text:
dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43379/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD61C" package="SOD61C">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43378/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD61D" package="SOD61D">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43381/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD61E" package="SOD61E">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43380/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="DO27-15" package="DO27-15">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43337/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD81" package="SOD81">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43363/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD84" package="SOD84">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43376/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="F126-10" package="F126-10">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43396/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="DO220S" package="DO220S">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43371/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="TO220H" package="TO220AC">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43370/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="TO220V" package="TO220ACS">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43373/3"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="G4-12" package="G4-12">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43368/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD83-12" package="SOD83-12">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43382/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SMB" package="SMB">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43404/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="P6-15" package="P6-15">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43343/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="C2673" package="C2673">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43390/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="C221B1A" package="C221B1A">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43391/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD80C" package="SOD80C">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43405/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="D-10" package="D-10">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43434/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="D-12.5" package="D-12.5">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43427/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="D-2.5" package="D-2.5">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43419/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="D-5" package="D-5">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43440/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="D-7.5" package="D-7.5">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43423/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD106-R" package="SOD106-R">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43424/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SMC" package="SMC">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43425/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD106-W" package="SOD106-W">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43431/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD106A-R" package="SOD106A-R">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43438/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD110-W" package="SOD110-W">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43428/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD110-R" package="SOD110-R">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43426/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD123" package="SOD123">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43420/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD323-R" package="SOD323-R">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43437/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SOD323-W" package="SOD323-W">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43418/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="GF1" package="GF1">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43422/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="MINIMELF" package="MINIMELF">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43429/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="MELF-MLL41" package="MELF-MLL41">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43444/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="MICROMELF-R" package="MICROMELF-R">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43436/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="MICROMELF-W" package="MICROMELF-W">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43441/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SC79_INFINEON" package="SC79_INFINEON">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43432/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="SCD80-INFINEON" package="SCD80_INFINEON">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43414/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="DO214AA" package="DO214AA">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43433/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="DO214AC" package="DO214AC">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43417/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="DO214BA" package="DO214BA">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43453/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="DO-214AC" package="DO-214AC">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43416/2"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="DO41-7.6" package="DO41-7.6">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:43421/1"/>
</package3dinstances>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
<library name="SparkFun-Aesthetics">
<description>
SparkFun Electronics' preferred foot prints

In this library you'll find non-functional items- supply symbols, logos, notations, frame blocks, etc.

We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com.

Licensing: Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/

