Contract 0x00000000009726632680fb29d3f7a9734e3010e2 15

 

Contract Overview

Balance:
631.037596620719742719 MATIC

MATIC Value:
$559.23 (@ $0.89/MATIC)

Token:
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0xb7945ceed6aabe2c6a1236fd29f80cae45e51b2fb01785cdc4402359fa51d680Fill Quote Eth T...433695882023-05-31 13:38:012 hrs 16 mins ago0x35e0dedb252c5df8110125fa24ada738dc573fc5 IN  0x00000000009726632680fb29d3f7a9734e3010e25.800995874900017 MATIC0.052582496 163
0x5232ede0b21c53dae1f71abfb07636cb9ddd155a2410ccf10dc7bb6cdfd26320Fill Quote Token...433691022023-05-31 13:20:452 hrs 33 mins ago0x34f32b5f77c17efaa78809be2843504c55e8cebd IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.045759479 163
0xda8664ed65fe4a1f3e87c00552cff2d4a2d82889dd6f2d379da5fcbf8a6ce421Fill Quote Eth T...433641112023-05-31 10:22:565 hrs 31 mins ago arshia15.crypto  IN  0x00000000009726632680fb29d3f7a9734e3010e211 MATIC0.035127287 221
0xc6b18d6cd54631a415c014f8472851de081068504fabd263b218badb29fc32d5Fill Quote Token...433640692023-05-31 10:21:285 hrs 33 mins ago arshia15.crypto  IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.0777609 180
0xeae547f11b957f931fff5a63ca0ce02260f45eb4288d9b8814ffb2e6d7a7f4ffFill Quote Token...433640162023-05-31 10:19:365 hrs 34 mins ago arshia15.crypto  IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.059318169 183
0x00159c2351f79576db387e79d3314f8749f910405a27591a181a5368f323fbb9Fill Quote Token...433628102023-05-31 9:35:576 hrs 18 mins ago0x452090cfc6c6325fb7d52ae047211b18324dcadd IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.04147362 162
0x259c0950cdac1f7b610ae8a52773bca090d27ed29fc608946b083107fbe0e2d8Fill Quote Token...433592222023-05-31 7:28:188 hrs 26 mins ago0xa7695a6fb16b0d20d7aa4eb6615ed86f33c3e01a IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.07382445 210
0xe5271e573491c4fe15d14b9deec42f0c9acc0e166c273f4c827df321f8b3d0e7Fill Quote Token...433586812023-05-31 7:09:088 hrs 45 mins ago0x5448143adbf49a46d0f3af342e678facf1cde7f7 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.039074672 208
0x81de990e1a8179f6a128f528b1e3ba31bf8473abdd9793a59bbda673cdcfa63dFill Quote Token...433523872023-05-31 3:23:0712 hrs 31 mins ago0x1087cdc564d4afc50363d498e9ad69f29c08ff12 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.073247802 159
0x1b73967e93588b60ab63536de976a2afc10073575b9bc9dff1aca5ca08d8aa4dFill Quote Token...433481052023-05-31 0:48:2215 hrs 6 mins ago0x7a4d5d8c1e6e0f71ea4cf9f85e87ec344d7e5247 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.063873659 167
0x4e1b7a6432a33c64c5297af3855647a12c43866ce569cd44605aeacc61b3eeffFill Quote Eth T...433481032023-05-31 0:48:1815 hrs 6 mins ago0xbdfadf482c992ee848a198dd9b2b9d9620f29c40 IN  0x00000000009726632680fb29d3f7a9734e3010e230 MATIC0.05780204 167
0x9ea17db6763c1b3396f1e03009a9620ef09bdc0d9588c4aeab0da8a9bf0a8eabFill Quote Token...433480902023-05-31 0:47:5015 hrs 6 mins ago0xbdfadf482c992ee848a198dd9b2b9d9620f29c40 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.027792219 169
0x9660348135a1cc02e213575e5308d7bdc8e16a9fe043a9bf6d933bb8943794b4Fill Quote Token...433480762023-05-31 0:47:2015 hrs 7 mins ago0x06d98affaebf83a70e141e13c17522448f0384f6 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.084519034 167
0xfd2d3d374224329bd000409ed6f833f66a98ffffaba615041b1da34bc916de61Fill Quote Token...433478242023-05-31 0:37:5215 hrs 16 mins ago0x06d98affaebf83a70e141e13c17522448f0384f6 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.0650242 139
0x3b44fa04868f22ad466e30599fb822cbf2d0c03526d91f2a04aaa336cfa13a5dFill Quote Eth T...433477762023-05-31 0:36:1015 hrs 18 mins ago0xe768ee38fd6f0c477db600996407b250fca2a58f IN  0x00000000009726632680fb29d3f7a9734e3010e2380 MATIC0.026404335 159
0x26ae756c2849b1a96adbb2c7d40bfd3429de429ed871785be6bf711e0949c90bFill Quote Eth T...433477322023-05-31 0:34:3615 hrs 19 mins ago0x7a4d5d8c1e6e0f71ea4cf9f85e87ec344d7e5247 IN  0x00000000009726632680fb29d3f7a9734e3010e215 MATIC0.025364395 173
0xca8817221d1016495e07c12fc4246cb70cd33aab1f9070716ef43c32dc41dd8cFill Quote Eth T...433477132023-05-31 0:33:5615 hrs 20 mins ago0x36c4a22e3a1b5b63bc665f12649362638a40da22 IN  0x00000000009726632680fb29d3f7a9734e3010e24 MATIC0.024500418 139
0x723a914a69b639f04e1fc065bfc1b83085a750bbb6ce30602aad98acc04a5ef3Fill Quote Token...433477112023-05-31 0:33:5015 hrs 20 mins ago0x7a4d5d8c1e6e0f71ea4cf9f85e87ec344d7e5247 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.039539908 164
0xeeb9055e83a4b66e6439fb30f3dede97ca9facb23ad3c6d9c076317cdc7f18b2Fill Quote Token...433476832023-05-31 0:32:5215 hrs 21 mins ago0x7a4d5d8c1e6e0f71ea4cf9f85e87ec344d7e5247 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.07305544 164
0xe69cc5ab2984d5f233f0f0a431be589c90466dba490a105cb38fc6a6b457f5f3Fill Quote Token...433467872023-05-31 0:00:4715 hrs 53 mins ago0x7a4d5d8c1e6e0f71ea4cf9f85e87ec344d7e5247 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.02547197 158
0xfd0105facd98896a7cceb79e6b4d497eb5604de340b1ca6a1bbaa12a67edf5f6Fill Quote Token...433467682023-05-31 0:00:0715 hrs 54 mins ago0x7a4d5d8c1e6e0f71ea4cf9f85e87ec344d7e5247 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.053591479 157
0xf00cde87da347c487fa56791cfab6b715ebc5dc68338305f018e90e02866d9b4Fill Quote Token...433467612023-05-30 23:59:5115 hrs 54 mins ago0x7a4d5d8c1e6e0f71ea4cf9f85e87ec344d7e5247 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.057204558 153
0xb86a5f90eb23f7763455bf430abbb9b43eaa269d215a7f4b4c2cd866f16d5b9dFill Quote Token...433456262023-05-30 23:19:2016 hrs 35 mins ago0xedc62d8720a85a07354d47289b6afdedd004ac11 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.030253671 161
0x95680b358731b3a3caa4aabf0b2e96c2e7528c432d15e43d0483d7fac475c7d1Fill Quote Eth T...433455172023-05-30 23:15:2816 hrs 39 mins ago0xe768ee38fd6f0c477db600996407b250fca2a58f IN  0x00000000009726632680fb29d3f7a9734e3010e2670 MATIC0.031311217 179
0x3eb3e0846ac3400cadd6bcf53093f7ce754d83406203cfd4775713c506d7e0ecFill Quote Token...433454882023-05-30 23:14:2816 hrs 40 mins ago0x7a4d5d8c1e6e0f71ea4cf9f85e87ec344d7e5247 IN  0x00000000009726632680fb29d3f7a9734e3010e20 MATIC0.058272984 161
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xb7945ceed6aabe2c6a1236fd29f80cae45e51b2fb01785cdc4402359fa51d680433695882023-05-31 13:38:012 hrs 16 mins ago 0x00000000009726632680fb29d3f7a9734e3010e2 0x: Exchange Proxy5.75210299940507398 MATIC
0x5232ede0b21c53dae1f71abfb07636cb9ddd155a2410ccf10dc7bb6cdfd26320433691022023-05-31 13:20:452 hrs 33 mins ago 0x00000000009726632680fb29d3f7a9734e3010e20x34f32b5f77c17efaa78809be2843504c55e8cebd2.312596506005369444 MATIC
0x5232ede0b21c53dae1f71abfb07636cb9ddd155a2410ccf10dc7bb6cdfd26320433691022023-05-31 13:20:452 hrs 33 mins ago 0x: Exchange Proxy Flash Wallet 0x00000000009726632680fb29d3f7a9734e3010e22.332422093802692328 MATIC
0x578b840a77c1be4d56dfa99d0e9cbd1f6c43133bc00c87e9083de2f3fce26c75433690052023-05-31 13:17:192 hrs 37 mins ago 0x00000000009726632680fb29d3f7a9734e3010e2 0x: Exchange Proxy1.9780425 MATIC
0x578b840a77c1be4d56dfa99d0e9cbd1f6c43133bc00c87e9083de2f3fce26c75433690052023-05-31 13:17:192 hrs 37 mins ago 0xc0ab6e988fe7ba442d17a36d35723a6686f61386 0x00000000009726632680fb29d3f7a9734e3010e21.995 MATIC
0x1312b025fd70b2ef33b7c0a02cca6a2fc1653c64be287dbf9bc403671f2b23f6433655612023-05-31 11:14:574 hrs 39 mins ago 0x00000000009726632680fb29d3f7a9734e3010e2 0xc0ab6e988fe7ba442d17a36d35723a6686f6138620.932121202921978904 MATIC
0x1312b025fd70b2ef33b7c0a02cca6a2fc1653c64be287dbf9bc403671f2b23f6433655612023-05-31 11:14:574 hrs 39 mins ago 0x: Exchange Proxy Flash Wallet 0x00000000009726632680fb29d3f7a9734e3010e221.111569544046373075 MATIC
0xda8664ed65fe4a1f3e87c00552cff2d4a2d82889dd6f2d379da5fcbf8a6ce421433641112023-05-31 10:22:565 hrs 31 mins ago 0x00000000009726632680fb29d3f7a9734e3010e2 0x1111111254eeb25477b68fb85ed929f73a96058210.9065 MATIC
0x00159c2351f79576db387e79d3314f8749f910405a27591a181a5368f323fbb9433628102023-05-31 9:35:576 hrs 18 mins ago 0x00000000009726632680fb29d3f7a9734e3010e20x452090cfc6c6325fb7d52ae047211b18324dcadd94.82176636836516768 MATIC
0x00159c2351f79576db387e79d3314f8749f910405a27591a181a5368f323fbb9433628102023-05-31 9:35:576 hrs 18 mins ago 0x: Exchange Proxy Flash Wallet 0x00000000009726632680fb29d3f7a9734e3010e295.634660986752564478 MATIC
0x259c0950cdac1f7b610ae8a52773bca090d27ed29fc608946b083107fbe0e2d8433592222023-05-31 7:28:188 hrs 26 mins ago 0x00000000009726632680fb29d3f7a9734e3010e20xa7695a6fb16b0d20d7aa4eb6615ed86f33c3e01a44.419611968444407614 MATIC
0x259c0950cdac1f7b610ae8a52773bca090d27ed29fc608946b083107fbe0e2d8433592222023-05-31 7:28:188 hrs 26 mins ago 0x: Exchange Proxy Flash Wallet 0x00000000009726632680fb29d3f7a9734e3010e244.800415500196074245 MATIC
0x4e1b7a6432a33c64c5297af3855647a12c43866ce569cd44605aeacc61b3eeff433481032023-05-31 0:48:1815 hrs 6 mins ago 0x00000000009726632680fb29d3f7a9734e3010e2 0x: Exchange Proxy29.745 MATIC
0x9ea17db6763c1b3396f1e03009a9620ef09bdc0d9588c4aeab0da8a9bf0a8eab433480902023-05-31 0:47:5015 hrs 6 mins ago 0x00000000009726632680fb29d3f7a9734e3010e20xbdfadf482c992ee848a198dd9b2b9d9620f29c4029.027721846698842965 MATIC
0x9ea17db6763c1b3396f1e03009a9620ef09bdc0d9588c4aeab0da8a9bf0a8eab433480902023-05-31 0:47:5015 hrs 6 mins ago 0x1111111254eeb25477b68fb85ed929f73a960582 0x00000000009726632680fb29d3f7a9734e3010e229.276572714774425582 MATIC
0x9660348135a1cc02e213575e5308d7bdc8e16a9fe043a9bf6d933bb8943794b4433480762023-05-31 0:47:2015 hrs 7 mins ago 0x00000000009726632680fb29d3f7a9734e3010e20x06d98affaebf83a70e141e13c17522448f0384f645.89618206466276477 MATIC
0x9660348135a1cc02e213575e5308d7bdc8e16a9fe043a9bf6d933bb8943794b4433480762023-05-31 0:47:2015 hrs 7 mins ago 0x: Exchange Proxy Flash Wallet 0x00000000009726632680fb29d3f7a9734e3010e246.289644038994215602 MATIC
0x3b44fa04868f22ad466e30599fb822cbf2d0c03526d91f2a04aaa336cfa13a5d433477762023-05-31 0:36:1015 hrs 18 mins ago 0x00000000009726632680fb29d3f7a9734e3010e2 0x1111111254eeb25477b68fb85ed929f73a960582376.77 MATIC
0x26ae756c2849b1a96adbb2c7d40bfd3429de429ed871785be6bf711e0949c90b433477322023-05-31 0:34:3615 hrs 19 mins ago 0x00000000009726632680fb29d3f7a9734e3010e2 0x1111111254eeb25477b68fb85ed929f73a96058214.8725 MATIC
0xca8817221d1016495e07c12fc4246cb70cd33aab1f9070716ef43c32dc41dd8c433477132023-05-31 0:33:5615 hrs 20 mins ago 0x00000000009726632680fb29d3f7a9734e3010e2 0x1111111254eeb25477b68fb85ed929f73a9605823.966 MATIC
0x723a914a69b639f04e1fc065bfc1b83085a750bbb6ce30602aad98acc04a5ef3433477112023-05-31 0:33:5015 hrs 20 mins ago 0x00000000009726632680fb29d3f7a9734e3010e20x7a4d5d8c1e6e0f71ea4cf9f85e87ec344d7e5247429.916951779565290161 MATIC
0x723a914a69b639f04e1fc065bfc1b83085a750bbb6ce30602aad98acc04a5ef3433477112023-05-31 0:33:5015 hrs 20 mins ago 0x1111111254eeb25477b68fb85ed929f73a960582 0x00000000009726632680fb29d3f7a9734e3010e2433.602573655638214988 MATIC
0x95680b358731b3a3caa4aabf0b2e96c2e7528c432d15e43d0483d7fac475c7d1433455172023-05-30 23:15:2816 hrs 39 mins ago 0x00000000009726632680fb29d3f7a9734e3010e2 0x1111111254eeb25477b68fb85ed929f73a960582664.305 MATIC
0x3eb3e0846ac3400cadd6bcf53093f7ce754d83406203cfd4775713c506d7e0ec433454882023-05-30 23:14:2816 hrs 40 mins ago 0x00000000009726632680fb29d3f7a9734e3010e20x7a4d5d8c1e6e0f71ea4cf9f85e87ec344d7e5247667.684483967227419935 MATIC
0x3eb3e0846ac3400cadd6bcf53093f7ce754d83406203cfd4775713c506d7e0ec433454882023-05-30 23:14:2816 hrs 40 mins ago 0x1111111254eeb25477b68fb85ed929f73a960582 0x00000000009726632680fb29d3f7a9734e3010e2673.408455841883429082 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RainbowRouter

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 11 : RainbowRouter.sol
/*

                                                            ▐██▒           ███
                                            ,╓, ▄▄  ,▄▄▄,   .▄▄. ,╓, ▄▄▄   ██▌ ▄▄▄     ,▄▄▄,  ,╓╓   ╓╓   ,╓
                                            ██████ ███▀▀██⌐ ▐██⌐ ███▀▀███⌐ ████▀▀███ ╓██▀▀▀██▄`██▌ ▐██▌ ▐██
                                            ███    ▄▄█████▌ ▐██⌐ ██▌  ▐██▌ ██▌   ║██⌐███   ▓██ ╙██▄█▌██▄██⌐
                                            ██▌   ▐██▄▄███▌,▐██⌐ ██▌  ▐██▌ ███▓▄▄███ ╙██▄▄▄██▀  ║███¬╙███▌
                                            ╙╙└    ╙╙▀╙─╙▀▀└"╙╙` ╙╙└   ╙╙" ╙╙`╙╙▀▀└    ╙╙▀▀╙`    ╙╙└  ╙╙╙
                                            

        
                                            _," _   _"""ⁿ=-,  _
                                            ⌠            _    __"=.__
                                            ▐░......   _  _          "=._
                                            ▐░░░░░░░░░░░░░░░░.           "= _
                                            ╚╩╩╩╩╩╩δφφφφ░░░░░░░░░░░          >__
                                            ▐░░░░░░░░__ _ ╙╙╚╩φφ░░░░░░░        ^=_
                                            ▐░░░░░░░░░░░░░░░,░  `╙╠φ░░░░░░░       ⁿ
                                            ▐░░░░░░░░░░░░░░░░░░░░._ `╚Åφ░░░░░       " _
                                            ╚╠╠╠╠╠╠╠╬╬╬▒▒φ░░░░░░░░░░░░  ╙╠░░░░░       "
                                            ╚╝╝╝╝╝╝╝╬╬╬╠╢╬╠╬╠╬▒░░░░░░░░░░ "╚φ░░░░       ½_
                                            ▐░░░░░░░░░░;░╙╙╝╬╠╬╠╠▒▒░░░░░░░░_ ╚φ░░░░      "_
                                            ╚▒φφφ░░░░░░░░░░░░-╙╚╬╠╠╠╬▒░░░░░░░ `╠▒░░░░      ,
                                            ╞╬╬╬╠╠╠╬╬╬╬▒φ▒░░░░░░░╙╚╬╬╠╬▒▒░░░░░ .╙╠░░░░      ≥
                                            _▒░░░ΓΓ╙╙╙╚╩╬╠╬╠▒▒░░░░░░╙╬╬╠╬▒▒░░░░░' ╠▒░░░░     ≥
                                            `╙ⁿⁿ≈≈σ╓░ '╙╙╚╬╠╬▒░░░░░░╙╬╬╠╬▒░░░░░  ╠▒░░░░     [
                                                        _╙Θ░ ░╙╠╠╬╬▒░░░░░╬╠╠╠▒▒░░░░  ╠▒░░░░    '_
                                                        _╙φ░'╙╠╠╬▒░░░░░╟╠╠╠▒░░░░░ _╠▒░░░     ░_
                                                            _`φ ░╚╬╠╠▒░░░░║╠╠╠▒░░░░░.`╠░░░░     [
                                                            _╚░⌡╚╠╬╬▒░░░░╠╠╠╬▒░░░░░ ╠▒░░░░    ░
                                                                _╙░⌡╚╠╠╬▒░░░"▒╠╠╬▒░░░░ ⌠╠░░░░    ⌡_
                                                                ╠ ░╠╠╠╬▒░░░║╠╬╠╬▒░░░ _╠▒░░░     Γ
                                                                ▐░░░╠╠╠▒░░░╟╠╠╠╬▒░░░░ ╠▒░░░░    [
                                                                _░.░╠╠╠▒░░░▐╬╠╠╬▒░░░░[╠╬░░░░    │
                                                                _╙φ░╠╠╠╬▒░░▐╬╬╠╬╬▒░░░[╠╬░░░░  ░≥_
                                                                    ____ ____  __ _______ ____


    /$$$$$$                                           /$$$$$$                                                                /$$                        
    /$$__  $$                                         /$$__  $$                                                              | $$                        
    | $$  \__/ /$$  /$$  /$$  /$$$$$$   /$$$$$$       | $$  \ $$  /$$$$$$   /$$$$$$   /$$$$$$   /$$$$$$   /$$$$$$   /$$$$$$  /$$$$$$    /$$$$$$   /$$$$$$ 
    |  $$$$$$ | $$ | $$ | $$ |____  $$ /$$__  $$      | $$$$$$$$ /$$__  $$ /$$__  $$ /$$__  $$ /$$__  $$ /$$__  $$ |____  $$|_  $$_/   /$$__  $$ /$$__  $$
    \____  $$| $$ | $$ | $$  /$$$$$$$| $$  \ $$      | $$__  $$| $$  \ $$| $$  \ $$| $$  \__/| $$$$$$$$| $$  \ $$  /$$$$$$$  | $$    | $$  \ $$| $$  \__/
    /$$  \ $$| $$ | $$ | $$ /$$__  $$| $$  | $$      | $$  | $$| $$  | $$| $$  | $$| $$      | $$_____/| $$  | $$ /$$__  $$  | $$ /$$| $$  | $$| $$      
    |  $$$$$$/|  $$$$$/$$$$/|  $$$$$$$| $$$$$$$/      | $$  | $$|  $$$$$$$|  $$$$$$$| $$      |  $$$$$$$|  $$$$$$$|  $$$$$$$  |  $$$$/|  $$$$$$/| $$      
    \______/  \_____/\___/  \_______/| $$____/       |__/  |__/ \____  $$ \____  $$|__/       \_______/ \____  $$ \_______/   \___/   \______/ |__/      
                                    | $$                       /$$  \ $$ /$$  \ $$                     /$$  \ $$                                        
                                    | $$                      |  $$$$$$/|  $$$$$$/                    |  $$$$$$/                                        
                                    |__/                       \______/  \______/                      \______/                                         
                
     
*/

