// File: RIGORMORTIS.sol

//OOOO0000000000000000000000OOOOOOO00OOOOOOOOOOOOOkkkkkkOO00OkkkkxxxxxdxxxxxxxxxxxxxxxxxxxxkOO00000kxxxxxxxxxkkxxxkkxxkkkxkOOOOOOOOOOOO0000000K0000KKKKKKKKKKKKKKKKKXXXXXXXKKXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//OOOO00000OOOkkxddxxk0000OOO000OOxl:;,,,'''',,',''''','':xOd;..................',,'........:xkk00kdc;,,,;,'........'''''.',,','',,,,,,,,,,,;clc;;:::::cc:::ccccccccccllllollllooooxkkOOOkxdddddxxxxk0XXXX
//OOOO00000OOkc,,,,;:oO000OOOO00xc'...     ..  .  .......':ol'.   ....:;.   .   .,;,......;lxO00KK00Okxxddxdc;..............................,loc;'.......',;;;::::;;;:::;;,,''......;cddlc,.........'cOXXX
//OOO00OO00OOOxdxxkkOOO0000OOOOOxlc:;,... ....  ........ .....    .;clxdc'......  ......;x000000KK0000000OOO0Od;...........................:ooodol:'....'dkdooodoooxkxdddddddddo;..;dddodxdc'........'dKXX
//OOO0OOOOkxdooollolc::::cclooodxkkOOkxdlc:;,.............       ..';,cxd;......   ....,x0K00KKKK000000KKKOkk0Kk:.........................:olok0Oxo;....,xx;:cllldxO0kxxxxxxxookc..;ooloxOOd:.........c0XX
//OO00Okdl;,'.'',:c:'''.'''.''''',;okxoodkOOkxol:;'...;odc.  .... ....'l:...,....   ...l0KKKKKKKK000000000xxO000x,.......................cddxxkkk0x,....,kk,,ldooOXXXXXXK0KXO::kl...,:oxkkxxd;........:0NX
//OO00Odc;,;;,c:colc:cc;:::;cloc;;coolc;,,;:cldxkOkxdxOOOo,.....   ...... ..';...   ...oOOO00KKKK0O0000Oxdddxxxk0d'.....................lOkddoxkx0k:....,xk,.;cookXXXK0OxodOl.:kl...'okdlodxdo:.......:0NN
//0000Ooc:;:coxocllcclc;;ccclodoclodlodoc::;',,,;:ldkOOOOkdlc:'.......... ...,,...  ..;k0xox0KKKKOOxoxkOOxxkkkOO0x,....................;dkdoxlokxxkx:,'.'xx;',;xkkKX0kdoollc,.:kl..,:ooc:::clloc,.....c0NN
//OOO0k:,:;,:c:cclolodoccooooloolodddoolllolcl:::,;;,:cldkOOOko;........    .';.......:OOc,,cOKKKOl,,,,:k0xxkk000l.....................cdkd:lookxodOkxkocxx,',,lxxOXOollol:,'.:kocxkkxdoolccclc:c,....cKNN
//OOOOo'.,llooloddxkkkkxxkkkkkkkxkOOkxxddoooloccllllcc;,,:lldkOOd;.......   ..........;kx;.',oOkOk:.;;''o0kxxk0Kx,....................,dxxxoddoddlokkOOkdkk;';,,lxOXOoloxo;;,':kxkKOxxxolooolcc;,:,...cKNN
//OOOx;...ckkkkOOOkoc::cllllllloddxkOOOOkkxddxooddodooool:,'',:okOko:'.......     ....'dOd:,:oc;:lxocclokOxkxkKKx,...................'lkxxxdoolcolcd0K0xlxO:';,',o0XOdxOd:;;;':kolxdxddo:clcdxol::l,..c0NN
//OOOx;,l:,cooxOOOc.    .;:cc'......';::coxkkOOOOOOkkkxxdlcc:;'',:lxOkdc'..... .....  .;x0OkOd;,,;o00000OxkOkk00x;..................,dddkdll:looxoldOO0OoxO:';;;,:xKK0Kkc;::;':kl;l:::;;;:;,:oldddOl..:0NN
//OOOkc,:;..codxdc;......lOOx, ...       ...,;clxkOOOOOOkdolllccc;,,;lxOkdc'........  .'oOOO0xc;,;lO0OkO0kOkcdkl..................'lkd:oolllxkxxdddddxxkxxOc';;;;,lkkkxl;;;;,';kxllldlclodlc:;;lld0x'.:0NN
//OOOk:.   .'clo:........,ll;.  ..             ...';coxkOOkxddloocc:'.';cdkko:........ .':clxxxxddddollokOKOc',...................:kkdoookkxkxd:;c,,:odxxxOc';;;,,colll:,;:;;';kxxxdkdllxdoodoccclO0:.:0WN
//OOOx;. .,:,:xkkc.....                              ..';coxkkkkxoll:,,,'',cxkxl;........ .':clllc:::clox0K0l....................'okkO0xkkkd:,.......,:ldxOc';::;;dOkdol;,;;;.;kx:;:ol;cdkxxxc:locd0d,:0WN
//OOk:.  .:xo;lxkd::oo,                                   ..;cdkOkkxdlc:::,'';lxOxl,..... .,lolc:ccldxkO00ko'...................'dOxxOkxdc:'...........';dOc',;,;o0kddoxo;,;c:;kx'..'...;oldk:ckkdokk::0NN
//OOx,    .:xlcxkkxxOOl.                                      .':okO0Oxolclc;;,,cdOOd;.....:k0OOOOOOKKKKkolc'..................'oOxoxkxl'................o0c.,:cl0Kkoolxxo:,ol:kx,......':cco;lOkkkKO::ONN
//kko'     .;'.ckxookOx,                                         ..,cdkOOxddolc:;;:okOxc'...:oxkkkOkkkkkdooc,.................;dOkxdlc;..................lOc',coox00xlooooc;ol:Ok,......;x0kocdxxOx0Kc;ONN
//kkl.   ..',;;:dkxxdoc.                                         .....':okOOkxoool:;;lk0kl'.....,oOkxxkOOkxxc...............,lkOkdc....................'.lOc',:odxxO0xddcloldo:Ok,.......':oxdc,lOk0Xl;kNN
//OOl.  .;okkdl;ckkd;.                                           .''......;lxOOkkxoolc:cxOkc....;xKK0OkOOkdddc............'okdcc:'....................,lookl';xKkdxdxOdoollldc;Ok,..............cxdOXo;xNN
//Okl.   .,;:;. .okx;.                                            .. ...   ..,lxOOkxddl:;:dOx:.;x0KKK0O00kddxxc...........,:;...........................;lddccx0Kxdkxxdk0o:d0l:Ok,..............',:kKl,xXN
//kkl.      ...  'oxd,                                                ..      ..:dO0Okdol;,cxd:cdOKKKKKKKxlllol'.........................................lOdldxddlckxclO0l:d0oc0k,..........'l:...;OO:,xXN
//Okl.     .     .;odc.                                                         ..,lkOxolcloddxddk000OO00Odllddol:,......................................;ddocddllcooccooccooloxl'...........'....'cc.'dXN
//Okc.    'c,     .cdd;                                                   ...,,''';cdkkxddxolododk00OOOOOxdddxkkOOxlcllc:,....................................'cdc;dOc,ox:ckx;........................'xXN
//Okc.    .lc.     ,ldo'                                                .':oxkkkkkOOOOOOOkxkkkOkodkkkOOkxoldkkk00OO000000Oxdollool:............................:OOcl0k:dklxKd'...............'........'dXX
//Ok;      .'.     .:dkl.                                          ....;lxxolcldxdocoxxodxddodkddOKK00K0OxodOkkkxddooxxdoxOkxkO0000k:...........................l0OokkoOkd0x,................'........,xXX
//Ok:               'oxx;                                          ..'coddccclOK0xxdxxxkxlldddxxdkkkOOOkxdlldxxxdoloOkdxkxolldddooxOdlol,.......................,dkooodxoxd,..........................'xXX
//Ok:.              .:xko.                                        .cdxoldxdoooxxxkkkxoxOl:lllodxdodkkxxoloodddoddlcx0doxk0xcokkocoxkOKXXk;.....................,lldddkoodl'...........................'dXX
//Ok:..              'oxx:.                                      .cO00OxxOOkxxkO0K0Odlk0dodoodddolcd0kxlcodddxodkxkko;:xkx0klxKOdxkOKOkO0l.....................,cooodxdxd;............................'dXX
//Ok;.               .;dkx'                                      .o0KK0OxxdxxxkOK0xxkllkOOkddxxdolld000dlddddxodkdoool;o0xkKxOKxdkOO0KOO0l.....................,lolldodo,.............................'dXX
//Ox;                ..cxxl.                                     .,dxO0OxdoocoodOxoO0c';lol:cllc;;oOKKKOdcclddoooloododOkloOKK0oxKKK0OOKKl.....................okdxOKxdl..............................'dXX
//Ox;                  'cdx:.                                     .lkO00x:,..'lOkolxOxdxkdlcooodxddkxxxkxodxO00OdokkkkkocxxxKXXOdccldk0XXd'...................'dkxx0Kkd:..............................'dXX
//Ox;                  .;odo.                                     .oO0Okc. ..'dKkxkxc:ldxdccooodxllkO000Oocodxkkoododdo::kOdOXXXd...:OXXX0c...................;dkdd0Kk:...............................'oXX
//Ok;                   .cdx:.                                    'okkxl'..  ,kKxoOKxc::codxdodoocokkkkOkodkOkkxoddooxdokOxd0XXKc....c00KXk;.................'d0xcdKk;.................................oKX
//Ok;                   .;dxo'                                   .;dkkd;...  'x0xldxkOkkOO0KKKOxdlo0K000OllO00OxdxdokOOOxcoOO0Kx,....,x0k0Xd'...............'dK0dd0k:..................................oKX
//Ox;                    .coo:.                                  .:dxxl'.. ...:dlxOo::coold0KOocc:lkkkkkdlooxkkkOOxxxxxdl;o0kOk;......l0OkKKo..............'oKKxd00l...................................oKX
//Ox;                     ,odd;.                                .'ldxo:........:ooO0dcoollxOOdlldocx00K0kldxddddxkO0kddxookOxkl.......'x0k0X0:.............oKXxoxOo'...................................oKX
//Ox,                     .;lol'                                .;oxdl;.   ....ckdoxkkkddxxxxxxxoc:xOkkkkooxddxkkxxkxdxxdxxdoo:........:OOOKXk;...........c0XxloOx,............;;......................oKX
//Ox,                      'oxkc.                               'ldxlc;.    ...;dko,;ldlcoddo:cdo;,oO00kdooddoooxkkxddxo:;:kkdko'.......o0O0XKo..........:OXxclkk;.....................................oKX
//Ok;                      .,coo,                              .;ldxll,      .,xxxkocloooodoclxo:;,;xKKkllooxkkxxxodxoolllxkocoOk:......,xOk0Xk,........:OXxcoOk:......................................oKX
//Ok;                       .ldxo.                            ..:oxxol'      .:Oxcdkxdodoodxkkl:;:cdOKKkdlcldkkxk0OxkkxkO0kdxd;:dOo,.....,xxkKKl......'lkKkldKO:.......................................oKK
//Ok:                       .;ood;.                            .cdOdol. .  ....lkc,lxxookOO0xlloccx0KK0xxxodoodxxxO00kkOkdllOkol:lkOc.....,dxOK0o'...;xOOkxOX0c........................................oKK
//Ok;                        .lxxd'                            'cx0doc....   .'lxxdlokd:lkkxdddoccdOkkxdOOoxxdllxkkxxdddoodO0xxOdccdOo'....,okKXKx:',x0OOk0X0c.........................................oKX
//0k;                         ,oddc.                  ....    .,okOdl,.....  .;xdlxxdl::cdxddccooldkxddxOxoxxkdoookOxoxxdkOOxoloOko:cxd,....,dKKKXKkddxOkOX0l..........................................l0K
//Ok;                         .:xxx,                  .',.    .ckOOdc....... .'xdclloooxkxdxoclddlxkkkOOOolxxxxdccoxOOkdxko:cxc.:dOd::ox:....,d0KKKKKxk0k00c...........................................l0K
//0k;                          .codl.                        .,xKKkdc. ........lkxdl:lk0xodlcokkxcoO00000xoxddkko:lxdkOdodlldd;...cxxl:lxo'...'lOKOOOxxxkOc............................................l0K
//0O:.                          ,odx:                       .'o0KK0Od'....... .cdxxololoxdollxdll:lOOO0OOkccoxkxolcdxdoolddxxd;....,okxlcxx:....l0KOkddO0o.............................................l0K
//0O:                           .:odo'                      'o0K00K00d'...... .lx::lodolclddxc..:cdKK0000Occlcdkkdododxxdxdldd,......:dko:okl...,kKKxo0Kk;.............................................l0K
//0k:                            'oxkl.                    .,oxxx0KOkkd'.......;xxxolllcldxd;.':lldOOkkOK0xol'.,cddlcdkkdooodc........'cxdccxo'..,lo:,::'..............................................l0K
//0O:.                            ;odd,                   .cxxxxdxxOOxo'........cddoodxddl:'..;dxxO0O000KOl;:,...'cccdddxdood:..........,oxlcdd;.......................................................c0K
//0Oc.                            .lxko.                 .:O000kkkllo;.. .......:xdc,:oo:.......':O0OkkOK0ookd,.....'cooddolc'............cxxcox:......................................................cOK
//0O:                              ,odx:.                .:O0OxdOkodc.   ..    ..colc;,'.....,;,':OK00O0KKd;,,........,cdkx;...............,odccd:.....................................................:OK
//0O:                              .:xkx,                .cO0xxOkoc;..   .     .....'.......,x0kox00000000xoxl'.......,:c:'..................:dlldc....................................................:O0
//0O:.                              .okkl.               .l0OxOOdc'         ... .............;c:lO00Okkkkxodxc................................,oxddl...................................................cO0
//0Oc.                              .;dkx;               ,x0xdOko,.          ................,,.c00OOOOkko;cc'..';,...';:,......................ckxxl'.................................................:O0
//0Oc.                               .lkko.             .cOklokxl.         ...:oxdodddc,'..;loxco0000000Odxko:;loxOkxxO0KOl'.....................;dxxl'........................................':;.....:OK
//0O:.                                'dxxc.            ,x0d;lkkc.       .:llx0KKKKK0Odooc',lxxox00OOOOO0Oo,,lkdok0KKKKK0kdxl....  ...    .........lddl'........................................'......:kK
//0Oc.                                .:dxx;           .cO0d:o0O:.      .cOkdddOKKXKKOdloxx:.':d0000O0000k;.okdox0KKKKKK0xdxc..                    .:ddo,........... ..................................:k0
//00l.                                 .lxkd.          'd0Oocd0k,       .o0xolox0KKKK0OkkOkl';ld0000OO00Oc';dOOO0KK00KK0kddd,...    .               .,odo,..    .     .................................:k0
//00l.                                 .;dxkc.        .;k0xccx0o.       .:kkdoox0OO0KKK00klldkOxxxxkxxxxdoxOkdk0KKOxk0Odlll:. ..              .....  .'lxd,.  ..     ..................................;k0
//00l.                                  .cdxd,        .lO0ocokOc.        .;dddddkkdkKKKK0dlk00Odxkxxxxxdoxkkxox00Oxx0kxdc'...        ...            ....ckd,....     ..................................:k0
//00l.                                   'oxko.       .o0Olcdkk,          ..'coloxod0kxkkod0OkxxOKK0000xoodxod000Okkdoxc........      .              ....ckd'..       .............  ..................:k0
//00o.                                   .;oxx:.      'd0klldko.            .'cllokOOc,clclxOOxdk00OOOOxdkkoodoloxOdcokl.........      ..              ...:xo.       ......  ..........................:k0
//00d.                                    .cdkx'      ,xKkookx,             ...cxddxkd;',::lk0xoxOOkkxdxxxo::;,:ldxddxkx;.........  ....                ...;dc.      ...........   ... ................;k0
//00d.                                     .cdkl.     ;k0dcdk:.           .....:xkOkxxdl'':cldxdodxxOxolol;;:ccloodO0OOx;...............   ..          .. ..,l,.     ...   .....    ...................:k0
//00o.                                     .;dkx;.   .cO0dokl.            .....;OKKKK0kxdccdxxdoooocododkkc:lkkddodk000d;cooo:.....   ... .   .        ..   .,;.  .        .....   ....................:kO
//00o.                                      .cdxd'   ,x0Oxkx,            .col,.:OK0OxxOxxocdkkkddOOxk000Kd'.,lxooodOKK0Oxddx0k:..... .....             ....  ...      ..    ....      .................:k0
//00o.                                      .:kkOl. .oO00OOk;.        .,cdO0kloO00Oxooxxd:;:,;dOk0KOO0kdc;,;cldodxdx0KKKKKOddOk;...   ....           ..   ....       ...    .....     ...   ...........;xO
//00o.                                       .ldkk:.lOxxkxxk:.        .lO0000O000Oxl;:dOd,;:''o0KK00Kkd:',:loldOOk;.:x0KKKKOodx,...........                ...        .      .....          ...........:kO
//00d.                                        ;xO0xcdkxxkxxd'         .;xOkO0KKK0d;...o0Oc,,,,ckOOkk000kdccloox0kc...,lkKKK0xod;...........      .       .. .        ...       .            ...........:kO
//OOd'                                        .cdxkl;okOO00O:.         ;xOxxk0K0xl,...cOKOc.';d0xxkdoxk00xlox0K0Oc.;odod0KK0xxo'..... ....               .  .  ..    ....         ...      ............:kO
//OOd'                                        .lkOkdxOkxxxl,.          .,lkkkkOOxdxxc..ck0OoldOOc;c:..,lOOO0K0Od;..;oooxOKK0Ox;.. .....        .   ...     ...  ...   ...       .......   .............;kO
//0Ox,                                        .:odox0OddOOl.             .ckxdk0Oxdd;. .;cdO0Od;........'';cc;,.....:dddkKKK0l... .......    ..    ...      ......    ......    ...       .............:kO
//00x,                                        'odcldxxkO0k;.              'dkdx00Oxkc.    .,;'..           ..........ldokKKKO;..........    ...              ....    ........   ..        .............:kO
//00x,                           .            'lddxdxkkkd:.                .cxk0KOOk:.             ..      ...  .....'oO0KKKx,.......       ...       ....    ..........,;,,'....             .........ckO
//00k,                         'ldl,        ..,:okkkxxo;.                   .o00000o.              ..            .....;k00KKd..........       ..      ... .    ....'cc;';ccll:'..    ..       .........ckO
//00k;.                      .,ck0Od;.    .,col;cddxooo;.                   .:OK0OOl.                            ......o0000l........ ..      ...  .....  ........,:l:,:ccodollc'.   .....  .   .......ckO
//00x,                      .ckkkOOO0d.    ......cddooxd'                   .,kK0kko.                            ......lO0K0l...........      ...  ..   ........'ldololoc';:clodd;. ...... ..    ......:kO
//00k;                    ....;coxkxl,....       .;oooxkc.                   'xK0xkd.                           .......lkOK0l...........                .....  ..cxdoxd:.. .,lolod;..      ....    ....:kO
//00k;                ...,ld;..':lxo'.;xkl'..     .';lxkx,                   .dK0xkd.                          ... ....oOOK0o............                      ..cxolodc.....:oooxo.        . ..   ....:kO
//K0k;.              .;xkkOkdllllodxxxk00Okx:.      .:kOOo.                  .oKKxkd.                              ....lxx0Kd.............                      .'cdlcol:ll...:ooxx,.       . ..    ...:kO
//KKO;.              .;oxOOxdlc:::clloxOOxdo;.       .lkOOc.                 .l0Kkkx'                             .....:xx0Kx'......   ...                      ...,:cldxxc.  .':dd,.                ..:kO
//KKk;                 ..:xo,..,coxl'.;oo,..          'dOOk,                 .c0Kkxx;                                ..;xxkKO;........ ..                       ..:oddoc;'.....;;:l.                  .cOO
//00x,                  ....   ,lx0d.  .....          .:xkOl.                 ;OKOxkc.                                .,xxx0Oc...........               .....   .lkxdodx:.:do,':,...           ....   .:kO
//00k;                 .coc.   .:dOd'   ,odl'...       .oOOk:.                ,kK0kko.                                 'dxx00l.......  .                ..      .oxoollxl'lxl:cl;.            .;llc:'..:kO
//00O;             .;lloO0xc;::cldkxlcccdkOOxxko'       ,dxkd'                .d00Okx'                                 .okx00o.....     .               ..      ..;:cloo'.,lol:'.             ..''''...:kO
//KKO:.           .;k0000kolodxkkkxddxO0OkOOOO0k;       .ckOOl.               .cO0Okkc.                                .cxk0Kx'....                               .,odo,..:ooo:.                      .:kO
//KKO:.            .;llx0Od;'',;cclc;,::cdO0o;,.         .oxxk:.               ,k0Okko.                                .;xO0Kk,....                               .cddl:lc;;cd:.                      .:kO
//K0O:.               .,ldc.   'cdOx'   .,cc'             ;xkOx'               .d0000k;                              ...,x000O:....                               .:doccll::l;.                       .;xO
//00Oc.                 ..     .cokx,                     .cxxkl.              .l000Okl.                               .,x0000c.   .                               .;c:;cc;;cc'..                     .;xk
//K0Oc.                        .:okk,                      'oxkx;              .l000Okd,.                              .;k0KK0o.                                     .,odc;col:::;.                   .:xk
//K00l.                      ..'cokk;                       :xxko.             .dOOkxxkd:'.                            .lO0000x,                                      .oxlclcclol;.                   .ckk
//KK0l.                     .;;,:ldx;                       .lkkk:.            ,xxdoc,;oxd:.                           'd00K00k:.                                     .lo:co;....                     .ckk
//KK0l.                      .;lllllo:.                      ,dxkx,           .cOxxx:'..lxd:.                         .,d00Oxooo,                                     .coclo:.                        .:kk
//KK0l.                       .;::ooc;.                      .:xkOl.          ,xOxdxdc,.cxxd,                       .;ccdOOo:oxOo.                                    .:llxx;                         .ckk
//K00o.                        .clxk;                         'dkxx;          .cxkddol:cdxd:.                      .coddkOx:cxkko'                                    .,cccc'                         .ckk
//K00o.                        .:lxk;                         .:xxkd.          'oxxdoooool,.                       .:oxkdxo:lxko,.                                     .oxo:.                         .ckk
//000o.                        .:cdO:                          .oxxkc.          'clcloolloo:.                       .ldolool:c;..                                      .okxl.         ...             .:kk
//000o.                        .:cdO:                           ,odxd,          ,oxxkOkkkkko;.                      .;dxdodxdo;.                                       .oxdc.       .;lol,.           .:kO
//000l.                       ..:ldO:                   ..'..   .cxdxo.         .cdkO0Okkxdc.                       'oxOkk00OOx,                                       .oxoc.       ,dxxx:.           .ckk
//00Ol.                     .'c::cdO:.     .'.        .'okkkl.   .lddk:.       '::coxOkxddo,                        ,oldOOO00kd;                                       'dxoc.   .','.:dd;.            .:kk
//OOOo.                     .;c;:cdOl.   .,c:'.      .;oxddko'    ,dxxd'       'ddlclxkxxd,                         .cookOOOxdl.                                   ..  'oddc.  .;xkxlldkdl'           .ckk
//OOOo. ..                 .;ol,:co0l.   .,l:'.      .lkOko:.     .:dodl.      .:xo;;ldkxo'                          ,odkOOko:.              .;:,.   ..          .,lc. ,:cdl.  .;cdd:,:dxc.           .ckk
//OOOo;col;....          .';cc:,:coOl.    .c,        .oOkxx:.      .lddx:.      .cl,;oxkxl'                          .lxOOOxl'             .:xOOkd:;cdd:.      .;c:lo,'lccxl..,:cdkd, ....         ....:kk
//00OdokOko:ldl'      ..',:,,;;,,,cxl'....:oc.      .:xOkkxc.       ,lloo'       .::;dkOdl,                          'lxOOxdo'             .dOOkxxkxdxxc.    .'cldl:oo,;;,ol',cooccc.              .l;.:kk
//OOOd,:kOkxddo,     ..,:::c:;::'.:olc:;;ccc:'';:'.'colcdOOo.       .cddxc.       ,:;lxOdl;                .         'lxOxldd.             .,ll;..lkxxd;.   .,:cdkx:co,.,,c:,coc;,cc'.             .od:lkk
//OOOd'.cxdol;,'.  .'::,;:;cl::c;,c::lc;clc:cc;,c:;:lc,..,,.         .looo,       .:;:dOxo:.                         ,oxOo:dl.                    ,llokkl. 'cl;.'oko:l:.,;,;;::;clcol;.            .:xxxkk
//OOOd' ..'cddlc;..'clool:looooc;;;;ll:;clcccl:,'';,;l,               ;ddxl.       ;c:okxlc.                        .:dkxclx:                      ..:xkxc;;;loc:dkxcl:.;;,:'';cl::coo:.   ....     .cxkkk
//OOOd'.'coollddc,'ckxllocc:cllo:;,;cll;,;::c;,;;,,',o;   .           .cood;       '::cxklc,                        .cdxd:od'                        .;llol,:xx:'cxkc:;,c;;c'.':cc:cl;'..,::;::..    .:dkk
//0OOd'.lkOOd;,lc,:cll;:lcc:::;c:;c:,:lc;;:c:;;c:..'cc. .,:.           'oddo.      .:::dklc;                        'lddc:oc.                          .cxdldkl'.cxkl;;cl;:c:;,;:clo:.  .co;.';'. ..  .lkk
//0OOx,.,oxxc....;cc;,,,;::;;;:cc:cc:;:cccc:;,,,;:,cl;..;ccc:'          ;llo:.     .;:,oklc:.                       ;loo;co'                ..      ..';okl',:lodkkkl;:lc',:,..':c;;;;;;:c:.    .:ll;..lkk
//OOOx;;dxddol:;'.''''.',,'....,ldl;..',,,;,...;cllool;..,::.     .;;.  .cddd;      ,:'ckoc:.                      .:lol;ol.              'cdd:,;;:llollxko;,:oddxkkl:ll:,::;,,;:c:'.'::;,::;,,:odddl'.okk
//OOOx;cOOx::ooo:..........,;,.':lccc:::;,::....',:cllc::;;;,....,okkd,  ,lodo'     'c,:xdl:.                      .:oo;:d;              .oOOOkxkxdol:;;c:,'.',,;:cllodolllooc,,;llcccc:''coooooddoo:..okk
//OOOx;.;lc,.;ccc:,;loddollooc;,;clc::cclooc;'...'cc,:cloooolcldddxxl:.  .cxxxc.    .:;:xdl;.                      .cdo;lo.              'oxkkOkdc,... .,'........',:::oxolclolc:;;:clcllc:;,',::;cdo''okk
//OOOk:. ...,colll;;:coxo::ccll:cool:cddxo:,...';cddl:'..''..;dxdoxd:.    .lodo,    .:;;xxl;                       'ldocd:.               .:xxo;.    .':cc,.   .....;,';::ccccccc;,;,.,;:olc:'....:do;,okk
//OOOkc. ..,cclloool;':xkxodkxoloxxlc:;;:,,;'..:ll:;;'... .  .,,':dkx:.    ;ddxo.    ;::xxo;                       ,lxddo.                .ckxdl'  ..'colooc;'......,;;;;:oc',ll;.,:,''';o:':cc;'''::''okk
//OOOkc..,',c::dddxo;;cxxooxdlllol;''',,;;;,.'';,'..',''.;c.     .:c;.     .:ood:.   ':cxxo,                       ,dxddc.                 .:ll:..,:;'''';;:oo:'.','..;cc:ldl:;;;;:cllc:cdo,;c:clc..  'okk
//OO0O:....,c::dkdlodxxo;,;,'';,,,;;,,;;,,'......''',cll:cl'                'oddd'   ;lcdkd;.                      ;xkdo;                        .c:;;,'..''';::,'..'......':clolclcclooclxlldlcoo,.. 'dkk
//OOOk:. ...',,;c:,.',,'.....',,,;;;,..',,'''''',;cllll;;lo;                 ;oloc. .coldkkl.                     .okkdo;                        ,l:;coolc;'..'''''...''',''....'''......';cclc::;... ,dkk
//OOOOc. .............................';;:::ccc:;;;;col:clo:                 .cddd;.'oooxkOx:.                   .lkkkdo:.                      .:dl:,;ldddlc;:;,,''','..............'',............. ,dkk
//0OOOc.  ...............'.........'.',,;;:cc;,,'...',,,loo:                  'clol,cxodkkkkx;                  .:kkkOdlc.                      .ldc:,'';::;:::;,;;;,,,''''....''''.......'''..''','. ;xkk
//00OOl.  .'''.....   ...'''',;,;,,:;::,:;;;,''.. ...''':lc,        .          ;ddxl:oloxodkkd'                 .lkOkxdll,                      .ldc:,,.......',,'';:;;;,:;;:;:;;,''..    ... .';;,.  ;xkk
//00OOl.  .;c;.      ...'......','.''',',,,;,,,;'.      ,l:.       .;.         .cloo;;:;::codo'                 ,cllcllcc;.                     .:oc'......  .......''''';'''.''.......        .:c'   ;xkk
//0OOOl.   .'.    ..',',;,,;,',,,,,'';::cccclc:;c:'.     ..                     'oodl;;:colclc'              .';coooll::locc;..                  .,'.     ..,,'','''..''''.....'......'..       ..    :xkk
//0OOOc.       .';:c:;:cc::::::::ccc:cllloloollccllc;'..                ......''':loo:,:lodoclc.           .:dxxdxkdollooodllool:'.                   ..',,:c:::::::;;;:::;;:::;;,,,;;:::;;..        .cxxx
//0OOOl.    ...;loooollllllllllloooolllloooolllllllllcc;.              .,,,,;:::::lddo:cl:ldlld:.         .cxdoodxxdlloollc;cc:cllllc:;,'''.         'clollollollllllllllllcclcccc:ccllccclcc,.      .lxxx
//OOOOl.    .cc,;;;;;;,,,;;;;::::::ccc::cccc:::c::::cc::::'            ..;;;cc:::;;cooc,'',;cll'          .lxolcl;,:c,,l:,,,;;,'',cc:lc::cc:'     .';coolllllllccclcccccccccc:::::;;:::;;:;;;;;,.    .:xxk
//OOOOl.    .:,..  .....  ..............................':,     'cllccccclolollollloolc::::cccc:;;::::;;:::cllcloc:::;;cc:c:::ccccllcccclooo;.    .ll;,,,,',,,'''','..'''..''.................'c,    .:xxk
//O00Ol.    .;;....'''.'....',,,',,,,,',,,,,'''''''''',,,:;     'coollloooooooooooooooolclloooooooooooooooooooddoddoooodddddddoodooooooooddo:.    .ll,'.....'''''..........''..............'.';l,     :xxx
//O00Od;:cc::llllooooloolllclloooooooooolloooolloollllolllc'......;oooooddooooooooddddooloool:cooooloooc:clllloolllloooooooooooolooooooooo:.......,llcc::c::c::cccc::ccccccccc:::::::::::ccccclc;'.''':xxk
//O000d;:looollllloooooolloolloodddddddoooddddddddooooooooddoool,.;oc:okxooo:col:ldlcdkkkocll;locoxdllo:;oxdl::lcldocokdlclllxxllllodooodk:..cooooooddddodooooooooddoooooooooolllllllllllllllllllllllclxxx
//O000d'.,odllcc,,lolllooolllllolooooddddddooooooolll::llooool;.. ;dc',ldool.,ol;:oc';dkd;.::'cl'.coclo,.cxxl..c;.:c';dd,.:;.:;,oo:;,cdc;o:. .,cooooooooooooooddddoccloooolloollllllllllllllllcllll:..cxxx
//OOOOd'.;o;'::c'.;;cc:dkxc,';:c:;ccdOOxclxo:lolc::co;,lc::coxc.  ,oll;.;cdl..,cdxdl:':do:.:c'loc;':lod;.cxko'.:;';c,'lx;.;,,:.;xkd;,oOd,::.  'odoooddldkxoooollldd:cxxloxkxo:ldo:::odc:;cllc;;:cc::..cxxx
//OO00x,.,o:',:c'..'okxkOxo:',od;.,,ckko,'od:,;c,.,co,'lo:':dxc.  ,oodd;.,ol.';lddolo:':ol'::'clod;.,ld;.cxko..:lcclc':d,.:;,;.;xkx;,dkl.;:.  'l;;oodc,oxc;oc;'',:o;:xl',oxko,';;...coc;,''::.,;..':.,dxxx
//0000k;.'lc;,.'..''ldxOOOOx,,dk:':,;ddll,;loo,;lc,'c,'okc'lkkl.  'ollxxc;oc.;ol;:oldd;cxc.;:.:clxd;,co,.ckkl..:l:okd,'c,.c;,c;,llol;:l;;o:.  ':',llo:,dd;:dc,',,;l,;lc;.:xko:'.'...:l:;cc.';.',..':';dxxx
//O00Ok:..ccccllccolclxOOOOxc:dkl:llloldkl:coxoccc::c:;ox:,looc.  .lddxkkxxdooddodxdxkxxkdlooloooxxdodolcoxkdccllldkxocolcoooddoooxkdolool;.  'l:;:;l:,:c::l::;:c:c,':oo,;dxc::::,,,;::;:dl:c,,,;;;:.'oxxx
//O00Ok;.,colllloolllllllooooooooooddooooollloolllllllllolllcc:...;loollllllooooooooooooooooloolllllllllcclllllloloooollllllllllllllllcccl;.. .ldolodollodoooolllllcclddollolcllllllccccclllccccc:;,..:xxx
//OOOOkc,looollloooooolloooooooddddddddddoooollllllllllllloolool;lxkxxxxxxxxxxxxxxxxxxxxxxxxxxdddddddddddoooddddddddddooooooooooddoooooodddd:';loooooooooooooooollolloodollllclccccccccccccc:::::::;;':xxd
//OOOOOxc:;;;,,,,,,;;,,,,,;;;;;;;;;;;;;;;;,,,,,,,,,,,,,,,,,;;;;;,;:;;;;;:dkkkkkxl:::::::::::::::::::::;;;;::::::cc::::::::::::::::::::::::::'';:::::::::::;;::;;;;;;;;;;;;;;,,,,,,,,'''''''''.......,;lxxx
//OOOOOOOOOOOOkkkxxkxxxxxxxxxxxxdddddddoddooolllllooooooollllollloolcclllxkkkkkkocccc:ccc::::::::::;;;;,,,;;,,,;;;;,,;;,,,,,,,,;;,,,;,,,,,,,;;;;;;;;;::::::::::::::::::::::::::::::ccccccclllllclllllodxxx
//OOOkxO0000000OOOOOOOOOOOOOOOOOOOOOOOkkOOOkkkkkkOOkkkkkOOOOkkOOOOkkkkkkkkkkOkkkkkxkkkkkkkkkkkkkkkkkxxkxxxxkxxxkkkkkkkkkkxxxxxkkkkxkkxxxkxxxkkkkkkkkkkkkkkkkkkkkkkxxkkkkkkkkxxxxxxxxxxxxxxxxxxxxxxxdloxxxx