You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage.</description>
<packages>
</packages>
<symbols>
<symbol name="DGND">
<wire x1="-1.905" y1="0" x2="1.905" y2="0" width="0.254" layer="94"/>
<text x="-2.54" y="-2.54" size="1.778" layer="96">>VALUE</text>
<pin name="GND" x="0" y="2.54" visible="off" length="short" direction="sup" rot="R270"/>
</symbol>
</symbols>
<devicesets>
<deviceset name="GND" prefix="GND">
<description>SUPPLY SYMBOL</description>
<gates>
<gate name="1" symbol="DGND" x="0" y="0"/>
</gates>
<devices>
<device name="">
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
</class>
</classes>
<parts>
<part name="CN1" library="homemade-hardware" deviceset="JST_2PIN_BATTERY" device="-SMT-HORIZ"/>
<part name="Q3" library="homemade-hardware" deviceset="TRANSISTOR-NPN" device="-SOT23" package3d_urn="urn:adsk.eagle:package:28738/2"/>
<part name="R1" library="homemade-hardware" deviceset="RESISTOR" device="0603" value="220"/>
<part name="R4" library="homemade-hardware" deviceset="RESISTOR" device="0603" value="10k"/>
<part name="MOTOR_LEFT_HEADER" library="homemade-hardware" deviceset="HEADER-2" device=""/>
<part name="R7" library="homemade-hardware" deviceset="RESISTOR" device="0603"/>
<part name="U$6" library="homemade-hardware" deviceset="HEADER-6" device=""/>
<part name="U$5" library="homemade-hardware" deviceset="HEADER-6" device=""/>
<part name="P+1" library="homemade-hardware" deviceset="VCC" device=""/>
<part name="GND1" library="homemade-hardware" deviceset="GND" device=""/>
<part name="GND3" library="homemade-hardware" deviceset="GND" device=""/>
<part name="P+3" library="homemade-hardware" deviceset="VCC" device=""/>
<part name="Q1" library="homemade-hardware" deviceset="TRANSISTOR-NPN" device="-SOT23" package3d_urn="urn:adsk.eagle:package:28738/2"/>
<part name="R3" library="homemade-hardware" deviceset="RESISTOR" device="0603" value="220"/>
<part name="R5" library="homemade-hardware" deviceset="RESISTOR" device="0603" value="10k"/>
<part name="MOTOR-CENTER-HEADER" library="homemade-hardware" deviceset="HEADER-2" device=""/>
<part name="GND4" library="homemade-hardware" deviceset="GND" device=""/>
<part name="P+4" library="homemade-hardware" deviceset="VCC" device=""/>
<part name="Q2" library="homemade-hardware" deviceset="TRANSISTOR-NPN" device="-SOT23" package3d_urn="urn:adsk.eagle:package:28738/2"/>
<part name="R6" library="homemade-hardware" deviceset="RESISTOR" device="0603" value="220"/>
<part name="R8" library="homemade-hardware" deviceset="RESISTOR" device="0603" value="10k"/>
<part name="MOTOR-RIGHT-HEADER" library="homemade-hardware" deviceset="HEADER-2" device=""/>
<part name="GND5" library="homemade-hardware" deviceset="GND" device=""/>
<part name="P+5" library="homemade-hardware" deviceset="VCC" device=""/>
<part name="P+6" library="homemade-hardware" deviceset="VCC" device=""/>
<part name="GND6" library="homemade-hardware" deviceset="GND" device=""/>
<part name="U$7" library="homemade-hardware" deviceset="HEADER-2" device=""/>
<part name="D4" library="diode" library_urn="urn:adsk.eagle:library:210" deviceset="DIODE-" device="SOD523" package3d_urn="urn:adsk.eagle:package:43410/1"/>
<part name="D5" library="diode" library_urn="urn:adsk.eagle:library:210" deviceset="DIODE-" device="SOD523" package3d_urn="urn:adsk.eagle:package:43410/1"/>
<part name="D6" library="diode" library_urn="urn:adsk.eagle:library:210" deviceset="DIODE-" device="SOD523" package3d_urn="urn:adsk.eagle:package:43410/1"/>
<part name="P+7" library="homemade-hardware" deviceset="VCC" device=""/>
<part name="GND7" library="homemade-hardware" deviceset="GND" device=""/>
<part name="U$1" library="homemade-hardware" deviceset="HEADER-2" device="" value="HEADER-2"/>
<part name="GND2" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND8" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND10" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="IC2" library="homemade-hardware" deviceset="LIPO_CHARGER" device="/OT"/>
<part name="C1" library="homemade-hardware" deviceset="CAP" device="-0805" value="10uF"/>
<part name="R2" library="homemade-hardware" deviceset="RESISTOR" device="-0805" value="150"/>
<part name="LED1" library="homemade-hardware" deviceset="LED" device="-0805" value="RED-2V/20mA"/>
<part name="LED2" library="homemade-hardware" deviceset="LED" device="-0805" value="GREEN-2V/20mA"/>
<part name="R9" library="homemade-hardware" deviceset="RESISTOR" device="-0805" value="150"/>
<part name="C2" library="homemade-hardware" deviceset="CAP" device="-0805" value="0.1uF"/>
<part name="R10" library="homemade-hardware" deviceset="RESISTOR" device="-0805" value="2k"/>
<part name="GND11" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="GND12" library="SparkFun-Aesthetics" deviceset="GND" device=""/>
<part name="JP1" library="homemade-hardware" deviceset="USB_CONN" device="-10118192-0001LF"/>
</parts>
<sheets>
<sheet>
<plain>
<wire x1="129" y1="211" x2="129" y2="-20.32" width="0.1524" layer="94" style="shortdash"/>
<wire x1="129" y1="-20.32" x2="130" y2="-20.32" width="0.1524" layer="94" style="shortdash"/>
<wire x1="6" y1="150" x2="126" y2="150" width="0.1524" layer="94" style="shortdash"/>
<wire x1="6" y1="68" x2="126" y2="68" width="0.1524" layer="94" style="shortdash"/>
<wire x1="126" y1="68" x2="126" y2="67" width="0.1524" layer="94" style="shortdash"/>
<text x="172" y="208" size="1.778" layer="94">Motor</text>
<text x="11" y="205" size="1.778" layer="94">Microcontroller</text>
<text x="14" y="61" size="1.778" layer="94">Power</text>
<text x="15" y="142" size="1.778" layer="94">Button</text>
<text x="264.16" y="7.62" size="1.778" layer="150">10k    =   100mA
4.7k   =   200mA
2k      =   500mA
1k      =   1000mA</text>
<text x="203.2" y="10.16" size="1.778" layer="91">charging = LOW
done = HIGH</text>
<frame x1="-2.54" y1="-22.86" x2="309.88" y2="226.06" columns="8" rows="5" layer="91"/>
<wire x1="131.9" y1="60.42" x2="304.8" y2="60.42" width="0.1524" layer="94" style="shortdash"/>
</plain>
<instances>
<instance part="CN1" gate="G$1" x="15.78" y="30.28" smashed="yes">
<attribute name="NAME" x="9.43" y="35.995" size="1.778" layer="95"/>
<attribute name="VALUE" x="9.43" y="25.2" size="1.778" layer="96"/>
</instance>
<instance part="Q3" gate="G$1" x="181.102" y="100.076" smashed="yes">
<attribute name="NAME" x="186.182" y="100.076" size="1.778" layer="95"/>
<attribute name="VALUE" x="170.942" y="105.156" size="1.778" layer="96"/>
</instance>
<instance part="R1" gate="G$1" x="163.322" y="100.076" smashed="yes" rot="R180">
<attribute name="NAME" x="167.132" y="98.5774" size="1.778" layer="95" rot="R180"/>
<attribute name="VALUE" x="167.132" y="103.378" size="1.778" layer="96" rot="R180"/>
</instance>
<instance part="R4" gate="G$1" x="173.482" y="92.456" smashed="yes" rot="R90">
<attribute name="NAME" x="171.9834" y="88.646" size="1.778" layer="95" rot="R90"/>
<attribute name="VALUE" x="176.784" y="88.646" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="MOTOR_LEFT_HEADER" gate="G$1" x="193.802" y="117.856" smashed="yes" rot="R180"/>
<instance part="R7" gate="G$1" x="59.182" y="101.496" smashed="yes" rot="R90">
<attribute name="NAME" x="57.6834" y="97.686" size="1.778" layer="95" rot="R90"/>
<attribute name="VALUE" x="62.484" y="97.686" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="U$6" gate="G$1" x="46.66" y="188.9" smashed="yes" rot="R180"/>
<instance part="U$5" gate="G$1" x="61.9" y="176.2" smashed="yes"/>
<instance part="P+1" gate="VCC" x="31.48" y="50.52" smashed="yes">
<attribute name="VALUE" x="28.94" y="47.98" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="GND1" gate="1" x="28.48" y="17.58" smashed="yes">
<attribute name="VALUE" x="25.94" y="15.04" size="1.778" layer="96"/>
</instance>
<instance part="GND3" gate="1" x="182.88" y="68.58" smashed="yes">
<attribute name="VALUE" x="180.34" y="66.04" size="1.778" layer="96"/>
</instance>
<instance part="P+3" gate="VCC" x="182.88" y="137.16" smashed="yes">
<attribute name="VALUE" x="180.34" y="134.62" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="Q1" gate="G$1" x="247.916153125" y="98.70095625" smashed="yes">
<attribute name="NAME" x="252.996153125" y="98.70095625" size="1.778" layer="95"/>
<attribute name="VALUE" x="237.756153125" y="103.78095625" size="1.778" layer="96"/>
</instance>
<instance part="R3" gate="G$1" x="230.136153125" y="98.70095625" smashed="yes" rot="R180">
<attribute name="NAME" x="233.946153125" y="97.20235625" size="1.778" layer="95" rot="R180"/>
<attribute name="VALUE" x="233.946153125" y="102.00295625" size="1.778" layer="96" rot="R180"/>
</instance>
<instance part="R5" gate="G$1" x="240.296153125" y="91.08095625" smashed="yes" rot="R90">
<attribute name="NAME" x="238.797553125" y="87.27095625" size="1.778" layer="95" rot="R90"/>
<attribute name="VALUE" x="243.598153125" y="87.27095625" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="MOTOR-CENTER-HEADER" gate="G$1" x="260.616153125" y="116.48095625" smashed="yes" rot="R180"/>
<instance part="GND4" gate="1" x="249.694153125" y="67.20495625" smashed="yes">
<attribute name="VALUE" x="247.154153125" y="64.66495625" size="1.778" layer="96"/>
</instance>
<instance part="P+4" gate="VCC" x="249.694153125" y="135.78495625" smashed="yes">
<attribute name="VALUE" x="247.154153125" y="133.24495625" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="Q2" gate="G$1" x="227.796153125" y="164.70095625" smashed="yes">
<attribute name="NAME" x="232.876153125" y="164.70095625" size="1.778" layer="95"/>
<attribute name="VALUE" x="217.636153125" y="169.78095625" size="1.778" layer="96"/>
</instance>
<instance part="R6" gate="G$1" x="210.016153125" y="164.70095625" smashed="yes" rot="R180">
<attribute name="NAME" x="213.826153125" y="163.20235625" size="1.778" layer="95" rot="R180"/>
<attribute name="VALUE" x="213.826153125" y="168.00295625" size="1.778" layer="96" rot="R180"/>
</instance>
<instance part="R8" gate="G$1" x="220.176153125" y="157.08095625" smashed="yes" rot="R90">
<attribute name="NAME" x="218.677553125" y="153.27095625" size="1.778" layer="95" rot="R90"/>
<attribute name="VALUE" x="223.478153125" y="153.27095625" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="MOTOR-RIGHT-HEADER" gate="G$1" x="240.496153125" y="182.48095625" smashed="yes" rot="R180"/>
<instance part="GND5" gate="1" x="229.574153125" y="133.20495625" smashed="yes">
<attribute name="VALUE" x="227.034153125" y="130.66495625" size="1.778" layer="96"/>
</instance>
<instance part="P+5" gate="VCC" x="229.574153125" y="201.78495625" smashed="yes">
<attribute name="VALUE" x="227.034153125" y="199.24495625" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="P+6" gate="VCC" x="60" y="132" smashed="yes">
<attribute name="VALUE" x="57.46" y="129.46" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="GND6" gate="1" x="59" y="91" smashed="yes">
<attribute name="VALUE" x="56.46" y="88.46" size="1.778" layer="96"/>
</instance>
<instance part="U$7" gate="G$1" x="36.962" y="42.496" smashed="yes" rot="R180"/>
<instance part="D4" gate="G$1" x="183.42" y="116.3" smashed="yes" rot="R90">
<attribute name="NAME" x="182.9374" y="118.84" size="1.778" layer="95" rot="R90"/>
<attribute name="VALUE" x="185.7314" y="118.84" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="D5" gate="G$1" x="250.16" y="115.68" smashed="yes" rot="R90">
<attribute name="NAME" x="249.6774" y="118.22" size="1.778" layer="95" rot="R90"/>
<attribute name="VALUE" x="252.4714" y="118.22" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="D6" gate="G$1" x="229.66" y="183.54" smashed="yes" rot="R90">
<attribute name="NAME" x="229.1774" y="186.08" size="1.778" layer="95" rot="R90"/>
<attribute name="VALUE" x="231.9714" y="186.08" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="P+7" gate="VCC" x="72" y="171" smashed="yes">
<attribute name="VALUE" x="69.46" y="168.46" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="GND7" gate="1" x="77" y="168" smashed="yes">
<attribute name="VALUE" x="74.46" y="165.46" size="1.778" layer="96"/>
</instance>
<instance part="U$1" gate="G$1" x="68" y="121" smashed="yes" rot="R180"/>
<instance part="GND2" gate="1" x="180.34" y="0" smashed="yes">
<attribute name="VALUE" x="177.8" y="-2.54" size="1.778" layer="96"/>
</instance>
<instance part="GND8" gate="1" x="170.18" y="50.8" smashed="yes" rot="R90">
<attribute name="VALUE" x="172.72" y="48.26" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="GND10" gate="1" x="254" y="0" smashed="yes">
<attribute name="VALUE" x="251.46" y="-2.54" size="1.778" layer="96"/>
</instance>
<instance part="IC2" gate="G$1" x="238.76" y="20.32" smashed="yes">
<attribute name="NAME" x="231.14" y="10.16" size="1.778" layer="95"/>
</instance>
<instance part="C1" gate="G$1" x="208.28" y="30.48" smashed="yes">
<attribute name="NAME" x="209.804" y="33.401" size="1.778" layer="95"/>
<attribute name="VALUE" x="209.804" y="28.321" size="1.778" layer="96"/>
</instance>
<instance part="R2" gate="G$1" x="187.96" y="15.24" smashed="yes">
<attribute name="NAME" x="184.15" y="16.7386" size="1.778" layer="95"/>
<attribute name="VALUE" x="184.15" y="11.938" size="1.778" layer="96"/>
</instance>
<instance part="LED1" gate="G$1" x="195.58" y="35.56" smashed="yes">
<attribute name="NAME" x="178.308" y="32.004" size="1.778" layer="95"/>
<attribute name="VALUE" x="178.308" y="29.845" size="1.778" layer="96"/>
</instance>
<instance part="LED2" gate="G$1" x="180.34" y="10.16" smashed="yes">
<attribute name="NAME" x="157.988" y="6.604" size="1.778" layer="95"/>
<attribute name="VALUE" x="157.988" y="4.445" size="1.778" layer="96"/>
</instance>
<instance part="R9" gate="G$1" x="195.58" y="22.86" smashed="yes" rot="R90">
<attribute name="NAME" x="194.31" y="23.9014" size="1.778" layer="95" rot="R180"/>
<attribute name="VALUE" x="201.93" y="23.622" size="1.778" layer="96" rot="R180"/>
</instance>
<instance part="C2" gate="G$1" x="218.44" y="30.48" smashed="yes">
<attribute name="NAME" x="219.964" y="33.401" size="1.778" layer="95"/>
<attribute name="VALUE" x="219.964" y="28.321" size="1.778" layer="96"/>
</instance>
<instance part="R10" gate="G$1" x="261.62" y="15.24" smashed="yes" rot="R90"/>
<instance part="GND11" gate="1" x="218.44" y="22.86" smashed="yes">
<attribute name="VALUE" x="215.9" y="20.32" size="1.778" layer="96"/>
</instance>
<instance part="GND12" gate="1" x="208.28" y="22.86" smashed="yes">
<attribute name="VALUE" x="205.74" y="20.32" size="1.778" layer="96"/>
</instance>
<instance part="JP1" gate="G$1" x="154.94" y="40.64" smashed="yes" rot="R180"/>
</instances>
<busses>
</busses>
<nets>
<net name="N$4" class="0">
<segment>
<pinref part="R1" gate="G$1" pin="1"/>
<pinref part="Q3" gate="G$1" pin="B"/>
<wire x1="168.402" y1="100.076" x2="178.562" y2="100.076" width="0.1524" layer="91"/>
<pinref part="R4" gate="G$1" pin="2"/>
<wire x1="173.482" y1="97.536" x2="168.402" y2="97.536" width="0.1524" layer="91"/>
<wire x1="168.402" y1="97.536" x2="168.402" y2="100.076" width="0.1524" layer="91"/>
<junction x="168.402" y="100.076"/>
</segment>
</net>
<net name="GND" class="0">
<segment>
<pinref part="CN1" gate="G$1" pin="1"/>
<wire x1="13.24" y1="32.82" x2="25.94" y2="32.82" width="0.1524" layer="91"/>
<wire x1="25.94" y1="32.82" x2="25.94" y2="25.2" width="0.1524" layer="91"/>
<wire x1="25.94" y1="25.2" x2="28.48" y2="25.2" width="0.1524" layer="91"/>
<pinref part="GND1" gate="1" pin="GND"/>
<wire x1="28.48" y1="25.2" x2="28.48" y2="20.12" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="Q3" gate="G$1" pin="E"/>
<pinref part="GND3" gate="1" pin="GND"/>
<wire x1="183.642" y1="94.996" x2="182.88" y2="94.996" width="0.1524" layer="91"/>
<wire x1="182.88" y1="94.996" x2="182.88" y2="86.36" width="0.1524" layer="91"/>
<pinref part="R4" gate="G$1" pin="1"/>
<wire x1="182.88" y1="86.36" x2="182.88" y2="71.12" width="0.1524" layer="91"/>
<wire x1="173.482" y1="87.376" x2="173.482" y2="86.36" width="0.1524" layer="91"/>
<wire x1="173.482" y1="86.36" x2="182.88" y2="86.36" width="0.1524" layer="91"/>
<junction x="182.88" y="86.36"/>
</segment>
<segment>
<pinref part="Q1" gate="G$1" pin="E"/>
<pinref part="GND4" gate="1" pin="GND"/>
<wire x1="250.456153125" y1="93.62095625" x2="249.694153125" y2="93.62095625" width="0.1524" layer="91"/>
<wire x1="249.694153125" y1="93.62095625" x2="249.694153125" y2="84.98495625" width="0.1524" layer="91"/>
<pinref part="R5" gate="G$1" pin="1"/>
<wire x1="249.694153125" y1="84.98495625" x2="249.694153125" y2="69.74495625" width="0.1524" layer="91"/>
<wire x1="240.296153125" y1="86.00095625" x2="240.296153125" y2="84.98495625" width="0.1524" layer="91"/>
<wire x1="240.296153125" y1="84.98495625" x2="249.694153125" y2="84.98495625" width="0.1524" layer="91"/>
<junction x="249.694153125" y="84.98495625"/>
</segment>
<segment>
<pinref part="Q2" gate="G$1" pin="E"/>
<pinref part="GND5" gate="1" pin="GND"/>
<wire x1="230.336153125" y1="159.62095625" x2="229.574153125" y2="159.62095625" width="0.1524" layer="91"/>
<wire x1="229.574153125" y1="159.62095625" x2="229.574153125" y2="150.98495625" width="0.1524" layer="91"/>
<pinref part="R8" gate="G$1" pin="1"/>
<wire x1="229.574153125" y1="150.98495625" x2="229.574153125" y2="135.74495625" width="0.1524" layer="91"/>
<wire x1="220.176153125" y1="152.00095625" x2="220.176153125" y2="150.98495625" width="0.1524" layer="91"/>
<wire x1="220.176153125" y1="150.98495625" x2="229.574153125" y2="150.98495625" width="0.1524" layer="91"/>
<junction x="229.574153125" y="150.98495625"/>
</segment>
<segment>
<pinref part="GND6" gate="1" pin="GND"/>
<pinref part="R7" gate="G$1" pin="1"/>
<wire x1="59" y1="93.54" x2="59.182" y2="93.54" width="0.1524" layer="91"/>
<wire x1="59.182" y1="93.54" x2="59.182" y2="96.416" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="U$5" gate="G$1" pin="2"/>
<wire x1="66.98" y1="178.74" x2="70" y2="178.74" width="0.1524" layer="91"/>
<wire x1="70" y1="178.74" x2="70" y2="176" width="0.1524" layer="91"/>
<wire x1="70" y1="176" x2="77" y2="176" width="0.1524" layer="91"/>
<wire x1="77" y1="176" x2="77" y2="172" width="0.1524" layer="91"/>
<pinref part="GND7" gate="1" pin="GND"/>
<wire x1="77" y1="172" x2="77" y2="171" width="0.1524" layer="91"/>
<wire x1="77" y1="170.54" x2="77" y2="171" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="GND2" gate="1" pin="GND"/>
<wire x1="180.34" y1="5.08" x2="180.34" y2="2.54" width="0.1524" layer="91"/>
<pinref part="LED2" gate="G$1" pin="C"/>
</segment>
<segment>
<pinref part="GND10" gate="1" pin="GND"/>
<wire x1="254" y1="15.24" x2="254" y2="10.16" width="0.1524" layer="91"/>
<wire x1="254" y1="10.16" x2="254" y2="2.54" width="0.1524" layer="91"/>
<wire x1="261.62" y1="10.16" x2="254" y2="10.16" width="0.1524" layer="91"/>
<junction x="254" y="10.16"/>
<pinref part="IC2" gate="G$1" pin="VSS"/>
<pinref part="R10" gate="G$1" pin="1"/>
</segment>
<segment>
<wire x1="218.44" y1="27.94" x2="218.44" y2="25.4" width="0.1524" layer="91"/>
<pinref part="C2" gate="G$1" pin="2"/>
<pinref part="GND11" gate="1" pin="GND"/>
</segment>
<segment>
<wire x1="208.28" y1="27.94" x2="208.28" y2="25.4" width="0.1524" layer="91"/>
<pinref part="C1" gate="G$1" pin="2"/>
<pinref part="GND12" gate="1" pin="GND"/>
</segment>
<segment>
<pinref part="JP1" gate="G$1" pin="GND"/>
<pinref part="GND8" gate="1" pin="GND"/>
<wire x1="160.02" y1="45.72" x2="167.64" y2="45.72" width="0.1524" layer="91"/>
<wire x1="167.64" y1="45.72" x2="167.64" y2="50.8" width="0.1524" layer="91"/>
</segment>
</net>
<net name="VCC" class="0">
<segment>
<pinref part="P+3" gate="VCC" pin="VCC"/>
<pinref part="MOTOR_LEFT_HEADER" gate="G$1" pin="1"/>
<wire x1="182.88" y1="132.08" x2="182.88" y2="134.62" width="0.1524" layer="91"/>
<wire x1="188.722" y1="117.856" x2="188.722" y2="132.08" width="0.1524" layer="91"/>
<wire x1="188.722" y1="132.08" x2="182.88" y2="132.08" width="0.1524" layer="91"/>
<pinref part="D4" gate="G$1" pin="C"/>
<wire x1="182.88" y1="134.62" x2="182.88" y2="118.84" width="0.1524" layer="91"/>
<wire x1="182.88" y1="118.84" x2="183.42" y2="118.84" width="0.1524" layer="91"/>
<junction x="182.88" y="134.62"/>
</segment>
<segment>
<pinref part="P+4" gate="VCC" pin="VCC"/>
<pinref part="MOTOR-CENTER-HEADER" gate="G$1" pin="1"/>
<wire x1="249.694153125" y1="130.70495625" x2="249.694153125" y2="133.24495625" width="0.1524" layer="91"/>
<wire x1="255.536153125" y1="116.48095625" x2="255.536153125" y2="130.70495625" width="0.1524" layer="91"/>
<wire x1="255.536153125" y1="130.70495625" x2="249.694153125" y2="130.70495625" width="0.1524" layer="91"/>
<pinref part="D5" gate="G$1" pin="C"/>
<wire x1="250.16" y1="118.22" x2="250.16" y2="133.24495625" width="0.1524" layer="91"/>
<wire x1="250.16" y1="133.24495625" x2="249.694153125" y2="133.24495625" width="0.1524" layer="91"/>
<junction x="249.694153125" y="133.24495625"/>
</segment>
<segment>
<pinref part="P+5" gate="VCC" pin="VCC"/>
<pinref part="MOTOR-RIGHT-HEADER" gate="G$1" pin="1"/>
<wire x1="229.574153125" y1="196.70495625" x2="229.574153125" y2="199.24495625" width="0.1524" layer="91"/>
<wire x1="235.416153125" y1="182.48095625" x2="235.416153125" y2="196.70495625" width="0.1524" layer="91"/>
<wire x1="235.416153125" y1="196.70495625" x2="229.574153125" y2="196.70495625" width="0.1524" layer="91"/>
<pinref part="D6" gate="G$1" pin="C"/>
<wire x1="229.66" y1="186.08" x2="229.66" y2="199.24495625" width="0.1524" layer="91"/>
<wire x1="229.66" y1="199.24495625" x2="229.574153125" y2="199.24495625" width="0.1524" layer="91"/>
<junction x="229.574153125" y="199.24495625"/>
</segment>
<segment>
<pinref part="U$7" gate="G$1" pin="1"/>
<pinref part="P+1" gate="VCC" pin="VCC"/>
<wire x1="31.882" y1="42.496" x2="31.882" y2="47.98" width="0.1524" layer="91"/>
<wire x1="31.882" y1="47.98" x2="31.48" y2="47.98" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="U$5" gate="G$1" pin="1"/>
<wire x1="66.98" y1="176.2" x2="66.98" y2="162" width="0.1524" layer="91"/>
<wire x1="66.98" y1="162" x2="72" y2="162" width="0.1524" layer="91"/>
<wire x1="72" y1="162" x2="72" y2="168.46" width="0.1524" layer="91"/>
<pinref part="P+7" gate="VCC" pin="VCC"/>
</segment>
<segment>
<pinref part="U$1" gate="G$1" pin="1"/>
<wire x1="62.92" y1="121" x2="60" y2="121" width="0.1524" layer="91"/>
<pinref part="P+6" gate="VCC" pin="VCC"/>
<wire x1="60" y1="121" x2="60" y2="129.46" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$1" class="0">
<segment>
<pinref part="Q3" gate="G$1" pin="C"/>
<pinref part="MOTOR_LEFT_HEADER" gate="G$1" pin="2"/>
<wire x1="188.722" y1="115.316" x2="187.96" y2="115.316" width="0.1524" layer="91"/>
<wire x1="187.96" y1="115.316" x2="187.96" y2="105.156" width="0.1524" layer="91"/>
<wire x1="187.96" y1="105.156" x2="183.642" y2="105.156" width="0.1524" layer="91"/>
<pinref part="D4" gate="G$1" pin="A"/>
<wire x1="183.42" y1="113.76" x2="183.42" y2="105.156" width="0.1524" layer="91"/>
<wire x1="183.42" y1="105.156" x2="183.642" y2="105.156" width="0.1524" layer="91"/>
<junction x="183.642" y="105.156"/>
</segment>
</net>
<net name="N$2" class="0">
<segment>
<pinref part="R3" gate="G$1" pin="1"/>
<pinref part="Q1" gate="G$1" pin="B"/>
<wire x1="235.216153125" y1="98.70095625" x2="245.376153125" y2="98.70095625" width="0.1524" layer="91"/>
<pinref part="R5" gate="G$1" pin="2"/>
<wire x1="240.296153125" y1="96.16095625" x2="235.216153125" y2="96.16095625" width="0.1524" layer="91"/>
<wire x1="235.216153125" y1="96.16095625" x2="235.216153125" y2="98.70095625" width="0.1524" layer="91"/>
<junction x="235.216153125" y="98.70095625"/>
</segment>
</net>
<net name="N$3" class="0">
<segment>
<pinref part="Q1" gate="G$1" pin="C"/>
<pinref part="MOTOR-CENTER-HEADER" gate="G$1" pin="2"/>
<wire x1="255.536153125" y1="113.94095625" x2="254.774153125" y2="113.94095625" width="0.1524" layer="91"/>
<wire x1="254.774153125" y1="113.94095625" x2="254.774153125" y2="103.78095625" width="0.1524" layer="91"/>
<wire x1="254.774153125" y1="103.78095625" x2="250.456153125" y2="103.78095625" width="0.1524" layer="91"/>
<pinref part="D5" gate="G$1" pin="A"/>
<wire x1="250.16" y1="113.14" x2="250.16" y2="103.78095625" width="0.1524" layer="91"/>
<wire x1="250.16" y1="103.78095625" x2="250.456153125" y2="103.78095625" width="0.1524" layer="91"/>
<junction x="250.456153125" y="103.78095625"/>
</segment>
</net>
<net name="N$5" class="0">
<segment>
<pinref part="R6" gate="G$1" pin="1"/>
<pinref part="Q2" gate="G$1" pin="B"/>
<wire x1="215.096153125" y1="164.70095625" x2="225.256153125" y2="164.70095625" width="0.1524" layer="91"/>
<pinref part="R8" gate="G$1" pin="2"/>
<wire x1="220.176153125" y1="162.16095625" x2="215.096153125" y2="162.16095625" width="0.1524" layer="91"/>
<wire x1="215.096153125" y1="162.16095625" x2="215.096153125" y2="164.70095625" width="0.1524" layer="91"/>
<junction x="215.096153125" y="164.70095625"/>
</segment>
</net>
<net name="N$6" class="0">
<segment>
<pinref part="Q2" gate="G$1" pin="C"/>
<pinref part="MOTOR-RIGHT-HEADER" gate="G$1" pin="2"/>
<wire x1="235.416153125" y1="179.94095625" x2="234.654153125" y2="179.94095625" width="0.1524" layer="91"/>
<wire x1="234.654153125" y1="179.94095625" x2="234.654153125" y2="169.78095625" width="0.1524" layer="91"/>
<wire x1="234.654153125" y1="169.78095625" x2="230.336153125" y2="169.78095625" width="0.1524" layer="91"/>
<pinref part="D6" gate="G$1" pin="A"/>
<wire x1="229.66" y1="181" x2="229.66" y2="169.78095625" width="0.1524" layer="91"/>
<wire x1="229.66" y1="169.78095625" x2="230.336153125" y2="169.78095625" width="0.1524" layer="91"/>
<junction x="230.336153125" y="169.78095625"/>
</segment>
</net>
<net name="MOTOR-3" class="0">
<segment>
<pinref part="U$5" gate="G$1" pin="3"/>
<wire x1="66.98" y1="181.28" x2="72" y2="181.28" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="R6" gate="G$1" pin="2"/>
<wire x1="204.936153125" y1="164.70095625" x2="196" y2="164.70095625" width="0.1524" layer="91"/>