//SPDX-License-Identifier: GPL-3.0
pragma solidity =0.8.11;
import "@rari-capital/solmate/src/utils/SafeTransferLib.sol";
import "@rari-capital/solmate/src/tokens/ERC20.sol";
import "./routers/BaseAggregator.sol";

/// @title Rainbow swap aggregator contract
contract RainbowRouter is BaseAggregator {
    /// @dev The address that is the current owner of this contract
    address public owner;

    /// @dev Event emitted when the owner changes
    event OwnerChanged(address indexed newOwner, address indexed oldOwner);

    /// @dev Event emitted when a swap target gets added
    event SwapTargetAdded(address indexed target);

    /// @dev Event emitted when a swap target gets removed
    event SwapTargetRemoved(address indexed target);

    /// @dev Event emitted when token fees are withdrawn
    event TokenWithdrawn(
        address indexed token,
        address indexed target,
        uint256 amount
    );

    /// @dev Event emitted when ETH fees are withdrawn
    event EthWithdrawn(address indexed target, uint256 amount);

    /// @dev modifier that ensures only the owner is allowed to call a specific method
    modifier onlyOwner() {
        require(msg.sender == owner, "ONLY_OWNER");
        _;
    }

    constructor() {
        owner = msg.sender;
        status = 1;
    }

    /// @dev We don't want to accept any ETH, except refunds from aggregators
    /// or the owner (for testing purposes), which can also withdraw
    /// This is done by evaluating the value of status, which is set to 2
    /// only during swaps due to the "nonReentrant" modifier
    receive() external payable {
        require(status == 2 || msg.sender == owner, "NO_RECEIVE");
    }

    /// @dev method to add or remove swap targets from swapTargets
    /// This is required so we only approve "trusted" swap targets
    /// to transfer tokens out of this contract
    /// @param target address of the swap target to add
    /// @param add flag to add or remove the swap target
    function updateSwapTargets(address target, bool add) external onlyOwner {
        swapTargets[target] = add;
        if (add) {
            emit SwapTargetAdded(target);
        } else {
            emit SwapTargetRemoved(target);
        }
    }

    /// @dev method to withdraw ERC20 tokens (from the fees)
    /// @param token address of the token to withdraw
    /// @param to address that's receiving the tokens
    /// @param amount amount of tokens to withdraw
    function withdrawToken(
        address token,
        address to,
        uint256 amount
    ) external onlyOwner {
        require(to != address(0), "ZERO_ADDRESS");
        SafeTransferLib.safeTransfer(ERC20(token), to, amount);
        emit TokenWithdrawn(token, to, amount);
    }

    /// @dev method to withdraw ETH (from the fees)
    /// @param to address that's receiving the ETH
    /// @param amount amount of ETH to withdraw
    function withdrawEth(address to, uint256 amount) external onlyOwner {
        require(to != address(0), "ZERO_ADDRESS");
        SafeTransferLib.safeTransferETH(to, amount);
        emit EthWithdrawn(to, amount);
    }

    /// @dev Transfers ownership of the contract to a new account (`newOwner`).
    /// @param newOwner address of the new owner
    /// Can only be called by the current owner.
    function transferOwnership(address newOwner) external virtual onlyOwner {
        require(newOwner != address(0), "ZERO_ADDRESS");
        require(newOwner != owner, "SAME_OWNER");
        address previousOwner = owner;
        owner = newOwner;
        emit OwnerChanged(newOwner, previousOwner);
    }
}