//The place was dark and dusty and half-lost
//In tangles of old alleys near the quays,
//Reeking of strange things brought in from the seas,
//And with queer curls of fog that west winds tossed …

//01000100 01100101 01100001 01110010 00100000 01010111 01100001 01101110 01100100 01100101 01110010 01100101 01110010 00101100 00001010 00001010 01010111 01100101 00100000 01101001 01101110 01110110 01101001 01110100 01100101 00100000 01111001 01101111 01110101 00100000 01110100 01101111 00100000 01101010 01101111 01101001 01101110 00100000 01110101 01110011 00100000 01100010 01100101 01100011 01100001 01110101 01110011 01100101 00100000 01110111 01100101 00100000 01101000 01100001 01110110 01100101 00100000 01100010 01100101 01100101 01101110 00100000 01110111 01100001 01101001 01110100 01101001 01101110 01100111 00100000 01100110 01101111 01110010 00100000 01111001 01101111 01110101 00100000 01100001 01101100 01101100 00100000 01110100 01101000 01101001 01110011 00100000 01110100 01101001 01101101 01100101 00101110 00100000 01010111 01100101 00100000 01101000 01100001 01110110 01100101 00100000 01110011 01100101 01100001 01110010 01100011 01101000 01100101 01100100 00100000 01110100 01101000 01100101 00100000 01100100 01100001 01110010 01101011 01100101 01110011 01110100 00100000 01100100 01100101 01110000 01110100 01101000 01110011 00100000 01101111 01100110 00100000 01111001 01101111 01110101 01110010 00100000 01101101 01101001 01101110 01100100 00100000 01100001 01101110 01100100 00100000 01110011 01101111 01110101 01101100 00100000 01110100 01101111 00100000 01100110 01101001 01101110 01100100 00100000 01101111 01110101 01110100 00100000 01101001 01100110 00100000 01111001 01101111 01110101 00100000 01100001 01110010 01100101 00100000 01100001 01101100 01110010 01100101 01100001 01100100 01111001 00100000 01110000 01110010 01100101 01110000 01100001 01110010 01100101 01100100 00100000 01110100 01101111 00100000 01101010 01101111 01101001 01101110 00100000 01110100 01101000 01100101 00100000 01100100 01100001 01110010 01101011 00100000 01110011 01101001 01100100 01100101 00101110 00100000 01000010 01110101 01110100 00100000 01110111 01100101 00100000 01100001 01110010 01100101 00100000 01100111 01101100 01100001 01100100 00100000 01110100 01101111 00100000 01110011 01100101 01100101 00100000 01110100 01101000 01100001 01110100 00100000 01111001 01101111 01110101 00100000 01100001 01110010 01100101 00100000 01110011 01110100 01101001 01101100 01101100 00100000 01101111 01101110 00100000 01101111 01110101 01110010 00100000 01110011 01101001 01100100 01100101 00101100 00100000 01100010 01110101 01110100 00100000 01101010 01110101 01110011 01110100 00100000 01101001 01101110 00100000 01100011 01100001 01110011 01100101 00100000 01111001 01101111 01110101 00100000 01100100 01101111 00100000 01100100 01100101 01100011 01101001 01100100 01100101 00100000 01110100 01101111 00100000 01110100 01110101 01110010 01101110 00100000 01110100 01110010 01100001 01101001 01110100 01101111 01110010 00100000 01101111 01101110 00100000 01111001 01101111 01110101 01110010 00100000 01100110 01100101 01101100 01101100 01101111 01110111 00100000 01101000 01110101 01101101 01100001 01101110 01110011 00101100 00100000 01110111 01100101 00100000 01110111 01101001 01101100 01101100 00100000 01100001 01101100 01110111 01100001 01111001 01110011 00100000 01100010 01100101 00100000 01101000 01100101 01110010 01100101 00100000 01100110 01101111 01110010 00100000 01111001 01101111 01110101 00101110 00001010 00001010 01010011 01101001 01101110 01100011 01100101 01110010 01100101 01101100 01111001 00100000 01111001 01101111 01110101 01110010 01110011 00101100 00001010 00001010 01001101 01101111 01110010 01110100 01101001 01110011
//https://t.me/MortisPortal
//01101101 01101111 01110010 01110100 01101001 01110011 00110001 00110001 00110110 00111001 00110110 00110001 00111000 00110100 00110011 00101110 01110111 01110000 01100011 01101111 01101101 01110011 01110100 01100001 01100111 01101001 01101110 01100111 00101110 01100011 01101111 01101101