</segment>
</net>
<net name="MOTOR-1" class="0">
<segment>
<pinref part="U$6" gate="G$1" pin="4"/>
<wire x1="41.58" y1="181.28" x2="41.58" y2="181" width="0.1524" layer="91"/>
<wire x1="41.58" y1="181" x2="37" y2="181" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="R1" gate="G$1" pin="2"/>
<wire x1="158.242" y1="100.076" x2="154.94" y2="100.076" width="0.1524" layer="91"/>

</segment>
</net>
<net name="MOTOR-2" class="0">
<segment>
<pinref part="U$6" gate="G$1" pin="2"/>
<wire x1="41.58" y1="186.36" x2="41.58" y2="187" width="0.1524" layer="91"/>
<wire x1="41.58" y1="187" x2="36" y2="187" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="R3" gate="G$1" pin="2"/>
<wire x1="225.056153125" y1="98.70095625" x2="219" y2="98.70095625" width="0.1524" layer="91"/>

</segment>
</net>
<net name="BUTTON" class="0">
<segment>
<pinref part="U$6" gate="G$1" pin="5"/>
<wire x1="41.58" y1="178.74" x2="38" y2="178.74" width="0.1524" layer="91"/>
<wire x1="38" y1="178.74" x2="38" y2="177" width="0.1524" layer="91"/>
<wire x1="38" y1="177" x2="36" y2="177" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="U$1" gate="G$1" pin="2"/>
<wire x1="62.92" y1="118.46" x2="59" y2="118.46" width="0.1524" layer="91"/>
<pinref part="R7" gate="G$1" pin="2"/>
<wire x1="59" y1="118.46" x2="59" y2="113" width="0.1524" layer="91"/>
<wire x1="59" y1="111" x2="59" y2="106.576" width="0.1524" layer="91"/>
<wire x1="59" y1="106.576" x2="59.182" y2="106.576" width="0.1524" layer="91"/>
<wire x1="59" y1="113" x2="59" y2="111" width="0.1524" layer="91"/>
<wire x1="59" y1="111" x2="49" y2="111" width="0.1524" layer="91"/>