File 2 of 11 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @author Modified from Gnosis (https://github.com/gnosis/gp-v2-contracts/blob/main/src/contracts/libraries/GPv2SafeERC20.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
library SafeTransferLib {
    /*///////////////////////////////////////////////////////////////
                            ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool callStatus;

        assembly {
            // Transfer the ETH and store if it succeeded or not.
            callStatus := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(callStatus, "ETH_TRANSFER_FAILED");
    }

    /*///////////////////////////////////////////////////////////////
                           ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool callStatus;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata to memory piece by piece:
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) // Begin with the function selector.
            mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "from" argument.
            mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Finally append the "amount" argument. No mask as it's a full 32 byte value.

            // Call the token and store if it succeeded or not.
            // We use 100 because the calldata length is 4 + 32 * 3.
            callStatus := call(gas(), token, 0, freeMemoryPointer, 100, 0, 0)
        }

        require(didLastOptionalReturnCallSucceed(callStatus), "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool callStatus;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata to memory piece by piece:
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) // Begin with the function selector.
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Finally append the "amount" argument. No mask as it's a full 32 byte value.

            // Call the token and store if it succeeded or not.
            // We use 68 because the calldata length is 4 + 32 * 2.
            callStatus := call(gas(), token, 0, freeMemoryPointer, 68, 0, 0)
        }

        require(didLastOptionalReturnCallSucceed(callStatus), "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool callStatus;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata to memory piece by piece:
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) // Begin with the function selector.
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Finally append the "amount" argument. No mask as it's a full 32 byte value.

            // Call the token and store if it succeeded or not.
            // We use 68 because the calldata length is 4 + 32 * 2.
            callStatus := call(gas(), token, 0, freeMemoryPointer, 68, 0, 0)
        }

        require(didLastOptionalReturnCallSucceed(callStatus), "APPROVE_FAILED");
    }

    /*///////////////////////////////////////////////////////////////
                         INTERNAL HELPER LOGIC
    //////////////////////////////////////////////////////////////*/

    function didLastOptionalReturnCallSucceed(bool callStatus) private pure returns (bool success) {
        assembly {
            // Get how many bytes the call returned.
            let returnDataSize := returndatasize()

            // If the call reverted:
            if iszero(callStatus) {
                // Copy the revert message into memory.
                returndatacopy(0, 0, returnDataSize)

                // Revert with the same message.
                revert(0, returnDataSize)
            }

            switch returnDataSize
            case 32 {
                // Copy the return data into memory.
                returndatacopy(0, 0, returnDataSize)

                // Set success to whether it returned true.
                success := iszero(iszero(mload(0)))
            }
            case 0 {
                // There was no return data.
                success := 1
            }
            default {
                // It returned some malformed input.
                success := 0
            }
        }
    }
}