// DEV: Mortis





pragma solidity ^0.6.0;

abstract contract Context {
    function _msgSender() internal virtual view returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal virtual view returns (bytes memory) {
        this;
        return msg.data;
    }
}

interface IERC20 {
    function totalSupply() external view returns (uint256);


    function balanceOf(address account) external view returns (uint256);

    function transfer(address recipient, uint256 amount)
        external
        returns (bool);


    function allowance(address owner, address spender)
        external
        view
        returns (uint256);


    function approve(address spender, uint256 amount) external returns (bool);


    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );
}


library SafeMath {

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }


    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }


    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }


    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }


    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;

        return c;
    }

    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }


    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}


library Address {

    function isContract(address account) internal view returns (bool) {
        bytes32 codehash;


            bytes32 accountHash
         = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        assembly {
            codehash := extcodehash(account)
        }
        return (codehash != accountHash && codehash != 0x0);
    }


    function sendValue(address payable recipient, uint256 amount) internal {
        require(
            address(this).balance >= amount,
            "Address: insufficient balance"
        );

        (bool success, ) = recipient.call{value: amount}("");
        require(
            success,
            "Address: unable to send value, recipient may have reverted"
        );
    }


    function functionCall(address target, bytes memory data)
        internal
        returns (bytes memory)
    {
        return functionCall(target, data, "Address: low-level call failed");
    }

    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return _functionCallWithValue(target, data, 0, errorMessage);
    }


    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return
            functionCallWithValue(
                target,
                data,
                value,
                "Address: low-level call with value failed"
            );
    }


    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(
            address(this).balance >= value,
            "Address: insufficient balance for call"
        );
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(
        address target,
        bytes memory data,
        uint256 weiValue,
        string memory errorMessage
    ) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{value: weiValue}(
            data
        );
        if (success) {
            return returndata;
        } else {
            if (returndata.length > 0) {

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}


contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );


    constructor() internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }


    function owner() public view returns (address) {
        return _owner;
    }

    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }


    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }


    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(
            newOwner != address(0),
            "Ownable: new owner is the zero address"
        );
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}