</segment>
</net>
<net name="VIN-USB" class="0">
<segment>
<pinref part="CN1" gate="G$1" pin="2"/>
<pinref part="U$7" gate="G$1" pin="2"/>
<wire x1="13.24" y1="30.28" x2="31.882" y2="30.28" width="0.1524" layer="91"/>
<wire x1="31.882" y1="30.28" x2="31.882" y2="39.956" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="IC2" gate="G$1" pin="VBAT"/>
<wire x1="254" y1="25.4" x2="259.08" y2="25.4" width="0.1524" layer="91"/>

</segment>
</net>
<net name="CURRENT-CONTROL" class="0">
<segment>
<wire x1="254" y1="20.32" x2="261.62" y2="20.32" width="0.1524" layer="91"/>
<pinref part="IC2" gate="G$1" pin="PROG"/>
<pinref part="R10" gate="G$1" pin="2"/>
</segment>
</net>
<net name="STATUS" class="0">
<segment>
<wire x1="195.58" y1="17.78" x2="195.58" y2="15.24" width="0.1524" layer="91"/>
<wire x1="193.04" y1="15.24" x2="195.58" y2="15.24" width="0.1524" layer="91"/>
<junction x="195.58" y="15.24"/>
<wire x1="195.58" y1="15.24" x2="226.06" y2="15.24" width="0.1524" layer="91"/>
<pinref part="IC2" gate="G$1" pin="STAT"/>
<pinref part="R9" gate="G$1" pin="1"/>
<pinref part="R2" gate="G$1" pin="2"/>
</segment>
</net>
<net name="N$8" class="0">
<segment>
<wire x1="195.58" y1="27.94" x2="195.58" y2="30.48" width="0.1524" layer="91"/>
<pinref part="LED1" gate="G$1" pin="C"/>
<pinref part="R9" gate="G$1" pin="2"/>
</segment>
</net>
<net name="N$9" class="0">
<segment>
<wire x1="182.88" y1="15.24" x2="180.34" y2="15.24" width="0.1524" layer="91"/>
<wire x1="180.34" y1="15.24" x2="180.34" y2="12.7" width="0.1524" layer="91"/>
<pinref part="LED2" gate="G$1" pin="A"/>
<pinref part="R2" gate="G$1" pin="1"/>
</segment>
</net>
<net name="5V" class="0">
<segment>
<wire x1="195.58" y1="40.64" x2="195.58" y2="38.1" width="0.1524" layer="91"/>
<wire x1="167.64" y1="40.64" x2="195.58" y2="40.64" width="0.1524" layer="91"/>
<junction x="195.58" y="40.64"/>
<wire x1="195.58" y1="40.64" x2="208.28" y2="40.64" width="0.1524" layer="91"/>
<wire x1="208.28" y1="40.64" x2="218.44" y2="40.64" width="0.1524" layer="91"/>
<wire x1="218.44" y1="40.64" x2="226.06" y2="40.64" width="0.1524" layer="91"/>
<wire x1="226.06" y1="40.64" x2="226.06" y2="25.4" width="0.1524" layer="91"/>
<wire x1="218.44" y1="35.56" x2="218.44" y2="40.64" width="0.1524" layer="91"/>
<junction x="218.44" y="40.64"/>
<wire x1="208.28" y1="35.56" x2="208.28" y2="40.64" width="0.1524" layer="91"/>
<junction x="208.28" y="40.64"/>
<pinref part="IC2" gate="G$1" pin="VDD"/>
<pinref part="C1" gate="G$1" pin="1"/>
<pinref part="C2" gate="G$1" pin="1"/>
<pinref part="LED1" gate="G$1" pin="A"/>
<pinref part="JP1" gate="G$1" pin="VBUS"/>
<wire x1="160.02" y1="43.18" x2="167.64" y2="43.18" width="0.1524" layer="91"/>
<wire x1="167.64" y1="43.18" x2="167.64" y2="40.64" width="0.1524" layer="91"/>
</segment>
</net>
</nets>
</sheet>
</sheets>
</schematic>
</drawing>
<compatibility>
<note version="6.3" minversion="6.2.2" severity="warning">
Since Version 6.2.2 text objects can contain more than one line,
which will not be processed correctly with this version.
</note>
<note version="8.2" severity="warning">
Since Version 8.2, EAGLE supports online libraries. The ids
of those online libraries will not be understood (or retained)
with this version.
</note>
<note version="8.3" severity="warning">
Since Version 8.3, EAGLE supports URNs for individual library
assets (packages, symbols, and devices). The URNs of those assets
will not be understood (or retained) with this version.
</note>
<note version="8.3" severity="warning">
Since Version 8.3, EAGLE supports the association of 3D packages
with devices in libraries, schematics, and board files. Those 3D
packages will not be understood (or retained) with this version.
</note>
</compatibility>
</eagle>

license_type: permissive

branch_name: refs/heads/master


text:
import { expect } from 'chai';
import * as express from 'express';

import * as options from '../../../src/v2/options';
import * as https from '../../../src/v2/providers/https';
import {
  expectedResponseHeaders,
  MockRequest,
} from '../../fixtures/mockrequest';
import { FULL_OPTIONS, FULL_TRIGGER } from './helpers';

/**
 * RunHandlerResult contains the data from an express.Response.
 */
interface RunHandlerResult {
  status: number;
  headers: { [name: string]: string };
  body: any;
}

function runHandler(
  handler: express.Handler,
  request: https.Request
): Promise<RunHandlerResult> {
  return new Promise((resolve, reject) => {
    // MockResponse mocks an express.Response.
    // This class lives here so it can reference resolve and reject.
    class MockResponse {
      private statusCode = 0;
      private headers: { [name: string]: string } = {};
      private callback: Function;

      public status(code: number) {
        this.statusCode = code;
        return this;
      }

      // Headers are only set by the cors handler.
      public setHeader(name: string, value: string) {
        this.headers[name] = value;
      }

      public getHeader(name: string): string {
        return this.headers[name];
      }

      public send(body: any) {
        resolve({
          status: this.statusCode,
          headers: this.headers,
          body,
        });
        if (this.callback) {
          this.callback();
        }
      }

      public end() {
        this.send(undefined);
      }

      public on(event: string, callback: Function) {
        if (event !== 'finish') {
          throw new Error('MockResponse only implements the finish event');
        }
        this.callback = callback;
      }
    }

    const response = new MockResponse();
    handler(request, response as any, () => undefined);
  });
}