File 3 of 11 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*///////////////////////////////////////////////////////////////
                                  EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*///////////////////////////////////////////////////////////////
                             METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*///////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*///////////////////////////////////////////////////////////////
                             EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    bytes32 public constant PERMIT_TYPEHASH =
        keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*///////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*///////////////////////////////////////////////////////////////
                              ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*///////////////////////////////////////////////////////////////
                              EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            bytes32 digest = keccak256(
                abi.encodePacked(
                    "\x19\x01",
                    DOMAIN_SEPARATOR(),
                    keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
                )
            );

            address recoveredAddress = ecrecover(digest, v, r, s);

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*///////////////////////////////////////////////////////////////
                       INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

File 4 of 11 : BaseAggregator.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity =0.8.11;

import "@rari-capital/solmate/src/utils/SafeTransferLib.sol";
import "@rari-capital/solmate/src/tokens/ERC20.sol";
import "../libraries/PermitHelper.sol";

/// @title Rainbow base aggregator contract
contract BaseAggregator {
    /// @dev Used to prevent re-entrancy
    uint256 internal status;

    /// @dev Set of allowed swapTargets.
    mapping(address => bool) public swapTargets;

    /// @dev modifier that prevents reentrancy attacks on specific methods
    modifier nonReentrant() {
        // On the first call to nonReentrant, status will be 1
        require(status != 2, "NON_REENTRANT");

        // Any calls to nonReentrant after this point will fail
        status = 2;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        status = 1;
    }

    /// @dev modifier that ensures only approved targets can be called
    modifier onlyApprovedTarget(address target) {
        require(swapTargets[target], "TARGET_NOT_AUTH");
        _;
    }

    /** EXTERNAL **/

    /// @param buyTokenAddress the address of token that the user should receive
    /// @param target the address of the aggregator contract that will exec the swap
    /// @param swapCallData the calldata that will be passed to the aggregator contract
    /// @param feeAmount the amount of ETH that we will take as a fee
    function fillQuoteEthToToken(
        address buyTokenAddress,
        address payable target,
        bytes calldata swapCallData,
        uint256 feeAmount
    ) external payable nonReentrant onlyApprovedTarget(target) {
        // 1 - Get the initial balances
        uint256 initialTokenBalance = ERC20(buyTokenAddress).balanceOf(
            address(this)
        );
        uint256 initialEthAmount = address(this).balance - msg.value;
        uint256 sellAmount = msg.value - feeAmount;

        // 2 - Call the encoded swap function call on the contract at `target`,
        // passing along any ETH attached to this function call to cover protocol fees
        // minus our fees, which are kept in this contract
        (bool success, bytes memory res) = target.call{value: sellAmount}(
            swapCallData
        );

        // Get the revert message of the call and revert with it if the call failed
        if (!success) {
            assembly {
                let returndata_size := mload(res)
                revert(add(32, res), returndata_size)
            }
        }

        // 3 - Make sure we received the tokens
        {
            uint256 finalTokenBalance = ERC20(buyTokenAddress).balanceOf(
                address(this)
            );
            require(initialTokenBalance < finalTokenBalance, "NO_TOKENS");
        }

        // 4 - Send the received tokens back to the user
        SafeTransferLib.safeTransfer(
            ERC20(buyTokenAddress),
            msg.sender,
            ERC20(buyTokenAddress).balanceOf(address(this)) -
                initialTokenBalance
        );

        // 5 - Return the remaining ETH to the user (if any)
        {
            uint256 finalEthAmount = address(this).balance - feeAmount;
            if (finalEthAmount > initialEthAmount) {
                SafeTransferLib.safeTransferETH(
                    msg.sender,
                    finalEthAmount - initialEthAmount
                );
            }
        }
    }

    /// @param sellTokenAddress the address of token that the user is selling
    /// @param buyTokenAddress the address of token that the user should receive
    /// @param target the address of the aggregator contract that will exec the swap
    /// @param swapCallData the calldata that will be passed to the aggregator contract
    /// @param sellAmount the amount of tokens that the user is selling
    /// @param feeAmount the amount of the tokens to sell that we will take as a fee
    function fillQuoteTokenToToken(
        address sellTokenAddress,
        address buyTokenAddress,
        address payable target,
        bytes calldata swapCallData,
        uint256 sellAmount,
        uint256 feeAmount
    ) external payable nonReentrant onlyApprovedTarget(target) {
        _fillQuoteTokenToToken(
            sellTokenAddress,
            buyTokenAddress,
            target,
            swapCallData,
            sellAmount,
            feeAmount
        );
    }

    /// @dev method that executes ERC20 to ERC20 token swaps with the ability to take a fee from the input
    // and accepts a signature to use permit, so the user doesn't have to make an previous approval transaction
    /// @param sellTokenAddress the address of token that the user is selling
    /// @param buyTokenAddress the address of token that the user should receive
    /// @param target the address of the aggregator contract that will exec the swap
    /// @param swapCallData the calldata that will be passed to the aggregator contract
    /// @param sellAmount the amount of tokens that the user is selling
    /// @param feeAmount the amount of the tokens to sell that we will take as a fee
    /// @param permitData struct containing the value, nonce, deadline, v, r and s values of the permit data
    function fillQuoteTokenToTokenWithPermit(
        address sellTokenAddress,
        address buyTokenAddress,
        address payable target,
        bytes calldata swapCallData,
        uint256 sellAmount,
        uint256 feeAmount,
        PermitHelper.Permit calldata permitData
    ) external payable nonReentrant onlyApprovedTarget(target) {
        // 1 - Apply permit
        PermitHelper.permit(
            permitData,
            sellTokenAddress,
            msg.sender,
            address(this)
        );

        //2 - Call fillQuoteTokenToToken
        _fillQuoteTokenToToken(
            sellTokenAddress,
            buyTokenAddress,
            target,
            swapCallData,
            sellAmount,
            feeAmount
        );
    }

    /// @dev method that executes ERC20 to ETH token swaps with the ability to take a fee from the output
    /// @param sellTokenAddress the address of token that the user is selling
    /// @param target the address of the aggregator contract that will exec the swap
    /// @param swapCallData the calldata that will be passed to the aggregator contract
    /// @param sellAmount the amount of tokens that the user is selling
    /// @param feePercentageBasisPoints the amount of ETH that we will take as a fee in 1e18 basis points (basis points with 4 decimals plus 14 extra decimals of precision)
    function fillQuoteTokenToEth(
        address sellTokenAddress,
        address payable target,
        bytes calldata swapCallData,
        uint256 sellAmount,
        uint256 feePercentageBasisPoints
    ) external payable nonReentrant onlyApprovedTarget(target) {
        _fillQuoteTokenToEth(
            sellTokenAddress,
            target,
            swapCallData,
            sellAmount,
            feePercentageBasisPoints
        );
    }

    /// @dev method that executes ERC20 to ETH token swaps with the ability to take a fee from the output
    // and accepts a signature to use permit, so the user doesn't have to make an previous approval transaction
    /// @param sellTokenAddress the address of token that the user is selling
    /// @param target the address of the aggregator contract that will exec the swap
    /// @param swapCallData the calldata that will be passed to the aggregator contract
    /// @param sellAmount the amount of tokens that the user is selling
    /// @param feePercentageBasisPoints the amount of ETH that we will take as a fee in 1e18 basis points (basis points with 4 decimals plus 14 extra decimals of precision)
    /// @param permitData struct containing the amount, nonce, deadline, v, r and s values of the permit data
    function fillQuoteTokenToEthWithPermit(
        address sellTokenAddress,
        address payable target,
        bytes calldata swapCallData,
        uint256 sellAmount,
        uint256 feePercentageBasisPoints,
        PermitHelper.Permit calldata permitData
    ) external payable nonReentrant onlyApprovedTarget(target) {
        // 1 - Apply permit
        PermitHelper.permit(
            permitData,
            sellTokenAddress,
            msg.sender,
            address(this)
        );

        // 2 - call fillQuoteTokenToEth
        _fillQuoteTokenToEth(
            sellTokenAddress,
            target,
            swapCallData,
            sellAmount,
            feePercentageBasisPoints
        );
    }

    /** INTERNAL **/

    /// @dev internal method that executes ERC20 to ETH token swaps with the ability to take a fee from the output
    function _fillQuoteTokenToEth(
        address sellTokenAddress,
        address payable target,
        bytes calldata swapCallData,
        uint256 sellAmount,
        uint256 feePercentageBasisPoints
    ) internal {
        // 1 - Get the initial ETH amount
        uint256 initialEthAmount = address(this).balance - msg.value;

        // 2 - Move the tokens to this contract
        // NOTE: This implicitly assumes that the the necessary approvals have been granted
        // from msg.sender to the BaseAggregator
        SafeTransferLib.safeTransferFrom(
            ERC20(sellTokenAddress),
            msg.sender,
            address(this),
            sellAmount
        );

        // 3 - Approve the aggregator's contract to swap the tokens
        SafeTransferLib.safeApprove(
            ERC20(sellTokenAddress),
            target,
            sellAmount
        );

        // 4 - Call the encoded swap function call on the contract at `target`,
        // passing along any ETH attached to this function call to cover protocol fees.
        (bool success, bytes memory res) = target.call{value: msg.value}(
            swapCallData
        );

        // Get the revert message of the call and revert with it if the call failed
        if (!success) {
            assembly {
                let returndata_size := mload(res)
                revert(add(32, res), returndata_size)
            }
        }

        // 5 - Check that the tokens were fully spent during the swap
        uint256 allowance = ERC20(sellTokenAddress).allowance(
            address(this),
            target
        );
        require(allowance == 0, "ALLOWANCE_NOT_ZERO");

        // 6 - Subtract the fees and send the rest to the user
        // Fees will be held in this contract
        uint256 finalEthAmount = address(this).balance;
        uint256 ethDiff = finalEthAmount - initialEthAmount;

        require(ethDiff > 0, "NO_ETH_BACK");

        if (feePercentageBasisPoints > 0) {
            uint256 fees = (ethDiff * feePercentageBasisPoints) / 1e18;
            uint256 amountMinusFees = ethDiff - fees;
            SafeTransferLib.safeTransferETH(msg.sender, amountMinusFees);
            // when there's no fee, 1inch sends the funds directly to the user
            // we check to prevent sending 0 ETH in that case
        } else if (ethDiff > 0) {
            SafeTransferLib.safeTransferETH(msg.sender, ethDiff);
        }
    }

    /// @dev internal method that executes ERC20 to ERC20 token swaps with the ability to take a fee from the input
    function _fillQuoteTokenToToken(
        address sellTokenAddress,
        address buyTokenAddress,
        address payable target,
        bytes calldata swapCallData,
        uint256 sellAmount,
        uint256 feeAmount
    ) internal {
        // 1 - Get the initial output token balance
        uint256 initialOutputTokenAmount = ERC20(buyTokenAddress).balanceOf(
            address(this)
        );

        // 2 - Move the tokens to this contract (which includes our fees)
        // NOTE: This implicitly assumes that the the necessary approvals have been granted
        // from msg.sender to the BaseAggregator
        SafeTransferLib.safeTransferFrom(
            ERC20(sellTokenAddress),
            msg.sender,
            address(this),
            sellAmount
        );

        // 3 - Approve the aggregator's contract to swap the tokens if needed
        SafeTransferLib.safeApprove(
            ERC20(sellTokenAddress),
            target,
            sellAmount - feeAmount
        );

        // 4 - Call the encoded swap function call on the contract at `target`,
        // passing along any ETH attached to this function call to cover protocol fees.
        (bool success, bytes memory res) = target.call{value: msg.value}(
            swapCallData
        );

        // Get the revert message of the call and revert with it if the call failed
        if (!success) {
            assembly {
                let returndata_size := mload(res)
                revert(add(32, res), returndata_size)
            }
        }

        // 5 - Check that the tokens were fully spent during the swap
        uint256 allowance = ERC20(sellTokenAddress).allowance(
            address(this),
            target
        );
        require(allowance == 0, "ALLOWANCE_NOT_ZERO");

        // 6 - Make sure we received the tokens
        uint256 finalOutputTokenAmount = ERC20(buyTokenAddress).balanceOf(
            address(this)
        );
        require(initialOutputTokenAmount < finalOutputTokenAmount, "NO_TOKENS");

        // 7 - Send tokens to the user
        SafeTransferLib.safeTransfer(
            ERC20(buyTokenAddress),
            msg.sender,
            finalOutputTokenAmount - initialOutputTokenAmount
        );
    }
}