interface IUniswapV2Factory {
    function createPair(address tokenA, address tokenB) external returns (address pair);
}

interface IUniswapV2Pair {
    function sync() external;
}

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);
    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
      address token,
      uint liquidity,
      uint amountTokenMin,
      uint amountETHMin,
      address to,
      uint deadline
    ) external returns (uint amountETH);
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
}

    contract Mortis is Context, IERC20, Ownable {
    using SafeMath for uint256;
    using Address for address;


    string private _name = "Mortis";
    string private _symbol = "MTS";
    
    uint8 private _decimals = 8;

    mapping(address => uint256) internal _reflectionBalance;
    mapping(address => uint256) internal _tokenBalance;
    mapping(address => mapping(address => uint256)) internal _allowances;

    uint256 private constant MAX = ~uint256(0);
    

    uint256 internal _tokenTotal = 13151820919e8;
 
    uint256 internal _reflectionTotal = (MAX - (MAX % _tokenTotal));

    mapping(address => bool) isTaxless;
    mapping(address => bool) internal _isExcluded;
    address[] internal _excluded;
    
    uint256 public _feeDecimal = 0;
    // thats the distribution to holders (400 = 4%)
    uint256 public _taxFee = 0;
    // thats the amount for liquidity pool
    uint256 public _liquidityFee = 0;
    // this amount gets burned by every transaction
    uint256 public _burnFee = 0;
    // this goes to a specific wallet (line 403)
    uint256 public _marketingFee = 100;

    uint256 public _taxFeeTotal;
    uint256 public _burnFeeTotal;
    uint256 public _liquidityFeeTotal;
    uint256 public _marketingFeeTotal;

    address public marketingWallet;

    bool public isTaxActive = true;
    bool private inSwapAndLiquify;
    bool public swapAndLiquifyEnabled = true;
    
    uint256 public maxTxAmount = _tokenTotal;
    uint256 public minTokensBeforeSwap = 10_000e8;
    
    IUniswapV2Router02 public  uniswapV2Router;
    address public  uniswapV2Pair;

    event SwapAndLiquifyEnabledUpdated(bool enabled);
    event SwapAndLiquify(uint256 tokensSwapped,uint256 ethReceived, uint256 tokensIntoLiqudity);

    modifier lockTheSwap {
        inSwapAndLiquify = true;
        _;
        inSwapAndLiquify = false;
    }

    constructor() public {
       
        IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); // for Ethereum
     
        
        
        uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
            
        uniswapV2Router = _uniswapV2Router;
        
        marketingWallet = 0x07787eEe546dcF3630aB182E9563D0bf199B4722;
       

      
        isTaxless[_msgSender()] = true;
        isTaxless[address(this)] = true;

        _reflectionBalance[_msgSender()] = _reflectionTotal;
        emit Transfer(address(0), _msgSender(), _tokenTotal);
    }

    function name() public view returns (string memory) {
        return _name;
    }

    function symbol() public view returns (string memory) {
        return _symbol;
    }

    function decimals() public view returns (uint8) {
        return _decimals;
    }

    function totalSupply() public override view returns (uint256) {
        return _tokenTotal;
    }

    function balanceOf(address account) public override view returns (uint256) {
        if (_isExcluded[account]) return _tokenBalance[account];
        return tokenFromReflection(_reflectionBalance[account]);
    }

    function transfer(address recipient, uint256 amount)
        public
        override
        virtual
        returns (bool)
    {
       _transfer(_msgSender(),recipient,amount);
        return true;
    }

    function allowance(address owner, address spender)
        public
        override
        view
        returns (uint256)
    {
        return _allowances[owner][spender];
    }

    function approve(address spender, uint256 amount)
        public
        override
        returns (bool)
    {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public override virtual returns (bool) {
        _transfer(sender,recipient,amount);
               
        _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub( amount,"ERC20: transfer amount exceeds allowance"));
        return true;
    }

    function increaseAllowance(address spender, uint256 addedValue)
        public
        virtual
        returns (bool)
    {
        _approve(
            _msgSender(),
            spender,
            _allowances[_msgSender()][spender].add(addedValue)
        );
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue)
        public
        virtual
        returns (bool)
    {
        _approve(
            _msgSender(),
            spender,
            _allowances[_msgSender()][spender].sub(
                subtractedValue,
                "ERC20: decreased allowance below zero"
            )
        );
        return true;
    }

    function isExcluded(address account) public view returns (bool) {
        return _isExcluded[account];
    }

    function reflectionFromToken(uint256 tokenAmount, bool deductTransferFee)
        public
        view
        returns (uint256)
    {
        require(tokenAmount <= _tokenTotal, "Amount must be less than supply");
        if (!deductTransferFee) {
            return tokenAmount.mul(_getReflectionRate());
        } else {
            return
                tokenAmount.sub(tokenAmount.mul(_taxFee).div(10** _feeDecimal + 2)).mul(
                    _getReflectionRate()
                );
        }
    }

    function tokenFromReflection(uint256 reflectionAmount)
        public
        view
        returns (uint256)
    {
        require(
            reflectionAmount <= _reflectionTotal,
            "Amount must be less than total reflections"
        );
        uint256 currentRate = _getReflectionRate();
        return reflectionAmount.div(currentRate);
    }

    function excludeAccount(address account) external onlyOwner() {
        require(
            account != address(uniswapV2Router),
            "ERC20: We can not exclude Uniswap router."
        );
        require(!_isExcluded[account], "ERC20: Account is already excluded");
        if (_reflectionBalance[account] > 0) {
            _tokenBalance[account] = tokenFromReflection(
                _reflectionBalance[account]
            );
        }
        _isExcluded[account] = true;
        _excluded.push(account);
    }

    function includeAccount(address account) external onlyOwner() {
        require(_isExcluded[account], "ERC20: Account is already included");
        for (uint256 i = 0; i < _excluded.length; i++) {
            if (_excluded[i] == account) {
                _excluded[i] = _excluded[_excluded.length - 1];
                _tokenBalance[account] = 0;
                _isExcluded[account] = false;
                _excluded.pop();
                break;
            }
        }
    }

    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) private {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) private {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");
        require(amount > 0, "Transfer amount must be greater than zero");
        
        require(amount <= maxTxAmount, "Transfer Limit exceeded!");
        
        uint256 contractTokenBalance = balanceOf(address(this));
        bool overMinTokenBalance = contractTokenBalance >= minTokensBeforeSwap;
        if (!inSwapAndLiquify && overMinTokenBalance && sender != uniswapV2Pair && swapAndLiquifyEnabled) {
            swapAndLiquify(contractTokenBalance);
        }

        uint256 transferAmount = amount;
        uint256 rate = _getReflectionRate();

        if(isTaxActive && !isTaxless[_msgSender()] && !isTaxless[recipient] && !inSwapAndLiquify){
            transferAmount = collectFee(sender,amount,rate);
        }

        _reflectionBalance[sender] = _reflectionBalance[sender].sub(amount.mul(rate));
        _reflectionBalance[recipient] = _reflectionBalance[recipient].add(transferAmount.mul(rate));

        if (_isExcluded[sender]) {
            _tokenBalance[sender] = _tokenBalance[sender].sub(amount);
        }
        if (_isExcluded[recipient]) {
            _tokenBalance[recipient] = _tokenBalance[recipient].add(transferAmount);
        }

        emit Transfer(sender, recipient, transferAmount);
    }
    
    function collectFee(address account, uint256 amount, uint256 rate) private returns (uint256) {
        uint256 transferAmount = amount;
        
        //@dev tax fee
        if(_taxFee != 0){
            uint256 taxFee = amount.mul(_taxFee).div(10**(_feeDecimal + 2));
            transferAmount = transferAmount.sub(taxFee);
            _reflectionTotal = _reflectionTotal.sub(taxFee.mul(rate));
            _taxFeeTotal = _taxFeeTotal.add(taxFee);
        }

        //@dev liquidity fee
        if(_liquidityFee != 0){
            uint256 liquidityFee = amount.mul(_liquidityFee).div(10**(_feeDecimal + 2));
            transferAmount = transferAmount.sub(liquidityFee);
            _reflectionBalance[address(this)] = _reflectionBalance[address(this)].add(liquidityFee.mul(rate));
            if(_isExcluded[address(this)]){
                _tokenBalance[address(this)] = _tokenBalance[address(this)].add(liquidityFee);
            }
            _liquidityFeeTotal = _liquidityFeeTotal.add(liquidityFee);
            emit Transfer(account,address(this),liquidityFee);
        }
      
        //@dev burn fee
        if(_burnFee != 0){
            uint256 burnFee = amount.mul(_burnFee).div(10**(_feeDecimal + 2));
            transferAmount = transferAmount.sub(burnFee);
            _tokenTotal = _tokenTotal.sub(burnFee);
            _reflectionTotal = _reflectionTotal.sub(burnFee.mul(rate));
            _burnFeeTotal = _burnFeeTotal.add(burnFee);
            emit Transfer(account,address(0),burnFee);
        }
        
        //@dev Marketing fee
        if(_marketingFee != 0){
            uint256 marketingFee = amount.mul(_marketingFee).div(10**(_feeDecimal + 2));
            transferAmount = transferAmount.sub(marketingFee);
            _reflectionBalance[marketingWallet] = _reflectionBalance[marketingWallet].add(marketingFee.mul(rate));
            if (_isExcluded[marketingWallet]) {
                _tokenBalance[marketingWallet] = _tokenBalance[marketingWallet].add(marketingFee);
            }
            _marketingFeeTotal = _marketingFeeTotal.add(marketingFee);
            emit Transfer(account,marketingWallet,marketingFee);
        }
        
        return transferAmount;
    }

    function _getReflectionRate() private view returns (uint256) {
        uint256 reflectionSupply = _reflectionTotal;
        uint256 tokenSupply = _tokenTotal;
        for (uint256 i = 0; i < _excluded.length; i++) {
            if (
                _reflectionBalance[_excluded[i]] > reflectionSupply ||
                _tokenBalance[_excluded[i]] > tokenSupply
            ) return _reflectionTotal.div(_tokenTotal);
            reflectionSupply = reflectionSupply.sub(
                _reflectionBalance[_excluded[i]]
            );
            tokenSupply = tokenSupply.sub(_tokenBalance[_excluded[i]]);
        }
        if (reflectionSupply < _reflectionTotal.div(_tokenTotal))
            return _reflectionTotal.div(_tokenTotal);
        return reflectionSupply.div(tokenSupply);
    }
    
     function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
         if(contractTokenBalance > maxTxAmount)
            contractTokenBalance = maxTxAmount;
        uint256 half = contractTokenBalance.div(2);
        uint256 otherHalf = contractTokenBalance.sub(half);


        uint256 initialBalance = address(this).balance;

        swapTokensForEth(half); 

        uint256 newBalance = address(this).balance.sub(initialBalance);

        addLiquidity(otherHalf, newBalance);
        
        emit SwapAndLiquify(half, newBalance, otherHalf);
    }

    function swapTokensForEth(uint256 tokenAmount) private {
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = uniswapV2Router.WETH();

        _approve(address(this), address(uniswapV2Router), tokenAmount);

        uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
            tokenAmount,
            0, 
            path,
            address(this),
            block.timestamp
        );
    }

    function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
        _approve(address(this), address(uniswapV2Router), tokenAmount);

        uniswapV2Router.addLiquidityETH{value: ethAmount}(
            address(this),
            tokenAmount,
            0, 
            0, 
            address(this),
            block.timestamp
        );
    }
   
    function setPair(address pair) external onlyOwner {
        uniswapV2Pair = pair;
    }
    
    function setMarketingWallet(address account) external onlyOwner {
        marketingWallet = account;
    }

    function setTaxless(address account, bool value) external onlyOwner {
        isTaxless[account] = value;
    }
    
    function setSwapAndLiquifyEnabled(bool enabled) external onlyOwner {
        swapAndLiquifyEnabled = enabled;
        SwapAndLiquifyEnabledUpdated(enabled);
    }
    
    function setTaxActive(bool value) external onlyOwner {
        isTaxActive = value;
    }
    
    function setTaxFee(uint256 fee) external onlyOwner {
        _taxFee = fee;
    }
    
    function setBurnFee(uint256 fee) external onlyOwner {
        _burnFee = fee;
    }
    
    function setLiquidityFee(uint256 fee) external onlyOwner {
        _liquidityFee = fee;
    }
 
    function setMarketingFee(uint256 fee) external onlyOwner {
        _marketingFee = fee;
    }
 
    function setMaxTxAmount(uint256 amount) external onlyOwner {
        maxTxAmount = amount;
    }
    
    function setMinTokensBeforeSwap(uint256 amount) external onlyOwner {
        minTokensBeforeSwap = amount;
    }

    receive() external payable {}
}