describe('onRequest', () => {
  beforeEach(() => {
    options.setGlobalOptions({});
    process.env.GCLOUD_PROJECT = 'aProject';
  });

  afterEach(() => {
    delete process.env.GCLOUD_PROJECT;
  });

  it('should return a minimal trigger with appropriate values', () => {
    const result = https.onRequest((req, res) => {
      res.send(200);
    });
    expect(result.__trigger).to.deep.equal({
      apiVersion: 2,
      platform: 'gcfv2',
      httpsTrigger: {
        allowInsecure: false,
      },
      labels: {},
    });
  });

  it('should create a complex trigger with appropriate values', () => {
    const result = https.onRequest(
      {
        ...FULL_OPTIONS,
        region: ['us-west1', 'us-central1'],
        invoker: ['service-account1@', 'service-account2@'],
      },
      (req, res) => {
        res.send(200);
      }
    );
    expect(result.__trigger).to.deep.equal({
      ...FULL_TRIGGER,
      httpsTrigger: {
        allowInsecure: false,
        invoker: ['service-account1@', 'service-account2@'],
      },
      regions: ['us-west1', 'us-central1'],
    });
  });

  it('should merge options and globalOptions', () => {
    options.setGlobalOptions({
      concurrency: 20,
      region: 'europe-west1',
      minInstances: 1,
      invoker: 'public',
    });

    const result = https.onRequest(
      {
        region: ['us-west1', 'us-central1'],
        minInstances: 3,
        invoker: 'private',
      },
      (req, res) => {
        res.send(200);
      }
    );

    expect(result.__trigger).to.deep.equal({
      apiVersion: 2,
      platform: 'gcfv2',
      httpsTrigger: {
        allowInsecure: false,
        invoker: ['private'],
      },
      concurrency: 20,
      minInstances: 3,
      regions: ['us-west1', 'us-central1'],
      labels: {},
    });
  });

  it('should be an express handler', async () => {
    const func = https.onRequest((req, res) => {
      res.send('Works');
    });

    const req = new MockRequest(
      {
        data: {},
      },
      {
        'content-type': 'application/json',
        origin: 'example.com',
      }
    );
    req.method = 'POST';

    const resp = await runHandler(func, req as any);
    expect(resp.body).to.equal('Works');
  });

  it('should enforce CORS options', async () => {
    const func = https.onRequest({ cors: 'example.com' }, (req, res) => {
      throw new Error('Should not reach here for OPTIONS preflight');
    });

    const req = new MockRequest(
      {
        data: {},
      },
      {
        'Access-Control-Request-Method': 'POST',
        'Access-Control-Request-Headers': 'origin',
        Origin: 'example.com',
      }
    );
    req.method = 'OPTIONS';

    const resp = await runHandler(func, req as any);
    expect(resp.status).to.equal(204);
    expect(resp.body).to.be.undefined;
    expect(resp.headers).to.deep.equal({
      'Access-Control-Allow-Methods': 'GET,HEAD,PUT,PATCH,POST,DELETE',
      'Access-Control-Allow-Origin': 'example.com',
      'Content-Length': '0',
      Vary: 'Origin, Access-Control-Request-Headers',
    });
  });
});

describe('onCall', () => {
  beforeEach(() => {
    options.setGlobalOptions({});
    process.env.GCLOUD_PROJECT = 'aProject';
  });

  afterEach(() => {
    delete process.env.GCLOUD_PROJECT;
  });

  it('should return a minimal trigger with appropriate values', () => {
    const result = https.onCall((request) => 42);
    expect(result.__trigger).to.deep.equal({
      apiVersion: 2,
      platform: 'gcfv2',
      httpsTrigger: {
        allowInsecure: false,
      },
      labels: {
        'deployment-callable': 'true',
      },
    });
  });

  it('should create a complex trigger with appropriate values', () => {
    const result = https.onCall(FULL_OPTIONS, (request) => 42);
    expect(result.__trigger).to.deep.equal({
      ...FULL_TRIGGER,
      httpsTrigger: {
        allowInsecure: false,
      },
      labels: {
        ...FULL_TRIGGER.labels,
        'deployment-callable': 'true',
      },
    });
  });

  it('should merge options and globalOptions', () => {
    options.setGlobalOptions({
      concurrency: 20,
      region: 'europe-west1',
      minInstances: 1,
    });

    const result = https.onCall(
      {
        region: ['us-west1', 'us-central1'],
        minInstances: 3,
      },
      (request) => 42
    );

    expect(result.__trigger).to.deep.equal({
      apiVersion: 2,
      platform: 'gcfv2',
      httpsTrigger: {
        allowInsecure: false,
      },
      concurrency: 20,
      minInstances: 3,
      regions: ['us-west1', 'us-central1'],
      labels: {
        'deployment-callable': 'true',
      },
    });
  });

  it('has a .run method', () => {
    const cf = https.onCall((request) => {
      return request;
    });

    const request: any = {
      data: 'data',
      instanceIdToken: 'token',
      auth: {
        uid: 'abc',
        token: 'token',
      },
    };
    expect(cf.run(request)).to.deep.equal(request);
  });

  it('should be an express handler', async () => {
    const func = https.onCall((request) => 42);

    const req = new MockRequest(
      {
        data: {},
      },
      {
        'content-type': 'application/json',
        origin: 'example.com',
      }
    );
    req.method = 'POST';

    const resp = await runHandler(func, req as any);
    expect(resp.body).to.deep.equal({ result: 42 });
  });

  it('should enforce CORS options', async () => {
    const func = https.onCall({ cors: 'example.com' }, (request) => {
      throw new Error('Should not reach here for OPTIONS preflight');
    });

    const req = new MockRequest(
      {
        data: {},
      },
      {
        'Access-Control-Request-Method': 'POST',
        'Access-Control-Request-Headers': 'origin',
        Origin: 'example.com',
      }
    );
    req.method = 'OPTIONS';

    const resp = await runHandler(func, req as any);
    expect(resp.status).to.equal(204);
    expect(resp.body).to.be.undefined;
    expect(resp.headers).to.deep.equal({
      'Access-Control-Allow-Methods': 'POST',
      'Access-Control-Allow-Origin': 'example.com',
      'Content-Length': '0',
      Vary: 'Origin, Access-Control-Request-Headers',
    });
  });

  it('adds CORS headers', async () => {
    const func = https.onCall((request) => 42);
    const req = new MockRequest(
      {
        data: {},
      },
      {
        'content-type': 'application/json',
        origin: 'example.com',
      }
    );
    req.method = 'POST';

    const response = await runHandler(func, req as any);

    expect(response.status).to.equal(200);
    expect(response.body).to.be.deep.equal({ result: 42 });
    expect(response.headers).to.deep.equal(expectedResponseHeaders);
  });

  // These tests pass if the code transpiles
  it('allows desirable syntax', () => {
    https.onCall<string, string>(
      (request: https.CallableRequest<string>) => `hello, ${request.data}!`
    );
    https.onCall<string>(
      (request: https.CallableRequest<string>) => `hello, ${request.data}!`
    );
    https.onCall<string>(
      (request: https.CallableRequest) => `hello, ${request.data}!`
    );
    https.onCall(
      (request: https.CallableRequest<string>) => `Hello, ${request.data}`
    );
    https.onCall((request: https.CallableRequest) => `Hello, ${request.data}`);
  });
});

license: MIT

gha_license_id: MIT

extension: ts


text:
//go:build app_v1

package simapp

import (
	"encoding/json"
	"fmt"
	"io"
	"os"
	"path/filepath"

	autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
	reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
	"cosmossdk.io/client/v2/autocli"
	"cosmossdk.io/core/appmodule"
	"cosmossdk.io/log"
	storetypes "cosmossdk.io/store/types"
	"cosmossdk.io/x/circuit"
	circuitkeeper "cosmossdk.io/x/circuit/keeper"
	circuittypes "cosmossdk.io/x/circuit/types"
	"cosmossdk.io/x/evidence"
	evidencekeeper "cosmossdk.io/x/evidence/keeper"
	evidencetypes "cosmossdk.io/x/evidence/types"
	"cosmossdk.io/x/feegrant"
	feegrantkeeper "cosmossdk.io/x/feegrant/keeper"
	feegrantmodule "cosmossdk.io/x/feegrant/module"
	"cosmossdk.io/x/nft"
	nftkeeper "cosmossdk.io/x/nft/keeper"
	nftmodule "cosmossdk.io/x/nft/module"
	"cosmossdk.io/x/tx/signing"
	"cosmossdk.io/x/upgrade"
	upgradekeeper "cosmossdk.io/x/upgrade/keeper"
	upgradetypes "cosmossdk.io/x/upgrade/types"
	abci "github.com/cometbft/cometbft/abci/types"
	dbm "github.com/cosmos/cosmos-db"
	"github.com/cosmos/cosmos-sdk/baseapp"
	"github.com/cosmos/cosmos-sdk/client"
	"github.com/cosmos/cosmos-sdk/client/flags"
	"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
	nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
	"github.com/cosmos/cosmos-sdk/codec"
	"github.com/cosmos/cosmos-sdk/codec/address"
	"github.com/cosmos/cosmos-sdk/codec/types"
	"github.com/cosmos/cosmos-sdk/runtime"
	runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
	"github.com/cosmos/cosmos-sdk/server"
	"github.com/cosmos/cosmos-sdk/server/api"
	"github.com/cosmos/cosmos-sdk/server/config"
	servertypes "github.com/cosmos/cosmos-sdk/server/types"
	"github.com/cosmos/cosmos-sdk/std"
	testdata_pulsar "github.com/cosmos/cosmos-sdk/testutil/testdata/testpb"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/cosmos/cosmos-sdk/types/module"
	"github.com/cosmos/cosmos-sdk/types/msgservice"
	"github.com/cosmos/cosmos-sdk/version"
	"github.com/cosmos/cosmos-sdk/x/auth"
	"github.com/cosmos/cosmos-sdk/x/auth/ante"
	authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
	authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
	"github.com/cosmos/cosmos-sdk/x/auth/posthandler"
	authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation"
	"github.com/cosmos/cosmos-sdk/x/auth/tx"
	authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
	authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
	"github.com/cosmos/cosmos-sdk/x/auth/vesting"
	vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
	"github.com/cosmos/cosmos-sdk/x/authz"
	authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
	authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module"
	"github.com/cosmos/cosmos-sdk/x/bank"
	bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
	banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
	consensus "github.com/cosmos/cosmos-sdk/x/consensus"
	consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
	consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
	"github.com/cosmos/cosmos-sdk/x/crisis"
	crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
	crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
	distr "github.com/cosmos/cosmos-sdk/x/distribution"
	distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
	distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
	"github.com/cosmos/cosmos-sdk/x/genutil"
	genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
	"github.com/cosmos/cosmos-sdk/x/gov"
	govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
	govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
	govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
	govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
	"github.com/cosmos/cosmos-sdk/x/group"
	groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper"
	groupmodule "github.com/cosmos/cosmos-sdk/x/group/module"
	"github.com/cosmos/cosmos-sdk/x/mint"
	mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
	minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
	"github.com/cosmos/cosmos-sdk/x/params"
	paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
	paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
	paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
	paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
	"github.com/cosmos/cosmos-sdk/x/slashing"
	slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
	slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
	"github.com/cosmos/cosmos-sdk/x/staking"
	stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
	stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
	"github.com/cosmos/gogoproto/proto"
	"github.com/spf13/cast"
)

const appName = "SimApp"

var (
	// DefaultNodeHome default home directories for the application daemon
	DefaultNodeHome string

	// module account permissions
	maccPerms = map[string][]string{
		authtypes.FeeCollectorName:     nil,
		distrtypes.ModuleName:          nil,
		minttypes.ModuleName:           {authtypes.Minter},
		stakingtypes.BondedPoolName:    {authtypes.Burner, authtypes.Staking},
		stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
		govtypes.ModuleName:            {authtypes.Burner},
		nft.ModuleName:                 nil,
	}
)