File 5 of 11 : PermitHelper.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity =0.8.11;
import "../interfaces/IERC2612.sol";
import "../interfaces/IDAI.sol";

/// @title PermitHelper
/// @dev Helper methods for using ERC20 Permit (ERC2612 or DAI/CHAI like)
library PermitHelper {
    struct Permit {
        uint256 value;
        uint256 nonce;
        uint256 deadline;
        bool isDaiStylePermit;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    /// @dev permit method helper that will handle both known implementations
    // DAI vs ERC2612 tokens
    /// @param permitData bytes containing the encoded permit signature
    /// @param tokenAddress address of the token that will be permitted
    /// @param holder address that holds the tokens to be permitted
    /// @param spender address that will be permitted to spend the tokens
    function permit(
        Permit memory permitData,
        address tokenAddress,
        address holder,
        address spender
    ) internal {
        if (permitData.isDaiStylePermit) {
            IDAI(tokenAddress).permit(
                holder,
                spender,
                permitData.nonce,
                permitData.deadline,
                true,
                permitData.v,
                permitData.r,
                permitData.s
            );
        } else {
            IERC2612(tokenAddress).permit(
                holder,
                spender,
                permitData.value,
                permitData.deadline,
                permitData.v,
                permitData.r,
                permitData.s
            );
        }
    }
}

File 6 of 11 : IERC2612.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity =0.8.11;

import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol";

interface IERC2612 is IERC20Metadata, IERC20Permit {
    function _nonces(address owner) external view returns (uint256);

    function version() external view returns (string memory);
}

File 7 of 11 : IDAI.sol
//SPDX-License-Identifier: GPL-3.0
pragma solidity =0.8.11;

import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@uniswap/v3-periphery/contracts/interfaces/external/IERC20PermitAllowed.sol";

interface IDAI is IERC20Metadata, IERC20PermitAllowed {
    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint256);

    function version() external view returns (string memory);
}