var (
	_ runtime.AppI            = (*SimApp)(nil)
	_ servertypes.Application = (*SimApp)(nil)
)

// SimApp extends an ABCI application, but with most of its parameters exported.
// They are exported for convenience in creating helper functions, as object
// capabilities aren't needed for testing.
type SimApp struct {
	*baseapp.BaseApp
	legacyAmino       *codec.LegacyAmino
	appCodec          codec.Codec
	txConfig          client.TxConfig
	interfaceRegistry types.InterfaceRegistry

	// keys to access the substores
	keys  map[string]*storetypes.KVStoreKey
	tkeys map[string]*storetypes.TransientStoreKey

	// keepers
	AccountKeeper         authkeeper.AccountKeeper
	BankKeeper            bankkeeper.Keeper
	StakingKeeper         *stakingkeeper.Keeper
	SlashingKeeper        slashingkeeper.Keeper
	MintKeeper            mintkeeper.Keeper
	DistrKeeper           distrkeeper.Keeper
	GovKeeper             govkeeper.Keeper
	CrisisKeeper          *crisiskeeper.Keeper
	UpgradeKeeper         *upgradekeeper.Keeper
	ParamsKeeper          paramskeeper.Keeper
	AuthzKeeper           authzkeeper.Keeper
	EvidenceKeeper        evidencekeeper.Keeper
	FeeGrantKeeper        feegrantkeeper.Keeper
	GroupKeeper           groupkeeper.Keeper
	NFTKeeper             nftkeeper.Keeper
	ConsensusParamsKeeper consensusparamkeeper.Keeper
	CircuitKeeper         circuitkeeper.Keeper

	// the module manager
	ModuleManager      *module.Manager
	BasicModuleManager module.BasicManager

	// simulation manager
	sm *module.SimulationManager

	// module configurator
	configurator module.Configurator
}

func init() {
	userHomeDir, err := os.UserHomeDir()
	if err != nil {
		panic(err)
	}

	DefaultNodeHome = filepath.Join(userHomeDir, ".simapp")
}

// NewSimApp returns a reference to an initialized SimApp.
func NewSimApp(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	appOpts servertypes.AppOptions,
	baseAppOptions ...func(*baseapp.BaseApp),
) *SimApp {
	interfaceRegistry, _ := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{
		ProtoFiles: proto.HybridResolver,
		SigningOptions: signing.Options{
			AddressCodec: address.Bech32Codec{
				Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(),
			},
			ValidatorAddressCodec: address.Bech32Codec{
				Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(),
			},
		},
	})
	appCodec := codec.NewProtoCodec(interfaceRegistry)
	legacyAmino := codec.NewLegacyAmino()
	txConfig := tx.NewTxConfig(appCodec, tx.DefaultSignModes)

	std.RegisterLegacyAminoCodec(legacyAmino)
	std.RegisterInterfaces(interfaceRegistry)

	// Below we could construct and set an application specific mempool and
	// ABCI 1.0 PrepareProposal and ProcessProposal handlers. These defaults are
	// already set in the SDK's BaseApp, this shows an example of how to override
	// them.
	//
	// Example:
	//
	// bApp := baseapp.NewBaseApp(...)
	// nonceMempool := mempool.NewSenderNonceMempool()
	// abciPropHandler := NewDefaultProposalHandler(nonceMempool, bApp)
	//
	// bApp.SetMempool(nonceMempool)
	// bApp.SetPrepareProposal(abciPropHandler.PrepareProposalHandler())
	// bApp.SetProcessProposal(abciPropHandler.ProcessProposalHandler())
	//
	// Alternatively, you can construct BaseApp options, append those to
	// baseAppOptions and pass them to NewBaseApp.
	//
	// Example:
	//
	// prepareOpt = func(app *baseapp.BaseApp) {
	// 	abciPropHandler := baseapp.NewDefaultProposalHandler(nonceMempool, app)
	// 	app.SetPrepareProposal(abciPropHandler.PrepareProposalHandler())
	// }
	// baseAppOptions = append(baseAppOptions, prepareOpt)

	// create and set dummy vote extension handler
	voteExtOp := func(bApp *baseapp.BaseApp) {
		voteExtHandler := NewVoteExtensionHandler()
		voteExtHandler.SetHandlers(bApp)
	}
	baseAppOptions = append(baseAppOptions, voteExtOp)

	bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseAppOptions...)
	bApp.SetCommitMultiStoreTracer(traceStore)
	bApp.SetVersion(version.Version)
	bApp.SetInterfaceRegistry(interfaceRegistry)
	bApp.SetTxEncoder(txConfig.TxEncoder())

	keys := storetypes.NewKVStoreKeys(
		authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, crisistypes.StoreKey,
		minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
		govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey,
		evidencetypes.StoreKey, circuittypes.StoreKey,
		authzkeeper.StoreKey, nftkeeper.StoreKey, group.StoreKey,
	)

	// register streaming services
	if err := bApp.RegisterStreamingServices(appOpts, keys); err != nil {
		panic(err)
	}

	tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
	app := &SimApp{
		BaseApp:           bApp,
		legacyAmino:       legacyAmino,
		appCodec:          appCodec,
		txConfig:          txConfig,
		interfaceRegistry: interfaceRegistry,
		keys:              keys,
		tkeys:             tkeys,
	}

	app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey])

	// set the BaseApp's parameter store
	app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String(), runtime.EventService{})
	bApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore)

	// add keepers
	app.AccountKeeper = authkeeper.NewAccountKeeper(appCodec, runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String())

	app.BankKeeper = bankkeeper.NewBaseKeeper(
		appCodec,
		runtime.NewKVStoreService(keys[banktypes.StoreKey]),
		app.AccountKeeper,
		BlockedAddresses(),
		authtypes.NewModuleAddress(govtypes.ModuleName).String(),
		logger,
	)
	app.StakingKeeper = stakingkeeper.NewKeeper(
		appCodec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
	)
	app.MintKeeper = mintkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[minttypes.StoreKey]), app.StakingKeeper, app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String())

	app.DistrKeeper = distrkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[distrtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, app.StakingKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String())

	app.SlashingKeeper = slashingkeeper.NewKeeper(
		appCodec, legacyAmino, runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), app.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
	)

	invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod))
	app.CrisisKeeper = crisiskeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[crisistypes.StoreKey]), invCheckPeriod,
		app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.AccountKeeper.AddressCodec())

	app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[feegrant.StoreKey]), app.AccountKeeper)

	// register the staking hooks
	// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
	app.StakingKeeper.SetHooks(
		stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()),
	)

	app.CircuitKeeper = circuitkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[circuittypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.AccountKeeper.AddressCodec())
	app.BaseApp.SetCircuitBreaker(&app.CircuitKeeper)

	app.AuthzKeeper = authzkeeper.NewKeeper(runtime.NewKVStoreService(keys[authzkeeper.StoreKey]), appCodec, app.MsgServiceRouter(), app.AccountKeeper)

	groupConfig := group.DefaultConfig()
	/*
		Example of setting group params:
		groupConfig.MaxMetadataLen = 1000
	*/
	app.GroupKeeper = groupkeeper.NewKeeper(keys[group.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper, groupConfig)

	// get skipUpgradeHeights from the app options
	skipUpgradeHeights := map[int64]bool{}
	for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) {
		skipUpgradeHeights[int64(h)] = true
	}
	homePath := cast.ToString(appOpts.Get(flags.FlagHome))
	// set the governance module account as the authority for conducting upgrades
	app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String())

	// Register the proposal types
	// Deprecated: Avoid adding new handlers, instead use the new proposal flow
	// by granting the governance module the right to execute the message.
	// See: https://docs.cosmos.network/main/modules/gov#proposal-messages
	govRouter := govv1beta1.NewRouter()
	govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler).
		AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper))
	govConfig := govtypes.DefaultConfig()
	/*
		Example of setting gov params:
		govConfig.MaxMetadataLen = 10000
	*/
	govKeeper := govkeeper.NewKeeper(
		appCodec, runtime.NewKVStoreService(keys[govtypes.StoreKey]), app.AccountKeeper, app.BankKeeper,
		app.StakingKeeper, app.DistrKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
	)

	// Set legacy router for backwards compatibility with gov v1beta1
	govKeeper.SetLegacyRouter(govRouter)

	app.GovKeeper = *govKeeper.SetHooks(
		govtypes.NewMultiGovHooks(
		// register the governance hooks
		),
	)

	app.NFTKeeper = nftkeeper.NewKeeper(runtime.NewKVStoreService(keys[nftkeeper.StoreKey]), appCodec, app.AccountKeeper, app.BankKeeper)

	// create evidence keeper with router
	evidenceKeeper := evidencekeeper.NewKeeper(
		appCodec, runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), app.StakingKeeper, app.SlashingKeeper, app.AccountKeeper.AddressCodec(), runtime.ProvideCometInfoService(),
	)
	// If evidence needs to be handled for the app, set routes in router here and seal
	app.EvidenceKeeper = *evidenceKeeper

	/****  Module Options ****/

	// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
	// we prefer to be more strict in what arguments the modules expect.
	skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))

	// NOTE: Any module instantiated in the module manager that is later modified
	// must be passed by reference here.
	app.ModuleManager = module.NewManager(
		genutil.NewAppModule(
			app.AccountKeeper, app.StakingKeeper, app,
			txConfig,
		),
		auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
		vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
		bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
		crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)),
		feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
		gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)),
		mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)),
		slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry),
		distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)),
		staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)),
		upgrade.NewAppModule(app.UpgradeKeeper, app.AccountKeeper.AddressCodec()),
		evidence.NewAppModule(app.EvidenceKeeper),
		params.NewAppModule(app.ParamsKeeper),
		authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
		groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
		nftmodule.NewAppModule(appCodec, app.NFTKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
		consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
		circuit.NewAppModule(appCodec, app.CircuitKeeper),
	)
	bApp.SetMigrationModuleManager(app.ModuleManager)

	// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
	// non-dependant module elements, such as codec registration and genesis verification.
	// By default it is composed of all the module from the module manager.
	// Additionally, app module basics can be overwritten by passing them as argument.
	app.BasicModuleManager = module.NewBasicManagerFromManager(
		app.ModuleManager,
		map[string]module.AppModuleBasic{
			genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
			govtypes.ModuleName: gov.NewAppModuleBasic(
				[]govclient.ProposalHandler{
					paramsclient.ProposalHandler,
				},
			),
		})
	app.BasicModuleManager.RegisterLegacyAminoCodec(legacyAmino)
	app.BasicModuleManager.RegisterInterfaces(interfaceRegistry)

	// During begin block slashing happens after distr.BeginBlocker so that
	// there is nothing left over in the validator fee pool, so as to keep the
	// CanWithdrawInvariant invariant.
	// NOTE: staking module is required if HistoricalEntries param > 0
	app.ModuleManager.SetOrderBeginBlockers(
		upgradetypes.ModuleName,
		minttypes.ModuleName,
		distrtypes.ModuleName,
		slashingtypes.ModuleName,
		evidencetypes.ModuleName,
		stakingtypes.ModuleName,
		genutiltypes.ModuleName,
		authz.ModuleName,
	)
	app.ModuleManager.SetOrderEndBlockers(
		crisistypes.ModuleName,
		govtypes.ModuleName,
		stakingtypes.ModuleName,
		genutiltypes.ModuleName,
		feegrant.ModuleName,
		group.ModuleName,
	)

	// NOTE: The genutils module must occur after staking so that pools are
	// properly initialized with tokens from genesis accounts.
	// NOTE: The genutils module must also occur after auth so that it can access the params from auth.
	genesisModuleOrder := []string{
		authtypes.ModuleName, banktypes.ModuleName,
		distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName,
		minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName,
		feegrant.ModuleName, nft.ModuleName, group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName,
		vestingtypes.ModuleName, consensusparamtypes.ModuleName, circuittypes.ModuleName,
	}
	app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
	app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)

	// Uncomment if you want to set a custom migration order here.
	// app.ModuleManager.SetOrderMigrations(custom order)

	app.ModuleManager.RegisterInvariants(app.CrisisKeeper)
	app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
	err := app.ModuleManager.RegisterServices(app.configurator)
	if err != nil {
		panic(err)
	}

	// RegisterUpgradeHandlers is used for registering any on-chain upgrades.
	// Make sure it's called after `app.ModuleManager` and `app.configurator` are set.
	app.RegisterUpgradeHandlers()

	autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.ModuleManager.Modules))

	reflectionSvc, err := runtimeservices.NewReflectionService()
	if err != nil {
		panic(err)
	}
	reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc)

	// add test gRPC service for testing gRPC queries in isolation
	testdata_pulsar.RegisterQueryServer(app.GRPCQueryRouter(), testdata_pulsar.QueryImpl{})

	// create the simulation manager and define the order of the modules for deterministic simulations
	//
	// NOTE: this is not required apps that don't use the simulator for fuzz testing
	// transactions
	overrideModules := map[string]module.AppModuleSimulation{
		authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
	}
	app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules)

	app.sm.RegisterStoreDecoders()

	// initialize stores
	app.MountKVStores(keys)
	app.MountTransientStores(tkeys)

	// initialize BaseApp
	app.SetInitChainer(app.InitChainer)
	app.SetBeginBlocker(app.BeginBlocker)
	app.SetEndBlocker(app.EndBlocker)
	app.setAnteHandler(txConfig)

	// In v0.46, the SDK introduces _postHandlers_. PostHandlers are like
	// antehandlers, but are run _after_ the `runMsgs` execution. They are also
	// defined as a chain, and have the same signature as antehandlers.
	//
	// In baseapp, postHandlers are run in the same store branch as `runMsgs`,
	// meaning that both `runMsgs` and `postHandler` state will be committed if
	// both are successful, and both will be reverted if any of the two fails.
	//
	// The SDK exposes a default postHandlers chain, which comprises of only
	// one decorator: the Transaction Tips decorator. However, some chains do
	// not need it by default, so feel free to comment the next line if you do
	// not need tips.
	// To read more about tips:
	// https://docs.cosmos.network/main/core/tips.html
	//
	// Please note that changing any of the anteHandler or postHandler chain is
	// likely to be a state-machine breaking change, which needs a coordinated
	// upgrade.
	app.setPostHandler()

	// At startup, after all modules have been registered, check that all prot
	// annotations are correct.
	protoFiles, err := proto.MergedRegistry()
	if err != nil {
		panic(err)
	}
	err = msgservice.ValidateProtoAnnotations(protoFiles)
	if err != nil {
		// Once we switch to using protoreflect-based antehandlers, we might
		// want to panic here instead of logging a warning.
		fmt.Fprintln(os.Stderr, err.Error())
	}

	if loadLatest {
		if err := app.LoadLatestVersion(); err != nil {
			panic(fmt.Errorf("error loading last version: %w", err))
		}
	}

	return app
}

func (app *SimApp) setAnteHandler(txConfig client.TxConfig) {
	anteHandler, err := NewAnteHandler(
		HandlerOptions{
			ante.HandlerOptions{
				AccountKeeper:   app.AccountKeeper,
				BankKeeper:      app.BankKeeper,
				SignModeHandler: txConfig.SignModeHandler(),
				FeegrantKeeper:  app.FeeGrantKeeper,
				SigGasConsumer:  ante.DefaultSigVerificationGasConsumer,
			},
			&app.CircuitKeeper,
		},
	)
	if err != nil {
		panic(err)
	}

	// Set the AnteHandler for the app
	app.SetAnteHandler(anteHandler)
}

func (app *SimApp) setPostHandler() {
	postHandler, err := posthandler.NewPostHandler(
		posthandler.HandlerOptions{},
	)
	if err != nil {
		panic(err)
	}

	app.SetPostHandler(postHandler)
}

// Name returns the name of the App
func (app *SimApp) Name() string { return app.BaseApp.Name() }

// BeginBlocker application updates every begin block
func (app *SimApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) {
	return app.ModuleManager.BeginBlock(ctx)
}

// EndBlocker application updates every end block
func (app *SimApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) {
	return app.ModuleManager.EndBlock(ctx)
}

func (a *SimApp) Configurator() module.Configurator {
	return a.configurator
}

// InitChainer application update at chain initialization
func (app *SimApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) {
	var genesisState GenesisState
	if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
		panic(err)
	}
	app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap())
	return app.ModuleManager.InitGenesis(ctx, app.appCodec, genesisState)
}

// LoadHeight loads a particular height
func (app *SimApp) LoadHeight(height int64) error {
	return app.LoadVersion(height)
}

// LegacyAmino returns SimApp's amino codec.
//
// NOTE: This is solely to be used for testing purposes as it may be desirable
// for modules to register their own custom testing types.
func (app *SimApp) LegacyAmino() *codec.LegacyAmino {
	return app.legacyAmino
}

// AppCodec returns SimApp's app codec.
//
// NOTE: This is solely to be used for testing purposes as it may be desirable
// for modules to register their own custom testing types.
func (app *SimApp) AppCodec() codec.Codec {
	return app.appCodec
}

// InterfaceRegistry returns SimApp's InterfaceRegistry
func (app *SimApp) InterfaceRegistry() types.InterfaceRegistry {
	return app.interfaceRegistry
}

// TxConfig returns SimApp's TxConfig
func (app *SimApp) TxConfig() client.TxConfig {
	return app.txConfig
}

// AutoCliOpts returns the autocli options for the app.
func (app *SimApp) AutoCliOpts() autocli.AppOptions {
	modules := make(map[string]appmodule.AppModule, 0)
	for _, m := range app.ModuleManager.Modules {
		if moduleWithName, ok := m.(module.HasName); ok {
			moduleName := moduleWithName.Name()
			if appModule, ok := moduleWithName.(appmodule.AppModule); ok {
				modules[moduleName] = appModule
			}
		}
	}

	return autocli.AppOptions{
		Modules:       modules,
		ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.ModuleManager.Modules),
	}
}

// DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (a *SimApp) DefaultGenesis() map[string]json.RawMessage {
	return a.BasicModuleManager.DefaultGenesis(a.appCodec)
}

// GetKey returns the KVStoreKey for the provided store key.
//
// NOTE: This is solely to be used for testing purposes.
func (app *SimApp) GetKey(storeKey string) *storetypes.KVStoreKey {
	return app.keys[storeKey]
}

// GetStoreKeys returns all the stored store keys.
func (app *SimApp) GetStoreKeys() []storetypes.StoreKey {
	keys := make([]storetypes.StoreKey, len(app.keys))
	for _, key := range app.keys {
		keys = append(keys, key)
	}

	return keys
}

// GetSubspace returns a param subspace for a given module name.
//
// NOTE: This is solely to be used for testing purposes.
func (app *SimApp) GetSubspace(moduleName string) paramstypes.Subspace {
	subspace, _ := app.ParamsKeeper.GetSubspace(moduleName)
	return subspace
}

// SimulationManager implements the SimulationApp interface
func (app *SimApp) SimulationManager() *module.SimulationManager {
	return app.sm
}

// RegisterAPIRoutes registers all application module routes with the provided
// API server.
func (app *SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
	clientCtx := apiSvr.ClientCtx
	// Register new tx routes from grpc-gateway.
	authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

	// Register new CometBFT queries routes from grpc-gateway.
	cmtservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

	// Register node gRPC service for grpc-gateway.
	nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

	// Register grpc-gateway routes for all modules.
	app.BasicModuleManager.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

	// register swagger API from root so that other applications can override easily
	if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil {
		panic(err)
	}
}

// RegisterTxService implements the Application.RegisterTxService method.
func (app *SimApp) RegisterTxService(clientCtx client.Context) {
	authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry)
}

// RegisterTendermintService implements the Application.RegisterTendermintService method.
func (app *SimApp) RegisterTendermintService(clientCtx client.Context) {
	cmtApp := server.NewCometABCIWrapper(app)
	cmtservice.RegisterTendermintService(
		clientCtx,
		app.BaseApp.GRPCQueryRouter(),
		app.interfaceRegistry,
		cmtApp.Query,
	)
}

func (app *SimApp) RegisterNodeService(clientCtx client.Context, cfg config.Config) {
	nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg)
}

// GetMaccPerms returns a copy of the module account permissions
//
// NOTE: This is solely to be used for testing purposes.
func GetMaccPerms() map[string][]string {
	dupMaccPerms := make(map[string][]string)
	for k, v := range maccPerms {
		dupMaccPerms[k] = v
	}

	return dupMaccPerms
}

// BlockedAddresses returns all the app's blocked account addresses.
func BlockedAddresses() map[string]bool {
	modAccAddrs := make(map[string]bool)
	for acc := range GetMaccPerms() {
		modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true
	}

	// allow the following addresses to receive funds
	delete(modAccAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String())

	return modAccAddrs
}

// initParamsKeeper init params keeper and its subspaces
func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper {
	paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)

	paramsKeeper.Subspace(authtypes.ModuleName)
	paramsKeeper.Subspace(banktypes.ModuleName)
	paramsKeeper.Subspace(stakingtypes.ModuleName)
	paramsKeeper.Subspace(minttypes.ModuleName)
	paramsKeeper.Subspace(distrtypes.ModuleName)
	paramsKeeper.Subspace(slashingtypes.ModuleName)
	paramsKeeper.Subspace(govtypes.ModuleName)
	paramsKeeper.Subspace(crisistypes.ModuleName)

	return paramsKeeper
}

repository: cosmos/cosmos-sdk