File 8 of 11 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 9 of 11 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 10 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 11 of 11 : IERC20PermitAllowed.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Interface for permit
/// @notice Interface used by DAI/CHAI for permit
interface IERC20PermitAllowed {
    /// @notice Approve the spender to spend some tokens via the holder signature
    /// @dev This is the permit interface used by DAI and CHAI
    /// @param holder The address of the token holder, the token owner
    /// @param spender The address of the token spender
    /// @param nonce The holder's nonce, increases at each call to permit
    /// @param expiry The timestamp at which the permit is no longer valid
    /// @param allowed Boolean that sets approval amount, true for type(uint256).max and false for 0
    /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
    /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
    /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
    function permit(
        address holder,
        address spender,
        uint256 nonce,
        uint256 expiry,
        bool allowed,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EthWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOwner","type":"address"},{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"}],"name":"SwapTargetAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"}],"name":"SwapTargetRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenWithdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"buyTokenAddress","type":"address"},{"internalType":"address payable","name":"target","type":"address"},{"internalType":"bytes","name":"swapCallData","type":"bytes"},{"internalType":"uint256","name":"feeAmount","type":"uint256"}],"name":"fillQuoteEthToToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"sellTokenAddress","type":"address"},{"internalType":"address payable","name":"target","type":"address"},{"internalType":"bytes","name":"swapCallData","type":"bytes"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"feePercentageBasisPoints","type":"uint256"}],"name":"fillQuoteTokenToEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"sellTokenAddress","type":"address"},{"internalType":"address payable","name":"target","type":"address"},{"internalType":"bytes","name":"swapCallData","type":"bytes"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"feePercentageBasisPoints","type":"uint256"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"isDaiStylePermit","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitHelper.Permit","name":"permitData","type":"tuple"}],"name":"fillQuoteTokenToEthWithPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"sellTokenAddress","type":"address"},{"internalType":"address","name":"buyTokenAddress","type":"address"},{"internalType":"address payable","name":"target","type":"address"},{"internalType":"bytes","name":"swapCallData","type":"bytes"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"feeAmount","type":"uint256"}],"name":"fillQuoteTokenToToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"sellTokenAddress","type":"address"},{"internalType":"address","name":"buyTokenAddress","type":"address"},{"internalType":"address payable","name":"target","type":"address"},{"internalType":"bytes","name":"swapCallData","type":"bytes"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"isDaiStylePermit","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitHelper.Permit","name":"permitData","type":"tuple"}],"name":"fillQuoteTokenToTokenWithPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"swapTargets","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"add","type":"bool"}],"name":"updateSwapTargets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50600280546001600160a01b031916331790556001600055611afd806100376000396000f3fe6080604052600436106100c05760003560e01c80638da5cb5b11610074578063b0480bbd1161004e578063b0480bbd1461024e578063b309383814610261578063f2fde38b1461027457600080fd5b80638da5cb5b146101e357806397bbda0e1461021b578063999b64641461023b57600080fd5b80633c2b9a7d116100a55780633c2b9a7d1461017857806355e4b7be1461018b57806383c4a19d1461019e57600080fd5b806301e33667146101385780631b9a91a41461015857600080fd5b3661013357600054600214806100e057506002546001600160a01b031633145b6101315760405162461bcd60e51b815260206004820152600a60248201527f4e4f5f524543454956450000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b005b600080fd5b34801561014457600080fd5b506101316101533660046115a6565b610294565b34801561016457600080fd5b506101316101733660046115e7565b61037d565b61013161018636600461165c565b61045a565b6101316101993660046116c9565b61075f565b3480156101aa57600080fd5b506101ce6101b9366004611754565b60016020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b3480156101ef57600080fd5b50600254610203906001600160a01b031681565b6040516001600160a01b0390911681526020016101da565b34801561022757600080fd5b5061013161023636600461178d565b610820565b6101316102493660046117c2565b610904565b61013161025c366004611851565b6109c3565b61013161026f3660046118f1565b610a9f565b34801561028057600080fd5b5061013161028f366004611754565b610b6a565b6002546001600160a01b031633146102db5760405162461bcd60e51b815260206004820152600a60248201526927a7262cafa7aba722a960b11b6044820152606401610128565b6001600160a01b0382166103205760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b6044820152606401610128565b61032b838383610cbd565b816001600160a01b0316836001600160a01b03167f8210728e7c071f615b840ee026032693858fbcd5e5359e67e438c890f59e56208360405161037091815260200190565b60405180910390a3505050565b6002546001600160a01b031633146103c45760405162461bcd60e51b815260206004820152600a60248201526927a7262cafa7aba722a960b11b6044820152606401610128565b6001600160a01b0382166104095760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b6044820152606401610128565b6104138282610d63565b816001600160a01b03167f8455ae6be5d92f1df1c3c1484388e247a36c7e60d72055ae216dbc258f257d4b8260405161044e91815260200190565b60405180910390a25050565b6000546002141561049d5760405162461bcd60e51b815260206004820152600d60248201526c1393d397d49151539514905395609a1b6044820152606401610128565b600260009081556001600160a01b038516815260016020526040902054849060ff166104fd5760405162461bcd60e51b815260206004820152600f60248201526e0a882a48e8aa8be9c9ea8be82aaa89608b1b6044820152606401610128565b6040516370a0823160e01b81523060048201526000906001600160a01b038816906370a0823190602401602060405180830381865afa158015610544573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610568919061197f565b9050600061057634476119ae565b9050600061058485346119ae565b9050600080896001600160a01b0316838a8a6040516105a49291906119c5565b60006040518083038185875af1925050503d80600081146105e1576040519150601f19603f3d011682016040523d82523d6000602084013e6105e6565b606091505b5091509150816105f95780518082602001fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038d16906370a0823190602401602060405180830381865afa158015610640573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610664919061197f565b90508086106106a15760405162461bcd60e51b81526020600482015260096024820152684e4f5f544f4b454e5360b81b6044820152606401610128565b506040516370a0823160e01b8152306004820152610723908c90339088906001600160a01b038416906370a0823190602401602060405180830381865afa1580156106f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610714919061197f565b61071e91906119ae565b610cbd565b600061072f88476119ae565b90508481111561074c5761074c3361074787846119ae565b610d63565b5050600160005550505050505050505050565b600054600214156107a25760405162461bcd60e51b815260206004820152600d60248201526c1393d397d49151539514905395609a1b6044820152606401610128565b600260009081556001600160a01b038616815260016020526040902054859060ff166108025760405162461bcd60e51b815260206004820152600f60248201526e0a882a48e8aa8be9c9ea8be82aaa89608b1b6044820152606401610128565b61081188888888888888610dc3565b50506001600055505050505050565b6002546001600160a01b031633146108675760405162461bcd60e51b815260206004820152600a60248201526927a7262cafa7aba722a960b11b6044820152606401610128565b6001600160a01b0382166000908152600160205260409020805460ff191682158015919091179091556108cc576040516001600160a01b038316907fb907822409611d127ab6a64611591b98e03a6a85ade4f258bae26b7c1efdfeaf90600090a25050565b6040516001600160a01b038316907f393b8be3e26787f19285ecd039dfd80bc6507828750f4d50367e6efe2524695c90600090a25050565b600054600214156109475760405162461bcd60e51b815260206004820152600d60248201526c1393d397d49151539514905395609a1b6044820152606401610128565b600260009081556001600160a01b038616815260016020526040902054859060ff166109a75760405162461bcd60e51b815260206004820152600f60248201526e0a882a48e8aa8be9c9ea8be82aaa89608b1b6044820152606401610128565b6109b587878787878761104c565b505060016000555050505050565b60005460021415610a065760405162461bcd60e51b815260206004820152600d60248201526c1393d397d49151539514905395609a1b6044820152606401610128565b600260009081556001600160a01b038716815260016020526040902054869060ff16610a665760405162461bcd60e51b815260206004820152600f60248201526e0a882a48e8aa8be9c9ea8be82aaa89608b1b6044820152606401610128565b610a80610a78368490038401846119e6565b8a333061125d565b610a8f89898989898989610dc3565b5050600160005550505050505050565b60005460021415610ae25760405162461bcd60e51b815260206004820152600d60248201526c1393d397d49151539514905395609a1b6044820152606401610128565b600260009081556001600160a01b038716815260016020526040902054869060ff16610b425760405162461bcd60e51b815260206004820152600f60248201526e0a882a48e8aa8be9c9ea8be82aaa89608b1b6044820152606401610128565b610b5c610b54368490038401846119e6565b89333061125d565b61081188888888888861104c565b6002546001600160a01b03163314610bb15760405162461bcd60e51b815260206004820152600a60248201526927a7262cafa7aba722a960b11b6044820152606401610128565b6001600160a01b038116610bf65760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b6044820152606401610128565b6002546001600160a01b0382811691161415610c545760405162461bcd60e51b815260206004820152600a60248201527f53414d455f4f574e4552000000000000000000000000000000000000000000006044820152606401610128565b600280546001600160a01b038381167fffffffffffffffffffffffff00000000000000000000000000000000000000008316811790935560405191169182917fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c90600090a35050565b60006040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201528260248201526000806044836000895af1915050610d11816113f1565b610d5d5760405162461bcd60e51b815260206004820152600f60248201527f5452414e534645525f4641494c454400000000000000000000000000000000006044820152606401610128565b50505050565b600080600080600085875af1905080610dbe5760405162461bcd60e51b815260206004820152601360248201527f4554485f5452414e534645525f4641494c4544000000000000000000000000006044820152606401610128565b505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038816906370a0823190602401602060405180830381865afa158015610e0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2e919061197f565b9050610e3c88333086611438565b610e508887610e4b85876119ae565b6114ee565b600080876001600160a01b0316348888604051610e6e9291906119c5565b60006040518083038185875af1925050503d8060008114610eab576040519150601f19603f3d011682016040523d82523d6000602084013e610eb0565b606091505b509150915081610ec35780518082602001fd5b604051636eb1769f60e11b81523060048201526001600160a01b038981166024830152600091908c169063dd62ed3e90604401602060405180830381865afa158015610f13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f37919061197f565b90508015610f875760405162461bcd60e51b815260206004820152601260248201527f414c4c4f57414e43455f4e4f545f5a45524f00000000000000000000000000006044820152606401610128565b6040516370a0823160e01b81523060048201526000906001600160a01b038c16906370a0823190602401602060405180830381865afa158015610fce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff2919061197f565b905080851061102f5760405162461bcd60e51b81526020600482015260096024820152684e4f5f544f4b454e5360b81b6044820152606401610128565b61103e8b3361071e88856119ae565b505050505050505050505050565b600061105834476119ae565b905061106687333086611438565b6110718787856114ee565b600080876001600160a01b031634888860405161108f9291906119c5565b60006040518083038185875af1925050503d80600081146110cc576040519150601f19603f3d011682016040523d82523d6000602084013e6110d1565b606091505b5091509150816110e45780518082602001fd5b604051636eb1769f60e11b81523060048201526001600160a01b038981166024830152600091908b169063dd62ed3e90604401602060405180830381865afa158015611134573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611158919061197f565b905080156111a85760405162461bcd60e51b815260206004820152601260248201527f414c4c4f57414e43455f4e4f545f5a45524f00000000000000000000000000006044820152606401610128565b4760006111b586836119ae565b9050600081116112075760405162461bcd60e51b815260206004820152600b60248201527f4e4f5f4554485f4241434b0000000000000000000000000000000000000000006044820152606401610128565b861561124d576000670de0b6b3a76400006112228984611a86565b61122c9190611aa5565b9050600061123a82846119ae565b90506112463382610d63565b505061103e565b801561103e5761103e3382610d63565b836060015115611331576020840151604080860151608087015160a088015160c089015193517f8fcbaf0c0000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301528781166024830152604482019690965260648101939093526001608484015260ff90911660a483015260c482015260e481019190915290841690638fcbaf0c9061010401600060405180830381600087803b15801561131457600080fd5b505af1158015611328573d6000803e3d6000fd5b50505050610d5d565b8351604080860151608087015160a088015160c089015193517fd505accf0000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015287811660248301526044820196909652606481019390935260ff909116608483015260a482015260c48101919091529084169063d505accf9060e401600060405180830381600087803b1580156113d357600080fd5b505af11580156113e7573d6000803e3d6000fd5b5050505050505050565b60003d8261140357806000803e806000fd5b806020811461141b57801561142c5760009250611431565b816000803e60005115159250611431565b600192505b5050919050565b60006040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526001600160a01b038416602482015282604482015260008060648360008a5af191505061149b816113f1565b6114e75760405162461bcd60e51b815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152606401610128565b5050505050565b60006040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201528260248201526000806044836000895af1915050611542816113f1565b610d5d5760405162461bcd60e51b815260206004820152600e60248201527f415050524f56455f4641494c45440000000000000000000000000000000000006044820152606401610128565b6001600160a01b03811681146115a357600080fd5b50565b6000806000606084860312156115bb57600080fd5b83356115c68161158e565b925060208401356115d68161158e565b929592945050506040919091013590565b600080604083850312156115fa57600080fd5b82356116058161158e565b946020939093013593505050565b60008083601f84011261162557600080fd5b50813567ffffffffffffffff81111561163d57600080fd5b60208301915083602082850101111561165557600080fd5b9250929050565b60008060008060006080868803121561167457600080fd5b853561167f8161158e565b9450602086013561168f8161158e565b9350604086013567ffffffffffffffff8111156116ab57600080fd5b6116b788828901611613565b96999598509660600135949350505050565b600080600080600080600060c0888a0312156116e457600080fd5b87356116ef8161158e565b965060208801356116ff8161158e565b9550604088013561170f8161158e565b9450606088013567ffffffffffffffff81111561172b57600080fd5b6117378a828b01611613565b989b979a50959895979660808701359660a0013595509350505050565b60006020828403121561176657600080fd5b81356117718161158e565b9392505050565b8035801515811461178857600080fd5b919050565b600080604083850312156117a057600080fd5b82356117ab8161158e565b91506117b960208401611778565b90509250929050565b60008060008060008060a087890312156117db57600080fd5b86356117e68161158e565b955060208701356117f68161158e565b9450604087013567ffffffffffffffff81111561181257600080fd5b61181e89828a01611613565b979a9699509760608101359660809091013595509350505050565b600060e0828403121561184b57600080fd5b50919050565b6000806000806000806000806101a0898b03121561186e57600080fd5b88356118798161158e565b975060208901356118898161158e565b965060408901356118998161158e565b9550606089013567ffffffffffffffff8111156118b557600080fd5b6118c18b828c01611613565b9096509450506080890135925060a089013591506118e28a60c08b01611839565b90509295985092959890939650565b6000806000806000806000610180888a03121561190d57600080fd5b87356119188161158e565b965060208801356119288161158e565b9550604088013567ffffffffffffffff81111561194457600080fd5b6119508a828b01611613565b90965094505060608801359250608088013591506119718960a08a01611839565b905092959891949750929550565b60006020828403121561199157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156119c0576119c0611998565b500390565b8183823760009101908152919050565b803560ff8116811461178857600080fd5b600060e082840312156119f857600080fd5b60405160e0810181811067ffffffffffffffff82111715611a2957634e487b7160e01b600052604160045260246000fd5b8060405250823581526020830135602082015260408301356040820152611a5260608401611778565b6060820152611a63608084016119d5565b608082015260a083013560a082015260c083013560c08201528091505092915050565b6000816000190483118215151615611aa057611aa0611998565b500290565b600082611ac257634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212209870dd0dc3fb83baf72036a002768c9388c9b2cbf93b6d7b09369fddefaaf87764736f6c634300080b0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.