repo_name: cosmos/cosmos-sdk

branch_name: refs/heads/main

gha_language: Go

extension: go


text:
#include "openal.h"

#include "beeps/exception.h"
#include "beeps/debug.h"
#include "sound.h"

namespace Beeps
{

	namespace global
	{

		static ALCdevice* device   = NULL;

		static ALCcontext* context = NULL;

	}// global

	static void
	cleanup ()
	{
		Sound_cleanup_sources();

		alcMakeContextCurrent(NULL);

		if (global::context)
		{
			alcDestroyContext(global::context);
			global::context = NULL;
		}

		if (global::device)
		{
			alcCloseDevice(global::device);
			global::device = NULL;
		}
	}

	void
	OpenAL_init ()
	{
		if (global::device || global::context)
			beeps_error(__FILE__, __LINE__, "already initialized.");

		global::device = alcOpenDevice(NULL);
		if (!global::device) goto FAILED;

		global::context = alcCreateContext(global::device, NULL);
		if (!global::context) goto FAILED;

		if (!alcMakeContextCurrent(global::context))
			goto FAILED;

		return;

	FAILED:
		cleanup();
		openal_error(__FILE__, __LINE__, "failed to initialize OpenAL.");
	}

	void
	OpenAL_fin ()
	{
		if (!global::context)
			beeps_error(__FILE__, __LINE__, "not initialized.");

		cleanup();
	}

	ALCenum
	OpenAL_get_error ()
	{
		assert(global::device);

		return alcGetError(global::device);
	}

	bool
	OpenAL_no_error ()
	{
		return OpenAL_get_error() == ALC_NO_ERROR;
	}

	static String
	get_error_name (ALenum error)
	{
		switch (error)
		{
			case ALC_NO_ERROR:        return "ALC_NO_ERROR";
			case ALC_INVALID_DEVICE:  return "ALC_INVALID_DEVICE";
			case ALC_INVALID_CONTEXT: return "ALC_INVALID_CONTEXT";
			case ALC_INVALID_ENUM:    return "ALC_INVALID_ENUM";
			case ALC_OUT_OF_MEMORY:   return "ALC_OUT_OF_MEMORY";
			default:                  return "UNKNOWN ERROR";
		}
	}

	void
	OpenAL_check_error (const char* file, int line)
	{
		ALCenum e = OpenAL_get_error();
		if (e != ALC_NO_ERROR)
			openal_error(file, line, "OpenAL error %s", get_error_name(e).c_str());
	}

}// Beeps

repository: xord/reflexion

repo_name: xord/reflexion

extension: cpp


text:
@article{choi_vitro_2015,
 abstract = {The hydroxypyridinonate ligand 3,4,3-LI(1,2-HOPO) is currently under development for radionuclide chelation therapy. The preclinical characterization of this highly promising ligand comprised the evaluation of its in vitro properties, including microsomal, plasma, and gastrointestinal fluid stability, cytochrome P450 inhibition, plasma protein binding, and intestinal absorption using the Caco-2 cell line. When mixed with active human liver microsomes, no loss of parent compound was observed after 60 min, indicating compound stability in the presence of liver microsomal P450. At the tested concentrations, 3,4,3-LI(1,2-HOPO) did not significantly influence the activities of any of the cytochromal isoforms screened. Thus, 3,4,3-LI(1,2-HOPO) is unlikely to cause drug–drug interactions by inhibiting the metabolic clearance of coadministered drugs metabolized by these enzymes. Plasma protein-binding assays revealed that the compound is protein-bound in dogs and less extensively in rats and humans. In the plasma stability study, the compound was stable after 1 h at 37°C in mouse, rat, dog, and human plasma samples. Finally, a bidirectional permeability assay demonstrated that 3,4,3-LI(1,2-HOPO) is not permeable across the Caco-2 monolayer, highlighting the need to further evaluate the effects of various compounds with known permeability enhancement properties on the permeability of the ligand in future studies. C},
 author = {Choi, Taylor A. and Furimsky, Anna M. and Swezey, Robert and Bunin, Deborah I. and Byrge, Patricia and Iyer, Lalitha V. and Chang, Polly Y. and Abergel, Rebecca J.},
 doi = {10.1002/jps.24394},
 file = {Attachment:/Users/julian/Documents/Mendeley/Choi et al. - 2015 - In Vitro Metabolism and Stability of the Actinide Chelating Agent 3,4,3-LI(1,2-HOPO).pdf:application/pdf},
 issn = {00223549},
 journal = {Journal of Pharmaceutical Sciences},
 keywords = {ADME, Chelation therapy, Cytochrome p450, Intestinal absorption, Microsomes, Protein binding, Stability},
 month = {May},
 number = {5},
 pages = {1832--1838},
 title = {In Vitro Metabolism and Stability of the Actinide Chelating Agent 3,4,3-LI(1,2-HOPO)},
 url = {http://linkinghub.elsevier.com/retrieve/pii/S0022354915301337},
 volume = {104},
 year = {2015}
}

repository: julianrees/academic-kickstart

repo_name: julianrees/academic-kickstart

extension: bib


text:
# this recipe is only intended for specific users, so don't choose it by default
DEFAULT_PREFERENCE = "-1"

# tag IGPS_03.07.02_Google
SRCREV = "d19d7e2a75c6aa35e745fe5e00bf7b256df11278"
IGPS_BRANCH = "igps_npcm8xx_google"

require npcm8xx-igps.inc

repository: daleghent/openbmc

repo_name: daleghent/openbmc

gha_license_id: NOASSERTION

gha_language: Python

extension: bb


text:
package event

const (
	PlacementDefault = iota
)

// BlockPlaced is called by a client when it places a block.
type BlockPlaced struct {
	// AuxType is the metadata value of the block placed.
	AuxType int
	// Block is the block that was placed. This is a string like 'stone'.
	Block string
	// Namespace is the namespace to which the block belongs. Usually, this is 'minecraft'.
	Namespace string
	// Type is the numerical ID of the block placed. For stone, this is 1.
	Type int
	// PlacementMethod was the method that was used to place the block.
	PlacementMethod int
	// ToolItemType is the item ID of the item that was used to place the block. Often, this is the same as
	// the Type field.
	ToolItemType int
}

repository: Tsubashi/mcwss

repo_name: Tsubashi/mcwss


text:
package quacktorstreams

import (
	"github.com/Azer0s/quacktors/quacktorstreams"
	"gopkg.in/confluentinc/confluent-kafka-go.v1/kafka"
)

type KafkaConsumer struct {
	Config *kafka.ConfigMap
	c      *kafka.Consumer
}

func (k *KafkaConsumer) Init() error {
	var err error
	k.c, err = kafka.NewConsumer(k.Config)

	if err != nil {
		return err
	}

	return nil
}

func (k *KafkaConsumer) Subscribe(topic string) error {
	err := k.c.Subscribe(topic, nil)

	if err != nil {
		return err
	}

	return nil
}

func (k *KafkaConsumer) NextMessage() (quacktorstreams.StreamMessage, error) {
	msg, err := k.c.ReadMessage(-1)

	if err != nil {
		return quacktorstreams.StreamMessage{}, err
	}

	return quacktorstreams.StreamMessage{
		Bytes: msg.Value,
		Topic: *msg.TopicPartition.Topic,
		Meta:  msg,
	}, nil
}


text:
#include "xleaflet/xvelocity.hpp"

template class XLEAFLET_API xw::xmaterialize<xlf::xvelocity>;
template xw::xmaterialize<xlf::xvelocity>::xmaterialize();
template class XLEAFLET_API xw::xtransport<xw::xmaterialize<xlf::xvelocity>>;

repository: jupyter-xeus/xleaflet

repo_name: jupyter-xeus/xleaflet


text:
set(CTEST_RUN_CURRENT_SCRIPT 0)

macro(check_arg name expected_value)
  message("${name}='${${name}}'")
  if(NOT "${${name}}" STREQUAL "${expected_value}")
    message(FATAL_ERROR "unexpected ${name} value '${${name}}', expected '${expected_value}'")
  endif()
endmacro()

check_arg(arg1 "this")
check_arg(arg2 "that")
check_arg(arg3 "the other")
check_arg(arg4 "this is the fourth")
check_arg(arg5 "the_fifth")
check_arg(arg6 "value-with-type")
check_arg(arg7 "")

extension: cmake


text:
# base recipe: meta/recipes-support/atk/atk_2.30.0.bb
# base branch: warrior
# base commit: 7e6ad795543a780989f709999a19ca2e86422b67

SUMMARY = "Accessibility toolkit for GNOME"
HOMEPAGE = "http://live.gnome.org/GAP/"
BUGTRACKER = "https://bugzilla.gnome.org/"
SECTION = "x11/libs"

LICENSE = "GPLv2+ & LGPLv2+"
LIC_FILES_CHKSUM = "\
	file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
	file://atk/atkutil.c;endline=18;md5=6fd31cd2fdc9b30f619ca8d819bc12d3 \
	file://atk/atk.h;endline=18;md5=fcd7710187e0eae485e356c30d1b0c3b \
"

# Need gettext-native as Meson can't turn off i18n
DEPENDS = "gettext-native glib-2.0"

GNOMEBASEBUILDCLASS = "meson"
inherit gnomebase

BPN = "atk1.0"
inherit debian-package
require recipes-debian/sources/${BPN}.inc
DEBIAN_UNPACK_DIR = "${WORKDIR}/atk-${PV}"

inherit gtk-doc gettext upstream-version-is-even gobject-introspection

GTKDOC_ENABLE_FLAG = "-Ddocs=true"
GTKDOC_DISABLE_FLAG = "-Ddocs=false"

EXTRA_OEMESON_append_class-target = "\
	${@bb.utils.contains('GTKDOC_ENABLED', 'True', '${GTKDOC_ENABLE_FLAG}', '${GTKDOC_DISABLE_FLAG}', d)} \
"

FILESPATH_append = ":${COREBASE}/meta/recipes-support/atk/atk"
SRC_URI += "file://0001-meson.build-enable-introspection-for-cross-compile.patch"

BBCLASSEXTEND = "native nativesdk"

repository: miraclelinux/meta-debian-extended

repo_name: miraclelinux/meta-debian-extended

branch_name: refs/heads/warrior

gha_language: BitBake


text:
using System;
using System.Collections.Generic;
using MediatR;
using SFA.DAS.QnA.Api.Types;
using SFA.DAS.QnA.Data.Entities;

namespace SFA.DAS.QnA.Application.Queries.WorkflowSections.GetWorkflowSections
{
    public class GetWorkflowSectionsRequest : IRequest<HandlerResponse<List<WorkflowSection>>>
    {
        public Guid ProjectId { get; }

        public GetWorkflowSectionsRequest(Guid projectId)
        {
            ProjectId = projectId;
        }
    }
}

repository: SkillsFundingAgency/das-qna-api

repo_name: SkillsFundingAgency/das-qna-api

gha_language: C#

extension: cs