From b3fdc3c25eabe08fa1f04c02dae3bda4a9edbd7f Mon Sep 17 00:00:00 2001 From: FabienCoutant Date: Mon, 26 May 2025 13:56:59 +0300 Subject: [PATCH 1/9] feat: setup Parallelizer deployment --- bun.lockb | Bin 171922 -> 173623 bytes .../configs/DiamondInitializer.sol | 43 +++++ .../configs/DiamondInitializerTypes.sol | 25 +++ contracts/parallelizer/configs/Production.sol | 90 +++++++++ deploy/config/sepolia/config.json | 39 ++++ .../parallelizer/DiamondInitializer.ts | 30 +++ deploy/scripts/parallelizer/Parallelizer.ts | 175 ++++++++++++++++++ .../scripts/parallelizer/facets/DiamondCut.ts | 31 ++++ .../parallelizer/facets/DiamondLoupe.ts | 31 ++++ deploy/scripts/parallelizer/facets/Getters.ts | 31 ++++ .../scripts/parallelizer/facets/Redeemer.ts | 31 ++++ .../parallelizer/facets/RewardHandler.ts | 31 ++++ .../parallelizer/facets/SettersGovernor.ts | 31 ++++ .../parallelizer/facets/SettersGuardian.ts | 31 ++++ deploy/scripts/parallelizer/facets/Swapper.ts | 31 ++++ deploy/utils/index.ts | 87 +++++++++ deploy/utils/types.ts | 84 +++++++++ hardhat.config.ts | 6 +- package.json | 3 + 19 files changed, 828 insertions(+), 2 deletions(-) create mode 100644 contracts/parallelizer/configs/DiamondInitializer.sol create mode 100644 contracts/parallelizer/configs/DiamondInitializerTypes.sol create mode 100644 contracts/parallelizer/configs/Production.sol create mode 100644 deploy/config/sepolia/config.json create mode 100644 deploy/scripts/parallelizer/DiamondInitializer.ts create mode 100644 deploy/scripts/parallelizer/Parallelizer.ts create mode 100644 deploy/scripts/parallelizer/facets/DiamondCut.ts create mode 100644 deploy/scripts/parallelizer/facets/DiamondLoupe.ts create mode 100644 deploy/scripts/parallelizer/facets/Getters.ts create mode 100644 deploy/scripts/parallelizer/facets/Redeemer.ts create mode 100644 deploy/scripts/parallelizer/facets/RewardHandler.ts create mode 100644 deploy/scripts/parallelizer/facets/SettersGovernor.ts create mode 100644 deploy/scripts/parallelizer/facets/SettersGuardian.ts create mode 100644 deploy/scripts/parallelizer/facets/Swapper.ts create mode 100644 deploy/utils/index.ts create mode 100644 deploy/utils/types.ts diff --git a/bun.lockb b/bun.lockb index 550816b20c93c1fb1671ff79f9af94ff5b18624f..c34349c6d834834799bade3ba14c1ef8fd104041 100755 GIT binary patch delta 33777 zcmeHwdwh@O|Nniz?LF?z9B0gX#vJCn8Ma}ww{y*5C`7Rg8*>=8nNw{mg;h@7%I(B_TOh$VVle6p7#Sd0p4dCi)&8kMHlV?#G_j>v}z}*L6PL_xt94c8lM} zy?(PJ>VI(flHaBDMb(DRjDW+`RgFdK)$5q8dz3@E})l&d|JzVNPp-#kbaQ0v>d5rYR;&}gE9yd85s06()WT0W><-Y;47Kj%iS&&(fOgKBMamMH&sm5ES zREB>*vLH`DR)bt%8AdQYx z_A)a(Z-OpI1GEMUJ|;6YJ3Bo!a~^c2pOrc)CpFVBehEfH%K1BYBpZ_H4A-(W zYDGN-x@D9=*Vu)wx_N6*c~mWb86=ZSLSwW3?IBsb7r--Go2n{28j}1TNM;+1PLatD z&q0eC#yaRIdHzC3_D@<$R(9iYndvj3GoQi3Qbvw|T?I4-nz}*$u#~LEX(LmH4jnmq z5ED3r0A{cklJ)N!sv@qoUn~)6xoQ{&a?W39A1F~hZ#e9cNd8JR9L)0LF~T@lZX10! zM`sAakwE^5+9&{I+d77UX3Ot{_#6a{pmWsDgpTs&FAZ0@p^U>gt`q92%B7ARnLZ{v zJ#X-75X|rhBnvwTotu&|#Bip;EF{2;#zQg#bY|ADlx9XSGGNBLP!P6ujxNCXEYt|s zpwz*`nl&|y?G03hYam&$`C6X_8EE7g`N=xs&tWQ~Na#$^2a*xyG*%hsK(a=CB2+g z8%Pf9>#$=JuZ>gu(9vUtFr($rnSs#!Z?L1D5wB)m26%SulaL%!el5}dOt@x(nguCY z6Eg;nNYCD?OPH3`ICVmHW=d_ZN+1}L1sI++IwLK8WNK>0*m3EZshQQ=D1Pv;(Ie7_ zq-3ULrRJn&WM{n#z6|VFX*sQ}TB(+3`}8VVjpeNE(@r&AW@^fiA?cZ8KDQq$SvhP< zd&L$)G8sP7&7@8I)Nm} z8qhD@t7b%G4^@CLNEYC)?y9wpYJJp@Xu0Jr?5V1E8j`)z{yt?Nt>tkY5A$EzSH7S2 zU5xzwNQm9C1JVyN5R&7g6eL^XXC3idEe}Fk;P36NGH9jc9y`p6%yYDUu&NHLCa4aV z#;TB9aklhT#mgKy#^ALAI&+=TPgOG)vMls$RG+!8LpZDb40Osx(3!g%>2dlw&Ggel zGJanE8F*OyFCdw~hW@I0d$oQX32|eHPc{rJxA|2du?pt@Hb5N^KGX6INUR~-A2dNUS1W^tF^B`HH)8JXKLy(M+51s{d?4249 z)BHTlN{+DKAlX7sLo%I7sk()-My4YvV=Q>4`yix$9z404NQGnuBQwW6JSt_3F?clQ z7a}Jk119)+J5|s$%o%n?Z}4o|#=}$ryJ|gF%gmJVjR%b$GOS8cETxPN%?zLAPdOV1e6c-$DH*C>@*qP@+(vYBWf z^{;L=x3Bou&D)6)!k${E?mrsuUUg?<_Hl)l2ZO>dr*j7OG zzL67^<{aC8ouKmSTTb!kptH=*nutLoV-FdfotlA@OB3kq+;)?dL^PuY^tT2Ed|Enc zz@x84_scC^bMmw!iDrxGZ6>el|7_mmLl^HU|89*%Ys+|6hA-}1c;@XDOHPU&@s<7a zO|i70>9zCwS$08HuNi9>!aZzT9zDjRZB4Mu@kF#%_(*P+}(CzHLt6z+x81hFdwrML%r^|+=kKK z4hW5NUxu%(J)=W>DPO}Fhzhvvo*}W8fQC_|H1j*Vpt{#QVi&^QY+E(FE+5P8TqD8k zXcyG*ns3{MHM~|d8u>m%G41lzVy$V=IzuaAw`9~cJd)un*wZ>xpG?J+w zKwb->^?_#C2T=5O=r*i5C`V7^yw$eqc+EfT#5!K93p%VhLQ2}@J+W3EG{!RR0}-+2 zN!tqdx@wlQJBKHj&)EgxUh}+N81A*|VPs*yL@CPGigiB;t(CnmBF@?ZA2wRuLapq= zx?b}M+p6a^&)JFfyjFdTe8w~Eo}sbkP`eNzr){gg*WC$YIG(k2KMtQtZ4Z1gu=cTg zqG((wTR?N!bHZY+7SP&2D`A(f7weuwO_tyQd{_}s0a}FwAuVae6#76@xijoJXe=wr zf(H6jYrZmG5RM3{9<;m<8dE`=N5opsK#POsM@x>QMqcYLaBM`3lX|gcl%3evYo^%+ zjlI?fRSW~0EbCA$)>R_d_KQfcQiD}1myii=f~FdiZGOcrjPP1rtE%d`RF=?a;bWH% zkF}0KV-;O?`9>{FkG&^S4xc7oYljC1CK+;|R;*Pa#4vh5Q++weE`-HAa4Zg*t#+(+ z8d_6mJ{*r$jcOQh&`PpF+(V$XkWIP(KFn-XpN)7L8p|S6b%lo7Pc==jhK8zSRo`ra z#)M#kV%&hH`t1PPG8VfJHH0;ZwMIi@yGcv)CEIH5H4oZ}&AsjrtQ-C1be>=rHuqW| zL8qmUeV}=)`x>+sc0j#2vx8j_?X?~Wb8=LDV#Rpfy=xgp7ds#(&bF{ z&?erewqYdN`(mZ1pWQ7%dRj}P2kIC`N9kJtU!wG#g|EFm1NPyD(OpuT;Oj=8t5jXv zuVsSO6SpsHeGI*n7Ir~PuXP2?gNi}b@2{tZks6vapvA~Aw5qw?E@pls#9~W6446fexzE0AEw#5Q`43zRUh?1=w z8fT8Tt#)4bTIlH2&^XuCD6ZY^_87p4_KY@h<}4&^{uvk9?t(`riTAZ~IKCT67nqGva z<~1^KH^K_n&JGBVvo^!0tjPPId`;|bA#ql7_z*=E&pioRCobQvt?{;Bc!G5m1lMO( z`c|lTpPO0DhSt>y!){m5&1*G5-W`+$*4S)lTqQ8*o5z~3+lfio`M{x0Sa(qntBKcH zAbYlKVO!n3)><%(<153z)fy^|^`Zfal3)kajx&eZRuAs}i9Nj54Y15pEyL~GDh)9n zZBYsecWSJ$SaH9G#

*brOp&`jV@0%~)$7G}INA*mYeC+Sz_R65J<1w&MC^Rc^0J zr54=o&@igF{37ZMXpCBtQLQ7;SQ@u|pk<3v@Ue9f6cOuAhSpq8#%JM^lh!&2pIW=o zM3%dw+WS%7+T4H&dwI=l+v@E#Kd=*fd#%d|SKYzJn}`nWfz(ycAB1+V)UbHEJonh0 z`y{vrVv=A##;jfdADaTk*q(0K)&pMaO)LWsfiq--4D4bU6K`rqi)r_vqsQM2D}?sw zO|4Tm!kg|UJy&5L@Ww`kcU z)}0Tn1Ba{oTlf;}ZkTU%dXfvM8E2;3);1sJ_p12c*R$EJ$`3#ADZY~^U7 zr=Vd~Vx2I~wm^%4hQnWIto0kT<}!?%etk5g(%7;CpfLkgmDiymM~+B@nSBidwb5EH zXdD$Pzx~j-NMPld4I|~I_93)~Z)#!i!kEJfmbt~WW6(GpRaneGY-BgJ zSViY#cQ( ze}L9bp2s2ws}bgs2iH;1IFfL{#L;uLojBa!yD{P3pXLy3OYKZDBEMVx# z8_-xBU%4T~rE;&@H$2W=;P|YM;A;j83}Q6upU~o@MNFDu#7f^N_$23gHBDym6$lP8 zY*0O7t;$2yu!4sBjV^ZKD6e}uIJr+*AHv7MioH;70#L&hvHrcku zdaX~vF(z!$-sMK9GRuX|>Hw`N!qj}tfyPuz$_88mjq&92=f21=*)!oIl@;dfeJx7e zRFF8f>clMGEf!>Xt%{>mQ=yx&xIYXnK}KIlACg7CpjyYEF-vJ>Rm@Ovdb)pa5urgJh4Q7}#6OWvQsRxk5s{w1(M?(Tr7ZqSrbKj+Irnfeo`&fn?Ruj|G#w)<$p~ zuI1#6@Ehms-7-aJoJA-aZu90rW22%OhqNdKg)M+h76T_BM-@wMxz;_8ew)*B$z0Ax>I(k8eYM}sz) zq#6_vCdOJB&{`s8e}qNaTk}f=uK?o*2CI;Kc#{(q(J~?$zd6}o<<~X$+16vRc7D}T zmTR)g!(X;ePiS7m!q|+AwPr)Z=79B~eC z$zf5F7bWw;x+5jl6M0dxF)%mf^-q#@n+Px+OdxqtvMjpuDf6U3K1doq2Jk8>na~u; zDoML102XAr=8H;(7ihkytO9N+zyd4>Xt%;C$_h=q3dz=41(XEd1Q=l>K>j^|5jSc1 zKBNWg1bl&y0Ty^4z>AXUd`<-yCDS=V1=kU$DM&ElQ7w-_@}gt`P6N#NDWJXgUnci$jW;hp;b_*f#muD=3%Lp$)vSu40nbEsiZh~aV zcS7RN*ae3P?bZ4|NY?yQNTzcLk`+1w$#l+Xc^;Al{}mE{#&2*+u>b#nhlW=rVHkfw zvgE!XnV>%;!vo-u4}xTd!6dar6r-xvi%JgCQ1A?|uEQzG*CLO@no(N^P|~oD)+t%@ zNUax@q@v)^zNrqUWWk~#NyTcO(zN$Yt85>iR;nc};&ez+Nvbs*N^GX`qAUg9J=E>S z)2rt(zeH%1owXGu^)6bcq_>;qleFxvWe*18qLf1ilBF7}!!va_CDYB)I;2`IvO%zC zCTf`r$rgQF8&cBygqBkwBcQK`vyLxCNfF3?$pH5+n-{1j(eTXgwH`7bU~1YQ1WSF3K=O6GbIE zu7>7|N+w)W^OW?~fm6~Bc)GG3@^q=&&_ph!k+5LQD4O3US)`_#r=;Etl9M_flJOEW z?}cQQJ3!*kxQEVdl2m6njMtS*2_y8>hD9X}?$TD+x>SWO;>6ARVDPb>@hRl7*~E1y@nY0@ea3YXiKB%Kyn-MqW!5{~zxnX!1{XEJ!Pz&Ob?3 z=(f9zJfn?{SX45>wwkB>zq`x8C`w^QcE>5z^Vk7HsNteyF;c1Ex|3vhnhgD)Nv=h_ zhu}rYcKP>S0*&zRy~Mxw693*ysCx@8M*rSRpb`G*UgO_;iGS}U}`Jt^Io)nsN$_ndSS){vPi-HX!gw3f^w>0Xv@(i>!!OZU2T`>Z3g zM!LRl(w{8d4bm<17MV2ZZkBG)dNLW(-6h@7x5?y4cfWMQH;~Dd?qTUhY$P*Px+kR@ z^A4Gr(mf~Lgm=lzmF`99c6yJ@BI#b1Zqg<)%cXl=x_#a!vqrkUAJCsH-3`($vzbhq zbT>;kXbYJP>F$zl=vFd0(%moJ@NHyrrF&Sq5g(G7D&3RPjoD6SrgYCqH(>{vxzfET z-A+5nERybJ=_c(Wvs}8@rQ2sWnKjb&{fPc#>28p2nL;vY(%mfGpgm+Vq`OPHp&ygU zk?wx!hVLblE8WA=jo3$Ks&r3EH)cPXnbJKc-Goob%$4p%>2~^*%p&PtmTuAkGRviV zUAlcfBeO=jz6a?~mhJ}Wmie4anshfyH|P+V4C(HYZs=h$Inv!P-S8u1a;1A%x)EQH znJV3r(v3MvW~Ow{NjKq3GIOPSQM#Ruky#|&%hF9cPG-4uuS>Vj2{LP>>wA*^Wa(~@ zZkbbL(xkgtxx zB{NsL7p2?j9GOMZy)50NZ^R-x6?H;i==y5x=DYLSuWk{((QAd%o^$X z-k?8Ox*O;|U&f@HCf&_+MUW{)h7!A!2z5y^M~VGPgqM(Ht`dipi13l*R3%O-5#yHR zOeM}Kk>D%Ixk_AAqEkspE>hyM5=o^bxm=0sO7yWLxkd?JKdB`vu|bJ4{*p{nVzUxK zr6rl6#4aU510T&~1*CHe$Pa*Yzcm86!e#0DkG1W7VYiOos`RhDFi61$WLts==BCH5;3 z9xTaRB@QbQQB{&tl{l$Hj7O3)l{lwFLWm^iDsfSXPSqs2NQuizB!xlLov_2(NIowpzU<-R8U zhF!kD%iy6c19K|0Ge7D0d@ZBedr7l*EFFDMsq^*cZhUCiZ+VmP_|Y`3m%R=-U;ewL zE~Sf53q;R)W>-GncZ~RRv2*zp#(cEC)`*E!>y>N$`)hG4629m;w%(2oe~mc3=ke72 zm$r1-ur9G#*9Rw@`y%ksh}^a7Mhy8qtyHatpL?hGy*JKZsk@y28-bH9e|>f?pR)6& z_I#$+=B#d$Jp=AvoR@dy=Y%(3y!3WdT49M_r+ss(#+jF+ul71$V!GA-<@wXsx5|F` zkK-?8|2$$xjqhISVy#Q>`AU(57Z*+VRNH1*6HneuKx#n|qz^SfZw0f%P`SIVpxZ{f>e?Hi<)Y%Uk?Dx+;xM}^w!IO7{OyMhb4e*wc zkJww!Eahr!Zp>(8`k5lXwK-&ChX!U>(>x;PG&IM%*OkFje=)X^Sy`I*zt=2fCWxp; zW}K@^ImQYy-S6XPmNFY*Q&OfdoypwhWHa{MMu^;eV^owm-p_sR9{jLZB$9nPq6&>R z_HAvBG2Kfaz%S*@7ykeaWI3?cR(O$vYeb!^MuhqOpXwC=z zR~d+Fl;-#ddyVEs>-3q{TFs5o93D^P83mdgt4U@s4;)k@6Apv<1L6#Am#sPea6e6R z{O>I2^#@jHZUQ*`$yXAVK=PWX?fAaLi;}@lESxHggMKyUOA@byYmPtd2+gV4BLDHJ zu|RYAu)`n!U8Av3bC2n`{9R&^=J=8ZTdyK8Pjgdg$Derko7`eePS=quL4QGWPiZa) z`qP?w1|0tQFUO6U04p#?)EKTiegpck}x4R8T$0bDO?^Dy|c!LfHaI`Joe z%32D^YXJz>s}`^f;L9akPH0yf;Hx|ANv;Is>Hw!WqfthxH|pOuVZsHF%0vjy~X0DE`2wrdFg4*;(fCh}*3jesA?;CfXX zHirLa$r#2;%|$@x%R(F)uW2q4{tp0-49-{l@oh|F2f*uf5UfZPPz!#JmNnY0DeE83 z7`WDILp%yK>S|7{&ho`uBSLd;Led)zv}MY;-qIZ3L2L((Lv6k0V&U%tjzjHj&9#7k zAUN6n8#KvZ28Zhe`Qj1&;cp80rRLhfpMeBf_+#Lhc6)%Y zVzq)i0m(tz0pOZPj&DKnacf7`f21aVfaGG>2}su5&zi$(Z}ipN?~wT8ze6y3Ywiz7 zW}FBN)*RoU!XN*ggE2&Ne?oFC>;l|Rj_vP8OqQ@K&`%qd0mmuS4H&LDzDnf}JqbwF z9N&t9*XRxm)LgjcdVqUKb9KSt&*%wo*I+Bu2f=lc|1iQx(_{mXoG$kR{WTY_BliN= zQ*#NL>kY1#=Gthk4>)c^%!GrHt@;3vqB*`m2glXFKX9MsMu20+1Aw8L8>6{oaOL1{&;B0=55oD6H;f9BG>jb0 z4FngUx$%(rGg5#|MBsqpJ6DW52*}plByh}lFu?Z!X~!R=@h5+ao(QfZ{EvZUI*dfV0=<@L*f4w90wy`;-cL!fP;^NksBQ~~Ime7_aK9iE&X)PwZXEmIpBWM+(ONb2ghm7 zxQir*{+|Ga^PJ>jkUo$Tfgd&Zl8!tH+$?aMk}re9AOHQC!5yF6a?L#g|5VNKu*I?P zD8SPK?N)<>*T@B)=KLec6BtRZ2QxLt6BrAV54;DC^ZqSu_Za-&g5woxZ-IQ$vYfM>yRj`Phyc;$=7 zd*I<5e_wM2@E2L3>eMt%X{afz$d=ioSKUIcgw zB6n2V&4d3MFcA1sbMxWf0Sp3;X>I}h8-T&Uam_7+{|#UWZ~`3j$m5}RohH8qi9dP1 zt%QuZK%CK$m%vZEk-%APw-kP6%z6KGJxFA;7~5SU7`+@lOcc6+^g{OY{2QqcR*>k66m72-!%6cxFpS8 z=8>L;tAKX^&Pl#7O73;w1AtTV56!KHpEV|TMRRL3$JugKb8F#$58#M*-ZN#>vjt}Y z*I6ABW4@}Eo4kcot8!@cm6V}zQTE5|zu zTnpY27gm_zBJfqSQC?{f0YDjm?>xQ^@Lfp0NVyVtjeZn|yU%OD8vr*QZZhkDrNA

z5uKpYSa@YQa<4&DUd>)`VN0lWY#1Qr1E z0KNdte|pdw;J~a7@C9{_T#oWoAPwMx!v%&5N-xgiN$}(Xd~taKFb>EA9t9=?Ilx$8 zBJc>%8|Vu>0Q3R)!t@eg8SoPDGO!$I1T+Tt3i*A&a9}A~^b~LgI17Bo{{I1RP9_RqH0XhN$0p9&q1w23qPz?wIDg#x3EZ}~m^CZBN z5ZC-CfL`qXKEMM&F2J4X5nvLK0;B@NfuTSQ5DEkX6@kh?5a0nS0abvi09QS(Xk4wh z5OLx87zN-VgeRcA08c$UyySfdXDjd#z>~`kU?;E#=z)l>fssgb6u^aKC~y*Cr+{hj zvjR^-764BHGk}@Ebl`Dd3h)HLH}D?<`U3-iWMBpR--{+5i$uC1!Fzy2AQq?&)BwVO znm{Np4#)w<0~3Jhh&Kor4Dj2?EJ)l0&0B8s_0wRE1U8EHJn^JxX2 zPVi|2pFX4j4+DIdz=sEXSa2V}hXLbs;kf7XVCWQxg>q_I4txcm3{VjW00M!sKqa6& zkcqTL17mm}Hx|eO_#hwy;Eg`->&F2(zy#nRZ~*um_zd_I_!ZziJnz|e0=y;XE%{||5xxBz?yd=Fd#&I3OI zye0k__z{=|@Q(ILfOoOa0Mh{8z0Lp%fTw|(z>CWPsh34?F@q2228Y!+9C_9rz9S2KXBI5;z7N1`Yv7fYZQn z;0xd+aFhw20=@!H03}gkU!WA=2Ux&j@QZ*Yz%pPda7quvYmnEq|9!|Uz*b;8z>Vxp zU<0rQcmv>xmxGm90p!tH4si6Y1Q<{W83X}5Y%n4todBFnx5Dpau(SyO4*b-a2B$Ig z+Y8kMY0_pHfJG}$CfWgHN1!v%1xNzg0Zf3a6l>*V$O03804x+UGhw?Gk~N+SKRL$b z3g{HZnVwFCRAus1^Z6hW3vn;NLUaXM0j&Yn#3?{C=uDW+{ujWezX7lSt9jAx zU_9A1$X`Y%+CNSSoeY?`!?89Fm=T+^Xf4Sx-061~if~$!e%iC3r+_>flPFpMrv^@~ zosu&G6Ltn16Jz|Maj839#dM0ML0#e63f(L%8E--DJaMntt7E_ukW`;JpR|;T55DO*Yf1r^sM#C`r zX&97-X0;x&`I{TBz6pbirMvC&knZe?jU1nA7M-yz@Wj+>Crj)8h z*!zLsc0cD`f}C2QC{bvUQX+Y`S;bQm7A(upyT7zz`gV(y)sTg4BIfKy;%&q#2#@p0 zfWDJ|KU*FoPt5L^NoRBrGNS6s%OiiFkpirt0#~}HDnRo+RqhJa-ttX znnbi<)TN^FM@aiM7;s2D_i$zJpyL4@1I>iiY|H2-vqTCE%(uj3+Bu&)utvx4y3ljp zCYPBT6Va4~SRmHIAjJ9J!NA19{xu7Ff2qrWL0Q#LocYLXYW^ZB7n%)2{7~ic$kF+r zLF$3%vp2r?%`Ino%82AbvxYfO9oqO-p;^sDOCQ*Sf*caxL3mQisRCPF9(niI zS7P5lKBy0CG+dP5kH&DmC(!%oR}Cvv?=neNSq={8ivyl63xC;kqEtT_BAcl|jQSW^ z$c!tA1s|J1)|beKos%XueT>3niXUMS?R+(1&GAj&hh;UYiX@t=+-G4XanLTVli#S} zlc|H)kj>?P`|_t~y%%%A`LIIVQ_GGw4ZE@pQJY3^h8guMh-daB*;Os^co5e54!{dBoVO3b)WmliPQTvv`lcMcD zOtFeVqW?a#imP;Gk+aWi>T$lB(Dq^PJwB`E|A+{>KB_g%Wuj+wS5PRr(fI(wOB<#f z^HljZQJOZ7XzDb)*KIgBQV$gAs*{77w$7+Ei7u_nW3|{97Hq z$A$sAhX!|#x<{;L+RjHD4)lHP)5KpFpT#KT%GVr6E%DWUG=TFphojTOuO~b-olA#q zp>-ni6AV-5vk*yq1Ruv#?x)O^g8WeM^Du~2;SDO%lCW8;NSO_ynI6+aw63WZ^6 z49|M;o?$-t<=)U&rN{LQ%+%qnIl z5q1SRCc};k_UjXNOs#xxWUE_tIl_AoInES|zk^sQ%%4!PkXmBqK@2BXH=inKfe0R|wM?ZWrFu&~zsh>osxu znAtp}1RfJ|og9|6=El{stI`A2*vDiEXegQ-zr9z*Bge6`78^8ouEp)ezeAho@mPF- zXi`q7z>;!n)T8?LeD2ylYGgUXUDf$!8{ajS+tjW4UzPN~QL|#Lez)Gftt2}46j2u4 z=W)Kf(%)EF_R5u6kI9KITjTD<(>RWJ@`t&$N2{}pPFI(w=-6v!_7U?h+$xW5D3!H&=Yg+A`G1|APD@w6Xs*HL z98vu&wxgf1fLFj^Z`twL15@U_FyCcHN62;Am?cJ?MYB5}c?k`if2r}YskzDklfjrT zmcqc?E;iB5`AE!y9b@jfC-Z4-ho!>kD}IDQwDUEYQC+KD|GoaCZ*Jw}d~fFL_0W^n zih~Pog`_+`)>TpTIA{8LoDUHNmVUN&$c5*gCR{XH~mf$vL0R=|5oJV~G{}98@8!aHI(M7B&6*!P`l^lV}SA zGg&-DJLmg6S$(@T$Oz||*RjhHvtSVIeAs7m`I#%5E*ka4Era-4^0{*U{_p$G9rwEH z(yfrC;sn$F`($v^o+-+oM;TU%h7g_*Bvb?4+iP81?o)3)``oRBPKbwTSL`OilPi=i6m(uJyG)kLvXFttIJ>>B+lQo#9;yhSf|O zG;=DbvUk-?5PPnfOwo%dX9I=|`!AD)Y&BG4Y%!c)Bs z+6KGL#+BjcXB_x&FUm*@WTfuZ#S4F#!^|bZypGmbB|H@GisfC=}Iin87j5x6v9z-h1tjhXQ%0 ziMh!;%{v`+#QlmEyml>>gedWgHFvIs^<5JEOxYxUvtBj>EU z71F4Vcpq^??sWc9adE1>1PhP;fM3;!c?dZKSXUl~gt4V>@n{U=~>t<0kXujvrX|3YyCQJwVU zIudNEWIcCJ@1J7bWlAHj>*6t%RHwt2`;nE zz3O>aZ{dYO^c^4K$tO_G_tu(aZwfpRRQC$1*aVMau>=egGnlsX<+pDiJ=mfBp%nF; zM@G#T+hAZmBYIYVm?z4IK&%vHOCgr};2ge;x3YG<)!Txb%Vg0PP1IAQKwmuX#m|Fc z0F9lm-aWVLQ*X;vU6_S_V0=l;fq~1NC|)n+s^W3J)Ayf=JE!cdACEEXJi}@tPQeh% zca$GQhL~R-Vzy{(x%ewViiJc1I*UgvB%(iVnEzUj$}?M4SnTg(qOVyRBVDY8VYKr# z#53o9J71?o!?CvvobM%e+`M!7g)JjKzZG&_{Dr6<=L3tQ_YCY9&};RXTL!vh{X`cQ z@RImXc~>*>f}d-cxks4(p!x_8gva@SVcAd8=54w*Y^SQ?>HJ*IuYh(5RSnwGl3ip<%UK*v}(L=4} zvrfDdcl26)K27E+8&7igi-*g)`XDX{^` zM1oCKB^If&8=1=FD)FJ3uHEUfuI3)+mcM~h>*KXOj-Z&FA6O9dL|-RHaK7WGtBU9>xuIu^#T8@)SWFD=AE>PmVHI87%v>?L zB9e7Jp*gAkkN^2J?49v0lLG^lHHU2(V~$}ZCmHunnuKty#umYIA0=)FC6=L9jT z93#dV;e|o8{=8=XPuu$L&dmG?$1ltW4kE+(zUGlu4I1U{O~3&zmvNEp8L^FN|5pa) zPvRKuoDXbT@!$2CUgvErQF?{KLzS|XPzL9VoDW=RyL(Ug=FztdoNsoPNHB-jdgyqG zTOq%R0f_2xKJxk9$ot~AuZtUb%OGCNfq@w%RzZZsr>LGe^Zk2Ox7PUUfb5wVR>psj zI9JYVwbbQoKcsVA03y%oRWT%Z42dbc8x#BO{IUoPDueOXCmos|zExUOl zsxpScZz8oahJs4gEEd_EByb=NE*92I46A}saMNyK6{I1xX2tBB0_Zfv$Y7iSK5wUf z=jc7~`x{qhr(D)G#rpoaSc=EcuExW}`@ycRA6j54K_P|TEc8+&q zLdfM82kSB(7i#Pk^*pYo=05R|2ThoW*Z+9V?$h(*q?B^&(S*t9S@vx&G0TItOB5$) z*Bo!!@yGV}P7KctT|f4D*y$dgw-Nhq3G>cBCCT}lA|k6{q~7I7k2Tu)_NZ%8z=o%4 zmK&!_jY8yzM;Z0;F>0M%ntQBe`$sd?eNHpZH0N`s9k&l2ysz#rnTV=?c%CgjMpTdU zebnx&4~+leNHC72*j(f+UMFtAAZ91h4n)oRpGY4$wOO;bVZatZzukRb^UoAXp=iv& zOff9f)zlT5DHepfy1FW7iwmKyH1$Iwj@c}I64=e&%y6&Pa0j0zt-wo4SBmG_b>VDWH7cK{;-HF!fIgns$kKxhATG4`NZoq z_p|km#T`2)Ya)LP9x+}e9~J-Nb=SV<44J=NK`{$A*T4>Y_X1>#pO{gu@DGDfKau*N zb)+xQSB@1`7|*#0x|^z9?!0L0XuaV<@pWO-UyoZMxCb6 z`AR{rv|j!Fo>>239CW^ekT<{8k@FvRTi#dOPkeVny`Fn7eK8n1=TTC-2li)v*m72; z4sT(#T()dg$B0LD_!}q2S8UtCQ}_&Y{xUzZ=Io%{Z6lg4n+Ku-2r+HzD<7?k+W$KA zAn31sc5%__hZ}7D5ITPz-TR+YA5I=>@3~jZspYC3)u*@mO?26jx67?N7?L{*I_LeI zWADxjSx^u-0eVH~KddTMVeF{0e?Bd~LbO&@Fgf`0$>n=0M{O!uCHCP_qX!SecJNoD z0dqeN{b^=xg!2ckufE%vGHP0t-S6o3Tl|V>RofL4*(PK3sPw^UqsL_oNy$zhoe`V)JYZI^B{6AAI8t(uA delta 33352 zcmeHwdw@<=`}W?OXJ+;=j$;_lm@y9H5QAY38s;OJy0+9+xkP-{9*^x|Ik`x8T>rC z`0fbn1+jQ?-TXzSVbnB?f?1H2AoH}$hh=r>BcNA=?5|}SWCiG5Ap;?QM0S+zwVp9? zO!FbxhVf8&!>9uOB#zgD9FiS9G8ggo9>b^sy$NKnVdNLg1X&-%NJv&>FeEd~%Wa-L zc36fnJ3tj!2+4}{fvf{L#x{&l$n%h1$YYR9-x0@=aX~9cRv=Q#s#=;_{@~9BS2PN~ zMT7-@=I=aXM&&2#di)xsDn2eJBQGy2BWDzPhxzAbjG35`V;KL$aq8)X=noTu5dYfzD=ogCW_TEbz>xYHfAg50d-}NEUkz zlE>3WPDGCy#w-jHYF>~H$??fd&&_K-At!4Pbe1!8MEdAau=_GhI%3m;5$UNBBf@%#71KmL$b0%Fu3X2!wh#C3`Pbl=nhC0fWgcik>1)k7pV#sD3HC~RaanA zF1x@mhGYyK(K^O39&4%!%!g#fMr*wvWU!HM6tvI@_aj3VL>FR)A3|q>A-Yr(Fz=Q*J{#4r@lRQ@cYDn3VYg>we)%wTyGVD*PRy@CC&E2tE(Ly<%>LR1S?LxQf+_86u#_hQm(DFbu zC~M4w(Hw%zFYngpE%jL`f6*irYjQ!~#8oB(yOG`br`EAa1iQ*sq#OX#B^TSMLoiHTJZ1PPzdFF1vS zaG3(1&L9G^F7&;3s2O4OQWdz;Q&r$FBwN1$JS#M2SghRgveQ)awnB1Lg6~wv{j}Vq z(_#Kg`?KI})V5$1GGc~HAp;@5h9Ujq6G-;New}cKmTMqw@S%NF0Tr}d;Y8Xk@?EVd ztgu!Vm}m}{#`9SgZx>yVPo?$vT?@pazW6MidCjP z_))T%@KA?oTl+7`pZ4KJakPoq!P!$gz+B@L*7lhJj_viC&pF9npY@yR%=adl9i2i@ zOB_4Q=Q(W|MhE9nZ=xCL%nS3G=}sZSRgPW9XPqeLbgPqO)^g_6@tM7yLWGYycDT>_ zyu8ybJjuM%nHTQ!%=Q?@ZB9yfqUSBdIx=Pl_!-7vRMq1w4vV)(K!YDB&3wZtjPRN3 z9lNg2T<9d%^;sVVIP>c!nITRgsJV_E>9hUNO;}_KOed{Qyxk94H)!RYqjloVXPm-F zpLHeB39Of7wsex~`OIu*9>PrwJ>Ow`Zg+yh6M3w@&m8T{tM9Y7V)VF%1~^s2;;pYL zI)M$6%wQ+EfzR%Q8PH7TUNt=4&W6?(n&DJM$<@*EST#_O#VC2Plibi}7CQ49`s^^w zr#3j^@1%L-1A0MYD)xR$+520Z$G1`|Mw^dN8fwEDn!16CAsV&)n)H zH}QFD!W-MM)%IP873a7DTAa*(u{Yj63M~Pe(yHGlj*+En#VcXA|U{00L%nKfTj+BmIy77 zhV-lEKKn4ZHsIhkjpI$rnb+KB#yf>LvY?h>VAn)9VH~VuwVZCzNp@VQ>hy9l!$+X0 zer5Itp|Mt~HFavMmRhQ4XtXTvq(#Ns>!GowvQMlZYde80rCYW1*-O2Kktz>WZ4e*u zCA419ipRLMW4H3zqrz0((2Wh^?XA!-Q;|7*)xHevc4+>xb7JeL?pKu>1Fa>F1+Y^C zwnAg2igLHUuj3qyNwO2dRrYGk9)ZRTO$Sx7k3du7S+!og9e_QC8jiJ!w>v;%XG%*m z&q;3M!;&zsjn8udNBYY-pX}JNKKqHf$`aLzjrSaamf)l`PBd#cg*ciL>6WMlDml*Q ziNbEz-ARc{^o&Ogvmdcn5X0<8>?g#MouGE@$~Q2KdnC07vG&fR3GK=^G>pzpO1z9D z%VXO>sVuG`)>CqiL>Wd3W7a28PPev6c0F9Ba4684o(WE2Tc3Rp%)OFXd{;t1W93`Q zT?ayoQ-{3q=3`Fbtv=6N;M&W)%Qs>5khh(J80`!vEiT^k05nt$4R{-|t}<4+skX%m zI&% z4uEs@kqh$x#E>Vr7m8xPB8DEuGI@uS+{x!DXeEaaV7Yq-vGzp;2gJ)xMlqe;m^}+IE(LPY zv2M@2Ue~mSW8QeHNrKZ2d&+PpIoan~jj4326VxEl^m7W6edcYB-OcBj+SV|7 zaPHXW5#yj>O=%GCX?81C5$8~yL^~TXE>&uV?uN!`jSU3-@|(0uiAuB=V(n8_B}2Gb~K;1(+!N zc5p?jirpCu7YX=$n|O1&GcOgJBRI4MYcVQgn?853l&rDS!H(;O0qq5AHS%kq@vKJMOeoSOLt}YZ z{L$?nK)V~7Ew$vH>MRVtg3YE1+J-TrWvh5k8noN#vYs7?B{`2`&RvyUO1(t$RwwyB zpFJr}b+MoUmoMZN2 zX!I8(Lj_hsYv-Ua`(KD*0>K&RM>Tr8V^XzFyr&N|Wa&-xI5L*fHqkzc7`;F?+01h6 zK|Xs^AJ;0(&lUyajWtrL?CH-3JXz6G~f*4qF6`UW@q+Z#w|3jXcJ5zZ7Zg z+GzAE+)1q$_H<|{1b)e5??Xc)wAQenat)m9v`q+r!i54e4+VS;4U0YpnGUJ?iLw)8nr*Npxv-@7ORrcdG#4rNv$C!A# zJG_D#{C8SH02Gcr&d0G_Rqu}umt&ubSX+6ry~LT9!E@un44-Wcz%mVM_)T2A9W&4{ z(u*_)+90V_^(6#Afvq;|3BFi+0U8}sW#T^=+ggz}7#e#|9y4Ec>=8b@Cd%NvM`yH+ z_uK_7iR&>=+6zbcJYPdcE3s}z3{g!%&!a;JLt_`IGuvIzu(HrIa1LnKTHjsT5gU&W0m~m7Ev*Sn^(}NM9;l$ z%zgr~*06v}hsAr|g_bBS{4)(BUdECTlbkgrQx@?O2zng0tX}c&T=6QS6OqQ#Xv)Au$FAs8f%ge0ENDQE24;ad&4-jnMmKUf6JmERWZr^@1il0z+H~i-+=5?W@SiasnE6H`N6VC#XpV4a?#v zXzXHiDlQnGg%$%1TQY|56g1XLZqRnEiEayyro`KK6lqB3nGCHN*C1TfBv1EQA5C=T zPfxM~C#mdk2{|Ys019i3eo9Ly52YPXr>$d?ocS}7?8=i%IK15#8m9`b#?b1yPIA7_ zIy%{zpPyvgQqZU zgOk~IuU571ZZkoU>~xmObB|ns` z$Uvo*DQQ1QAE&gOjM)+CB!*~~l2+JS#twzRATZY979JPXin4Zsg2^|b)IVLi+DM`R1Y1g`)*upOY`4lQ4Uw1ItqAMiH7 z3Lgacp=3Tsso+D&e2!7Ur=(=M;{fHys{M#SVFf+~Snw$z7`Ot^@JE0jN@n~sK>ixQ zidjfRy*y+fWF<)QH6dByI*^qin?bUiR**rE`ALZIQ&KXc4&b@y^nj#E3W9LRQIKqD z4kR<01j&L5AerH#kSx%Fq}_5ze2opjsfe)yk~QB4iLbFA0W&Jp z`awvx{17BFdLNQ4It|GRf2rlykgWJ+NPLYe2$=3CNZS3Z^yfXz4d)d&*=9-;AgOR@fy?X)7Wkt!C@IPRtP}iO%WK+> zk`=fCNjsClO_Im`z*AO$WRF&ZWCf~2GOPR=nh1g9hmr<0wN6RHP_37g9LqYIFDYps zp?OM1>mgtTnrL3jE;kc@sWanSbOt4*>HPL^O{dKxjpYW}5*Az%+Cnl#A|#vC4w8M* z5fWeHb_O>|Qe6=+T{0x?Q?*@5$>Y5=Ps#k#%3*O-_n$rcRLIwg;1Xql1OSD~Ck_9^Y zI3*X@6_Dhg)bc5Pyo6Ls3JF$ZjW%4X4gYT?vXC3(e}74#m$d)IYYNtZ*B0_a$sVYy zWh5j&MRFLFs=)u=H3hT3=^EtkOA6H~LzVc;OARhHyp-UFlAieYC57yUzb`5NzNGm3 zlH%`6ivR9XgWKNUmlS_rQv7{Mp)M^rAO60i;3Wo6ss2A+QglQ1hVj30N#RU?vY%-< z$Dh0#Vf0fB=gRPu4C7XkSs=qRGE7=UW|<5x%CO7RWLC=Xsti+ClUXOj8#3(s44KU` z^m~@^fim1C!%Az&WXf=t3`5qE$(G>(8HTSTGf{?zWf=7wnHe%XF2m^cWai57lnmpZ zC$m6?XJnYPfy^=)UX)>%jbv8J@Tv?`Um&wihBsu`cN3Y-GW6Tb_&^zMlVPPTWHM#A zONJpYlF63g0U3sGB{NZmhh-S`5}6q?JTAlNm&weP;VBu$y+USz4A00g=~XhzWOz}A zUAB=~DZ{HWOx;dqoeXctujvWth5;%sLs~ zkYV5bWH!st@1Kkhl;JiRR(g|6rVMw{+_Wgv+W*PeZi}8Un+$O_HC&*;VaF+~2PLj!% z;Q<+je@bSe3=hjN>J*t7GCVHB=+DT^mEkEF#(hp^feg>cFzGazWiq@d!!BQtSt-M- zGEDuF%sLs~kYV4i$ZVFO-`9)}l;JiRRyso_Q--@_81fC7Y#APqVfa}x6J>ZBAInEydlHB-;>!a zL%&Om50v3H8CJSXCR2vHWEgUVOtuUU$T0i|G81KZScXwQl9?gH<1&o?iOgIXo|0kQ zRWb`?ct(avKa*J|!;3QP@^3OLWq4JFsn^J?li>{+_Wgy-W*PeZ%J@JTZj)i9>tr%z zxJ!m1zmdt7;Q<+j-ykzlhKFSs^*fmvGCa<3X|&03t_)8x6mg~$3zRscM3N=RWlCIB zqDwhRu2kZx5~<}SxlV~2O7!(ea z(YJ~uH!I;+RcZs3*rr6KYLd)UVwVyj)g_s&!~rG3gC#jpiNi`n)sW;2C5|f*9U{rO zN}N(6uBIdxC~-!Kq*{_(ro=@hx`aw{r4m<_NUbf&bxPb&qOVtyo0aejliENfwkc7m zjwCac*rh~BxFoZcIG{v$gd`^_aaf6{x{{os#Bn8}BPBUkiBn3%)sy4`CC(_3R9}+I zl(?uwmj;qtsl-(!QX5Kgof0>c=o=-;%}V$+lG;Eewkc7mu_QB<*rh~B6G>(_F+;@3 zCT2(8Vm6H%m2cp@euZe#6psbXtbGgqD@=Lu!YyWib;H=6+QJMp#o!L+u|c( zy%-;DPV&sEgdf;MS_`wLG;i143@|H;sx8b!>)Xmq6=HfG#Sa0Mw!_9>=I{`+xhcq# zsXvcKYR~qnZOlo5p6y-n+f#{Dc*dp{t+pq0FvppmoV)Sc77O-C@=`~$zn?0(#rFH} zFeh7PviPZ++0(jhia<4%Z*SSdoSG^S#)MoFynr!`&!1B=uw8D>&}i|}3NtA`0~A@F z*z-f3KQs`$pUTg0&CzBy58#ufIsT|IUvvBs-c9$k=Ei`-SN;gNMswMk!_Nl!##&8| z)rtAz!$!@G*M|I&>jlm67k+%@Pty-U@{_B%3W(2_44x7J$0Qu=hXJOUsO{tv0g}US z2$QrSM%GvY@H0gl^0(B-Bx4v;HOFV2mTGRAPRpMGmT7Lf=J>ph&>VlRV`ccz(Bqn$ zNshl^@OPspH2DBXeEFZmjpdq~trLepU!l3V;5ZyLfhRRLPuuZPlczNIu;%zcR!7b8 zSqOaPLs|K4HMu|=dZCX;&Ky_%H47T@sjFJrK^AMfI^ZfJ&YynxPzCMy(|I*U@Occ9 zE#|K%)it*alF_hb025WA$=9+*@*W5FjYYJ|N=APBuE#QV~ zZVfm_n*qZ$w@%wN2bbkOA;6i5uY4$Aq&8fyxfbA)H21vbT7vU|qjzu6Tr0%+Tnrs~ zBP557zfILeoKE|ew&OEze6WX3oBy^Z+d!#_IK9?=wgnIU$w!XppnT4Sb%+B35T}E_ ztJB6K{v|*M<#RCj@~KJVb$||fSabBXRRA6IJ;mkAN8yHopobpOhKY!?b#%s~nrnx6 zRqcd)$Od2jXBy)=K*#$)b4iHr)4g>}b3SnEfk@y(&2>P$lZo-Cqa4>{N5n@VF~{p8 zaLlI@kb*e7_Y+7iMz;Z}n)^cA-43p&=DvdD>e(6SrMYh*nYIg%rnxKb!hpr!xKooq zLbBjHfZm$B3dzPN1AR1i4H92IylV8-93LN|Pjm-x`$JaR51BE)9>6`CbDt{8PXT$a zCIex`6)zRIPjjK**pi+A|7s0;Asiel(+e1&Irs6QG;jko$0vyR@W-9NV9hlKhbaFG zfst-v{bzb7Z|2FKHxc+j{;A4{f+dL%u!;s^2ACRTF44t??xRILUH0A0y0ASB`g5-lh_{zsA zgEW^5i6rt-%F3F{)7)T`Z*Y9*JQFmTj`(j#LFeHUMNB*d;OPpvNtzpq`0tvVthr&} zEW~LyMROU5^D#5}*i_ABB2J&mC&|Z^5I2ScKOjQKyB{3B@^{qB;OKZWv|SeB=fKhN zxPUS3NZ`EY3N$wg+;^JelTWl84P4aREK5H}G6v-Ln&hKV<)LQ-mo)dFPCOPIAE={u zKcu;Fh;zD;o2R+)h;xmgbI%8duaN_AJs|f82$qqH^5r}yxkx9@L;PcHxL9)&!2L^e zOEfnT+)2$jnwtdfQ_VdF4qsz3a7uH_G&cp@=j1s4k85%&;#>ha{g#76l>aeGF0-6| zD>QdM;sAXpEb6FqmR3tZR z@jyuu^l|b=rr)EdW~h&jZIr=%D77B0f=b?|@_XF9Sw_Uj+kP{%k(A;Xo_>?;2b!7l_)&9P5$AByX@An(ONhS?&}s9pYVu_$Y#mAWS7c)YqjRzAS#ff77^d9;upBzA1rGJkH(rCng6W~<6e(-R zf}a4&gTvR@2{2PSsK2&*1929-0tnD{|3IAGPY310peV%H1+X%7(2APdjrhy-gl7>6 z(&Qe*Sun@75;%Ni$+ovwh*A*9-uZjeC3n>v|}E1wB0+1 zlcRmO<^rp%XBKd{SH#7QW|XM%g4r^kd+=;v4lozs{>%NA`z!a;hXL-Pj{*yTg#fot zZkOC1xgB!*TMBT?699L)Cjjnj+{w6eai`+Wvh4{!j#bly)${XK@Dr1A#k%yMW$69{>*m%ZG-0Lh@nc zRzM8U8fXK=0&ze*kO0t&c_X12&>Y}e%$ozjKn)-S!1L1iMpGQD2h;}|01bgCpb^j* zpzG7sy+9biM>V)8*Z^0St!NQX3SI_Y0bT{R0X!)f2jro_sgP;Foj^a}9)Rcm19(v| z7?E^f2rv{F4rBo%fp$Q9APMLIbObs9w*fVQT0kgJ8>kKh12uq4D0C(;3wQvS4NL+i z15*I*RKtMb9RGp95Fib>3+N5>0$KwxfETC&R0FC5!9Wcl1gHtr0@k1>vLHtSa}b{k zJP6DO9tQ3QKO1ruz=fy)n92Bb1l-h50>cpJbK8A^e!xAzy+8_ZE5N0*GQg!V0^rgY z4EzIWcL6+Y+5_wb_5uF{csleJz*C??;2u5I=Z>=zSOq){3si_7xc)P;Rw^!8EOWrKa@_c7cLi~kusBU1xC%f;APA@gR0gU5Re@?i0AK^9qY$4tNi{tcZsfp~Gxi}@=6uit+Jc+LJba0d7WI179W z@Vfmx!0Yl00I$Wr2QC3$0$&07rxAPsybpW;90NWCjsqV79|NBNyd*vWoCJ8;dkXjr z_#8L{90uM4jsQo2gTOn$yFekZANVKmCU5}Y73|v_|9yz;0A2%L2X+E)0RI4X0lW&` z1MCI11J3}@0&9S^z&hYLU_J0WumRWzyZ~$hc!9YEcoEnNyac=qtN@026^xz-V9$kPVCl#sTAjYjB5Ofs+6o@KqhBq|P(hHNdlg>&(>Ms~tOyqxw@_AOo#v~- zzB&*B{0p4UGry=NdqKJxu`)LR8ZuMXmdDu(zW}W0b$~W3%t5BCbSHq7z60nE_yDem zER1%q18$}FBEFLIpDP~=Vaq64iA?}ov;}w>Ab)e$sSH$$OQvxv$jZ45V&N`WDaK{q zC|_pI7O?_ufsAu#bT`Rvbt}oSWSm{?a&AF?R#7)!7R!U& z;ZF6$lDABr0~+G|Tc)=*Pl9ah`tBc<3<%)qP(3i>*0;^tW}@ixwwZ!oMW21!Z0#M4 zV}Urfs$oI1Tjpd82`~r7Mkhoglab=`+h(XaQ&cE4TU#d$(V@_+W&LP~dkf7TvF%Yg zrmGqg_wX~He!JK*2gXFVipJ?W_bwipn)7mDr%%=%z>!uhqg&%pS8<}y4E3fVX$2T` z-7`>3t8q&X4BAA;M7PB5Bq|>?Lt{t4pdxb^dTvGew8zKkykU@sBb9I@ z07v4ZTO~xt8MDLyB=vF`stJRvX#>~n{krmM7_^Lr3FfX?3;Ihhga`@?j9`{(bt;_JLNM|CB%&w8Xffk8%Rk_|NJ8_TZU40?!4TN$p#q ze`8xt6Ni}h%|l)V1~IIHFO_r?s%@$h@7RifD2zzQjk5$Y^_@|zTsPgX6=2LKljuwZri)y0TQTT-Wm-f%DpI`a-aX-3y8&%smV$e~ve4&_f z6up)#HbIMX|M32I{~q$`py~l_ip{^Op+^3E#k!#tW;Kk#5mbSd_%uXZKZ=3M5-r{@ z>dJ8Rl>2A*e;aMSIIiC9|B{)Z=A19ni%r?3%$zZa8X?jPkJ zGQL6k4izdVAUDiwj>x&%BJ~5amN`fa{{T(N7ArnLx6bm)YqWyw~TJX>U?-wfz^rP$zHq}cU6`o<6gK2j^xkqc03ip5aP7GfiWw<{L#T1ftTVzaL| zPU#n`lcTE!iJ2E*H&vvaHiJcrA5Bl#1sKd%3t zkf^;#{}>`jZ2hcQ(_|?Vas6YnHW$x7ruMpjGQan`)-h+#wc!Rg~0iTS}96- z?#)g5!;qHlF6~*RJw=oI#aOt{f8U2?`%Wp3z>0!Nrd+tF@5@f7yZbMy``3<8s>lC_ zji{}LJVx~7P<9ntzJ@5XMtZdMWGK-}uloXxT~!x6AG31I$HlW+j-D=}bT8@QDD9)} zXzSXPu0}Pn^_m&%C)XxDe7Z`1bU6`z7QWL+M1GIfXcyAGrAjpWl{pV|9m^<6r`E0i zV~OSvvG!Y>AN+A~*K4~mSe*7))&1o{Z)_G@{jBPu?m5%X>%Q(|Zq~@^6*|6}YME}5 z$3(|-Xh1)4AB0!Gps1i>$QaM?FLu``wp$?}|z2YP7#iz{MeYwiV!}2Z!S3QpX&#gngsCpg?#)pxj*?COfbJ&|guwU%Fe(S!a zqZe;2HmoKF!7%QROFVPJMk+5Xc*5=9@I;Tt5?d`PPKxQVnVHwrJJ*xFSHEBQbn;8Z z7A?eSWDdvt6{3tCj%8qjGlqy3-=Qah>dSkR1&6=uzih$_7PexyIqpkfuDtberA>hk zzF2&utEh_c5sSXVkPJdaaKceAre?dz59OadT5L5{Y()Xqg?i%M?@(j+6)oYxD=sxZ zF&8JkrT21uJrMTCUUBWvcDaWKiOB0{p`2Ir*%DV4Tm?$lls(g>Ukw&@a3yk6YJJjB zl#4!FxICAPbN}PA_VkxzBJ#|fZq`DYe%kqedm(5;!Q!Txpx|JC%wp_WnxuvS18YjA3 zG2399V&DA5h^gGX?pt^^rCx6SQN6yGi-%OM8Nq%fPStpFGVVIsu6yS{bjyF?26}Kx zdqatiEBk~^R!Q%#)~TjqmRzO;*!_T@50>*nHzh~KZ>JW1-x-gaM8)!%r&^0jLVXBNB3AHDrA zW^Ad3{l^ab3xhv8r|Xn@%9fa(MXfBWdCI^4*oe}zwI~Zc7P=jJ!iD`RPu)taVLJ6q z6Q-=SqbTRnYenpMJxwof8T8H3C~i&q+;J z#U9;q1LMyNOt9|TwJLR3cFsHPu6{Ve`&~Hizn&moxPh5@K+N>FLc`qGYkjw+{p#RX z`!tqW$P31kZAI|!W{lT;G1rPG4%Qw&W=92Sfjcz#nMkDn4#)I~3jtQB*L~4etyR;W zcyxVlUe2>J*mYG=vF@9?qTB7yI6MEYzB(fq{CN?R#Baaj0{oSwt*q8w_Z48v8or$| zq1s*hbp~jZZ)rYiP-X%0hJvbr>05dTHvyEg%(QB|o$%-7|Il9aGOd^}_hn!S-40%i zSy3DRO~btj_*0TtX`;H5;!|3eb*8Bd;yLV%!;>wkEVyKd?5Yv&=`^S4XZg?k-b;^sJ{?}eyMY*bJ)`_Z8t1;oOH^ zlz0yr#k%jO`!;B3{hUt*U)Kh3d-n}>uPl2$?Bx4{<`f@MMR@;Yg^I-wtg>)C?8G9x z|L+;;g{;g1<;~Gjjo#kdw%S={fLL4s4Rqf=);jg(`e_u-0j`-7h)C^T)0zZ#POLgw!ol_ z$#%BExqc393G) z|Bmy;2BSq!7{t17KJ2{f&2{H?k2+Rt;JzF2>7jSW?%TP!T=5Y@JcXpV$1LmGR2-$Y zSBwp@T8r??)(G#4o@#Z@e7I(x7NSLW^Z=J{bZaBAx-yK{h@BLhL|P3i*iZhdv_pIk z%Im(z@YvJ7a~)4#@2`_$$PSB+Rjpuunaw9XMN$?ePW$`%WYjs%O3s#+1sN;hq*s9Fu1n%|vjFWUM3nIY?QUwKfLA=Be( zt{N)gzBDrOM2mrq21b4(H%VFNRl=!erC4Y06kk-cdZ^4paeto0iu36s z77c4+v}L2{-MQ2zi|1-uDPH&Wm#^Hm=COG>{l;3RUiOWFqH-;ak#?SX~Fj9<48_HXo?eJfVkfnpVs{;g{^BW;qr`SEhW&sz@3m6g1f?v!?u$MHK0o>VrqPqT zaxHHy2T|uQ%~ML}FWS|?gpo&Dmzk~EU3^jpC9f4h;W&-G`E)lJTT0#g@2@+s&5hxr zQ@GW``eB4v6pr)o-$sZH(9JI5=WwL&EpCahLaQ$wsW#O{ZAb4h#7 z%o)N{CvHhtLOf!6UD>7Fn#GHCt#kOna783q=f2u=?A4}6?%%cv_Z~41u-D?TE_pRk z%j>=j)S4Q!ZGOEf6Xa0KT)T?P^{txa+8TF>I`!Z+?(0N5?;kq!P@^AmV5xuhPZw!0 zFvp5fw3{_fK6F~JVD(FVew+SYADN>Zwq;@!4C4NLBXZwd`k-e?;}eM|PRQ!Yq+gF0 z7wcIu*7xH@z4{oGv$eIBhvM$sah@81^ zq9Z<>AUZU#YN?;sL;oT}{flp|_^crsD=)!PtdrwKm4;TWxOS7&lxo%Pi5u3T#|)Xj z+%n3ZG5ldjm+W=lsJgT5?%UJH?`(>+`e*B&Vlm6g6&oSSuA1x}Ri{|@C9A9JTa+^5BaN%i%c@UP<=O?ACkywf5ZD1S8f{A zbdLj_CzkJi``Nx}!<~bn;#<_aRii%YnVDxkdbP^d55i_7L1(=dpLlI~*pu^ulc86K zeqm!kwee%V{ZDNJj{%Nc_hdh1$&Ga!3)_QBO?zCT4iX}~~xa~hT Tv06+OgVtF0iL?%;Fpd8M4V@c7 diff --git a/contracts/parallelizer/configs/DiamondInitializer.sol b/contracts/parallelizer/configs/DiamondInitializer.sol new file mode 100644 index 0000000..e0eea16 --- /dev/null +++ b/contracts/parallelizer/configs/DiamondInitializer.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.28; + +import "./DiamondInitializerTypes.sol"; + +/// @dev This contract is used only once to initialize the diamond proxy. +contract DiamondInitializer { + function initialize( + IAccessManager _accessManager, + address _tokenP, + CollateralSetup[] memory _collaterals, + RedemptionSetup memory _redemptionSetup + ) + external + { + LibSetters.setAccessManager(_accessManager); + + ParallelizerStorage storage ts = s.transmuterStorage(); + ts.statusReentrant = NOT_ENTERED; + ts.normalizer = uint128(BASE_27); + ts.tokenP = ITokenP(_tokenP); + + // Setup each collateral + uint256 collateralsLength = _collaterals.length; + for (uint256 i; i < collateralsLength; i++) { + CollateralSetup memory collateral = _collaterals[i]; + LibSetters.addCollateral(collateral.token); + LibSetters.setOracle(collateral.token, collateral.oracleConfig); + // Mint fees + LibSetters.setFees(collateral.token, collateral.xMintFee, collateral.yMintFee, true); + // Burn fees + LibSetters.setFees(collateral.token, collateral.xBurnFee, collateral.yBurnFee, false); + LibSetters.togglePause(collateral.token, ActionType.Mint); + LibSetters.togglePause(collateral.token, ActionType.Burn); + } + + // setRedemptionCurveParams + if (_redemptionSetup.xRedeemFee.length > 0) { + LibSetters.togglePause(address(0), ActionType.Redeem); + LibSetters.setRedemptionCurveParams(_redemptionSetup.xRedeemFee, _redemptionSetup.yRedeemFee); + } + } +} diff --git a/contracts/parallelizer/configs/DiamondInitializerTypes.sol b/contracts/parallelizer/configs/DiamondInitializerTypes.sol new file mode 100644 index 0000000..5a723f3 --- /dev/null +++ b/contracts/parallelizer/configs/DiamondInitializerTypes.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.28; + +import "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol"; + +import "../libraries/LibOracle.sol"; +import { LibSetters } from "../libraries/LibSetters.sol"; +import { LibStorage as s } from "../libraries/LibStorage.sol"; + +import "../../utils/Constants.sol"; +import "../Storage.sol" as Storage; + +struct CollateralSetup { + address token; + bytes oracleConfig; + uint64[] xMintFee; + int64[] yMintFee; + uint64[] xBurnFee; + int64[] yBurnFee; +} + +struct RedemptionSetup { + uint64[] xRedeemFee; + int64[] yRedeemFee; +} diff --git a/contracts/parallelizer/configs/Production.sol b/contracts/parallelizer/configs/Production.sol new file mode 100644 index 0000000..c131558 --- /dev/null +++ b/contracts/parallelizer/configs/Production.sol @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.28; + +import "./ProductionTypes.sol"; + +/// @dev This contract is used only once to initialize the diamond proxy. +contract Production { + function initialize( + IAccessManager _accessManager, + address _tokenP, + CollateralSetup[] memory _collaterals, + RedemptionSetup memory _redemptionSetup + ) + external + { + // // Set Collaterals + // CollateralSetupProd[] memory collaterals = new CollateralSetupProd[](1); + // // USDC + // { + // uint64[] memory xMintFeeUsdc = new uint64[](1); + // xMintFeeUsdc[0] = uint64(0); + + // int64[] memory yMintFeeUsdc = new int64[](1); + // yMintFeeUsdc[0] = int64(0); + + // uint64[] memory xBurnFeeUsdc = new uint64[](1); + // xBurnFeeUsdc[0] = uint64(BASE_9); + + // int64[] memory yBurnFeeUsdc = new int64[](1); + // yBurnFeeUsdc[0] = int64(0); + + // bytes memory oracleConfig; + // { + // bytes memory readData; + // { + // AggregatorV3Interface[] memory circuitChainlink = new AggregatorV3Interface[](1); + // uint32[] memory stalePeriods = new uint32[](1); + // uint8[] memory circuitChainIsMultiplied = new uint8[](1); + // uint8[] memory chainlinkDecimals = new uint8[](1); + + // // Chainlink USDC/USD oracle + // circuitChainlink[0] = AggregatorV3Interface(0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6); + // stalePeriods[0] = 1 days; + // circuitChainIsMultiplied[0] = 1; + // chainlinkDecimals[0] = 8; + // OracleQuoteType quoteType = OracleQuoteType.UNIT; + // readData = abi.encode(circuitChainlink, stalePeriods, circuitChainIsMultiplied, chainlinkDecimals, + // quoteType); + // } + // bytes memory targetData; + // oracleConfig = abi.encode( + // Storage.OracleReadType.CHAINLINK_FEEDS, + // Storage.OracleReadType.STABLE, + // readData, + // targetData, + // abi.encode(uint128(0), uint128(50 * BPS)) + // ); + // } + // collaterals[0] = CollateralSetupProd(USDC, oracleConfig, xMintFeeUsdc, yMintFeeUsdc, xBurnFeeUsdc, + // yBurnFeeUsdc); + // } + + LibSetters.setAccessManager(_accessManager); + + ParallelizerStorage storage ts = s.transmuterStorage(); + ts.statusReentrant = NOT_ENTERED; + ts.normalizer = uint128(BASE_27); + ts.tokenP = ITokenP(_tokenP); + + // Setup each collateral + uint256 collateralsLength = _collaterals.length; + for (uint256 i; i < collateralsLength; i++) { + CollateralSetup memory collateral = _collaterals[i]; + LibSetters.addCollateral(collateral.token); + LibSetters.setOracle(collateral.token, collateral.oracleConfig); + // Mint fees + LibSetters.setFees(collateral.token, collateral.xMintFee, collateral.yMintFee, true); + // Burn fees + LibSetters.setFees(collateral.token, collateral.xBurnFee, collateral.yBurnFee, false); + LibSetters.togglePause(collateral.token, ActionType.Mint); + LibSetters.togglePause(collateral.token, ActionType.Burn); + } + + // setRedemptionCurveParams + if (_redemptionSetup.xRedeemFee.length > 0) { + LibSetters.togglePause(address(0), ActionType.Redeem); + LibSetters.setRedemptionCurveParams(_redemptionSetup.xRedeemFee, _redemptionSetup.yRedeemFee); + } + } +} diff --git a/deploy/config/sepolia/config.json b/deploy/config/sepolia/config.json new file mode 100644 index 0000000..6d03c99 --- /dev/null +++ b/deploy/config/sepolia/config.json @@ -0,0 +1,39 @@ +{ + "accessManager": "0xfD28f108e95f4D41daAE9dbfFf707D677985998E", + "wallets": { + "dao": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02" + }, + "tokens": { + "usdp": "0xA8FE9843B4Cc2aAB136209B49E2c3E2A7ebD5CFA" + }, + "parallelizer": { + "usdp": { + "collaterals": [ + { + "token": "0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8", + "oracle": { + "oracleType": "CHAINLINK_FEEDS", + "targetType": "STABLE", + "quoteType": "UNIT", + "circuitChainlink": ["0xA2F78ab2355fe2f984D808B5CeE7FD0A93D5270E"], + "stalePeriods": [86400], + "circuitChainIsMultiplied": [1], + "chainlinkDecimals": [8], + "hyperparameters": { + "userDeviation": 0, + "burnRatioDeviation": 5000000000000000 + } + }, + "xMintFee": [0, 940000000, 950000000], + "yMintFee": [500000, 500000, 999999999999], + "xBurnFee": [1000000000, 310000000, 300000000], + "yBurnFee": [500000, 500000, 999000000] + } + ], + "redemptionSetup": { + "xRedeemFee": [750000000, 850000000, 950000000, 970000000], + "yRedeemFee": [995000000, 950000000, 950000000, 995000000] + } + } + }, +} diff --git a/deploy/scripts/parallelizer/DiamondInitializer.ts b/deploy/scripts/parallelizer/DiamondInitializer.ts new file mode 100644 index 0000000..c584e6b --- /dev/null +++ b/deploy/scripts/parallelizer/DiamondInitializer.ts @@ -0,0 +1,30 @@ +import assert from "assert"; + +import { type DeployFunction } from "hardhat-deploy/types"; + +const contractName = "DiamondInitializer"; + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + console.log(`Deploying ${contractName}...`); + + const initializer = await deploy(contractName, { + from: deployer, + log: true, + }); + + console.log(`Deployed contract: ${contractName}, network: ${hre.network.name}, address: ${initializer.address}`); +}; + +deploy.tags = [contractName]; + +export default deploy; diff --git a/deploy/scripts/parallelizer/Parallelizer.ts b/deploy/scripts/parallelizer/Parallelizer.ts new file mode 100644 index 0000000..3e2aa33 --- /dev/null +++ b/deploy/scripts/parallelizer/Parallelizer.ts @@ -0,0 +1,175 @@ +import assert from "assert"; +import { defaultAbiCoder as abiCoder, FunctionFragment, Interface } from "@ethersproject/abi"; +import { BigNumber } from "ethers"; + +import { DeploymentsExtension, type DeployFunction, Deployment } from "hardhat-deploy/types"; + +import { + ChainlinkFeedsConfig, + CollateralConfig, + CollateralSetupParams, + OracleReadType, + RedemptionSetup, +} from "../../utils/types"; + +import { readFileSync } from "fs-extra"; +import { checkAddressValid, getTokenAddressFromConfig, parseToConfigData } from "../../utils"; + +const contractName = "Parallelizer"; + +const token = "USDp"; + +enum FacetCutAction { + Add, + Replace, + Remove, +} + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + const config = parseToConfigData( + JSON.parse(readFileSync(`./deploy/config/${hre.network.name}/config.json`).toString()), + ); + + const tokenPAddress = getTokenAddressFromConfig(token, config); + if (!tokenPAddress) throw new Error(`Token ${token} address not found in config`); + + const accessManager = checkAddressValid(config.accessManager, "access manager"); + + const parallelizerConfig = config.parallelizer[token.toLowerCase() as keyof typeof config.parallelizer]; + if (!parallelizerConfig) throw new Error(`Parallelizer config for ${token} not found in config`); + + let collateralArgs = []; + const collaterals = parallelizerConfig.collaterals; + + for (const collateral of collaterals) { + if (!collateral) throw new Error(`Collateral ${collateral} has no oracle config`); + const collateralSetup = setUpCollateral(collateral); + collateralArgs.push(collateralSetup); + } + + const redemptionSetup = setUpRedemption(parallelizerConfig.redemptionSetup); + + const initializer = await deployments.get("DiamondInitializer"); + const callData = new Interface(initializer.abi).encodeFunctionData("initialize", [ + accessManager, + tokenPAddress, + collateralArgs, + redemptionSetup, + ]); + + const facets = await getFacetsWithSelectors(deployments); + const cuts = facets.map((facet) => facet.cut); + const parallelizer = await deploy(`${contractName}_${token}`, { + contract: "DiamondProxy", + from: deployer, + args: [cuts, initializer.address, callData], + log: true, + skipIfAlreadyDeployed: true, + }); + + console.log( + `Deployed contract: ${contractName}_${token}, network: ${hre.network.name}, address: ${parallelizer.address}`, + ); +}; + +deploy.tags = [contractName]; +deploy.dependencies = ["DiamondInitializer", "Facets"]; + +export default deploy; + +const getFacetsWithSelectors = async (deployments: DeploymentsExtension) => { + const facetsList = [ + "DiamondCut", + "DiamondLoupe", + "SettersGovernor", + "SettersGuardian", + "Getters", + "Swapper", + "Redeemer", + "RewardHandler", + ]; + const facets = []; + for (const facet of facetsList) { + const facetContract = await deployments.get(facet); + const cut = { + facetAddress: facetContract.address, + action: FacetCutAction.Add, + functionSelectors: getSelectors(facetContract), + }; + facets.push({ + facetContract, + cut, + }); + } + return facets; +}; + +function sigsFromABI(abi: any[]): string[] { + return abi + .filter((fragment: any) => fragment.type === "function") + .map((fragment: any) => Interface.getSighash(FunctionFragment.from(fragment))); +} + +const getSelectors = (contract: Deployment) => { + return sigsFromABI(contract.abi); +}; + +const setUpCollateral = (collateral: CollateralConfig): CollateralSetupParams => { + const { token, oracle, xMintFee, yMintFee, xBurnFee, yBurnFee } = collateral; + + let readData; + if (oracle.oracleType === OracleReadType.CHAINLINK_FEEDS) { + const { circuitChainlink, stalePeriods, circuitChainIsMultiplied, chainlinkDecimals } = oracle; + if ( + circuitChainlink.length != stalePeriods.length || + circuitChainlink.length != circuitChainIsMultiplied.length || + circuitChainlink.length != chainlinkDecimals.length + ) { + throw new Error(`Chainlink feeds config must have the same length`); + } + readData = abiCoder.encode( + ["address[]", "uint32[]", "uint8[]", "uint8[]", "uint8"], + [circuitChainlink, stalePeriods, circuitChainIsMultiplied, chainlinkDecimals, oracle.quoteType], + ); + } + let targetData = "0x"; + let hyperparametersData = "0x"; + if (oracle.hyperparameters) { + hyperparametersData = abiCoder.encode( + ["uint128", "uint128"], + [oracle.hyperparameters.userDeviation, oracle.hyperparameters.burnRatioDeviation], + ); + } + + const oracleConfig = abiCoder.encode( + ["uint8", "uint8", "bytes", "bytes", "bytes"], + [oracle.oracleType, oracle.targetType, readData, targetData, hyperparametersData], + ); + + return { + token, + oracleConfig, + xMintFee, + yMintFee, + xBurnFee, + yBurnFee, + }; +}; + +const setUpRedemption = (redemption?: RedemptionSetup): RedemptionSetup => { + if (!redemption) throw new Error(`Redemption setup not found in config`); + if (redemption.xRedeemFee.length !== redemption.yRedeemFee.length) { + throw new Error(`Redemption setup must have the same length`); + } + return redemption; +}; diff --git a/deploy/scripts/parallelizer/facets/DiamondCut.ts b/deploy/scripts/parallelizer/facets/DiamondCut.ts new file mode 100644 index 0000000..7506ba5 --- /dev/null +++ b/deploy/scripts/parallelizer/facets/DiamondCut.ts @@ -0,0 +1,31 @@ +import assert from "assert"; + +import { type DeployFunction } from "hardhat-deploy/types"; + +const contractName = "DiamondCut"; + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + console.log(`Deploying facet ${contractName}...`); + + const diamondCut = await deploy(contractName, { + from: deployer, + skipIfAlreadyDeployed: true, + log: true, + }); + + console.log(`Deployed facet: ${contractName}, network: ${hre.network.name}, address: ${diamondCut.address}`); +}; + +deploy.tags = ["Facets", contractName]; + +export default deploy; diff --git a/deploy/scripts/parallelizer/facets/DiamondLoupe.ts b/deploy/scripts/parallelizer/facets/DiamondLoupe.ts new file mode 100644 index 0000000..5fce75a --- /dev/null +++ b/deploy/scripts/parallelizer/facets/DiamondLoupe.ts @@ -0,0 +1,31 @@ +import assert from "assert"; + +import { type DeployFunction } from "hardhat-deploy/types"; + +const contractName = "DiamondLoupe"; + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + console.log(`Deploying facet ${contractName}...`); + + const diamondLoupe = await deploy(contractName, { + from: deployer, + skipIfAlreadyDeployed: true, + log: true, + }); + + console.log(`Deployed facet: ${contractName}, network: ${hre.network.name}, address: ${diamondLoupe.address}`); +}; + +deploy.tags = ["Facets", contractName]; + +export default deploy; diff --git a/deploy/scripts/parallelizer/facets/Getters.ts b/deploy/scripts/parallelizer/facets/Getters.ts new file mode 100644 index 0000000..2d5ffc0 --- /dev/null +++ b/deploy/scripts/parallelizer/facets/Getters.ts @@ -0,0 +1,31 @@ +import assert from "assert"; + +import { type DeployFunction } from "hardhat-deploy/types"; + +const contractName = "Getters"; + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + console.log(`Deploying facet ${contractName}...`); + + const getters = await deploy(contractName, { + from: deployer, + log: true, + skipIfAlreadyDeployed: true, + }); + + console.log(`Deployed facet: ${contractName}, network: ${hre.network.name}, address: ${getters.address}`); +}; + +deploy.tags = ["Facets", contractName]; + +export default deploy; diff --git a/deploy/scripts/parallelizer/facets/Redeemer.ts b/deploy/scripts/parallelizer/facets/Redeemer.ts new file mode 100644 index 0000000..0b65579 --- /dev/null +++ b/deploy/scripts/parallelizer/facets/Redeemer.ts @@ -0,0 +1,31 @@ +import assert from "assert"; + +import { type DeployFunction } from "hardhat-deploy/types"; + +const contractName = "Redeemer"; + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + console.log(`Deploying facet ${contractName}...`); + + const redeemer = await deploy(contractName, { + from: deployer, + log: true, + skipIfAlreadyDeployed: true, + }); + + console.log(`Deployed facet: ${contractName}, network: ${hre.network.name}, address: ${redeemer.address}`); +}; + +deploy.tags = ["Facets", contractName]; + +export default deploy; diff --git a/deploy/scripts/parallelizer/facets/RewardHandler.ts b/deploy/scripts/parallelizer/facets/RewardHandler.ts new file mode 100644 index 0000000..4187cb0 --- /dev/null +++ b/deploy/scripts/parallelizer/facets/RewardHandler.ts @@ -0,0 +1,31 @@ +import assert from "assert"; + +import { type DeployFunction } from "hardhat-deploy/types"; + +const contractName = "RewardHandler"; + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + console.log(`Deploying facet ${contractName}...`); + + const rewardHandler = await deploy(contractName, { + from: deployer, + log: true, + skipIfAlreadyDeployed: true, + }); + + console.log(`Deployed facet: ${contractName}, network: ${hre.network.name}, address: ${rewardHandler.address}`); +}; + +deploy.tags = ["Facets", contractName]; + +export default deploy; diff --git a/deploy/scripts/parallelizer/facets/SettersGovernor.ts b/deploy/scripts/parallelizer/facets/SettersGovernor.ts new file mode 100644 index 0000000..c87c973 --- /dev/null +++ b/deploy/scripts/parallelizer/facets/SettersGovernor.ts @@ -0,0 +1,31 @@ +import assert from "assert"; + +import { type DeployFunction } from "hardhat-deploy/types"; + +const contractName = "SettersGovernor"; + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + console.log(`Deploying facet ${contractName}...`); + + const settersGovernor = await deploy(contractName, { + from: deployer, + log: true, + skipIfAlreadyDeployed: true, + }); + + console.log(`Deployed facet: ${contractName}, network: ${hre.network.name}, address: ${settersGovernor.address}`); +}; + +deploy.tags = ["Facets", contractName]; + +export default deploy; diff --git a/deploy/scripts/parallelizer/facets/SettersGuardian.ts b/deploy/scripts/parallelizer/facets/SettersGuardian.ts new file mode 100644 index 0000000..511fa5f --- /dev/null +++ b/deploy/scripts/parallelizer/facets/SettersGuardian.ts @@ -0,0 +1,31 @@ +import assert from "assert"; + +import { type DeployFunction } from "hardhat-deploy/types"; + +const contractName = "SettersGuardian"; + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + console.log(`Deploying facet ${contractName}...`); + + const settersGuardian = await deploy(contractName, { + from: deployer, + log: true, + skipIfAlreadyDeployed: true, + }); + + console.log(`Deployed facet: ${contractName}, network: ${hre.network.name}, address: ${settersGuardian.address}`); +}; + +deploy.tags = ["Facets", contractName]; + +export default deploy; diff --git a/deploy/scripts/parallelizer/facets/Swapper.ts b/deploy/scripts/parallelizer/facets/Swapper.ts new file mode 100644 index 0000000..bf5c390 --- /dev/null +++ b/deploy/scripts/parallelizer/facets/Swapper.ts @@ -0,0 +1,31 @@ +import assert from "assert"; + +import { type DeployFunction } from "hardhat-deploy/types"; + +const contractName = "Swapper"; + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + console.log(`Deploying facet ${contractName}...`); + + const swapper = await deploy(contractName, { + from: deployer, + log: true, + skipIfAlreadyDeployed: true, + }); + + console.log(`Deployed facet: ${contractName}, network: ${hre.network.name}, address: ${swapper.address}`); +}; + +deploy.tags = ["Facets", contractName]; + +export default deploy; diff --git a/deploy/utils/index.ts b/deploy/utils/index.ts new file mode 100644 index 0000000..4e34165 --- /dev/null +++ b/deploy/utils/index.ts @@ -0,0 +1,87 @@ +import { ethers } from "ethers"; +import { Address, ConfigData, Hyperparameters, OracleReadType, QuoteType } from "./types"; + +// return token address defined in config.tokens +export const getTokenAddressFromConfig = (token: string, config: ConfigData) => { + if (!Object.keys(config.tokens).includes(token.toLowerCase())) throw new Error(`Token ${token} not found in config`); + const tokenAddress = config.tokens[token.toLowerCase() as keyof typeof config.tokens]; + if (!isAddressValid(tokenAddress)) throw new Error(`Invalid ${token} address: ${tokenAddress}`); + return tokenAddress; +}; + +export const getWalletAddressFromConfig = (wallet: string, config: ConfigData) => { + if (!Object.keys(config.wallets).includes(wallet.toLowerCase())) + throw new Error(`Wallet ${wallet} not found in config`); + const walletAddress = config.wallets[wallet.toLowerCase() as keyof typeof config.wallets]; + if (!isAddressValid(walletAddress)) throw new Error(`Invalid ${wallet} address: ${walletAddress}`); + return walletAddress; +}; + +export const checkAddressValid = (address: Address, label: string) => { + if (!isAddressValid(address)) throw new Error(`Invalid ${label} address: ${address}`); + return address; +}; + +export const isAddressValid = (address: string) => { + return ethers.utils.isAddress(address) && ethers.constants.AddressZero !== address; +}; + +export const parseToConfigData = (config: any): ConfigData => { + return { + ...config, + parallelizer: Object.fromEntries( + Object.entries(config.parallelizer).map(([key, value]: [string, any]) => [ + key, + { + ...value, + collaterals: value.collaterals.map(({ xMintFee, yMintFee, xBurnFee, yBurnFee, oracle, token }: any) => { + checkAddressValid(token, `Invalid ${token} collateral address`); + if (!(oracle.oracleType in OracleReadType)) { + throw new Error(`${token} Invalid oracle type: ${oracle.oracleType}`); + } + if (!(oracle.targetType in OracleReadType)) { + throw new Error(`${token} Invalid target type: ${oracle.targetType}`); + } + if (!(oracle.quoteType in QuoteType)) { + throw new Error(`${token} Invalid quote type: ${oracle.quoteType}`); + } + if (xMintFee.length !== yMintFee.length) { + throw new Error(`Mint fee array must have the same length`); + } + if (xBurnFee.length !== yBurnFee.length) { + throw new Error(`Burn fee array must have the same length`); + } + + let hyperparameters: Hyperparameters | undefined; + if (oracle.hyperparameters) { + hyperparameters = { + userDeviation: BigInt(oracle.hyperparameters.userDeviation), + burnRatioDeviation: BigInt(oracle.hyperparameters.burnRatioDeviation), + }; + } + + return { + token, + oracle: { + ...oracle, + quoteType: QuoteType[oracle.quoteType as keyof typeof QuoteType], + oracleType: OracleReadType[oracle.oracleType as keyof typeof OracleReadType], + targetType: OracleReadType[oracle.targetType as keyof typeof OracleReadType], + stalePeriods: oracle.stalePeriods.map((x: string | number) => BigInt(x)), + hyperparameters: hyperparameters, + }, + xMintFee: xMintFee.map((x: string | number) => BigInt(x)), + yMintFee: yMintFee.map((x: string | number) => BigInt(x)), + xBurnFee: xBurnFee.map((x: string | number) => BigInt(x)), + yBurnFee: yBurnFee.map((x: string | number) => BigInt(x)), + }; + }), + redemptionSetup: { + xRedeemFee: value.redemptionSetup.xRedeemFee.map((x: string | number) => BigInt(x)), + yRedeemFee: value.redemptionSetup.yRedeemFee.map((x: string | number) => BigInt(x)), + }, + }, + ]), + ), + }; +}; diff --git a/deploy/utils/types.ts b/deploy/utils/types.ts new file mode 100644 index 0000000..9ed7e1b --- /dev/null +++ b/deploy/utils/types.ts @@ -0,0 +1,84 @@ +import { checkAddressValid } from "./index"; + +export type Address = `0x${string}`; + +export enum OracleReadType { + CHAINLINK_FEEDS, + EXTERNAL, + NO_ORACLE, + STABLE, + WSTETH, + CBETH, + RETH, + SFRXETH, + MAX, + MORPHO_ORACLE, +} + +export enum QuoteType { + UNIT, + TARGET, +} + +export type CollateralSetupParams = { + token: Address; + oracleConfig: string; + xMintFee: bigint[]; + yMintFee: bigint[]; + xBurnFee: bigint[]; + yBurnFee: bigint[]; +}; + +export type ChainlinkFeedsConfig = OracleBaseConfig & { + circuitChainlink: Address[]; + stalePeriods: bigint[]; + circuitChainIsMultiplied: number[]; + chainlinkDecimals: number[]; + quoteType: QuoteType; +}; + +export type Hyperparameters = { + userDeviation: bigint; + burnRatioDeviation: bigint; +}; + +export type OracleBaseConfig = { + oracleType: OracleReadType; + targetType: OracleReadType; + hyperparameters?: Hyperparameters; + targetData?: string; +}; + +export type RedemptionSetup = { + xRedeemFee: bigint[]; + yRedeemFee: bigint[]; +}; + +export type OracleConfig = ChainlinkFeedsConfig; + +export type CollateralConfig = { + token: Address; + oracle: OracleConfig; + xMintFee: bigint[]; + yMintFee: bigint[]; + xBurnFee: bigint[]; + yBurnFee: bigint[]; +}; + +export type ParallelizerConfig = { + collaterals: CollateralConfig[]; + redemptionSetup: RedemptionSetup; +}; + +export type ConfigData = { + accessManager: Address; + wallets: { + dao: Address; + }; + tokens: { + [tokenP: string]: Address; + }; + parallelizer: { + [tokenP: string]: ParallelizerConfig; + }; +}; diff --git a/hardhat.config.ts b/hardhat.config.ts index dffe4c1..d4fec1b 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,6 +1,6 @@ import "dotenv/config"; - import "hardhat-deploy"; +import "@nomicfoundation/hardhat-foundry"; import { HardhatUserConfig, HttpNetworkAccountsUserConfig } from "hardhat/types"; @@ -23,10 +23,12 @@ const config: HardhatUserConfig = { { version: "0.8.28", settings: { + evmVersion: "cancun", optimizer: { enabled: true, - runs: 10_000, + runs: 1_000, }, + viaIR: true, }, }, ], diff --git a/package.json b/package.json index 6c90dca..d7b4390 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,11 @@ "url": "https://github.com/ParallelProtocol/parallel-parallelizer/issues" }, "devDependencies": { + "@nomicfoundation/hardhat-foundry": "^1.1.3", + "@types/fs-extra": "^11.0.4", "dotenv": "^16.4.7", "forge-std": "github:foundry-rs/forge-std#v1.9.5", + "fs-extra": "^11.3.0", "hardhat": "^2.22.19", "hardhat-deploy": "^1.0.1", "prettier": "^3.5.3", From caf1caa3de69f674965b7fd058efb8d9dba2c68c Mon Sep 17 00:00:00 2001 From: FabienCoutant Date: Mon, 26 May 2025 13:56:59 +0300 Subject: [PATCH 2/9] feat: setup Savings deployment scripts --- deploy/abis/IERC20.ts | 77 ++++++++++++++++++++++++++++++ deploy/config/sepolia/config.json | 6 +++ deploy/scripts/Saving.ts | 79 +++++++++++++++++++++++++++++++ deploy/utils/types.ts | 8 ++++ 4 files changed, 170 insertions(+) create mode 100644 deploy/abis/IERC20.ts create mode 100644 deploy/scripts/Saving.ts diff --git a/deploy/abis/IERC20.ts b/deploy/abis/IERC20.ts new file mode 100644 index 0000000..1b1fc62 --- /dev/null +++ b/deploy/abis/IERC20.ts @@ -0,0 +1,77 @@ +export const IERC20Abi = [ + { + type: "function", + name: "allowance", + inputs: [ + { name: "owner", type: "address", internalType: "address" }, + { name: "spender", type: "address", internalType: "address" }, + ], + outputs: [{ name: "", type: "uint256", internalType: "uint256" }], + stateMutability: "view", + }, + { + type: "function", + name: "approve", + inputs: [ + { name: "spender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + ], + outputs: [{ name: "", type: "bool", internalType: "bool" }], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "balanceOf", + inputs: [{ name: "account", type: "address", internalType: "address" }], + outputs: [{ name: "", type: "uint256", internalType: "uint256" }], + stateMutability: "view", + }, + { + type: "function", + name: "totalSupply", + inputs: [], + outputs: [{ name: "", type: "uint256", internalType: "uint256" }], + stateMutability: "view", + }, + { + type: "function", + name: "transfer", + inputs: [ + { name: "to", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + ], + outputs: [{ name: "", type: "bool", internalType: "bool" }], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "transferFrom", + inputs: [ + { name: "from", type: "address", internalType: "address" }, + { name: "to", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + ], + outputs: [{ name: "", type: "bool", internalType: "bool" }], + stateMutability: "nonpayable", + }, + { + type: "event", + name: "Approval", + inputs: [ + { name: "owner", type: "address", indexed: true, internalType: "address" }, + { name: "spender", type: "address", indexed: true, internalType: "address" }, + { name: "value", type: "uint256", indexed: false, internalType: "uint256" }, + ], + anonymous: false, + }, + { + type: "event", + name: "Transfer", + inputs: [ + { name: "from", type: "address", indexed: true, internalType: "address" }, + { name: "to", type: "address", indexed: true, internalType: "address" }, + { name: "value", type: "uint256", indexed: false, internalType: "uint256" }, + ], + anonymous: false, + }, +]; diff --git a/deploy/config/sepolia/config.json b/deploy/config/sepolia/config.json index 6d03c99..7a3062e 100644 --- a/deploy/config/sepolia/config.json +++ b/deploy/config/sepolia/config.json @@ -36,4 +36,10 @@ } } }, + "savings": { + "usdp": { + "name": "Staked USDp", + "symbol": "sUSDp" + } + } } diff --git a/deploy/scripts/Saving.ts b/deploy/scripts/Saving.ts new file mode 100644 index 0000000..2985b3a --- /dev/null +++ b/deploy/scripts/Saving.ts @@ -0,0 +1,79 @@ +import assert from "assert"; +import { ethers, utils } from "ethers"; + +import { type DeployFunction } from "hardhat-deploy/types"; +import { checkAddressValid, parseToConfigData } from "../utils"; +import { readFileSync } from "fs"; + +import { IERC20Abi } from "../abis/IERC20"; + +const contractName = "Savings"; + +const token = "USDp"; +const initialDivider = "1"; + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments, network } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + const config = parseToConfigData( + JSON.parse(readFileSync(`./deploy/config/${hre.network.name}/config.json`).toString()), + ); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + const accessManager = checkAddressValid(config.accessManager, "Invalid AccessManager address"); + const tokenP = checkAddressValid( + config.tokens[token.toLowerCase() as keyof typeof config.tokens], + "Invalid tokenP address", + ); + const savingsConfig = config.savings[token.toLowerCase() as keyof typeof config.savings]; + + // Deploy the implementation contract if it doesn't exist + await deploy("SavingsNameable", { + from: deployer, + log: true, + skipIfAlreadyDeployed: false, + }); + + const nonce = await network.provider.send("eth_getTransactionCount", [deployer, "latest"]); + + const futureAddress = utils.getContractAddress({ + from: deployer, + nonce: parseInt(nonce, 16) + 1, + }); + + const signer = await deployments.getSigner(deployer); + const tokenPContract = new ethers.Contract(tokenP, IERC20Abi, signer); + const allowance = await tokenPContract.allowance(deployer, futureAddress); + if (BigInt(allowance) < BigInt(1e18)) { + console.log("Approving allowance for future address of 1e18"); + const tx = await tokenPContract.approve(futureAddress, utils.parseUnits(initialDivider, 18)); + await tx.wait(); + } + + const savings = await deploy(`${contractName}_${token}`, { + from: deployer, + proxy: { + proxyContract: "UUPS", + implementationName: "SavingsNameable", + execute: { + methodName: "initialize", + args: [accessManager, tokenP, savingsConfig.name, savingsConfig.symbol, initialDivider], + }, + }, + log: true, + skipIfAlreadyDeployed: false, + }); + + console.log(`Deployed ${contractName}_${token}, network: ${hre.network.name}, address: ${savings.address}`); +}; + +deploy.tags = [contractName]; + +export default deploy; diff --git a/deploy/utils/types.ts b/deploy/utils/types.ts index 9ed7e1b..416ddfa 100644 --- a/deploy/utils/types.ts +++ b/deploy/utils/types.ts @@ -70,6 +70,11 @@ export type ParallelizerConfig = { redemptionSetup: RedemptionSetup; }; +export type SavingsConfig = { + name: string; + symbol: string; +}; + export type ConfigData = { accessManager: Address; wallets: { @@ -81,4 +86,7 @@ export type ConfigData = { parallelizer: { [tokenP: string]: ParallelizerConfig; }; + savings: { + [tokenP: string]: SavingsConfig; + }; }; From 3ba29c8e762e7a067f91a4d4f7ab0c6769a7a153 Mon Sep 17 00:00:00 2001 From: FabienCoutant Date: Mon, 26 May 2025 13:56:59 +0300 Subject: [PATCH 3/9] refactor: remove unused configs --- contracts/parallelizer/configs/Production.sol | 90 ---------------- .../parallelizer/configs/ProductionTypes.sol | 23 ---- .../parallelizer/configs/ProductionUSD.sol | 100 ------------------ 3 files changed, 213 deletions(-) delete mode 100644 contracts/parallelizer/configs/Production.sol delete mode 100644 contracts/parallelizer/configs/ProductionTypes.sol delete mode 100644 contracts/parallelizer/configs/ProductionUSD.sol diff --git a/contracts/parallelizer/configs/Production.sol b/contracts/parallelizer/configs/Production.sol deleted file mode 100644 index c131558..0000000 --- a/contracts/parallelizer/configs/Production.sol +++ /dev/null @@ -1,90 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.28; - -import "./ProductionTypes.sol"; - -/// @dev This contract is used only once to initialize the diamond proxy. -contract Production { - function initialize( - IAccessManager _accessManager, - address _tokenP, - CollateralSetup[] memory _collaterals, - RedemptionSetup memory _redemptionSetup - ) - external - { - // // Set Collaterals - // CollateralSetupProd[] memory collaterals = new CollateralSetupProd[](1); - // // USDC - // { - // uint64[] memory xMintFeeUsdc = new uint64[](1); - // xMintFeeUsdc[0] = uint64(0); - - // int64[] memory yMintFeeUsdc = new int64[](1); - // yMintFeeUsdc[0] = int64(0); - - // uint64[] memory xBurnFeeUsdc = new uint64[](1); - // xBurnFeeUsdc[0] = uint64(BASE_9); - - // int64[] memory yBurnFeeUsdc = new int64[](1); - // yBurnFeeUsdc[0] = int64(0); - - // bytes memory oracleConfig; - // { - // bytes memory readData; - // { - // AggregatorV3Interface[] memory circuitChainlink = new AggregatorV3Interface[](1); - // uint32[] memory stalePeriods = new uint32[](1); - // uint8[] memory circuitChainIsMultiplied = new uint8[](1); - // uint8[] memory chainlinkDecimals = new uint8[](1); - - // // Chainlink USDC/USD oracle - // circuitChainlink[0] = AggregatorV3Interface(0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6); - // stalePeriods[0] = 1 days; - // circuitChainIsMultiplied[0] = 1; - // chainlinkDecimals[0] = 8; - // OracleQuoteType quoteType = OracleQuoteType.UNIT; - // readData = abi.encode(circuitChainlink, stalePeriods, circuitChainIsMultiplied, chainlinkDecimals, - // quoteType); - // } - // bytes memory targetData; - // oracleConfig = abi.encode( - // Storage.OracleReadType.CHAINLINK_FEEDS, - // Storage.OracleReadType.STABLE, - // readData, - // targetData, - // abi.encode(uint128(0), uint128(50 * BPS)) - // ); - // } - // collaterals[0] = CollateralSetupProd(USDC, oracleConfig, xMintFeeUsdc, yMintFeeUsdc, xBurnFeeUsdc, - // yBurnFeeUsdc); - // } - - LibSetters.setAccessManager(_accessManager); - - ParallelizerStorage storage ts = s.transmuterStorage(); - ts.statusReentrant = NOT_ENTERED; - ts.normalizer = uint128(BASE_27); - ts.tokenP = ITokenP(_tokenP); - - // Setup each collateral - uint256 collateralsLength = _collaterals.length; - for (uint256 i; i < collateralsLength; i++) { - CollateralSetup memory collateral = _collaterals[i]; - LibSetters.addCollateral(collateral.token); - LibSetters.setOracle(collateral.token, collateral.oracleConfig); - // Mint fees - LibSetters.setFees(collateral.token, collateral.xMintFee, collateral.yMintFee, true); - // Burn fees - LibSetters.setFees(collateral.token, collateral.xBurnFee, collateral.yBurnFee, false); - LibSetters.togglePause(collateral.token, ActionType.Mint); - LibSetters.togglePause(collateral.token, ActionType.Burn); - } - - // setRedemptionCurveParams - if (_redemptionSetup.xRedeemFee.length > 0) { - LibSetters.togglePause(address(0), ActionType.Redeem); - LibSetters.setRedemptionCurveParams(_redemptionSetup.xRedeemFee, _redemptionSetup.yRedeemFee); - } - } -} diff --git a/contracts/parallelizer/configs/ProductionTypes.sol b/contracts/parallelizer/configs/ProductionTypes.sol deleted file mode 100644 index c09a41d..0000000 --- a/contracts/parallelizer/configs/ProductionTypes.sol +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.28; - -import "interfaces/external/chainlink/AggregatorV3Interface.sol"; - -import { LibDiamondEtherscan } from "../libraries/LibDiamondEtherscan.sol"; -import "../libraries/LibOracle.sol"; -import { LibSetters } from "../libraries/LibSetters.sol"; -import { LibStorage as s } from "../libraries/LibStorage.sol"; - -import { DummyDiamondImplementation } from "../../../scripts/generated/DummyDiamondImplementation.sol"; - -import "../../utils/Constants.sol"; -import "../Storage.sol" as Storage; - -struct CollateralSetupProd { - address token; - bytes oracleConfig; - uint64[] xMintFee; - int64[] yMintFee; - uint64[] xBurnFee; - int64[] yBurnFee; -} diff --git a/contracts/parallelizer/configs/ProductionUSD.sol b/contracts/parallelizer/configs/ProductionUSD.sol deleted file mode 100644 index b9dbc92..0000000 --- a/contracts/parallelizer/configs/ProductionUSD.sol +++ /dev/null @@ -1,100 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.28; - -import "./ProductionTypes.sol"; - -/// @dev This contract is used only once to initialize the diamond proxy. -contract ProductionUSD { - // address constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; - - function initialize(IAccessManager _accessManager, address _tokenP, address dummyImplementation) external { - /* - require(address(_accessControlManager) == 0x5bc6BEf80DA563EBf6Df6D6913513fa9A7ec89BE); - require(address(_tokenP) == 0x0000206329b97DB379d5E1Bf586BbDB969C63274); - */ - - // Set Collaterals - CollateralSetupProd[] memory collaterals = new CollateralSetupProd[](1); - // USDC - { - uint64[] memory xMintFeeUsdc = new uint64[](1); - xMintFeeUsdc[0] = uint64(0); - - int64[] memory yMintFeeUsdc = new int64[](1); - yMintFeeUsdc[0] = int64(0); - - uint64[] memory xBurnFeeUsdc = new uint64[](1); - xBurnFeeUsdc[0] = uint64(BASE_9); - - int64[] memory yBurnFeeUsdc = new int64[](1); - yBurnFeeUsdc[0] = int64(0); - - bytes memory oracleConfig; - { - bytes memory readData; - { - AggregatorV3Interface[] memory circuitChainlink = new AggregatorV3Interface[](1); - uint32[] memory stalePeriods = new uint32[](1); - uint8[] memory circuitChainIsMultiplied = new uint8[](1); - uint8[] memory chainlinkDecimals = new uint8[](1); - - // Chainlink USDC/USD oracle - circuitChainlink[0] = AggregatorV3Interface(0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6); - stalePeriods[0] = 1 days; - circuitChainIsMultiplied[0] = 1; - chainlinkDecimals[0] = 8; - OracleQuoteType quoteType = OracleQuoteType.UNIT; - readData = abi.encode(circuitChainlink, stalePeriods, circuitChainIsMultiplied, chainlinkDecimals, quoteType); - } - bytes memory targetData; - oracleConfig = abi.encode( - Storage.OracleReadType.CHAINLINK_FEEDS, - Storage.OracleReadType.STABLE, - readData, - targetData, - abi.encode(uint128(0), uint128(50 * BPS)) - ); - } - collaterals[0] = CollateralSetupProd(USDC, oracleConfig, xMintFeeUsdc, yMintFeeUsdc, xBurnFeeUsdc, yBurnFeeUsdc); - } - - LibSetters.setAccessManager(_accessManager); - - ParallelizerStorage storage ts = s.transmuterStorage(); - ts.statusReentrant = NOT_ENTERED; - ts.normalizer = uint128(BASE_27); - ts.tokenP = ITokenP(_tokenP); - - // Setup each collateral - uint256 collateralsLength = collaterals.length; - for (uint256 i; i < collateralsLength; i++) { - CollateralSetupProd memory collateral = collaterals[i]; - LibSetters.addCollateral(collateral.token); - LibSetters.setOracle(collateral.token, collateral.oracleConfig); - // Mint fees - LibSetters.setFees(collateral.token, collateral.xMintFee, collateral.yMintFee, true); - // Burn fees - LibSetters.setFees(collateral.token, collateral.xBurnFee, collateral.yBurnFee, false); - LibSetters.togglePause(collateral.token, ActionType.Mint); - LibSetters.togglePause(collateral.token, ActionType.Burn); - } - - // setRedemptionCurveParams - LibSetters.togglePause(USDC, ActionType.Redeem); - uint64[] memory xRedeemFee = new uint64[](4); - xRedeemFee[0] = uint64((75 * BASE_9) / 100); - xRedeemFee[1] = uint64((85 * BASE_9) / 100); - xRedeemFee[2] = uint64((95 * BASE_9) / 100); - xRedeemFee[3] = uint64((97 * BASE_9) / 100); - - int64[] memory yRedeemFee = new int64[](4); - yRedeemFee[0] = int64(uint64((995 * BASE_9) / 1000)); - yRedeemFee[1] = int64(uint64((950 * BASE_9) / 1000)); - yRedeemFee[2] = int64(uint64((950 * BASE_9) / 1000)); - yRedeemFee[3] = int64(uint64((995 * BASE_9) / 1000)); - LibSetters.setRedemptionCurveParams(xRedeemFee, yRedeemFee); - - // setDummyImplementation - LibDiamondEtherscan.setDummyImplementation(dummyImplementation); - } -} From dbd4d4fa141dcb8e4e0058e30c9e86a859ebe7e2 Mon Sep 17 00:00:00 2001 From: FabienCoutant Date: Mon, 26 May 2025 13:58:13 +0300 Subject: [PATCH 4/9] fix: file import for hardhat --- contracts/helpers/BaseHarvester.sol | 6 +++--- contracts/helpers/GenericHarvester.sol | 10 +++++----- contracts/helpers/MultiBlockHarvester.sol | 6 +++--- contracts/interfaces/IGetters.sol | 2 +- contracts/parallelizer/Storage.sol | 2 +- .../parallelizer/configs/DiamondInitializerTypes.sol | 7 ++++--- contracts/parallelizer/configs/Test.sol | 2 +- contracts/parallelizer/facets/DiamondCut.sol | 2 +- contracts/parallelizer/facets/DiamondEtherscan.sol | 2 +- contracts/parallelizer/facets/DiamondLoupe.sol | 2 +- contracts/parallelizer/facets/Getters.sol | 2 +- contracts/parallelizer/facets/Redeemer.sol | 4 ++-- contracts/parallelizer/facets/RewardHandler.sol | 2 +- contracts/parallelizer/facets/SettersGovernor.sol | 2 +- contracts/parallelizer/facets/SettersGuardian.sol | 2 +- contracts/parallelizer/facets/Swapper.sol | 8 ++++---- contracts/parallelizer/libraries/LibManager.sol | 2 +- contracts/parallelizer/libraries/LibOracle.sol | 6 +++--- contracts/parallelizer/libraries/LibSetters.sol | 2 +- contracts/parallelizer/libraries/LibWhitelist.sol | 2 +- contracts/savings/BaseSavings.sol | 2 +- contracts/utils/Constants.sol | 8 ++++---- remappings.txt | 3 --- tests/Fixture.sol | 9 +++++---- tests/invariants/BasicInvariants.sol | 2 +- tests/invariants/PathIndeInvariants.t.sol | 2 +- tests/invariants/actors/BaseActor.t.sol | 6 +++--- tests/mock/MockManager.sol | 2 +- tests/mock/MockReentrant.sol | 3 ++- tests/units/Layout.t.sol | 2 +- tests/units/Parallelizer.t.sol | 4 ++-- tests/units/ParallelizerReentrant.sol | 7 ++++--- tests/units/Permit2.t.sol | 2 +- tests/units/StablecoinCap.t.sol | 4 ++-- tests/utils/Helper.sol | 2 +- tests/utils/Parallelizer.sol | 3 +-- 36 files changed, 67 insertions(+), 67 deletions(-) diff --git a/contracts/helpers/BaseHarvester.sol b/contracts/helpers/BaseHarvester.sol index ad69b5f..4f6fc9a 100644 --- a/contracts/helpers/BaseHarvester.sol +++ b/contracts/helpers/BaseHarvester.sol @@ -4,11 +4,11 @@ pragma solidity 0.8.28; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { AccessManaged } from "../utils/AccessManaged.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import { IParallelizer } from "../interfaces/IParallelizer.sol"; -import { ITokenP } from "../interfaces/ITokenP.sol"; +import { IParallelizer } from "contracts/interfaces/IParallelizer.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; +import "contracts/interfaces/IHarvester.sol"; import "../utils/Errors.sol"; -import "../interfaces/IHarvester.sol"; struct YieldBearingParams { // Address of the asset used to mint the yield bearing asset diff --git a/contracts/helpers/GenericHarvester.sol b/contracts/helpers/GenericHarvester.sol index 0729d48..cbe96d4 100644 --- a/contracts/helpers/GenericHarvester.sol +++ b/contracts/helpers/GenericHarvester.sol @@ -9,12 +9,12 @@ import { IERC3156FlashBorrower } from "@openzeppelin/contracts/interfaces/IERC31 import { IERC3156FlashLender } from "@openzeppelin/contracts/interfaces/IERC3156FlashLender.sol"; import { RouterSwapper } from "@helpers/RouterSwapper.sol"; -import { IParallelizer } from "interfaces/IParallelizer.sol"; -import { ITokenP } from "interfaces/ITokenP.sol"; -import { IERC4626 } from "interfaces/external/IERC4626.sol"; +import { IParallelizer } from "contracts/interfaces/IParallelizer.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; +import { IERC4626 } from "contracts/interfaces/external/IERC4626.sol"; -import "utils/Constants.sol"; -import "utils/Errors.sol"; +import "../utils/Constants.sol"; +import "../utils/Errors.sol"; import { BaseHarvester, YieldBearingParams } from "./BaseHarvester.sol"; diff --git a/contracts/helpers/MultiBlockHarvester.sol b/contracts/helpers/MultiBlockHarvester.sol index 35e2ca4..c050e75 100644 --- a/contracts/helpers/MultiBlockHarvester.sol +++ b/contracts/helpers/MultiBlockHarvester.sol @@ -6,9 +6,9 @@ import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.s import { Math } from "@openzeppelin/contracts/utils/math/Math.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { BaseHarvester, YieldBearingParams } from "./BaseHarvester.sol"; -import { IParallelizer } from "../interfaces/IParallelizer.sol"; -import { ITokenP } from "../interfaces/ITokenP.sol"; -import { IPool } from "../interfaces/IPool.sol"; +import { IParallelizer } from "contracts/interfaces/IParallelizer.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; +import { IPool } from "contracts/interfaces/IPool.sol"; import "../utils/Errors.sol"; import "../utils/Constants.sol"; diff --git a/contracts/interfaces/IGetters.sol b/contracts/interfaces/IGetters.sol index cca6102..621f150 100644 --- a/contracts/interfaces/IGetters.sol +++ b/contracts/interfaces/IGetters.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.28; -import { ITokenP } from "interfaces/ITokenP.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; import "../parallelizer/Storage.sol"; diff --git a/contracts/parallelizer/Storage.sol b/contracts/parallelizer/Storage.sol index 669839b..3146f23 100644 --- a/contracts/parallelizer/Storage.sol +++ b/contracts/parallelizer/Storage.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.28; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { IAccessManager } from "@openzeppelin/contracts/access/manager/IAccessManager.sol"; -import { ITokenP } from "interfaces/ITokenP.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; /*////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ENUMS diff --git a/contracts/parallelizer/configs/DiamondInitializerTypes.sol b/contracts/parallelizer/configs/DiamondInitializerTypes.sol index 5a723f3..390b296 100644 --- a/contracts/parallelizer/configs/DiamondInitializerTypes.sol +++ b/contracts/parallelizer/configs/DiamondInitializerTypes.sol @@ -1,14 +1,15 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; -import "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol"; +import { IAccessManager } from "@openzeppelin/contracts/access/manager/IAccessManager.sol"; -import "../libraries/LibOracle.sol"; +import { LibDiamondEtherscan } from "../libraries/LibDiamondEtherscan.sol"; +import { LibOracle } from "../libraries/LibOracle.sol"; import { LibSetters } from "../libraries/LibSetters.sol"; import { LibStorage as s } from "../libraries/LibStorage.sol"; import "../../utils/Constants.sol"; -import "../Storage.sol" as Storage; +import "../Storage.sol"; struct CollateralSetup { address token; diff --git a/contracts/parallelizer/configs/Test.sol b/contracts/parallelizer/configs/Test.sol index b457256..0559c10 100644 --- a/contracts/parallelizer/configs/Test.sol +++ b/contracts/parallelizer/configs/Test.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; -import "interfaces/external/chainlink/AggregatorV3Interface.sol"; +import "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol"; import "../libraries/LibOracle.sol"; import { LibSetters } from "../libraries/LibSetters.sol"; diff --git a/contracts/parallelizer/facets/DiamondCut.sol b/contracts/parallelizer/facets/DiamondCut.sol index 73b4de7..517d53c 100644 --- a/contracts/parallelizer/facets/DiamondCut.sol +++ b/contracts/parallelizer/facets/DiamondCut.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.28; -import { IDiamondCut } from "interfaces/IDiamondCut.sol"; +import { IDiamondCut } from "contracts/interfaces/IDiamondCut.sol"; import { LibDiamond } from "../libraries/LibDiamond.sol"; diff --git a/contracts/parallelizer/facets/DiamondEtherscan.sol b/contracts/parallelizer/facets/DiamondEtherscan.sol index 0c6fb82..1307595 100644 --- a/contracts/parallelizer/facets/DiamondEtherscan.sol +++ b/contracts/parallelizer/facets/DiamondEtherscan.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.28; -import { IDiamondEtherscan } from "interfaces/IDiamondEtherscan.sol"; +import { IDiamondEtherscan } from "contracts/interfaces/IDiamondEtherscan.sol"; import { LibDiamondEtherscan } from "../libraries/LibDiamondEtherscan.sol"; import { AccessManagedModifiers } from "./AccessManagedModifiers.sol"; diff --git a/contracts/parallelizer/facets/DiamondLoupe.sol b/contracts/parallelizer/facets/DiamondLoupe.sol index 25a252d..b410ab5 100644 --- a/contracts/parallelizer/facets/DiamondLoupe.sol +++ b/contracts/parallelizer/facets/DiamondLoupe.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.28; -import { IDiamondLoupe } from "interfaces/IDiamondLoupe.sol"; +import { IDiamondLoupe } from "contracts/interfaces/IDiamondLoupe.sol"; import { LibStorage as s } from "../libraries/LibStorage.sol"; diff --git a/contracts/parallelizer/facets/Getters.sol b/contracts/parallelizer/facets/Getters.sol index 15b6a86..3545bb6 100644 --- a/contracts/parallelizer/facets/Getters.sol +++ b/contracts/parallelizer/facets/Getters.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; -import { IGetters } from "interfaces/IGetters.sol"; +import { IGetters } from "contracts/interfaces/IGetters.sol"; import { LibOracle } from "../libraries/LibOracle.sol"; import { LibGetters } from "../libraries/LibGetters.sol"; diff --git a/contracts/parallelizer/facets/Redeemer.sol b/contracts/parallelizer/facets/Redeemer.sol index d9c43e2..21b6998 100644 --- a/contracts/parallelizer/facets/Redeemer.sol +++ b/contracts/parallelizer/facets/Redeemer.sol @@ -6,8 +6,8 @@ import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { Math } from "@openzeppelin/contracts/utils/math/Math.sol"; -import { ITokenP } from "interfaces/ITokenP.sol"; -import { IRedeemer } from "interfaces/IRedeemer.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; +import { IRedeemer } from "contracts/interfaces/IRedeemer.sol"; import { AccessManagedModifiers } from "./AccessManagedModifiers.sol"; import { LibDiamond } from "../libraries/LibDiamond.sol"; diff --git a/contracts/parallelizer/facets/RewardHandler.sol b/contracts/parallelizer/facets/RewardHandler.sol index 6cedd41..577d677 100644 --- a/contracts/parallelizer/facets/RewardHandler.sol +++ b/contracts/parallelizer/facets/RewardHandler.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.28; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import { IRewardHandler } from "interfaces/IRewardHandler.sol"; +import { IRewardHandler } from "contracts/interfaces/IRewardHandler.sol"; import { AccessManagedModifiers } from "./AccessManagedModifiers.sol"; diff --git a/contracts/parallelizer/facets/SettersGovernor.sol b/contracts/parallelizer/facets/SettersGovernor.sol index 3497557..d8ee03d 100644 --- a/contracts/parallelizer/facets/SettersGovernor.sol +++ b/contracts/parallelizer/facets/SettersGovernor.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.28; import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import { ISettersGovernor } from "interfaces/ISetters.sol"; +import { ISettersGovernor } from "contracts/interfaces/ISetters.sol"; import { LibManager } from "../libraries/LibManager.sol"; import { LibOracle } from "../libraries/LibOracle.sol"; diff --git a/contracts/parallelizer/facets/SettersGuardian.sol b/contracts/parallelizer/facets/SettersGuardian.sol index b09d4cb..a3c3ff0 100644 --- a/contracts/parallelizer/facets/SettersGuardian.sol +++ b/contracts/parallelizer/facets/SettersGuardian.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; -import { ISettersGuardian } from "interfaces/ISetters.sol"; +import { ISettersGuardian } from "contracts/interfaces/ISetters.sol"; import { LibSetters } from "../libraries/LibSetters.sol"; import { AccessManagedModifiers } from "./AccessManagedModifiers.sol"; diff --git a/contracts/parallelizer/facets/Swapper.sol b/contracts/parallelizer/facets/Swapper.sol index 4be63c8..d37babb 100644 --- a/contracts/parallelizer/facets/Swapper.sol +++ b/contracts/parallelizer/facets/Swapper.sol @@ -7,10 +7,10 @@ import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.s import { Math } from "@openzeppelin/contracts/utils/math/Math.sol"; import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol"; -import { ITokenP } from "interfaces/ITokenP.sol"; -import { ISwapper } from "interfaces/ISwapper.sol"; -import { IPermit2, PermitTransferFrom } from "interfaces/external/permit2/IPermit2.sol"; -import { SignatureTransferDetails, TokenPermissions } from "interfaces/external/permit2/IPermit2.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; +import { ISwapper } from "contracts/interfaces/ISwapper.sol"; +import { IPermit2, PermitTransferFrom } from "contracts/interfaces/external/permit2/IPermit2.sol"; +import { SignatureTransferDetails, TokenPermissions } from "contracts/interfaces/external/permit2/IPermit2.sol"; import { AccessManagedModifiers } from "./AccessManagedModifiers.sol"; import { LibHelpers } from "../libraries/LibHelpers.sol"; diff --git a/contracts/parallelizer/libraries/LibManager.sol b/contracts/parallelizer/libraries/LibManager.sol index c78ffad..f81d549 100644 --- a/contracts/parallelizer/libraries/LibManager.sol +++ b/contracts/parallelizer/libraries/LibManager.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; -import { IManager } from "interfaces/IManager.sol"; +import { IManager } from "contracts/interfaces/IManager.sol"; import "../Storage.sol"; diff --git a/contracts/parallelizer/libraries/LibOracle.sol b/contracts/parallelizer/libraries/LibOracle.sol index 910a056..a9a6559 100644 --- a/contracts/parallelizer/libraries/LibOracle.sol +++ b/contracts/parallelizer/libraries/LibOracle.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; -import { IParallelizerOracle } from "interfaces/IParallelizerOracle.sol"; -import { AggregatorV3Interface } from "interfaces/external/chainlink/AggregatorV3Interface.sol"; -import { IMorphoOracle } from "interfaces/external/morpho/IMorphoOracle.sol"; +import { IParallelizerOracle } from "contracts/interfaces/IParallelizerOracle.sol"; +import { AggregatorV3Interface } from "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol"; +import { IMorphoOracle } from "contracts/interfaces/external/morpho/IMorphoOracle.sol"; import { LibStorage as s } from "./LibStorage.sol"; diff --git a/contracts/parallelizer/libraries/LibSetters.sol b/contracts/parallelizer/libraries/LibSetters.sol index c830cc8..63b0255 100644 --- a/contracts/parallelizer/libraries/LibSetters.sol +++ b/contracts/parallelizer/libraries/LibSetters.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.28; import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol"; import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; -import { LibManager } from "../libraries/LibManager.sol"; +import { LibManager } from "./LibManager.sol"; import { LibOracle } from "./LibOracle.sol"; import { LibStorage as s } from "./LibStorage.sol"; import { LibDiamond } from "./LibDiamond.sol"; diff --git a/contracts/parallelizer/libraries/LibWhitelist.sol b/contracts/parallelizer/libraries/LibWhitelist.sol index b98ddcd..2c5bdce 100644 --- a/contracts/parallelizer/libraries/LibWhitelist.sol +++ b/contracts/parallelizer/libraries/LibWhitelist.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; -import { IKeyringGuard } from "interfaces/external/keyring/IKeyringGuard.sol"; +import { IKeyringGuard } from "contracts/interfaces/external/keyring/IKeyringGuard.sol"; import { LibStorage as s } from "./LibStorage.sol"; diff --git a/contracts/savings/BaseSavings.sol b/contracts/savings/BaseSavings.sol index 355503e..ee51016 100644 --- a/contracts/savings/BaseSavings.sol +++ b/contracts/savings/BaseSavings.sol @@ -8,8 +8,8 @@ import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/I import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { Math } from "@openzeppelin/contracts/utils/math/Math.sol"; -import { ITokenP } from "contracts/interfaces/ITokenP.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; import { AccessManagedUpgradeable, IAccessManager } from "../utils/AccessManagedUpgradeable.sol"; import "../utils/Constants.sol"; diff --git a/contracts/utils/Constants.sol b/contracts/utils/Constants.sol index abe2464..3d1d398 100644 --- a/contracts/utils/Constants.sol +++ b/contracts/utils/Constants.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; -import { ICbETH } from "../interfaces/external/coinbase/ICbETH.sol"; -import { ISfrxETH } from "../interfaces/external/frax/ISfrxETH.sol"; -import { IStETH } from "../interfaces/external/lido/IStETH.sol"; -import { IRETH } from "../interfaces/external/rocketPool/IRETH.sol"; +import { ICbETH } from "contracts/interfaces/external/coinbase/ICbETH.sol"; +import { ISfrxETH } from "contracts/interfaces/external/frax/ISfrxETH.sol"; +import { IStETH } from "contracts/interfaces/external/lido/IStETH.sol"; +import { IRETH } from "contracts/interfaces/external/rocketPool/IRETH.sol"; /*////////////////////////////////////////////////////////////////////////////////////////////////////////////////// STORAGE SLOTS diff --git a/remappings.txt b/remappings.txt index 9dcdbd5..7abc780 100644 --- a/remappings.txt +++ b/remappings.txt @@ -4,6 +4,3 @@ @prb-math/=lib/prb-math/src/ @openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ @openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/ -interfaces/=contracts/interfaces/ -utils/=contracts/utils/ -libs/=libs/ diff --git a/tests/Fixture.sol b/tests/Fixture.sol index 90beee4..99a0209 100644 --- a/tests/Fixture.sol +++ b/tests/Fixture.sol @@ -8,9 +8,9 @@ import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; import { Constants, ContractType } from "@helpers/Constants.sol"; -import { ITokenP } from "interfaces/ITokenP.sol"; -import { IManager } from "interfaces/IManager.sol"; -import { AggregatorV3Interface } from "interfaces/external/chainlink/AggregatorV3Interface.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; +import { IManager } from "contracts/interfaces/IManager.sol"; +import { AggregatorV3Interface } from "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol"; import { CHAIN_SOURCE } from "scripts/helpers/Constants.s.sol"; @@ -21,7 +21,8 @@ import { MockTokenPermit } from "./mock/MockTokenPermit.sol"; import { CollateralSetup, Test } from "contracts/parallelizer/configs/Test.sol"; import "contracts/utils/Constants.sol"; import "contracts/utils/Errors.sol"; -import { IParallelizer, Parallelizer } from "./utils/Parallelizer.sol"; +import { IParallelizer } from "contracts/interfaces/IParallelizer.sol"; +import { Parallelizer } from "./utils/Parallelizer.sol"; import { ConfigAccessManager } from "./utils/ConfigAccessManager.sol"; contract Fixture is Parallelizer, ConfigAccessManager { diff --git a/tests/invariants/BasicInvariants.sol b/tests/invariants/BasicInvariants.sol index 409b5ca..68c37ea 100644 --- a/tests/invariants/BasicInvariants.sol +++ b/tests/invariants/BasicInvariants.sol @@ -5,7 +5,7 @@ pragma solidity 0.8.28; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; -import { AggregatorV3Interface } from "interfaces/external/chainlink/AggregatorV3Interface.sol"; +import { AggregatorV3Interface } from "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol"; import { MockAccessControlManager } from "tests/mock/MockAccessControlManager.sol"; import "contracts/utils/Constants.sol"; diff --git a/tests/invariants/PathIndeInvariants.t.sol b/tests/invariants/PathIndeInvariants.t.sol index 1659e6d..bcea1ed 100644 --- a/tests/invariants/PathIndeInvariants.t.sol +++ b/tests/invariants/PathIndeInvariants.t.sol @@ -5,7 +5,7 @@ pragma solidity 0.8.28; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; -import { AggregatorV3Interface } from "interfaces/external/chainlink/AggregatorV3Interface.sol"; +import { AggregatorV3Interface } from "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol"; import { MockAccessControlManager } from "tests/mock/MockAccessControlManager.sol"; import "contracts/utils/Constants.sol"; diff --git a/tests/invariants/actors/BaseActor.t.sol b/tests/invariants/actors/BaseActor.t.sol index cbe4e78..f9be969 100644 --- a/tests/invariants/actors/BaseActor.t.sol +++ b/tests/invariants/actors/BaseActor.t.sol @@ -5,9 +5,9 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; //solhint-disable -import { AggregatorV3Interface } from "interfaces/external/chainlink/AggregatorV3Interface.sol"; -import { ITokenP } from "interfaces/ITokenP.sol"; -import { IParallelizer } from "interfaces/IParallelizer.sol"; +import { AggregatorV3Interface } from "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; +import { IParallelizer } from "contracts/interfaces/IParallelizer.sol"; import { Test, stdMath, StdStorage, stdStorage } from "@forge-std/Test.sol"; import "contracts/utils/Constants.sol"; import "contracts/utils/Errors.sol"; diff --git a/tests/mock/MockManager.sol b/tests/mock/MockManager.sol index b852b9e..b2e9595 100644 --- a/tests/mock/MockManager.sol +++ b/tests/mock/MockManager.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.28; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import "interfaces/IManager.sol"; +import "contracts/interfaces/IManager.sol"; import { LibHelpers } from "../../contracts/parallelizer/libraries/LibHelpers.sol"; import { LibOracle, AggregatorV3Interface } from "../../contracts/parallelizer/libraries/LibOracle.sol"; diff --git a/tests/mock/MockReentrant.sol b/tests/mock/MockReentrant.sol index fb17189..0917ce1 100644 --- a/tests/mock/MockReentrant.sol +++ b/tests/mock/MockReentrant.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.28; -import { IParallelizer, Parallelizer } from "../utils/Parallelizer.sol"; +import { IParallelizer } from "contracts/interfaces/IParallelizer.sol"; +import { Parallelizer } from "../utils/Parallelizer.sol"; import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; import { IERC1820Registry } from "./MockERC777.sol"; diff --git a/tests/units/Layout.t.sol b/tests/units/Layout.t.sol index b3a4d15..decfdc4 100644 --- a/tests/units/Layout.t.sol +++ b/tests/units/Layout.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.28; -import { ITokenP } from "interfaces/ITokenP.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; import { console } from "@forge-std/console.sol"; diff --git a/tests/units/Parallelizer.t.sol b/tests/units/Parallelizer.t.sol index 4e4c111..8e5530e 100644 --- a/tests/units/Parallelizer.t.sol +++ b/tests/units/Parallelizer.t.sol @@ -4,8 +4,8 @@ pragma solidity 0.8.28; import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; -import { ITokenP } from "interfaces/ITokenP.sol"; -import { AggregatorV3Interface } from "interfaces/external/chainlink/AggregatorV3Interface.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; +import { AggregatorV3Interface } from "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol"; import { MockAccessControlManager } from "tests/mock/MockAccessControlManager.sol"; import { MockChainlinkOracle } from "tests/mock/MockChainlinkOracle.sol"; diff --git a/tests/units/ParallelizerReentrant.sol b/tests/units/ParallelizerReentrant.sol index c037e71..2212f43 100644 --- a/tests/units/ParallelizerReentrant.sol +++ b/tests/units/ParallelizerReentrant.sol @@ -7,8 +7,8 @@ import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.s import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import { AccessManager, IAccessManaged } from "@openzeppelin/contracts/access/manager/AccessManager.sol"; -import { ITokenP } from "interfaces/ITokenP.sol"; -import { AggregatorV3Interface } from "interfaces/external/chainlink/AggregatorV3Interface.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; +import { AggregatorV3Interface } from "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol"; import { MockAccessControlManager } from "../mock/MockAccessControlManager.sol"; import { MockChainlinkOracle } from "../mock/MockChainlinkOracle.sol"; @@ -22,7 +22,8 @@ import "contracts/parallelizer/Storage.sol"; import "contracts/utils/Constants.sol"; import "contracts/utils/Errors.sol" as Errors; -import { IParallelizer, Parallelizer } from "../utils/Parallelizer.sol"; +import { IParallelizer } from "contracts/interfaces/IParallelizer.sol"; +import { Parallelizer } from "../utils/Parallelizer.sol"; import { ConfigAccessManager } from "../utils/ConfigAccessManager.sol"; contract ParallelizerReentrantTest is Parallelizer, ConfigAccessManager { diff --git a/tests/units/Permit2.t.sol b/tests/units/Permit2.t.sol index 89281da..be5d847 100644 --- a/tests/units/Permit2.t.sol +++ b/tests/units/Permit2.t.sol @@ -8,7 +8,7 @@ import { PermitTransferFrom, SignatureTransferDetails, TokenPermissions -} from "interfaces/external/permit2/IPermit2.sol"; +} from "contracts/interfaces/external/permit2/IPermit2.sol"; import { stdError } from "@forge-std/Test.sol"; diff --git a/tests/units/StablecoinCap.t.sol b/tests/units/StablecoinCap.t.sol index 9149a47..a0beee5 100644 --- a/tests/units/StablecoinCap.t.sol +++ b/tests/units/StablecoinCap.t.sol @@ -4,8 +4,8 @@ pragma solidity 0.8.28; import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; -import { ITokenP } from "interfaces/ITokenP.sol"; -import { AggregatorV3Interface } from "interfaces/external/chainlink/AggregatorV3Interface.sol"; +import { ITokenP } from "contracts/interfaces/ITokenP.sol"; +import { AggregatorV3Interface } from "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol"; import { MockAccessControlManager } from "tests/mock/MockAccessControlManager.sol"; import { MockChainlinkOracle } from "tests/mock/MockChainlinkOracle.sol"; diff --git a/tests/utils/Helper.sol b/tests/utils/Helper.sol index e685ca1..b552b24 100644 --- a/tests/utils/Helper.sol +++ b/tests/utils/Helper.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.28; -import "interfaces/IDiamondLoupe.sol"; +import "contracts/interfaces/IDiamondLoupe.sol"; import { Test, stdError, Vm } from "@forge-std/Test.sol"; import { CommonUtils } from "@helpers/CommonUtils.sol"; diff --git a/tests/utils/Parallelizer.sol b/tests/utils/Parallelizer.sol index ef85009..6a01a21 100644 --- a/tests/utils/Parallelizer.sol +++ b/tests/utils/Parallelizer.sol @@ -1,8 +1,7 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.28; -import { IParallelizer } from "interfaces/IParallelizer.sol"; - +import { IParallelizer } from "contracts/interfaces/IParallelizer.sol"; import { DiamondProxy } from "contracts/parallelizer/DiamondProxy.sol"; import "contracts/parallelizer/Storage.sol"; import { DiamondCut } from "contracts/parallelizer/facets/DiamondCut.sol"; From 5d1a494a6c5a6acbb6d57f54693012fb14bb6af1 Mon Sep 17 00:00:00 2001 From: FabienCoutant Date: Mon, 26 May 2025 17:33:13 +0300 Subject: [PATCH 5/9] feat: add diamondEtherscan facet --- .../parallelizer/facets/DiamondEtherscan.ts | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 deploy/scripts/parallelizer/facets/DiamondEtherscan.ts diff --git a/deploy/scripts/parallelizer/facets/DiamondEtherscan.ts b/deploy/scripts/parallelizer/facets/DiamondEtherscan.ts new file mode 100644 index 0000000..c9d1c0c --- /dev/null +++ b/deploy/scripts/parallelizer/facets/DiamondEtherscan.ts @@ -0,0 +1,31 @@ +import assert from "assert"; + +import { type DeployFunction } from "hardhat-deploy/types"; + +const contractName = "DiamondEtherscan"; + +const deploy: DeployFunction = async (hre) => { + const { getNamedAccounts, deployments } = hre; + + const { deploy } = deployments; + const { deployer } = await getNamedAccounts(); + + assert(deployer, "Missing named deployer account"); + + console.log(`Network: ${hre.network.name}`); + console.log(`Deployer: ${deployer}`); + + console.log(`Deploying facet ${contractName}...`); + + const diamondEtherscan = await deploy(contractName, { + from: deployer, + skipIfAlreadyDeployed: true, + log: true, + }); + + console.log(`Deployed facet: ${contractName}, network: ${hre.network.name}, address: ${diamondEtherscan.address}`); +}; + +deploy.tags = ["Facets", contractName]; + +export default deploy; From 95f17b083e888960603de4ecd897a44f3fa08650 Mon Sep 17 00:00:00 2001 From: FabienCoutant Date: Mon, 26 May 2025 17:48:12 +0300 Subject: [PATCH 6/9] fix: usdp address --- deploy/config/sepolia/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/config/sepolia/config.json b/deploy/config/sepolia/config.json index 7a3062e..e5c071c 100644 --- a/deploy/config/sepolia/config.json +++ b/deploy/config/sepolia/config.json @@ -4,7 +4,7 @@ "dao": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02" }, "tokens": { - "usdp": "0xA8FE9843B4Cc2aAB136209B49E2c3E2A7ebD5CFA" + "usdp": "0xe8a3DA6f5ed1cf04c58ac7f6A7383641e877517b" }, "parallelizer": { "usdp": { From aa7aa0d1b8258d202095b958c1538b395a53d943 Mon Sep 17 00:00:00 2001 From: FabienCoutant Date: Mon, 26 May 2025 17:55:02 +0300 Subject: [PATCH 7/9] fix: remove Facets from deploy.tags --- deploy/scripts/parallelizer/facets/DiamondEtherscan.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/scripts/parallelizer/facets/DiamondEtherscan.ts b/deploy/scripts/parallelizer/facets/DiamondEtherscan.ts index c9d1c0c..e33a819 100644 --- a/deploy/scripts/parallelizer/facets/DiamondEtherscan.ts +++ b/deploy/scripts/parallelizer/facets/DiamondEtherscan.ts @@ -26,6 +26,6 @@ const deploy: DeployFunction = async (hre) => { console.log(`Deployed facet: ${contractName}, network: ${hre.network.name}, address: ${diamondEtherscan.address}`); }; -deploy.tags = ["Facets", contractName]; +deploy.tags = [contractName]; export default deploy; From ebd9213a8916edd98e47b4c2e8c11d60195a72b0 Mon Sep 17 00:00:00 2001 From: FabienCoutant Date: Tue, 27 May 2025 10:43:17 +0300 Subject: [PATCH 8/9] feat: deploy on sepolia --- README.md | 15 + deployments/sepolia/.chainId | 1 + deployments/sepolia/DiamondCut.json | 281 +++ deployments/sepolia/DiamondInitializer.json | 275 +++ deployments/sepolia/DiamondLoupe.json | 162 ++ deployments/sepolia/Getters.json | 772 ++++++++ deployments/sepolia/Parallelizer_USDp.json | 511 +++++ deployments/sepolia/Redeemer.json | 354 ++++ deployments/sepolia/RewardHandler.json | 139 ++ deployments/sepolia/SavingsNameable.json | 1762 +++++++++++++++++ deployments/sepolia/Savings_USDp.json | 1503 ++++++++++++++ deployments/sepolia/Savings_USDp_Proxy.json | 198 ++ deployments/sepolia/SettersGovernor.json | 639 ++++++ deployments/sepolia/SettersGuardian.json | 311 +++ deployments/sepolia/Swapper.json | 507 +++++ .../0e89febeebc7444140de8e67c9067d2c.json | 80 + .../9d44d918681c9ad36f866ebee034a3d1.json | 307 +++ foundry.toml | 1 - scripts/Base.s.sol | 38 + scripts/SetParallelizerRoles.s.sol | 38 + scripts/SetSavingRoles.s.sol | 28 + 21 files changed, 7921 insertions(+), 1 deletion(-) create mode 100644 deployments/sepolia/.chainId create mode 100644 deployments/sepolia/DiamondCut.json create mode 100644 deployments/sepolia/DiamondInitializer.json create mode 100644 deployments/sepolia/DiamondLoupe.json create mode 100644 deployments/sepolia/Getters.json create mode 100644 deployments/sepolia/Parallelizer_USDp.json create mode 100644 deployments/sepolia/Redeemer.json create mode 100644 deployments/sepolia/RewardHandler.json create mode 100644 deployments/sepolia/SavingsNameable.json create mode 100644 deployments/sepolia/Savings_USDp.json create mode 100644 deployments/sepolia/Savings_USDp_Proxy.json create mode 100644 deployments/sepolia/SettersGovernor.json create mode 100644 deployments/sepolia/SettersGuardian.json create mode 100644 deployments/sepolia/Swapper.json create mode 100644 deployments/sepolia/solcInputs/0e89febeebc7444140de8e67c9067d2c.json create mode 100644 deployments/sepolia/solcInputs/9d44d918681c9ad36f866ebee034a3d1.json create mode 100644 scripts/Base.s.sol create mode 100644 scripts/SetParallelizerRoles.s.sol create mode 100644 scripts/SetSavingRoles.s.sol diff --git a/README.md b/README.md index cbc8450..043189f 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,21 @@ Some changed has been made to the original Angle's Transmuter: ## Deployment Addresses +### Testnet + +| Contract | Explore | +| --------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| DiamondCut Facet | [0x9B3a8f7CEC208e247d97dEE13313690977e24459](https://sepolia.etherscan.io/address/0x9B3a8f7CEC208e247d97dEE13313690977e24459) | +| DiamondLoupe Facet | [0xC9B6279baa19dBB8bCc3250c89cAa093AaBA0bfc](https://sepolia.etherscan.io/address/0xC9B6279baa19dBB8bCc3250c89cAa093AaBA0bfc) | +| Getters Facet | [0x78BB4882b77D74aD9B04Ab71fE8e61f72595823C](https://sepolia.etherscan.io/address/0x78BB4882b77D74aD9B04Ab71fE8e61f72595823C) | +| Redeemer Facet | [0x57770C1721Eb35509f38210A935c8b1911db7E0e](https://sepolia.etherscan.io/address/0x57770C1721Eb35509f38210A935c8b1911db7E0e) | +| RewardHandler Facet | [0xad58Fc13a682a121e5fe2f8E45D4D988A7e51B0D](https://sepolia.etherscan.io/address/0xad58Fc13a682a121e5fe2f8E45D4D988A7e51B0D) | +| SettersGovernor Facet | [0xA360E5aD9F17caff53715346888aA0d13541c2F5](https://sepolia.etherscan.io/address/0xA360E5aD9F17caff53715346888aA0d13541c2F5) | +| SettersGuardian Facet | [0xa9C21Cf291ad935e0C9B05a55A42254fB159181d](https://sepolia.etherscan.io/address/0xa9C21Cf291ad935e0C9B05a55A42254fB159181d) | +| Swapper Facet | [0x1bB46FC55E3fd91Ca0F162DCC0B3ef574C8ff97E](https://sepolia.etherscan.io/address/0x1bB46FC55E3fd91Ca0F162DCC0B3ef574C8ff97E) | +| Parallelizer USDp | [0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862](https://sepolia.etherscan.io/address/0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862) | +| sUSDp (Savings) | [0x23D491aa7C0972087F8a607F6f4c7106a02BA95d](https://sepolia.etherscan.io/address/0x23D491aa7C0972087F8a607F6f4c7106a02BA95d) | + ## Security ### Trust assumptions of the Parallelizer system diff --git a/deployments/sepolia/.chainId b/deployments/sepolia/.chainId new file mode 100644 index 0000000..bd8d1cd --- /dev/null +++ b/deployments/sepolia/.chainId @@ -0,0 +1 @@ +11155111 \ No newline at end of file diff --git a/deployments/sepolia/DiamondCut.json b/deployments/sepolia/DiamondCut.json new file mode 100644 index 0000000..e479ff2 --- /dev/null +++ b/deployments/sepolia/DiamondCut.json @@ -0,0 +1,281 @@ +{ + "address": "0x9B3a8f7CEC208e247d97dEE13313690977e24459", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotAddFunctionToDiamondThatAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotAddSelectorsToZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveFunctionThatDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveImmutableFunction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionThatDoesNotExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotReplaceFunctionsFromFacetWithZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceImmutableFunction", + "type": "error" + }, + { + "inputs": [], + "name": "ContractHasNoCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_initializationContractAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "InitializationFunctionReverted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facetAddress", + "type": "address" + } + ], + "name": "NoSelectorsProvidedForFacetForCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facetAddress", + "type": "address" + } + ], + "name": "RemoveFacetAddressMustBeZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "indexed": false, + "internalType": "struct FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "DiamondCut", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "diamondCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xec04346fa9c8ad4f8c3bd9f174c71ea6c7de04dd1fda4ee11f7e640e17b5cea5", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0x9B3a8f7CEC208e247d97dEE13313690977e24459", + "transactionIndex": 102, + "gasUsed": "925928", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe905c3902a53272d167ff8948713df151774e13835df315420eb2fd59dcaf770", + "transactionHash": "0xec04346fa9c8ad4f8c3bd9f174c71ea6c7de04dd1fda4ee11f7e640e17b5cea5", + "logs": [], + "blockNumber": 8411092, + "cumulativeGasUsed": "20429969", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9d44d918681c9ad36f866ebee034a3d1", + "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AccessManagedUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotAddFunctionToDiamondThatAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4[]\",\"name\":\"_selectors\",\"type\":\"bytes4[]\"}],\"name\":\"CannotAddSelectorsToZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotRemoveFunctionThatDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotRemoveImmutableFunction\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotReplaceFunctionThatDoesNotExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4[]\",\"name\":\"_selectors\",\"type\":\"bytes4[]\"}],\"name\":\"CannotReplaceFunctionsFromFacetWithZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotReplaceImmutableFunction\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ContractHasNoCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_initializationContractAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"name\":\"InitializationFunctionReverted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_facetAddress\",\"type\":\"address\"}],\"name\":\"NoSelectorsProvidedForFacetForCut\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_facetAddress\",\"type\":\"address\"}],\"name\":\"RemoveFacetAddressMustBeZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"facetAddress\",\"type\":\"address\"},{\"internalType\":\"enum FacetCutAction\",\"name\":\"action\",\"type\":\"uint8\"},{\"internalType\":\"bytes4[]\",\"name\":\"functionSelectors\",\"type\":\"bytes4[]\"}],\"indexed\":false,\"internalType\":\"struct FacetCut[]\",\"name\":\"_diamondCut\",\"type\":\"tuple[]\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_init\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"name\":\"DiamondCut\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"facetAddress\",\"type\":\"address\"},{\"internalType\":\"enum FacetCutAction\",\"name\":\"action\",\"type\":\"uint8\"},{\"internalType\":\"bytes4[]\",\"name\":\"functionSelectors\",\"type\":\"bytes4[]\"}],\"internalType\":\"struct FacetCut[]\",\"name\":\"_diamondCut\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"_init\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"name\":\"diamondCut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Cooper Labs\",\"custom:contact\":\"security@cooperlabs.xyz\",\"details\":\"Reference: EIP-2535 DiamondsForked from https://github.com/mudgen/diamond-3/blob/master/contracts/facets/DiamondCutFacet.sol by mudgen\",\"kind\":\"dev\",\"methods\":{\"diamondCut((address,uint8,bytes4[])[],address,bytes)\":{\"params\":{\"_calldata\":\"A function call, including function selector and arguments, executed with delegatecall on _init\",\"_diamondCut\":\"Contains the facet addresses and function selectors\",\"_init\":\"The address of the contract or facet to execute _calldata\"}}},\"title\":\"DiamondCut\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"diamondCut((address,uint8,bytes4[])[],address,bytes)\":{\"notice\":\"Add/replace/remove any number of functions and optionally execute a function with delegatecall\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/parallelizer/facets/DiamondCut.sol\":\"DiamondCut\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAuthority} from \\\"./IAuthority.sol\\\";\\n\\nlibrary AuthorityUtils {\\n /**\\n * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\\n * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\\n * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\\n */\\n function canCallWithDelay(\\n address authority,\\n address caller,\\n address target,\\n bytes4 selector\\n ) internal view returns (bool immediate, uint32 delay) {\\n (bool success, bytes memory data) = authority.staticcall(\\n abi.encodeCall(IAuthority.canCall, (caller, target, selector))\\n );\\n if (success) {\\n if (data.length >= 0x40) {\\n (immediate, delay) = abi.decode(data, (bool, uint32));\\n } else if (data.length >= 0x20) {\\n immediate = abi.decode(data, (bool));\\n }\\n }\\n return (immediate, delay);\\n }\\n}\\n\",\"keccak256\":\"0xb3875997b0d8705e29aa20fee88e1dfef93df438794ae1ad8ba2eb016a4dd4e4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAccessManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\ninterface IAccessManager {\\n /**\\n * @dev A delayed operation was scheduled.\\n */\\n event OperationScheduled(\\n bytes32 indexed operationId,\\n uint32 indexed nonce,\\n uint48 schedule,\\n address caller,\\n address target,\\n bytes data\\n );\\n\\n /**\\n * @dev A scheduled operation was executed.\\n */\\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev A scheduled operation was canceled.\\n */\\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev Informational labelling for a roleId.\\n */\\n event RoleLabel(uint64 indexed roleId, string label);\\n\\n /**\\n * @dev Emitted when `account` is granted `roleId`.\\n *\\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\\n * otherwise it indicates the execution delay for this account and roleId is updated.\\n */\\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\\n\\n /**\\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\\n */\\n event RoleRevoked(uint64 indexed roleId, address indexed account);\\n\\n /**\\n * @dev Role acting as admin over a given `roleId` is updated.\\n */\\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\\n\\n /**\\n * @dev Role acting as guardian over a given `roleId` is updated.\\n */\\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\\n\\n /**\\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\\n */\\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\\n\\n /**\\n * @dev Target mode is updated (true = closed, false = open).\\n */\\n event TargetClosed(address indexed target, bool closed);\\n\\n /**\\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\\n */\\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\\n\\n /**\\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\\n */\\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\\n\\n error AccessManagerAlreadyScheduled(bytes32 operationId);\\n error AccessManagerNotScheduled(bytes32 operationId);\\n error AccessManagerNotReady(bytes32 operationId);\\n error AccessManagerExpired(bytes32 operationId);\\n error AccessManagerLockedRole(uint64 roleId);\\n error AccessManagerBadConfirmation();\\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\\n error AccessManagerUnauthorizedConsume(address target);\\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\\n\\n /**\\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\\n * & {execute} workflow.\\n *\\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\\n * for future execution.\\n *\\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\\n * the operation can be executed if and only if delay is greater than 0.\\n *\\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\\n *\\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\\n * {AccessManager} documentation.\\n */\\n function canCall(\\n address caller,\\n address target,\\n bytes4 selector\\n ) external view returns (bool allowed, uint32 delay);\\n\\n /**\\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\\n *\\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\\n * disabling any scheduling usage.\\n */\\n function expiration() external view returns (uint32);\\n\\n /**\\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\\n * can be increased without setback (and reset via {revokeRole} in the case event of an\\n * accidental increase). Defaults to 5 days.\\n */\\n function minSetback() external view returns (uint32);\\n\\n /**\\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\\n *\\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\\n */\\n function isTargetClosed(address target) external view returns (bool);\\n\\n /**\\n * @dev Get the role required to call a function.\\n */\\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\\n\\n /**\\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\\n */\\n function getTargetAdminDelay(address target) external view returns (uint32);\\n\\n /**\\n * @dev Get the id of the role that acts as an admin for the given role.\\n *\\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\\n * an operation that is restricted to this role.\\n */\\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role that acts as a guardian for a given role.\\n *\\n * The guardian permission allows canceling operations that have been scheduled under the role.\\n */\\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role current grant delay.\\n *\\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\\n */\\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\\n\\n /**\\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\\n * level.\\n *\\n * Returns:\\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\\n * [1] Current execution delay for the account.\\n * [2] Pending execution delay for the account.\\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\\n */\\n function getAccess(\\n uint64 roleId,\\n address account\\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\\n\\n /**\\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\\n * permission might be associated with an execution delay. {getAccess} can provide more details.\\n */\\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\\n\\n /**\\n * @dev Give a label to a role, for improved role discoverability by UIs.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleLabel} event.\\n */\\n function labelRole(uint64 roleId, string calldata label) external;\\n\\n /**\\n * @dev Add `account` to `roleId`, or change its execution delay.\\n *\\n * This gives the account the authorization to call any function that is restricted to this role. An optional\\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\\n *\\n * If the account has already been granted this role, the execution delay will be updated. This update is not\\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - granted role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleGranted} event.\\n */\\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\\n\\n /**\\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\\n * no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - revoked role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function revokeRole(uint64 roleId, address account) external;\\n\\n /**\\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\\n * the role this call has no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function renounceRole(uint64 roleId, address callerConfirmation) external;\\n\\n /**\\n * @dev Change admin role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleAdminChanged} event\\n */\\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\\n\\n /**\\n * @dev Change guardian role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGuardianChanged} event\\n */\\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\\n\\n /**\\n * @dev Update the delay for granting a `roleId`.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGrantDelayChanged} event.\\n */\\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetFunctionRoleUpdated} event per selector.\\n */\\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\\n\\n /**\\n * @dev Set the delay for changing the configuration of a given target contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetAdminDelayUpdated} event.\\n */\\n function setTargetAdminDelay(address target, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the closed flag for a contract.\\n *\\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetClosed} event.\\n */\\n function setTargetClosed(address target, bool closed) external;\\n\\n /**\\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\\n * operation is not yet scheduled, has expired, was executed, or was canceled.\\n */\\n function getSchedule(bytes32 id) external view returns (uint48);\\n\\n /**\\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\\n * been scheduled.\\n */\\n function getNonce(bytes32 id) external view returns (uint32);\\n\\n /**\\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\\n * required for the caller. The special value zero will automatically set the earliest possible time.\\n *\\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\\n *\\n * Emits a {OperationScheduled} event.\\n *\\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\\n * contract if it is using standard Solidity ABI encoding.\\n */\\n function schedule(\\n address target,\\n bytes calldata data,\\n uint48 when\\n ) external returns (bytes32 operationId, uint32 nonce);\\n\\n /**\\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\\n * execution delay is 0.\\n *\\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\\n *\\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\\n */\\n function execute(address target, bytes calldata data) external payable returns (uint32);\\n\\n /**\\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\\n * operation that is cancelled.\\n *\\n * Requirements:\\n *\\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\\n *\\n * Emits a {OperationCanceled} event.\\n */\\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\\n\\n /**\\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\\n *\\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\\n * with all the verifications that it implies.\\n *\\n * Emit a {OperationExecuted} event.\\n */\\n function consumeScheduledOp(address caller, bytes calldata data) external;\\n\\n /**\\n * @dev Hashing function for delayed operations.\\n */\\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\\n\\n /**\\n * @dev Changes the authority of a target managed by this manager instance.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n */\\n function updateAuthority(address target, address newAuthority) external;\\n}\\n\",\"keccak256\":\"0x9be2d08a326515805bc9cf6315b7953f8d1ebe88abf48c2d645fb1fa8211a0e2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAuthority.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard interface for permissioning originally defined in Dappsys.\\n */\\ninterface IAuthority {\\n /**\\n * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\\n */\\n function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\\n}\\n\",\"keccak256\":\"0x4cc0766bd7fb7b3bafb70afa2a93b6e313a0baec7a35ad1b57505be7861c1030\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/interfaces/IDiamondCut.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"../parallelizer/Storage.sol\\\";\\n\\n/// @title IDiamondCut\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/interfaces/IDiamondCut.sol by mudgen\\n/// @dev This interface is an authorized fork of Angle's `IDiamondCut` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IDiamondCut.sol\\ninterface IDiamondCut {\\n /// @notice Add/replace/remove any number of functions and optionally execute a function with delegatecall\\n /// @param _diamondCut Contains the facet addresses and function selectors\\n /// @param _init The address of the contract or facet to execute _calldata\\n /// @param _calldata A function call, including function selector and arguments, executed with delegatecall on\\n /// _init\\n function diamondCut(FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata) external;\\n}\\n\",\"keccak256\":\"0x08a01f77b740f7da424f0ea27a6a292f9e292058e23d1fe960d2d19a44496c7b\",\"license\":\"MIT\"},\"contracts/interfaces/ITokenP.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title ITokenP\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Interface for the stablecoins `tokenP` contracts\\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\\ninterface ITokenP is IERC20 {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MINTER ROLE ONLY FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Lets a whitelisted contract mint tokenPs\\n /// @param account Address to mint to\\n /// @param amount Amount to mint\\n function mint(address account, uint256 amount) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @param sender Address which requested the burn from `burner`\\n /// @dev This method is to be called by a contract with the minter right after being requested\\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\\n /// @dev The method checks the allowance between the `sender` and the `burner`\\n function burnFrom(uint256 amount, address burner, address sender) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\\n /// requested to do so by an address willing to burn tokens from its address\\n function burnSelf(uint256 amount, address burner) external;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Amount of decimals of the stablecoin\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x64a1305faa8c5c91767a11af0eae16e4b463aa0bfe10f11b74aae9d96681a5eb\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/coinbase/ICbETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ICbETH\\n/// @notice Interface for the `cbETH` contract\\ninterface ICbETH {\\n function exchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb159341cb0e25c478912b274cdda2d50fa84692aeac87b6823d281aaea2aed04\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/frax/ISfrxETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ISfrxETH\\n/// @notice Interface for the `sfrxETH` contract\\ninterface ISfrxETH {\\n function pricePerShare() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x914cbea276f817c7db62bfca21e15bd8f7892faa9f39d86baaef574cf12b859f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/lido/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IStETH\\n/// @notice Interface for the `StETH` contract\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n\\n function submit(address) external payable returns (uint256);\\n\\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf21e3d8bdadc236b34bf2122b0e0b939d2d6bb6e2889b508636cbb7b84f59680\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/rocketPool/IRETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IRETH\\n/// @notice Interface for the `rETH` contract\\ninterface IRETH {\\n function getExchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x567a378e95d40160e297c1adb617ccaa69c03e49c4ad72a6ce651dd43cdbd5cd\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/Storage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ENUMS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nenum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n}\\n\\nenum ManagerType {\\n EXTERNAL\\n}\\n\\nenum ActionType {\\n Mint,\\n Burn,\\n Redeem\\n}\\n\\nenum TrustedType {\\n Updater,\\n Seller\\n}\\n\\nenum QuoteType {\\n MintExactInput,\\n MintExactOutput,\\n BurnExactInput,\\n BurnExactOutput\\n}\\n\\nenum OracleReadType {\\n CHAINLINK_FEEDS,\\n EXTERNAL,\\n NO_ORACLE,\\n STABLE,\\n WSTETH,\\n CBETH,\\n RETH,\\n SFRXETH,\\n MAX,\\n MORPHO_ORACLE\\n}\\n\\nenum OracleQuoteType {\\n UNIT,\\n TARGET\\n}\\n\\nenum WhitelistType {\\n BACKED\\n}\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STRUCTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nstruct Permit2Details {\\n address to; // Address that will receive the funds\\n uint256 nonce; // Nonce of the transaction\\n bytes signature; // Permit signature of the user\\n}\\n\\nstruct FacetCut {\\n address facetAddress; // Facet contract address\\n FacetCutAction action; // Can be add, remove or replace\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct Facet {\\n address facetAddress; // Facet contract address\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct FacetInfo {\\n address facetAddress; // Facet contract address\\n uint16 selectorPosition; // Position in the list of all selectors\\n}\\n\\nstruct DiamondStorage {\\n bytes4[] selectors; // List of all available selectors\\n mapping(bytes4 => FacetInfo) selectorInfo; // Selector to (address, position in list)\\n IAccessManager accessManager; // Contract handling access management\\n}\\n\\nstruct ImplementationStorage {\\n address implementation; // Dummy implementation address for Etherscan usability\\n}\\n\\nstruct ManagerStorage {\\n IERC20[] subCollaterals; // Subtokens handled by the manager or strategies\\n bytes config; // Additional configuration data\\n}\\n\\nstruct Collateral {\\n uint8 isManaged; // If the collateral is managed through external strategies\\n uint8 isMintLive; // If minting from this asset is unpaused\\n uint8 isBurnLive; // If burning to this asset is unpaused\\n uint8 decimals; // IERC20Metadata(collateral).decimals()\\n uint8 onlyWhitelisted; // If only whitelisted addresses can burn or redeem for this token\\n uint216 normalizedStables; // Normalized amount of stablecoins issued from this collateral\\n uint64[] xFeeMint; // Increasing exposures in [0,BASE_9[\\n int64[] yFeeMint; // Mint fees at the exposures specified in `xFeeMint`\\n uint64[] xFeeBurn; // Decreasing exposures in ]0,BASE_9]\\n int64[] yFeeBurn; // Burn fees at the exposures specified in `xFeeBurn`\\n bytes oracleConfig; // Data about the oracle used for the collateral\\n bytes whitelistData; // For whitelisted collateral, data used to verify whitelists\\n ManagerStorage managerData; // For managed collateral, data used to handle the strategies\\n uint256 stablecoinCap; // Cap on the amount of stablecoins that can be issued from this collateral\\n}\\n\\nstruct ParallelizerStorage {\\n ITokenP tokenP; // tokenP handled by the system\\n uint8 isRedemptionLive; // If redemption is unpaused\\n uint8 statusReentrant; // If call is reentrant or not\\n bool consumingSchedule; // If the contract is consuming a scheduled operation\\n uint128 normalizedStables; // Normalized amount of stablecoins issued by the system\\n uint128 normalizer; // To reconcile `normalizedStables` values with the actual amount\\n address[] collateralList; // List of collateral assets supported by the system\\n uint64[] xRedemptionCurve; // Increasing collateral ratios > 0\\n int64[] yRedemptionCurve; // Value of the redemption fees at `xRedemptionCurve`\\n mapping(address => Collateral) collaterals; // Maps a collateral asset to its parameters\\n mapping(address => uint256) isTrusted; // If an address is trusted to update the normalizer value\\n mapping(address => uint256) isSellerTrusted; // If an address is trusted to sell accruing reward tokens or to run\\n // keeper jobs on oracles\\n mapping(WhitelistType => mapping(address => uint256)) isWhitelistedForType;\\n}\\n// Whether an address is whitelisted for a specific whitelist type\\n\",\"keccak256\":\"0x3f4313dd110dbe390038320b2d3cf24dcbe9b75cd9573e7f048f7233c02dd227\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/AccessManagedModifiers.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { LibDiamond } from \\\"../libraries/LibDiamond.sol\\\";\\nimport { LibStorage as s, ParallelizerStorage } from \\\"../libraries/LibStorage.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\n\\n/// @title AccessManagedModifiers\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This contract is an authorized fork of Angle's `AccessControlModifiers` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/AccessControlModifiers.sol\\n/// update access logic to use OpenZeppelin's `AccessManaged` logic\\ncontract AccessManagedModifiers {\\n /// @notice Checks whether the `msg.sender` can call a function with a given selector\\n modifier restricted() {\\n if (!LibDiamond.checkCanCall(msg.sender, msg.data)) revert AccessManagedUnauthorized(msg.sender);\\n _;\\n }\\n\\n /// @notice Prevents a contract from calling itself, directly or indirectly\\n /// @dev This implementation is an adaptation of the OpenZepellin `ReentrancyGuard` for the purpose of this\\n /// Diamond Proxy system. The base implementation can be found here\\n /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol\\n modifier nonReentrant() {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n // Reentrant protection\\n // On the first call, `ts.statusReentrant` will be `NOT_ENTERED`\\n if (ts.statusReentrant == ENTERED) revert ReentrantCall();\\n // Any calls to the `nonReentrant` modifier after this point will fail\\n ts.statusReentrant = ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n ts.statusReentrant = NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0xa23f4434f86462af0594992bd826ba6af88f55201f2a7f79ce5fde05b5f10073\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/DiamondCut.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { IDiamondCut } from \\\"contracts/interfaces/IDiamondCut.sol\\\";\\n\\nimport { LibDiamond } from \\\"../libraries/LibDiamond.sol\\\";\\n\\nimport { AccessManagedModifiers } from \\\"./AccessManagedModifiers.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title DiamondCut\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/facets/DiamondCutFacet.sol by mudgen\\ncontract DiamondCut is IDiamondCut, AccessManagedModifiers {\\n /// @inheritdoc IDiamondCut\\n function diamondCut(FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata) external restricted {\\n LibDiamond.diamondCut(_diamondCut, _init, _calldata);\\n }\\n}\\n\",\"keccak256\":\"0xed4bcf3941026467dc1fcc510bf8368b123aa9f7786dd25cbec66f6036ea8f16\",\"license\":\"MIT\"},\"contracts/parallelizer/libraries/LibDiamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { AuthorityUtils } from \\\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibDiamond\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Helper library to deal with diamond proxies.\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/libraries/LibDiamond.sol by mudgen\\nlibrary LibDiamond {\\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n function isGovernor(address caller) internal view returns (bool) {\\n (bool isMember,) = s.diamondStorage().accessManager.hasRole(GOVERNOR_ROLE, caller);\\n return isMember;\\n }\\n\\n /// @notice Checks whether `caller` can call `data` on `this`\\n function checkCanCall(address caller, bytes calldata data) internal returns (bool) {\\n IAccessManager accessManager = s.diamondStorage().accessManager;\\n (bool immediate, uint32 delay) =\\n AuthorityUtils.canCallWithDelay(address(accessManager), caller, address(this), bytes4(data[0:4]));\\n if (!immediate) {\\n if (delay > 0) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n ts.consumingSchedule = true;\\n accessManager.consumeScheduledOp(caller, data);\\n ts.consumingSchedule = false;\\n } else {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @notice Internal function version of `diamondCut`\\n function diamondCut(FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {\\n uint256 diamondCutLength = _diamondCut.length;\\n for (uint256 facetIndex; facetIndex < diamondCutLength; facetIndex++) {\\n bytes4[] memory functionSelectors = _diamondCut[facetIndex].functionSelectors;\\n address facetAddress = _diamondCut[facetIndex].facetAddress;\\n\\n if (functionSelectors.length == 0) {\\n revert NoSelectorsProvidedForFacetForCut(facetAddress);\\n }\\n\\n FacetCutAction action = _diamondCut[facetIndex].action;\\n if (action == FacetCutAction.Add) {\\n _addFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Replace) {\\n _replaceFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Remove) {\\n _removeFunctions(facetAddress, functionSelectors);\\n }\\n }\\n\\n emit DiamondCut(_diamondCut, _init, _calldata);\\n _initializeDiamondCut(_init, _calldata);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n PRIVATE FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Does a delegate call on `_init` with `_calldata`\\n function _initializeDiamondCut(address _init, bytes memory _calldata) private {\\n if (_init == address(0)) {\\n return;\\n }\\n _enforceHasContractCode(_init);\\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n if (!success) {\\n if (error.length > 0) {\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(error)\\n revert(add(32, error), returndata_size)\\n }\\n } else {\\n revert InitializationFunctionReverted(_init, _calldata);\\n }\\n }\\n }\\n\\n /// @notice Adds a new function to the diamond proxy\\n /// @dev Reverts if selectors are already existing\\n function _addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n if (_facetAddress == address(0)) {\\n revert CannotAddSelectorsToZeroAddress(_functionSelectors);\\n }\\n DiamondStorage storage ds = s.diamondStorage();\\n uint16 selectorCount = uint16(ds.selectors.length);\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n if (oldFacetAddress != address(0)) {\\n revert CannotAddFunctionToDiamondThatAlreadyExists(selector);\\n }\\n ds.selectorInfo[selector] = FacetInfo(_facetAddress, selectorCount);\\n ds.selectors.push(selector);\\n selectorCount++;\\n }\\n }\\n\\n /// @notice Upgrades a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n if (_facetAddress == address(0)) {\\n revert CannotReplaceFunctionsFromFacetWithZeroAddress(_functionSelectors);\\n }\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n // Can't replace immutable functions -- functions defined directly in the diamond in this case\\n if (oldFacetAddress == address(this)) {\\n revert CannotReplaceImmutableFunction(selector);\\n }\\n if (oldFacetAddress == _facetAddress) {\\n revert CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(selector);\\n }\\n if (oldFacetAddress == address(0)) {\\n revert CannotReplaceFunctionThatDoesNotExists(selector);\\n }\\n // Replace old facet address\\n ds.selectorInfo[selector].facetAddress = _facetAddress;\\n }\\n }\\n\\n /// @notice Removes a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n uint256 selectorCount = ds.selectors.length;\\n if (_facetAddress != address(0)) {\\n revert RemoveFacetAddressMustBeZeroAddress(_facetAddress);\\n }\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n FacetInfo memory oldFacetAddressAndSelectorPosition = ds.selectorInfo[selector];\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(0)) {\\n revert CannotRemoveFunctionThatDoesNotExist(selector);\\n }\\n\\n // Can't remove immutable functions -- functions defined directly in the diamond\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(this)) {\\n revert CannotRemoveImmutableFunction(selector);\\n }\\n // Replace selector with last selector\\n selectorCount--;\\n if (oldFacetAddressAndSelectorPosition.selectorPosition != selectorCount) {\\n bytes4 lastSelector = ds.selectors[selectorCount];\\n ds.selectors[oldFacetAddressAndSelectorPosition.selectorPosition] = lastSelector;\\n ds.selectorInfo[lastSelector].selectorPosition = oldFacetAddressAndSelectorPosition.selectorPosition;\\n }\\n // Delete last selector\\n ds.selectors.pop();\\n delete ds.selectorInfo[selector];\\n }\\n }\\n\\n /// @notice Checks that an address has a non void bytecode\\n function _enforceHasContractCode(address _contract) private view {\\n uint256 contractSize;\\n assembly (\\\"memory-safe\\\") {\\n contractSize := extcodesize(_contract)\\n }\\n if (contractSize == 0) {\\n revert ContractHasNoCode();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x10bde4c13cc3d3c4aec15b793565bfe05b5f770eafeb839bfd159dbe6351dc62\",\"license\":\"MIT\"},\"contracts/parallelizer/libraries/LibStorage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport { DiamondStorage, ImplementationStorage, ParallelizerStorage } from \\\"../Storage.sol\\\";\\n\\n/// @title LibStorage\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibStorage` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibStorage.sol\\nlibrary LibStorage {\\n /// @notice Returns the storage struct stored at the `DIAMOND_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic of the different facets used in the diamond proxy\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ds.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `TRANSMUTER_STORAGE_POSITION` slot\\n /// @dev This struct handles the particular logic of the Parallelizer system\\n function transmuterStorage() internal pure returns (ParallelizerStorage storage ts) {\\n bytes32 position = TRANSMUTER_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ts.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `IMPLEMENTATION_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic for making the contract easily usable on Etherscan\\n function implementationStorage() internal pure returns (ImplementationStorage storage ims) {\\n bytes32 position = IMPLEMENTATION_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ims.slot := position\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf8c333898ca14d3e8696c232f669a839dddbf705a609a1b0795ecc6b8f1b2d73\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ICbETH } from \\\"contracts/interfaces/external/coinbase/ICbETH.sol\\\";\\nimport { ISfrxETH } from \\\"contracts/interfaces/external/frax/ISfrxETH.sol\\\";\\nimport { IStETH } from \\\"contracts/interfaces/external/lido/IStETH.sol\\\";\\nimport { IRETH } from \\\"contracts/interfaces/external/rocketPool/IRETH.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STORAGE SLOTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n/// @dev Storage position of `DiamondStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.diamond.storage\\\") - 1`\\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\\n\\n/// @dev Storage position of `ParallelizerStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.parallelizer.storage\\\") - 1`\\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\\n\\n/// @dev Storage position of `ImplementationStorage` structure\\n/// @dev Equals `keccak256(\\\"eip1967.proxy.implementation\\\") - 1`\\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MATHS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nuint256 constant BASE_6 = 1e6;\\nuint256 constant BASE_8 = 1e8;\\nuint256 constant BASE_9 = 1e9;\\nuint256 constant BASE_12 = 1e12;\\nuint256 constant BPS = 1e14;\\nuint256 constant BASE_18 = 1e18;\\nuint256 constant HALF_BASE_27 = 1e27 / 2;\\nuint256 constant BASE_27 = 1e27;\\nuint256 constant BASE_36 = 1e36;\\nuint256 constant MAX_BURN_FEE = 999_000_000;\\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// The values being non-zero value makes deployment a bit more expensive,\\n// but in exchange the refund on every call to nonReentrant will be lower in\\n// amount. Since refunds are capped to a percentage of the total\\n// transaction's gas, it is best to keep them low in cases like this one, to\\n// increase the likelihood of the full refund coming into effect.\\nuint8 constant NOT_ENTERED = 1;\\nuint8 constant ENTERED = 2;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// Role IDs for the AccessManager\\nuint64 constant GOVERNOR_ROLE = 10;\\nuint64 constant GUARDIAN_ROLE = 20;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n COMMON ADDRESSES \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\\n\",\"keccak256\":\"0x3306bdd0d4e4f364e0d35893a7ffb59c8eb9e94a5bd861f58b8d7ba8a7b336e5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nerror AccessManagedUnauthorized(address caller);\\nerror AlreadyAdded();\\nerror CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);\\nerror CannotAddSelectorsToZeroAddress(bytes4[] _selectors);\\nerror CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);\\nerror CannotRemoveImmutableFunction(bytes4 _selector);\\nerror CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);\\nerror CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);\\nerror CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);\\nerror CannotReplaceImmutableFunction(bytes4 _selector);\\nerror ContractHasNoCode();\\nerror CollateralBacked();\\nerror FunctionNotFound(bytes4 _functionSelector);\\nerror IncorrectFacetCutAction(uint8 _action);\\nerror InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);\\nerror InvalidChainlinkRate();\\nerror InvalidLengths();\\nerror InvalidNegativeFees();\\nerror InvalidOracleType();\\nerror InvalidParam();\\nerror InvalidParams();\\nerror InvalidRate();\\nerror InvalidSwap();\\nerror InvalidTokens();\\nerror InvalidAccessManager();\\nerror ManagerHasAssets();\\nerror NoSelectorsProvidedForFacetForCut(address _facetAddress);\\nerror NotAllowed();\\nerror NotCollateral();\\nerror NotGovernor();\\nerror NotGuardian();\\nerror NotTrusted();\\nerror NotTrustedOrGuardian();\\nerror NotWhitelisted();\\nerror OdosSwapFailed();\\nerror OracleUpdateFailed();\\nerror Paused();\\nerror ReentrantCall();\\nerror RemoveFacetAddressMustBeZeroAddress(address _facetAddress);\\nerror TooBigAmountIn();\\nerror TooLate();\\nerror TooSmallAmountOut();\\nerror ZeroAddress();\\nerror ZeroAmount();\\nerror SwapError();\\nerror SlippageTooHigh();\\nerror InsufficientFunds();\\n\",\"keccak256\":\"0x1e2f6812ef78e948e5155d32213b52afff8c0ba5463d18bee10694efbf886130\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x60808060405234601557610fdc908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c631f931c1c14610024575f80fd5b34610a6a576060366003190112610a6a5760043567ffffffffffffffff8111610a6a5736602382011215610a6a57806004013567ffffffffffffffff8111610a6a5760248160051b83010190368211610a6a57602435906001600160a01b038216808303610a6a576044359367ffffffffffffffff8511610a6a5736602386011215610a6a5784600401359067ffffffffffffffff8211610a6a573660248388010111610a6a576100d53633610b0c565b15610a6e576100e384610ad8565b936100f16040519586610ab6565b84526020840190819760248101925b82841061096a575050505060208180602461011b5f95610af0565b986101296040519a8b610ab6565b828a5201838901378601015281515f5b81811061025d5750506040519160608301906060845251809152608083019060808160051b85010196915f905b8282106101b7576101b588887f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67389806101ad8f8c6020840152828103604084015286610dc3565b0390a1610ee4565b005b90919297607f19868203018252885160608201906001600160a01b038151168352602081015190600382101561024957604060809160209384870152015193606060408201528451809452019201905f905b808210610227575050506020806001929a0192019201909291610166565b9091926020806001926001600160e01b03198751168152019401920190610209565b634e487b7160e01b5f52602160045260245ffd5b60406102698286610d9b565b5101516001600160a01b0361027e8387610d9b565b5151169080511561093e5760206102958488610d9b565b510151600381101561024957806104fd575081156104c35761ffff7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b5416916102dd81610f76565b8151915f935b8385106102f95750505050506001905b01610139565b6001600160e01b031961030c8684610d9b565b5116805f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b0360405f205416610498576103d860405161035681610a9a565b85815261ffff8060208301951694858152845f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b038060405f209451161673ffffffffffffffffffffffffffffffffffffffff19845416178355511661ffff60a01b1961ffff60a01b83549260a01b169116179055565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b5490680100000000000000008210156104845761043e82600161045b94017fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b55610e23565b90919063ffffffff83549160031b9260e01c831b921b1916179055565b61ffff811461047057600194850194016102e3565b634e487b7160e01b5f52601160045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b7febbf5d07000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b6104f9906040519182917f0ae3681c00000000000000000000000000000000000000000000000000000000835260048301610ea1565b0390fd5b600181036106a05750811561066a5761051582610f76565b8051906001600160a01b038316905f5b8381106105395750505050506001906102f3565b6001600160e01b031961054c8284610d9b565b5116805f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b0360405f20541630811461063e5786811461061257156105e757906001915f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260405f208473ffffffffffffffffffffffffffffffffffffffff1982541617905501610525565b7f7479f939000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b507f358d9d1a000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b507f520300da000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b6104f9906040519182917fcd98a96f00000000000000000000000000000000000000000000000000000000835260048301610ea1565b6002146106b2575b50506001906102f3565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b54918061091357508051905f5b8281106106ee5750506106a8565b6001600160e01b03196107018284610d9b565b511690815f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260405f20946040519561073d87610a9a565b54956001600160a01b03871680825261ffff602083019860a01c168852156108e757516001600160a01b031630146108bb578015610470575f1901948561ffff82511603610837575b507fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b54918215610823576001925f19016107bf81610e23565b63ffffffff82549160031b1b191690557fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b555f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020525f6040812055016106e0565b634e487b7160e01b5f52603160045260245ffd5b6108b5906001600160e01b031961ffff61085089610e23565b90549060031b1c60e01b9261086b8461043e84845116610e23565b511691165f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260405f209061ffff60a01b1961ffff60a01b83549260a01b169116179055565b5f610786565b827f6fafeb08000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b837f7a08a22d000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7fd091bc81000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b507fe767f91f000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b833567ffffffffffffffff8111610a6a57820160606023198236030112610a6a57604051906060820182811067ffffffffffffffff8211176104845760405260248101356001600160a01b0381168103610a6a57825260448101356003811015610a6a576020830152606481013567ffffffffffffffff8111610a6a57602491010136601f82011215610a6a578035610a0281610ad8565b91610a106040519384610ab6565b81835260208084019260051b82010190368211610a6a57602001915b818310610a49575050506040820152815260209384019301610100565b82356001600160e01b031981168103610a6a57815260209283019201610a2c565b5f80fd5b7f068ca9d8000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b6040810190811067ffffffffffffffff82111761048457604052565b90601f8019910116810190811067ffffffffffffffff82111761048457604052565b67ffffffffffffffff81116104845760051b60200190565b67ffffffffffffffff811161048457601f01601f191660200190565b6001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54169180600411610a6a575f5f905f80604051956001600160a01b0360208801917fb700961300000000000000000000000000000000000000000000000000000000835216968760248201523060448201526001600160e01b0319833516606482015260648152610ba7608482610ab6565b5190885afa610bb4610de7565b90610d22575b5015610bca575b50505050600190565b63ffffffff1615610d1b5776010000000000000000000000000000000000000000000060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7555823b15610a6a576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af18015610d1057610d00575b5060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7554167f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75555f808080610bc1565b5f610d0a91610ab6565b5f610cab565b6040513d5f823e3d90fd5b5050505f90565b80519092909160408310610d645750508160409181010312610a6a576040610d4c60208301610e16565b91015163ffffffff81168103610a6a57905b5f610bba565b916020819492941015610d79575b5050610d5e565b8192509060209181010312610a6a576020610d949101610e16565b5f80610d72565b8051821015610daf5760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b3d15610e11573d90610df882610af0565b91610e066040519384610ab6565b82523d5f602084013e565b606090565b51908115158203610a6a57565b907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b54821015610daf577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b5f52600382901c7f44fefae66705534388ac21ba5f0775616856a675b8eaea9bb0b2507f062387c3019160021b601c1690565b60206040818301928281528451809452019201905f5b818110610ec45750505090565b82516001600160e01b031916845260209384019390920191600101610eb7565b906001600160a01b038216918215610f71575f81610f028293610f76565b83519060208501905af491610f15610de7565b9215610f2057505050565b825115610f2f57825160208401fd5b6104f96040519283927f192105d70000000000000000000000000000000000000000000000000000000084526004840152604060248401526044830190610dc3565b505050565b3b15610f7e57565b7fc1df45cf000000000000000000000000000000000000000000000000000000005f5260045ffdfea26469706673582212202cd02906dbe84f6a65f9724271eb9204c1f12d05095ec70a5ac220fe0f70017d64736f6c634300081c0033", + "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f3560e01c631f931c1c14610024575f80fd5b34610a6a576060366003190112610a6a5760043567ffffffffffffffff8111610a6a5736602382011215610a6a57806004013567ffffffffffffffff8111610a6a5760248160051b83010190368211610a6a57602435906001600160a01b038216808303610a6a576044359367ffffffffffffffff8511610a6a5736602386011215610a6a5784600401359067ffffffffffffffff8211610a6a573660248388010111610a6a576100d53633610b0c565b15610a6e576100e384610ad8565b936100f16040519586610ab6565b84526020840190819760248101925b82841061096a575050505060208180602461011b5f95610af0565b986101296040519a8b610ab6565b828a5201838901378601015281515f5b81811061025d5750506040519160608301906060845251809152608083019060808160051b85010196915f905b8282106101b7576101b588887f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67389806101ad8f8c6020840152828103604084015286610dc3565b0390a1610ee4565b005b90919297607f19868203018252885160608201906001600160a01b038151168352602081015190600382101561024957604060809160209384870152015193606060408201528451809452019201905f905b808210610227575050506020806001929a0192019201909291610166565b9091926020806001926001600160e01b03198751168152019401920190610209565b634e487b7160e01b5f52602160045260245ffd5b60406102698286610d9b565b5101516001600160a01b0361027e8387610d9b565b5151169080511561093e5760206102958488610d9b565b510151600381101561024957806104fd575081156104c35761ffff7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b5416916102dd81610f76565b8151915f935b8385106102f95750505050506001905b01610139565b6001600160e01b031961030c8684610d9b565b5116805f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b0360405f205416610498576103d860405161035681610a9a565b85815261ffff8060208301951694858152845f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b038060405f209451161673ffffffffffffffffffffffffffffffffffffffff19845416178355511661ffff60a01b1961ffff60a01b83549260a01b169116179055565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b5490680100000000000000008210156104845761043e82600161045b94017fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b55610e23565b90919063ffffffff83549160031b9260e01c831b921b1916179055565b61ffff811461047057600194850194016102e3565b634e487b7160e01b5f52601160045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b7febbf5d07000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b6104f9906040519182917f0ae3681c00000000000000000000000000000000000000000000000000000000835260048301610ea1565b0390fd5b600181036106a05750811561066a5761051582610f76565b8051906001600160a01b038316905f5b8381106105395750505050506001906102f3565b6001600160e01b031961054c8284610d9b565b5116805f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b0360405f20541630811461063e5786811461061257156105e757906001915f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260405f208473ffffffffffffffffffffffffffffffffffffffff1982541617905501610525565b7f7479f939000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b507f358d9d1a000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b507f520300da000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b6104f9906040519182917fcd98a96f00000000000000000000000000000000000000000000000000000000835260048301610ea1565b6002146106b2575b50506001906102f3565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b54918061091357508051905f5b8281106106ee5750506106a8565b6001600160e01b03196107018284610d9b565b511690815f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260405f20946040519561073d87610a9a565b54956001600160a01b03871680825261ffff602083019860a01c168852156108e757516001600160a01b031630146108bb578015610470575f1901948561ffff82511603610837575b507fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b54918215610823576001925f19016107bf81610e23565b63ffffffff82549160031b1b191690557fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b555f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020525f6040812055016106e0565b634e487b7160e01b5f52603160045260245ffd5b6108b5906001600160e01b031961ffff61085089610e23565b90549060031b1c60e01b9261086b8461043e84845116610e23565b511691165f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260405f209061ffff60a01b1961ffff60a01b83549260a01b169116179055565b5f610786565b827f6fafeb08000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b837f7a08a22d000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7fd091bc81000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b507fe767f91f000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b833567ffffffffffffffff8111610a6a57820160606023198236030112610a6a57604051906060820182811067ffffffffffffffff8211176104845760405260248101356001600160a01b0381168103610a6a57825260448101356003811015610a6a576020830152606481013567ffffffffffffffff8111610a6a57602491010136601f82011215610a6a578035610a0281610ad8565b91610a106040519384610ab6565b81835260208084019260051b82010190368211610a6a57602001915b818310610a49575050506040820152815260209384019301610100565b82356001600160e01b031981168103610a6a57815260209283019201610a2c565b5f80fd5b7f068ca9d8000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b6040810190811067ffffffffffffffff82111761048457604052565b90601f8019910116810190811067ffffffffffffffff82111761048457604052565b67ffffffffffffffff81116104845760051b60200190565b67ffffffffffffffff811161048457601f01601f191660200190565b6001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54169180600411610a6a575f5f905f80604051956001600160a01b0360208801917fb700961300000000000000000000000000000000000000000000000000000000835216968760248201523060448201526001600160e01b0319833516606482015260648152610ba7608482610ab6565b5190885afa610bb4610de7565b90610d22575b5015610bca575b50505050600190565b63ffffffff1615610d1b5776010000000000000000000000000000000000000000000060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7555823b15610a6a576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af18015610d1057610d00575b5060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7554167f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75555f808080610bc1565b5f610d0a91610ab6565b5f610cab565b6040513d5f823e3d90fd5b5050505f90565b80519092909160408310610d645750508160409181010312610a6a576040610d4c60208301610e16565b91015163ffffffff81168103610a6a57905b5f610bba565b916020819492941015610d79575b5050610d5e565b8192509060209181010312610a6a576020610d949101610e16565b5f80610d72565b8051821015610daf5760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b3d15610e11573d90610df882610af0565b91610e066040519384610ab6565b82523d5f602084013e565b606090565b51908115158203610a6a57565b907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b54821015610daf577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b5f52600382901c7f44fefae66705534388ac21ba5f0775616856a675b8eaea9bb0b2507f062387c3019160021b601c1690565b60206040818301928281528451809452019201905f5b818110610ec45750505090565b82516001600160e01b031916845260209384019390920191600101610eb7565b906001600160a01b038216918215610f71575f81610f028293610f76565b83519060208501905af491610f15610de7565b9215610f2057505050565b825115610f2f57825160208401fd5b6104f96040519283927f192105d70000000000000000000000000000000000000000000000000000000084526004840152604060248401526044830190610dc3565b505050565b3b15610f7e57565b7fc1df45cf000000000000000000000000000000000000000000000000000000005f5260045ffdfea26469706673582212202cd02906dbe84f6a65f9724271eb9204c1f12d05095ec70a5ac220fe0f70017d64736f6c634300081c0033", + "devdoc": { + "author": "Cooper Labs", + "custom:contact": "security@cooperlabs.xyz", + "details": "Reference: EIP-2535 DiamondsForked from https://github.com/mudgen/diamond-3/blob/master/contracts/facets/DiamondCutFacet.sol by mudgen", + "kind": "dev", + "methods": { + "diamondCut((address,uint8,bytes4[])[],address,bytes)": { + "params": { + "_calldata": "A function call, including function selector and arguments, executed with delegatecall on _init", + "_diamondCut": "Contains the facet addresses and function selectors", + "_init": "The address of the contract or facet to execute _calldata" + } + } + }, + "title": "DiamondCut", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "diamondCut((address,uint8,bytes4[])[],address,bytes)": { + "notice": "Add/replace/remove any number of functions and optionally execute a function with delegatecall" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/DiamondInitializer.json b/deployments/sepolia/DiamondInitializer.json new file mode 100644 index 0000000..730062a --- /dev/null +++ b/deployments/sepolia/DiamondInitializer.json @@ -0,0 +1,275 @@ +{ + "address": "0xA19c5D1013A8682aC76206a085Ec24aC89F7c025", + "abi": [ + { + "inputs": [], + "name": "AlreadyAdded", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAccessManager", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidChainlinkRate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidNegativeFees", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidParams", + "type": "error" + }, + { + "inputs": [], + "name": "NotCollateral", + "type": "error" + }, + { + "inputs": [], + "name": "NotGovernor", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "CollateralAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64[]", + "name": "xFee", + "type": "uint64[]" + }, + { + "indexed": false, + "internalType": "int64[]", + "name": "yFee", + "type": "int64[]" + }, + { + "indexed": false, + "internalType": "bool", + "name": "mint", + "type": "bool" + } + ], + "name": "FeesSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "oracleConfig", + "type": "bytes" + } + ], + "name": "OracleSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "pausedType", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "PauseToggled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64[]", + "name": "xFee", + "type": "uint64[]" + }, + { + "indexed": false, + "internalType": "int64[]", + "name": "yFee", + "type": "int64[]" + } + ], + "name": "RedemptionCurveParamsSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IAccessManager", + "name": "_accessManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenP", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "bytes", + "name": "oracleConfig", + "type": "bytes" + }, + { + "internalType": "uint64[]", + "name": "xMintFee", + "type": "uint64[]" + }, + { + "internalType": "int64[]", + "name": "yMintFee", + "type": "int64[]" + }, + { + "internalType": "uint64[]", + "name": "xBurnFee", + "type": "uint64[]" + }, + { + "internalType": "int64[]", + "name": "yBurnFee", + "type": "int64[]" + } + ], + "internalType": "struct CollateralSetup[]", + "name": "_collaterals", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint64[]", + "name": "xRedeemFee", + "type": "uint64[]" + }, + { + "internalType": "int64[]", + "name": "yRedeemFee", + "type": "int64[]" + } + ], + "internalType": "struct RedemptionSetup", + "name": "_redemptionSetup", + "type": "tuple" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xd1b6b8fbf5d548aaea0f7e4e80093a42b080974e58030007a52f7010b665a2ab", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0xA19c5D1013A8682aC76206a085Ec24aC89F7c025", + "transactionIndex": 90, + "gasUsed": "2830524", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5402209c00cbe1d7a8ce463995868c605dcf467ac7e0c02d324cbe3aea08f918", + "transactionHash": "0xd1b6b8fbf5d548aaea0f7e4e80093a42b080974e58030007a52f7010b665a2ab", + "logs": [], + "blockNumber": 8411091, + "cumulativeGasUsed": "24849307", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9d44d918681c9ad36f866ebee034a3d1", + "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"AlreadyAdded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAccessManager\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidChainlinkRate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNegativeFees\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotCollateral\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotGovernor\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"CollateralAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"xFee\",\"type\":\"uint64[]\"},{\"indexed\":false,\"internalType\":\"int64[]\",\"name\":\"yFee\",\"type\":\"int64[]\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"mint\",\"type\":\"bool\"}],\"name\":\"FeesSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"oracleConfig\",\"type\":\"bytes\"}],\"name\":\"OracleSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"pausedType\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isPaused\",\"type\":\"bool\"}],\"name\":\"PauseToggled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"xFee\",\"type\":\"uint64[]\"},{\"indexed\":false,\"internalType\":\"int64[]\",\"name\":\"yFee\",\"type\":\"int64[]\"}],\"name\":\"RedemptionCurveParamsSet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"contract IAccessManager\",\"name\":\"_accessManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenP\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"oracleConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64[]\",\"name\":\"xMintFee\",\"type\":\"uint64[]\"},{\"internalType\":\"int64[]\",\"name\":\"yMintFee\",\"type\":\"int64[]\"},{\"internalType\":\"uint64[]\",\"name\":\"xBurnFee\",\"type\":\"uint64[]\"},{\"internalType\":\"int64[]\",\"name\":\"yBurnFee\",\"type\":\"int64[]\"}],\"internalType\":\"struct CollateralSetup[]\",\"name\":\"_collaterals\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64[]\",\"name\":\"xRedeemFee\",\"type\":\"uint64[]\"},{\"internalType\":\"int64[]\",\"name\":\"yRedeemFee\",\"type\":\"int64[]\"}],\"internalType\":\"struct RedemptionSetup\",\"name\":\"_redemptionSetup\",\"type\":\"tuple\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract is used only once to initialize the diamond proxy.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/parallelizer/configs/DiamondInitializer.sol\":\"DiamondInitializer\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAuthority} from \\\"./IAuthority.sol\\\";\\n\\nlibrary AuthorityUtils {\\n /**\\n * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\\n * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\\n * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\\n */\\n function canCallWithDelay(\\n address authority,\\n address caller,\\n address target,\\n bytes4 selector\\n ) internal view returns (bool immediate, uint32 delay) {\\n (bool success, bytes memory data) = authority.staticcall(\\n abi.encodeCall(IAuthority.canCall, (caller, target, selector))\\n );\\n if (success) {\\n if (data.length >= 0x40) {\\n (immediate, delay) = abi.decode(data, (bool, uint32));\\n } else if (data.length >= 0x20) {\\n immediate = abi.decode(data, (bool));\\n }\\n }\\n return (immediate, delay);\\n }\\n}\\n\",\"keccak256\":\"0xb3875997b0d8705e29aa20fee88e1dfef93df438794ae1ad8ba2eb016a4dd4e4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAccessManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\ninterface IAccessManager {\\n /**\\n * @dev A delayed operation was scheduled.\\n */\\n event OperationScheduled(\\n bytes32 indexed operationId,\\n uint32 indexed nonce,\\n uint48 schedule,\\n address caller,\\n address target,\\n bytes data\\n );\\n\\n /**\\n * @dev A scheduled operation was executed.\\n */\\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev A scheduled operation was canceled.\\n */\\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev Informational labelling for a roleId.\\n */\\n event RoleLabel(uint64 indexed roleId, string label);\\n\\n /**\\n * @dev Emitted when `account` is granted `roleId`.\\n *\\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\\n * otherwise it indicates the execution delay for this account and roleId is updated.\\n */\\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\\n\\n /**\\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\\n */\\n event RoleRevoked(uint64 indexed roleId, address indexed account);\\n\\n /**\\n * @dev Role acting as admin over a given `roleId` is updated.\\n */\\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\\n\\n /**\\n * @dev Role acting as guardian over a given `roleId` is updated.\\n */\\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\\n\\n /**\\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\\n */\\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\\n\\n /**\\n * @dev Target mode is updated (true = closed, false = open).\\n */\\n event TargetClosed(address indexed target, bool closed);\\n\\n /**\\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\\n */\\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\\n\\n /**\\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\\n */\\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\\n\\n error AccessManagerAlreadyScheduled(bytes32 operationId);\\n error AccessManagerNotScheduled(bytes32 operationId);\\n error AccessManagerNotReady(bytes32 operationId);\\n error AccessManagerExpired(bytes32 operationId);\\n error AccessManagerLockedRole(uint64 roleId);\\n error AccessManagerBadConfirmation();\\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\\n error AccessManagerUnauthorizedConsume(address target);\\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\\n\\n /**\\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\\n * & {execute} workflow.\\n *\\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\\n * for future execution.\\n *\\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\\n * the operation can be executed if and only if delay is greater than 0.\\n *\\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\\n *\\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\\n * {AccessManager} documentation.\\n */\\n function canCall(\\n address caller,\\n address target,\\n bytes4 selector\\n ) external view returns (bool allowed, uint32 delay);\\n\\n /**\\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\\n *\\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\\n * disabling any scheduling usage.\\n */\\n function expiration() external view returns (uint32);\\n\\n /**\\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\\n * can be increased without setback (and reset via {revokeRole} in the case event of an\\n * accidental increase). Defaults to 5 days.\\n */\\n function minSetback() external view returns (uint32);\\n\\n /**\\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\\n *\\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\\n */\\n function isTargetClosed(address target) external view returns (bool);\\n\\n /**\\n * @dev Get the role required to call a function.\\n */\\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\\n\\n /**\\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\\n */\\n function getTargetAdminDelay(address target) external view returns (uint32);\\n\\n /**\\n * @dev Get the id of the role that acts as an admin for the given role.\\n *\\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\\n * an operation that is restricted to this role.\\n */\\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role that acts as a guardian for a given role.\\n *\\n * The guardian permission allows canceling operations that have been scheduled under the role.\\n */\\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role current grant delay.\\n *\\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\\n */\\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\\n\\n /**\\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\\n * level.\\n *\\n * Returns:\\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\\n * [1] Current execution delay for the account.\\n * [2] Pending execution delay for the account.\\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\\n */\\n function getAccess(\\n uint64 roleId,\\n address account\\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\\n\\n /**\\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\\n * permission might be associated with an execution delay. {getAccess} can provide more details.\\n */\\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\\n\\n /**\\n * @dev Give a label to a role, for improved role discoverability by UIs.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleLabel} event.\\n */\\n function labelRole(uint64 roleId, string calldata label) external;\\n\\n /**\\n * @dev Add `account` to `roleId`, or change its execution delay.\\n *\\n * This gives the account the authorization to call any function that is restricted to this role. An optional\\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\\n *\\n * If the account has already been granted this role, the execution delay will be updated. This update is not\\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - granted role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleGranted} event.\\n */\\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\\n\\n /**\\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\\n * no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - revoked role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function revokeRole(uint64 roleId, address account) external;\\n\\n /**\\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\\n * the role this call has no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function renounceRole(uint64 roleId, address callerConfirmation) external;\\n\\n /**\\n * @dev Change admin role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleAdminChanged} event\\n */\\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\\n\\n /**\\n * @dev Change guardian role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGuardianChanged} event\\n */\\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\\n\\n /**\\n * @dev Update the delay for granting a `roleId`.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGrantDelayChanged} event.\\n */\\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetFunctionRoleUpdated} event per selector.\\n */\\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\\n\\n /**\\n * @dev Set the delay for changing the configuration of a given target contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetAdminDelayUpdated} event.\\n */\\n function setTargetAdminDelay(address target, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the closed flag for a contract.\\n *\\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetClosed} event.\\n */\\n function setTargetClosed(address target, bool closed) external;\\n\\n /**\\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\\n * operation is not yet scheduled, has expired, was executed, or was canceled.\\n */\\n function getSchedule(bytes32 id) external view returns (uint48);\\n\\n /**\\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\\n * been scheduled.\\n */\\n function getNonce(bytes32 id) external view returns (uint32);\\n\\n /**\\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\\n * required for the caller. The special value zero will automatically set the earliest possible time.\\n *\\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\\n *\\n * Emits a {OperationScheduled} event.\\n *\\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\\n * contract if it is using standard Solidity ABI encoding.\\n */\\n function schedule(\\n address target,\\n bytes calldata data,\\n uint48 when\\n ) external returns (bytes32 operationId, uint32 nonce);\\n\\n /**\\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\\n * execution delay is 0.\\n *\\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\\n *\\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\\n */\\n function execute(address target, bytes calldata data) external payable returns (uint32);\\n\\n /**\\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\\n * operation that is cancelled.\\n *\\n * Requirements:\\n *\\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\\n *\\n * Emits a {OperationCanceled} event.\\n */\\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\\n\\n /**\\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\\n *\\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\\n * with all the verifications that it implies.\\n *\\n * Emit a {OperationExecuted} event.\\n */\\n function consumeScheduledOp(address caller, bytes calldata data) external;\\n\\n /**\\n * @dev Hashing function for delayed operations.\\n */\\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\\n\\n /**\\n * @dev Changes the authority of a target managed by this manager instance.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n */\\n function updateAuthority(address target, address newAuthority) external;\\n}\\n\",\"keccak256\":\"0x9be2d08a326515805bc9cf6315b7953f8d1ebe88abf48c2d645fb1fa8211a0e2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAuthority.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard interface for permissioning originally defined in Dappsys.\\n */\\ninterface IAuthority {\\n /**\\n * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\\n */\\n function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\\n}\\n\",\"keccak256\":\"0x4cc0766bd7fb7b3bafb70afa2a93b6e313a0baec7a35ad1b57505be7861c1030\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x70f2f713b13b7ce4610bcd0ac9fec0f3cc43693b043abcb8dc40a42a726eb330\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/interfaces/IManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IManager` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IManager.sol\\ninterface IManager {\\n /// @notice Returns the amount of collateral managed by the Manager\\n /// @return balances Balances of all the subCollaterals handled by the manager\\n /// @dev MUST NOT revert\\n function totalAssets() external view returns (uint256[] memory balances, uint256 totalValue);\\n\\n /// @notice Hook to invest `amount` of `collateral`\\n /// @dev MUST revert if the manager cannot accept these funds\\n /// @dev MUST have received the funds beforehand\\n function invest(uint256 amount) external;\\n\\n /// @notice Sends `amount` of `collateral` to the `to` address\\n /// @dev Called when `tokenP` are burnt and during redemptions\\n // @dev MUST revert if there are not funds enough available\\n /// @dev MUST be callable only by the parallelizer\\n function release(address asset, address to, uint256 amount) external;\\n\\n /// @notice Gives the maximum amount of collateral immediately available for a transfer\\n /// @dev Useful for integrators using `quoteIn` and `quoteOut`\\n function maxAvailable() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8507172834f0243643fcf366bff6bae8f20523d102f5896f2140946975458e2c\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IParallelizerOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IParallelizerOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IParallelizerOracle` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IParallelizerOracle.sol\\ninterface IParallelizerOracle {\\n /// @notice Reads the oracle value for asset to use in a redemption to compute the collateral ratio\\n function readRedemption() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a mint. It should be comprehensive of the\\n /// deviation from the target price\\n function readMint() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a burn transaction as well as the ratio\\n /// between the current price and the target price for the asset\\n function readBurn() external view returns (uint256 oracleValue, uint256 ratio);\\n\\n /// @notice Reads the oracle value for asset\\n function read() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb7287bfcade62fa4dfb07ea1cd6c1fc8be1525320f3faca44d8d9a6a01e99110\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/ITokenP.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title ITokenP\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Interface for the stablecoins `tokenP` contracts\\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\\ninterface ITokenP is IERC20 {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MINTER ROLE ONLY FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Lets a whitelisted contract mint tokenPs\\n /// @param account Address to mint to\\n /// @param amount Amount to mint\\n function mint(address account, uint256 amount) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @param sender Address which requested the burn from `burner`\\n /// @dev This method is to be called by a contract with the minter right after being requested\\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\\n /// @dev The method checks the allowance between the `sender` and the `burner`\\n function burnFrom(uint256 amount, address burner, address sender) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\\n /// requested to do so by an address willing to burn tokens from its address\\n function burnSelf(uint256 amount, address burner) external;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Amount of decimals of the stablecoin\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x64a1305faa8c5c91767a11af0eae16e4b463aa0bfe10f11b74aae9d96681a5eb\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\ninterface AggregatorV3Interface {\\n function decimals() external view returns (uint8);\\n\\n function description() external view returns (string memory);\\n\\n function version() external view returns (uint256);\\n\\n // getRoundData and latestRoundData should both raise \\\"No data present\\\"\\n // if they do not have data to report, instead of returning unset values\\n // which could be misinterpreted as actual reported values.\\n function getRoundData(uint80 _roundId)\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n\\n function latestRoundData()\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n}\\n\",\"keccak256\":\"0x94da577160ebb1bfeb7008676c8e7d43dda926d9c0beee29077e9ed774707373\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/coinbase/ICbETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ICbETH\\n/// @notice Interface for the `cbETH` contract\\ninterface ICbETH {\\n function exchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb159341cb0e25c478912b274cdda2d50fa84692aeac87b6823d281aaea2aed04\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/frax/ISfrxETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ISfrxETH\\n/// @notice Interface for the `sfrxETH` contract\\ninterface ISfrxETH {\\n function pricePerShare() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x914cbea276f817c7db62bfca21e15bd8f7892faa9f39d86baaef574cf12b859f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/keyring/IKeyringGuard.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IKeyringGuard\\n/// @notice Interface for the `KeyringGuard` contract\\ninterface IKeyringGuard {\\n function isAuthorized(address from, address to) external returns (bool passed);\\n}\\n\",\"keccak256\":\"0x30bdab602ba0a6e2571372803ae35f7bebcc354d69408be627c04c57f7071f90\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/lido/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IStETH\\n/// @notice Interface for the `StETH` contract\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n\\n function submit(address) external payable returns (uint256);\\n\\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf21e3d8bdadc236b34bf2122b0e0b939d2d6bb6e2889b508636cbb7b84f59680\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/morpho/IMorphoOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IMorphoOracle\\n/// @notice Interface for the oracle contracts used within Morpho\\ninterface IMorphoOracle {\\n function price() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x0d1849803b554763f1dce55eba5a6e8d7c5b12d4cc8dfe23637e827d2ee91d17\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/rocketPool/IRETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IRETH\\n/// @notice Interface for the `rETH` contract\\ninterface IRETH {\\n function getExchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x567a378e95d40160e297c1adb617ccaa69c03e49c4ad72a6ce651dd43cdbd5cd\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/Storage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ENUMS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nenum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n}\\n\\nenum ManagerType {\\n EXTERNAL\\n}\\n\\nenum ActionType {\\n Mint,\\n Burn,\\n Redeem\\n}\\n\\nenum TrustedType {\\n Updater,\\n Seller\\n}\\n\\nenum QuoteType {\\n MintExactInput,\\n MintExactOutput,\\n BurnExactInput,\\n BurnExactOutput\\n}\\n\\nenum OracleReadType {\\n CHAINLINK_FEEDS,\\n EXTERNAL,\\n NO_ORACLE,\\n STABLE,\\n WSTETH,\\n CBETH,\\n RETH,\\n SFRXETH,\\n MAX,\\n MORPHO_ORACLE\\n}\\n\\nenum OracleQuoteType {\\n UNIT,\\n TARGET\\n}\\n\\nenum WhitelistType {\\n BACKED\\n}\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STRUCTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nstruct Permit2Details {\\n address to; // Address that will receive the funds\\n uint256 nonce; // Nonce of the transaction\\n bytes signature; // Permit signature of the user\\n}\\n\\nstruct FacetCut {\\n address facetAddress; // Facet contract address\\n FacetCutAction action; // Can be add, remove or replace\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct Facet {\\n address facetAddress; // Facet contract address\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct FacetInfo {\\n address facetAddress; // Facet contract address\\n uint16 selectorPosition; // Position in the list of all selectors\\n}\\n\\nstruct DiamondStorage {\\n bytes4[] selectors; // List of all available selectors\\n mapping(bytes4 => FacetInfo) selectorInfo; // Selector to (address, position in list)\\n IAccessManager accessManager; // Contract handling access management\\n}\\n\\nstruct ImplementationStorage {\\n address implementation; // Dummy implementation address for Etherscan usability\\n}\\n\\nstruct ManagerStorage {\\n IERC20[] subCollaterals; // Subtokens handled by the manager or strategies\\n bytes config; // Additional configuration data\\n}\\n\\nstruct Collateral {\\n uint8 isManaged; // If the collateral is managed through external strategies\\n uint8 isMintLive; // If minting from this asset is unpaused\\n uint8 isBurnLive; // If burning to this asset is unpaused\\n uint8 decimals; // IERC20Metadata(collateral).decimals()\\n uint8 onlyWhitelisted; // If only whitelisted addresses can burn or redeem for this token\\n uint216 normalizedStables; // Normalized amount of stablecoins issued from this collateral\\n uint64[] xFeeMint; // Increasing exposures in [0,BASE_9[\\n int64[] yFeeMint; // Mint fees at the exposures specified in `xFeeMint`\\n uint64[] xFeeBurn; // Decreasing exposures in ]0,BASE_9]\\n int64[] yFeeBurn; // Burn fees at the exposures specified in `xFeeBurn`\\n bytes oracleConfig; // Data about the oracle used for the collateral\\n bytes whitelistData; // For whitelisted collateral, data used to verify whitelists\\n ManagerStorage managerData; // For managed collateral, data used to handle the strategies\\n uint256 stablecoinCap; // Cap on the amount of stablecoins that can be issued from this collateral\\n}\\n\\nstruct ParallelizerStorage {\\n ITokenP tokenP; // tokenP handled by the system\\n uint8 isRedemptionLive; // If redemption is unpaused\\n uint8 statusReentrant; // If call is reentrant or not\\n bool consumingSchedule; // If the contract is consuming a scheduled operation\\n uint128 normalizedStables; // Normalized amount of stablecoins issued by the system\\n uint128 normalizer; // To reconcile `normalizedStables` values with the actual amount\\n address[] collateralList; // List of collateral assets supported by the system\\n uint64[] xRedemptionCurve; // Increasing collateral ratios > 0\\n int64[] yRedemptionCurve; // Value of the redemption fees at `xRedemptionCurve`\\n mapping(address => Collateral) collaterals; // Maps a collateral asset to its parameters\\n mapping(address => uint256) isTrusted; // If an address is trusted to update the normalizer value\\n mapping(address => uint256) isSellerTrusted; // If an address is trusted to sell accruing reward tokens or to run\\n // keeper jobs on oracles\\n mapping(WhitelistType => mapping(address => uint256)) isWhitelistedForType;\\n}\\n// Whether an address is whitelisted for a specific whitelist type\\n\",\"keccak256\":\"0x3f4313dd110dbe390038320b2d3cf24dcbe9b75cd9573e7f048f7233c02dd227\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/configs/DiamondInitializer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"./DiamondInitializerTypes.sol\\\";\\n\\n/// @dev This contract is used only once to initialize the diamond proxy.\\ncontract DiamondInitializer {\\n function initialize(\\n IAccessManager _accessManager,\\n address _tokenP,\\n CollateralSetup[] memory _collaterals,\\n RedemptionSetup memory _redemptionSetup\\n )\\n external\\n {\\n LibSetters.setAccessManager(_accessManager);\\n\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n ts.statusReentrant = NOT_ENTERED;\\n ts.normalizer = uint128(BASE_27);\\n ts.tokenP = ITokenP(_tokenP);\\n\\n // Setup each collateral\\n uint256 collateralsLength = _collaterals.length;\\n for (uint256 i; i < collateralsLength; i++) {\\n CollateralSetup memory collateral = _collaterals[i];\\n LibSetters.addCollateral(collateral.token);\\n LibSetters.setOracle(collateral.token, collateral.oracleConfig);\\n // Mint fees\\n LibSetters.setFees(collateral.token, collateral.xMintFee, collateral.yMintFee, true);\\n // Burn fees\\n LibSetters.setFees(collateral.token, collateral.xBurnFee, collateral.yBurnFee, false);\\n LibSetters.togglePause(collateral.token, ActionType.Mint);\\n LibSetters.togglePause(collateral.token, ActionType.Burn);\\n }\\n\\n // setRedemptionCurveParams\\n if (_redemptionSetup.xRedeemFee.length > 0) {\\n LibSetters.togglePause(address(0), ActionType.Redeem);\\n LibSetters.setRedemptionCurveParams(_redemptionSetup.xRedeemFee, _redemptionSetup.yRedeemFee);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7fa69aeb3e6cef51aa659ef3a633556b9d219004ce33e04b21bc80f6dc8d16c6\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/configs/DiamondInitializerTypes.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\n\\nimport { LibDiamondEtherscan } from \\\"../libraries/LibDiamondEtherscan.sol\\\";\\nimport { LibOracle } from \\\"../libraries/LibOracle.sol\\\";\\nimport { LibSetters } from \\\"../libraries/LibSetters.sol\\\";\\nimport { LibStorage as s } from \\\"../libraries/LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\nstruct CollateralSetup {\\n address token;\\n bytes oracleConfig;\\n uint64[] xMintFee;\\n int64[] yMintFee;\\n uint64[] xBurnFee;\\n int64[] yBurnFee;\\n}\\n\\nstruct RedemptionSetup {\\n uint64[] xRedeemFee;\\n int64[] yRedeemFee;\\n}\\n\",\"keccak256\":\"0xd9e652bbb51b1095d6ef5462dd0da6f5761c58b35775c8116259cbb9c0ff5289\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibDiamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { AuthorityUtils } from \\\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibDiamond\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Helper library to deal with diamond proxies.\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/libraries/LibDiamond.sol by mudgen\\nlibrary LibDiamond {\\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n function isGovernor(address caller) internal view returns (bool) {\\n (bool isMember,) = s.diamondStorage().accessManager.hasRole(GOVERNOR_ROLE, caller);\\n return isMember;\\n }\\n\\n /// @notice Checks whether `caller` can call `data` on `this`\\n function checkCanCall(address caller, bytes calldata data) internal returns (bool) {\\n IAccessManager accessManager = s.diamondStorage().accessManager;\\n (bool immediate, uint32 delay) =\\n AuthorityUtils.canCallWithDelay(address(accessManager), caller, address(this), bytes4(data[0:4]));\\n if (!immediate) {\\n if (delay > 0) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n ts.consumingSchedule = true;\\n accessManager.consumeScheduledOp(caller, data);\\n ts.consumingSchedule = false;\\n } else {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @notice Internal function version of `diamondCut`\\n function diamondCut(FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {\\n uint256 diamondCutLength = _diamondCut.length;\\n for (uint256 facetIndex; facetIndex < diamondCutLength; facetIndex++) {\\n bytes4[] memory functionSelectors = _diamondCut[facetIndex].functionSelectors;\\n address facetAddress = _diamondCut[facetIndex].facetAddress;\\n\\n if (functionSelectors.length == 0) {\\n revert NoSelectorsProvidedForFacetForCut(facetAddress);\\n }\\n\\n FacetCutAction action = _diamondCut[facetIndex].action;\\n if (action == FacetCutAction.Add) {\\n _addFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Replace) {\\n _replaceFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Remove) {\\n _removeFunctions(facetAddress, functionSelectors);\\n }\\n }\\n\\n emit DiamondCut(_diamondCut, _init, _calldata);\\n _initializeDiamondCut(_init, _calldata);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n PRIVATE FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Does a delegate call on `_init` with `_calldata`\\n function _initializeDiamondCut(address _init, bytes memory _calldata) private {\\n if (_init == address(0)) {\\n return;\\n }\\n _enforceHasContractCode(_init);\\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n if (!success) {\\n if (error.length > 0) {\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(error)\\n revert(add(32, error), returndata_size)\\n }\\n } else {\\n revert InitializationFunctionReverted(_init, _calldata);\\n }\\n }\\n }\\n\\n /// @notice Adds a new function to the diamond proxy\\n /// @dev Reverts if selectors are already existing\\n function _addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n if (_facetAddress == address(0)) {\\n revert CannotAddSelectorsToZeroAddress(_functionSelectors);\\n }\\n DiamondStorage storage ds = s.diamondStorage();\\n uint16 selectorCount = uint16(ds.selectors.length);\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n if (oldFacetAddress != address(0)) {\\n revert CannotAddFunctionToDiamondThatAlreadyExists(selector);\\n }\\n ds.selectorInfo[selector] = FacetInfo(_facetAddress, selectorCount);\\n ds.selectors.push(selector);\\n selectorCount++;\\n }\\n }\\n\\n /// @notice Upgrades a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n if (_facetAddress == address(0)) {\\n revert CannotReplaceFunctionsFromFacetWithZeroAddress(_functionSelectors);\\n }\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n // Can't replace immutable functions -- functions defined directly in the diamond in this case\\n if (oldFacetAddress == address(this)) {\\n revert CannotReplaceImmutableFunction(selector);\\n }\\n if (oldFacetAddress == _facetAddress) {\\n revert CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(selector);\\n }\\n if (oldFacetAddress == address(0)) {\\n revert CannotReplaceFunctionThatDoesNotExists(selector);\\n }\\n // Replace old facet address\\n ds.selectorInfo[selector].facetAddress = _facetAddress;\\n }\\n }\\n\\n /// @notice Removes a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n uint256 selectorCount = ds.selectors.length;\\n if (_facetAddress != address(0)) {\\n revert RemoveFacetAddressMustBeZeroAddress(_facetAddress);\\n }\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n FacetInfo memory oldFacetAddressAndSelectorPosition = ds.selectorInfo[selector];\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(0)) {\\n revert CannotRemoveFunctionThatDoesNotExist(selector);\\n }\\n\\n // Can't remove immutable functions -- functions defined directly in the diamond\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(this)) {\\n revert CannotRemoveImmutableFunction(selector);\\n }\\n // Replace selector with last selector\\n selectorCount--;\\n if (oldFacetAddressAndSelectorPosition.selectorPosition != selectorCount) {\\n bytes4 lastSelector = ds.selectors[selectorCount];\\n ds.selectors[oldFacetAddressAndSelectorPosition.selectorPosition] = lastSelector;\\n ds.selectorInfo[lastSelector].selectorPosition = oldFacetAddressAndSelectorPosition.selectorPosition;\\n }\\n // Delete last selector\\n ds.selectors.pop();\\n delete ds.selectorInfo[selector];\\n }\\n }\\n\\n /// @notice Checks that an address has a non void bytecode\\n function _enforceHasContractCode(address _contract) private view {\\n uint256 contractSize;\\n assembly (\\\"memory-safe\\\") {\\n contractSize := extcodesize(_contract)\\n }\\n if (contractSize == 0) {\\n revert ContractHasNoCode();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x10bde4c13cc3d3c4aec15b793565bfe05b5f770eafeb839bfd159dbe6351dc62\",\"license\":\"MIT\"},\"contracts/parallelizer/libraries/LibDiamondEtherscan.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\n/// @title LibDiamondEtherscan\\n/// @notice Allow to verify a diamond proxy on Etherscan\\n/// @dev Forked from https://github.com/zdenham/diamond-etherscan/blob/main/contracts/libraries/LibDiamondEtherscan.sol\\nlibrary LibDiamondEtherscan {\\n event Upgraded(address indexed implementation);\\n\\n /// @notice Internal version of `setDummyImplementation`\\n function setDummyImplementation(address implementationAddress) internal {\\n s.implementationStorage().implementation = implementationAddress;\\n emit Upgraded(implementationAddress);\\n }\\n\\n /// @notice Internal version of `implementation`\\n function dummyImplementation() internal view returns (address) {\\n return s.implementationStorage().implementation;\\n }\\n}\\n\",\"keccak256\":\"0x016498883b4a43b5ad6778ac5e77d86e9849174e266e783a40b6f275c3260480\",\"license\":\"MIT\"},\"contracts/parallelizer/libraries/LibManager.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IManager } from \\\"contracts/interfaces/IManager.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Managed collateral assets may be handled through external smart contracts or directly through this library\\n/// @dev There is no implementation at this point for a managed collateral handled through this library, and\\n/// a new specific `ManagerType` would need to be added in this case\\n/// @dev This library is an authorized fork of Angle's `LibManager` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibManager.sol\\nlibrary LibManager {\\n /// @notice Checks to which address managed funds must be transferred\\n function transferRecipient(bytes memory config) internal view returns (address recipient) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n recipient = address(this);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (address));\\n }\\n\\n /// @notice Performs a transfer of `token` for a collateral that is managed to a `to` address\\n /// @dev `token` may not be the actual collateral itself, as some collaterals have subcollaterals associated\\n /// with it\\n /// @dev Eventually pulls funds from strategies\\n function release(address token, address to, uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).release(token, to, amount);\\n }\\n\\n /// @notice Gets the balances of all the tokens controlled through `managerData`\\n /// @return balances An array of size `subCollaterals` with current balances of all subCollaterals\\n /// including the one corresponding to the `managerData` given\\n /// @return totalValue The value of all the `subCollaterals` in `collateral`\\n /// @dev `subCollaterals` must always have as first token (index 0) the collateral itself\\n function totalAssets(bytes memory config) internal view returns (uint256[] memory balances, uint256 totalValue) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).totalAssets();\\n }\\n\\n /// @notice Calls a hook if needed after new funds have been transfered to a manager\\n function invest(uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).invest(amount);\\n }\\n\\n /// @notice Returns available underlying tokens, for instance if liquidity is fully used and\\n /// not withdrawable the function will return 0\\n function maxAvailable(bytes memory config) internal view returns (uint256 available) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).maxAvailable();\\n }\\n\\n /// @notice Decodes the `managerData` associated to a collateral\\n function parseManagerConfig(bytes memory config) internal pure returns (ManagerType managerType, bytes memory data) {\\n (managerType, data) = abi.decode(config, (ManagerType, bytes));\\n }\\n}\\n\",\"keccak256\":\"0x18282c744bc34bd9ae937c0c49e909c9c4e50c15e69fb485aa68fc56e549d1a1\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IParallelizerOracle } from \\\"contracts/interfaces/IParallelizerOracle.sol\\\";\\nimport { AggregatorV3Interface } from \\\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\\\";\\nimport { IMorphoOracle } from \\\"contracts/interfaces/external/morpho/IMorphoOracle.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibOracle` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibOracle.sol\\nlibrary LibOracle {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ACTIONS SPECIFIC ORACLES \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads the oracle value used during a redemption to compute collateral ratio for `oracleConfig`\\n /// @dev This value is only sensitive to compute the collateral ratio and deduce a penalty factor\\n function readRedemption(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (OracleReadType oracleType, OracleReadType targetType, bytes memory oracleData, bytes memory targetData,) =\\n _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readRedemption();\\n } else {\\n (oracleValue,) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, 0);\\n return oracleValue;\\n }\\n }\\n\\n /// @notice Reads the oracle value used during mint operations for an asset with `oracleConfig`\\n /// @dev For assets which do not rely on external oracles, this value is the minimum between the processed oracle\\n /// value for the asset and its target price\\n function readMint(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readMint();\\n }\\n\\n (uint128 userDeviation,) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n if (targetPrice < oracleValue) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads the oracle value used for a burn operation for an asset with `oracleConfig`\\n /// @return oracleValue The actual oracle value obtained\\n /// @return ratio If `oracle value < target price`, the ratio between the oracle value and the target\\n /// price, otherwise `BASE_18`\\n function readBurn(bytes memory oracleConfig) internal view returns (uint256 oracleValue, uint256 ratio) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readBurn();\\n }\\n (uint128 userDeviation, uint128 burnRatioDeviation) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n // Firewall in case the oracle value reported is low compared to the target\\n // If the oracle value is slightly below its target, then no deviation is reported for the oracle and\\n // the price of burning the stablecoin for other assets is not impacted. Also, the oracle value of this asset\\n // is set to the target price, to not be open to direct arbitrage\\n ratio = BASE_18;\\n if (oracleValue * BASE_18 < targetPrice * (BASE_18 - burnRatioDeviation)) {\\n ratio = (oracleValue * BASE_18) / targetPrice;\\n } else if (oracleValue < targetPrice) {\\n oracleValue = targetPrice;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n VIEW FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of the `getOracle` function\\n function getOracle(address collateral)\\n internal\\n view\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return _parseOracleConfig(s.transmuterStorage().collaterals[collateral].oracleConfig);\\n }\\n\\n /// @notice Gets the oracle value and the ratio with respect to the target price when it comes to\\n /// burning for `collateral`\\n function getBurnOracle(\\n address collateral,\\n bytes memory oracleConfig\\n )\\n internal\\n view\\n returns (uint256 minRatio, uint256 oracleValue)\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n minRatio = BASE_18;\\n address[] memory collateralList = ts.collateralList;\\n uint256 length = collateralList.length;\\n for (uint256 i; i < length; ++i) {\\n uint256 ratioObserved = BASE_18;\\n if (collateralList[i] != collateral) {\\n (, ratioObserved) = readBurn(ts.collaterals[collateralList[i]].oracleConfig);\\n } else {\\n (oracleValue, ratioObserved) = readBurn(oracleConfig);\\n }\\n if (ratioObserved < minRatio) minRatio = ratioObserved;\\n }\\n }\\n\\n /// @notice Computes the `quoteAmount` (for Chainlink oracles) depending on a `quoteType` and a base value\\n /// (e.g the target price of the asset)\\n /// @dev For cases where the Chainlink feed directly looks into the value of the asset, `quoteAmount` is `BASE_18`.\\n /// For others, like wstETH for which Chainlink only has an oracle for stETH, `quoteAmount` is the target price\\n function quoteAmount(OracleQuoteType quoteType, uint256 baseValue) internal pure returns (uint256) {\\n if (quoteType == OracleQuoteType.UNIT) return BASE_18;\\n else return baseValue;\\n }\\n\\n function readSpotAndTarget(\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n uint256 deviation\\n )\\n internal\\n view\\n returns (uint256 oracleValue, uint256 targetPrice)\\n {\\n targetPrice = read(targetType, BASE_18, targetData);\\n oracleValue = read(oracleType, targetPrice, oracleData);\\n // System may tolerate small deviations from target\\n // If the oracle value reported is reasonably close to the target\\n // --> disregard the oracle value and return the target price\\n if (\\n targetPrice * (BASE_18 - deviation) < oracleValue * BASE_18\\n && oracleValue * BASE_18 < targetPrice * (BASE_18 + deviation)\\n ) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads an oracle value (or a target oracle value) for an asset based on its data parsed `oracleConfig`\\n function read(OracleReadType readType, uint256 baseValue, bytes memory data) internal view returns (uint256) {\\n if (readType == OracleReadType.CHAINLINK_FEEDS) {\\n (\\n AggregatorV3Interface[] memory circuitChainlink,\\n uint32[] memory stalePeriods,\\n uint8[] memory circuitChainIsMultiplied,\\n uint8[] memory chainlinkDecimals,\\n OracleQuoteType quoteType\\n ) = abi.decode(data, (AggregatorV3Interface[], uint32[], uint8[], uint8[], OracleQuoteType));\\n uint256 quotePrice = quoteAmount(quoteType, baseValue);\\n uint256 listLength = circuitChainlink.length;\\n for (uint256 i; i < listLength; ++i) {\\n quotePrice = readChainlinkFeed(\\n quotePrice, circuitChainlink[i], circuitChainIsMultiplied[i], chainlinkDecimals[i], stalePeriods[i]\\n );\\n }\\n return quotePrice;\\n } else if (readType == OracleReadType.STABLE) {\\n return BASE_18;\\n } else if (readType == OracleReadType.NO_ORACLE) {\\n return baseValue;\\n } else if (readType == OracleReadType.WSTETH) {\\n return STETH.getPooledEthByShares(1 ether);\\n } else if (readType == OracleReadType.CBETH) {\\n return CBETH.exchangeRate();\\n } else if (readType == OracleReadType.RETH) {\\n return RETH.getExchangeRate();\\n } else if (readType == OracleReadType.SFRXETH) {\\n return SFRXETH.pricePerShare();\\n } else if (readType == OracleReadType.MAX) {\\n uint256 maxValue = abi.decode(data, (uint256));\\n return maxValue;\\n } else if (readType == OracleReadType.MORPHO_ORACLE) {\\n (address contractAddress, uint256 normalizationFactor) = abi.decode(data, (address, uint256));\\n return IMorphoOracle(contractAddress).price() / normalizationFactor;\\n }\\n // If the `OracleReadType` is `EXTERNAL`, it means that this function is called to compute a\\n // `targetPrice` in which case the `baseValue` is returned here\\n else {\\n return baseValue;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n SPECIFIC HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads a Chainlink feed using a quote amount and converts the quote amount to the out-currency\\n /// @param _quoteAmount The amount for which to compute the price expressed in `BASE_18`\\n /// @param feed Chainlink feed to query\\n /// @param multiplied Whether the ratio outputted by Chainlink should be multiplied or divided to the `quoteAmount`\\n /// @param decimals Number of decimals of the corresponding Chainlink pair\\n /// @return The `quoteAmount` converted in out-currency\\n function readChainlinkFeed(\\n uint256 _quoteAmount,\\n AggregatorV3Interface feed,\\n uint8 multiplied,\\n uint256 decimals,\\n uint32 stalePeriod\\n )\\n internal\\n view\\n returns (uint256)\\n {\\n (, int256 ratio,, uint256 updatedAt,) = feed.latestRoundData();\\n if (ratio <= 0 || block.timestamp - updatedAt > stalePeriod) revert InvalidChainlinkRate();\\n // Checking whether we should multiply or divide by the ratio computed\\n if (multiplied == 1) return (_quoteAmount * uint256(ratio)) / (10 ** decimals);\\n else return (_quoteAmount * (10 ** decimals)) / uint256(ratio);\\n }\\n\\n /// @notice Parses an `oracleConfig` into several sub fields\\n function _parseOracleConfig(bytes memory oracleConfig)\\n private\\n pure\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return abi.decode(oracleConfig, (OracleReadType, OracleReadType, bytes, bytes, bytes));\\n }\\n\\n function updateOracle(address collateral) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n if (ts.collaterals[collateral].decimals == 0) revert NotCollateral();\\n\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(ts.collaterals[collateral].oracleConfig);\\n\\n if (targetType != OracleReadType.MAX) revert OracleUpdateFailed();\\n uint256 oracleValue = read(oracleType, BASE_18, oracleData);\\n\\n uint256 maxValue = abi.decode(targetData, (uint256));\\n if (oracleValue > maxValue) {\\n ts.collaterals[collateral].oracleConfig = abi.encode(\\n oracleType,\\n targetType,\\n oracleData,\\n // There are no checks whether the value increased or not\\n abi.encode(oracleValue),\\n hyperparameters\\n );\\n } else {\\n revert OracleUpdateFailed();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x24f504bdd0b7346a447d646a2b2b19afe1a71ee829a59e5cb2ac5fac320611d7\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibSetters.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { SafeCast } from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport { IERC20Metadata } from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\nimport { LibManager } from \\\"./LibManager.sol\\\";\\nimport { LibOracle } from \\\"./LibOracle.sol\\\";\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\nimport { LibDiamond } from \\\"./LibDiamond.sol\\\";\\nimport { LibWhitelist } from \\\"./LibWhitelist.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibSetters\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibSetters` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibSetters.sol\\nlibrary LibSetters {\\n using SafeCast for uint256;\\n\\n event CollateralAdded(address indexed collateral);\\n event CollateralManagerSet(address indexed collateral, ManagerStorage managerData);\\n event CollateralRevoked(address indexed collateral);\\n event CollateralWhitelistStatusUpdated(address indexed collateral, bytes whitelistData, uint8 whitelistStatus);\\n event FeesSet(address indexed collateral, uint64[] xFee, int64[] yFee, bool mint);\\n event OracleSet(address indexed collateral, bytes oracleConfig);\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n event PauseToggled(address indexed collateral, uint256 pausedType, bool isPaused);\\n event RedemptionCurveParamsSet(uint64[] xFee, int64[] yFee);\\n event ReservesAdjusted(address indexed collateral, uint256 amount, bool increase);\\n event StablecoinCapSet(address indexed collateral, uint256 stablecoinCap);\\n event TrustedToggled(address indexed sender, bool isTrusted, TrustedType trustedType);\\n event WhitelistStatusToggled(WhitelistType whitelistType, address indexed who, uint256 whitelistStatus);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ONLY GOVERNOR ACTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of `setAccessManager`\\n function setAccessManager(IAccessManager _newAccessManager) internal {\\n if (address(_newAccessManager).code.length == 0) revert InvalidAccessManager();\\n DiamondStorage storage ds = s.diamondStorage();\\n address previousAccessManager = address(ds.accessManager);\\n ds.accessManager = _newAccessManager;\\n emit OwnershipTransferred(previousAccessManager, address(_newAccessManager));\\n }\\n\\n /// @notice Internal version of `setCollateralManager`\\n function setCollateralManager(\\n address collateral,\\n bool checkExternalManagerBalance,\\n ManagerStorage memory managerData\\n )\\n internal\\n {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n uint8 isManaged = collatInfo.isManaged;\\n if (isManaged > 0 && checkExternalManagerBalance) {\\n (, uint256 totalValue) = LibManager.totalAssets(collatInfo.managerData.config);\\n if (totalValue > 0) revert ManagerHasAssets();\\n }\\n if (managerData.config.length != 0) {\\n // The first subCollateral given should be the actual collateral asset\\n if (address(managerData.subCollaterals[0]) != collateral) revert InvalidParams();\\n // Sanity check on the manager data that is passed\\n LibManager.parseManagerConfig(managerData.config);\\n collatInfo.isManaged = 1;\\n } else {\\n collatInfo.isManaged = 0;\\n }\\n collatInfo.managerData = managerData;\\n emit CollateralManagerSet(collateral, managerData);\\n }\\n\\n /// @notice Internal version of `toggleTrusted`\\n function toggleTrusted(address sender, TrustedType t) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint256 trustedStatus;\\n if (t == TrustedType.Updater) {\\n trustedStatus = 1 - ts.isTrusted[sender];\\n ts.isTrusted[sender] = trustedStatus;\\n } else {\\n trustedStatus = 1 - ts.isSellerTrusted[sender];\\n ts.isSellerTrusted[sender] = trustedStatus;\\n }\\n emit TrustedToggled(sender, trustedStatus == 1, t);\\n }\\n\\n /// @notice Internal version of `addCollateral`\\n function addCollateral(address collateral) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals != 0) revert AlreadyAdded();\\n collatInfo.decimals = uint8(IERC20Metadata(collateral).decimals());\\n ts.collateralList.push(collateral);\\n emit CollateralAdded(collateral);\\n }\\n\\n /// @notice Internal version of `adjustStablecoins`\\n function adjustStablecoins(address collateral, uint128 amount, bool increase) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n uint128 normalizedAmount = ((amount * BASE_27) / ts.normalizer).toUint128();\\n if (increase) {\\n collatInfo.normalizedStables = collatInfo.normalizedStables + uint216(normalizedAmount);\\n ts.normalizedStables = ts.normalizedStables + normalizedAmount;\\n } else {\\n collatInfo.normalizedStables = collatInfo.normalizedStables - uint216(normalizedAmount);\\n ts.normalizedStables = ts.normalizedStables - normalizedAmount;\\n }\\n emit ReservesAdjusted(collateral, amount, increase);\\n }\\n\\n /// @notice Internal version of `revokeCollateral`\\n function revokeCollateral(address collateral, bool checkExternalManagerBalance) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n if (collatInfo.normalizedStables > 0) revert CollateralBacked();\\n uint8 isManaged = collatInfo.isManaged;\\n if (isManaged > 0 && checkExternalManagerBalance) {\\n (, uint256 totalValue) = LibManager.totalAssets(collatInfo.managerData.config);\\n if (totalValue > 0) revert ManagerHasAssets();\\n }\\n delete ts.collaterals[collateral];\\n address[] memory collateralListMem = ts.collateralList;\\n uint256 length = collateralListMem.length;\\n for (uint256 i; i < length - 1; ++i) {\\n if (collateralListMem[i] == collateral) {\\n ts.collateralList[i] = collateralListMem[length - 1];\\n break;\\n }\\n }\\n ts.collateralList.pop();\\n emit CollateralRevoked(collateral);\\n }\\n\\n /// @notice Internal version of `setOracle`\\n function setOracle(address collateral, bytes memory oracleConfig) internal {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n // Checks oracle validity\\n LibOracle.readMint(oracleConfig);\\n collatInfo.oracleConfig = oracleConfig;\\n emit OracleSet(collateral, oracleConfig);\\n }\\n\\n /// @notice Internal version of `setWhitelistStatus`\\n function setWhitelistStatus(address collateral, uint8 whitelistStatus, bytes memory whitelistData) internal {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n if (whitelistStatus == 1) {\\n // Sanity check\\n LibWhitelist.checkWhitelist(whitelistData, address(this));\\n collatInfo.whitelistData = whitelistData;\\n } else {\\n // If whitelist is revoked, clear the whitelist data\\n collatInfo.whitelistData = \\\"\\\";\\n }\\n collatInfo.onlyWhitelisted = whitelistStatus;\\n emit CollateralWhitelistStatusUpdated(collateral, collatInfo.whitelistData, whitelistStatus);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ONLY GUARDIAN ACTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of `togglePause`\\n function togglePause(address collateral, ActionType action) internal {\\n uint8 isLive;\\n if (action == ActionType.Mint || action == ActionType.Burn) {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n if (action == ActionType.Mint) {\\n isLive = 1 - collatInfo.isMintLive;\\n collatInfo.isMintLive = isLive;\\n } else {\\n isLive = 1 - collatInfo.isBurnLive;\\n collatInfo.isBurnLive = isLive;\\n }\\n } else {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n isLive = 1 - ts.isRedemptionLive;\\n ts.isRedemptionLive = isLive;\\n }\\n emit PauseToggled(collateral, uint256(action), isLive == 0);\\n }\\n\\n /// @notice Internal version of `setFees`\\n function setFees(address collateral, uint64[] memory xFee, int64[] memory yFee, bool mint) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n checkFees(xFee, yFee, mint ? ActionType.Mint : ActionType.Burn);\\n if (mint) {\\n collatInfo.xFeeMint = xFee;\\n collatInfo.yFeeMint = yFee;\\n } else {\\n collatInfo.xFeeBurn = xFee;\\n collatInfo.yFeeBurn = yFee;\\n }\\n emit FeesSet(collateral, xFee, yFee, mint);\\n }\\n\\n /// @notice Internal version of `setRedemptionCurveParams`\\n function setRedemptionCurveParams(uint64[] memory xFee, int64[] memory yFee) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n LibSetters.checkFees(xFee, yFee, ActionType.Redeem);\\n ts.xRedemptionCurve = xFee;\\n ts.yRedemptionCurve = yFee;\\n emit RedemptionCurveParamsSet(xFee, yFee);\\n }\\n\\n /// @notice Internal version of `toggleWhitelist`\\n function toggleWhitelist(WhitelistType whitelistType, address who) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint256 whitelistStatus = 1 - ts.isWhitelistedForType[whitelistType][who];\\n ts.isWhitelistedForType[whitelistType][who] = whitelistStatus;\\n emit WhitelistStatusToggled(whitelistType, who, whitelistStatus);\\n }\\n\\n /// @notice Sets the stablecoin cap that can be issued from a collateral\\n function setStablecoinCap(address collateral, uint256 stablecoinCap) internal {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n collatInfo.stablecoinCap = stablecoinCap;\\n emit StablecoinCapSet(collateral, stablecoinCap);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Checks the fee values given for the `mint`, `burn`, and `redeem` functions\\n function checkFees(uint64[] memory xFee, int64[] memory yFee, ActionType action) internal view {\\n uint256 n = xFee.length;\\n if (n != yFee.length || n == 0) revert InvalidParams();\\n if (\\n // Mint inflexion points should be in [0,BASE_9[\\n // We have: amountPostFee * (BASE_9 + yFeeMint) = amountPreFee * BASE_9\\n // Hence we consider BASE_12 as the max value (100% fees) for yFeeMint\\n // Burn inflexion points should be in [0,BASE_9] but fees should be constant in\\n // the first segment [BASE_9, x_{n-1}[\\n // Redemption inflexion points should be in [0,BASE_9]\\n (action == ActionType.Mint && (xFee[n - 1] >= BASE_9 || xFee[0] != 0 || yFee[n - 1] > int256(BASE_12)))\\n || (\\n action == ActionType.Burn\\n && (xFee[0] != BASE_9 || yFee[n - 1] > int256(BASE_9) || (n > 1 && (yFee[0] != yFee[1])))\\n ) || (action == ActionType.Redeem && (xFee[n - 1] > BASE_9 || yFee[n - 1] < 0 || yFee[n - 1] > int256(BASE_9)))\\n ) {\\n revert InvalidParams();\\n }\\n\\n for (uint256 i; i < n - 1; ++i) {\\n if (\\n // xFee strictly increasing and yFee increasing for mints\\n // xFee strictly decreasing and yFee increasing for burns\\n // xFee strictly increasing and yFee should be in [0,BASE_9] for redemptions\\n (action == ActionType.Mint && (xFee[i] >= xFee[i + 1] || (yFee[i + 1] < yFee[i])))\\n || (action == ActionType.Burn && (xFee[i] <= xFee[i + 1] || (yFee[i + 1] < yFee[i])))\\n || (action == ActionType.Redeem && (xFee[i] >= xFee[i + 1] || yFee[i] < 0 || yFee[i] > int256(BASE_9)))\\n ) revert InvalidParams();\\n }\\n\\n // If a mint or burn fee is negative, we need to check that accounts atomically minting\\n // (from any collateral) and then burning cannot get more than their initial value\\n if (yFee[0] < 0) {\\n if (!LibDiamond.isGovernor(msg.sender)) revert NotGovernor(); // Only governor can set negative fees\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n address[] memory collateralListMem = ts.collateralList;\\n uint256 length = collateralListMem.length;\\n if (action == ActionType.Mint) {\\n // This can be mathematically expressed by `(1-min_c(burnFee_c))<=(1+mintFee[0])`\\n for (uint256 i; i < length; ++i) {\\n int64[] memory burnFees = ts.collaterals[collateralListMem[i]].yFeeBurn;\\n if (burnFees[0] + yFee[0] < 0) revert InvalidNegativeFees();\\n }\\n }\\n if (action == ActionType.Burn) {\\n // This can be mathematically expressed by `(1-burnFee[0])<=(1+min_c(mintFee_c))`\\n for (uint256 i; i < length; ++i) {\\n int64[] memory mintFees = ts.collaterals[collateralListMem[i]].yFeeMint;\\n if (yFee[0] + mintFees[0] < 0) revert InvalidNegativeFees();\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x82116bafaf14b59de009ab43fc4489a478cd78f150fa60a1f9f89c2b93173471\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibStorage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport { DiamondStorage, ImplementationStorage, ParallelizerStorage } from \\\"../Storage.sol\\\";\\n\\n/// @title LibStorage\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibStorage` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibStorage.sol\\nlibrary LibStorage {\\n /// @notice Returns the storage struct stored at the `DIAMOND_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic of the different facets used in the diamond proxy\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ds.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `TRANSMUTER_STORAGE_POSITION` slot\\n /// @dev This struct handles the particular logic of the Parallelizer system\\n function transmuterStorage() internal pure returns (ParallelizerStorage storage ts) {\\n bytes32 position = TRANSMUTER_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ts.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `IMPLEMENTATION_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic for making the contract easily usable on Etherscan\\n function implementationStorage() internal pure returns (ImplementationStorage storage ims) {\\n bytes32 position = IMPLEMENTATION_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ims.slot := position\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf8c333898ca14d3e8696c232f669a839dddbf705a609a1b0795ecc6b8f1b2d73\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibWhitelist.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IKeyringGuard } from \\\"contracts/interfaces/external/keyring/IKeyringGuard.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibWhitelist\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibWhitelist` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibWhitelist.sol\\nlibrary LibWhitelist {\\n /// @notice Checks whether `sender` is whitelisted for a collateral with `whitelistData`\\n function checkWhitelist(bytes memory whitelistData, address sender) internal returns (bool) {\\n (WhitelistType whitelistType, bytes memory data) = abi.decode(whitelistData, (WhitelistType, bytes));\\n if (s.transmuterStorage().isWhitelistedForType[whitelistType][sender] > 0) return true;\\n if (data.length != 0) {\\n if (whitelistType == WhitelistType.BACKED) {\\n address keyringGuard = abi.decode(data, (address));\\n if (keyringGuard != address(0)) return IKeyringGuard(keyringGuard).isAuthorized(address(this), sender);\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x72595e0b49dfce76ba70d9f69af54ffbc84650c8c696caa20f858ef2438d94b5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ICbETH } from \\\"contracts/interfaces/external/coinbase/ICbETH.sol\\\";\\nimport { ISfrxETH } from \\\"contracts/interfaces/external/frax/ISfrxETH.sol\\\";\\nimport { IStETH } from \\\"contracts/interfaces/external/lido/IStETH.sol\\\";\\nimport { IRETH } from \\\"contracts/interfaces/external/rocketPool/IRETH.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STORAGE SLOTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n/// @dev Storage position of `DiamondStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.diamond.storage\\\") - 1`\\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\\n\\n/// @dev Storage position of `ParallelizerStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.parallelizer.storage\\\") - 1`\\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\\n\\n/// @dev Storage position of `ImplementationStorage` structure\\n/// @dev Equals `keccak256(\\\"eip1967.proxy.implementation\\\") - 1`\\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MATHS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nuint256 constant BASE_6 = 1e6;\\nuint256 constant BASE_8 = 1e8;\\nuint256 constant BASE_9 = 1e9;\\nuint256 constant BASE_12 = 1e12;\\nuint256 constant BPS = 1e14;\\nuint256 constant BASE_18 = 1e18;\\nuint256 constant HALF_BASE_27 = 1e27 / 2;\\nuint256 constant BASE_27 = 1e27;\\nuint256 constant BASE_36 = 1e36;\\nuint256 constant MAX_BURN_FEE = 999_000_000;\\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// The values being non-zero value makes deployment a bit more expensive,\\n// but in exchange the refund on every call to nonReentrant will be lower in\\n// amount. Since refunds are capped to a percentage of the total\\n// transaction's gas, it is best to keep them low in cases like this one, to\\n// increase the likelihood of the full refund coming into effect.\\nuint8 constant NOT_ENTERED = 1;\\nuint8 constant ENTERED = 2;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// Role IDs for the AccessManager\\nuint64 constant GOVERNOR_ROLE = 10;\\nuint64 constant GUARDIAN_ROLE = 20;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n COMMON ADDRESSES \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\\n\",\"keccak256\":\"0x3306bdd0d4e4f364e0d35893a7ffb59c8eb9e94a5bd861f58b8d7ba8a7b336e5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nerror AccessManagedUnauthorized(address caller);\\nerror AlreadyAdded();\\nerror CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);\\nerror CannotAddSelectorsToZeroAddress(bytes4[] _selectors);\\nerror CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);\\nerror CannotRemoveImmutableFunction(bytes4 _selector);\\nerror CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);\\nerror CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);\\nerror CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);\\nerror CannotReplaceImmutableFunction(bytes4 _selector);\\nerror ContractHasNoCode();\\nerror CollateralBacked();\\nerror FunctionNotFound(bytes4 _functionSelector);\\nerror IncorrectFacetCutAction(uint8 _action);\\nerror InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);\\nerror InvalidChainlinkRate();\\nerror InvalidLengths();\\nerror InvalidNegativeFees();\\nerror InvalidOracleType();\\nerror InvalidParam();\\nerror InvalidParams();\\nerror InvalidRate();\\nerror InvalidSwap();\\nerror InvalidTokens();\\nerror InvalidAccessManager();\\nerror ManagerHasAssets();\\nerror NoSelectorsProvidedForFacetForCut(address _facetAddress);\\nerror NotAllowed();\\nerror NotCollateral();\\nerror NotGovernor();\\nerror NotGuardian();\\nerror NotTrusted();\\nerror NotTrustedOrGuardian();\\nerror NotWhitelisted();\\nerror OdosSwapFailed();\\nerror OracleUpdateFailed();\\nerror Paused();\\nerror ReentrantCall();\\nerror RemoveFacetAddressMustBeZeroAddress(address _facetAddress);\\nerror TooBigAmountIn();\\nerror TooLate();\\nerror TooSmallAmountOut();\\nerror ZeroAddress();\\nerror ZeroAmount();\\nerror SwapError();\\nerror SlippageTooHigh();\\nerror InsufficientFunds();\\n\",\"keccak256\":\"0x1e2f6812ef78e948e5155d32213b52afff8c0ba5463d18bee10694efbf886130\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x6080806040523460155761323c908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f5f3560e01c6377dabb7b14610025575f80fd5b34611a1c576080366003190112611a1c576004356001600160a01b038116809103611a1c576024356001600160a01b038116809103611a1c57604435906001600160401b038211611a1c5736602383011215611a1c57816004013561008981611ba6565b926100976040519485611b85565b8184526024602085019260051b82010190368211611a1c5760248101925b828410611a205750505050606435926001600160401b038411611a1c5760406003198536030112611a1c5760405193604085018581106001600160401b038211176116205760405280600401356001600160401b038111611a1c576101209060043691840101611bd8565b85526024810135906001600160401b038211611a1c5760046101459236920101611c46565b6020850152803b156119f4576001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54168173ffffffffffffffffffffffffffffffffffffffff197fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d5416177fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a37f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7580547f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7680546fffffffffffffffffffffffffffffffff167b033b2e3c9fd0803ce8000000000000000000000000000000000000001790557fffffffffffffffffffff00ff00000000000000000000000000000000000000001691909117750100000000000000000000000000000000000000000017905580515f915b818310610be6575050508051516102cf575080f35b90808015610b4c5750610312816001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b80549060ff8260181c1615610b3d5782610b29575f809161033860ff8560101c16611ddc565b9362ff00008560101b169062ff000019161790555b6104a157507f3da495aea17ab24773f3161f4707961a797e39147ce4f8a8fbac0309a4a2d2e46040839260ff8251916002835216156020820152a2602082519201519180519280518414801590610b21575b610b12578283848015610a56575b50610a47575f198501948511948491865b610a3357818310156104b557806104a157508491858680156103f9575b506103ea5760010191866103be565b600486635435b28960e11b8152fd5b905061048d5760016001600160401b036104138388611ccf565b5116908201808311610479576104316001600160401b039188611ccf565b511611801590610463575b8015610449575b866103db565b50633b9aca006104598286611ccf565b5160070b13610443565b508561046f8286611ccf565b5160070b1261043c565b602488634e487b7160e01b81526011600452fd5b602486634e487b7160e01b81526021600452fd5b80634e487b7160e01b602492526021600452fd5b9295505050806104c485611cae565b5160070b126108c8575b5080516001600160401b0381116107c457600160401b81116107c4577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7854817f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7855808210610875575b5060208201907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c788452602084208160021c91855b838110610830575060031981169003806107d8575b505050508251926001600160401b0384116107c457600160401b84116107c4577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7954847f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795580851061074f575b5060208101937f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c798452602084208160021c91855b83811061070a5750600319811690038061068d575b5050507fdd1690e851f57f138700d42b0a081b3b1b9a97dd2cb2aabc25c92658736290649293509061068761067992604051938493604085526040850190611d6a565b908382036020850152611da6565b0390a180f35b958596865b8181106106d257505050019390935590918291906106876106797fdd1690e851f57f138700d42b0a081b3b1b9a97dd2cb2aabc25c9265873629064610636565b90919760206107006001928b5160070b908560031b6001600160401b03809160031b9316831b921b19161790565b9901929101610692565b86875b60048110610722575083820155600101610621565b89519099916001916020916001600160401b0360068e901b81811b199092169216901b179201990161070d565b61079d907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c79855260208520600380880160021c820192601889831b16806107a3575b500160021c0190611cf1565b5f6105ed565b6107be905f198601908154905f199060200360031b1c169055565b5f610791565b602483634e487b7160e01b81526041600452fd5b928593865b8181106107f25750505001555f808080610580565b90919460206108266001926001600160401b03895116908560031b6001600160401b03809160031b9316831b921b19161790565b96019291016107dd565b86875b6004811061084857508382015560010161056b565b86519096916001916020916001600160401b0360068b901b81811b199092169216901b1792019601610833565b6108c2907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c78855260208520600380850160021c820192601886831b16806107a357500160021c0190611cf1565b5f610537565b604460406001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54168151928380926368fc2b7760e11b8252600a60048301523360248301525afa908115610a285782916109d6575b50156109c757806040518060207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77549182815201907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7784526020842090845b8181106109a557505050908061099a920390611b85565b6104a15750816104ce565b82546001600160a01b0316845286955060209093019260019283019201610983565b80633b8d9d7560e21b60049252fd5b90506040813d604011610a20575b816109f160409383611b85565b81010312610a1c578051908115158203610a18576020610a11910161283e565b505f610924565b8280fd5b5080fd5b3d91506109e4565b6040513d84823e3d90fd5b80634e487b7160e01b602492526011600452fd5b600484635435b28960e11b8152fd5b9050610afe575f1985018581119081610aea57633b9aca006001600160401b03610a808388611ccf565b511611918215610ad0575b8215610a9a575b5050846103ad565b909150610abc57610ab0633b9aca009184611ccf565b5160070b135f80610a92565b602485634e487b7160e01b81526011600452fd5b5085915081610adf8286611ccf565b5160070b1291610a8b565b602486634e487b7160e01b81526011600452fd5b602484634e487b7160e01b81526021600452fd5b600483635435b28960e11b8152fd5b50831561039f565b602483634e487b7160e01b81526021600452fd5b600483630dcfc57f60e21b8152fd5b7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75549080610b7f60ff8460a01c16611ddc565b927fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff00000000000000000000000000000000000000008560a01b169116177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755561034d565b909193610bf38583611ccf565b5180516001600160a01b03165f8181527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260409020805460ff8160181c166119cc576040517f313ce567000000000000000000000000000000000000000000000000000000008152602081600481875afa80156119c1578690611981575b63ff000000915060181b169063ff00000019161790557f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7754600160401b81101561196d5760018101807f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7755811015611959577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7784527f83745245930c5ea665f7d67c93434aa3e54c73e6ed3f6f245cc3d5c311286bfa01805473ffffffffffffffffffffffffffffffffffffffff1916821790557f7db05e63d635a68c62fd7fd8f3107ae8ab584a383e102d1bd8a40f4c977e465f8380a26001600160a01b038151166020820151610db6826001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460181c161561194a57600590610dcf83611e0a565b500181516001600160401b0381116113b6578154600181811c91168015611940575b602082101461192c57601f81116118f1575b506020601f821160011461186b5792602092826040937fba11329c0b0f98b91c254755aa8d698feac3b46fab65b65fe5ab7570de2ff928968a91611860575b508160011b915f199060031b1c19161790555b815192839181835280519182918282860152018484015e8181018301889052601f01601f19168101030190a26001600160a01b0381511660408201516060830151610ed0836001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460181c161561185157610ee886838561205f565b8251600182016001600160401b03821161183d57600160401b821161183d57610f1682825481845583611d2e565b60208501908852602088208260021c91895b8381106117f857506003198416909303928361179f575b505050506002018151906001600160401b03821161146f57600160401b821161146f57610f7182825481845583611d2e565b60208301908752602087208260021c91885b83811061175a5750600319841690930392836116e4575b505050507f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad91610fdb61067992604051938493606085526060850190611d6a565b600160408301520390a26001600160a01b038151169160808201519260a083015193611037826001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b9460ff865460181c16156116d55760019561105387838561205f565b84156114835786810183516001600160401b03811161146f57600160401b811161146f5761108681835481855584611d2e565b602085019187526020872090875b8160021c811061142b57506003198116810392836113ca575b505050506002018151906001600160401b0382116113b657600160401b82116113b6576110df82825481845583611d2e565b60208301908652602086208260021c91875b8381106113725750600319841690930392836112fb575b505050507f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad9161114a610679925b604051938493606085526060850190611d6a565b8560408301520390a26001600160a01b0382511690611199826001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b9060ff825460181c16156112ec57806104a157808254926111bf60ff8560081c16611ddc565b9361ff008560081b169061ff0019161790556104a15750907f3da495aea17ab24773f3161f4707961a797e39147ce4f8a8fbac0309a4a2d2e460406001600160a01b03949360ff8251915f835216156020820152a2511694611251866001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b9586549260ff8460181c16156112dd575f809861127360ff8760101c16611ddc565b9562ff00008760101b169062ff000019161790556112c95760407f3da495aea17ab24773f3161f4707961a797e39147ce4f8a8fbac0309a4a2d2e49160ff600196835192835216156020820152a20191906102ba565b634e487b7160e01b5f52602160045260245ffd5b630dcfc57f60e21b5f5260045ffd5b80630dcfc57f60e21b60049252fd5b879388905b8b81831061133b575050505001558161114a6106797f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad611108565b90919295611368602091885160070b908660031b6001600160401b03809160031b9316831b921b19161790565b9601920190611300565b8a90898a5b6004811061138a575081850155016110f1565b84516020909501948e946001600160401b03918216600684901b90811b92901b19909316179101611377565b602486634e487b7160e01b81526041600452fd5b889389905b8c8183106113ee5750505050906002939291841c0155905f80806110ad565b909192956114216020916001600160401b03895116908660031b6001600160401b03809160031b9316831b921b19161790565b96019201906113cf565b8a90898a5b6004811061144357508185015501611094565b86516020909701968e946001600160401b03918216600684901b90811b92901b19909316179101611430565b602487634e487b7160e01b81526041600452fd5b6003810183516001600160401b03811161162057600160401b8111611620576114b181835481855584611d2e565b60208501915f5260205f20905f5b8160021c81106116915750600319811681039283611634575b505050506004018151906001600160401b03821161162057600160401b82116116205761150a82825481845583611d2e565b60208301905f5260205f208260021c915f5b8381106115dc575060031984169093039283611565575b505050507f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad9161114a61067992611136565b5f935f905b8b8183106115a5575050505001558161114a6106797f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad611533565b909192956115d2602091885160070b908660031b6001600160401b03809160031b9316831b921b19161790565b960192019061156a565b8a905f5f5b600481106115f45750818501550161151c565b84516020909501948e946001600160401b03918216600684901b90811b92901b199093161791016115e1565b634e487b7160e01b5f52604160045260245ffd5b5f935f905b8c818310611654575050505060021c015560045f80806114d8565b909192956116876020916001600160401b03895116908660031b6001600160401b03809160031b9316831b921b19161790565b9601920190611639565b8a905f5f5b600481106116a9575081850155016114bf565b86516020909701968e946001600160401b03918216600684901b90811b92901b19909316179101611696565b600484630dcfc57f60e21b8152fd5b889389905b80821061172257505050015581610fdb6106797f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad610f9a565b9091946020611750600192885160070b908660031b6001600160401b03809160031b9316831b921b19161790565b96019201906116e9565b898a5b60048110611772575083820155600101610f83565b83519093916001916020916001600160401b03600688901b81811b199092169216901b179201930161175d565b89938a905b8082106117ba57505050015560025f8080610f3f565b90919460206117ee6001926001600160401b03895116908660031b6001600160401b03809160031b9316831b921b19161790565b96019201906117a4565b8a8b5b60048110611810575083820155600101610f28565b83519093916001916020916001600160401b03600688901b81811b199092169216901b17920193016117fb565b602488634e487b7160e01b81526041600452fd5b600486630dcfc57f60e21b8152fd5b90508301515f610e42565b82875280872090601f198316885b8181106118d95750837fba11329c0b0f98b91c254755aa8d698feac3b46fab65b65fe5ab7570de2ff928969360209693604096600194106118c1575b5050811b019055610e55565b8501515f1960f88460031b161c191690555f806118b5565b9192602060018192868a015181550194019201611879565b61191c9083885260208820601f840160051c81019160208510611922575b601f0160051c0190611cf1565b5f610e03565b909150819061190f565b602487634e487b7160e01b81526022600452fd5b90607f1690610df1565b600485630dcfc57f60e21b8152fd5b602484634e487b7160e01b81526032600452fd5b602484634e487b7160e01b81526041600452fd5b506020813d82116119b9575b8161199a60209383611b85565b810103126119b5576119b063ff00000091611ce3565b610c74565b8580fd5b3d915061198d565b6040513d88823e3d90fd5b6004857ff411c327000000000000000000000000000000000000000000000000000000008152fd5b7fa98154e2000000000000000000000000000000000000000000000000000000005f5260045ffd5b5f80fd5b83356001600160401b038111611a1c57820160c06023198236030112611a1c576040519160c083018381106001600160401b038211176116205760405260248201356001600160a01b0381168103611a1c57835260448201356001600160401b038111611a1c5760249083010136601f82011215611a1c578035611aa381611bbd565b91611ab16040519384611b85565b8183523660208383010111611a1c57815f9260208093018386013783010152602084015260648201356001600160401b038111611a1c57611af89060243691850101611bd8565b604084015260848201356001600160401b038111611a1c57611b209060243691850101611c46565b606084015260a48201356001600160401b038111611a1c57611b489060243691850101611bd8565b608084015260c4820135926001600160401b038411611a1c57611b75602094936024869536920101611c46565b60a08201528152019301926100b5565b90601f801991011681019081106001600160401b0382111761162057604052565b6001600160401b0381116116205760051b60200190565b6001600160401b03811161162057601f01601f191660200190565b9080601f83011215611a1c57813590611bf082611ba6565b92611bfe6040519485611b85565b82845260208085019360051b820101918211611a1c57602001915b818310611c265750505090565b82356001600160401b0381168103611a1c57815260209283019201611c19565b9080601f83011215611a1c57813590611c5e82611ba6565b92611c6c6040519485611b85565b82845260208085019360051b820101918211611a1c57602001915b818310611c945750505090565b82358060070b8103611a1c57815260209283019201611c87565b805115611cbb5760200190565b634e487b7160e01b5f52603260045260245ffd5b8051821015611cbb5760209160051b010190565b519060ff82168203611a1c57565b818110611cfc575050565b5f8155600101611cf1565b81810292918115918404141715611d1a57565b634e487b7160e01b5f52601160045260245ffd5b9190808210611d3c57505050565b611d68925f52600360205f2091601882850160021c840194831b16806107a357500160021c0190611cf1565b565b90602080835192838152019201905f5b818110611d875750505090565b82516001600160401b0316845260209384019390920191600101611d7a565b90602080835192838152019201905f5b818110611dc35750505090565b825160070b845260209384019390920191600101611db6565b60ff166001039060ff8211611d1a57565b51906fffffffffffffffffffffffffffffffff82168203611a1c57565b908151820160a08360208301920312611a1c57602083015190600a821015611a1c57604084015193600a851015611a1c5760608101516001600160401b038111611a1c57826020611e5d928401016127f8565b9060808101516001600160401b038111611a1c57836020611e80928401016127f8565b9260a0820151916001600160401b038311611a1c57611ea292016020016127f8565b60018414611f9157604081805181010312611a1c57611ef7926fffffffffffffffffffffffffffffffff82611ee86040611ee16020611ef09701611ded565b9201611ded565b5016966128d2565b8093612ceb565b9280670de0b6b3a764000003670de0b6b3a76400008111611d1a57611f1c9083611d07565b670de0b6b3a7640000850290858204670de0b6b3a76400001486151715611d1a5781119182611f63575b5050611f5b575b828110611f575750565b9150565b915081611f4d565b909150670de0b6b3a76400000180670de0b6b3a764000011611d1a57611f899083611d07565b115f80611f46565b5080939450602092508091505181010312611a1c57602001516001600160a01b038116809103611a1c576020600491604051928380927f5ade93550000000000000000000000000000000000000000000000000000000082525afa90811561202c575f91611ffd575090565b90506020813d602011612024575b8161201860209383611b85565b81010312611a1c575190565b3d915061200b565b6040513d5f823e3d90fd5b9060070b9060070b0190677fffffffffffffff198212677fffffffffffffff831317611d1a57565b90929192815193815185148015906127f0575b6120de576003811015806112c957811594858061277a575b80156126e9575b828115612659575b506120de575f198701968711965f885b611d1a578181101561225557836112c95787806121ec575b8015612175575b8481156120ed575b506120de57600101886120a9565b635435b28960e11b5f5260045ffd5b90506112c9576002851480612103575b846120d0565b506001600160401b036121168289611ccf565b511660018201808311611d1a576121356001600160401b03918a611ccf565b51161180159061215f575b806120fd5750633b9aca006121558288611ccf565b5160070b136120fd565b505f61216b8288611ccf565b5160070b12612140565b505f93506001851480156120c857506001600160401b036121968289611ccf565b51166001820190818311611d1a576001600160401b036121b6838b611ccf565b511610908115916121c8575b506120c8565b6121d3915087611ccf565b5160070b6121e18288611ccf565b5160070b135f6121c2565b506001600160401b036121ff8289611ccf565b51166001820190818311611d1a576001600160401b0361221f838b611ccf565b51161190811591612231575b506120c1565b61223c915087611ccf565b5160070b61224a8288611ccf565b5160070b135f61222b565b5050955092509290925f61226885611cae565b5160070b12612278575b50505050565b604460406001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54168151928380926368fc2b7760e11b8252600a60048301523360248301525afa90811561202c575f9161260f575b50156126005760405191828360207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775492838152017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f20925f5b8181106125de57505061234892500384611b85565b8251936112c957612501575b600114612362575b80612272565b5f5b828110612371575061235c565b60026123c06001600160a01b036123888486611ccf565b51166001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b016040519081602082549182815201915f5260205f20905f915b8160038401106124c45793612439938193612419935f9754918181106124b0575b818110612499575b818110612482575b10612471575b500382611b85565b61242f61242588611cae565b5160070b91611cae565b5160070b90612037565b60070b1261244957600101612364565b7f11336121000000000000000000000000000000000000000000000000000000005f5260045ffd5b60c01d60070b81526020015f612411565b9260206001918460801c60070b815201930161240b565b9260206001918460401c60070b8152019301612403565b9260206001918460070b81520193016123fb565b926001608060049286548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b60608201520194019201916123da565b5f5b8381106125105750612354565b60046125276001600160a01b036123888487611ccf565b016040519081602082549182815201915f5260205f20905f915b8160038401106125a1578461259194612584945f979461257f9454918181106124b05781811061249957818110612482571061247157500382611b85565b611cae565b5160070b61242f88611cae565b60070b1261244957600101612503565b926001608060049286548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b6060820152019401920191612541565b84546001600160a01b0316835260019485019488945060209093019201612333565b633b8d9d7560e21b5f5260045ffd5b90506040813d604011612651575b8161262a60409383611b85565b81010312611a1c578051908115158203611a1c57602061264a910161283e565b505f6122d4565b3d915061261d565b90506112c957600283148061266f575b82612099565b505f1987018781119081611d1a57633b9aca006001600160401b03612694838a611ccf565b5116119182156126cf575b82156126ad575b5050612669565b909150611d1a576126c3633b9aca009186611ccf565b5160070b135f806126a6565b505f9150816126de8288611ccf565b5160070b129161269f565b505f915060018314806126fc575b612091565b50633b9aca006001600160401b0361271387611cae565b511614801590612755575b8061209157506001871180156126f7575061273884611cae565b5160070b845160011015611cbb57604085015160070b1415612091565b505f198701878111611d1a57612770633b9aca009186611ccf565b5160070b1361271e565b505f198701878111611d1a57633b9aca006001600160401b0361279d8389611ccf565b511610908115916127d3575b81156127b6575b5061208a565b64e8d4a5100091506127c89086611ccf565b5160070b135f6127b0565b90506001600160401b036127e687611cae565b51161515906127a9565b508415612072565b81601f82011215611a1c5780519061280f82611bbd565b9261281d6040519485611b85565b82845260208383010111611a1c57815f9260208093018386015e8301015290565b519063ffffffff82168203611a1c57565b8115612859570490565b634e487b7160e01b5f52601260045260245ffd5b9080601f83011215611a1c57815161288481611ba6565b926128926040519485611b85565b81845260208085019260051b820101928311611a1c57602001905b8282106128ba5750505090565b602080916128c784611ce3565b8152019101906128ad565b600a8110156112c95780612ada575090815182019160a08160208501940312611a1c5760208101516001600160401b038111611a1c5781019280603f85011215611a1c57602084015161292481611ba6565b946129326040519687611b85565b8186526020808088019360051b8301010190838211611a1c57604001915b818310612aba5750505060408201516001600160401b038111611a1c57820181603f82011215611a1c5760208101519061298982611ba6565b916129976040519384611b85565b8083526020808085019260051b8401010191848311611a1c57604001905b828210612aa25750505060608301516001600160401b038111611a1c578260206129e19286010161286d565b9160808401516001600160401b038111611a1c5760a0916020612a069287010161286d565b9301516002811015611a1c57670de0b6b3a7640000612a2991969492959661308c565b938351915f935b838510612a405750505050505090565b90919293949695612a956001916001600160a01b03612a5f898c611ccf565b511660ff612a6d8a87611ccf565b511660ff612a7b8b89611ccf565b51169163ffffffff612a8d8c8b611ccf565b5116936130cb565b9697950193929190612a30565b60208091612aaf8461283e565b8152019101906129b5565b82516001600160a01b0381168103611a1c57815260209283019201612950565b60038103612af0575050670de0b6b3a764000090565b60028103612b06575050670de0b6b3a764000090565b60048103612b59575050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561202c575f91611ffd575090565b60058103612b9e575050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561202c575f91611ffd575090565b60068103612be35750506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561202c575f91611ffd575090565b60078103612c28575050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561202c575f91611ffd575090565b60088103612c49575060208151918180820193849201010312611a1c575190565b600903612cde57604081805181010312611a1c5760208101516001600160a01b038116809103611a1c57602060406004930151916040519384809263501ad8ff60e11b82525afa801561202c575f90612caa575b612ca7925061284f565b90565b506020823d602011612cd6575b81612cc460209383611b85565b81010312611a1c57612ca79151612c9d565b3d9150612cb7565b50670de0b6b3a764000090565b92919092600a8110156112c95780612eb857508051810160a08260208301920312611a1c5760208201516001600160401b038111611a1c5782019381603f86011215611a1c576020850151612d3f81611ba6565b95612d4d6040519788611b85565b8187526020808089019360051b8301010190848211611a1c57604001915b818310612e985750505060408301516001600160401b038111611a1c5783019082603f83011215611a1c57602082015191612da583611ba6565b92612db36040519485611b85565b8084526020808086019260051b8401010191858311611a1c57604001905b828210612e805750505060608401516001600160401b038111611a1c57836020612dfd9287010161286d565b9260808501516001600160401b038111611a1c5760a0916020612e229288010161286d565b940151906002821015611a1c57612e3d91969492959661308c565b938351915f935b838510612e545750505050505090565b90919293949695612e736001916001600160a01b03612a5f898c611ccf565b9697950193929190612e44565b60208091612e8d8461283e565b815201910190612dd1565b82516001600160a01b0381168103611a1c57815260209283019201612d6b565b9192909160038103612ed357505050670de0b6b3a764000090565b60028103612ee15750905090565b60048103612f3557505050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561202c575f91611ffd575090565b60058103612f7b57505050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561202c575f91611ffd575090565b60068103612fc1575050506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561202c575f91611ffd575090565b6007810361300757505050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561202c575f91611ffd575090565b6008810361302957505060208151918180820193849201010312611a1c575190565b6009036130875750604081805181010312611a1c5760208101516001600160a01b038116809103611a1c57602060406004930151916040519384809263501ad8ff60e11b82525afa801561202c575f90612caa57612ca7925061284f565b905090565b60028110156112c957612ca75750670de0b6b3a764000090565b519069ffffffffffffffffffff82168203611a1c57565b604d8111611d1a57600a0a90565b91909360a06001600160a01b0394956004604051809781937ffeaf968c000000000000000000000000000000000000000000000000000000008352165afa90811561202c575f945f926131b0575b505f851391821592613196575b505061316e5760ff1660010361315357613147612ca7939261314d92611d07565b916130bd565b9061284f565b61316990613163612ca7946130bd565b90611d07565b61284f565b7fae193563000000000000000000000000000000000000000000000000000000005f5260045ffd5b4290810392508211611d1a5763ffffffff16105f80613126565b9450905060a0843d60a0116131fe575b816131cd60a09383611b85565b81010312611a1c576131de846130a6565b5060208401516131f56080606087015196016130a6565b5093905f613119565b3d91506131c056fea264697066735822122011fe342fd5ac7da6ff1664e4d4eaa7adc90c36dab7984085d65dfe6b69ac19ca64736f6c634300081c0033", + "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f5f3560e01c6377dabb7b14610025575f80fd5b34611a1c576080366003190112611a1c576004356001600160a01b038116809103611a1c576024356001600160a01b038116809103611a1c57604435906001600160401b038211611a1c5736602383011215611a1c57816004013561008981611ba6565b926100976040519485611b85565b8184526024602085019260051b82010190368211611a1c5760248101925b828410611a205750505050606435926001600160401b038411611a1c5760406003198536030112611a1c5760405193604085018581106001600160401b038211176116205760405280600401356001600160401b038111611a1c576101209060043691840101611bd8565b85526024810135906001600160401b038211611a1c5760046101459236920101611c46565b6020850152803b156119f4576001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54168173ffffffffffffffffffffffffffffffffffffffff197fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d5416177fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a37f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7580547f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7680546fffffffffffffffffffffffffffffffff167b033b2e3c9fd0803ce8000000000000000000000000000000000000001790557fffffffffffffffffffff00ff00000000000000000000000000000000000000001691909117750100000000000000000000000000000000000000000017905580515f915b818310610be6575050508051516102cf575080f35b90808015610b4c5750610312816001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b80549060ff8260181c1615610b3d5782610b29575f809161033860ff8560101c16611ddc565b9362ff00008560101b169062ff000019161790555b6104a157507f3da495aea17ab24773f3161f4707961a797e39147ce4f8a8fbac0309a4a2d2e46040839260ff8251916002835216156020820152a2602082519201519180519280518414801590610b21575b610b12578283848015610a56575b50610a47575f198501948511948491865b610a3357818310156104b557806104a157508491858680156103f9575b506103ea5760010191866103be565b600486635435b28960e11b8152fd5b905061048d5760016001600160401b036104138388611ccf565b5116908201808311610479576104316001600160401b039188611ccf565b511611801590610463575b8015610449575b866103db565b50633b9aca006104598286611ccf565b5160070b13610443565b508561046f8286611ccf565b5160070b1261043c565b602488634e487b7160e01b81526011600452fd5b602486634e487b7160e01b81526021600452fd5b80634e487b7160e01b602492526021600452fd5b9295505050806104c485611cae565b5160070b126108c8575b5080516001600160401b0381116107c457600160401b81116107c4577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7854817f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7855808210610875575b5060208201907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c788452602084208160021c91855b838110610830575060031981169003806107d8575b505050508251926001600160401b0384116107c457600160401b84116107c4577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7954847f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795580851061074f575b5060208101937f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c798452602084208160021c91855b83811061070a5750600319811690038061068d575b5050507fdd1690e851f57f138700d42b0a081b3b1b9a97dd2cb2aabc25c92658736290649293509061068761067992604051938493604085526040850190611d6a565b908382036020850152611da6565b0390a180f35b958596865b8181106106d257505050019390935590918291906106876106797fdd1690e851f57f138700d42b0a081b3b1b9a97dd2cb2aabc25c9265873629064610636565b90919760206107006001928b5160070b908560031b6001600160401b03809160031b9316831b921b19161790565b9901929101610692565b86875b60048110610722575083820155600101610621565b89519099916001916020916001600160401b0360068e901b81811b199092169216901b179201990161070d565b61079d907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c79855260208520600380880160021c820192601889831b16806107a3575b500160021c0190611cf1565b5f6105ed565b6107be905f198601908154905f199060200360031b1c169055565b5f610791565b602483634e487b7160e01b81526041600452fd5b928593865b8181106107f25750505001555f808080610580565b90919460206108266001926001600160401b03895116908560031b6001600160401b03809160031b9316831b921b19161790565b96019291016107dd565b86875b6004811061084857508382015560010161056b565b86519096916001916020916001600160401b0360068b901b81811b199092169216901b1792019601610833565b6108c2907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c78855260208520600380850160021c820192601886831b16806107a357500160021c0190611cf1565b5f610537565b604460406001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54168151928380926368fc2b7760e11b8252600a60048301523360248301525afa908115610a285782916109d6575b50156109c757806040518060207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77549182815201907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7784526020842090845b8181106109a557505050908061099a920390611b85565b6104a15750816104ce565b82546001600160a01b0316845286955060209093019260019283019201610983565b80633b8d9d7560e21b60049252fd5b90506040813d604011610a20575b816109f160409383611b85565b81010312610a1c578051908115158203610a18576020610a11910161283e565b505f610924565b8280fd5b5080fd5b3d91506109e4565b6040513d84823e3d90fd5b80634e487b7160e01b602492526011600452fd5b600484635435b28960e11b8152fd5b9050610afe575f1985018581119081610aea57633b9aca006001600160401b03610a808388611ccf565b511611918215610ad0575b8215610a9a575b5050846103ad565b909150610abc57610ab0633b9aca009184611ccf565b5160070b135f80610a92565b602485634e487b7160e01b81526011600452fd5b5085915081610adf8286611ccf565b5160070b1291610a8b565b602486634e487b7160e01b81526011600452fd5b602484634e487b7160e01b81526021600452fd5b600483635435b28960e11b8152fd5b50831561039f565b602483634e487b7160e01b81526021600452fd5b600483630dcfc57f60e21b8152fd5b7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75549080610b7f60ff8460a01c16611ddc565b927fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff00000000000000000000000000000000000000008560a01b169116177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755561034d565b909193610bf38583611ccf565b5180516001600160a01b03165f8181527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260409020805460ff8160181c166119cc576040517f313ce567000000000000000000000000000000000000000000000000000000008152602081600481875afa80156119c1578690611981575b63ff000000915060181b169063ff00000019161790557f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7754600160401b81101561196d5760018101807f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7755811015611959577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7784527f83745245930c5ea665f7d67c93434aa3e54c73e6ed3f6f245cc3d5c311286bfa01805473ffffffffffffffffffffffffffffffffffffffff1916821790557f7db05e63d635a68c62fd7fd8f3107ae8ab584a383e102d1bd8a40f4c977e465f8380a26001600160a01b038151166020820151610db6826001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460181c161561194a57600590610dcf83611e0a565b500181516001600160401b0381116113b6578154600181811c91168015611940575b602082101461192c57601f81116118f1575b506020601f821160011461186b5792602092826040937fba11329c0b0f98b91c254755aa8d698feac3b46fab65b65fe5ab7570de2ff928968a91611860575b508160011b915f199060031b1c19161790555b815192839181835280519182918282860152018484015e8181018301889052601f01601f19168101030190a26001600160a01b0381511660408201516060830151610ed0836001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460181c161561185157610ee886838561205f565b8251600182016001600160401b03821161183d57600160401b821161183d57610f1682825481845583611d2e565b60208501908852602088208260021c91895b8381106117f857506003198416909303928361179f575b505050506002018151906001600160401b03821161146f57600160401b821161146f57610f7182825481845583611d2e565b60208301908752602087208260021c91885b83811061175a5750600319841690930392836116e4575b505050507f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad91610fdb61067992604051938493606085526060850190611d6a565b600160408301520390a26001600160a01b038151169160808201519260a083015193611037826001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b9460ff865460181c16156116d55760019561105387838561205f565b84156114835786810183516001600160401b03811161146f57600160401b811161146f5761108681835481855584611d2e565b602085019187526020872090875b8160021c811061142b57506003198116810392836113ca575b505050506002018151906001600160401b0382116113b657600160401b82116113b6576110df82825481845583611d2e565b60208301908652602086208260021c91875b8381106113725750600319841690930392836112fb575b505050507f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad9161114a610679925b604051938493606085526060850190611d6a565b8560408301520390a26001600160a01b0382511690611199826001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b9060ff825460181c16156112ec57806104a157808254926111bf60ff8560081c16611ddc565b9361ff008560081b169061ff0019161790556104a15750907f3da495aea17ab24773f3161f4707961a797e39147ce4f8a8fbac0309a4a2d2e460406001600160a01b03949360ff8251915f835216156020820152a2511694611251866001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b9586549260ff8460181c16156112dd575f809861127360ff8760101c16611ddc565b9562ff00008760101b169062ff000019161790556112c95760407f3da495aea17ab24773f3161f4707961a797e39147ce4f8a8fbac0309a4a2d2e49160ff600196835192835216156020820152a20191906102ba565b634e487b7160e01b5f52602160045260245ffd5b630dcfc57f60e21b5f5260045ffd5b80630dcfc57f60e21b60049252fd5b879388905b8b81831061133b575050505001558161114a6106797f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad611108565b90919295611368602091885160070b908660031b6001600160401b03809160031b9316831b921b19161790565b9601920190611300565b8a90898a5b6004811061138a575081850155016110f1565b84516020909501948e946001600160401b03918216600684901b90811b92901b19909316179101611377565b602486634e487b7160e01b81526041600452fd5b889389905b8c8183106113ee5750505050906002939291841c0155905f80806110ad565b909192956114216020916001600160401b03895116908660031b6001600160401b03809160031b9316831b921b19161790565b96019201906113cf565b8a90898a5b6004811061144357508185015501611094565b86516020909701968e946001600160401b03918216600684901b90811b92901b19909316179101611430565b602487634e487b7160e01b81526041600452fd5b6003810183516001600160401b03811161162057600160401b8111611620576114b181835481855584611d2e565b60208501915f5260205f20905f5b8160021c81106116915750600319811681039283611634575b505050506004018151906001600160401b03821161162057600160401b82116116205761150a82825481845583611d2e565b60208301905f5260205f208260021c915f5b8381106115dc575060031984169093039283611565575b505050507f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad9161114a61067992611136565b5f935f905b8b8183106115a5575050505001558161114a6106797f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad611533565b909192956115d2602091885160070b908660031b6001600160401b03809160031b9316831b921b19161790565b960192019061156a565b8a905f5f5b600481106115f45750818501550161151c565b84516020909501948e946001600160401b03918216600684901b90811b92901b199093161791016115e1565b634e487b7160e01b5f52604160045260245ffd5b5f935f905b8c818310611654575050505060021c015560045f80806114d8565b909192956116876020916001600160401b03895116908660031b6001600160401b03809160031b9316831b921b19161790565b9601920190611639565b8a905f5f5b600481106116a9575081850155016114bf565b86516020909701968e946001600160401b03918216600684901b90811b92901b19909316179101611696565b600484630dcfc57f60e21b8152fd5b889389905b80821061172257505050015581610fdb6106797f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad610f9a565b9091946020611750600192885160070b908660031b6001600160401b03809160031b9316831b921b19161790565b96019201906116e9565b898a5b60048110611772575083820155600101610f83565b83519093916001916020916001600160401b03600688901b81811b199092169216901b179201930161175d565b89938a905b8082106117ba57505050015560025f8080610f3f565b90919460206117ee6001926001600160401b03895116908660031b6001600160401b03809160031b9316831b921b19161790565b96019201906117a4565b8a8b5b60048110611810575083820155600101610f28565b83519093916001916020916001600160401b03600688901b81811b199092169216901b17920193016117fb565b602488634e487b7160e01b81526041600452fd5b600486630dcfc57f60e21b8152fd5b90508301515f610e42565b82875280872090601f198316885b8181106118d95750837fba11329c0b0f98b91c254755aa8d698feac3b46fab65b65fe5ab7570de2ff928969360209693604096600194106118c1575b5050811b019055610e55565b8501515f1960f88460031b161c191690555f806118b5565b9192602060018192868a015181550194019201611879565b61191c9083885260208820601f840160051c81019160208510611922575b601f0160051c0190611cf1565b5f610e03565b909150819061190f565b602487634e487b7160e01b81526022600452fd5b90607f1690610df1565b600485630dcfc57f60e21b8152fd5b602484634e487b7160e01b81526032600452fd5b602484634e487b7160e01b81526041600452fd5b506020813d82116119b9575b8161199a60209383611b85565b810103126119b5576119b063ff00000091611ce3565b610c74565b8580fd5b3d915061198d565b6040513d88823e3d90fd5b6004857ff411c327000000000000000000000000000000000000000000000000000000008152fd5b7fa98154e2000000000000000000000000000000000000000000000000000000005f5260045ffd5b5f80fd5b83356001600160401b038111611a1c57820160c06023198236030112611a1c576040519160c083018381106001600160401b038211176116205760405260248201356001600160a01b0381168103611a1c57835260448201356001600160401b038111611a1c5760249083010136601f82011215611a1c578035611aa381611bbd565b91611ab16040519384611b85565b8183523660208383010111611a1c57815f9260208093018386013783010152602084015260648201356001600160401b038111611a1c57611af89060243691850101611bd8565b604084015260848201356001600160401b038111611a1c57611b209060243691850101611c46565b606084015260a48201356001600160401b038111611a1c57611b489060243691850101611bd8565b608084015260c4820135926001600160401b038411611a1c57611b75602094936024869536920101611c46565b60a08201528152019301926100b5565b90601f801991011681019081106001600160401b0382111761162057604052565b6001600160401b0381116116205760051b60200190565b6001600160401b03811161162057601f01601f191660200190565b9080601f83011215611a1c57813590611bf082611ba6565b92611bfe6040519485611b85565b82845260208085019360051b820101918211611a1c57602001915b818310611c265750505090565b82356001600160401b0381168103611a1c57815260209283019201611c19565b9080601f83011215611a1c57813590611c5e82611ba6565b92611c6c6040519485611b85565b82845260208085019360051b820101918211611a1c57602001915b818310611c945750505090565b82358060070b8103611a1c57815260209283019201611c87565b805115611cbb5760200190565b634e487b7160e01b5f52603260045260245ffd5b8051821015611cbb5760209160051b010190565b519060ff82168203611a1c57565b818110611cfc575050565b5f8155600101611cf1565b81810292918115918404141715611d1a57565b634e487b7160e01b5f52601160045260245ffd5b9190808210611d3c57505050565b611d68925f52600360205f2091601882850160021c840194831b16806107a357500160021c0190611cf1565b565b90602080835192838152019201905f5b818110611d875750505090565b82516001600160401b0316845260209384019390920191600101611d7a565b90602080835192838152019201905f5b818110611dc35750505090565b825160070b845260209384019390920191600101611db6565b60ff166001039060ff8211611d1a57565b51906fffffffffffffffffffffffffffffffff82168203611a1c57565b908151820160a08360208301920312611a1c57602083015190600a821015611a1c57604084015193600a851015611a1c5760608101516001600160401b038111611a1c57826020611e5d928401016127f8565b9060808101516001600160401b038111611a1c57836020611e80928401016127f8565b9260a0820151916001600160401b038311611a1c57611ea292016020016127f8565b60018414611f9157604081805181010312611a1c57611ef7926fffffffffffffffffffffffffffffffff82611ee86040611ee16020611ef09701611ded565b9201611ded565b5016966128d2565b8093612ceb565b9280670de0b6b3a764000003670de0b6b3a76400008111611d1a57611f1c9083611d07565b670de0b6b3a7640000850290858204670de0b6b3a76400001486151715611d1a5781119182611f63575b5050611f5b575b828110611f575750565b9150565b915081611f4d565b909150670de0b6b3a76400000180670de0b6b3a764000011611d1a57611f899083611d07565b115f80611f46565b5080939450602092508091505181010312611a1c57602001516001600160a01b038116809103611a1c576020600491604051928380927f5ade93550000000000000000000000000000000000000000000000000000000082525afa90811561202c575f91611ffd575090565b90506020813d602011612024575b8161201860209383611b85565b81010312611a1c575190565b3d915061200b565b6040513d5f823e3d90fd5b9060070b9060070b0190677fffffffffffffff198212677fffffffffffffff831317611d1a57565b90929192815193815185148015906127f0575b6120de576003811015806112c957811594858061277a575b80156126e9575b828115612659575b506120de575f198701968711965f885b611d1a578181101561225557836112c95787806121ec575b8015612175575b8481156120ed575b506120de57600101886120a9565b635435b28960e11b5f5260045ffd5b90506112c9576002851480612103575b846120d0565b506001600160401b036121168289611ccf565b511660018201808311611d1a576121356001600160401b03918a611ccf565b51161180159061215f575b806120fd5750633b9aca006121558288611ccf565b5160070b136120fd565b505f61216b8288611ccf565b5160070b12612140565b505f93506001851480156120c857506001600160401b036121968289611ccf565b51166001820190818311611d1a576001600160401b036121b6838b611ccf565b511610908115916121c8575b506120c8565b6121d3915087611ccf565b5160070b6121e18288611ccf565b5160070b135f6121c2565b506001600160401b036121ff8289611ccf565b51166001820190818311611d1a576001600160401b0361221f838b611ccf565b51161190811591612231575b506120c1565b61223c915087611ccf565b5160070b61224a8288611ccf565b5160070b135f61222b565b5050955092509290925f61226885611cae565b5160070b12612278575b50505050565b604460406001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54168151928380926368fc2b7760e11b8252600a60048301523360248301525afa90811561202c575f9161260f575b50156126005760405191828360207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775492838152017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f20925f5b8181106125de57505061234892500384611b85565b8251936112c957612501575b600114612362575b80612272565b5f5b828110612371575061235c565b60026123c06001600160a01b036123888486611ccf565b51166001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b016040519081602082549182815201915f5260205f20905f915b8160038401106124c45793612439938193612419935f9754918181106124b0575b818110612499575b818110612482575b10612471575b500382611b85565b61242f61242588611cae565b5160070b91611cae565b5160070b90612037565b60070b1261244957600101612364565b7f11336121000000000000000000000000000000000000000000000000000000005f5260045ffd5b60c01d60070b81526020015f612411565b9260206001918460801c60070b815201930161240b565b9260206001918460401c60070b8152019301612403565b9260206001918460070b81520193016123fb565b926001608060049286548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b60608201520194019201916123da565b5f5b8381106125105750612354565b60046125276001600160a01b036123888487611ccf565b016040519081602082549182815201915f5260205f20905f915b8160038401106125a1578461259194612584945f979461257f9454918181106124b05781811061249957818110612482571061247157500382611b85565b611cae565b5160070b61242f88611cae565b60070b1261244957600101612503565b926001608060049286548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b6060820152019401920191612541565b84546001600160a01b0316835260019485019488945060209093019201612333565b633b8d9d7560e21b5f5260045ffd5b90506040813d604011612651575b8161262a60409383611b85565b81010312611a1c578051908115158203611a1c57602061264a910161283e565b505f6122d4565b3d915061261d565b90506112c957600283148061266f575b82612099565b505f1987018781119081611d1a57633b9aca006001600160401b03612694838a611ccf565b5116119182156126cf575b82156126ad575b5050612669565b909150611d1a576126c3633b9aca009186611ccf565b5160070b135f806126a6565b505f9150816126de8288611ccf565b5160070b129161269f565b505f915060018314806126fc575b612091565b50633b9aca006001600160401b0361271387611cae565b511614801590612755575b8061209157506001871180156126f7575061273884611cae565b5160070b845160011015611cbb57604085015160070b1415612091565b505f198701878111611d1a57612770633b9aca009186611ccf565b5160070b1361271e565b505f198701878111611d1a57633b9aca006001600160401b0361279d8389611ccf565b511610908115916127d3575b81156127b6575b5061208a565b64e8d4a5100091506127c89086611ccf565b5160070b135f6127b0565b90506001600160401b036127e687611cae565b51161515906127a9565b508415612072565b81601f82011215611a1c5780519061280f82611bbd565b9261281d6040519485611b85565b82845260208383010111611a1c57815f9260208093018386015e8301015290565b519063ffffffff82168203611a1c57565b8115612859570490565b634e487b7160e01b5f52601260045260245ffd5b9080601f83011215611a1c57815161288481611ba6565b926128926040519485611b85565b81845260208085019260051b820101928311611a1c57602001905b8282106128ba5750505090565b602080916128c784611ce3565b8152019101906128ad565b600a8110156112c95780612ada575090815182019160a08160208501940312611a1c5760208101516001600160401b038111611a1c5781019280603f85011215611a1c57602084015161292481611ba6565b946129326040519687611b85565b8186526020808088019360051b8301010190838211611a1c57604001915b818310612aba5750505060408201516001600160401b038111611a1c57820181603f82011215611a1c5760208101519061298982611ba6565b916129976040519384611b85565b8083526020808085019260051b8401010191848311611a1c57604001905b828210612aa25750505060608301516001600160401b038111611a1c578260206129e19286010161286d565b9160808401516001600160401b038111611a1c5760a0916020612a069287010161286d565b9301516002811015611a1c57670de0b6b3a7640000612a2991969492959661308c565b938351915f935b838510612a405750505050505090565b90919293949695612a956001916001600160a01b03612a5f898c611ccf565b511660ff612a6d8a87611ccf565b511660ff612a7b8b89611ccf565b51169163ffffffff612a8d8c8b611ccf565b5116936130cb565b9697950193929190612a30565b60208091612aaf8461283e565b8152019101906129b5565b82516001600160a01b0381168103611a1c57815260209283019201612950565b60038103612af0575050670de0b6b3a764000090565b60028103612b06575050670de0b6b3a764000090565b60048103612b59575050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561202c575f91611ffd575090565b60058103612b9e575050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561202c575f91611ffd575090565b60068103612be35750506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561202c575f91611ffd575090565b60078103612c28575050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561202c575f91611ffd575090565b60088103612c49575060208151918180820193849201010312611a1c575190565b600903612cde57604081805181010312611a1c5760208101516001600160a01b038116809103611a1c57602060406004930151916040519384809263501ad8ff60e11b82525afa801561202c575f90612caa575b612ca7925061284f565b90565b506020823d602011612cd6575b81612cc460209383611b85565b81010312611a1c57612ca79151612c9d565b3d9150612cb7565b50670de0b6b3a764000090565b92919092600a8110156112c95780612eb857508051810160a08260208301920312611a1c5760208201516001600160401b038111611a1c5782019381603f86011215611a1c576020850151612d3f81611ba6565b95612d4d6040519788611b85565b8187526020808089019360051b8301010190848211611a1c57604001915b818310612e985750505060408301516001600160401b038111611a1c5783019082603f83011215611a1c57602082015191612da583611ba6565b92612db36040519485611b85565b8084526020808086019260051b8401010191858311611a1c57604001905b828210612e805750505060608401516001600160401b038111611a1c57836020612dfd9287010161286d565b9260808501516001600160401b038111611a1c5760a0916020612e229288010161286d565b940151906002821015611a1c57612e3d91969492959661308c565b938351915f935b838510612e545750505050505090565b90919293949695612e736001916001600160a01b03612a5f898c611ccf565b9697950193929190612e44565b60208091612e8d8461283e565b815201910190612dd1565b82516001600160a01b0381168103611a1c57815260209283019201612d6b565b9192909160038103612ed357505050670de0b6b3a764000090565b60028103612ee15750905090565b60048103612f3557505050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561202c575f91611ffd575090565b60058103612f7b57505050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561202c575f91611ffd575090565b60068103612fc1575050506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561202c575f91611ffd575090565b6007810361300757505050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561202c575f91611ffd575090565b6008810361302957505060208151918180820193849201010312611a1c575190565b6009036130875750604081805181010312611a1c5760208101516001600160a01b038116809103611a1c57602060406004930151916040519384809263501ad8ff60e11b82525afa801561202c575f90612caa57612ca7925061284f565b905090565b60028110156112c957612ca75750670de0b6b3a764000090565b519069ffffffffffffffffffff82168203611a1c57565b604d8111611d1a57600a0a90565b91909360a06001600160a01b0394956004604051809781937ffeaf968c000000000000000000000000000000000000000000000000000000008352165afa90811561202c575f945f926131b0575b505f851391821592613196575b505061316e5760ff1660010361315357613147612ca7939261314d92611d07565b916130bd565b9061284f565b61316990613163612ca7946130bd565b90611d07565b61284f565b7fae193563000000000000000000000000000000000000000000000000000000005f5260045ffd5b4290810392508211611d1a5763ffffffff16105f80613126565b9450905060a0843d60a0116131fe575b816131cd60a09383611b85565b81010312611a1c576131de846130a6565b5060208401516131f56080606087015196016130a6565b5093905f613119565b3d91506131c056fea264697066735822122011fe342fd5ac7da6ff1664e4d4eaa7adc90c36dab7984085d65dfe6b69ac19ca64736f6c634300081c0033", + "devdoc": { + "details": "This contract is used only once to initialize the diamond proxy.", + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/DiamondLoupe.json b/deployments/sepolia/DiamondLoupe.json new file mode 100644 index 0000000..aa66027 --- /dev/null +++ b/deployments/sepolia/DiamondLoupe.json @@ -0,0 +1,162 @@ +{ + "address": "0xC9B6279baa19dBB8bCc3250c89cAa093AaBA0bfc", + "abi": [ + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_functionSelector", + "type": "bytes4" + } + ], + "name": "facetAddress", + "outputs": [ + { + "internalType": "address", + "name": "facetAddress_", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "facetAddresses_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "_facetFunctionSelectors", + "type": "bytes4[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Facet[]", + "name": "facets_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x276b6758b4e845b29bfa5fe2df7f650ca5e626cac7c67a9b6fbf657128b13ad7", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0xC9B6279baa19dBB8bCc3250c89cAa093AaBA0bfc", + "transactionIndex": 89, + "gasUsed": "474967", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3850fd594cb8ef062348993ac12461bd5c90378c696906094c2c8189ff9d4827", + "transactionHash": "0x276b6758b4e845b29bfa5fe2df7f650ca5e626cac7c67a9b6fbf657128b13ad7", + "logs": [], + "blockNumber": 8411094, + "cumulativeGasUsed": "11161050", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9d44d918681c9ad36f866ebee034a3d1", + "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_functionSelector\",\"type\":\"bytes4\"}],\"name\":\"facetAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"facetAddress_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"facetAddresses\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"facetAddresses_\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_facet\",\"type\":\"address\"}],\"name\":\"facetFunctionSelectors\",\"outputs\":[{\"internalType\":\"bytes4[]\",\"name\":\"_facetFunctionSelectors\",\"type\":\"bytes4[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"facets\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"facetAddress\",\"type\":\"address\"},{\"internalType\":\"bytes4[]\",\"name\":\"functionSelectors\",\"type\":\"bytes4[]\"}],\"internalType\":\"struct Facet[]\",\"name\":\"facets_\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Cooper Labs\",\"custom:contact\":\"security@cooperlabs.xyz\",\"details\":\"Reference: EIP-2535 DiamondsForked from https://github.com/mudgen/diamond-3/blob/master/contracts/facets/DiamondLoupeFacet.sol by mudgen\",\"kind\":\"dev\",\"methods\":{\"facetAddress(bytes4)\":{\"details\":\"If facet is not found return address(0).\",\"params\":{\"_functionSelector\":\"The function selector.\"},\"returns\":{\"facetAddress_\":\"The facet address.\"}},\"facetAddresses()\":{\"returns\":{\"facetAddresses_\":\"facetAddresses_\"}},\"facetFunctionSelectors(address)\":{\"params\":{\"_facet\":\"The facet address.\"},\"returns\":{\"_facetFunctionSelectors\":\"facetFunctionSelectors_\"}},\"facets()\":{\"returns\":{\"facets_\":\"Facet\"}}},\"title\":\"DiamondLoupe\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"facetAddress(bytes4)\":{\"notice\":\"Gets the facet that supports the given selector.\"},\"facetAddresses()\":{\"notice\":\"Get all the facet addresses used by a diamond.\"},\"facetFunctionSelectors(address)\":{\"notice\":\"Gets all the function selectors supported by a specific facet.\"},\"facets()\":{\"notice\":\"Gets all facet addresses and their four byte function selectors.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/parallelizer/facets/DiamondLoupe.sol\":\"DiamondLoupe\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/manager/IAccessManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\ninterface IAccessManager {\\n /**\\n * @dev A delayed operation was scheduled.\\n */\\n event OperationScheduled(\\n bytes32 indexed operationId,\\n uint32 indexed nonce,\\n uint48 schedule,\\n address caller,\\n address target,\\n bytes data\\n );\\n\\n /**\\n * @dev A scheduled operation was executed.\\n */\\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev A scheduled operation was canceled.\\n */\\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev Informational labelling for a roleId.\\n */\\n event RoleLabel(uint64 indexed roleId, string label);\\n\\n /**\\n * @dev Emitted when `account` is granted `roleId`.\\n *\\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\\n * otherwise it indicates the execution delay for this account and roleId is updated.\\n */\\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\\n\\n /**\\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\\n */\\n event RoleRevoked(uint64 indexed roleId, address indexed account);\\n\\n /**\\n * @dev Role acting as admin over a given `roleId` is updated.\\n */\\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\\n\\n /**\\n * @dev Role acting as guardian over a given `roleId` is updated.\\n */\\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\\n\\n /**\\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\\n */\\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\\n\\n /**\\n * @dev Target mode is updated (true = closed, false = open).\\n */\\n event TargetClosed(address indexed target, bool closed);\\n\\n /**\\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\\n */\\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\\n\\n /**\\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\\n */\\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\\n\\n error AccessManagerAlreadyScheduled(bytes32 operationId);\\n error AccessManagerNotScheduled(bytes32 operationId);\\n error AccessManagerNotReady(bytes32 operationId);\\n error AccessManagerExpired(bytes32 operationId);\\n error AccessManagerLockedRole(uint64 roleId);\\n error AccessManagerBadConfirmation();\\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\\n error AccessManagerUnauthorizedConsume(address target);\\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\\n\\n /**\\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\\n * & {execute} workflow.\\n *\\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\\n * for future execution.\\n *\\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\\n * the operation can be executed if and only if delay is greater than 0.\\n *\\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\\n *\\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\\n * {AccessManager} documentation.\\n */\\n function canCall(\\n address caller,\\n address target,\\n bytes4 selector\\n ) external view returns (bool allowed, uint32 delay);\\n\\n /**\\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\\n *\\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\\n * disabling any scheduling usage.\\n */\\n function expiration() external view returns (uint32);\\n\\n /**\\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\\n * can be increased without setback (and reset via {revokeRole} in the case event of an\\n * accidental increase). Defaults to 5 days.\\n */\\n function minSetback() external view returns (uint32);\\n\\n /**\\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\\n *\\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\\n */\\n function isTargetClosed(address target) external view returns (bool);\\n\\n /**\\n * @dev Get the role required to call a function.\\n */\\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\\n\\n /**\\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\\n */\\n function getTargetAdminDelay(address target) external view returns (uint32);\\n\\n /**\\n * @dev Get the id of the role that acts as an admin for the given role.\\n *\\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\\n * an operation that is restricted to this role.\\n */\\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role that acts as a guardian for a given role.\\n *\\n * The guardian permission allows canceling operations that have been scheduled under the role.\\n */\\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role current grant delay.\\n *\\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\\n */\\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\\n\\n /**\\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\\n * level.\\n *\\n * Returns:\\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\\n * [1] Current execution delay for the account.\\n * [2] Pending execution delay for the account.\\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\\n */\\n function getAccess(\\n uint64 roleId,\\n address account\\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\\n\\n /**\\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\\n * permission might be associated with an execution delay. {getAccess} can provide more details.\\n */\\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\\n\\n /**\\n * @dev Give a label to a role, for improved role discoverability by UIs.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleLabel} event.\\n */\\n function labelRole(uint64 roleId, string calldata label) external;\\n\\n /**\\n * @dev Add `account` to `roleId`, or change its execution delay.\\n *\\n * This gives the account the authorization to call any function that is restricted to this role. An optional\\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\\n *\\n * If the account has already been granted this role, the execution delay will be updated. This update is not\\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - granted role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleGranted} event.\\n */\\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\\n\\n /**\\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\\n * no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - revoked role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function revokeRole(uint64 roleId, address account) external;\\n\\n /**\\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\\n * the role this call has no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function renounceRole(uint64 roleId, address callerConfirmation) external;\\n\\n /**\\n * @dev Change admin role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleAdminChanged} event\\n */\\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\\n\\n /**\\n * @dev Change guardian role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGuardianChanged} event\\n */\\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\\n\\n /**\\n * @dev Update the delay for granting a `roleId`.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGrantDelayChanged} event.\\n */\\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetFunctionRoleUpdated} event per selector.\\n */\\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\\n\\n /**\\n * @dev Set the delay for changing the configuration of a given target contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetAdminDelayUpdated} event.\\n */\\n function setTargetAdminDelay(address target, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the closed flag for a contract.\\n *\\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetClosed} event.\\n */\\n function setTargetClosed(address target, bool closed) external;\\n\\n /**\\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\\n * operation is not yet scheduled, has expired, was executed, or was canceled.\\n */\\n function getSchedule(bytes32 id) external view returns (uint48);\\n\\n /**\\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\\n * been scheduled.\\n */\\n function getNonce(bytes32 id) external view returns (uint32);\\n\\n /**\\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\\n * required for the caller. The special value zero will automatically set the earliest possible time.\\n *\\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\\n *\\n * Emits a {OperationScheduled} event.\\n *\\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\\n * contract if it is using standard Solidity ABI encoding.\\n */\\n function schedule(\\n address target,\\n bytes calldata data,\\n uint48 when\\n ) external returns (bytes32 operationId, uint32 nonce);\\n\\n /**\\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\\n * execution delay is 0.\\n *\\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\\n *\\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\\n */\\n function execute(address target, bytes calldata data) external payable returns (uint32);\\n\\n /**\\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\\n * operation that is cancelled.\\n *\\n * Requirements:\\n *\\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\\n *\\n * Emits a {OperationCanceled} event.\\n */\\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\\n\\n /**\\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\\n *\\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\\n * with all the verifications that it implies.\\n *\\n * Emit a {OperationExecuted} event.\\n */\\n function consumeScheduledOp(address caller, bytes calldata data) external;\\n\\n /**\\n * @dev Hashing function for delayed operations.\\n */\\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\\n\\n /**\\n * @dev Changes the authority of a target managed by this manager instance.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n */\\n function updateAuthority(address target, address newAuthority) external;\\n}\\n\",\"keccak256\":\"0x9be2d08a326515805bc9cf6315b7953f8d1ebe88abf48c2d645fb1fa8211a0e2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/interfaces/IDiamondLoupe.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"../parallelizer/Storage.sol\\\";\\n\\n/// @notice IDiamondLoupe\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/interfaces/IDiamondLoupe.sol by mudgen\\ninterface IDiamondLoupe {\\n /// @notice Gets all facet addresses and their four byte function selectors.\\n /// @return facets_ Facet\\n function facets() external view returns (Facet[] memory facets_);\\n\\n /// @notice Gets all the function selectors supported by a specific facet.\\n /// @param _facet The facet address.\\n /// @return facetFunctionSelectors_\\n function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_);\\n\\n /// @notice Get all the facet addresses used by a diamond.\\n /// @return facetAddresses_\\n function facetAddresses() external view returns (address[] memory facetAddresses_);\\n\\n /// @notice Gets the facet that supports the given selector.\\n /// @dev If facet is not found return address(0).\\n /// @param _functionSelector The function selector.\\n /// @return facetAddress_ The facet address.\\n function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_);\\n}\\n\",\"keccak256\":\"0xa5580958acabe2c44967e835e77a748eb0b8812f70cd071191201508c9388ca8\",\"license\":\"MIT\"},\"contracts/interfaces/ITokenP.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title ITokenP\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Interface for the stablecoins `tokenP` contracts\\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\\ninterface ITokenP is IERC20 {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MINTER ROLE ONLY FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Lets a whitelisted contract mint tokenPs\\n /// @param account Address to mint to\\n /// @param amount Amount to mint\\n function mint(address account, uint256 amount) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @param sender Address which requested the burn from `burner`\\n /// @dev This method is to be called by a contract with the minter right after being requested\\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\\n /// @dev The method checks the allowance between the `sender` and the `burner`\\n function burnFrom(uint256 amount, address burner, address sender) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\\n /// requested to do so by an address willing to burn tokens from its address\\n function burnSelf(uint256 amount, address burner) external;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Amount of decimals of the stablecoin\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x64a1305faa8c5c91767a11af0eae16e4b463aa0bfe10f11b74aae9d96681a5eb\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/coinbase/ICbETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ICbETH\\n/// @notice Interface for the `cbETH` contract\\ninterface ICbETH {\\n function exchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb159341cb0e25c478912b274cdda2d50fa84692aeac87b6823d281aaea2aed04\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/frax/ISfrxETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ISfrxETH\\n/// @notice Interface for the `sfrxETH` contract\\ninterface ISfrxETH {\\n function pricePerShare() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x914cbea276f817c7db62bfca21e15bd8f7892faa9f39d86baaef574cf12b859f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/lido/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IStETH\\n/// @notice Interface for the `StETH` contract\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n\\n function submit(address) external payable returns (uint256);\\n\\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf21e3d8bdadc236b34bf2122b0e0b939d2d6bb6e2889b508636cbb7b84f59680\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/rocketPool/IRETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IRETH\\n/// @notice Interface for the `rETH` contract\\ninterface IRETH {\\n function getExchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x567a378e95d40160e297c1adb617ccaa69c03e49c4ad72a6ce651dd43cdbd5cd\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/Storage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ENUMS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nenum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n}\\n\\nenum ManagerType {\\n EXTERNAL\\n}\\n\\nenum ActionType {\\n Mint,\\n Burn,\\n Redeem\\n}\\n\\nenum TrustedType {\\n Updater,\\n Seller\\n}\\n\\nenum QuoteType {\\n MintExactInput,\\n MintExactOutput,\\n BurnExactInput,\\n BurnExactOutput\\n}\\n\\nenum OracleReadType {\\n CHAINLINK_FEEDS,\\n EXTERNAL,\\n NO_ORACLE,\\n STABLE,\\n WSTETH,\\n CBETH,\\n RETH,\\n SFRXETH,\\n MAX,\\n MORPHO_ORACLE\\n}\\n\\nenum OracleQuoteType {\\n UNIT,\\n TARGET\\n}\\n\\nenum WhitelistType {\\n BACKED\\n}\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STRUCTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nstruct Permit2Details {\\n address to; // Address that will receive the funds\\n uint256 nonce; // Nonce of the transaction\\n bytes signature; // Permit signature of the user\\n}\\n\\nstruct FacetCut {\\n address facetAddress; // Facet contract address\\n FacetCutAction action; // Can be add, remove or replace\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct Facet {\\n address facetAddress; // Facet contract address\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct FacetInfo {\\n address facetAddress; // Facet contract address\\n uint16 selectorPosition; // Position in the list of all selectors\\n}\\n\\nstruct DiamondStorage {\\n bytes4[] selectors; // List of all available selectors\\n mapping(bytes4 => FacetInfo) selectorInfo; // Selector to (address, position in list)\\n IAccessManager accessManager; // Contract handling access management\\n}\\n\\nstruct ImplementationStorage {\\n address implementation; // Dummy implementation address for Etherscan usability\\n}\\n\\nstruct ManagerStorage {\\n IERC20[] subCollaterals; // Subtokens handled by the manager or strategies\\n bytes config; // Additional configuration data\\n}\\n\\nstruct Collateral {\\n uint8 isManaged; // If the collateral is managed through external strategies\\n uint8 isMintLive; // If minting from this asset is unpaused\\n uint8 isBurnLive; // If burning to this asset is unpaused\\n uint8 decimals; // IERC20Metadata(collateral).decimals()\\n uint8 onlyWhitelisted; // If only whitelisted addresses can burn or redeem for this token\\n uint216 normalizedStables; // Normalized amount of stablecoins issued from this collateral\\n uint64[] xFeeMint; // Increasing exposures in [0,BASE_9[\\n int64[] yFeeMint; // Mint fees at the exposures specified in `xFeeMint`\\n uint64[] xFeeBurn; // Decreasing exposures in ]0,BASE_9]\\n int64[] yFeeBurn; // Burn fees at the exposures specified in `xFeeBurn`\\n bytes oracleConfig; // Data about the oracle used for the collateral\\n bytes whitelistData; // For whitelisted collateral, data used to verify whitelists\\n ManagerStorage managerData; // For managed collateral, data used to handle the strategies\\n uint256 stablecoinCap; // Cap on the amount of stablecoins that can be issued from this collateral\\n}\\n\\nstruct ParallelizerStorage {\\n ITokenP tokenP; // tokenP handled by the system\\n uint8 isRedemptionLive; // If redemption is unpaused\\n uint8 statusReentrant; // If call is reentrant or not\\n bool consumingSchedule; // If the contract is consuming a scheduled operation\\n uint128 normalizedStables; // Normalized amount of stablecoins issued by the system\\n uint128 normalizer; // To reconcile `normalizedStables` values with the actual amount\\n address[] collateralList; // List of collateral assets supported by the system\\n uint64[] xRedemptionCurve; // Increasing collateral ratios > 0\\n int64[] yRedemptionCurve; // Value of the redemption fees at `xRedemptionCurve`\\n mapping(address => Collateral) collaterals; // Maps a collateral asset to its parameters\\n mapping(address => uint256) isTrusted; // If an address is trusted to update the normalizer value\\n mapping(address => uint256) isSellerTrusted; // If an address is trusted to sell accruing reward tokens or to run\\n // keeper jobs on oracles\\n mapping(WhitelistType => mapping(address => uint256)) isWhitelistedForType;\\n}\\n// Whether an address is whitelisted for a specific whitelist type\\n\",\"keccak256\":\"0x3f4313dd110dbe390038320b2d3cf24dcbe9b75cd9573e7f048f7233c02dd227\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/DiamondLoupe.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { IDiamondLoupe } from \\\"contracts/interfaces/IDiamondLoupe.sol\\\";\\n\\nimport { LibStorage as s } from \\\"../libraries/LibStorage.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title DiamondLoupe\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/facets/DiamondLoupeFacet.sol by mudgen\\ncontract DiamondLoupe is IDiamondLoupe {\\n /// @inheritdoc IDiamondLoupe\\n function facets() external view override returns (Facet[] memory facets_) {\\n DiamondStorage storage ds = s.diamondStorage();\\n uint256 selectorCount = ds.selectors.length;\\n facets_ = new Facet[](selectorCount);\\n uint16[] memory numFacetSelectors = new uint16[](selectorCount);\\n uint256 numFacets;\\n\\n for (uint256 selectorIndex; selectorIndex < selectorCount; selectorIndex++) {\\n bytes4 selector = ds.selectors[selectorIndex];\\n address facetAddress_ = ds.selectorInfo[selector].facetAddress;\\n bool continueLoop = false;\\n // Find the functionSelectors array for selector and add selector to it\\n for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) {\\n if (facets_[facetIndex].facetAddress == facetAddress_) {\\n facets_[facetIndex].functionSelectors[numFacetSelectors[facetIndex]] = selector;\\n numFacetSelectors[facetIndex]++;\\n continueLoop = true;\\n break;\\n }\\n }\\n // If functionSelectors array exists for selector then continue loop\\n if (continueLoop) {\\n continueLoop = false;\\n continue;\\n }\\n\\n // Create a new functionSelectors array for selector\\n facets_[numFacets].facetAddress = facetAddress_;\\n facets_[numFacets].functionSelectors = new bytes4[](selectorCount);\\n facets_[numFacets].functionSelectors[0] = selector;\\n numFacetSelectors[numFacets] = 1;\\n numFacets++;\\n }\\n for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) {\\n uint256 numSelectors = numFacetSelectors[facetIndex];\\n bytes4[] memory selectors = facets_[facetIndex].functionSelectors;\\n // Set the number of selectors\\n assembly (\\\"memory-safe\\\") {\\n mstore(selectors, numSelectors)\\n }\\n }\\n // Set the number of facets\\n assembly (\\\"memory-safe\\\") {\\n mstore(facets_, numFacets)\\n }\\n }\\n\\n /// @inheritdoc IDiamondLoupe\\n function facetFunctionSelectors(address _facet)\\n external\\n view\\n override\\n returns (bytes4[] memory _facetFunctionSelectors)\\n {\\n DiamondStorage storage ds = s.diamondStorage();\\n uint256 selectorCount = ds.selectors.length;\\n uint256 numSelectors;\\n _facetFunctionSelectors = new bytes4[](selectorCount);\\n\\n for (uint256 selectorIndex; selectorIndex < selectorCount; selectorIndex++) {\\n bytes4 selector = ds.selectors[selectorIndex];\\n address facetAddress_ = ds.selectorInfo[selector].facetAddress;\\n if (_facet == facetAddress_) {\\n _facetFunctionSelectors[numSelectors] = selector;\\n numSelectors++;\\n }\\n }\\n // Set the number of selectors in the array\\n assembly (\\\"memory-safe\\\") {\\n mstore(_facetFunctionSelectors, numSelectors)\\n }\\n }\\n\\n /// @inheritdoc IDiamondLoupe\\n function facetAddresses() external view override returns (address[] memory facetAddresses_) {\\n DiamondStorage storage ds = s.diamondStorage();\\n uint256 selectorCount = ds.selectors.length;\\n // Create an array set to the maximum size possible\\n facetAddresses_ = new address[](selectorCount);\\n uint256 numFacets;\\n // Loop through function selectors\\n for (uint256 selectorIndex; selectorIndex < selectorCount; selectorIndex++) {\\n bytes4 selector = ds.selectors[selectorIndex];\\n address facetAddress_ = ds.selectorInfo[selector].facetAddress;\\n bool continueLoop = false;\\n // See if we have collected the address already and break out of loop if we have\\n for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) {\\n if (facetAddress_ == facetAddresses_[facetIndex]) {\\n continueLoop = true;\\n break;\\n }\\n }\\n // Continue loop if we already have the address\\n if (continueLoop) {\\n continueLoop = false;\\n continue;\\n }\\n // Include address\\n facetAddresses_[numFacets] = facetAddress_;\\n numFacets++;\\n }\\n // Set the number of facet addresses in the array\\n assembly (\\\"memory-safe\\\") {\\n mstore(facetAddresses_, numFacets)\\n }\\n }\\n\\n /// @inheritdoc IDiamondLoupe\\n function facetAddress(bytes4 _functionSelector) external view override returns (address facetAddress_) {\\n DiamondStorage storage ds = s.diamondStorage();\\n facetAddress_ = ds.selectorInfo[_functionSelector].facetAddress;\\n }\\n}\\n\",\"keccak256\":\"0x1e9c69efa9003173bd2a04648580ae6dcf405d7b21e2e0ade77e7060c5f6edd4\",\"license\":\"MIT\"},\"contracts/parallelizer/libraries/LibStorage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport { DiamondStorage, ImplementationStorage, ParallelizerStorage } from \\\"../Storage.sol\\\";\\n\\n/// @title LibStorage\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibStorage` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibStorage.sol\\nlibrary LibStorage {\\n /// @notice Returns the storage struct stored at the `DIAMOND_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic of the different facets used in the diamond proxy\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ds.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `TRANSMUTER_STORAGE_POSITION` slot\\n /// @dev This struct handles the particular logic of the Parallelizer system\\n function transmuterStorage() internal pure returns (ParallelizerStorage storage ts) {\\n bytes32 position = TRANSMUTER_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ts.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `IMPLEMENTATION_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic for making the contract easily usable on Etherscan\\n function implementationStorage() internal pure returns (ImplementationStorage storage ims) {\\n bytes32 position = IMPLEMENTATION_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ims.slot := position\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf8c333898ca14d3e8696c232f669a839dddbf705a609a1b0795ecc6b8f1b2d73\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ICbETH } from \\\"contracts/interfaces/external/coinbase/ICbETH.sol\\\";\\nimport { ISfrxETH } from \\\"contracts/interfaces/external/frax/ISfrxETH.sol\\\";\\nimport { IStETH } from \\\"contracts/interfaces/external/lido/IStETH.sol\\\";\\nimport { IRETH } from \\\"contracts/interfaces/external/rocketPool/IRETH.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STORAGE SLOTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n/// @dev Storage position of `DiamondStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.diamond.storage\\\") - 1`\\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\\n\\n/// @dev Storage position of `ParallelizerStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.parallelizer.storage\\\") - 1`\\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\\n\\n/// @dev Storage position of `ImplementationStorage` structure\\n/// @dev Equals `keccak256(\\\"eip1967.proxy.implementation\\\") - 1`\\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MATHS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nuint256 constant BASE_6 = 1e6;\\nuint256 constant BASE_8 = 1e8;\\nuint256 constant BASE_9 = 1e9;\\nuint256 constant BASE_12 = 1e12;\\nuint256 constant BPS = 1e14;\\nuint256 constant BASE_18 = 1e18;\\nuint256 constant HALF_BASE_27 = 1e27 / 2;\\nuint256 constant BASE_27 = 1e27;\\nuint256 constant BASE_36 = 1e36;\\nuint256 constant MAX_BURN_FEE = 999_000_000;\\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// The values being non-zero value makes deployment a bit more expensive,\\n// but in exchange the refund on every call to nonReentrant will be lower in\\n// amount. Since refunds are capped to a percentage of the total\\n// transaction's gas, it is best to keep them low in cases like this one, to\\n// increase the likelihood of the full refund coming into effect.\\nuint8 constant NOT_ENTERED = 1;\\nuint8 constant ENTERED = 2;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// Role IDs for the AccessManager\\nuint64 constant GOVERNOR_ROLE = 10;\\nuint64 constant GUARDIAN_ROLE = 20;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n COMMON ADDRESSES \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\\n\",\"keccak256\":\"0x3306bdd0d4e4f364e0d35893a7ffb59c8eb9e94a5bd861f58b8d7ba8a7b336e5\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x6080806040523460155761079e908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c806352ef6b2c146104ba5780637a0ed627146101a6578063adfca15e146100ad5763cdffacc614610045575f80fd5b346100a95760203660031901126100a9576004356001600160e01b031981168091036100a9575f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260206001600160a01b0360405f205416604051908152f35b5f80fd5b346100a95760203660031901126100a9576004356001600160a01b0381168091036100a9577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b545f6100fe82610740565b915f5b818110610125578284526040516020808252819061012190820187610625565b0390f35b6001600160e01b0319610137826106a0565b90549060031b1c60e01b16805f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b0360405f2054168614610187575b50600101610101565b8361019f91610199600194968861071e565b52610732565b929061017e565b346100a9575f3660031901126100a9577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b546101e96101e482610688565b610662565b81815290601f196101f982610688565b015f5b81811061046f5750506102116101e482610688565b818152601f1961022083610688565b013660208301375f915f905b8082106102ea5750505f5b8281106102c257505081526040518091602082016020835281518091526040830190602060408260051b8601019301915f905b82821061027957505050500390f35b919360019193955060206102b28192603f198a82030186526040838a516001600160a01b03815116845201519181858201520190610625565b960192019201859493919261026a565b8061ffff6102d26001938561071e565b511660206102e0838861071e565b5101515201610237565b90926001600160e01b03196102fe856106a0565b90549060031b1c60e01b1690815f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b0360405f2054165f5f5b8381106103c8575b506103bd57610359828861071e565b515261036483610740565b6020610370838961071e565b510152602061037f828861071e565b510151908151156103a95760019260206103a093015282610199828761071e565b935b019061022c565b634e487b7160e01b5f52603260045260245ffd5b5093600191506103a2565b826001600160a01b036103e0838c989c99979961071e565b515116146103f657600101979397949294610342565b905087610425602061040d84889c9899979961071e565b51015161ffff61041d858b61071e565b51169061071e565b5261ffff610433828861071e565b51169061ffff821461045b57600161044e61ffff928961071e565b920116905260018861034a565b634e487b7160e01b5f52601160045260245ffd5b60405190604082019180831067ffffffffffffffff8411176104a6576020926040525f8152606083820152828287010152016101fc565b634e487b7160e01b5f52604160045260245ffd5b346100a9575f3660031901126100a9577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b546104f86101e482610688565b81815261050482610688565b602082019290601f19013684375f905f905b80821061056c5750508152604051918291602083019060208452518091526040830191905f5b81811061054a575050500390f35b82516001600160a01b031684528594506020938401939092019160010161053c565b90916001600160e01b0319610583849695966106a0565b90549060031b1c60e01b165f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b0360405f2054165f5f5b8381106105f9575b506105ef57816105e3916101996001948961071e565b925b0190939293610516565b50916001906105e5565b6001600160a01b0361060b828a61071e565b5116831461061b576001016105c5565b50506001876105cd565b90602080835192838152019201905f5b8181106106425750505090565b82516001600160e01b031916845260209384019390920191600101610635565b6040519190601f01601f1916820167ffffffffffffffff8111838210176104a657604052565b67ffffffffffffffff81116104a65760051b60200190565b907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b548210156103a9577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b5f52600382901c7f44fefae66705534388ac21ba5f0775616856a675b8eaea9bb0b2507f062387c3019160021b601c1690565b80518210156103a95760209160051b010190565b5f19811461045b5760010190565b9061074d6101e483610688565b828152809261075e601f1991610688565b019060203691013756fea26469706673582212206f714638b72ed4261525ac8071822d26a9f72790ba32f2c588f573d8e8d8fcda64736f6c634300081c0033", + "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f3560e01c806352ef6b2c146104ba5780637a0ed627146101a6578063adfca15e146100ad5763cdffacc614610045575f80fd5b346100a95760203660031901126100a9576004356001600160e01b031981168091036100a9575f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260206001600160a01b0360405f205416604051908152f35b5f80fd5b346100a95760203660031901126100a9576004356001600160a01b0381168091036100a9577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b545f6100fe82610740565b915f5b818110610125578284526040516020808252819061012190820187610625565b0390f35b6001600160e01b0319610137826106a0565b90549060031b1c60e01b16805f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b0360405f2054168614610187575b50600101610101565b8361019f91610199600194968861071e565b52610732565b929061017e565b346100a9575f3660031901126100a9577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b546101e96101e482610688565b610662565b81815290601f196101f982610688565b015f5b81811061046f5750506102116101e482610688565b818152601f1961022083610688565b013660208301375f915f905b8082106102ea5750505f5b8281106102c257505081526040518091602082016020835281518091526040830190602060408260051b8601019301915f905b82821061027957505050500390f35b919360019193955060206102b28192603f198a82030186526040838a516001600160a01b03815116845201519181858201520190610625565b960192019201859493919261026a565b8061ffff6102d26001938561071e565b511660206102e0838861071e565b5101515201610237565b90926001600160e01b03196102fe856106a0565b90549060031b1c60e01b1690815f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b0360405f2054165f5f5b8381106103c8575b506103bd57610359828861071e565b515261036483610740565b6020610370838961071e565b510152602061037f828861071e565b510151908151156103a95760019260206103a093015282610199828761071e565b935b019061022c565b634e487b7160e01b5f52603260045260245ffd5b5093600191506103a2565b826001600160a01b036103e0838c989c99979961071e565b515116146103f657600101979397949294610342565b905087610425602061040d84889c9899979961071e565b51015161ffff61041d858b61071e565b51169061071e565b5261ffff610433828861071e565b51169061ffff821461045b57600161044e61ffff928961071e565b920116905260018861034a565b634e487b7160e01b5f52601160045260245ffd5b60405190604082019180831067ffffffffffffffff8411176104a6576020926040525f8152606083820152828287010152016101fc565b634e487b7160e01b5f52604160045260245ffd5b346100a9575f3660031901126100a9577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b546104f86101e482610688565b81815261050482610688565b602082019290601f19013684375f905f905b80821061056c5750508152604051918291602083019060208452518091526040830191905f5b81811061054a575050500390f35b82516001600160a01b031684528594506020938401939092019160010161053c565b90916001600160e01b0319610583849695966106a0565b90549060031b1c60e01b165f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526001600160a01b0360405f2054165f5f5b8381106105f9575b506105ef57816105e3916101996001948961071e565b925b0190939293610516565b50916001906105e5565b6001600160a01b0361060b828a61071e565b5116831461061b576001016105c5565b50506001876105cd565b90602080835192838152019201905f5b8181106106425750505090565b82516001600160e01b031916845260209384019390920191600101610635565b6040519190601f01601f1916820167ffffffffffffffff8111838210176104a657604052565b67ffffffffffffffff81116104a65760051b60200190565b907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b548210156103a9577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b5f52600382901c7f44fefae66705534388ac21ba5f0775616856a675b8eaea9bb0b2507f062387c3019160021b601c1690565b80518210156103a95760209160051b010190565b5f19811461045b5760010190565b9061074d6101e483610688565b828152809261075e601f1991610688565b019060203691013756fea26469706673582212206f714638b72ed4261525ac8071822d26a9f72790ba32f2c588f573d8e8d8fcda64736f6c634300081c0033", + "devdoc": { + "author": "Cooper Labs", + "custom:contact": "security@cooperlabs.xyz", + "details": "Reference: EIP-2535 DiamondsForked from https://github.com/mudgen/diamond-3/blob/master/contracts/facets/DiamondLoupeFacet.sol by mudgen", + "kind": "dev", + "methods": { + "facetAddress(bytes4)": { + "details": "If facet is not found return address(0).", + "params": { + "_functionSelector": "The function selector." + }, + "returns": { + "facetAddress_": "The facet address." + } + }, + "facetAddresses()": { + "returns": { + "facetAddresses_": "facetAddresses_" + } + }, + "facetFunctionSelectors(address)": { + "params": { + "_facet": "The facet address." + }, + "returns": { + "_facetFunctionSelectors": "facetFunctionSelectors_" + } + }, + "facets()": { + "returns": { + "facets_": "Facet" + } + } + }, + "title": "DiamondLoupe", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "facetAddress(bytes4)": { + "notice": "Gets the facet that supports the given selector." + }, + "facetAddresses()": { + "notice": "Get all the facet addresses used by a diamond." + }, + "facetFunctionSelectors(address)": { + "notice": "Gets all the function selectors supported by a specific facet." + }, + "facets()": { + "notice": "Gets all facet addresses and their four byte function selectors." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/Getters.json b/deployments/sepolia/Getters.json new file mode 100644 index 0000000..5609a32 --- /dev/null +++ b/deployments/sepolia/Getters.json @@ -0,0 +1,772 @@ +{ + "address": "0x78BB4882b77D74aD9B04Ab71fE8e61f72595823C", + "abi": [ + { + "inputs": [], + "name": "InvalidChainlinkRate", + "type": "error" + }, + { + "inputs": [], + "name": "NotCollateral", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrantCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [], + "name": "accessManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getCollateralBurnFees", + "outputs": [ + { + "internalType": "uint64[]", + "name": "xFeeBurn", + "type": "uint64[]" + }, + { + "internalType": "int64[]", + "name": "yFeeBurn", + "type": "int64[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getCollateralDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getCollateralInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint8", + "name": "isManaged", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "isMintLive", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "isBurnLive", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "onlyWhitelisted", + "type": "uint8" + }, + { + "internalType": "uint216", + "name": "normalizedStables", + "type": "uint216" + }, + { + "internalType": "uint64[]", + "name": "xFeeMint", + "type": "uint64[]" + }, + { + "internalType": "int64[]", + "name": "yFeeMint", + "type": "int64[]" + }, + { + "internalType": "uint64[]", + "name": "xFeeBurn", + "type": "uint64[]" + }, + { + "internalType": "int64[]", + "name": "yFeeBurn", + "type": "int64[]" + }, + { + "internalType": "bytes", + "name": "oracleConfig", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "whitelistData", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "contract IERC20[]", + "name": "subCollaterals", + "type": "address[]" + }, + { + "internalType": "bytes", + "name": "config", + "type": "bytes" + } + ], + "internalType": "struct ManagerStorage", + "name": "managerData", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "stablecoinCap", + "type": "uint256" + } + ], + "internalType": "struct Collateral", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCollateralList", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getCollateralMintFees", + "outputs": [ + { + "internalType": "uint64[]", + "name": "xFeeMint", + "type": "uint64[]" + }, + { + "internalType": "int64[]", + "name": "yFeeMint", + "type": "int64[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCollateralRatio", + "outputs": [ + { + "internalType": "uint64", + "name": "collatRatio", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "stablecoinsIssued", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getCollateralWhitelistData", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getIssuedByCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "stablecoinsFromCollateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stablecoinsIssued", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getManagerData", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "contract IERC20[]", + "name": "", + "type": "address[]" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getOracle", + "outputs": [ + { + "internalType": "enum OracleReadType", + "name": "oracleType", + "type": "uint8" + }, + { + "internalType": "enum OracleReadType", + "name": "targetType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "oracleData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "targetData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "hyperparameters", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getOracleValues", + "outputs": [ + { + "internalType": "uint256", + "name": "mint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "burn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ratio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redemption", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRedemptionFees", + "outputs": [ + { + "internalType": "uint64[]", + "name": "xRedemptionCurve", + "type": "uint64[]" + }, + { + "internalType": "int64[]", + "name": "yRedemptionCurve", + "type": "int64[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getStablecoinCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalIssued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isConsumingScheduledOp", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "internalType": "enum ActionType", + "name": "action", + "type": "uint8" + } + ], + "name": "isPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "isTrusted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "isTrustedSeller", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "isValidSelector", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "isWhitelistedCollateral", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "isWhitelistedForCollateral", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum WhitelistType", + "name": "whitelistType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "isWhitelistedForType", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokenP", + "outputs": [ + { + "internalType": "contract ITokenP", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x3692d021e10b08b44ac975e9cb5d4181db1977dd3201d4fafe3b10880395853a", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0x78BB4882b77D74aD9B04Ab71fE8e61f72595823C", + "transactionIndex": 89, + "gasUsed": "2611445", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8876bd7b79acfffd84b4d89e47e0f6118e909797749242d0344ea378f778db1a", + "transactionHash": "0x3692d021e10b08b44ac975e9cb5d4181db1977dd3201d4fafe3b10880395853a", + "logs": [], + "blockNumber": 8411095, + "cumulativeGasUsed": "20210026", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9d44d918681c9ad36f866ebee034a3d1", + "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidChainlinkRate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotCollateral\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"accessManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"getCollateralBurnFees\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"xFeeBurn\",\"type\":\"uint64[]\"},{\"internalType\":\"int64[]\",\"name\":\"yFeeBurn\",\"type\":\"int64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"getCollateralDecimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"getCollateralInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"isManaged\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"isMintLive\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"isBurnLive\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"onlyWhitelisted\",\"type\":\"uint8\"},{\"internalType\":\"uint216\",\"name\":\"normalizedStables\",\"type\":\"uint216\"},{\"internalType\":\"uint64[]\",\"name\":\"xFeeMint\",\"type\":\"uint64[]\"},{\"internalType\":\"int64[]\",\"name\":\"yFeeMint\",\"type\":\"int64[]\"},{\"internalType\":\"uint64[]\",\"name\":\"xFeeBurn\",\"type\":\"uint64[]\"},{\"internalType\":\"int64[]\",\"name\":\"yFeeBurn\",\"type\":\"int64[]\"},{\"internalType\":\"bytes\",\"name\":\"oracleConfig\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"whitelistData\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"contract IERC20[]\",\"name\":\"subCollaterals\",\"type\":\"address[]\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"struct ManagerStorage\",\"name\":\"managerData\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"stablecoinCap\",\"type\":\"uint256\"}],\"internalType\":\"struct Collateral\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCollateralList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"getCollateralMintFees\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"xFeeMint\",\"type\":\"uint64[]\"},{\"internalType\":\"int64[]\",\"name\":\"yFeeMint\",\"type\":\"int64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCollateralRatio\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"collatRatio\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"stablecoinsIssued\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"getCollateralWhitelistData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"getIssuedByCollateral\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stablecoinsFromCollateral\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stablecoinsIssued\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"getManagerData\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"contract IERC20[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"getOracle\",\"outputs\":[{\"internalType\":\"enum OracleReadType\",\"name\":\"oracleType\",\"type\":\"uint8\"},{\"internalType\":\"enum OracleReadType\",\"name\":\"targetType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"oracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"targetData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"hyperparameters\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"getOracleValues\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"mint\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"burn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ratio\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minRatio\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"redemption\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRedemptionFees\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"xRedemptionCurve\",\"type\":\"uint64[]\"},{\"internalType\":\"int64[]\",\"name\":\"yRedemptionCurve\",\"type\":\"int64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"getStablecoinCap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalIssued\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isConsumingScheduledOp\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"internalType\":\"enum ActionType\",\"name\":\"action\",\"type\":\"uint8\"}],\"name\":\"isPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"isTrusted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"isTrustedSeller\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"selector\",\"type\":\"bytes4\"}],\"name\":\"isValidSelector\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"isWhitelistedCollateral\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"isWhitelistedForCollateral\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum WhitelistType\",\"name\":\"whitelistType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"isWhitelistedForType\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenP\",\"outputs\":[{\"internalType\":\"contract ITokenP\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Cooper Labs\",\"custom:contact\":\"security@cooperlabs.xyz\",\"details\":\"There may be duplicates in the info provided by the getters defined hereThis contract is an authorized fork of Angle's `Getters` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/Getters.sol\",\"errors\":{\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}]},\"kind\":\"dev\",\"methods\":{\"getCollateralRatio()\":{\"details\":\"This function may revert and overflow if the collateral ratio is too big due to a too small amount of `stablecoinsIssued`. Due to this, it is recommended to initialize the system with a non negligible amount of `stablecoinsIssued` so DoS attacks on redemptions which use this function become economically impossible\"},\"getOracle(address)\":{\"returns\":{\"oracleData\":\"Extra data needed to read the oracle. For Chainlink oracles, this data is supposed to give the addresses of the Chainlink feeds to read, the stale periods for each feed, ...\",\"oracleType\":\"Type of oracle (Chainlink, external smart contract, ...)\",\"targetData\":\"Extra data needed to read the target price of the asset\",\"targetType\":\"Type passed to read the value of the target price\"}},\"getOracleValues(address)\":{\"details\":\"This function is not optimized for gas consumption as for instance the `burn` value for collateral is computed twice: once in `readBurn` and once in `getBurnOracle`\",\"returns\":{\"burn\":\"Oracle value that will be used for `collateral` for a burn transaction. This value is then used along with oracle values for all other collateral assets to get a global burn value for the oracle\",\"minRatio\":\"Minimum ratio across all collateral assets between a collateral burn price and its target price. This value is independent of `collateral` and is used to normalize the burn oracle value for burn transactions.\",\"mint\":\"Oracle value to be used for a mint transaction with `collateral`\",\"ratio\":\"Ratio, in base `10**18` between the oracle value of the `collateral` and its target price. This value is 10**18 if the oracle is greater than the collateral price\",\"redemption\":\"Oracle value that would be used to price `collateral` when computing the collateral ratio during a redemption\"}},\"isConsumingScheduledOp()\":{\"details\":\"Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs attacker controlled calls.\"},\"isWhitelistedForCollateral(address,address)\":{\"details\":\"This function is non view as it may consult external non view functions from whitelist providers\"},\"isWhitelistedForType(uint8,address)\":{\"details\":\"Note that ultimately whitelisting may depend as well on external providers\"}},\"title\":\"Getters\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"accessManager()\":{\"notice\":\"Returns the address of the `accessManager` contract\"},\"getCollateralBurnFees(address)\":{\"notice\":\"Returns the `xFee` and `yFee` arrays from which fees are computed when coming to burn for `collateral`\"},\"getCollateralDecimals(address)\":{\"notice\":\"Returns the decimals of a given `collateral`\"},\"getCollateralInfo(address)\":{\"notice\":\"Returns all the info in storage associated to a `collateral`\"},\"getCollateralList()\":{\"notice\":\"Returns the list of collateral assets supported by the system\"},\"getCollateralMintFees(address)\":{\"notice\":\"Returns the `xFee` and `yFee` arrays from which fees are computed when coming to mint with `collateral`\"},\"getCollateralRatio()\":{\"notice\":\"Returns the collateral ratio of Parallelizer in base `10**9` and a rounded version of the total amount of stablecoins issued\"},\"getCollateralWhitelistData(address)\":{\"notice\":\"Gets the data needed to deal with whitelists for `collateral`\"},\"getIssuedByCollateral(address)\":{\"notice\":\"Returns the amount of stablecoins issued from `collateral` and the total amount of stablecoins issued through Parallelizer\"},\"getManagerData(address)\":{\"notice\":\"Returns if a collateral is \\\"managed\\\" and the associated manager configuration\"},\"getOracle(address)\":{\"notice\":\"Returns the data used to compute oracle values for `collateral`\"},\"getOracleValues(address)\":{\"notice\":\"Returns the oracle values associated to `collateral`\"},\"getRedemptionFees()\":{\"notice\":\"Returns the `xFee` and `yFee` arrays used to compute the penalty factor depending on the collateral ratio when users come to redeem\"},\"getStablecoinCap(address)\":{\"notice\":\"Returns the stablecoin cap for `collateral`\"},\"getTotalIssued()\":{\"notice\":\"Returns the total amount of stablecoins issued through Parallelizer\"},\"isPaused(address,uint8)\":{\"notice\":\"Returns if the associated functionality is paused or not\"},\"isTrusted(address)\":{\"notice\":\"Returns if `sender` is trusted to update normalizers\"},\"isTrustedSeller(address)\":{\"notice\":\"Returns if `sender` is trusted to update sell rewards\"},\"isValidSelector(bytes4)\":{\"notice\":\"Checks whether a given `selector` is actually a valid selector corresponding to a function in one of the facets of the proxy\"},\"isWhitelistedCollateral(address)\":{\"notice\":\"Checks whether only whitelisted address can deal with `collateral` during burns and redemptions\"},\"isWhitelistedForCollateral(address,address)\":{\"notice\":\"Checks whether `sender` can deal with `collateral` during burns and redemptions\"},\"isWhitelistedForType(uint8,address)\":{\"notice\":\"Checks whether `sender` has a non null entry in the `isWhitelistedForType` storage mapping\"},\"tokenP()\":{\"notice\":\"Stablecoin minted by parallelizer\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/parallelizer/facets/Getters.sol\":\"Getters\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/manager/IAccessManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\ninterface IAccessManager {\\n /**\\n * @dev A delayed operation was scheduled.\\n */\\n event OperationScheduled(\\n bytes32 indexed operationId,\\n uint32 indexed nonce,\\n uint48 schedule,\\n address caller,\\n address target,\\n bytes data\\n );\\n\\n /**\\n * @dev A scheduled operation was executed.\\n */\\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev A scheduled operation was canceled.\\n */\\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev Informational labelling for a roleId.\\n */\\n event RoleLabel(uint64 indexed roleId, string label);\\n\\n /**\\n * @dev Emitted when `account` is granted `roleId`.\\n *\\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\\n * otherwise it indicates the execution delay for this account and roleId is updated.\\n */\\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\\n\\n /**\\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\\n */\\n event RoleRevoked(uint64 indexed roleId, address indexed account);\\n\\n /**\\n * @dev Role acting as admin over a given `roleId` is updated.\\n */\\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\\n\\n /**\\n * @dev Role acting as guardian over a given `roleId` is updated.\\n */\\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\\n\\n /**\\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\\n */\\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\\n\\n /**\\n * @dev Target mode is updated (true = closed, false = open).\\n */\\n event TargetClosed(address indexed target, bool closed);\\n\\n /**\\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\\n */\\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\\n\\n /**\\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\\n */\\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\\n\\n error AccessManagerAlreadyScheduled(bytes32 operationId);\\n error AccessManagerNotScheduled(bytes32 operationId);\\n error AccessManagerNotReady(bytes32 operationId);\\n error AccessManagerExpired(bytes32 operationId);\\n error AccessManagerLockedRole(uint64 roleId);\\n error AccessManagerBadConfirmation();\\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\\n error AccessManagerUnauthorizedConsume(address target);\\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\\n\\n /**\\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\\n * & {execute} workflow.\\n *\\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\\n * for future execution.\\n *\\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\\n * the operation can be executed if and only if delay is greater than 0.\\n *\\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\\n *\\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\\n * {AccessManager} documentation.\\n */\\n function canCall(\\n address caller,\\n address target,\\n bytes4 selector\\n ) external view returns (bool allowed, uint32 delay);\\n\\n /**\\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\\n *\\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\\n * disabling any scheduling usage.\\n */\\n function expiration() external view returns (uint32);\\n\\n /**\\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\\n * can be increased without setback (and reset via {revokeRole} in the case event of an\\n * accidental increase). Defaults to 5 days.\\n */\\n function minSetback() external view returns (uint32);\\n\\n /**\\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\\n *\\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\\n */\\n function isTargetClosed(address target) external view returns (bool);\\n\\n /**\\n * @dev Get the role required to call a function.\\n */\\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\\n\\n /**\\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\\n */\\n function getTargetAdminDelay(address target) external view returns (uint32);\\n\\n /**\\n * @dev Get the id of the role that acts as an admin for the given role.\\n *\\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\\n * an operation that is restricted to this role.\\n */\\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role that acts as a guardian for a given role.\\n *\\n * The guardian permission allows canceling operations that have been scheduled under the role.\\n */\\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role current grant delay.\\n *\\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\\n */\\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\\n\\n /**\\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\\n * level.\\n *\\n * Returns:\\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\\n * [1] Current execution delay for the account.\\n * [2] Pending execution delay for the account.\\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\\n */\\n function getAccess(\\n uint64 roleId,\\n address account\\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\\n\\n /**\\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\\n * permission might be associated with an execution delay. {getAccess} can provide more details.\\n */\\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\\n\\n /**\\n * @dev Give a label to a role, for improved role discoverability by UIs.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleLabel} event.\\n */\\n function labelRole(uint64 roleId, string calldata label) external;\\n\\n /**\\n * @dev Add `account` to `roleId`, or change its execution delay.\\n *\\n * This gives the account the authorization to call any function that is restricted to this role. An optional\\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\\n *\\n * If the account has already been granted this role, the execution delay will be updated. This update is not\\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - granted role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleGranted} event.\\n */\\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\\n\\n /**\\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\\n * no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - revoked role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function revokeRole(uint64 roleId, address account) external;\\n\\n /**\\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\\n * the role this call has no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function renounceRole(uint64 roleId, address callerConfirmation) external;\\n\\n /**\\n * @dev Change admin role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleAdminChanged} event\\n */\\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\\n\\n /**\\n * @dev Change guardian role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGuardianChanged} event\\n */\\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\\n\\n /**\\n * @dev Update the delay for granting a `roleId`.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGrantDelayChanged} event.\\n */\\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetFunctionRoleUpdated} event per selector.\\n */\\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\\n\\n /**\\n * @dev Set the delay for changing the configuration of a given target contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetAdminDelayUpdated} event.\\n */\\n function setTargetAdminDelay(address target, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the closed flag for a contract.\\n *\\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetClosed} event.\\n */\\n function setTargetClosed(address target, bool closed) external;\\n\\n /**\\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\\n * operation is not yet scheduled, has expired, was executed, or was canceled.\\n */\\n function getSchedule(bytes32 id) external view returns (uint48);\\n\\n /**\\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\\n * been scheduled.\\n */\\n function getNonce(bytes32 id) external view returns (uint32);\\n\\n /**\\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\\n * required for the caller. The special value zero will automatically set the earliest possible time.\\n *\\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\\n *\\n * Emits a {OperationScheduled} event.\\n *\\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\\n * contract if it is using standard Solidity ABI encoding.\\n */\\n function schedule(\\n address target,\\n bytes calldata data,\\n uint48 when\\n ) external returns (bytes32 operationId, uint32 nonce);\\n\\n /**\\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\\n * execution delay is 0.\\n *\\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\\n *\\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\\n */\\n function execute(address target, bytes calldata data) external payable returns (uint32);\\n\\n /**\\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\\n * operation that is cancelled.\\n *\\n * Requirements:\\n *\\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\\n *\\n * Emits a {OperationCanceled} event.\\n */\\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\\n\\n /**\\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\\n *\\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\\n * with all the verifications that it implies.\\n *\\n * Emit a {OperationExecuted} event.\\n */\\n function consumeScheduledOp(address caller, bytes calldata data) external;\\n\\n /**\\n * @dev Hashing function for delayed operations.\\n */\\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\\n\\n /**\\n * @dev Changes the authority of a target managed by this manager instance.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n */\\n function updateAuthority(address target, address newAuthority) external;\\n}\\n\",\"keccak256\":\"0x9be2d08a326515805bc9cf6315b7953f8d1ebe88abf48c2d645fb1fa8211a0e2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/interfaces/IGetters.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\n\\nimport \\\"../parallelizer/Storage.sol\\\";\\n\\n/// @title IGetters\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IGetters` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IGetters.sol\\ninterface IGetters {\\n /// @notice Checks whether a given `selector` is actually a valid selector corresponding to a function in one of\\n /// the\\n /// facets of the proxy\\n function isValidSelector(bytes4 selector) external view returns (bool);\\n\\n /// @notice Stablecoin minted by parallelizer\\n function tokenP() external view returns (ITokenP);\\n\\n /// @notice Returns the list of collateral assets supported by the system\\n function getCollateralList() external view returns (address[] memory);\\n\\n /// @notice Returns all the info in storage associated to a `collateral`\\n function getCollateralInfo(address collateral) external view returns (Collateral memory);\\n\\n /// @notice Returns the decimals of a given `collateral`\\n function getCollateralDecimals(address collateral) external view returns (uint8);\\n\\n /// @notice Returns the `xFee` and `yFee` arrays from which fees are computed when coming to mint\\n /// with `collateral`\\n function getCollateralMintFees(address collateral) external view returns (uint64[] memory, int64[] memory);\\n\\n /// @notice Returns the `xFee` and `yFee` arrays from which fees are computed when coming to burn\\n /// for `collateral`\\n function getCollateralBurnFees(address collateral) external view returns (uint64[] memory, int64[] memory);\\n\\n /// @notice Returns the `xFee` and `yFee` arrays used to compute the penalty factor depending on the collateral\\n /// ratio when users come to redeem\\n function getRedemptionFees() external view returns (uint64[] memory, int64[] memory);\\n\\n /// @notice Returns the collateral ratio of Parallelizer in base `10**9` and a rounded version of the total amount\\n /// of stablecoins issued\\n function getCollateralRatio() external view returns (uint64 collatRatio, uint256 stablecoinsIssued);\\n\\n /// @notice Returns the total amount of stablecoins issued through Parallelizer\\n function getTotalIssued() external view returns (uint256 stablecoinsIssued);\\n\\n /// @notice Returns the amount of stablecoins issued from `collateral` and the total amount of stablecoins issued\\n /// through Parallelizer\\n function getIssuedByCollateral(address collateral)\\n external\\n view\\n returns (uint256 stablecoinsFromCollateral, uint256 stablecoinsIssued);\\n\\n /// @notice Returns if a collateral is \\\"managed\\\" and the associated manager configuration\\n function getManagerData(address collateral)\\n external\\n view\\n returns (bool isManaged, IERC20[] memory subCollaterals, bytes memory config);\\n\\n /// @notice Returns the oracle values associated to `collateral`\\n /// @return mint Oracle value to be used for a mint transaction with `collateral`\\n /// @return burn Oracle value that will be used for `collateral` for a burn transaction. This value\\n /// is then used along with oracle values for all other collateral assets to get a global burn value for the oracle\\n /// @return ratio Ratio, in base `10**18` between the oracle value of the `collateral` and its target price.\\n /// This value is 10**18 if the oracle is greater than the collateral price\\n /// @return minRatio Minimum ratio across all collateral assets between a collateral burn price and its target\\n /// price. This value is independent of `collateral` and is used to normalize the burn oracle value for burn\\n /// transactions.\\n /// @return redemption Oracle value that would be used to price `collateral` when computing the collateral ratio\\n /// during a redemption\\n function getOracleValues(address collateral)\\n external\\n view\\n returns (uint256 mint, uint256 burn, uint256 ratio, uint256 minRatio, uint256 redemption);\\n\\n /// @notice Returns the data used to compute oracle values for `collateral`\\n /// @return oracleType Type of oracle (Chainlink, external smart contract, ...)\\n /// @return targetType Type passed to read the value of the target price\\n /// @return oracleData Extra data needed to read the oracle. For Chainlink oracles, this data is supposed to give\\n /// the addresses of the Chainlink feeds to read, the stale periods for each feed, ...\\n /// @return targetData Extra data needed to read the target price of the asset\\n function getOracle(address collateral)\\n external\\n view\\n returns (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n );\\n\\n /// @notice Returns if the associated functionality is paused or not\\n function isPaused(address collateral, ActionType action) external view returns (bool);\\n\\n /// @notice Returns if `sender` is trusted to update normalizers\\n function isTrusted(address sender) external view returns (bool);\\n\\n /// @notice Returns if `sender` is trusted to update sell rewards\\n function isTrustedSeller(address sender) external view returns (bool);\\n\\n /// @notice Checks whether `sender` has a non null entry in the `isWhitelistedForType` storage mapping\\n /// @dev Note that ultimately whitelisting may depend as well on external providers\\n function isWhitelistedForType(WhitelistType whitelistType, address sender) external view returns (bool);\\n\\n /// @notice Checks whether `sender` can deal with `collateral` during burns and redemptions\\n function isWhitelistedForCollateral(address collateral, address sender) external returns (bool);\\n\\n /// @notice Checks whether only whitelisted address can deal with `collateral` during burns and redemptions\\n function isWhitelistedCollateral(address collateral) external view returns (bool);\\n\\n /// @notice Gets the data needed to deal with whitelists for `collateral`\\n function getCollateralWhitelistData(address collateral) external view returns (bytes memory);\\n\\n /// @notice Returns the stablecoin cap for `collateral`\\n function getStablecoinCap(address collateral) external view returns (uint256);\\n\\n /// @notice Returns the address of the `accessManager` contract\\n function accessManager() external view returns (address);\\n\\n /// @dev Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is\\n /// being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs\\n /// attacker controlled calls.\\n function isConsumingScheduledOp() external view returns (bytes4);\\n}\\n\",\"keccak256\":\"0xaa9eba6ee7770d6146fedbfef07ad10ff09524692319ca0cc32abfa64a2b597b\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IManager` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IManager.sol\\ninterface IManager {\\n /// @notice Returns the amount of collateral managed by the Manager\\n /// @return balances Balances of all the subCollaterals handled by the manager\\n /// @dev MUST NOT revert\\n function totalAssets() external view returns (uint256[] memory balances, uint256 totalValue);\\n\\n /// @notice Hook to invest `amount` of `collateral`\\n /// @dev MUST revert if the manager cannot accept these funds\\n /// @dev MUST have received the funds beforehand\\n function invest(uint256 amount) external;\\n\\n /// @notice Sends `amount` of `collateral` to the `to` address\\n /// @dev Called when `tokenP` are burnt and during redemptions\\n // @dev MUST revert if there are not funds enough available\\n /// @dev MUST be callable only by the parallelizer\\n function release(address asset, address to, uint256 amount) external;\\n\\n /// @notice Gives the maximum amount of collateral immediately available for a transfer\\n /// @dev Useful for integrators using `quoteIn` and `quoteOut`\\n function maxAvailable() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8507172834f0243643fcf366bff6bae8f20523d102f5896f2140946975458e2c\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IParallelizerOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IParallelizerOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IParallelizerOracle` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IParallelizerOracle.sol\\ninterface IParallelizerOracle {\\n /// @notice Reads the oracle value for asset to use in a redemption to compute the collateral ratio\\n function readRedemption() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a mint. It should be comprehensive of the\\n /// deviation from the target price\\n function readMint() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a burn transaction as well as the ratio\\n /// between the current price and the target price for the asset\\n function readBurn() external view returns (uint256 oracleValue, uint256 ratio);\\n\\n /// @notice Reads the oracle value for asset\\n function read() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb7287bfcade62fa4dfb07ea1cd6c1fc8be1525320f3faca44d8d9a6a01e99110\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/ITokenP.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title ITokenP\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Interface for the stablecoins `tokenP` contracts\\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\\ninterface ITokenP is IERC20 {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MINTER ROLE ONLY FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Lets a whitelisted contract mint tokenPs\\n /// @param account Address to mint to\\n /// @param amount Amount to mint\\n function mint(address account, uint256 amount) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @param sender Address which requested the burn from `burner`\\n /// @dev This method is to be called by a contract with the minter right after being requested\\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\\n /// @dev The method checks the allowance between the `sender` and the `burner`\\n function burnFrom(uint256 amount, address burner, address sender) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\\n /// requested to do so by an address willing to burn tokens from its address\\n function burnSelf(uint256 amount, address burner) external;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Amount of decimals of the stablecoin\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x64a1305faa8c5c91767a11af0eae16e4b463aa0bfe10f11b74aae9d96681a5eb\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\ninterface AggregatorV3Interface {\\n function decimals() external view returns (uint8);\\n\\n function description() external view returns (string memory);\\n\\n function version() external view returns (uint256);\\n\\n // getRoundData and latestRoundData should both raise \\\"No data present\\\"\\n // if they do not have data to report, instead of returning unset values\\n // which could be misinterpreted as actual reported values.\\n function getRoundData(uint80 _roundId)\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n\\n function latestRoundData()\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n}\\n\",\"keccak256\":\"0x94da577160ebb1bfeb7008676c8e7d43dda926d9c0beee29077e9ed774707373\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/coinbase/ICbETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ICbETH\\n/// @notice Interface for the `cbETH` contract\\ninterface ICbETH {\\n function exchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb159341cb0e25c478912b274cdda2d50fa84692aeac87b6823d281aaea2aed04\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/frax/ISfrxETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ISfrxETH\\n/// @notice Interface for the `sfrxETH` contract\\ninterface ISfrxETH {\\n function pricePerShare() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x914cbea276f817c7db62bfca21e15bd8f7892faa9f39d86baaef574cf12b859f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/keyring/IKeyringGuard.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IKeyringGuard\\n/// @notice Interface for the `KeyringGuard` contract\\ninterface IKeyringGuard {\\n function isAuthorized(address from, address to) external returns (bool passed);\\n}\\n\",\"keccak256\":\"0x30bdab602ba0a6e2571372803ae35f7bebcc354d69408be627c04c57f7071f90\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/lido/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IStETH\\n/// @notice Interface for the `StETH` contract\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n\\n function submit(address) external payable returns (uint256);\\n\\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf21e3d8bdadc236b34bf2122b0e0b939d2d6bb6e2889b508636cbb7b84f59680\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/morpho/IMorphoOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IMorphoOracle\\n/// @notice Interface for the oracle contracts used within Morpho\\ninterface IMorphoOracle {\\n function price() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x0d1849803b554763f1dce55eba5a6e8d7c5b12d4cc8dfe23637e827d2ee91d17\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/rocketPool/IRETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IRETH\\n/// @notice Interface for the `rETH` contract\\ninterface IRETH {\\n function getExchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x567a378e95d40160e297c1adb617ccaa69c03e49c4ad72a6ce651dd43cdbd5cd\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/Storage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ENUMS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nenum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n}\\n\\nenum ManagerType {\\n EXTERNAL\\n}\\n\\nenum ActionType {\\n Mint,\\n Burn,\\n Redeem\\n}\\n\\nenum TrustedType {\\n Updater,\\n Seller\\n}\\n\\nenum QuoteType {\\n MintExactInput,\\n MintExactOutput,\\n BurnExactInput,\\n BurnExactOutput\\n}\\n\\nenum OracleReadType {\\n CHAINLINK_FEEDS,\\n EXTERNAL,\\n NO_ORACLE,\\n STABLE,\\n WSTETH,\\n CBETH,\\n RETH,\\n SFRXETH,\\n MAX,\\n MORPHO_ORACLE\\n}\\n\\nenum OracleQuoteType {\\n UNIT,\\n TARGET\\n}\\n\\nenum WhitelistType {\\n BACKED\\n}\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STRUCTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nstruct Permit2Details {\\n address to; // Address that will receive the funds\\n uint256 nonce; // Nonce of the transaction\\n bytes signature; // Permit signature of the user\\n}\\n\\nstruct FacetCut {\\n address facetAddress; // Facet contract address\\n FacetCutAction action; // Can be add, remove or replace\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct Facet {\\n address facetAddress; // Facet contract address\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct FacetInfo {\\n address facetAddress; // Facet contract address\\n uint16 selectorPosition; // Position in the list of all selectors\\n}\\n\\nstruct DiamondStorage {\\n bytes4[] selectors; // List of all available selectors\\n mapping(bytes4 => FacetInfo) selectorInfo; // Selector to (address, position in list)\\n IAccessManager accessManager; // Contract handling access management\\n}\\n\\nstruct ImplementationStorage {\\n address implementation; // Dummy implementation address for Etherscan usability\\n}\\n\\nstruct ManagerStorage {\\n IERC20[] subCollaterals; // Subtokens handled by the manager or strategies\\n bytes config; // Additional configuration data\\n}\\n\\nstruct Collateral {\\n uint8 isManaged; // If the collateral is managed through external strategies\\n uint8 isMintLive; // If minting from this asset is unpaused\\n uint8 isBurnLive; // If burning to this asset is unpaused\\n uint8 decimals; // IERC20Metadata(collateral).decimals()\\n uint8 onlyWhitelisted; // If only whitelisted addresses can burn or redeem for this token\\n uint216 normalizedStables; // Normalized amount of stablecoins issued from this collateral\\n uint64[] xFeeMint; // Increasing exposures in [0,BASE_9[\\n int64[] yFeeMint; // Mint fees at the exposures specified in `xFeeMint`\\n uint64[] xFeeBurn; // Decreasing exposures in ]0,BASE_9]\\n int64[] yFeeBurn; // Burn fees at the exposures specified in `xFeeBurn`\\n bytes oracleConfig; // Data about the oracle used for the collateral\\n bytes whitelistData; // For whitelisted collateral, data used to verify whitelists\\n ManagerStorage managerData; // For managed collateral, data used to handle the strategies\\n uint256 stablecoinCap; // Cap on the amount of stablecoins that can be issued from this collateral\\n}\\n\\nstruct ParallelizerStorage {\\n ITokenP tokenP; // tokenP handled by the system\\n uint8 isRedemptionLive; // If redemption is unpaused\\n uint8 statusReentrant; // If call is reentrant or not\\n bool consumingSchedule; // If the contract is consuming a scheduled operation\\n uint128 normalizedStables; // Normalized amount of stablecoins issued by the system\\n uint128 normalizer; // To reconcile `normalizedStables` values with the actual amount\\n address[] collateralList; // List of collateral assets supported by the system\\n uint64[] xRedemptionCurve; // Increasing collateral ratios > 0\\n int64[] yRedemptionCurve; // Value of the redemption fees at `xRedemptionCurve`\\n mapping(address => Collateral) collaterals; // Maps a collateral asset to its parameters\\n mapping(address => uint256) isTrusted; // If an address is trusted to update the normalizer value\\n mapping(address => uint256) isSellerTrusted; // If an address is trusted to sell accruing reward tokens or to run\\n // keeper jobs on oracles\\n mapping(WhitelistType => mapping(address => uint256)) isWhitelistedForType;\\n}\\n// Whether an address is whitelisted for a specific whitelist type\\n\",\"keccak256\":\"0x3f4313dd110dbe390038320b2d3cf24dcbe9b75cd9573e7f048f7233c02dd227\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/Getters.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IGetters } from \\\"contracts/interfaces/IGetters.sol\\\";\\n\\nimport { LibOracle } from \\\"../libraries/LibOracle.sol\\\";\\nimport { LibGetters } from \\\"../libraries/LibGetters.sol\\\";\\nimport { LibStorage as s } from \\\"../libraries/LibStorage.sol\\\";\\nimport { LibWhitelist } from \\\"../libraries/LibWhitelist.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title Getters\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev There may be duplicates in the info provided by the getters defined here\\n/// @dev This contract is an authorized fork of Angle's `Getters` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/Getters.sol\\ncontract Getters is IGetters {\\n /// @inheritdoc IGetters\\n function isValidSelector(bytes4 selector) external view returns (bool) {\\n return s.diamondStorage().selectorInfo[selector].facetAddress != address(0);\\n }\\n\\n /// @inheritdoc IGetters\\n function tokenP() external view returns (ITokenP) {\\n return s.transmuterStorage().tokenP;\\n }\\n\\n /// @inheritdoc IGetters\\n function getCollateralList() external view returns (address[] memory) {\\n return s.transmuterStorage().collateralList;\\n }\\n\\n /// @inheritdoc IGetters\\n function getCollateralInfo(address collateral) external view returns (Collateral memory) {\\n return s.transmuterStorage().collaterals[collateral];\\n }\\n\\n /// @inheritdoc IGetters\\n function getCollateralDecimals(address collateral) external view returns (uint8) {\\n return s.transmuterStorage().collaterals[collateral].decimals;\\n }\\n\\n /// @inheritdoc IGetters\\n function getCollateralMintFees(address collateral)\\n external\\n view\\n returns (uint64[] memory xFeeMint, int64[] memory yFeeMint)\\n {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n return (collatInfo.xFeeMint, collatInfo.yFeeMint);\\n }\\n\\n /// @inheritdoc IGetters\\n function getCollateralBurnFees(address collateral)\\n external\\n view\\n returns (uint64[] memory xFeeBurn, int64[] memory yFeeBurn)\\n {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n return (collatInfo.xFeeBurn, collatInfo.yFeeBurn);\\n }\\n\\n /// @inheritdoc IGetters\\n function getRedemptionFees()\\n external\\n view\\n returns (uint64[] memory xRedemptionCurve, int64[] memory yRedemptionCurve)\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n return (ts.xRedemptionCurve, ts.yRedemptionCurve);\\n }\\n\\n /// @inheritdoc IGetters\\n /// @dev This function may revert and overflow if the collateral ratio is too big due to a too small\\n /// amount of `stablecoinsIssued`. Due to this, it is recommended to initialize the system with a non\\n /// negligible amount of `stablecoinsIssued` so DoS attacks on redemptions which use this function\\n /// become economically impossible\\n function getCollateralRatio() external view returns (uint64 collatRatio, uint256 stablecoinsIssued) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n // Reentrant protection\\n if (ts.statusReentrant == ENTERED) revert ReentrantCall();\\n\\n (collatRatio, stablecoinsIssued,,,) = LibGetters.getCollateralRatio();\\n }\\n\\n /// @inheritdoc IGetters\\n function getIssuedByCollateral(address collateral)\\n external\\n view\\n returns (uint256 stablecoinsFromCollateral, uint256 stablecoinsIssued)\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint256 _normalizer = ts.normalizer;\\n return (\\n (uint256(ts.collaterals[collateral].normalizedStables) * _normalizer) / BASE_27,\\n (uint256(ts.normalizedStables) * _normalizer) / BASE_27\\n );\\n }\\n\\n /// @inheritdoc IGetters\\n function getTotalIssued() external view returns (uint256) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n return (uint256(ts.normalizedStables) * uint256(ts.normalizer)) / BASE_27;\\n }\\n\\n /// @inheritdoc IGetters\\n function getManagerData(address collateral) external view returns (bool, IERC20[] memory, bytes memory) {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.isManaged > 0) {\\n return (true, collatInfo.managerData.subCollaterals, collatInfo.managerData.config);\\n }\\n return (false, new IERC20[](0), \\\"\\\");\\n }\\n\\n /// @inheritdoc IGetters\\n /// @dev This function is not optimized for gas consumption as for instance the `burn` value for collateral\\n /// is computed twice: once in `readBurn` and once in `getBurnOracle`\\n function getOracleValues(address collateral)\\n external\\n view\\n returns (uint256 mint, uint256 burn, uint256 ratio, uint256 minRatio, uint256 redemption)\\n {\\n bytes memory oracleConfig = s.transmuterStorage().collaterals[collateral].oracleConfig;\\n (burn, ratio) = LibOracle.readBurn(oracleConfig);\\n (minRatio,) = LibOracle.getBurnOracle(collateral, oracleConfig);\\n return (LibOracle.readMint(oracleConfig), burn, ratio, minRatio, LibOracle.readRedemption(oracleConfig));\\n }\\n\\n /// @inheritdoc IGetters\\n function getOracle(address collateral)\\n external\\n view\\n returns (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n )\\n {\\n return LibOracle.getOracle(collateral);\\n }\\n\\n /// @inheritdoc IGetters\\n function isPaused(address collateral, ActionType action) external view returns (bool) {\\n if (action == ActionType.Mint || action == ActionType.Burn) {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n if (action == ActionType.Mint) {\\n return collatInfo.isMintLive == 0;\\n } else {\\n return collatInfo.isBurnLive == 0;\\n }\\n } else {\\n return s.transmuterStorage().isRedemptionLive == 0;\\n }\\n }\\n\\n /// @inheritdoc IGetters\\n function isTrusted(address sender) external view returns (bool) {\\n return s.transmuterStorage().isTrusted[sender] == 1;\\n }\\n\\n /// @inheritdoc IGetters\\n function isTrustedSeller(address sender) external view returns (bool) {\\n return s.transmuterStorage().isSellerTrusted[sender] == 1;\\n }\\n\\n /// @inheritdoc IGetters\\n function isWhitelistedForType(WhitelistType whitelistType, address sender) external view returns (bool) {\\n return s.transmuterStorage().isWhitelistedForType[whitelistType][sender] > 0;\\n }\\n\\n /// @inheritdoc IGetters\\n /// @dev This function is non view as it may consult external non view functions from whitelist providers\\n function isWhitelistedForCollateral(address collateral, address sender) external returns (bool) {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n return (collatInfo.onlyWhitelisted == 0 || LibWhitelist.checkWhitelist(collatInfo.whitelistData, sender));\\n }\\n\\n /// @inheritdoc IGetters\\n function isWhitelistedCollateral(address collateral) external view returns (bool) {\\n return s.transmuterStorage().collaterals[collateral].onlyWhitelisted == 1;\\n }\\n\\n /// @inheritdoc IGetters\\n function getCollateralWhitelistData(address collateral) external view returns (bytes memory) {\\n return s.transmuterStorage().collaterals[collateral].whitelistData;\\n }\\n\\n /// @inheritdoc IGetters\\n function getStablecoinCap(address collateral) external view returns (uint256) {\\n return s.transmuterStorage().collaterals[collateral].stablecoinCap;\\n }\\n\\n /// @inheritdoc IGetters\\n function accessManager() external view returns (address) {\\n return address(s.diamondStorage().accessManager);\\n }\\n\\n /// @inheritdoc IGetters\\n function isConsumingScheduledOp() external view returns (bytes4) {\\n return s.transmuterStorage().consumingSchedule ? this.isConsumingScheduledOp.selector : bytes4(0);\\n }\\n}\\n\",\"keccak256\":\"0x874e67a5bcfd8af1de10908bcac1a0c9bc78dd7ba4620cc9e61ef9e3d22acf5b\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibGetters.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport { SafeCast } from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\n\\nimport { LibHelpers } from \\\"./LibHelpers.sol\\\";\\nimport { LibManager } from \\\"./LibManager.sol\\\";\\nimport { LibOracle } from \\\"./LibOracle.sol\\\";\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibGetters\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibGetters` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibGetters.sol\\nlibrary LibGetters {\\n using Math for uint256;\\n using SafeCast for uint256;\\n\\n /// @notice Internal version of the `getCollateralRatio` function with additional return values like `tokens` that\\n /// is the list of tokens supported by the system, or `balances` which is the amount of each token in `tokens`\\n /// controlled by the protocol\\n /// @dev In case some collaterals support external strategies (`isManaged>0`), this list may be bigger\\n /// than the `collateralList`\\n /// @dev `subCollateralsTracker` is an array which gives for each collateral asset in the collateral list an\\n /// accumulator helping to recompute the amount of sub-collateral for each collateral. If the array is:\\n /// [1,4,5], this means that the collateral with index 1 in the `collateralsList` has 4-1=3 sub-collaterals.\\n function getCollateralRatio()\\n internal\\n view\\n returns (\\n uint64 collatRatio,\\n uint256 stablecoinsIssued,\\n address[] memory tokens,\\n uint256[] memory balances,\\n uint256[] memory subCollateralsTracker\\n )\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint256 totalCollateralization;\\n address[] memory collateralList = ts.collateralList;\\n uint256 collateralListLength = collateralList.length;\\n uint256 subCollateralsAmount;\\n // Building the `subCollateralsTracker` array which is useful when later sending the tokens as part of the\\n // redemption\\n subCollateralsTracker = new uint256[](collateralListLength);\\n for (uint256 i; i < collateralListLength; ++i) {\\n if (ts.collaterals[collateralList[i]].isManaged == 0) ++subCollateralsAmount;\\n else subCollateralsAmount += ts.collaterals[collateralList[i]].managerData.subCollaterals.length;\\n subCollateralsTracker[i] = subCollateralsAmount;\\n }\\n balances = new uint256[](subCollateralsAmount);\\n tokens = new address[](subCollateralsAmount);\\n\\n {\\n uint256 countCollat;\\n for (uint256 i; i < collateralListLength; ++i) {\\n Collateral storage collateral = ts.collaterals[collateralList[i]];\\n uint256 collateralBalance; // Will be either the balance or the value of assets managed\\n if (collateral.isManaged > 0) {\\n // If a collateral is managed, the balances of the sub-collaterals cannot be directly obtained by\\n // calling `balanceOf` of the sub-collaterals\\n uint256[] memory subCollateralsBalances;\\n (subCollateralsBalances, collateralBalance) = LibManager.totalAssets(collateral.managerData.config);\\n uint256 numSubCollats = subCollateralsBalances.length;\\n for (uint256 k; k < numSubCollats; ++k) {\\n tokens[countCollat + k] = address(collateral.managerData.subCollaterals[k]);\\n balances[countCollat + k] = subCollateralsBalances[k];\\n }\\n countCollat += numSubCollats;\\n } else {\\n collateralBalance = IERC20(collateralList[i]).balanceOf(address(this));\\n tokens[countCollat] = collateralList[i];\\n balances[countCollat++] = collateralBalance;\\n }\\n uint256 oracleValue = LibOracle.readRedemption(collateral.oracleConfig);\\n totalCollateralization +=\\n (oracleValue * LibHelpers.convertDecimalTo(collateralBalance, collateral.decimals, 18)) / BASE_18;\\n }\\n }\\n // The `stablecoinsIssued` value need to be rounded up because it is then used as a divizer when computing\\n // the `collatRatio`\\n stablecoinsIssued = uint256(ts.normalizedStables).mulDiv(ts.normalizer, BASE_27, Math.Rounding.Ceil);\\n if (stablecoinsIssued > 0) {\\n collatRatio = (totalCollateralization.mulDiv(BASE_9, stablecoinsIssued, Math.Rounding.Ceil)).toUint64();\\n } else {\\n collatRatio = type(uint64).max;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9d5a32ebe58604bf34e29dc8e1624077db26cacaf621f31c98c8c5e12b06dad2\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibHelpers.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibHelpers\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibHelpers` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibHelpers.sol\\nlibrary LibHelpers {\\n /// @notice Rebases the units of `amount` from `fromDecimals` to `toDecimals`\\n function convertDecimalTo(uint256 amount, uint8 fromDecimals, uint8 toDecimals) internal pure returns (uint256) {\\n if (fromDecimals > toDecimals) return amount / 10 ** (fromDecimals - toDecimals);\\n else if (fromDecimals < toDecimals) return amount * 10 ** (toDecimals - fromDecimals);\\n else return amount;\\n }\\n\\n /// @notice Checks whether a `token` is in a list `tokens` and returns the index of the token in the list\\n /// or -1 in the other case\\n function checkList(address token, address[] memory tokens) internal pure returns (int256) {\\n uint256 tokensLength = tokens.length;\\n for (uint256 i; i < tokensLength; ++i) {\\n if (token == tokens[i]) return int256(i);\\n }\\n return -1;\\n }\\n\\n /// @notice Searches a sorted `array` and returns the first index that contains a value strictly greater\\n /// (or lower if increasingArray is false) to `element` minus 1\\n /// @dev If no such index exists (i.e. all values in the array are strictly lesser/greater than `element`),\\n /// either array length minus 1, or 0 are returned\\n /// @dev The time complexity of the search is O(log n).\\n /// @dev Inspired from OpenZeppelin Contracts v4.4.1:\\n /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Arrays.sol\\n /// @dev Modified by Angle Labs to support `uint64`, monotonous arrays and exclusive upper bounds\\n function findLowerBound(\\n bool increasingArray,\\n uint64[] memory array,\\n uint64 normalizerArray,\\n uint64 element\\n )\\n internal\\n pure\\n returns (uint256)\\n {\\n if (array.length == 0) {\\n return 0;\\n }\\n uint256 low = 1;\\n uint256 high = array.length;\\n\\n if (\\n (increasingArray && array[high - 1] * normalizerArray <= element)\\n || (!increasingArray && array[high - 1] * normalizerArray >= element)\\n ) return high - 1;\\n\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds down (it does integer division with truncation).\\n if (increasingArray ? array[mid] * normalizerArray > element : array[mid] * normalizerArray < element) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n // At this point `low` is the exclusive upper bound.\\n // `low - 1` is the inclusive lower bound.\\n return low - 1;\\n }\\n\\n /// @notice Evaluates for `x` a piecewise linear function defined with the breaking points in the arrays\\n /// `xArray` and `yArray`\\n /// @dev The values in the `xArray` must be increasing\\n function piecewiseLinear(uint64 x, uint64[] memory xArray, int64[] memory yArray) internal pure returns (int64) {\\n uint256 indexLowerBound = findLowerBound(true, xArray, 1, x);\\n if (indexLowerBound == 0 && x < xArray[0]) return yArray[0];\\n else if (indexLowerBound == xArray.length - 1) return yArray[xArray.length - 1];\\n return yArray[indexLowerBound]\\n + ((yArray[indexLowerBound + 1] - yArray[indexLowerBound]) * int64(x - xArray[indexLowerBound]))\\n / int64(xArray[indexLowerBound + 1] - xArray[indexLowerBound]);\\n }\\n}\\n\",\"keccak256\":\"0xfbda0e69409593ef0e4a176a7909d980e3cf09b2c4642cd2c6d16e1773c6e6f2\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/libraries/LibManager.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IManager } from \\\"contracts/interfaces/IManager.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Managed collateral assets may be handled through external smart contracts or directly through this library\\n/// @dev There is no implementation at this point for a managed collateral handled through this library, and\\n/// a new specific `ManagerType` would need to be added in this case\\n/// @dev This library is an authorized fork of Angle's `LibManager` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibManager.sol\\nlibrary LibManager {\\n /// @notice Checks to which address managed funds must be transferred\\n function transferRecipient(bytes memory config) internal view returns (address recipient) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n recipient = address(this);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (address));\\n }\\n\\n /// @notice Performs a transfer of `token` for a collateral that is managed to a `to` address\\n /// @dev `token` may not be the actual collateral itself, as some collaterals have subcollaterals associated\\n /// with it\\n /// @dev Eventually pulls funds from strategies\\n function release(address token, address to, uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).release(token, to, amount);\\n }\\n\\n /// @notice Gets the balances of all the tokens controlled through `managerData`\\n /// @return balances An array of size `subCollaterals` with current balances of all subCollaterals\\n /// including the one corresponding to the `managerData` given\\n /// @return totalValue The value of all the `subCollaterals` in `collateral`\\n /// @dev `subCollaterals` must always have as first token (index 0) the collateral itself\\n function totalAssets(bytes memory config) internal view returns (uint256[] memory balances, uint256 totalValue) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).totalAssets();\\n }\\n\\n /// @notice Calls a hook if needed after new funds have been transfered to a manager\\n function invest(uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).invest(amount);\\n }\\n\\n /// @notice Returns available underlying tokens, for instance if liquidity is fully used and\\n /// not withdrawable the function will return 0\\n function maxAvailable(bytes memory config) internal view returns (uint256 available) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).maxAvailable();\\n }\\n\\n /// @notice Decodes the `managerData` associated to a collateral\\n function parseManagerConfig(bytes memory config) internal pure returns (ManagerType managerType, bytes memory data) {\\n (managerType, data) = abi.decode(config, (ManagerType, bytes));\\n }\\n}\\n\",\"keccak256\":\"0x18282c744bc34bd9ae937c0c49e909c9c4e50c15e69fb485aa68fc56e549d1a1\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IParallelizerOracle } from \\\"contracts/interfaces/IParallelizerOracle.sol\\\";\\nimport { AggregatorV3Interface } from \\\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\\\";\\nimport { IMorphoOracle } from \\\"contracts/interfaces/external/morpho/IMorphoOracle.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibOracle` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibOracle.sol\\nlibrary LibOracle {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ACTIONS SPECIFIC ORACLES \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads the oracle value used during a redemption to compute collateral ratio for `oracleConfig`\\n /// @dev This value is only sensitive to compute the collateral ratio and deduce a penalty factor\\n function readRedemption(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (OracleReadType oracleType, OracleReadType targetType, bytes memory oracleData, bytes memory targetData,) =\\n _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readRedemption();\\n } else {\\n (oracleValue,) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, 0);\\n return oracleValue;\\n }\\n }\\n\\n /// @notice Reads the oracle value used during mint operations for an asset with `oracleConfig`\\n /// @dev For assets which do not rely on external oracles, this value is the minimum between the processed oracle\\n /// value for the asset and its target price\\n function readMint(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readMint();\\n }\\n\\n (uint128 userDeviation,) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n if (targetPrice < oracleValue) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads the oracle value used for a burn operation for an asset with `oracleConfig`\\n /// @return oracleValue The actual oracle value obtained\\n /// @return ratio If `oracle value < target price`, the ratio between the oracle value and the target\\n /// price, otherwise `BASE_18`\\n function readBurn(bytes memory oracleConfig) internal view returns (uint256 oracleValue, uint256 ratio) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readBurn();\\n }\\n (uint128 userDeviation, uint128 burnRatioDeviation) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n // Firewall in case the oracle value reported is low compared to the target\\n // If the oracle value is slightly below its target, then no deviation is reported for the oracle and\\n // the price of burning the stablecoin for other assets is not impacted. Also, the oracle value of this asset\\n // is set to the target price, to not be open to direct arbitrage\\n ratio = BASE_18;\\n if (oracleValue * BASE_18 < targetPrice * (BASE_18 - burnRatioDeviation)) {\\n ratio = (oracleValue * BASE_18) / targetPrice;\\n } else if (oracleValue < targetPrice) {\\n oracleValue = targetPrice;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n VIEW FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of the `getOracle` function\\n function getOracle(address collateral)\\n internal\\n view\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return _parseOracleConfig(s.transmuterStorage().collaterals[collateral].oracleConfig);\\n }\\n\\n /// @notice Gets the oracle value and the ratio with respect to the target price when it comes to\\n /// burning for `collateral`\\n function getBurnOracle(\\n address collateral,\\n bytes memory oracleConfig\\n )\\n internal\\n view\\n returns (uint256 minRatio, uint256 oracleValue)\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n minRatio = BASE_18;\\n address[] memory collateralList = ts.collateralList;\\n uint256 length = collateralList.length;\\n for (uint256 i; i < length; ++i) {\\n uint256 ratioObserved = BASE_18;\\n if (collateralList[i] != collateral) {\\n (, ratioObserved) = readBurn(ts.collaterals[collateralList[i]].oracleConfig);\\n } else {\\n (oracleValue, ratioObserved) = readBurn(oracleConfig);\\n }\\n if (ratioObserved < minRatio) minRatio = ratioObserved;\\n }\\n }\\n\\n /// @notice Computes the `quoteAmount` (for Chainlink oracles) depending on a `quoteType` and a base value\\n /// (e.g the target price of the asset)\\n /// @dev For cases where the Chainlink feed directly looks into the value of the asset, `quoteAmount` is `BASE_18`.\\n /// For others, like wstETH for which Chainlink only has an oracle for stETH, `quoteAmount` is the target price\\n function quoteAmount(OracleQuoteType quoteType, uint256 baseValue) internal pure returns (uint256) {\\n if (quoteType == OracleQuoteType.UNIT) return BASE_18;\\n else return baseValue;\\n }\\n\\n function readSpotAndTarget(\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n uint256 deviation\\n )\\n internal\\n view\\n returns (uint256 oracleValue, uint256 targetPrice)\\n {\\n targetPrice = read(targetType, BASE_18, targetData);\\n oracleValue = read(oracleType, targetPrice, oracleData);\\n // System may tolerate small deviations from target\\n // If the oracle value reported is reasonably close to the target\\n // --> disregard the oracle value and return the target price\\n if (\\n targetPrice * (BASE_18 - deviation) < oracleValue * BASE_18\\n && oracleValue * BASE_18 < targetPrice * (BASE_18 + deviation)\\n ) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads an oracle value (or a target oracle value) for an asset based on its data parsed `oracleConfig`\\n function read(OracleReadType readType, uint256 baseValue, bytes memory data) internal view returns (uint256) {\\n if (readType == OracleReadType.CHAINLINK_FEEDS) {\\n (\\n AggregatorV3Interface[] memory circuitChainlink,\\n uint32[] memory stalePeriods,\\n uint8[] memory circuitChainIsMultiplied,\\n uint8[] memory chainlinkDecimals,\\n OracleQuoteType quoteType\\n ) = abi.decode(data, (AggregatorV3Interface[], uint32[], uint8[], uint8[], OracleQuoteType));\\n uint256 quotePrice = quoteAmount(quoteType, baseValue);\\n uint256 listLength = circuitChainlink.length;\\n for (uint256 i; i < listLength; ++i) {\\n quotePrice = readChainlinkFeed(\\n quotePrice, circuitChainlink[i], circuitChainIsMultiplied[i], chainlinkDecimals[i], stalePeriods[i]\\n );\\n }\\n return quotePrice;\\n } else if (readType == OracleReadType.STABLE) {\\n return BASE_18;\\n } else if (readType == OracleReadType.NO_ORACLE) {\\n return baseValue;\\n } else if (readType == OracleReadType.WSTETH) {\\n return STETH.getPooledEthByShares(1 ether);\\n } else if (readType == OracleReadType.CBETH) {\\n return CBETH.exchangeRate();\\n } else if (readType == OracleReadType.RETH) {\\n return RETH.getExchangeRate();\\n } else if (readType == OracleReadType.SFRXETH) {\\n return SFRXETH.pricePerShare();\\n } else if (readType == OracleReadType.MAX) {\\n uint256 maxValue = abi.decode(data, (uint256));\\n return maxValue;\\n } else if (readType == OracleReadType.MORPHO_ORACLE) {\\n (address contractAddress, uint256 normalizationFactor) = abi.decode(data, (address, uint256));\\n return IMorphoOracle(contractAddress).price() / normalizationFactor;\\n }\\n // If the `OracleReadType` is `EXTERNAL`, it means that this function is called to compute a\\n // `targetPrice` in which case the `baseValue` is returned here\\n else {\\n return baseValue;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n SPECIFIC HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads a Chainlink feed using a quote amount and converts the quote amount to the out-currency\\n /// @param _quoteAmount The amount for which to compute the price expressed in `BASE_18`\\n /// @param feed Chainlink feed to query\\n /// @param multiplied Whether the ratio outputted by Chainlink should be multiplied or divided to the `quoteAmount`\\n /// @param decimals Number of decimals of the corresponding Chainlink pair\\n /// @return The `quoteAmount` converted in out-currency\\n function readChainlinkFeed(\\n uint256 _quoteAmount,\\n AggregatorV3Interface feed,\\n uint8 multiplied,\\n uint256 decimals,\\n uint32 stalePeriod\\n )\\n internal\\n view\\n returns (uint256)\\n {\\n (, int256 ratio,, uint256 updatedAt,) = feed.latestRoundData();\\n if (ratio <= 0 || block.timestamp - updatedAt > stalePeriod) revert InvalidChainlinkRate();\\n // Checking whether we should multiply or divide by the ratio computed\\n if (multiplied == 1) return (_quoteAmount * uint256(ratio)) / (10 ** decimals);\\n else return (_quoteAmount * (10 ** decimals)) / uint256(ratio);\\n }\\n\\n /// @notice Parses an `oracleConfig` into several sub fields\\n function _parseOracleConfig(bytes memory oracleConfig)\\n private\\n pure\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return abi.decode(oracleConfig, (OracleReadType, OracleReadType, bytes, bytes, bytes));\\n }\\n\\n function updateOracle(address collateral) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n if (ts.collaterals[collateral].decimals == 0) revert NotCollateral();\\n\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(ts.collaterals[collateral].oracleConfig);\\n\\n if (targetType != OracleReadType.MAX) revert OracleUpdateFailed();\\n uint256 oracleValue = read(oracleType, BASE_18, oracleData);\\n\\n uint256 maxValue = abi.decode(targetData, (uint256));\\n if (oracleValue > maxValue) {\\n ts.collaterals[collateral].oracleConfig = abi.encode(\\n oracleType,\\n targetType,\\n oracleData,\\n // There are no checks whether the value increased or not\\n abi.encode(oracleValue),\\n hyperparameters\\n );\\n } else {\\n revert OracleUpdateFailed();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x24f504bdd0b7346a447d646a2b2b19afe1a71ee829a59e5cb2ac5fac320611d7\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibStorage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport { DiamondStorage, ImplementationStorage, ParallelizerStorage } from \\\"../Storage.sol\\\";\\n\\n/// @title LibStorage\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibStorage` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibStorage.sol\\nlibrary LibStorage {\\n /// @notice Returns the storage struct stored at the `DIAMOND_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic of the different facets used in the diamond proxy\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ds.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `TRANSMUTER_STORAGE_POSITION` slot\\n /// @dev This struct handles the particular logic of the Parallelizer system\\n function transmuterStorage() internal pure returns (ParallelizerStorage storage ts) {\\n bytes32 position = TRANSMUTER_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ts.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `IMPLEMENTATION_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic for making the contract easily usable on Etherscan\\n function implementationStorage() internal pure returns (ImplementationStorage storage ims) {\\n bytes32 position = IMPLEMENTATION_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ims.slot := position\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf8c333898ca14d3e8696c232f669a839dddbf705a609a1b0795ecc6b8f1b2d73\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibWhitelist.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IKeyringGuard } from \\\"contracts/interfaces/external/keyring/IKeyringGuard.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibWhitelist\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibWhitelist` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibWhitelist.sol\\nlibrary LibWhitelist {\\n /// @notice Checks whether `sender` is whitelisted for a collateral with `whitelistData`\\n function checkWhitelist(bytes memory whitelistData, address sender) internal returns (bool) {\\n (WhitelistType whitelistType, bytes memory data) = abi.decode(whitelistData, (WhitelistType, bytes));\\n if (s.transmuterStorage().isWhitelistedForType[whitelistType][sender] > 0) return true;\\n if (data.length != 0) {\\n if (whitelistType == WhitelistType.BACKED) {\\n address keyringGuard = abi.decode(data, (address));\\n if (keyringGuard != address(0)) return IKeyringGuard(keyringGuard).isAuthorized(address(this), sender);\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x72595e0b49dfce76ba70d9f69af54ffbc84650c8c696caa20f858ef2438d94b5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ICbETH } from \\\"contracts/interfaces/external/coinbase/ICbETH.sol\\\";\\nimport { ISfrxETH } from \\\"contracts/interfaces/external/frax/ISfrxETH.sol\\\";\\nimport { IStETH } from \\\"contracts/interfaces/external/lido/IStETH.sol\\\";\\nimport { IRETH } from \\\"contracts/interfaces/external/rocketPool/IRETH.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STORAGE SLOTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n/// @dev Storage position of `DiamondStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.diamond.storage\\\") - 1`\\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\\n\\n/// @dev Storage position of `ParallelizerStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.parallelizer.storage\\\") - 1`\\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\\n\\n/// @dev Storage position of `ImplementationStorage` structure\\n/// @dev Equals `keccak256(\\\"eip1967.proxy.implementation\\\") - 1`\\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MATHS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nuint256 constant BASE_6 = 1e6;\\nuint256 constant BASE_8 = 1e8;\\nuint256 constant BASE_9 = 1e9;\\nuint256 constant BASE_12 = 1e12;\\nuint256 constant BPS = 1e14;\\nuint256 constant BASE_18 = 1e18;\\nuint256 constant HALF_BASE_27 = 1e27 / 2;\\nuint256 constant BASE_27 = 1e27;\\nuint256 constant BASE_36 = 1e36;\\nuint256 constant MAX_BURN_FEE = 999_000_000;\\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// The values being non-zero value makes deployment a bit more expensive,\\n// but in exchange the refund on every call to nonReentrant will be lower in\\n// amount. Since refunds are capped to a percentage of the total\\n// transaction's gas, it is best to keep them low in cases like this one, to\\n// increase the likelihood of the full refund coming into effect.\\nuint8 constant NOT_ENTERED = 1;\\nuint8 constant ENTERED = 2;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// Role IDs for the AccessManager\\nuint64 constant GOVERNOR_ROLE = 10;\\nuint64 constant GUARDIAN_ROLE = 20;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n COMMON ADDRESSES \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\\n\",\"keccak256\":\"0x3306bdd0d4e4f364e0d35893a7ffb59c8eb9e94a5bd861f58b8d7ba8a7b336e5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nerror AccessManagedUnauthorized(address caller);\\nerror AlreadyAdded();\\nerror CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);\\nerror CannotAddSelectorsToZeroAddress(bytes4[] _selectors);\\nerror CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);\\nerror CannotRemoveImmutableFunction(bytes4 _selector);\\nerror CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);\\nerror CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);\\nerror CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);\\nerror CannotReplaceImmutableFunction(bytes4 _selector);\\nerror ContractHasNoCode();\\nerror CollateralBacked();\\nerror FunctionNotFound(bytes4 _functionSelector);\\nerror IncorrectFacetCutAction(uint8 _action);\\nerror InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);\\nerror InvalidChainlinkRate();\\nerror InvalidLengths();\\nerror InvalidNegativeFees();\\nerror InvalidOracleType();\\nerror InvalidParam();\\nerror InvalidParams();\\nerror InvalidRate();\\nerror InvalidSwap();\\nerror InvalidTokens();\\nerror InvalidAccessManager();\\nerror ManagerHasAssets();\\nerror NoSelectorsProvidedForFacetForCut(address _facetAddress);\\nerror NotAllowed();\\nerror NotCollateral();\\nerror NotGovernor();\\nerror NotGuardian();\\nerror NotTrusted();\\nerror NotTrustedOrGuardian();\\nerror NotWhitelisted();\\nerror OdosSwapFailed();\\nerror OracleUpdateFailed();\\nerror Paused();\\nerror ReentrantCall();\\nerror RemoveFacetAddressMustBeZeroAddress(address _facetAddress);\\nerror TooBigAmountIn();\\nerror TooLate();\\nerror TooSmallAmountOut();\\nerror ZeroAddress();\\nerror ZeroAmount();\\nerror SwapError();\\nerror SlippageTooHigh();\\nerror InsufficientFunds();\\n\",\"keccak256\":\"0x1e2f6812ef78e948e5155d32213b52afff8c0ba5463d18bee10694efbf886130\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x60808060405234601557612e4e908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c80630d126627146113b257806310d3d22e146113315780631978a5ed146112ec57806331da6b13146112c25780633335221014610f9d57806338c269eb14610e745780634ea3e34314610e2157806377dc342914610da3578063782513bd14610d6b578063847da7be14610d3e5780638db9653f14610cde5780638fb3603714610c4b57806394e35d9e14610b9357806396d6487914610b3957806399eeca4914610ac0578063a52aefd414610a29578063adc9d1f71461079d578063b718136114610738578063b85780bc146106f0578063cd377c5314610256578063eb7aac5f14610229578063f9839d89146101c4578063fdcb60681461017f5763fe7d0c5414610121575f80fd5b3461017b57602036600319011261017b576001600160a01b036101426113ee565b165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7c6020526020600160405f205414604051908152f35b5f80fd5b3461017b575f36600319011261017b5760206001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d5416604051908152f35b3461017b57602036600319011261017b576020600160ff61021c6101e66113ee565b6001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b54831c1614604051908152f35b3461017b57602036600319011261017b57602060ff6102496101e66113ee565b5460181c16604051908152f35b3461017b575f36600319011261017b57600260ff7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755460a81c16146106c8575f61029e611aaa565b80515f916102ab826120a3565b5f905b8382106106595750506102c0836120a3565b926102ca816119cb565b906102d8604051928361169c565b8082526102e7601f19916119cb565b013660208301375f5f945b84861061040c578661034f7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c76546b033b2e3c9fd0803ce80000006001600160801b0382169160801c610345828285612c0d565b92091515906120d5565b908115806103f85761036683633b9aca0084612c0d565b906103e45782633b9aca0061037e93091515906120d5565b9067ffffffffffffffff82116103b35767ffffffffffffffff60409216905b67ffffffffffffffff8351921682526020820152f35b507f6dfcc650000000000000000000000000000000000000000000000000000000005f52604060045260245260445ffd5b634e487b7160e01b5f52601260045260245ffd5b505060409067ffffffffffffffff9061039d565b90919293949561045f6001600160a01b036104278988611cdb565b51166001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b8054909360ff821615610563576007850161048461047f600888016118b0565b612234565b92908051925f908054915b8581106104f657505050506104ea936104dd6001969460ff6104d26104cd60056104c5670de0b6b3a7640000996104e3996120d5565b9d5b016118b0565b611dd5565b9360181c16906123b2565b90611a6f565b04906120d5565b960194939291906102f2565b8281101561054f57600190825f528c6105296001600160a01b038360205f2001541691610523848a6120d5565b90611cdb565b526105348186611cdb565b5161054861054283896120d5565b8d611cdb565b520161048f565b634e487b7160e01b5f52603260045260245ffd5b93916024919260206001600160a01b0361057d8c8b611cdb565b5116604051948580927f70a082310000000000000000000000000000000000000000000000000000000082523060048301525afa92831561064e575f9361061b575b50826105cb8b8a611cdb565b516001600160a01b03166105df888a611cdb565b526105e9876120e2565b966105f49087611cdb565b526104e36001946104dd6104ea9560ff6104d26104cd6005670de0b6b3a7640000986104c7565b9092506020813d8211610646575b816106366020938361169c565b8101031261017b5751918a6105bf565b3d9150610629565b6040513d5f823e3d90fd5b9091929360019060ff6106776001600160a01b036104278789611cdb565b541661069f57610686906120e2565b925b836106938285611cdb565b520190939291936102ae565b6106c29060076106ba6001600160a01b03610427888a611cdb565b0154906120d5565b92610688565b7f37ed32e8000000000000000000000000000000000000000000000000000000005f5260045ffd5b3461017b57602036600319011261017b5761070c6101e66113ee565b610724600261071d600184016116be565b92016117ca565b906107346040519283928361150e565b0390f35b3461017b575f36600319011261017b57610750611aaa565b6040518091602082016020835281518091526020604084019201905f5b81811061077b575050500390f35b82516001600160a01b031684528594506020938401939092019160010161076d565b3461017b575f36600319011261017b576040517f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c785480825281602081017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c785f5260205f20925f905b8060038301106109d45761083b9454918181106109b9575b81811061099b575b81811061097d575b1061096f575b50038261169c565b604051907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795480835282602081017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795f5260205f20925f905b80600383011061092c576108ca945491818110610918575b818110610901575b8181106108ea575b106108d9575b50038361169c565b6107346040519283928361150e565b60c01d60070b8152602001856108c2565b9260206001918460801c60070b81520193016108bc565b9260206001918460401c60070b81520193016108b4565b9260206001918460070b81520193016108ac565b916004919350608060019186548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b6060820152019401920185929391610894565b60c01c815260200184610833565b92602060019167ffffffffffffffff8560801c16815201930161082d565b92602060019167ffffffffffffffff8560401c168152019301610825565b92602060019167ffffffffffffffff8516815201930161081d565b9160049193506080600191865467ffffffffffffffff8116825267ffffffffffffffff8160401c16602083015267ffffffffffffffff81841c16604083015260c01c6060820152019401920184929391610805565b3461017b57604036600319011261017b576020610a446113ee565b610a86610a4f611404565b916001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b9060ff8254841c1615918215610aa3575b50506040519015158152f35b610ab992506006610ab491016118b0565b611f2f565b8280610a97565b3461017b57604036600319011261017b57600435600181101561017b57610ae5611404565b90610aef81611aa0565b5f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d6020526001600160a01b0360405f2091165f52602052602060405f20541515604051908152f35b3461017b57602036600319011261017b576001600160a01b03610b5a6113ee565b165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7b6020526020600160405f205414604051908152f35b3461017b57602036600319011261017b576040610bae6113ee565b6b033b2e3c9fd0803ce8000000610c3e610c2d6001600160801b0383610c367f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7654968760801c9485916001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b5460281c611a6f565b049416611a6f565b0482519182526020820152f35b3461017b575f36600319011261017b577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755460b01c60ff1615610cd65760207f8fb36037000000000000000000000000000000000000000000000000000000005b7fffffffff0000000000000000000000000000000000000000000000000000000060405191168152f35b60205f610cac565b3461017b575f36600319011261017b5760206b033b2e3c9fd0803ce8000000610d357f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c76546001600160801b038160801c9116611a6f565b04604051908152f35b3461017b57602036600319011261017b57610d5a6101e66113ee565b610724600461071d600384016116be565b3461017b57602036600319011261017b57610734610d8f60066104c76101e66113ee565b60405191829160208352602083019061143b565b3461017b57602036600319011261017b576004357fffffffff00000000000000000000000000000000000000000000000000000000811680910361017b575f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260206001600160a01b0360405f2054161515604051908152f35b3461017b57602036600319011261017b57610734610e45610e406113ee565b6119e3565b610e66604094929451948594151585526060602086015260608501906114d2565b90838203604085015261143b565b3461017b57602036600319011261017b57610e8d6113ee565b610ecc60056104c7836001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b610ed581611b8d565b670de0b6b3a764000090610ee7611aaa565b8051906001600160a01b035f9716965b828110610f345750505060a09450610f17610f1185611cef565b94611dd5565b926040519485526020850152604084015260608301526080820152f35b876001600160a01b03610f478385611cdb565b511614610f8d57610f70610f6b60056104c76001600160a01b036104278688611cdb565b611b8d565b90505b858110610f84575b50600101610ef7565b94506001610f7b565b610f9687611b8d565b9050610f73565b3461017b57602036600319011261017b57610fb66113ee565b604051610fc28161164f565b5f8152602081015f9052604081015f9052606081015f9052608081015f905260a081015f905260c081016060905260e081016060905261010081016060905261012081016060905261014081016060905261016081016060905260405161102881611680565b6060815260208101606090526101808201526101a0015f905261107b906001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b6040516110878161164f565b815460ff8116825260208201928160081c60ff16845260408301918060101c60ff16835260608401908060181c60ff16825260808501908060201c60ff16825260a086019060281c8152600184016110de906116be565b60c087019081526110f1600286016117ca565b60e08801908152611104600387016116be565b610100890190815291611119600488016117ca565b6101208a019081529361112e600589016118b0565b6101408b019081529561114360068a016118b0565b976101608c01988952604051996111598b611680565b6111656007820161197a565b8b52611173600882016118b0565b60208c01526101808d019a8b52600901549a6101a08d019b8c52604051809e819e602083525160ff1660208301525160ff1690604001525160ff1660608d01525160ff1660808c01525160ff1660a08b0152517affffffffffffffffffffffffffffffffffffffffffffffffffffff1660c08a01525160e089016101c090526101e089016112009161145f565b9051888203601f19016101008a0152611219919061149c565b9051878203601f1901610120890152611232919061145f565b9051868203601f190161014088015261124b919061149c565b9051858203601f1901610160870152611264919061143b565b9051848203601f190161018086015261127d919061143b565b9051601f19848303016101a08501528051604083526040830161129f916114d2565b90602001519180820390602001526112b69161143b565b90516101c08301520390f35b3461017b57602036600319011261017b57602060096112e26101e66113ee565b0154604051908152f35b3461017b575f36600319011261017b5760206001600160a01b037f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416604051908152f35b3461017b57602036600319011261017b5761137b6113856107346113966113a461136961136460056104c76101e66113ee565b6120f0565b959260409891949851998a809a61141a565b602089019061141a565b60a0604088015260a087019061143b565b90858203606087015261143b565b90838203608085015261143b565b3461017b57604036600319011261017b576113cb6113ee565b60243590600382101561017b576020916113e49161156a565b6040519015158152f35b600435906001600160a01b038216820361017b57565b602435906001600160a01b038216820361017b57565b90600a8210156114275752565b634e487b7160e01b5f52602160045260245ffd5b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b90602080835192838152019201905f5b81811061147c5750505090565b825167ffffffffffffffff1684526020938401939092019160010161146f565b90602080835192838152019201905f5b8181106114b95750505090565b825160070b8452602093840193909201916001016114ac565b90602080835192838152019201905f5b8181106114ef5750505090565b82516001600160a01b03168452602093840193909201916001016114e2565b9291604084019360408152825180955260206060820193015f955b808710611548575050611545939450602081840391015261149c565b90565b909360208060019267ffffffffffffffff885116815201950196019590611529565b6003821015908161142757821580938115611641575b5015611612576115c0906001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b549060ff8260181c16156115ea576114275760ff91156115e25760081c161590565b60101c161590565b7f373f15fc000000000000000000000000000000000000000000000000000000005f5260045ffd5b50505060ff7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755460a01c161590565b92505060015f92145f611580565b6101c0810190811067ffffffffffffffff82111761166c57604052565b634e487b7160e01b5f52604160045260245ffd5b6040810190811067ffffffffffffffff82111761166c57604052565b90601f8019910116810190811067ffffffffffffffff82111761166c57604052565b90604051918281549182825260208201905f5260205f20925f905b8060038301106117755761170e94549181811061175a575b81811061173c575b81811061171e575b106117105750038361169c565b565b60c01c81526020015f6108c2565b92602060019167ffffffffffffffff8560801c168152019301611701565b92602060019167ffffffffffffffff8560401c1681520193016116f9565b92602060019167ffffffffffffffff851681520193016116f1565b9160049193506080600191865467ffffffffffffffff8116825267ffffffffffffffff8160401c16602083015267ffffffffffffffff81841c16604083015260c01c60608201520194019201859293916116d9565b90604051918281549182825260208201905f5260205f20925f905b80600383011061186d5761170e945491818110611859575b818110611842575b81811061182b575b1061181a5750038361169c565b60c01d60070b81526020015f6108c2565b9260206001918460801c60070b815201930161180d565b9260206001918460401c60070b8152019301611805565b9260206001918460070b81520193016117fd565b916004919350608060019186548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b60608201520194019201859293916117e5565b90604051915f8154908160011c9260018316928315611970575b60208510841461195c57848752869390811561193a57506001146118f6575b5061170e9250038361169c565b90505f9291925260205f20905f915b81831061191e57505090602061170e928201015f6118e9565b6020919350806001915483858901015201910190918492611905565b90506020925061170e94915060ff191682840152151560051b8201015f6118e9565b634e487b7160e01b5f52602260045260245ffd5b93607f16936118ca565b90604051918281549182825260208201905f5260205f20925f5b8181106119a957505061170e9250038361169c565b84546001600160a01b0316835260019485019487945060209093019201611994565b67ffffffffffffffff811161166c5760051b60200190565b611a1d906001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815416611a54575060405190611a3660208361169c565b5f82525f3681375f9190604051611a4e60208261169c565b5f815290565b6001916115456008611a686007850161197a565b93016118b0565b81810292918115918404141715611a8257565b634e487b7160e01b5f52601160045260245ffd5b81156103e4570490565b6001111561142757565b604051907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775480835282602081017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f20925f5b818110611b1757505061170e9250038361169c565b84546001600160a01b0316835260019485019487945060209093019201611b02565b9081602091031261017b57516001600160a01b038116810361017b5790565b51906001600160801b038216820361017b57565b919082604091031261017b576115456020611b8684611b58565b9301611b58565b611b96906120f0565b600a85949293969510156114275760018414611c425794611bd6939291611bce876020806001600160801b039a518301019101611b6c565b971693612191565b81939193670de0b6b3a76400009283820290828204851483151715611a82576001600160801b03168403848111611a8257611c119084611a6f565b1115611c315750818402918483041484151715611a825761154591611a96565b819093929310611c3e5750565b9250565b5050505060406001600160a01b03611c6584602080600497518301019101611b39565b168151938480927f4cb44a760000000000000000000000000000000000000000000000000000000082525afa91821561064e575f905f93611ca557509190565b9250506040823d604011611cd3575b81611cc16040938361169c565b8101031261017b576020825192015190565b3d9150611cb4565b805182101561054f5760209160051b010190565b611cf8906120f0565b600a859492939510156114275760018414611d4657906001600160801b03611d2d83602080611d359996518301019101611b6c565b501693612191565b819291928110611d425750565b9150565b5050505060206001600160a01b03611d68838380600496518301019101611b39565b16604051928380927f5ade93550000000000000000000000000000000000000000000000000000000082525afa90811561064e575f91611da6575090565b90506020813d602011611dcd575b81611dc16020938361169c565b8101031261017b575190565b3d9150611db4565b611dde906120f0565b50909291600a8310156114275760018303611e525750505060206001600160a01b03611e14838380600496518301019101611b39565b16604051928380927f6256f2c50000000000000000000000000000000000000000000000000000000082525afa90811561064e575f91611da6575090565b611e68929391611e6191612464565b809361289a565b90670de0b6b3a7640000808202828104821483151715611a8257818402848104831485151715611a82578082109283611eac575b505050611ea7575090565b905090565b909192508383041483151715611a8257105f8080611e9c565b81601f8201121561017b5780519067ffffffffffffffff821161166c5760405192611efa601f8401601f19166020018561169c565b8284526020838301011161017b57815f9260208093018386015e8301015290565b51906001600160a01b038216820361017b57565b8051810160408282031261017b57602082015191600183101561017b5760408101519167ffffffffffffffff831161017b57611f72926020809201920101611ec5565b90611f7c81611aa0565b805f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d60205260405f206001600160a01b0384165f5260205260405f205461209b578151611fcd575b5050505f90565b611fd681611aa0565b15611fe2575b80611fc6565b60208180518101031261017b5761200360206001600160a01b039201611f1b565b16908115611fdc576001600160a01b0360446020925f60405195869485937f65e4ad9e0000000000000000000000000000000000000000000000000000000085523060048601521660248401525af190811561064e575f91612063575090565b90506020813d602011612093575b8161207e6020938361169c565b8101031261017b5751801515810361017b5790565b3d9150612071565b505050600190565b906120ad826119cb565b6120ba604051918261169c565b82815280926120cb601f19916119cb565b0190602036910137565b91908201809211611a8257565b5f198114611a825760010190565b8051810160a0826020830192031261017b576020820151600a81101561017b57604083015193600a85101561017b57606084015167ffffffffffffffff811161017b5783602061214292870101611ec5565b93608081015167ffffffffffffffff811161017b5784602061216692840101611ec5565b9360a08201519167ffffffffffffffff831161017b576121899201602001611ec5565b919493929190565b9394926121a2906121a99392612464565b809461289a565b9280670de0b6b3a764000003670de0b6b3a76400008111611a82576121ce9084611a6f565b670de0b6b3a7640000850290858204670de0b6b3a76400001486151715611a825781119182612206575b505061220057565b91508091565b909150670de0b6b3a76400000180670de0b6b3a764000011611a825761222c9084611a6f565b115f806121f8565b6060915f918051810160408282031261017b57602082015191600183101561017b5760408101519167ffffffffffffffff831161017b5761227c926020809201920101611ec5565b9061228681611aa0565b1561228e5750565b602091935080809350518101031261017b5760200151906001600160a01b03821680920361017b575f600492604051938480927f01e1d1140000000000000000000000000000000000000000000000000000000082525afa91821561064e575f905f936122fa57509190565b9250503d805f843e61230c818461169c565b82019160408184031261017b57805167ffffffffffffffff811161017b5781019280601f8501121561017b578351612343816119cb565b94612351604051968761169c565b81865260208087019260051b82010192831161017b57602001905b82821061237d575050506020015190565b815181526020918201910161236c565b9060ff8091169116039060ff8211611a8257565b60ff16604d8111611a8257600a0a90565b9060ff811660128111156123de5750906123d86123d360126115459461238d565b6123a1565b90611a96565b601211156123f857906104dd6123d361154593601261238d565b5090565b9080601f8301121561017b57815190612414826119cb565b92612422604051948561169c565b82845260208085019360051b82010191821161017b57602001915b81831061244a5750505090565b825160ff8116810361017b5781526020928301920161243d565b600a8110156114275780612674575090815182019160a0816020850194031261017b57602081015167ffffffffffffffff811161017b5781019280603f8501121561017b5760208401516124b7816119cb565b946124c5604051968761169c565b8186526020808088019360051b830101019083821161017b57604001915b81831061265457505050604082015167ffffffffffffffff811161017b57820181603f8201121561017b57602081015161251c816119cb565b9161252a604051938461169c565b8183526020808085019360051b830101019084821161017b57604001915b81831061263757505050606083015167ffffffffffffffff811161017b57826020612575928601016123fc565b91608084015167ffffffffffffffff811161017b5760a091602061259b928701016123fc565b930151600281101561017b57670de0b6b3a76400006125be919694929596612caa565b938351915f935b8385106125d55750505050505090565b9091929394969561262a6001916001600160a01b036125f4898c611cdb565b511660ff6126028a87611cdb565b511660ff6126108b89611cdb565b51169163ffffffff6126228c8b611cdb565b511693612ce9565b96979501939291906125c5565b825163ffffffff8116810361017b57815260209283019201612548565b82516001600160a01b038116810361017b578152602092830192016124e3565b6003810361268a575050670de0b6b3a764000090565b600281036126a0575050670de0b6b3a764000090565b600481036126f3575050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561064e575f91611da6575090565b60058103612738575050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561064e575f91611da6575090565b6006810361277d5750506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561064e575f91611da6575090565b600781036127c2575050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561064e575f91611da6575090565b600881036127e357506020815191818082019384920101031261017b575190565b60090361288d5760408180518101031261017b57806020604061280f826001600160a01b039501611f1b565b920151916004604051809581937fa035b1fe000000000000000000000000000000000000000000000000000000008352165afa801561064e575f90612859575b6115459250611a96565b506020823d602011612885575b816128736020938361169c565b8101031261017b57611545915161284f565b3d9150612866565b50670de0b6b3a764000090565b92919092600a8110156114275780612a6f57508051810160a0826020830192031261017b57602082015167ffffffffffffffff811161017b5782019381603f8601121561017b5760208501516128ef816119cb565b956128fd604051978861169c565b8187526020808089019360051b830101019084821161017b57604001915b818310612a4f57505050604083015167ffffffffffffffff811161017b5783019082603f8301121561017b576020820151612955816119cb565b92612963604051948561169c565b8184526020808086019360051b830101019085821161017b57604001915b818310612a3257505050606084015167ffffffffffffffff811161017b578360206129ae928701016123fc565b92608085015167ffffffffffffffff811161017b5760a09160206129d4928801016123fc565b94015190600282101561017b576129ef919694929596612caa565b938351915f935b838510612a065750505050505090565b90919293949695612a256001916001600160a01b036125f4898c611cdb565b96979501939291906129f6565b825163ffffffff8116810361017b57815260209283019201612981565b82516001600160a01b038116810361017b5781526020928301920161291b565b9192909160038103612a8a57505050670de0b6b3a764000090565b60028103612a985750905090565b60048103612aec57505050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561064e575f91611da6575090565b60058103612b3257505050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561064e575f91611da6575090565b60068103612b78575050506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561064e575f91611da6575090565b60078103612bbe57505050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561064e575f91611da6575090565b60088103612be05750506020815191818082019384920101031261017b575190565b600903611ea7575060408180518101031261017b57806020604061280f826001600160a01b039501611f1b565b91818302915f1981850993838086109503948086039514612c9d5784831115612c855790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b5050906115459250611a96565b6002811015611427576115455750670de0b6b3a764000090565b519069ffffffffffffffffffff8216820361017b57565b604d8111611a8257600a0a90565b91909360a06001600160a01b0394956004604051809781937ffeaf968c000000000000000000000000000000000000000000000000000000008352165afa90811561064e575f945f92612dc2575b505f851391821592612da8575b5050612d805760ff16600103612d6b57612d6561154593926123d892611a6f565b91612cdb565b612d7b906104dd61154594612cdb565b611a96565b7fae193563000000000000000000000000000000000000000000000000000000005f5260045ffd5b4290810392508211611a825763ffffffff16105f80612d44565b9450905060a0843d60a011612e10575b81612ddf60a0938361169c565b8101031261017b57612df084612cc4565b506020840151612e07608060608701519601612cc4565b5093905f612d37565b3d9150612dd256fea26469706673582212200c57a3026d32af326299971b7e6464f43def9b4c98416396c6092c299675888464736f6c634300081c0033", + "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f3560e01c80630d126627146113b257806310d3d22e146113315780631978a5ed146112ec57806331da6b13146112c25780633335221014610f9d57806338c269eb14610e745780634ea3e34314610e2157806377dc342914610da3578063782513bd14610d6b578063847da7be14610d3e5780638db9653f14610cde5780638fb3603714610c4b57806394e35d9e14610b9357806396d6487914610b3957806399eeca4914610ac0578063a52aefd414610a29578063adc9d1f71461079d578063b718136114610738578063b85780bc146106f0578063cd377c5314610256578063eb7aac5f14610229578063f9839d89146101c4578063fdcb60681461017f5763fe7d0c5414610121575f80fd5b3461017b57602036600319011261017b576001600160a01b036101426113ee565b165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7c6020526020600160405f205414604051908152f35b5f80fd5b3461017b575f36600319011261017b5760206001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d5416604051908152f35b3461017b57602036600319011261017b576020600160ff61021c6101e66113ee565b6001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b54831c1614604051908152f35b3461017b57602036600319011261017b57602060ff6102496101e66113ee565b5460181c16604051908152f35b3461017b575f36600319011261017b57600260ff7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755460a81c16146106c8575f61029e611aaa565b80515f916102ab826120a3565b5f905b8382106106595750506102c0836120a3565b926102ca816119cb565b906102d8604051928361169c565b8082526102e7601f19916119cb565b013660208301375f5f945b84861061040c578661034f7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c76546b033b2e3c9fd0803ce80000006001600160801b0382169160801c610345828285612c0d565b92091515906120d5565b908115806103f85761036683633b9aca0084612c0d565b906103e45782633b9aca0061037e93091515906120d5565b9067ffffffffffffffff82116103b35767ffffffffffffffff60409216905b67ffffffffffffffff8351921682526020820152f35b507f6dfcc650000000000000000000000000000000000000000000000000000000005f52604060045260245260445ffd5b634e487b7160e01b5f52601260045260245ffd5b505060409067ffffffffffffffff9061039d565b90919293949561045f6001600160a01b036104278988611cdb565b51166001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b8054909360ff821615610563576007850161048461047f600888016118b0565b612234565b92908051925f908054915b8581106104f657505050506104ea936104dd6001969460ff6104d26104cd60056104c5670de0b6b3a7640000996104e3996120d5565b9d5b016118b0565b611dd5565b9360181c16906123b2565b90611a6f565b04906120d5565b960194939291906102f2565b8281101561054f57600190825f528c6105296001600160a01b038360205f2001541691610523848a6120d5565b90611cdb565b526105348186611cdb565b5161054861054283896120d5565b8d611cdb565b520161048f565b634e487b7160e01b5f52603260045260245ffd5b93916024919260206001600160a01b0361057d8c8b611cdb565b5116604051948580927f70a082310000000000000000000000000000000000000000000000000000000082523060048301525afa92831561064e575f9361061b575b50826105cb8b8a611cdb565b516001600160a01b03166105df888a611cdb565b526105e9876120e2565b966105f49087611cdb565b526104e36001946104dd6104ea9560ff6104d26104cd6005670de0b6b3a7640000986104c7565b9092506020813d8211610646575b816106366020938361169c565b8101031261017b5751918a6105bf565b3d9150610629565b6040513d5f823e3d90fd5b9091929360019060ff6106776001600160a01b036104278789611cdb565b541661069f57610686906120e2565b925b836106938285611cdb565b520190939291936102ae565b6106c29060076106ba6001600160a01b03610427888a611cdb565b0154906120d5565b92610688565b7f37ed32e8000000000000000000000000000000000000000000000000000000005f5260045ffd5b3461017b57602036600319011261017b5761070c6101e66113ee565b610724600261071d600184016116be565b92016117ca565b906107346040519283928361150e565b0390f35b3461017b575f36600319011261017b57610750611aaa565b6040518091602082016020835281518091526020604084019201905f5b81811061077b575050500390f35b82516001600160a01b031684528594506020938401939092019160010161076d565b3461017b575f36600319011261017b576040517f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c785480825281602081017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c785f5260205f20925f905b8060038301106109d45761083b9454918181106109b9575b81811061099b575b81811061097d575b1061096f575b50038261169c565b604051907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795480835282602081017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795f5260205f20925f905b80600383011061092c576108ca945491818110610918575b818110610901575b8181106108ea575b106108d9575b50038361169c565b6107346040519283928361150e565b60c01d60070b8152602001856108c2565b9260206001918460801c60070b81520193016108bc565b9260206001918460401c60070b81520193016108b4565b9260206001918460070b81520193016108ac565b916004919350608060019186548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b6060820152019401920185929391610894565b60c01c815260200184610833565b92602060019167ffffffffffffffff8560801c16815201930161082d565b92602060019167ffffffffffffffff8560401c168152019301610825565b92602060019167ffffffffffffffff8516815201930161081d565b9160049193506080600191865467ffffffffffffffff8116825267ffffffffffffffff8160401c16602083015267ffffffffffffffff81841c16604083015260c01c6060820152019401920184929391610805565b3461017b57604036600319011261017b576020610a446113ee565b610a86610a4f611404565b916001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b9060ff8254841c1615918215610aa3575b50506040519015158152f35b610ab992506006610ab491016118b0565b611f2f565b8280610a97565b3461017b57604036600319011261017b57600435600181101561017b57610ae5611404565b90610aef81611aa0565b5f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d6020526001600160a01b0360405f2091165f52602052602060405f20541515604051908152f35b3461017b57602036600319011261017b576001600160a01b03610b5a6113ee565b165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7b6020526020600160405f205414604051908152f35b3461017b57602036600319011261017b576040610bae6113ee565b6b033b2e3c9fd0803ce8000000610c3e610c2d6001600160801b0383610c367f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7654968760801c9485916001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b5460281c611a6f565b049416611a6f565b0482519182526020820152f35b3461017b575f36600319011261017b577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755460b01c60ff1615610cd65760207f8fb36037000000000000000000000000000000000000000000000000000000005b7fffffffff0000000000000000000000000000000000000000000000000000000060405191168152f35b60205f610cac565b3461017b575f36600319011261017b5760206b033b2e3c9fd0803ce8000000610d357f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c76546001600160801b038160801c9116611a6f565b04604051908152f35b3461017b57602036600319011261017b57610d5a6101e66113ee565b610724600461071d600384016116be565b3461017b57602036600319011261017b57610734610d8f60066104c76101e66113ee565b60405191829160208352602083019061143b565b3461017b57602036600319011261017b576004357fffffffff00000000000000000000000000000000000000000000000000000000811680910361017b575f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260206001600160a01b0360405f2054161515604051908152f35b3461017b57602036600319011261017b57610734610e45610e406113ee565b6119e3565b610e66604094929451948594151585526060602086015260608501906114d2565b90838203604085015261143b565b3461017b57602036600319011261017b57610e8d6113ee565b610ecc60056104c7836001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b610ed581611b8d565b670de0b6b3a764000090610ee7611aaa565b8051906001600160a01b035f9716965b828110610f345750505060a09450610f17610f1185611cef565b94611dd5565b926040519485526020850152604084015260608301526080820152f35b876001600160a01b03610f478385611cdb565b511614610f8d57610f70610f6b60056104c76001600160a01b036104278688611cdb565b611b8d565b90505b858110610f84575b50600101610ef7565b94506001610f7b565b610f9687611b8d565b9050610f73565b3461017b57602036600319011261017b57610fb66113ee565b604051610fc28161164f565b5f8152602081015f9052604081015f9052606081015f9052608081015f905260a081015f905260c081016060905260e081016060905261010081016060905261012081016060905261014081016060905261016081016060905260405161102881611680565b6060815260208101606090526101808201526101a0015f905261107b906001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b6040516110878161164f565b815460ff8116825260208201928160081c60ff16845260408301918060101c60ff16835260608401908060181c60ff16825260808501908060201c60ff16825260a086019060281c8152600184016110de906116be565b60c087019081526110f1600286016117ca565b60e08801908152611104600387016116be565b610100890190815291611119600488016117ca565b6101208a019081529361112e600589016118b0565b6101408b019081529561114360068a016118b0565b976101608c01988952604051996111598b611680565b6111656007820161197a565b8b52611173600882016118b0565b60208c01526101808d019a8b52600901549a6101a08d019b8c52604051809e819e602083525160ff1660208301525160ff1690604001525160ff1660608d01525160ff1660808c01525160ff1660a08b0152517affffffffffffffffffffffffffffffffffffffffffffffffffffff1660c08a01525160e089016101c090526101e089016112009161145f565b9051888203601f19016101008a0152611219919061149c565b9051878203601f1901610120890152611232919061145f565b9051868203601f190161014088015261124b919061149c565b9051858203601f1901610160870152611264919061143b565b9051848203601f190161018086015261127d919061143b565b9051601f19848303016101a08501528051604083526040830161129f916114d2565b90602001519180820390602001526112b69161143b565b90516101c08301520390f35b3461017b57602036600319011261017b57602060096112e26101e66113ee565b0154604051908152f35b3461017b575f36600319011261017b5760206001600160a01b037f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416604051908152f35b3461017b57602036600319011261017b5761137b6113856107346113966113a461136961136460056104c76101e66113ee565b6120f0565b959260409891949851998a809a61141a565b602089019061141a565b60a0604088015260a087019061143b565b90858203606087015261143b565b90838203608085015261143b565b3461017b57604036600319011261017b576113cb6113ee565b60243590600382101561017b576020916113e49161156a565b6040519015158152f35b600435906001600160a01b038216820361017b57565b602435906001600160a01b038216820361017b57565b90600a8210156114275752565b634e487b7160e01b5f52602160045260245ffd5b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b90602080835192838152019201905f5b81811061147c5750505090565b825167ffffffffffffffff1684526020938401939092019160010161146f565b90602080835192838152019201905f5b8181106114b95750505090565b825160070b8452602093840193909201916001016114ac565b90602080835192838152019201905f5b8181106114ef5750505090565b82516001600160a01b03168452602093840193909201916001016114e2565b9291604084019360408152825180955260206060820193015f955b808710611548575050611545939450602081840391015261149c565b90565b909360208060019267ffffffffffffffff885116815201950196019590611529565b6003821015908161142757821580938115611641575b5015611612576115c0906001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b549060ff8260181c16156115ea576114275760ff91156115e25760081c161590565b60101c161590565b7f373f15fc000000000000000000000000000000000000000000000000000000005f5260045ffd5b50505060ff7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755460a01c161590565b92505060015f92145f611580565b6101c0810190811067ffffffffffffffff82111761166c57604052565b634e487b7160e01b5f52604160045260245ffd5b6040810190811067ffffffffffffffff82111761166c57604052565b90601f8019910116810190811067ffffffffffffffff82111761166c57604052565b90604051918281549182825260208201905f5260205f20925f905b8060038301106117755761170e94549181811061175a575b81811061173c575b81811061171e575b106117105750038361169c565b565b60c01c81526020015f6108c2565b92602060019167ffffffffffffffff8560801c168152019301611701565b92602060019167ffffffffffffffff8560401c1681520193016116f9565b92602060019167ffffffffffffffff851681520193016116f1565b9160049193506080600191865467ffffffffffffffff8116825267ffffffffffffffff8160401c16602083015267ffffffffffffffff81841c16604083015260c01c60608201520194019201859293916116d9565b90604051918281549182825260208201905f5260205f20925f905b80600383011061186d5761170e945491818110611859575b818110611842575b81811061182b575b1061181a5750038361169c565b60c01d60070b81526020015f6108c2565b9260206001918460801c60070b815201930161180d565b9260206001918460401c60070b8152019301611805565b9260206001918460070b81520193016117fd565b916004919350608060019186548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b60608201520194019201859293916117e5565b90604051915f8154908160011c9260018316928315611970575b60208510841461195c57848752869390811561193a57506001146118f6575b5061170e9250038361169c565b90505f9291925260205f20905f915b81831061191e57505090602061170e928201015f6118e9565b6020919350806001915483858901015201910190918492611905565b90506020925061170e94915060ff191682840152151560051b8201015f6118e9565b634e487b7160e01b5f52602260045260245ffd5b93607f16936118ca565b90604051918281549182825260208201905f5260205f20925f5b8181106119a957505061170e9250038361169c565b84546001600160a01b0316835260019485019487945060209093019201611994565b67ffffffffffffffff811161166c5760051b60200190565b611a1d906001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815416611a54575060405190611a3660208361169c565b5f82525f3681375f9190604051611a4e60208261169c565b5f815290565b6001916115456008611a686007850161197a565b93016118b0565b81810292918115918404141715611a8257565b634e487b7160e01b5f52601160045260245ffd5b81156103e4570490565b6001111561142757565b604051907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775480835282602081017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f20925f5b818110611b1757505061170e9250038361169c565b84546001600160a01b0316835260019485019487945060209093019201611b02565b9081602091031261017b57516001600160a01b038116810361017b5790565b51906001600160801b038216820361017b57565b919082604091031261017b576115456020611b8684611b58565b9301611b58565b611b96906120f0565b600a85949293969510156114275760018414611c425794611bd6939291611bce876020806001600160801b039a518301019101611b6c565b971693612191565b81939193670de0b6b3a76400009283820290828204851483151715611a82576001600160801b03168403848111611a8257611c119084611a6f565b1115611c315750818402918483041484151715611a825761154591611a96565b819093929310611c3e5750565b9250565b5050505060406001600160a01b03611c6584602080600497518301019101611b39565b168151938480927f4cb44a760000000000000000000000000000000000000000000000000000000082525afa91821561064e575f905f93611ca557509190565b9250506040823d604011611cd3575b81611cc16040938361169c565b8101031261017b576020825192015190565b3d9150611cb4565b805182101561054f5760209160051b010190565b611cf8906120f0565b600a859492939510156114275760018414611d4657906001600160801b03611d2d83602080611d359996518301019101611b6c565b501693612191565b819291928110611d425750565b9150565b5050505060206001600160a01b03611d68838380600496518301019101611b39565b16604051928380927f5ade93550000000000000000000000000000000000000000000000000000000082525afa90811561064e575f91611da6575090565b90506020813d602011611dcd575b81611dc16020938361169c565b8101031261017b575190565b3d9150611db4565b611dde906120f0565b50909291600a8310156114275760018303611e525750505060206001600160a01b03611e14838380600496518301019101611b39565b16604051928380927f6256f2c50000000000000000000000000000000000000000000000000000000082525afa90811561064e575f91611da6575090565b611e68929391611e6191612464565b809361289a565b90670de0b6b3a7640000808202828104821483151715611a8257818402848104831485151715611a82578082109283611eac575b505050611ea7575090565b905090565b909192508383041483151715611a8257105f8080611e9c565b81601f8201121561017b5780519067ffffffffffffffff821161166c5760405192611efa601f8401601f19166020018561169c565b8284526020838301011161017b57815f9260208093018386015e8301015290565b51906001600160a01b038216820361017b57565b8051810160408282031261017b57602082015191600183101561017b5760408101519167ffffffffffffffff831161017b57611f72926020809201920101611ec5565b90611f7c81611aa0565b805f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d60205260405f206001600160a01b0384165f5260205260405f205461209b578151611fcd575b5050505f90565b611fd681611aa0565b15611fe2575b80611fc6565b60208180518101031261017b5761200360206001600160a01b039201611f1b565b16908115611fdc576001600160a01b0360446020925f60405195869485937f65e4ad9e0000000000000000000000000000000000000000000000000000000085523060048601521660248401525af190811561064e575f91612063575090565b90506020813d602011612093575b8161207e6020938361169c565b8101031261017b5751801515810361017b5790565b3d9150612071565b505050600190565b906120ad826119cb565b6120ba604051918261169c565b82815280926120cb601f19916119cb565b0190602036910137565b91908201809211611a8257565b5f198114611a825760010190565b8051810160a0826020830192031261017b576020820151600a81101561017b57604083015193600a85101561017b57606084015167ffffffffffffffff811161017b5783602061214292870101611ec5565b93608081015167ffffffffffffffff811161017b5784602061216692840101611ec5565b9360a08201519167ffffffffffffffff831161017b576121899201602001611ec5565b919493929190565b9394926121a2906121a99392612464565b809461289a565b9280670de0b6b3a764000003670de0b6b3a76400008111611a82576121ce9084611a6f565b670de0b6b3a7640000850290858204670de0b6b3a76400001486151715611a825781119182612206575b505061220057565b91508091565b909150670de0b6b3a76400000180670de0b6b3a764000011611a825761222c9084611a6f565b115f806121f8565b6060915f918051810160408282031261017b57602082015191600183101561017b5760408101519167ffffffffffffffff831161017b5761227c926020809201920101611ec5565b9061228681611aa0565b1561228e5750565b602091935080809350518101031261017b5760200151906001600160a01b03821680920361017b575f600492604051938480927f01e1d1140000000000000000000000000000000000000000000000000000000082525afa91821561064e575f905f936122fa57509190565b9250503d805f843e61230c818461169c565b82019160408184031261017b57805167ffffffffffffffff811161017b5781019280601f8501121561017b578351612343816119cb565b94612351604051968761169c565b81865260208087019260051b82010192831161017b57602001905b82821061237d575050506020015190565b815181526020918201910161236c565b9060ff8091169116039060ff8211611a8257565b60ff16604d8111611a8257600a0a90565b9060ff811660128111156123de5750906123d86123d360126115459461238d565b6123a1565b90611a96565b601211156123f857906104dd6123d361154593601261238d565b5090565b9080601f8301121561017b57815190612414826119cb565b92612422604051948561169c565b82845260208085019360051b82010191821161017b57602001915b81831061244a5750505090565b825160ff8116810361017b5781526020928301920161243d565b600a8110156114275780612674575090815182019160a0816020850194031261017b57602081015167ffffffffffffffff811161017b5781019280603f8501121561017b5760208401516124b7816119cb565b946124c5604051968761169c565b8186526020808088019360051b830101019083821161017b57604001915b81831061265457505050604082015167ffffffffffffffff811161017b57820181603f8201121561017b57602081015161251c816119cb565b9161252a604051938461169c565b8183526020808085019360051b830101019084821161017b57604001915b81831061263757505050606083015167ffffffffffffffff811161017b57826020612575928601016123fc565b91608084015167ffffffffffffffff811161017b5760a091602061259b928701016123fc565b930151600281101561017b57670de0b6b3a76400006125be919694929596612caa565b938351915f935b8385106125d55750505050505090565b9091929394969561262a6001916001600160a01b036125f4898c611cdb565b511660ff6126028a87611cdb565b511660ff6126108b89611cdb565b51169163ffffffff6126228c8b611cdb565b511693612ce9565b96979501939291906125c5565b825163ffffffff8116810361017b57815260209283019201612548565b82516001600160a01b038116810361017b578152602092830192016124e3565b6003810361268a575050670de0b6b3a764000090565b600281036126a0575050670de0b6b3a764000090565b600481036126f3575050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561064e575f91611da6575090565b60058103612738575050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561064e575f91611da6575090565b6006810361277d5750506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561064e575f91611da6575090565b600781036127c2575050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561064e575f91611da6575090565b600881036127e357506020815191818082019384920101031261017b575190565b60090361288d5760408180518101031261017b57806020604061280f826001600160a01b039501611f1b565b920151916004604051809581937fa035b1fe000000000000000000000000000000000000000000000000000000008352165afa801561064e575f90612859575b6115459250611a96565b506020823d602011612885575b816128736020938361169c565b8101031261017b57611545915161284f565b3d9150612866565b50670de0b6b3a764000090565b92919092600a8110156114275780612a6f57508051810160a0826020830192031261017b57602082015167ffffffffffffffff811161017b5782019381603f8601121561017b5760208501516128ef816119cb565b956128fd604051978861169c565b8187526020808089019360051b830101019084821161017b57604001915b818310612a4f57505050604083015167ffffffffffffffff811161017b5783019082603f8301121561017b576020820151612955816119cb565b92612963604051948561169c565b8184526020808086019360051b830101019085821161017b57604001915b818310612a3257505050606084015167ffffffffffffffff811161017b578360206129ae928701016123fc565b92608085015167ffffffffffffffff811161017b5760a09160206129d4928801016123fc565b94015190600282101561017b576129ef919694929596612caa565b938351915f935b838510612a065750505050505090565b90919293949695612a256001916001600160a01b036125f4898c611cdb565b96979501939291906129f6565b825163ffffffff8116810361017b57815260209283019201612981565b82516001600160a01b038116810361017b5781526020928301920161291b565b9192909160038103612a8a57505050670de0b6b3a764000090565b60028103612a985750905090565b60048103612aec57505050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561064e575f91611da6575090565b60058103612b3257505050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561064e575f91611da6575090565b60068103612b78575050506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561064e575f91611da6575090565b60078103612bbe57505050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561064e575f91611da6575090565b60088103612be05750506020815191818082019384920101031261017b575190565b600903611ea7575060408180518101031261017b57806020604061280f826001600160a01b039501611f1b565b91818302915f1981850993838086109503948086039514612c9d5784831115612c855790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b5050906115459250611a96565b6002811015611427576115455750670de0b6b3a764000090565b519069ffffffffffffffffffff8216820361017b57565b604d8111611a8257600a0a90565b91909360a06001600160a01b0394956004604051809781937ffeaf968c000000000000000000000000000000000000000000000000000000008352165afa90811561064e575f945f92612dc2575b505f851391821592612da8575b5050612d805760ff16600103612d6b57612d6561154593926123d892611a6f565b91612cdb565b612d7b906104dd61154594612cdb565b611a96565b7fae193563000000000000000000000000000000000000000000000000000000005f5260045ffd5b4290810392508211611a825763ffffffff16105f80612d44565b9450905060a0843d60a011612e10575b81612ddf60a0938361169c565b8101031261017b57612df084612cc4565b506020840151612e07608060608701519601612cc4565b5093905f612d37565b3d9150612dd256fea26469706673582212200c57a3026d32af326299971b7e6464f43def9b4c98416396c6092c299675888464736f6c634300081c0033", + "devdoc": { + "author": "Cooper Labs", + "custom:contact": "security@cooperlabs.xyz", + "details": "There may be duplicates in the info provided by the getters defined hereThis contract is an authorized fork of Angle's `Getters` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/Getters.sol", + "errors": { + "SafeCastOverflowedUintDowncast(uint8,uint256)": [ + { + "details": "Value doesn't fit in an uint of `bits` size." + } + ] + }, + "kind": "dev", + "methods": { + "getCollateralRatio()": { + "details": "This function may revert and overflow if the collateral ratio is too big due to a too small amount of `stablecoinsIssued`. Due to this, it is recommended to initialize the system with a non negligible amount of `stablecoinsIssued` so DoS attacks on redemptions which use this function become economically impossible" + }, + "getOracle(address)": { + "returns": { + "oracleData": "Extra data needed to read the oracle. For Chainlink oracles, this data is supposed to give the addresses of the Chainlink feeds to read, the stale periods for each feed, ...", + "oracleType": "Type of oracle (Chainlink, external smart contract, ...)", + "targetData": "Extra data needed to read the target price of the asset", + "targetType": "Type passed to read the value of the target price" + } + }, + "getOracleValues(address)": { + "details": "This function is not optimized for gas consumption as for instance the `burn` value for collateral is computed twice: once in `readBurn` and once in `getBurnOracle`", + "returns": { + "burn": "Oracle value that will be used for `collateral` for a burn transaction. This value is then used along with oracle values for all other collateral assets to get a global burn value for the oracle", + "minRatio": "Minimum ratio across all collateral assets between a collateral burn price and its target price. This value is independent of `collateral` and is used to normalize the burn oracle value for burn transactions.", + "mint": "Oracle value to be used for a mint transaction with `collateral`", + "ratio": "Ratio, in base `10**18` between the oracle value of the `collateral` and its target price. This value is 10**18 if the oracle is greater than the collateral price", + "redemption": "Oracle value that would be used to price `collateral` when computing the collateral ratio during a redemption" + } + }, + "isConsumingScheduledOp()": { + "details": "Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs attacker controlled calls." + }, + "isWhitelistedForCollateral(address,address)": { + "details": "This function is non view as it may consult external non view functions from whitelist providers" + }, + "isWhitelistedForType(uint8,address)": { + "details": "Note that ultimately whitelisting may depend as well on external providers" + } + }, + "title": "Getters", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "accessManager()": { + "notice": "Returns the address of the `accessManager` contract" + }, + "getCollateralBurnFees(address)": { + "notice": "Returns the `xFee` and `yFee` arrays from which fees are computed when coming to burn for `collateral`" + }, + "getCollateralDecimals(address)": { + "notice": "Returns the decimals of a given `collateral`" + }, + "getCollateralInfo(address)": { + "notice": "Returns all the info in storage associated to a `collateral`" + }, + "getCollateralList()": { + "notice": "Returns the list of collateral assets supported by the system" + }, + "getCollateralMintFees(address)": { + "notice": "Returns the `xFee` and `yFee` arrays from which fees are computed when coming to mint with `collateral`" + }, + "getCollateralRatio()": { + "notice": "Returns the collateral ratio of Parallelizer in base `10**9` and a rounded version of the total amount of stablecoins issued" + }, + "getCollateralWhitelistData(address)": { + "notice": "Gets the data needed to deal with whitelists for `collateral`" + }, + "getIssuedByCollateral(address)": { + "notice": "Returns the amount of stablecoins issued from `collateral` and the total amount of stablecoins issued through Parallelizer" + }, + "getManagerData(address)": { + "notice": "Returns if a collateral is \"managed\" and the associated manager configuration" + }, + "getOracle(address)": { + "notice": "Returns the data used to compute oracle values for `collateral`" + }, + "getOracleValues(address)": { + "notice": "Returns the oracle values associated to `collateral`" + }, + "getRedemptionFees()": { + "notice": "Returns the `xFee` and `yFee` arrays used to compute the penalty factor depending on the collateral ratio when users come to redeem" + }, + "getStablecoinCap(address)": { + "notice": "Returns the stablecoin cap for `collateral`" + }, + "getTotalIssued()": { + "notice": "Returns the total amount of stablecoins issued through Parallelizer" + }, + "isPaused(address,uint8)": { + "notice": "Returns if the associated functionality is paused or not" + }, + "isTrusted(address)": { + "notice": "Returns if `sender` is trusted to update normalizers" + }, + "isTrustedSeller(address)": { + "notice": "Returns if `sender` is trusted to update sell rewards" + }, + "isValidSelector(bytes4)": { + "notice": "Checks whether a given `selector` is actually a valid selector corresponding to a function in one of the facets of the proxy" + }, + "isWhitelistedCollateral(address)": { + "notice": "Checks whether only whitelisted address can deal with `collateral` during burns and redemptions" + }, + "isWhitelistedForCollateral(address,address)": { + "notice": "Checks whether `sender` can deal with `collateral` during burns and redemptions" + }, + "isWhitelistedForType(uint8,address)": { + "notice": "Checks whether `sender` has a non null entry in the `isWhitelistedForType` storage mapping" + }, + "tokenP()": { + "notice": "Stablecoin minted by parallelizer" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/Parallelizer_USDp.json b/deployments/sepolia/Parallelizer_USDp.json new file mode 100644 index 0000000..c1d82b5 --- /dev/null +++ b/deployments/sepolia/Parallelizer_USDp.json @@ -0,0 +1,511 @@ +{ + "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotAddFunctionToDiamondThatAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotAddSelectorsToZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveFunctionThatDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveImmutableFunction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionThatDoesNotExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotReplaceFunctionsFromFacetWithZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceImmutableFunction", + "type": "error" + }, + { + "inputs": [], + "name": "ContractHasNoCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_functionSelector", + "type": "bytes4" + } + ], + "name": "FunctionNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_initializationContractAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "InitializationFunctionReverted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facetAddress", + "type": "address" + } + ], + "name": "NoSelectorsProvidedForFacetForCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facetAddress", + "type": "address" + } + ], + "name": "RemoveFacetAddressMustBeZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "indexed": false, + "internalType": "struct FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "DiamondCut", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + } + ], + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "transactionIndex": 89, + "gasUsed": "2711002", + "logsBloom": "0x00000000000000000200000000000800000000100010000000800000000000000002000000200000000100000000002000000000008000000080000000000000000000200000000002000000000000000001000021000000000800000000000000000000020000000000000002000800000000000000000000040000000000400020080000000000000000000000000000000000000000000000000000040000000000000008000000010000000400000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000100020000000000000000000000000000000000000000000000000000040000000000000", + "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1", + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "logs": [ + { + "transactionIndex": 89, + "blockNumber": 8411101, + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "topics": [ + "0x8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a19c5d1013a8682ac76206a085ec24ac89f7c0250000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000009200000000000000000000000000000000000000000000000000000000000000a600000000000000000000000000000000000000000000000000000000000000b600000000000000000000000009b3a8f7cec208e247d97dee13313690977e244590000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000011f931c1c00000000000000000000000000000000000000000000000000000000000000000000000000000000c9b6279baa19dbb8bcc3250c89caa093aaba0bfc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004cdffacc60000000000000000000000000000000000000000000000000000000052ef6b2c00000000000000000000000000000000000000000000000000000000adfca15e000000000000000000000000000000000000000000000000000000007a0ed62700000000000000000000000000000000000000000000000000000000000000000000000000000000a360e5ad9f17caff53715346888aa0d13541c2f500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000bf0d2d5a800000000000000000000000000000000000000000000000000000000c1cdee7e0000000000000000000000000000000000000000000000000000000087c8ab7a000000000000000000000000000000000000000000000000000000005c3eebda000000000000000000000000000000000000000000000000000000004591f14800000000000000000000000000000000000000000000000000000000c9580804000000000000000000000000000000000000000000000000000000004d2b3e1400000000000000000000000000000000000000000000000000000000b13b0847000000000000000000000000000000000000000000000000000000001b0c7182000000000000000000000000000000000000000000000000000000007c0343a1000000000000000000000000000000000000000000000000000000001cb44dfc00000000000000000000000000000000000000000000000000000000000000000000000000000000a9c21cf291ad935e0c9b05a55a42254fb159181d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000005629feb62000000000000000000000000000000000000000000000000000000004eec47b900000000000000000000000000000000000000000000000000000000603b432700000000000000000000000000000000000000000000000000000000a9e6a1a400000000000000000000000000000000000000000000000000000000b607d0990000000000000000000000000000000000000000000000000000000000000000000000000000000078bb4882b77d74ad9b04ab71fe8e61f72595823c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000018fdcb606800000000000000000000000000000000000000000000000000000000847da7be00000000000000000000000000000000000000000000000000000000eb7aac5f000000000000000000000000000000000000000000000000000000003335221000000000000000000000000000000000000000000000000000000000b718136100000000000000000000000000000000000000000000000000000000b85780bc00000000000000000000000000000000000000000000000000000000cd377c5300000000000000000000000000000000000000000000000000000000782513bd0000000000000000000000000000000000000000000000000000000094e35d9e000000000000000000000000000000000000000000000000000000004ea3e3430000000000000000000000000000000000000000000000000000000010d3d22e0000000000000000000000000000000000000000000000000000000038c269eb00000000000000000000000000000000000000000000000000000000adc9d1f70000000000000000000000000000000000000000000000000000000031da6b13000000000000000000000000000000000000000000000000000000008db9653f000000000000000000000000000000000000000000000000000000008fb36037000000000000000000000000000000000000000000000000000000000d1266270000000000000000000000000000000000000000000000000000000096d6487900000000000000000000000000000000000000000000000000000000fe7d0c540000000000000000000000000000000000000000000000000000000077dc342900000000000000000000000000000000000000000000000000000000f9839d8900000000000000000000000000000000000000000000000000000000a52aefd40000000000000000000000000000000000000000000000000000000099eeca49000000000000000000000000000000000000000000000000000000001978a5ed000000000000000000000000000000000000000000000000000000000000000000000000000000001bb46fc55e3fd91ca0f162dcc0b3ef574c8ff97e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000064583aea6000000000000000000000000000000000000000000000000000000009525f3ab000000000000000000000000000000000000000000000000000000003b6a1fe000000000000000000000000000000000000000000000000000000000d92c6cb200000000000000000000000000000000000000000000000000000000b92567fa00000000000000000000000000000000000000000000000000000000c10a62870000000000000000000000000000000000000000000000000000000000000000000000000000000057770c1721eb35509f38210a935c8b1911db7e0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004d703a0cd00000000000000000000000000000000000000000000000000000000815822c1000000000000000000000000000000000000000000000000000000002e7639bc00000000000000000000000000000000000000000000000000000000fd7daaf800000000000000000000000000000000000000000000000000000000000000000000000000000000ad58fc13a682a121e5fe2f8e45d4d988a7e51b0d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000105b4193400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080477dabb7b000000000000000000000000fd28f108e95f4d41daae9dbfff707d677985998e000000000000000000000000e8a3da6f5ed1cf04c58ac7f6a7383641e877517b000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000006800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000094a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000004c0000000000000000000000000000000000000000000000000000000000000054000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a2f78ab2355fe2f984d808b5cee7fd0a93d5270e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011c37937e0800000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003807430000000000000000000000000000000000000000000000000000000000389fd9800000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000e8d4a50fff0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000000000000127a39800000000000000000000000000000000000000000000000000000000011e1a3000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000003b8b87c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000002cb417800000000000000000000000000000000000000000000000000000000032a9f88000000000000000000000000000000000000000000000000000000000389fd9800000000000000000000000000000000000000000000000000000000039d106800000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000003b4e7ec000000000000000000000000000000000000000000000000000000000389fd98000000000000000000000000000000000000000000000000000000000389fd980000000000000000000000000000000000000000000000000000000003b4e7ec000000000000000000000000000000000000000000000000000000000", + "logIndex": 354, + "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" + }, + { + "transactionIndex": 89, + "blockNumber": 8411101, + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000fd28f108e95f4d41daae9dbfff707d677985998e" + ], + "data": "0x", + "logIndex": 355, + "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" + }, + { + "transactionIndex": 89, + "blockNumber": 8411101, + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "topics": [ + "0x7db05e63d635a68c62fd7fd8f3107ae8ab584a383e102d1bd8a40f4c977e465f", + "0x00000000000000000000000094a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8" + ], + "data": "0x", + "logIndex": 356, + "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" + }, + { + "transactionIndex": 89, + "blockNumber": 8411101, + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "topics": [ + "0xba11329c0b0f98b91c254755aa8d698feac3b46fab65b65fe5ab7570de2ff928", + "0x00000000000000000000000094a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a2f78ab2355fe2f984d808b5cee7fd0a93d5270e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011c37937e08000", + "logIndex": 357, + "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" + }, + { + "transactionIndex": 89, + "blockNumber": 8411101, + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "topics": [ + "0x8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad", + "0x00000000000000000000000094a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003807430000000000000000000000000000000000000000000000000000000000389fd9800000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000e8d4a50fff", + "logIndex": 358, + "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" + }, + { + "transactionIndex": 89, + "blockNumber": 8411101, + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "topics": [ + "0x8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad", + "0x00000000000000000000000094a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000000000000127a39800000000000000000000000000000000000000000000000000000000011e1a3000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000003b8b87c0", + "logIndex": 359, + "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" + }, + { + "transactionIndex": 89, + "blockNumber": 8411101, + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "topics": [ + "0x3da495aea17ab24773f3161f4707961a797e39147ce4f8a8fbac0309a4a2d2e4", + "0x00000000000000000000000094a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 360, + "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" + }, + { + "transactionIndex": 89, + "blockNumber": 8411101, + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "topics": [ + "0x3da495aea17ab24773f3161f4707961a797e39147ce4f8a8fbac0309a4a2d2e4", + "0x00000000000000000000000094a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 361, + "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" + }, + { + "transactionIndex": 89, + "blockNumber": 8411101, + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "topics": [ + "0x3da495aea17ab24773f3161f4707961a797e39147ce4f8a8fbac0309a4a2d2e4", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 362, + "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" + }, + { + "transactionIndex": 89, + "blockNumber": 8411101, + "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", + "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", + "topics": [ + "0xdd1690e851f57f138700d42b0a081b3b1b9a97dd2cb2aabc25c9265873629064" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000002cb417800000000000000000000000000000000000000000000000000000000032a9f88000000000000000000000000000000000000000000000000000000000389fd9800000000000000000000000000000000000000000000000000000000039d106800000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000003b4e7ec000000000000000000000000000000000000000000000000000000000389fd98000000000000000000000000000000000000000000000000000000000389fd980000000000000000000000000000000000000000000000000000000003b4e7ec0", + "logIndex": 363, + "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" + } + ], + "blockNumber": 8411101, + "cumulativeGasUsed": "17528080", + "status": 1, + "byzantium": true + }, + "args": [ + [ + { + "facetAddress": "0x9B3a8f7CEC208e247d97dEE13313690977e24459", + "action": 0, + "functionSelectors": [ + "0x1f931c1c" + ] + }, + { + "facetAddress": "0xC9B6279baa19dBB8bCc3250c89cAa093AaBA0bfc", + "action": 0, + "functionSelectors": [ + "0xcdffacc6", + "0x52ef6b2c", + "0xadfca15e", + "0x7a0ed627" + ] + }, + { + "facetAddress": "0xA360E5aD9F17caff53715346888aA0d13541c2F5", + "action": 0, + "functionSelectors": [ + "0xf0d2d5a8", + "0xc1cdee7e", + "0x87c8ab7a", + "0x5c3eebda", + "0x4591f148", + "0xc9580804", + "0x4d2b3e14", + "0xb13b0847", + "0x1b0c7182", + "0x7c0343a1", + "0x1cb44dfc" + ] + }, + { + "facetAddress": "0xa9C21Cf291ad935e0C9B05a55A42254fB159181d", + "action": 0, + "functionSelectors": [ + "0x629feb62", + "0x4eec47b9", + "0x603b4327", + "0xa9e6a1a4", + "0xb607d099" + ] + }, + { + "facetAddress": "0x78BB4882b77D74aD9B04Ab71fE8e61f72595823C", + "action": 0, + "functionSelectors": [ + "0xfdcb6068", + "0x847da7be", + "0xeb7aac5f", + "0x33352210", + "0xb7181361", + "0xb85780bc", + "0xcd377c53", + "0x782513bd", + "0x94e35d9e", + "0x4ea3e343", + "0x10d3d22e", + "0x38c269eb", + "0xadc9d1f7", + "0x31da6b13", + "0x8db9653f", + "0x8fb36037", + "0x0d126627", + "0x96d64879", + "0xfe7d0c54", + "0x77dc3429", + "0xf9839d89", + "0xa52aefd4", + "0x99eeca49", + "0x1978a5ed" + ] + }, + { + "facetAddress": "0x1bB46FC55E3fd91Ca0F162DCC0B3ef574C8ff97E", + "action": 0, + "functionSelectors": [ + "0x4583aea6", + "0x9525f3ab", + "0x3b6a1fe0", + "0xd92c6cb2", + "0xb92567fa", + "0xc10a6287" + ] + }, + { + "facetAddress": "0x57770C1721Eb35509f38210A935c8b1911db7E0e", + "action": 0, + "functionSelectors": [ + "0xd703a0cd", + "0x815822c1", + "0x2e7639bc", + "0xfd7daaf8" + ] + }, + { + "facetAddress": "0xad58Fc13a682a121e5fe2f8E45D4D988A7e51B0D", + "action": 0, + "functionSelectors": [ + "0x05b41934" + ] + } + ], + "0xA19c5D1013A8682aC76206a085Ec24aC89F7c025", + "0x77dabb7b000000000000000000000000fd28f108e95f4d41daae9dbfff707d677985998e000000000000000000000000e8a3da6f5ed1cf04c58ac7f6a7383641e877517b000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000006800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000094a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000004c0000000000000000000000000000000000000000000000000000000000000054000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a2f78ab2355fe2f984d808b5cee7fd0a93d5270e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011c37937e0800000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003807430000000000000000000000000000000000000000000000000000000000389fd9800000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000e8d4a50fff0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000000000000127a39800000000000000000000000000000000000000000000000000000000011e1a3000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000003b8b87c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000002cb417800000000000000000000000000000000000000000000000000000000032a9f88000000000000000000000000000000000000000000000000000000000389fd9800000000000000000000000000000000000000000000000000000000039d106800000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000003b4e7ec000000000000000000000000000000000000000000000000000000000389fd98000000000000000000000000000000000000000000000000000000000389fd980000000000000000000000000000000000000000000000000000000003b4e7ec0" + ], + "numDeployments": 1, + "solcInputHash": "9d44d918681c9ad36f866ebee034a3d1", + "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"facetAddress\",\"type\":\"address\"},{\"internalType\":\"enum FacetCutAction\",\"name\":\"action\",\"type\":\"uint8\"},{\"internalType\":\"bytes4[]\",\"name\":\"functionSelectors\",\"type\":\"bytes4[]\"}],\"internalType\":\"struct FacetCut[]\",\"name\":\"_diamondCut\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"_init\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotAddFunctionToDiamondThatAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4[]\",\"name\":\"_selectors\",\"type\":\"bytes4[]\"}],\"name\":\"CannotAddSelectorsToZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotRemoveFunctionThatDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotRemoveImmutableFunction\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotReplaceFunctionThatDoesNotExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4[]\",\"name\":\"_selectors\",\"type\":\"bytes4[]\"}],\"name\":\"CannotReplaceFunctionsFromFacetWithZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_selector\",\"type\":\"bytes4\"}],\"name\":\"CannotReplaceImmutableFunction\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ContractHasNoCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_functionSelector\",\"type\":\"bytes4\"}],\"name\":\"FunctionNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_initializationContractAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"name\":\"InitializationFunctionReverted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_facetAddress\",\"type\":\"address\"}],\"name\":\"NoSelectorsProvidedForFacetForCut\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_facetAddress\",\"type\":\"address\"}],\"name\":\"RemoveFacetAddressMustBeZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"facetAddress\",\"type\":\"address\"},{\"internalType\":\"enum FacetCutAction\",\"name\":\"action\",\"type\":\"uint8\"},{\"internalType\":\"bytes4[]\",\"name\":\"functionSelectors\",\"type\":\"bytes4[]\"}],\"indexed\":false,\"internalType\":\"struct FacetCut[]\",\"name\":\"_diamondCut\",\"type\":\"tuple[]\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_init\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"name\":\"DiamondCut\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"}],\"devdoc\":{\"author\":\"Cooper Labs\",\"custom:contact\":\"security@cooperlabs.xyz\",\"details\":\"Reference: EIP-2535 DiamondsForked from https://github.com/mudgen/diamond-3/blob/master/contracts/Diamond.sol by mudgen\",\"kind\":\"dev\",\"methods\":{},\"title\":\"DiamondProxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Implementation of a Diamond Proxy\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/parallelizer/DiamondProxy.sol\":\"DiamondProxy\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAuthority} from \\\"./IAuthority.sol\\\";\\n\\nlibrary AuthorityUtils {\\n /**\\n * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\\n * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\\n * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\\n */\\n function canCallWithDelay(\\n address authority,\\n address caller,\\n address target,\\n bytes4 selector\\n ) internal view returns (bool immediate, uint32 delay) {\\n (bool success, bytes memory data) = authority.staticcall(\\n abi.encodeCall(IAuthority.canCall, (caller, target, selector))\\n );\\n if (success) {\\n if (data.length >= 0x40) {\\n (immediate, delay) = abi.decode(data, (bool, uint32));\\n } else if (data.length >= 0x20) {\\n immediate = abi.decode(data, (bool));\\n }\\n }\\n return (immediate, delay);\\n }\\n}\\n\",\"keccak256\":\"0xb3875997b0d8705e29aa20fee88e1dfef93df438794ae1ad8ba2eb016a4dd4e4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAccessManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\ninterface IAccessManager {\\n /**\\n * @dev A delayed operation was scheduled.\\n */\\n event OperationScheduled(\\n bytes32 indexed operationId,\\n uint32 indexed nonce,\\n uint48 schedule,\\n address caller,\\n address target,\\n bytes data\\n );\\n\\n /**\\n * @dev A scheduled operation was executed.\\n */\\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev A scheduled operation was canceled.\\n */\\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev Informational labelling for a roleId.\\n */\\n event RoleLabel(uint64 indexed roleId, string label);\\n\\n /**\\n * @dev Emitted when `account` is granted `roleId`.\\n *\\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\\n * otherwise it indicates the execution delay for this account and roleId is updated.\\n */\\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\\n\\n /**\\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\\n */\\n event RoleRevoked(uint64 indexed roleId, address indexed account);\\n\\n /**\\n * @dev Role acting as admin over a given `roleId` is updated.\\n */\\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\\n\\n /**\\n * @dev Role acting as guardian over a given `roleId` is updated.\\n */\\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\\n\\n /**\\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\\n */\\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\\n\\n /**\\n * @dev Target mode is updated (true = closed, false = open).\\n */\\n event TargetClosed(address indexed target, bool closed);\\n\\n /**\\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\\n */\\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\\n\\n /**\\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\\n */\\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\\n\\n error AccessManagerAlreadyScheduled(bytes32 operationId);\\n error AccessManagerNotScheduled(bytes32 operationId);\\n error AccessManagerNotReady(bytes32 operationId);\\n error AccessManagerExpired(bytes32 operationId);\\n error AccessManagerLockedRole(uint64 roleId);\\n error AccessManagerBadConfirmation();\\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\\n error AccessManagerUnauthorizedConsume(address target);\\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\\n\\n /**\\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\\n * & {execute} workflow.\\n *\\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\\n * for future execution.\\n *\\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\\n * the operation can be executed if and only if delay is greater than 0.\\n *\\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\\n *\\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\\n * {AccessManager} documentation.\\n */\\n function canCall(\\n address caller,\\n address target,\\n bytes4 selector\\n ) external view returns (bool allowed, uint32 delay);\\n\\n /**\\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\\n *\\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\\n * disabling any scheduling usage.\\n */\\n function expiration() external view returns (uint32);\\n\\n /**\\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\\n * can be increased without setback (and reset via {revokeRole} in the case event of an\\n * accidental increase). Defaults to 5 days.\\n */\\n function minSetback() external view returns (uint32);\\n\\n /**\\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\\n *\\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\\n */\\n function isTargetClosed(address target) external view returns (bool);\\n\\n /**\\n * @dev Get the role required to call a function.\\n */\\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\\n\\n /**\\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\\n */\\n function getTargetAdminDelay(address target) external view returns (uint32);\\n\\n /**\\n * @dev Get the id of the role that acts as an admin for the given role.\\n *\\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\\n * an operation that is restricted to this role.\\n */\\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role that acts as a guardian for a given role.\\n *\\n * The guardian permission allows canceling operations that have been scheduled under the role.\\n */\\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role current grant delay.\\n *\\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\\n */\\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\\n\\n /**\\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\\n * level.\\n *\\n * Returns:\\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\\n * [1] Current execution delay for the account.\\n * [2] Pending execution delay for the account.\\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\\n */\\n function getAccess(\\n uint64 roleId,\\n address account\\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\\n\\n /**\\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\\n * permission might be associated with an execution delay. {getAccess} can provide more details.\\n */\\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\\n\\n /**\\n * @dev Give a label to a role, for improved role discoverability by UIs.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleLabel} event.\\n */\\n function labelRole(uint64 roleId, string calldata label) external;\\n\\n /**\\n * @dev Add `account` to `roleId`, or change its execution delay.\\n *\\n * This gives the account the authorization to call any function that is restricted to this role. An optional\\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\\n *\\n * If the account has already been granted this role, the execution delay will be updated. This update is not\\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - granted role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleGranted} event.\\n */\\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\\n\\n /**\\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\\n * no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - revoked role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function revokeRole(uint64 roleId, address account) external;\\n\\n /**\\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\\n * the role this call has no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function renounceRole(uint64 roleId, address callerConfirmation) external;\\n\\n /**\\n * @dev Change admin role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleAdminChanged} event\\n */\\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\\n\\n /**\\n * @dev Change guardian role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGuardianChanged} event\\n */\\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\\n\\n /**\\n * @dev Update the delay for granting a `roleId`.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGrantDelayChanged} event.\\n */\\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetFunctionRoleUpdated} event per selector.\\n */\\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\\n\\n /**\\n * @dev Set the delay for changing the configuration of a given target contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetAdminDelayUpdated} event.\\n */\\n function setTargetAdminDelay(address target, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the closed flag for a contract.\\n *\\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetClosed} event.\\n */\\n function setTargetClosed(address target, bool closed) external;\\n\\n /**\\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\\n * operation is not yet scheduled, has expired, was executed, or was canceled.\\n */\\n function getSchedule(bytes32 id) external view returns (uint48);\\n\\n /**\\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\\n * been scheduled.\\n */\\n function getNonce(bytes32 id) external view returns (uint32);\\n\\n /**\\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\\n * required for the caller. The special value zero will automatically set the earliest possible time.\\n *\\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\\n *\\n * Emits a {OperationScheduled} event.\\n *\\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\\n * contract if it is using standard Solidity ABI encoding.\\n */\\n function schedule(\\n address target,\\n bytes calldata data,\\n uint48 when\\n ) external returns (bytes32 operationId, uint32 nonce);\\n\\n /**\\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\\n * execution delay is 0.\\n *\\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\\n *\\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\\n */\\n function execute(address target, bytes calldata data) external payable returns (uint32);\\n\\n /**\\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\\n * operation that is cancelled.\\n *\\n * Requirements:\\n *\\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\\n *\\n * Emits a {OperationCanceled} event.\\n */\\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\\n\\n /**\\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\\n *\\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\\n * with all the verifications that it implies.\\n *\\n * Emit a {OperationExecuted} event.\\n */\\n function consumeScheduledOp(address caller, bytes calldata data) external;\\n\\n /**\\n * @dev Hashing function for delayed operations.\\n */\\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\\n\\n /**\\n * @dev Changes the authority of a target managed by this manager instance.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n */\\n function updateAuthority(address target, address newAuthority) external;\\n}\\n\",\"keccak256\":\"0x9be2d08a326515805bc9cf6315b7953f8d1ebe88abf48c2d645fb1fa8211a0e2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAuthority.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard interface for permissioning originally defined in Dappsys.\\n */\\ninterface IAuthority {\\n /**\\n * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\\n */\\n function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\\n}\\n\",\"keccak256\":\"0x4cc0766bd7fb7b3bafb70afa2a93b6e313a0baec7a35ad1b57505be7861c1030\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/interfaces/ITokenP.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title ITokenP\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Interface for the stablecoins `tokenP` contracts\\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\\ninterface ITokenP is IERC20 {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MINTER ROLE ONLY FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Lets a whitelisted contract mint tokenPs\\n /// @param account Address to mint to\\n /// @param amount Amount to mint\\n function mint(address account, uint256 amount) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @param sender Address which requested the burn from `burner`\\n /// @dev This method is to be called by a contract with the minter right after being requested\\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\\n /// @dev The method checks the allowance between the `sender` and the `burner`\\n function burnFrom(uint256 amount, address burner, address sender) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\\n /// requested to do so by an address willing to burn tokens from its address\\n function burnSelf(uint256 amount, address burner) external;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Amount of decimals of the stablecoin\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x64a1305faa8c5c91767a11af0eae16e4b463aa0bfe10f11b74aae9d96681a5eb\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/coinbase/ICbETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ICbETH\\n/// @notice Interface for the `cbETH` contract\\ninterface ICbETH {\\n function exchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb159341cb0e25c478912b274cdda2d50fa84692aeac87b6823d281aaea2aed04\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/frax/ISfrxETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ISfrxETH\\n/// @notice Interface for the `sfrxETH` contract\\ninterface ISfrxETH {\\n function pricePerShare() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x914cbea276f817c7db62bfca21e15bd8f7892faa9f39d86baaef574cf12b859f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/lido/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IStETH\\n/// @notice Interface for the `StETH` contract\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n\\n function submit(address) external payable returns (uint256);\\n\\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf21e3d8bdadc236b34bf2122b0e0b939d2d6bb6e2889b508636cbb7b84f59680\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/rocketPool/IRETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IRETH\\n/// @notice Interface for the `rETH` contract\\ninterface IRETH {\\n function getExchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x567a378e95d40160e297c1adb617ccaa69c03e49c4ad72a6ce651dd43cdbd5cd\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/DiamondProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { LibDiamond } from \\\"./libraries/LibDiamond.sol\\\";\\nimport { LibStorage as s } from \\\"./libraries/LibStorage.sol\\\";\\n\\nimport \\\"../utils/Errors.sol\\\";\\nimport \\\"./Storage.sol\\\";\\n\\n/// @title DiamondProxy\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Implementation of a Diamond Proxy\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/Diamond.sol by mudgen\\ncontract DiamondProxy {\\n constructor(FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) payable {\\n LibDiamond.diamondCut(_diamondCut, _init, _calldata);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n FALLBACK \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @dev 1. Find the facet for the function that is called.\\n /// @dev 2. Delegate the execution to the found facet via `delegatecall`.\\n fallback() external payable {\\n DiamondStorage storage ds = s.diamondStorage();\\n // Get facet from function selector\\n address facetAddress = ds.selectorInfo[msg.sig].facetAddress;\\n if (facetAddress == address(0)) {\\n revert FunctionNotFound(msg.sig);\\n }\\n\\n assembly (\\\"memory-safe\\\") {\\n // The pointer to the free memory slot\\n let ptr := mload(0x40)\\n // Copy function signature and arguments from calldata at zero position into memory at pointer position\\n calldatacopy(ptr, 0, calldatasize())\\n // Delegatecall method of the implementation contract returns 0 on error\\n let result := delegatecall(gas(), facetAddress, ptr, calldatasize(), 0, 0)\\n // Get the size of the last return data\\n let size := returndatasize()\\n // Copy the size length of bytes from return data at zero position to pointer position\\n returndatacopy(ptr, 0, size)\\n // Depending on the result value\\n switch result\\n case 0 {\\n // End execution and revert state changes\\n revert(ptr, size)\\n }\\n default {\\n // Return data with length of size at pointers position\\n return(ptr, size)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa9ad48c719387cec27b364dce973b02b19ed1f14deb6d8328bfdb6328f202440\",\"license\":\"MIT\"},\"contracts/parallelizer/Storage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ENUMS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nenum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n}\\n\\nenum ManagerType {\\n EXTERNAL\\n}\\n\\nenum ActionType {\\n Mint,\\n Burn,\\n Redeem\\n}\\n\\nenum TrustedType {\\n Updater,\\n Seller\\n}\\n\\nenum QuoteType {\\n MintExactInput,\\n MintExactOutput,\\n BurnExactInput,\\n BurnExactOutput\\n}\\n\\nenum OracleReadType {\\n CHAINLINK_FEEDS,\\n EXTERNAL,\\n NO_ORACLE,\\n STABLE,\\n WSTETH,\\n CBETH,\\n RETH,\\n SFRXETH,\\n MAX,\\n MORPHO_ORACLE\\n}\\n\\nenum OracleQuoteType {\\n UNIT,\\n TARGET\\n}\\n\\nenum WhitelistType {\\n BACKED\\n}\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STRUCTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nstruct Permit2Details {\\n address to; // Address that will receive the funds\\n uint256 nonce; // Nonce of the transaction\\n bytes signature; // Permit signature of the user\\n}\\n\\nstruct FacetCut {\\n address facetAddress; // Facet contract address\\n FacetCutAction action; // Can be add, remove or replace\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct Facet {\\n address facetAddress; // Facet contract address\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct FacetInfo {\\n address facetAddress; // Facet contract address\\n uint16 selectorPosition; // Position in the list of all selectors\\n}\\n\\nstruct DiamondStorage {\\n bytes4[] selectors; // List of all available selectors\\n mapping(bytes4 => FacetInfo) selectorInfo; // Selector to (address, position in list)\\n IAccessManager accessManager; // Contract handling access management\\n}\\n\\nstruct ImplementationStorage {\\n address implementation; // Dummy implementation address for Etherscan usability\\n}\\n\\nstruct ManagerStorage {\\n IERC20[] subCollaterals; // Subtokens handled by the manager or strategies\\n bytes config; // Additional configuration data\\n}\\n\\nstruct Collateral {\\n uint8 isManaged; // If the collateral is managed through external strategies\\n uint8 isMintLive; // If minting from this asset is unpaused\\n uint8 isBurnLive; // If burning to this asset is unpaused\\n uint8 decimals; // IERC20Metadata(collateral).decimals()\\n uint8 onlyWhitelisted; // If only whitelisted addresses can burn or redeem for this token\\n uint216 normalizedStables; // Normalized amount of stablecoins issued from this collateral\\n uint64[] xFeeMint; // Increasing exposures in [0,BASE_9[\\n int64[] yFeeMint; // Mint fees at the exposures specified in `xFeeMint`\\n uint64[] xFeeBurn; // Decreasing exposures in ]0,BASE_9]\\n int64[] yFeeBurn; // Burn fees at the exposures specified in `xFeeBurn`\\n bytes oracleConfig; // Data about the oracle used for the collateral\\n bytes whitelistData; // For whitelisted collateral, data used to verify whitelists\\n ManagerStorage managerData; // For managed collateral, data used to handle the strategies\\n uint256 stablecoinCap; // Cap on the amount of stablecoins that can be issued from this collateral\\n}\\n\\nstruct ParallelizerStorage {\\n ITokenP tokenP; // tokenP handled by the system\\n uint8 isRedemptionLive; // If redemption is unpaused\\n uint8 statusReentrant; // If call is reentrant or not\\n bool consumingSchedule; // If the contract is consuming a scheduled operation\\n uint128 normalizedStables; // Normalized amount of stablecoins issued by the system\\n uint128 normalizer; // To reconcile `normalizedStables` values with the actual amount\\n address[] collateralList; // List of collateral assets supported by the system\\n uint64[] xRedemptionCurve; // Increasing collateral ratios > 0\\n int64[] yRedemptionCurve; // Value of the redemption fees at `xRedemptionCurve`\\n mapping(address => Collateral) collaterals; // Maps a collateral asset to its parameters\\n mapping(address => uint256) isTrusted; // If an address is trusted to update the normalizer value\\n mapping(address => uint256) isSellerTrusted; // If an address is trusted to sell accruing reward tokens or to run\\n // keeper jobs on oracles\\n mapping(WhitelistType => mapping(address => uint256)) isWhitelistedForType;\\n}\\n// Whether an address is whitelisted for a specific whitelist type\\n\",\"keccak256\":\"0x3f4313dd110dbe390038320b2d3cf24dcbe9b75cd9573e7f048f7233c02dd227\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibDiamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { AuthorityUtils } from \\\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibDiamond\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Helper library to deal with diamond proxies.\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/libraries/LibDiamond.sol by mudgen\\nlibrary LibDiamond {\\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n function isGovernor(address caller) internal view returns (bool) {\\n (bool isMember,) = s.diamondStorage().accessManager.hasRole(GOVERNOR_ROLE, caller);\\n return isMember;\\n }\\n\\n /// @notice Checks whether `caller` can call `data` on `this`\\n function checkCanCall(address caller, bytes calldata data) internal returns (bool) {\\n IAccessManager accessManager = s.diamondStorage().accessManager;\\n (bool immediate, uint32 delay) =\\n AuthorityUtils.canCallWithDelay(address(accessManager), caller, address(this), bytes4(data[0:4]));\\n if (!immediate) {\\n if (delay > 0) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n ts.consumingSchedule = true;\\n accessManager.consumeScheduledOp(caller, data);\\n ts.consumingSchedule = false;\\n } else {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @notice Internal function version of `diamondCut`\\n function diamondCut(FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {\\n uint256 diamondCutLength = _diamondCut.length;\\n for (uint256 facetIndex; facetIndex < diamondCutLength; facetIndex++) {\\n bytes4[] memory functionSelectors = _diamondCut[facetIndex].functionSelectors;\\n address facetAddress = _diamondCut[facetIndex].facetAddress;\\n\\n if (functionSelectors.length == 0) {\\n revert NoSelectorsProvidedForFacetForCut(facetAddress);\\n }\\n\\n FacetCutAction action = _diamondCut[facetIndex].action;\\n if (action == FacetCutAction.Add) {\\n _addFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Replace) {\\n _replaceFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Remove) {\\n _removeFunctions(facetAddress, functionSelectors);\\n }\\n }\\n\\n emit DiamondCut(_diamondCut, _init, _calldata);\\n _initializeDiamondCut(_init, _calldata);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n PRIVATE FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Does a delegate call on `_init` with `_calldata`\\n function _initializeDiamondCut(address _init, bytes memory _calldata) private {\\n if (_init == address(0)) {\\n return;\\n }\\n _enforceHasContractCode(_init);\\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n if (!success) {\\n if (error.length > 0) {\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(error)\\n revert(add(32, error), returndata_size)\\n }\\n } else {\\n revert InitializationFunctionReverted(_init, _calldata);\\n }\\n }\\n }\\n\\n /// @notice Adds a new function to the diamond proxy\\n /// @dev Reverts if selectors are already existing\\n function _addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n if (_facetAddress == address(0)) {\\n revert CannotAddSelectorsToZeroAddress(_functionSelectors);\\n }\\n DiamondStorage storage ds = s.diamondStorage();\\n uint16 selectorCount = uint16(ds.selectors.length);\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n if (oldFacetAddress != address(0)) {\\n revert CannotAddFunctionToDiamondThatAlreadyExists(selector);\\n }\\n ds.selectorInfo[selector] = FacetInfo(_facetAddress, selectorCount);\\n ds.selectors.push(selector);\\n selectorCount++;\\n }\\n }\\n\\n /// @notice Upgrades a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n if (_facetAddress == address(0)) {\\n revert CannotReplaceFunctionsFromFacetWithZeroAddress(_functionSelectors);\\n }\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n // Can't replace immutable functions -- functions defined directly in the diamond in this case\\n if (oldFacetAddress == address(this)) {\\n revert CannotReplaceImmutableFunction(selector);\\n }\\n if (oldFacetAddress == _facetAddress) {\\n revert CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(selector);\\n }\\n if (oldFacetAddress == address(0)) {\\n revert CannotReplaceFunctionThatDoesNotExists(selector);\\n }\\n // Replace old facet address\\n ds.selectorInfo[selector].facetAddress = _facetAddress;\\n }\\n }\\n\\n /// @notice Removes a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n uint256 selectorCount = ds.selectors.length;\\n if (_facetAddress != address(0)) {\\n revert RemoveFacetAddressMustBeZeroAddress(_facetAddress);\\n }\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n FacetInfo memory oldFacetAddressAndSelectorPosition = ds.selectorInfo[selector];\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(0)) {\\n revert CannotRemoveFunctionThatDoesNotExist(selector);\\n }\\n\\n // Can't remove immutable functions -- functions defined directly in the diamond\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(this)) {\\n revert CannotRemoveImmutableFunction(selector);\\n }\\n // Replace selector with last selector\\n selectorCount--;\\n if (oldFacetAddressAndSelectorPosition.selectorPosition != selectorCount) {\\n bytes4 lastSelector = ds.selectors[selectorCount];\\n ds.selectors[oldFacetAddressAndSelectorPosition.selectorPosition] = lastSelector;\\n ds.selectorInfo[lastSelector].selectorPosition = oldFacetAddressAndSelectorPosition.selectorPosition;\\n }\\n // Delete last selector\\n ds.selectors.pop();\\n delete ds.selectorInfo[selector];\\n }\\n }\\n\\n /// @notice Checks that an address has a non void bytecode\\n function _enforceHasContractCode(address _contract) private view {\\n uint256 contractSize;\\n assembly (\\\"memory-safe\\\") {\\n contractSize := extcodesize(_contract)\\n }\\n if (contractSize == 0) {\\n revert ContractHasNoCode();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x10bde4c13cc3d3c4aec15b793565bfe05b5f770eafeb839bfd159dbe6351dc62\",\"license\":\"MIT\"},\"contracts/parallelizer/libraries/LibStorage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport { DiamondStorage, ImplementationStorage, ParallelizerStorage } from \\\"../Storage.sol\\\";\\n\\n/// @title LibStorage\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibStorage` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibStorage.sol\\nlibrary LibStorage {\\n /// @notice Returns the storage struct stored at the `DIAMOND_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic of the different facets used in the diamond proxy\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ds.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `TRANSMUTER_STORAGE_POSITION` slot\\n /// @dev This struct handles the particular logic of the Parallelizer system\\n function transmuterStorage() internal pure returns (ParallelizerStorage storage ts) {\\n bytes32 position = TRANSMUTER_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ts.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `IMPLEMENTATION_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic for making the contract easily usable on Etherscan\\n function implementationStorage() internal pure returns (ImplementationStorage storage ims) {\\n bytes32 position = IMPLEMENTATION_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ims.slot := position\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf8c333898ca14d3e8696c232f669a839dddbf705a609a1b0795ecc6b8f1b2d73\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ICbETH } from \\\"contracts/interfaces/external/coinbase/ICbETH.sol\\\";\\nimport { ISfrxETH } from \\\"contracts/interfaces/external/frax/ISfrxETH.sol\\\";\\nimport { IStETH } from \\\"contracts/interfaces/external/lido/IStETH.sol\\\";\\nimport { IRETH } from \\\"contracts/interfaces/external/rocketPool/IRETH.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STORAGE SLOTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n/// @dev Storage position of `DiamondStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.diamond.storage\\\") - 1`\\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\\n\\n/// @dev Storage position of `ParallelizerStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.parallelizer.storage\\\") - 1`\\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\\n\\n/// @dev Storage position of `ImplementationStorage` structure\\n/// @dev Equals `keccak256(\\\"eip1967.proxy.implementation\\\") - 1`\\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MATHS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nuint256 constant BASE_6 = 1e6;\\nuint256 constant BASE_8 = 1e8;\\nuint256 constant BASE_9 = 1e9;\\nuint256 constant BASE_12 = 1e12;\\nuint256 constant BPS = 1e14;\\nuint256 constant BASE_18 = 1e18;\\nuint256 constant HALF_BASE_27 = 1e27 / 2;\\nuint256 constant BASE_27 = 1e27;\\nuint256 constant BASE_36 = 1e36;\\nuint256 constant MAX_BURN_FEE = 999_000_000;\\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// The values being non-zero value makes deployment a bit more expensive,\\n// but in exchange the refund on every call to nonReentrant will be lower in\\n// amount. Since refunds are capped to a percentage of the total\\n// transaction's gas, it is best to keep them low in cases like this one, to\\n// increase the likelihood of the full refund coming into effect.\\nuint8 constant NOT_ENTERED = 1;\\nuint8 constant ENTERED = 2;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// Role IDs for the AccessManager\\nuint64 constant GOVERNOR_ROLE = 10;\\nuint64 constant GUARDIAN_ROLE = 20;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n COMMON ADDRESSES \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\\n\",\"keccak256\":\"0x3306bdd0d4e4f364e0d35893a7ffb59c8eb9e94a5bd861f58b8d7ba8a7b336e5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nerror AccessManagedUnauthorized(address caller);\\nerror AlreadyAdded();\\nerror CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);\\nerror CannotAddSelectorsToZeroAddress(bytes4[] _selectors);\\nerror CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);\\nerror CannotRemoveImmutableFunction(bytes4 _selector);\\nerror CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);\\nerror CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);\\nerror CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);\\nerror CannotReplaceImmutableFunction(bytes4 _selector);\\nerror ContractHasNoCode();\\nerror CollateralBacked();\\nerror FunctionNotFound(bytes4 _functionSelector);\\nerror IncorrectFacetCutAction(uint8 _action);\\nerror InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);\\nerror InvalidChainlinkRate();\\nerror InvalidLengths();\\nerror InvalidNegativeFees();\\nerror InvalidOracleType();\\nerror InvalidParam();\\nerror InvalidParams();\\nerror InvalidRate();\\nerror InvalidSwap();\\nerror InvalidTokens();\\nerror InvalidAccessManager();\\nerror ManagerHasAssets();\\nerror NoSelectorsProvidedForFacetForCut(address _facetAddress);\\nerror NotAllowed();\\nerror NotCollateral();\\nerror NotGovernor();\\nerror NotGuardian();\\nerror NotTrusted();\\nerror NotTrustedOrGuardian();\\nerror NotWhitelisted();\\nerror OdosSwapFailed();\\nerror OracleUpdateFailed();\\nerror Paused();\\nerror ReentrantCall();\\nerror RemoveFacetAddressMustBeZeroAddress(address _facetAddress);\\nerror TooBigAmountIn();\\nerror TooLate();\\nerror TooSmallAmountOut();\\nerror ZeroAddress();\\nerror ZeroAmount();\\nerror SwapError();\\nerror SlippageTooHigh();\\nerror InsufficientFunds();\\n\",\"keccak256\":\"0x1e2f6812ef78e948e5155d32213b52afff8c0ba5463d18bee10694efbf886130\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x6080604052610b528038038061001481610823565b92833981016060828203126107165781516001600160401b0381116107165782019181601f840112156107165782519261005561005085610848565b610823565b90602082868152016020819660051b830101918583116107165760208101915b83831061071a575050505061008c6020830161085f565b604083015190926001600160401b038211610716570183601f82011215610716578051906100bc61005083610873565b948286526020838301011161071657815f9260208093018388015e8501015280515f5b81811061021c5750506040519060608201906060835251809152608082019060808160051b84010195915f905b828210610172576001600160a01b0386166020860152848803604086015261016487877f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673888061015c8e866108b6565b0390a1610975565b60405160ee9081610a248239f35b848803607f19018152835180516001600160a01b03168952602081015194989394929391926060830191600382101561020857604060809160209384870152015193606060408201528451809452019201905f905b8082106101e55750505060208060019299019201920190929161010c565b82516001600160e01b0319168452602093840193909201916001909101906101c7565b634e487b7160e01b5f52602160045260245ffd5b6040610228828561088e565b5101516001600160a01b0361023d838661088e565b51511690805115610703576020610254848761088e565b51015160038110156102085780610417575081156103f65761ffff5f516020610b325f395f51905f5254169161028981610a0c565b8151915f935b8385106102a55750505050506001905b016100df565b6001600160e01b03196102b8868461088e565b51165f8181525f516020610b125f395f51905f5260205260409020546001600160a01b03166103e45761034a6102ec610804565b85815261ffff9390931660208085018281525f8581525f516020610b125f395f51905f5290925260409091209451855491516001600160b01b03199092166001600160a01b03919091161760a09190911b61ffff60a01b1617909355565b5f516020610b325f395f51905f525490680100000000000000008210156103d05761038a8260016103a794015f516020610b325f395f51905f52556108da565b90919063ffffffff83549160031b9260e01c831b921b1916179055565b61ffff81146103bc576001948501940161028f565b634e487b7160e01b5f52601160045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b63ebbf5d0760e01b5f5260045260245ffd5b6040516302b8da0760e21b81529081906104139060048301610932565b0390fd5b60018103610524575081156105075761042f82610a0c565b8051906001600160a01b038316905f5b83811061045357505050505060019061029f565b6001600160e01b0319610466828461088e565b51165f8181525f516020610b125f395f51905f5260205260409020546001600160a01b03163081146104f4578681146104e157156104cf575f9081525f516020610b125f395f51905f526020526040902080546001600160a01b0319168417905560010161043f565b637479f93960e01b5f5260045260245ffd5b50631ac6ce8d60e11b5f5260045260245ffd5b50632901806d60e11b5f5260045260245ffd5b60405163cd98a96f60e01b81529081906104139060048301610932565b600214610536575b505060019061029f565b5f516020610b325f395f51905f525491806106f157508051905f5b82811061055f57505061052c565b6001600160e01b0319610572828461088e565b511690815f525f516020610b125f395f51905f5260205260405f2094610596610804565b95549560018060a01b03871680825261ffff602083019860a01c168852156106de57516001600160a01b031630146106cb5780156103bc575f1901948561ffff82511603610657575b505f516020610b325f395f51905f5254918215610643576001925f1901610605816108da565b63ffffffff82549160031b1b191690555f516020610b325f395f51905f52555f525f516020610b125f395f51905f526020525f604081205501610551565b634e487b7160e01b5f52603160045260245ffd5b6106c59061ffff610667886108da565b90549060031b1c60e01b916106828361038a848451166108da565b516001600160e01b03199092165f9081525f516020610b125f395f51905f5260205260409020805461ffff60a01b19169190921660a01b61ffff60a01b16179055565b5f6105df565b82630df5fd6160e31b5f5260045260245ffd5b83637a08a22d60e01b5f5260045260245ffd5b63d091bc8160e01b5f5260045260245ffd5b5063e767f91f60e01b5f5260045260245ffd5b5f80fd5b82516001600160401b0381116107165782016060818903601f1901126107165760405190606082016001600160401b038111838210176103d0576040526107636020820161085f565b82526040810151600381101561071657602083015260608101516001600160401b03811161071657602091010188601f820112156107165780516107a961005082610848565b9160208084848152019260051b820101908b821161071657602001915b8183106107e3575050506040820152815260209283019201610075565b82516001600160e01b031981168103610716578152602092830192016107c6565b60408051919082016001600160401b038111838210176103d057604052565b6040519190601f01601f191682016001600160401b038111838210176103d057604052565b6001600160401b0381116103d05760051b60200190565b51906001600160a01b038216820361071657565b6001600160401b0381116103d057601f01601f191660200190565b80518210156108a25760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b905f516020610b325f395f51905f52548210156108a2575f516020610b325f395f51905f525f52600382901c7f44fefae66705534388ac21ba5f0775616856a675b8eaea9bb0b2507f062387c3019160021b601c1690565b60206040818301928281528451809452019201905f5b8181106109555750505090565b82516001600160e01b031916845260209384019390920191600101610948565b6001600160a01b03811691908215610a07575f816109938293610a0c565b83519060208501905af4913d156109ff573d926109b261005085610873565b9384523d5f602086013e5b156109c757505050565b8251156109d657825160208401fd5b61041360405192839263192105d760e01b845260048401526040602484015260448301906108b6565b6060926109bd565b505050565b3b15610a1457565b63c1df45cf60e01b5f5260045ffdfe6080806040527fffffffff000000000000000000000000000000000000000000000000000000005f3516805f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205273ffffffffffffffffffffffffffffffffffffffff60405f205416908115608d57505f8091368285378336915af4903d91825f833e15608b57f35bfd5b7f5416eb98000000000000000000000000000000000000000000000000000000005f5260045260245ffdfea2646970667358221220629bc78921d5e77037d547e2af363fd9d91e1e539c2a2db1e3afa1bb9e654ef564736f6c634300081c0033c8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131cc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b", + "deployedBytecode": "0x6080806040527fffffffff000000000000000000000000000000000000000000000000000000005f3516805f527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205273ffffffffffffffffffffffffffffffffffffffff60405f205416908115608d57505f8091368285378336915af4903d91825f833e15608b57f35bfd5b7f5416eb98000000000000000000000000000000000000000000000000000000005f5260045260245ffdfea2646970667358221220629bc78921d5e77037d547e2af363fd9d91e1e539c2a2db1e3afa1bb9e654ef564736f6c634300081c0033", + "devdoc": { + "author": "Cooper Labs", + "custom:contact": "security@cooperlabs.xyz", + "details": "Reference: EIP-2535 DiamondsForked from https://github.com/mudgen/diamond-3/blob/master/contracts/Diamond.sol by mudgen", + "kind": "dev", + "methods": {}, + "title": "DiamondProxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "notice": "Implementation of a Diamond Proxy", + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/Redeemer.json b/deployments/sepolia/Redeemer.json new file mode 100644 index 0000000..69fd765 --- /dev/null +++ b/deployments/sepolia/Redeemer.json @@ -0,0 +1,354 @@ +{ + "address": "0x57770C1721Eb35509f38210A935c8b1911db7E0e", + "abi": [ + { + "inputs": [], + "name": "InvalidChainlinkRate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidLengths", + "type": "error" + }, + { + "inputs": [], + "name": "NotTrusted", + "type": "error" + }, + { + "inputs": [], + "name": "NotWhitelisted", + "type": "error" + }, + { + "inputs": [], + "name": "Paused", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrantCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "TooBigAmountIn", + "type": "error" + }, + { + "inputs": [], + "name": "TooLate", + "type": "error" + }, + { + "inputs": [], + "name": "TooSmallAmountOut", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newNormalizerValue", + "type": "uint256" + } + ], + "name": "NormalizerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "forfeitTokens", + "type": "address[]" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "Redeemed", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "quoteRedemptionCurve", + "outputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "minAmountOuts", + "type": "uint256[]" + } + ], + "name": "redeem", + "outputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "minAmountOuts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "forfeitTokens", + "type": "address[]" + } + ], + "name": "redeemWithForfeit", + "outputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "increase", + "type": "bool" + } + ], + "name": "updateNormalizer", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x557f1906847afa4fa2b27e4d7d40910a23ad7af11ad4674f640f343aea773379", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0x57770C1721Eb35509f38210A935c8b1911db7E0e", + "transactionIndex": 92, + "gasUsed": "2530869", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4d9d2f97f77a11fb882e585028b908e7010bff83abeefdfd4b64c869dd9b07b5", + "transactionHash": "0x557f1906847afa4fa2b27e4d7d40910a23ad7af11ad4674f640f343aea773379", + "logs": [], + "blockNumber": 8411096, + "cumulativeGasUsed": "19829606", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9d44d918681c9ad36f866ebee034a3d1", + "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidChainlinkRate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidLengths\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotTrusted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWhitelisted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Paused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooBigAmountIn\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooLate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooSmallAmountOut\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newNormalizerValue\",\"type\":\"uint256\"}],\"name\":\"NormalizerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"forfeitTokens\",\"type\":\"address[]\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"Redeemed\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"quoteRedemptionCurve\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"minAmountOuts\",\"type\":\"uint256[]\"}],\"name\":\"redeem\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"minAmountOuts\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"forfeitTokens\",\"type\":\"address[]\"}],\"name\":\"redeemWithForfeit\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"increase\",\"type\":\"bool\"}],\"name\":\"updateNormalizer\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Cooper Labs\",\"custom:contact\":\"security@cooperlabs.xyz\",\"details\":\"This contract is an authorized fork of Angle's `Redeemer` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/Redeemer.sol\",\"errors\":{\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC-20 token failed.\"}]},\"kind\":\"dev\",\"methods\":{\"quoteRedemptionCurve(uint256)\":{\"returns\":{\"amounts\":\"Amount that would be obtained for each token in the `tokens` array\",\"tokens\":\"List of tokens that would be given\"}},\"redeem(uint256,address,uint256,uint256[])\":{\"details\":\"The `minAmountOuts` list must reflect the amount of `tokens` returnedIn normal conditions, the amount of tokens outputted by this function should be the amount of collateral assets supported by the system, following their order in the `collateralList`.If one collateral has its liquidity managed through strategies, then it's possible that this asset has sub-collaterals with it. In this situation, these sub-collaterals may be sent during the redemption process and the `minAmountOuts` will be bigger than the `collateralList` length. If there are 3 collateral assets and the 2nd collateral asset in the list (at index 1) consists of 3 sub-collaterals, then the ordering of the token list will be as follows: `[collat 1, sub-collat 1 of collat 2, sub-collat 2 of collat 2, sub-collat 3 of collat 2, collat 3]`The list of tokens outputted (and hence the minimum length of the `minAmountOuts` list) can be obtained by calling the `quoteRedemptionCurve` functionTokens requiring a whitelist must be forfeited if the redemption is to an address that is not in the whitelist, otherwise this function revertsNo approval is needed before calling this function\",\"params\":{\"deadline\":\"Timestamp before which the redemption should have occured\",\"minAmountOuts\":\"Minimum amount of each token given back in the redemption to obtain\",\"receiver\":\"Address which should be receiving the output tokens\"},\"returns\":{\"amounts\":\"Amount given for each token in the `tokens` array\",\"tokens\":\"List of tokens returned\"}},\"redeemWithForfeit(uint256,address,uint256,uint256[],address[])\":{\"details\":\"Beware that if a token is given in the `forfeitTokens` list, the redemption will not try to send token even if it has enough immediately available to send the amount\"},\"updateNormalizer(uint256,bool)\":{\"details\":\"This function may be called by trusted addresses: these could be for instance savings contract minting stablecoins when they notice a profit\"}},\"title\":\"Redeemer\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"quoteRedemptionCurve(uint256)\":{\"notice\":\"Simulate the exact output that a redemption of `amount` of stablecoins would give at a given block\"},\"redeem(uint256,address,uint256,uint256[])\":{\"notice\":\"Redeems `amount` of stablecoins from the system\"},\"redeemWithForfeit(uint256,address,uint256,uint256[],address[])\":{\"notice\":\"Same as the redeem function above with the additional feature to specify a list of `forfeitTokens` for which the Parallelizer system will not try to do a transfer to `receiver`.\"},\"updateNormalizer(uint256,bool)\":{\"notice\":\"Updates the normalizer variable by `amount`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/parallelizer/facets/Redeemer.sol\":\"Redeemer\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAuthority} from \\\"./IAuthority.sol\\\";\\n\\nlibrary AuthorityUtils {\\n /**\\n * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\\n * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\\n * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\\n */\\n function canCallWithDelay(\\n address authority,\\n address caller,\\n address target,\\n bytes4 selector\\n ) internal view returns (bool immediate, uint32 delay) {\\n (bool success, bytes memory data) = authority.staticcall(\\n abi.encodeCall(IAuthority.canCall, (caller, target, selector))\\n );\\n if (success) {\\n if (data.length >= 0x40) {\\n (immediate, delay) = abi.decode(data, (bool, uint32));\\n } else if (data.length >= 0x20) {\\n immediate = abi.decode(data, (bool));\\n }\\n }\\n return (immediate, delay);\\n }\\n}\\n\",\"keccak256\":\"0xb3875997b0d8705e29aa20fee88e1dfef93df438794ae1ad8ba2eb016a4dd4e4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAccessManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\ninterface IAccessManager {\\n /**\\n * @dev A delayed operation was scheduled.\\n */\\n event OperationScheduled(\\n bytes32 indexed operationId,\\n uint32 indexed nonce,\\n uint48 schedule,\\n address caller,\\n address target,\\n bytes data\\n );\\n\\n /**\\n * @dev A scheduled operation was executed.\\n */\\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev A scheduled operation was canceled.\\n */\\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev Informational labelling for a roleId.\\n */\\n event RoleLabel(uint64 indexed roleId, string label);\\n\\n /**\\n * @dev Emitted when `account` is granted `roleId`.\\n *\\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\\n * otherwise it indicates the execution delay for this account and roleId is updated.\\n */\\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\\n\\n /**\\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\\n */\\n event RoleRevoked(uint64 indexed roleId, address indexed account);\\n\\n /**\\n * @dev Role acting as admin over a given `roleId` is updated.\\n */\\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\\n\\n /**\\n * @dev Role acting as guardian over a given `roleId` is updated.\\n */\\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\\n\\n /**\\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\\n */\\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\\n\\n /**\\n * @dev Target mode is updated (true = closed, false = open).\\n */\\n event TargetClosed(address indexed target, bool closed);\\n\\n /**\\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\\n */\\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\\n\\n /**\\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\\n */\\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\\n\\n error AccessManagerAlreadyScheduled(bytes32 operationId);\\n error AccessManagerNotScheduled(bytes32 operationId);\\n error AccessManagerNotReady(bytes32 operationId);\\n error AccessManagerExpired(bytes32 operationId);\\n error AccessManagerLockedRole(uint64 roleId);\\n error AccessManagerBadConfirmation();\\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\\n error AccessManagerUnauthorizedConsume(address target);\\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\\n\\n /**\\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\\n * & {execute} workflow.\\n *\\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\\n * for future execution.\\n *\\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\\n * the operation can be executed if and only if delay is greater than 0.\\n *\\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\\n *\\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\\n * {AccessManager} documentation.\\n */\\n function canCall(\\n address caller,\\n address target,\\n bytes4 selector\\n ) external view returns (bool allowed, uint32 delay);\\n\\n /**\\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\\n *\\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\\n * disabling any scheduling usage.\\n */\\n function expiration() external view returns (uint32);\\n\\n /**\\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\\n * can be increased without setback (and reset via {revokeRole} in the case event of an\\n * accidental increase). Defaults to 5 days.\\n */\\n function minSetback() external view returns (uint32);\\n\\n /**\\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\\n *\\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\\n */\\n function isTargetClosed(address target) external view returns (bool);\\n\\n /**\\n * @dev Get the role required to call a function.\\n */\\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\\n\\n /**\\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\\n */\\n function getTargetAdminDelay(address target) external view returns (uint32);\\n\\n /**\\n * @dev Get the id of the role that acts as an admin for the given role.\\n *\\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\\n * an operation that is restricted to this role.\\n */\\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role that acts as a guardian for a given role.\\n *\\n * The guardian permission allows canceling operations that have been scheduled under the role.\\n */\\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role current grant delay.\\n *\\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\\n */\\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\\n\\n /**\\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\\n * level.\\n *\\n * Returns:\\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\\n * [1] Current execution delay for the account.\\n * [2] Pending execution delay for the account.\\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\\n */\\n function getAccess(\\n uint64 roleId,\\n address account\\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\\n\\n /**\\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\\n * permission might be associated with an execution delay. {getAccess} can provide more details.\\n */\\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\\n\\n /**\\n * @dev Give a label to a role, for improved role discoverability by UIs.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleLabel} event.\\n */\\n function labelRole(uint64 roleId, string calldata label) external;\\n\\n /**\\n * @dev Add `account` to `roleId`, or change its execution delay.\\n *\\n * This gives the account the authorization to call any function that is restricted to this role. An optional\\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\\n *\\n * If the account has already been granted this role, the execution delay will be updated. This update is not\\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - granted role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleGranted} event.\\n */\\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\\n\\n /**\\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\\n * no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - revoked role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function revokeRole(uint64 roleId, address account) external;\\n\\n /**\\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\\n * the role this call has no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function renounceRole(uint64 roleId, address callerConfirmation) external;\\n\\n /**\\n * @dev Change admin role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleAdminChanged} event\\n */\\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\\n\\n /**\\n * @dev Change guardian role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGuardianChanged} event\\n */\\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\\n\\n /**\\n * @dev Update the delay for granting a `roleId`.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGrantDelayChanged} event.\\n */\\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetFunctionRoleUpdated} event per selector.\\n */\\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\\n\\n /**\\n * @dev Set the delay for changing the configuration of a given target contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetAdminDelayUpdated} event.\\n */\\n function setTargetAdminDelay(address target, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the closed flag for a contract.\\n *\\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetClosed} event.\\n */\\n function setTargetClosed(address target, bool closed) external;\\n\\n /**\\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\\n * operation is not yet scheduled, has expired, was executed, or was canceled.\\n */\\n function getSchedule(bytes32 id) external view returns (uint48);\\n\\n /**\\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\\n * been scheduled.\\n */\\n function getNonce(bytes32 id) external view returns (uint32);\\n\\n /**\\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\\n * required for the caller. The special value zero will automatically set the earliest possible time.\\n *\\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\\n *\\n * Emits a {OperationScheduled} event.\\n *\\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\\n * contract if it is using standard Solidity ABI encoding.\\n */\\n function schedule(\\n address target,\\n bytes calldata data,\\n uint48 when\\n ) external returns (bytes32 operationId, uint32 nonce);\\n\\n /**\\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\\n * execution delay is 0.\\n *\\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\\n *\\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\\n */\\n function execute(address target, bytes calldata data) external payable returns (uint32);\\n\\n /**\\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\\n * operation that is cancelled.\\n *\\n * Requirements:\\n *\\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\\n *\\n * Emits a {OperationCanceled} event.\\n */\\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\\n\\n /**\\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\\n *\\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\\n * with all the verifications that it implies.\\n *\\n * Emit a {OperationExecuted} event.\\n */\\n function consumeScheduledOp(address caller, bytes calldata data) external;\\n\\n /**\\n * @dev Hashing function for delayed operations.\\n */\\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\\n\\n /**\\n * @dev Changes the authority of a target managed by this manager instance.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n */\\n function updateAuthority(address target, address newAuthority) external;\\n}\\n\",\"keccak256\":\"0x9be2d08a326515805bc9cf6315b7953f8d1ebe88abf48c2d645fb1fa8211a0e2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAuthority.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard interface for permissioning originally defined in Dappsys.\\n */\\ninterface IAuthority {\\n /**\\n * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\\n */\\n function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\\n}\\n\",\"keccak256\":\"0x4cc0766bd7fb7b3bafb70afa2a93b6e313a0baec7a35ad1b57505be7861c1030\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1363.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"./IERC20.sol\\\";\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @title IERC1363\\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\\n *\\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\\n */\\ninterface IERC1363 is IERC20, IERC165 {\\n /*\\n * Note: the ERC-165 identifier for this interface is 0xb0202a11.\\n * 0xb0202a11 ===\\n * bytes4(keccak256('transferAndCall(address,uint256)')) ^\\n * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\\n * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\\n * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\\n * bytes4(keccak256('approveAndCall(address,uint256)')) ^\\n * bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\\n */\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferAndCall(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @param data Additional data with no specified format, sent in call to `to`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param from The address which you want to send tokens from.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param from The address which you want to send tokens from.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @param data Additional data with no specified format, sent in call to `to`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to be spent.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function approveAndCall(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to be spent.\\n * @param data Additional data with no specified format, sent in call to `spender`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9b6b3e7803bc5f2f8cd7ad57db8ac1def61a9930a5a3107df4882e028a9605d7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\n\",\"keccak256\":\"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC1363} from \\\"../../../interfaces/IERC1363.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n /**\\n * @dev An operation with an ERC-20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n *\\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n *\\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n *\\n * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\\n * only sets the \\\"standard\\\" allowance. Any temporary allowance will remain active, in addition to the value being\\n * set here.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n if (to.code.length == 0) {\\n safeTransfer(token, to, value);\\n } else if (!token.transferAndCall(to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\\n * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function transferFromAndCallRelaxed(\\n IERC1363 token,\\n address from,\\n address to,\\n uint256 value,\\n bytes memory data\\n ) internal {\\n if (to.code.length == 0) {\\n safeTransferFrom(token, from, to, value);\\n } else if (!token.transferFromAndCall(from, to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\\n * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\\n * once without retrying, and relies on the returned value to be true.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n if (to.code.length == 0) {\\n forceApprove(token, to, value);\\n } else if (!token.approveAndCall(to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n uint256 returnSize;\\n uint256 returnValue;\\n assembly (\\\"memory-safe\\\") {\\n let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n // bubble errors\\n if iszero(success) {\\n let ptr := mload(0x40)\\n returndatacopy(ptr, 0, returndatasize())\\n revert(ptr, returndatasize())\\n }\\n returnSize := returndatasize()\\n returnValue := mload(0)\\n }\\n\\n if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n bool success;\\n uint256 returnSize;\\n uint256 returnValue;\\n assembly (\\\"memory-safe\\\") {\\n success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n returnSize := returndatasize()\\n returnValue := mload(0)\\n }\\n return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\\n }\\n}\\n\",\"keccak256\":\"0x4ea01544758fd2c7045961904686bfe232d2220a04ecaa2d6b08dac17827febf\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/interfaces/IManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IManager` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IManager.sol\\ninterface IManager {\\n /// @notice Returns the amount of collateral managed by the Manager\\n /// @return balances Balances of all the subCollaterals handled by the manager\\n /// @dev MUST NOT revert\\n function totalAssets() external view returns (uint256[] memory balances, uint256 totalValue);\\n\\n /// @notice Hook to invest `amount` of `collateral`\\n /// @dev MUST revert if the manager cannot accept these funds\\n /// @dev MUST have received the funds beforehand\\n function invest(uint256 amount) external;\\n\\n /// @notice Sends `amount` of `collateral` to the `to` address\\n /// @dev Called when `tokenP` are burnt and during redemptions\\n // @dev MUST revert if there are not funds enough available\\n /// @dev MUST be callable only by the parallelizer\\n function release(address asset, address to, uint256 amount) external;\\n\\n /// @notice Gives the maximum amount of collateral immediately available for a transfer\\n /// @dev Useful for integrators using `quoteIn` and `quoteOut`\\n function maxAvailable() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8507172834f0243643fcf366bff6bae8f20523d102f5896f2140946975458e2c\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IParallelizerOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IParallelizerOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IParallelizerOracle` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IParallelizerOracle.sol\\ninterface IParallelizerOracle {\\n /// @notice Reads the oracle value for asset to use in a redemption to compute the collateral ratio\\n function readRedemption() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a mint. It should be comprehensive of the\\n /// deviation from the target price\\n function readMint() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a burn transaction as well as the ratio\\n /// between the current price and the target price for the asset\\n function readBurn() external view returns (uint256 oracleValue, uint256 ratio);\\n\\n /// @notice Reads the oracle value for asset\\n function read() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb7287bfcade62fa4dfb07ea1cd6c1fc8be1525320f3faca44d8d9a6a01e99110\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IRedeemer.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IRedeemer\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IRedeemer` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IRedeemer.sol\\ninterface IRedeemer {\\n /// @notice Redeems `amount` of stablecoins from the system\\n /// @param receiver Address which should be receiving the output tokens\\n /// @param deadline Timestamp before which the redemption should have occured\\n /// @param minAmountOuts Minimum amount of each token given back in the redemption to obtain\\n /// @return tokens List of tokens returned\\n /// @return amounts Amount given for each token in the `tokens` array\\n function redeem(\\n uint256 amount,\\n address receiver,\\n uint256 deadline,\\n uint256[] memory minAmountOuts\\n )\\n external\\n returns (address[] memory tokens, uint256[] memory amounts);\\n\\n /// @notice Same as the redeem function above with the additional feature to specify a list of `forfeitTokens` for\\n /// which the Parallelizer system will not try to do a transfer to `receiver`.\\n function redeemWithForfeit(\\n uint256 amount,\\n address receiver,\\n uint256 deadline,\\n uint256[] memory minAmountOuts,\\n address[] memory forfeitTokens\\n )\\n external\\n returns (address[] memory tokens, uint256[] memory amounts);\\n\\n /// @notice Simulate the exact output that a redemption of `amount` of stablecoins would give at a given block\\n /// @return tokens List of tokens that would be given\\n /// @return amounts Amount that would be obtained for each token in the `tokens` array\\n function quoteRedemptionCurve(uint256 amount)\\n external\\n view\\n returns (address[] memory tokens, uint256[] memory amounts);\\n\\n /// @notice Updates the normalizer variable by `amount`\\n function updateNormalizer(uint256 amount, bool increase) external returns (uint256);\\n}\\n\",\"keccak256\":\"0xb3522ee0380b321c64d02bf2db2acb658d8b314b811dd54b6a718d6708b5fb21\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/ITokenP.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title ITokenP\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Interface for the stablecoins `tokenP` contracts\\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\\ninterface ITokenP is IERC20 {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MINTER ROLE ONLY FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Lets a whitelisted contract mint tokenPs\\n /// @param account Address to mint to\\n /// @param amount Amount to mint\\n function mint(address account, uint256 amount) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @param sender Address which requested the burn from `burner`\\n /// @dev This method is to be called by a contract with the minter right after being requested\\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\\n /// @dev The method checks the allowance between the `sender` and the `burner`\\n function burnFrom(uint256 amount, address burner, address sender) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\\n /// requested to do so by an address willing to burn tokens from its address\\n function burnSelf(uint256 amount, address burner) external;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Amount of decimals of the stablecoin\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x64a1305faa8c5c91767a11af0eae16e4b463aa0bfe10f11b74aae9d96681a5eb\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\ninterface AggregatorV3Interface {\\n function decimals() external view returns (uint8);\\n\\n function description() external view returns (string memory);\\n\\n function version() external view returns (uint256);\\n\\n // getRoundData and latestRoundData should both raise \\\"No data present\\\"\\n // if they do not have data to report, instead of returning unset values\\n // which could be misinterpreted as actual reported values.\\n function getRoundData(uint80 _roundId)\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n\\n function latestRoundData()\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n}\\n\",\"keccak256\":\"0x94da577160ebb1bfeb7008676c8e7d43dda926d9c0beee29077e9ed774707373\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/coinbase/ICbETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ICbETH\\n/// @notice Interface for the `cbETH` contract\\ninterface ICbETH {\\n function exchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb159341cb0e25c478912b274cdda2d50fa84692aeac87b6823d281aaea2aed04\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/frax/ISfrxETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ISfrxETH\\n/// @notice Interface for the `sfrxETH` contract\\ninterface ISfrxETH {\\n function pricePerShare() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x914cbea276f817c7db62bfca21e15bd8f7892faa9f39d86baaef574cf12b859f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/keyring/IKeyringGuard.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IKeyringGuard\\n/// @notice Interface for the `KeyringGuard` contract\\ninterface IKeyringGuard {\\n function isAuthorized(address from, address to) external returns (bool passed);\\n}\\n\",\"keccak256\":\"0x30bdab602ba0a6e2571372803ae35f7bebcc354d69408be627c04c57f7071f90\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/lido/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IStETH\\n/// @notice Interface for the `StETH` contract\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n\\n function submit(address) external payable returns (uint256);\\n\\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf21e3d8bdadc236b34bf2122b0e0b939d2d6bb6e2889b508636cbb7b84f59680\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/morpho/IMorphoOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IMorphoOracle\\n/// @notice Interface for the oracle contracts used within Morpho\\ninterface IMorphoOracle {\\n function price() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x0d1849803b554763f1dce55eba5a6e8d7c5b12d4cc8dfe23637e827d2ee91d17\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/rocketPool/IRETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IRETH\\n/// @notice Interface for the `rETH` contract\\ninterface IRETH {\\n function getExchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x567a378e95d40160e297c1adb617ccaa69c03e49c4ad72a6ce651dd43cdbd5cd\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/Storage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ENUMS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nenum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n}\\n\\nenum ManagerType {\\n EXTERNAL\\n}\\n\\nenum ActionType {\\n Mint,\\n Burn,\\n Redeem\\n}\\n\\nenum TrustedType {\\n Updater,\\n Seller\\n}\\n\\nenum QuoteType {\\n MintExactInput,\\n MintExactOutput,\\n BurnExactInput,\\n BurnExactOutput\\n}\\n\\nenum OracleReadType {\\n CHAINLINK_FEEDS,\\n EXTERNAL,\\n NO_ORACLE,\\n STABLE,\\n WSTETH,\\n CBETH,\\n RETH,\\n SFRXETH,\\n MAX,\\n MORPHO_ORACLE\\n}\\n\\nenum OracleQuoteType {\\n UNIT,\\n TARGET\\n}\\n\\nenum WhitelistType {\\n BACKED\\n}\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STRUCTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nstruct Permit2Details {\\n address to; // Address that will receive the funds\\n uint256 nonce; // Nonce of the transaction\\n bytes signature; // Permit signature of the user\\n}\\n\\nstruct FacetCut {\\n address facetAddress; // Facet contract address\\n FacetCutAction action; // Can be add, remove or replace\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct Facet {\\n address facetAddress; // Facet contract address\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct FacetInfo {\\n address facetAddress; // Facet contract address\\n uint16 selectorPosition; // Position in the list of all selectors\\n}\\n\\nstruct DiamondStorage {\\n bytes4[] selectors; // List of all available selectors\\n mapping(bytes4 => FacetInfo) selectorInfo; // Selector to (address, position in list)\\n IAccessManager accessManager; // Contract handling access management\\n}\\n\\nstruct ImplementationStorage {\\n address implementation; // Dummy implementation address for Etherscan usability\\n}\\n\\nstruct ManagerStorage {\\n IERC20[] subCollaterals; // Subtokens handled by the manager or strategies\\n bytes config; // Additional configuration data\\n}\\n\\nstruct Collateral {\\n uint8 isManaged; // If the collateral is managed through external strategies\\n uint8 isMintLive; // If minting from this asset is unpaused\\n uint8 isBurnLive; // If burning to this asset is unpaused\\n uint8 decimals; // IERC20Metadata(collateral).decimals()\\n uint8 onlyWhitelisted; // If only whitelisted addresses can burn or redeem for this token\\n uint216 normalizedStables; // Normalized amount of stablecoins issued from this collateral\\n uint64[] xFeeMint; // Increasing exposures in [0,BASE_9[\\n int64[] yFeeMint; // Mint fees at the exposures specified in `xFeeMint`\\n uint64[] xFeeBurn; // Decreasing exposures in ]0,BASE_9]\\n int64[] yFeeBurn; // Burn fees at the exposures specified in `xFeeBurn`\\n bytes oracleConfig; // Data about the oracle used for the collateral\\n bytes whitelistData; // For whitelisted collateral, data used to verify whitelists\\n ManagerStorage managerData; // For managed collateral, data used to handle the strategies\\n uint256 stablecoinCap; // Cap on the amount of stablecoins that can be issued from this collateral\\n}\\n\\nstruct ParallelizerStorage {\\n ITokenP tokenP; // tokenP handled by the system\\n uint8 isRedemptionLive; // If redemption is unpaused\\n uint8 statusReentrant; // If call is reentrant or not\\n bool consumingSchedule; // If the contract is consuming a scheduled operation\\n uint128 normalizedStables; // Normalized amount of stablecoins issued by the system\\n uint128 normalizer; // To reconcile `normalizedStables` values with the actual amount\\n address[] collateralList; // List of collateral assets supported by the system\\n uint64[] xRedemptionCurve; // Increasing collateral ratios > 0\\n int64[] yRedemptionCurve; // Value of the redemption fees at `xRedemptionCurve`\\n mapping(address => Collateral) collaterals; // Maps a collateral asset to its parameters\\n mapping(address => uint256) isTrusted; // If an address is trusted to update the normalizer value\\n mapping(address => uint256) isSellerTrusted; // If an address is trusted to sell accruing reward tokens or to run\\n // keeper jobs on oracles\\n mapping(WhitelistType => mapping(address => uint256)) isWhitelistedForType;\\n}\\n// Whether an address is whitelisted for a specific whitelist type\\n\",\"keccak256\":\"0x3f4313dd110dbe390038320b2d3cf24dcbe9b75cd9573e7f048f7233c02dd227\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/AccessManagedModifiers.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { LibDiamond } from \\\"../libraries/LibDiamond.sol\\\";\\nimport { LibStorage as s, ParallelizerStorage } from \\\"../libraries/LibStorage.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\n\\n/// @title AccessManagedModifiers\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This contract is an authorized fork of Angle's `AccessControlModifiers` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/AccessControlModifiers.sol\\n/// update access logic to use OpenZeppelin's `AccessManaged` logic\\ncontract AccessManagedModifiers {\\n /// @notice Checks whether the `msg.sender` can call a function with a given selector\\n modifier restricted() {\\n if (!LibDiamond.checkCanCall(msg.sender, msg.data)) revert AccessManagedUnauthorized(msg.sender);\\n _;\\n }\\n\\n /// @notice Prevents a contract from calling itself, directly or indirectly\\n /// @dev This implementation is an adaptation of the OpenZepellin `ReentrancyGuard` for the purpose of this\\n /// Diamond Proxy system. The base implementation can be found here\\n /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol\\n modifier nonReentrant() {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n // Reentrant protection\\n // On the first call, `ts.statusReentrant` will be `NOT_ENTERED`\\n if (ts.statusReentrant == ENTERED) revert ReentrantCall();\\n // Any calls to the `nonReentrant` modifier after this point will fail\\n ts.statusReentrant = ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n ts.statusReentrant = NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0xa23f4434f86462af0594992bd826ba6af88f55201f2a7f79ce5fde05b5f10073\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/Redeemer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeCast } from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\nimport { IRedeemer } from \\\"contracts/interfaces/IRedeemer.sol\\\";\\n\\nimport { AccessManagedModifiers } from \\\"./AccessManagedModifiers.sol\\\";\\nimport { LibDiamond } from \\\"../libraries/LibDiamond.sol\\\";\\nimport { LibHelpers } from \\\"../libraries/LibHelpers.sol\\\";\\nimport { LibGetters } from \\\"../libraries/LibGetters.sol\\\";\\nimport { LibManager } from \\\"../libraries/LibManager.sol\\\";\\nimport { LibStorage as s } from \\\"../libraries/LibStorage.sol\\\";\\nimport { LibWhitelist } from \\\"../libraries/LibWhitelist.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title Redeemer\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This contract is an authorized fork of Angle's `Redeemer` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/Redeemer.sol\\ncontract Redeemer is IRedeemer, AccessManagedModifiers {\\n using SafeERC20 for IERC20;\\n using Math for uint256;\\n using SafeCast for uint256;\\n\\n event Redeemed(\\n uint256 amount,\\n address[] tokens,\\n uint256[] amounts,\\n address[] forfeitTokens,\\n address indexed from,\\n address indexed to\\n );\\n event NormalizerUpdated(uint256 newNormalizerValue);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL ACTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @inheritdoc IRedeemer\\n /// @dev The `minAmountOuts` list must reflect the amount of `tokens` returned\\n /// @dev In normal conditions, the amount of tokens outputted by this function should be the amount\\n /// of collateral assets supported by the system, following their order in the `collateralList`.\\n /// @dev If one collateral has its liquidity managed through strategies, then it's possible that this asset\\n /// has sub-collaterals with it. In this situation, these sub-collaterals may be sent during the redemption\\n /// process and the `minAmountOuts` will be bigger than the `collateralList` length. If there are 3 collateral\\n /// assets and the 2nd collateral asset in the list (at index 1) consists of 3 sub-collaterals, then the ordering\\n /// of the token list will be as follows:\\n /// `[collat 1, sub-collat 1 of collat 2, sub-collat 2 of collat 2, sub-collat 3 of collat 2, collat 3]`\\n /// @dev The list of tokens outputted (and hence the minimum length of the `minAmountOuts` list) can be obtained\\n /// by calling the `quoteRedemptionCurve` function\\n /// @dev Tokens requiring a whitelist must be forfeited if the redemption is to an address that is not in the\\n /// whitelist, otherwise this function reverts\\n /// @dev No approval is needed before calling this function\\n function redeem(\\n uint256 amount,\\n address receiver,\\n uint256 deadline,\\n uint256[] memory minAmountOuts\\n )\\n external\\n returns (address[] memory tokens, uint256[] memory amounts)\\n {\\n return _redeem(amount, receiver, deadline, minAmountOuts, new address[](0));\\n }\\n\\n /// @inheritdoc IRedeemer\\n /// @dev Beware that if a token is given in the `forfeitTokens` list, the redemption will not try to send token\\n /// even if it has enough immediately available to send the amount\\n function redeemWithForfeit(\\n uint256 amount,\\n address receiver,\\n uint256 deadline,\\n uint256[] memory minAmountOuts,\\n address[] memory forfeitTokens\\n )\\n external\\n returns (address[] memory tokens, uint256[] memory amounts)\\n {\\n return _redeem(amount, receiver, deadline, minAmountOuts, forfeitTokens);\\n }\\n\\n /// @inheritdoc IRedeemer\\n /// @dev This function may be called by trusted addresses: these could be for instance savings contract\\n /// minting stablecoins when they notice a profit\\n function updateNormalizer(uint256 amount, bool increase) external returns (uint256) {\\n if (!LibDiamond.checkCanCall(msg.sender, msg.data) && s.transmuterStorage().isTrusted[msg.sender] == 0) {\\n revert NotTrusted();\\n }\\n return _updateNormalizer(amount, increase);\\n }\\n\\n /// @inheritdoc IRedeemer\\n function quoteRedemptionCurve(uint256 amount)\\n external\\n view\\n returns (address[] memory tokens, uint256[] memory amounts)\\n {\\n (tokens, amounts,) = _quoteRedemptionCurve(amount);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal function of the `redeem` function in the `Redeemer` contract\\n function _redeem(\\n uint256 amount,\\n address to,\\n uint256 deadline,\\n uint256[] memory minAmountOuts,\\n address[] memory forfeitTokens\\n )\\n internal\\n nonReentrant\\n returns (address[] memory tokens, uint256[] memory amounts)\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n\\n if (ts.isRedemptionLive == 0) revert Paused();\\n if (block.timestamp > deadline) revert TooLate();\\n\\n uint256[] memory subCollateralsTracker;\\n (tokens, amounts, subCollateralsTracker) = _quoteRedemptionCurve(amount);\\n // Check that the provided slippage tokens length is identical to the redeem one\\n uint256 amountsLength = amounts.length;\\n // If a collateral is added and another one is removed after a redeem transaction is sent, the tokens\\n // corresponding to the `minAmountOuts` given may not correspond to the actual collateral `tokens` of\\n // the protocol\\n if (amountsLength != minAmountOuts.length) revert InvalidLengths();\\n // Updating the normalizer enables to simultaneously and proportionally reduce the amount\\n // of stablecoins issued from each collateral without having to loop through each of them\\n _updateNormalizer(amount, false);\\n\\n ITokenP(ts.tokenP).burnSelf(amount, msg.sender);\\n\\n address[] memory collateralListMem = ts.collateralList;\\n uint256 indexCollateral;\\n for (uint256 i; i < amountsLength; ++i) {\\n if (amounts[i] < minAmountOuts[i]) revert TooSmallAmountOut();\\n // If a token is in the `forfeitTokens` list, then it is not sent as part of the redemption process\\n if (amounts[i] > 0 && LibHelpers.checkList(tokens[i], forfeitTokens) < 0) {\\n Collateral storage collatInfo = ts.collaterals[collateralListMem[indexCollateral]];\\n if (collatInfo.onlyWhitelisted > 0 && !LibWhitelist.checkWhitelist(collatInfo.whitelistData, to)) {\\n revert NotWhitelisted();\\n }\\n if (collatInfo.isManaged > 0) {\\n LibManager.release(tokens[i], to, amounts[i], collatInfo.managerData.config);\\n } else {\\n IERC20(tokens[i]).safeTransfer(to, amounts[i]);\\n }\\n }\\n if (subCollateralsTracker[indexCollateral] - 1 <= i) ++indexCollateral;\\n }\\n emit Redeemed(amount, tokens, amounts, forfeitTokens, msg.sender, to);\\n }\\n\\n /// @dev This function reverts if `stablecoinsIssued==0`, which is expected behavior as there is nothing to redeem\\n /// anyway in this case, or if the `amountBurnt` is greater than `stablecoinsIssued`\\n function _quoteRedemptionCurve(uint256 amountBurnt)\\n internal\\n view\\n returns (address[] memory tokens, uint256[] memory balances, uint256[] memory subCollateralsTracker)\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint64 collatRatio;\\n uint256 stablecoinsIssued;\\n (collatRatio, stablecoinsIssued, tokens, balances, subCollateralsTracker) = LibGetters.getCollateralRatio();\\n if (amountBurnt > stablecoinsIssued) revert TooBigAmountIn();\\n int64[] memory yRedemptionCurveMem = ts.yRedemptionCurve;\\n uint64 penaltyFactor;\\n // If the protocol is under-collateralized, a penalty factor is applied to the returned amount of each asset\\n if (collatRatio < BASE_9) {\\n uint64[] memory xRedemptionCurveMem = ts.xRedemptionCurve;\\n penaltyFactor = uint64(LibHelpers.piecewiseLinear(collatRatio, xRedemptionCurveMem, yRedemptionCurveMem));\\n }\\n\\n for (uint256 i; i < balances.length; ++i) {\\n // The amount given for each token in reserves does not depend on the price of the tokens in reserve:\\n // it is a proportion of the balance for each token computed as the ratio between the stablecoins\\n // burnt relative to the amount of stablecoins issued.\\n // If the protocol is over-collateralized, the amount of each token given is inversely proportional\\n // to the collateral ratio.\\n balances[i] = collatRatio >= BASE_9\\n ? (amountBurnt * balances[i] * (uint64(yRedemptionCurveMem[yRedemptionCurveMem.length - 1])))\\n / (stablecoinsIssued * collatRatio)\\n : (amountBurnt * balances[i] * penaltyFactor) / (stablecoinsIssued * BASE_9);\\n }\\n }\\n\\n /// @notice Updates the `normalizer` variable used to track stablecoins issued from each asset and globally\\n function _updateNormalizer(uint256 amount, bool increase) internal returns (uint256 newNormalizerValue) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint256 _normalizer = ts.normalizer;\\n uint256 _normalizedStables = ts.normalizedStables;\\n // In case of an increase, the update formula used is the simplified version of the formula below:\\n /*\\n _normalizer * (BASE_27 + BASE_27 * amount / stablecoinsIssued) / BASE_27\\n = _normalizer + (_normalizer * BASE_27 * amount * (BASE_27 / (_normalizedStables * normalizer))) / BASE_27\\n = _normalizer + BASE_27 * amount / _normalizedStables\\n */\\n if (increase) {\\n newNormalizerValue = _normalizer + (amount * BASE_27) / _normalizedStables;\\n } else {\\n newNormalizerValue = _normalizer - (amount * BASE_27) / _normalizedStables;\\n }\\n // If the `normalizer` gets too small or too big, it must be renormalized to later avoid the propagation of\\n // rounding errors, as well as overflows. In this case, the function has to iterate through all the\\n // supported collateral assets\\n if (newNormalizerValue <= BASE_18 || newNormalizerValue >= BASE_36) {\\n address[] memory collateralListMem = ts.collateralList;\\n uint256 collateralListLength = collateralListMem.length;\\n // For each asset, we store the actual amount of stablecoins issued based on the `newNormalizerValue`\\n // (and not a normalized value)\\n // We ensure to preserve the invariant `sum(collateralNewNormalizedStables) = normalizedStables`\\n uint128 newNormalizedStables;\\n for (uint256 i; i < collateralListLength; ++i) {\\n uint128 newCollateralNormalizedStable = (\\n (uint256(ts.collaterals[collateralListMem[i]].normalizedStables) * newNormalizerValue) / BASE_27\\n ).toUint128();\\n newNormalizedStables += newCollateralNormalizedStable;\\n ts.collaterals[collateralListMem[i]].normalizedStables = uint216(newCollateralNormalizedStable);\\n }\\n ts.normalizedStables = newNormalizedStables;\\n newNormalizerValue = BASE_27;\\n }\\n ts.normalizer = newNormalizerValue.toUint128();\\n emit NormalizerUpdated(newNormalizerValue);\\n }\\n}\\n\",\"keccak256\":\"0x9a573fe7a2ee933da41f50dadcf72da74bf846001d7ad378a14f7f7afc955a4b\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibDiamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { AuthorityUtils } from \\\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibDiamond\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Helper library to deal with diamond proxies.\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/libraries/LibDiamond.sol by mudgen\\nlibrary LibDiamond {\\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n function isGovernor(address caller) internal view returns (bool) {\\n (bool isMember,) = s.diamondStorage().accessManager.hasRole(GOVERNOR_ROLE, caller);\\n return isMember;\\n }\\n\\n /// @notice Checks whether `caller` can call `data` on `this`\\n function checkCanCall(address caller, bytes calldata data) internal returns (bool) {\\n IAccessManager accessManager = s.diamondStorage().accessManager;\\n (bool immediate, uint32 delay) =\\n AuthorityUtils.canCallWithDelay(address(accessManager), caller, address(this), bytes4(data[0:4]));\\n if (!immediate) {\\n if (delay > 0) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n ts.consumingSchedule = true;\\n accessManager.consumeScheduledOp(caller, data);\\n ts.consumingSchedule = false;\\n } else {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @notice Internal function version of `diamondCut`\\n function diamondCut(FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {\\n uint256 diamondCutLength = _diamondCut.length;\\n for (uint256 facetIndex; facetIndex < diamondCutLength; facetIndex++) {\\n bytes4[] memory functionSelectors = _diamondCut[facetIndex].functionSelectors;\\n address facetAddress = _diamondCut[facetIndex].facetAddress;\\n\\n if (functionSelectors.length == 0) {\\n revert NoSelectorsProvidedForFacetForCut(facetAddress);\\n }\\n\\n FacetCutAction action = _diamondCut[facetIndex].action;\\n if (action == FacetCutAction.Add) {\\n _addFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Replace) {\\n _replaceFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Remove) {\\n _removeFunctions(facetAddress, functionSelectors);\\n }\\n }\\n\\n emit DiamondCut(_diamondCut, _init, _calldata);\\n _initializeDiamondCut(_init, _calldata);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n PRIVATE FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Does a delegate call on `_init` with `_calldata`\\n function _initializeDiamondCut(address _init, bytes memory _calldata) private {\\n if (_init == address(0)) {\\n return;\\n }\\n _enforceHasContractCode(_init);\\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n if (!success) {\\n if (error.length > 0) {\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(error)\\n revert(add(32, error), returndata_size)\\n }\\n } else {\\n revert InitializationFunctionReverted(_init, _calldata);\\n }\\n }\\n }\\n\\n /// @notice Adds a new function to the diamond proxy\\n /// @dev Reverts if selectors are already existing\\n function _addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n if (_facetAddress == address(0)) {\\n revert CannotAddSelectorsToZeroAddress(_functionSelectors);\\n }\\n DiamondStorage storage ds = s.diamondStorage();\\n uint16 selectorCount = uint16(ds.selectors.length);\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n if (oldFacetAddress != address(0)) {\\n revert CannotAddFunctionToDiamondThatAlreadyExists(selector);\\n }\\n ds.selectorInfo[selector] = FacetInfo(_facetAddress, selectorCount);\\n ds.selectors.push(selector);\\n selectorCount++;\\n }\\n }\\n\\n /// @notice Upgrades a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n if (_facetAddress == address(0)) {\\n revert CannotReplaceFunctionsFromFacetWithZeroAddress(_functionSelectors);\\n }\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n // Can't replace immutable functions -- functions defined directly in the diamond in this case\\n if (oldFacetAddress == address(this)) {\\n revert CannotReplaceImmutableFunction(selector);\\n }\\n if (oldFacetAddress == _facetAddress) {\\n revert CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(selector);\\n }\\n if (oldFacetAddress == address(0)) {\\n revert CannotReplaceFunctionThatDoesNotExists(selector);\\n }\\n // Replace old facet address\\n ds.selectorInfo[selector].facetAddress = _facetAddress;\\n }\\n }\\n\\n /// @notice Removes a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n uint256 selectorCount = ds.selectors.length;\\n if (_facetAddress != address(0)) {\\n revert RemoveFacetAddressMustBeZeroAddress(_facetAddress);\\n }\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n FacetInfo memory oldFacetAddressAndSelectorPosition = ds.selectorInfo[selector];\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(0)) {\\n revert CannotRemoveFunctionThatDoesNotExist(selector);\\n }\\n\\n // Can't remove immutable functions -- functions defined directly in the diamond\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(this)) {\\n revert CannotRemoveImmutableFunction(selector);\\n }\\n // Replace selector with last selector\\n selectorCount--;\\n if (oldFacetAddressAndSelectorPosition.selectorPosition != selectorCount) {\\n bytes4 lastSelector = ds.selectors[selectorCount];\\n ds.selectors[oldFacetAddressAndSelectorPosition.selectorPosition] = lastSelector;\\n ds.selectorInfo[lastSelector].selectorPosition = oldFacetAddressAndSelectorPosition.selectorPosition;\\n }\\n // Delete last selector\\n ds.selectors.pop();\\n delete ds.selectorInfo[selector];\\n }\\n }\\n\\n /// @notice Checks that an address has a non void bytecode\\n function _enforceHasContractCode(address _contract) private view {\\n uint256 contractSize;\\n assembly (\\\"memory-safe\\\") {\\n contractSize := extcodesize(_contract)\\n }\\n if (contractSize == 0) {\\n revert ContractHasNoCode();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x10bde4c13cc3d3c4aec15b793565bfe05b5f770eafeb839bfd159dbe6351dc62\",\"license\":\"MIT\"},\"contracts/parallelizer/libraries/LibGetters.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport { SafeCast } from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\n\\nimport { LibHelpers } from \\\"./LibHelpers.sol\\\";\\nimport { LibManager } from \\\"./LibManager.sol\\\";\\nimport { LibOracle } from \\\"./LibOracle.sol\\\";\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibGetters\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibGetters` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibGetters.sol\\nlibrary LibGetters {\\n using Math for uint256;\\n using SafeCast for uint256;\\n\\n /// @notice Internal version of the `getCollateralRatio` function with additional return values like `tokens` that\\n /// is the list of tokens supported by the system, or `balances` which is the amount of each token in `tokens`\\n /// controlled by the protocol\\n /// @dev In case some collaterals support external strategies (`isManaged>0`), this list may be bigger\\n /// than the `collateralList`\\n /// @dev `subCollateralsTracker` is an array which gives for each collateral asset in the collateral list an\\n /// accumulator helping to recompute the amount of sub-collateral for each collateral. If the array is:\\n /// [1,4,5], this means that the collateral with index 1 in the `collateralsList` has 4-1=3 sub-collaterals.\\n function getCollateralRatio()\\n internal\\n view\\n returns (\\n uint64 collatRatio,\\n uint256 stablecoinsIssued,\\n address[] memory tokens,\\n uint256[] memory balances,\\n uint256[] memory subCollateralsTracker\\n )\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint256 totalCollateralization;\\n address[] memory collateralList = ts.collateralList;\\n uint256 collateralListLength = collateralList.length;\\n uint256 subCollateralsAmount;\\n // Building the `subCollateralsTracker` array which is useful when later sending the tokens as part of the\\n // redemption\\n subCollateralsTracker = new uint256[](collateralListLength);\\n for (uint256 i; i < collateralListLength; ++i) {\\n if (ts.collaterals[collateralList[i]].isManaged == 0) ++subCollateralsAmount;\\n else subCollateralsAmount += ts.collaterals[collateralList[i]].managerData.subCollaterals.length;\\n subCollateralsTracker[i] = subCollateralsAmount;\\n }\\n balances = new uint256[](subCollateralsAmount);\\n tokens = new address[](subCollateralsAmount);\\n\\n {\\n uint256 countCollat;\\n for (uint256 i; i < collateralListLength; ++i) {\\n Collateral storage collateral = ts.collaterals[collateralList[i]];\\n uint256 collateralBalance; // Will be either the balance or the value of assets managed\\n if (collateral.isManaged > 0) {\\n // If a collateral is managed, the balances of the sub-collaterals cannot be directly obtained by\\n // calling `balanceOf` of the sub-collaterals\\n uint256[] memory subCollateralsBalances;\\n (subCollateralsBalances, collateralBalance) = LibManager.totalAssets(collateral.managerData.config);\\n uint256 numSubCollats = subCollateralsBalances.length;\\n for (uint256 k; k < numSubCollats; ++k) {\\n tokens[countCollat + k] = address(collateral.managerData.subCollaterals[k]);\\n balances[countCollat + k] = subCollateralsBalances[k];\\n }\\n countCollat += numSubCollats;\\n } else {\\n collateralBalance = IERC20(collateralList[i]).balanceOf(address(this));\\n tokens[countCollat] = collateralList[i];\\n balances[countCollat++] = collateralBalance;\\n }\\n uint256 oracleValue = LibOracle.readRedemption(collateral.oracleConfig);\\n totalCollateralization +=\\n (oracleValue * LibHelpers.convertDecimalTo(collateralBalance, collateral.decimals, 18)) / BASE_18;\\n }\\n }\\n // The `stablecoinsIssued` value need to be rounded up because it is then used as a divizer when computing\\n // the `collatRatio`\\n stablecoinsIssued = uint256(ts.normalizedStables).mulDiv(ts.normalizer, BASE_27, Math.Rounding.Ceil);\\n if (stablecoinsIssued > 0) {\\n collatRatio = (totalCollateralization.mulDiv(BASE_9, stablecoinsIssued, Math.Rounding.Ceil)).toUint64();\\n } else {\\n collatRatio = type(uint64).max;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9d5a32ebe58604bf34e29dc8e1624077db26cacaf621f31c98c8c5e12b06dad2\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibHelpers.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibHelpers\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibHelpers` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibHelpers.sol\\nlibrary LibHelpers {\\n /// @notice Rebases the units of `amount` from `fromDecimals` to `toDecimals`\\n function convertDecimalTo(uint256 amount, uint8 fromDecimals, uint8 toDecimals) internal pure returns (uint256) {\\n if (fromDecimals > toDecimals) return amount / 10 ** (fromDecimals - toDecimals);\\n else if (fromDecimals < toDecimals) return amount * 10 ** (toDecimals - fromDecimals);\\n else return amount;\\n }\\n\\n /// @notice Checks whether a `token` is in a list `tokens` and returns the index of the token in the list\\n /// or -1 in the other case\\n function checkList(address token, address[] memory tokens) internal pure returns (int256) {\\n uint256 tokensLength = tokens.length;\\n for (uint256 i; i < tokensLength; ++i) {\\n if (token == tokens[i]) return int256(i);\\n }\\n return -1;\\n }\\n\\n /// @notice Searches a sorted `array` and returns the first index that contains a value strictly greater\\n /// (or lower if increasingArray is false) to `element` minus 1\\n /// @dev If no such index exists (i.e. all values in the array are strictly lesser/greater than `element`),\\n /// either array length minus 1, or 0 are returned\\n /// @dev The time complexity of the search is O(log n).\\n /// @dev Inspired from OpenZeppelin Contracts v4.4.1:\\n /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Arrays.sol\\n /// @dev Modified by Angle Labs to support `uint64`, monotonous arrays and exclusive upper bounds\\n function findLowerBound(\\n bool increasingArray,\\n uint64[] memory array,\\n uint64 normalizerArray,\\n uint64 element\\n )\\n internal\\n pure\\n returns (uint256)\\n {\\n if (array.length == 0) {\\n return 0;\\n }\\n uint256 low = 1;\\n uint256 high = array.length;\\n\\n if (\\n (increasingArray && array[high - 1] * normalizerArray <= element)\\n || (!increasingArray && array[high - 1] * normalizerArray >= element)\\n ) return high - 1;\\n\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds down (it does integer division with truncation).\\n if (increasingArray ? array[mid] * normalizerArray > element : array[mid] * normalizerArray < element) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n // At this point `low` is the exclusive upper bound.\\n // `low - 1` is the inclusive lower bound.\\n return low - 1;\\n }\\n\\n /// @notice Evaluates for `x` a piecewise linear function defined with the breaking points in the arrays\\n /// `xArray` and `yArray`\\n /// @dev The values in the `xArray` must be increasing\\n function piecewiseLinear(uint64 x, uint64[] memory xArray, int64[] memory yArray) internal pure returns (int64) {\\n uint256 indexLowerBound = findLowerBound(true, xArray, 1, x);\\n if (indexLowerBound == 0 && x < xArray[0]) return yArray[0];\\n else if (indexLowerBound == xArray.length - 1) return yArray[xArray.length - 1];\\n return yArray[indexLowerBound]\\n + ((yArray[indexLowerBound + 1] - yArray[indexLowerBound]) * int64(x - xArray[indexLowerBound]))\\n / int64(xArray[indexLowerBound + 1] - xArray[indexLowerBound]);\\n }\\n}\\n\",\"keccak256\":\"0xfbda0e69409593ef0e4a176a7909d980e3cf09b2c4642cd2c6d16e1773c6e6f2\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/libraries/LibManager.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IManager } from \\\"contracts/interfaces/IManager.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Managed collateral assets may be handled through external smart contracts or directly through this library\\n/// @dev There is no implementation at this point for a managed collateral handled through this library, and\\n/// a new specific `ManagerType` would need to be added in this case\\n/// @dev This library is an authorized fork of Angle's `LibManager` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibManager.sol\\nlibrary LibManager {\\n /// @notice Checks to which address managed funds must be transferred\\n function transferRecipient(bytes memory config) internal view returns (address recipient) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n recipient = address(this);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (address));\\n }\\n\\n /// @notice Performs a transfer of `token` for a collateral that is managed to a `to` address\\n /// @dev `token` may not be the actual collateral itself, as some collaterals have subcollaterals associated\\n /// with it\\n /// @dev Eventually pulls funds from strategies\\n function release(address token, address to, uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).release(token, to, amount);\\n }\\n\\n /// @notice Gets the balances of all the tokens controlled through `managerData`\\n /// @return balances An array of size `subCollaterals` with current balances of all subCollaterals\\n /// including the one corresponding to the `managerData` given\\n /// @return totalValue The value of all the `subCollaterals` in `collateral`\\n /// @dev `subCollaterals` must always have as first token (index 0) the collateral itself\\n function totalAssets(bytes memory config) internal view returns (uint256[] memory balances, uint256 totalValue) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).totalAssets();\\n }\\n\\n /// @notice Calls a hook if needed after new funds have been transfered to a manager\\n function invest(uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).invest(amount);\\n }\\n\\n /// @notice Returns available underlying tokens, for instance if liquidity is fully used and\\n /// not withdrawable the function will return 0\\n function maxAvailable(bytes memory config) internal view returns (uint256 available) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).maxAvailable();\\n }\\n\\n /// @notice Decodes the `managerData` associated to a collateral\\n function parseManagerConfig(bytes memory config) internal pure returns (ManagerType managerType, bytes memory data) {\\n (managerType, data) = abi.decode(config, (ManagerType, bytes));\\n }\\n}\\n\",\"keccak256\":\"0x18282c744bc34bd9ae937c0c49e909c9c4e50c15e69fb485aa68fc56e549d1a1\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IParallelizerOracle } from \\\"contracts/interfaces/IParallelizerOracle.sol\\\";\\nimport { AggregatorV3Interface } from \\\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\\\";\\nimport { IMorphoOracle } from \\\"contracts/interfaces/external/morpho/IMorphoOracle.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibOracle` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibOracle.sol\\nlibrary LibOracle {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ACTIONS SPECIFIC ORACLES \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads the oracle value used during a redemption to compute collateral ratio for `oracleConfig`\\n /// @dev This value is only sensitive to compute the collateral ratio and deduce a penalty factor\\n function readRedemption(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (OracleReadType oracleType, OracleReadType targetType, bytes memory oracleData, bytes memory targetData,) =\\n _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readRedemption();\\n } else {\\n (oracleValue,) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, 0);\\n return oracleValue;\\n }\\n }\\n\\n /// @notice Reads the oracle value used during mint operations for an asset with `oracleConfig`\\n /// @dev For assets which do not rely on external oracles, this value is the minimum between the processed oracle\\n /// value for the asset and its target price\\n function readMint(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readMint();\\n }\\n\\n (uint128 userDeviation,) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n if (targetPrice < oracleValue) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads the oracle value used for a burn operation for an asset with `oracleConfig`\\n /// @return oracleValue The actual oracle value obtained\\n /// @return ratio If `oracle value < target price`, the ratio between the oracle value and the target\\n /// price, otherwise `BASE_18`\\n function readBurn(bytes memory oracleConfig) internal view returns (uint256 oracleValue, uint256 ratio) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readBurn();\\n }\\n (uint128 userDeviation, uint128 burnRatioDeviation) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n // Firewall in case the oracle value reported is low compared to the target\\n // If the oracle value is slightly below its target, then no deviation is reported for the oracle and\\n // the price of burning the stablecoin for other assets is not impacted. Also, the oracle value of this asset\\n // is set to the target price, to not be open to direct arbitrage\\n ratio = BASE_18;\\n if (oracleValue * BASE_18 < targetPrice * (BASE_18 - burnRatioDeviation)) {\\n ratio = (oracleValue * BASE_18) / targetPrice;\\n } else if (oracleValue < targetPrice) {\\n oracleValue = targetPrice;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n VIEW FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of the `getOracle` function\\n function getOracle(address collateral)\\n internal\\n view\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return _parseOracleConfig(s.transmuterStorage().collaterals[collateral].oracleConfig);\\n }\\n\\n /// @notice Gets the oracle value and the ratio with respect to the target price when it comes to\\n /// burning for `collateral`\\n function getBurnOracle(\\n address collateral,\\n bytes memory oracleConfig\\n )\\n internal\\n view\\n returns (uint256 minRatio, uint256 oracleValue)\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n minRatio = BASE_18;\\n address[] memory collateralList = ts.collateralList;\\n uint256 length = collateralList.length;\\n for (uint256 i; i < length; ++i) {\\n uint256 ratioObserved = BASE_18;\\n if (collateralList[i] != collateral) {\\n (, ratioObserved) = readBurn(ts.collaterals[collateralList[i]].oracleConfig);\\n } else {\\n (oracleValue, ratioObserved) = readBurn(oracleConfig);\\n }\\n if (ratioObserved < minRatio) minRatio = ratioObserved;\\n }\\n }\\n\\n /// @notice Computes the `quoteAmount` (for Chainlink oracles) depending on a `quoteType` and a base value\\n /// (e.g the target price of the asset)\\n /// @dev For cases where the Chainlink feed directly looks into the value of the asset, `quoteAmount` is `BASE_18`.\\n /// For others, like wstETH for which Chainlink only has an oracle for stETH, `quoteAmount` is the target price\\n function quoteAmount(OracleQuoteType quoteType, uint256 baseValue) internal pure returns (uint256) {\\n if (quoteType == OracleQuoteType.UNIT) return BASE_18;\\n else return baseValue;\\n }\\n\\n function readSpotAndTarget(\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n uint256 deviation\\n )\\n internal\\n view\\n returns (uint256 oracleValue, uint256 targetPrice)\\n {\\n targetPrice = read(targetType, BASE_18, targetData);\\n oracleValue = read(oracleType, targetPrice, oracleData);\\n // System may tolerate small deviations from target\\n // If the oracle value reported is reasonably close to the target\\n // --> disregard the oracle value and return the target price\\n if (\\n targetPrice * (BASE_18 - deviation) < oracleValue * BASE_18\\n && oracleValue * BASE_18 < targetPrice * (BASE_18 + deviation)\\n ) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads an oracle value (or a target oracle value) for an asset based on its data parsed `oracleConfig`\\n function read(OracleReadType readType, uint256 baseValue, bytes memory data) internal view returns (uint256) {\\n if (readType == OracleReadType.CHAINLINK_FEEDS) {\\n (\\n AggregatorV3Interface[] memory circuitChainlink,\\n uint32[] memory stalePeriods,\\n uint8[] memory circuitChainIsMultiplied,\\n uint8[] memory chainlinkDecimals,\\n OracleQuoteType quoteType\\n ) = abi.decode(data, (AggregatorV3Interface[], uint32[], uint8[], uint8[], OracleQuoteType));\\n uint256 quotePrice = quoteAmount(quoteType, baseValue);\\n uint256 listLength = circuitChainlink.length;\\n for (uint256 i; i < listLength; ++i) {\\n quotePrice = readChainlinkFeed(\\n quotePrice, circuitChainlink[i], circuitChainIsMultiplied[i], chainlinkDecimals[i], stalePeriods[i]\\n );\\n }\\n return quotePrice;\\n } else if (readType == OracleReadType.STABLE) {\\n return BASE_18;\\n } else if (readType == OracleReadType.NO_ORACLE) {\\n return baseValue;\\n } else if (readType == OracleReadType.WSTETH) {\\n return STETH.getPooledEthByShares(1 ether);\\n } else if (readType == OracleReadType.CBETH) {\\n return CBETH.exchangeRate();\\n } else if (readType == OracleReadType.RETH) {\\n return RETH.getExchangeRate();\\n } else if (readType == OracleReadType.SFRXETH) {\\n return SFRXETH.pricePerShare();\\n } else if (readType == OracleReadType.MAX) {\\n uint256 maxValue = abi.decode(data, (uint256));\\n return maxValue;\\n } else if (readType == OracleReadType.MORPHO_ORACLE) {\\n (address contractAddress, uint256 normalizationFactor) = abi.decode(data, (address, uint256));\\n return IMorphoOracle(contractAddress).price() / normalizationFactor;\\n }\\n // If the `OracleReadType` is `EXTERNAL`, it means that this function is called to compute a\\n // `targetPrice` in which case the `baseValue` is returned here\\n else {\\n return baseValue;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n SPECIFIC HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads a Chainlink feed using a quote amount and converts the quote amount to the out-currency\\n /// @param _quoteAmount The amount for which to compute the price expressed in `BASE_18`\\n /// @param feed Chainlink feed to query\\n /// @param multiplied Whether the ratio outputted by Chainlink should be multiplied or divided to the `quoteAmount`\\n /// @param decimals Number of decimals of the corresponding Chainlink pair\\n /// @return The `quoteAmount` converted in out-currency\\n function readChainlinkFeed(\\n uint256 _quoteAmount,\\n AggregatorV3Interface feed,\\n uint8 multiplied,\\n uint256 decimals,\\n uint32 stalePeriod\\n )\\n internal\\n view\\n returns (uint256)\\n {\\n (, int256 ratio,, uint256 updatedAt,) = feed.latestRoundData();\\n if (ratio <= 0 || block.timestamp - updatedAt > stalePeriod) revert InvalidChainlinkRate();\\n // Checking whether we should multiply or divide by the ratio computed\\n if (multiplied == 1) return (_quoteAmount * uint256(ratio)) / (10 ** decimals);\\n else return (_quoteAmount * (10 ** decimals)) / uint256(ratio);\\n }\\n\\n /// @notice Parses an `oracleConfig` into several sub fields\\n function _parseOracleConfig(bytes memory oracleConfig)\\n private\\n pure\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return abi.decode(oracleConfig, (OracleReadType, OracleReadType, bytes, bytes, bytes));\\n }\\n\\n function updateOracle(address collateral) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n if (ts.collaterals[collateral].decimals == 0) revert NotCollateral();\\n\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(ts.collaterals[collateral].oracleConfig);\\n\\n if (targetType != OracleReadType.MAX) revert OracleUpdateFailed();\\n uint256 oracleValue = read(oracleType, BASE_18, oracleData);\\n\\n uint256 maxValue = abi.decode(targetData, (uint256));\\n if (oracleValue > maxValue) {\\n ts.collaterals[collateral].oracleConfig = abi.encode(\\n oracleType,\\n targetType,\\n oracleData,\\n // There are no checks whether the value increased or not\\n abi.encode(oracleValue),\\n hyperparameters\\n );\\n } else {\\n revert OracleUpdateFailed();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x24f504bdd0b7346a447d646a2b2b19afe1a71ee829a59e5cb2ac5fac320611d7\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibStorage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport { DiamondStorage, ImplementationStorage, ParallelizerStorage } from \\\"../Storage.sol\\\";\\n\\n/// @title LibStorage\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibStorage` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibStorage.sol\\nlibrary LibStorage {\\n /// @notice Returns the storage struct stored at the `DIAMOND_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic of the different facets used in the diamond proxy\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ds.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `TRANSMUTER_STORAGE_POSITION` slot\\n /// @dev This struct handles the particular logic of the Parallelizer system\\n function transmuterStorage() internal pure returns (ParallelizerStorage storage ts) {\\n bytes32 position = TRANSMUTER_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ts.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `IMPLEMENTATION_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic for making the contract easily usable on Etherscan\\n function implementationStorage() internal pure returns (ImplementationStorage storage ims) {\\n bytes32 position = IMPLEMENTATION_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ims.slot := position\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf8c333898ca14d3e8696c232f669a839dddbf705a609a1b0795ecc6b8f1b2d73\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibWhitelist.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IKeyringGuard } from \\\"contracts/interfaces/external/keyring/IKeyringGuard.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibWhitelist\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibWhitelist` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibWhitelist.sol\\nlibrary LibWhitelist {\\n /// @notice Checks whether `sender` is whitelisted for a collateral with `whitelistData`\\n function checkWhitelist(bytes memory whitelistData, address sender) internal returns (bool) {\\n (WhitelistType whitelistType, bytes memory data) = abi.decode(whitelistData, (WhitelistType, bytes));\\n if (s.transmuterStorage().isWhitelistedForType[whitelistType][sender] > 0) return true;\\n if (data.length != 0) {\\n if (whitelistType == WhitelistType.BACKED) {\\n address keyringGuard = abi.decode(data, (address));\\n if (keyringGuard != address(0)) return IKeyringGuard(keyringGuard).isAuthorized(address(this), sender);\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x72595e0b49dfce76ba70d9f69af54ffbc84650c8c696caa20f858ef2438d94b5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ICbETH } from \\\"contracts/interfaces/external/coinbase/ICbETH.sol\\\";\\nimport { ISfrxETH } from \\\"contracts/interfaces/external/frax/ISfrxETH.sol\\\";\\nimport { IStETH } from \\\"contracts/interfaces/external/lido/IStETH.sol\\\";\\nimport { IRETH } from \\\"contracts/interfaces/external/rocketPool/IRETH.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STORAGE SLOTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n/// @dev Storage position of `DiamondStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.diamond.storage\\\") - 1`\\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\\n\\n/// @dev Storage position of `ParallelizerStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.parallelizer.storage\\\") - 1`\\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\\n\\n/// @dev Storage position of `ImplementationStorage` structure\\n/// @dev Equals `keccak256(\\\"eip1967.proxy.implementation\\\") - 1`\\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MATHS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nuint256 constant BASE_6 = 1e6;\\nuint256 constant BASE_8 = 1e8;\\nuint256 constant BASE_9 = 1e9;\\nuint256 constant BASE_12 = 1e12;\\nuint256 constant BPS = 1e14;\\nuint256 constant BASE_18 = 1e18;\\nuint256 constant HALF_BASE_27 = 1e27 / 2;\\nuint256 constant BASE_27 = 1e27;\\nuint256 constant BASE_36 = 1e36;\\nuint256 constant MAX_BURN_FEE = 999_000_000;\\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// The values being non-zero value makes deployment a bit more expensive,\\n// but in exchange the refund on every call to nonReentrant will be lower in\\n// amount. Since refunds are capped to a percentage of the total\\n// transaction's gas, it is best to keep them low in cases like this one, to\\n// increase the likelihood of the full refund coming into effect.\\nuint8 constant NOT_ENTERED = 1;\\nuint8 constant ENTERED = 2;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// Role IDs for the AccessManager\\nuint64 constant GOVERNOR_ROLE = 10;\\nuint64 constant GUARDIAN_ROLE = 20;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n COMMON ADDRESSES \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\\n\",\"keccak256\":\"0x3306bdd0d4e4f364e0d35893a7ffb59c8eb9e94a5bd861f58b8d7ba8a7b336e5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nerror AccessManagedUnauthorized(address caller);\\nerror AlreadyAdded();\\nerror CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);\\nerror CannotAddSelectorsToZeroAddress(bytes4[] _selectors);\\nerror CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);\\nerror CannotRemoveImmutableFunction(bytes4 _selector);\\nerror CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);\\nerror CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);\\nerror CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);\\nerror CannotReplaceImmutableFunction(bytes4 _selector);\\nerror ContractHasNoCode();\\nerror CollateralBacked();\\nerror FunctionNotFound(bytes4 _functionSelector);\\nerror IncorrectFacetCutAction(uint8 _action);\\nerror InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);\\nerror InvalidChainlinkRate();\\nerror InvalidLengths();\\nerror InvalidNegativeFees();\\nerror InvalidOracleType();\\nerror InvalidParam();\\nerror InvalidParams();\\nerror InvalidRate();\\nerror InvalidSwap();\\nerror InvalidTokens();\\nerror InvalidAccessManager();\\nerror ManagerHasAssets();\\nerror NoSelectorsProvidedForFacetForCut(address _facetAddress);\\nerror NotAllowed();\\nerror NotCollateral();\\nerror NotGovernor();\\nerror NotGuardian();\\nerror NotTrusted();\\nerror NotTrustedOrGuardian();\\nerror NotWhitelisted();\\nerror OdosSwapFailed();\\nerror OracleUpdateFailed();\\nerror Paused();\\nerror ReentrantCall();\\nerror RemoveFacetAddressMustBeZeroAddress(address _facetAddress);\\nerror TooBigAmountIn();\\nerror TooLate();\\nerror TooSmallAmountOut();\\nerror ZeroAddress();\\nerror ZeroAmount();\\nerror SwapError();\\nerror SlippageTooHigh();\\nerror InsufficientFunds();\\n\",\"keccak256\":\"0x1e2f6812ef78e948e5155d32213b52afff8c0ba5463d18bee10694efbf886130\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x60808060405234601557612cec908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c80632e7639bc1461041f578063815822c1146103b0578063d703a0cd1461037f5763fd7daaf814610045575f80fd5b3461037b57604036600319011261037b57602435600435811515820361037b5761006f3633611556565b1580610348575b610320575f516020612c975f395f51905f5254906001600160801b038260801c9216925f146102df576b033b2e3c9fd0803ce80000008102908082046b033b2e3c9fd0803ce800000014901517156102b2576100db926100d591610e15565b906117c8565b670de0b6b3a764000081118015906102c6575b610170575b806100ff602092611de2565b6001600160801b036fffffffffffffffffffffffffffffffff195f516020612c975f395f51905f52549260801b169116175f516020612c975f395f51905f52557fb4fde7403c001c7cdeafc0c3bb46e972111b7efac4e832398cbf9fabe1694ed982604051838152a1604051908152f35b610178610674565b9081515f915f5b8281106101dc575050506001600160801b039150166fffffffffffffffffffffffffffffffff195f516020612c975f395f51905f525416175f516020612c975f395f51905f525560206b033b2e3c9fd0803ce800000090506100f3565b61024c6b033b2e3c9fd0803ce80000006102468461023d6001600160a01b03610205878c610726565b51166001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b5460281c610e02565b04611de2565b936001600160801b03808616911601906001600160801b0382116102b257600191946102836001600160a01b03610205848a610726565b9064ffffffffff74ffffffffffffffffffffffffffffffff000000000083549260281b1691161790550161017f565b634e487b7160e01b5f52601160045260245ffd5b506ec097ce7bc90715b34b9f10000000008110156100ee565b6b033b2e3c9fd0803ce80000008102908082046b033b2e3c9fd0803ce800000014901517156102b25761031b9261031591610e15565b90610804565b6100db565b7fc22a648e000000000000000000000000000000000000000000000000000000005f5260045ffd5b50335f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7b60205260405f205415610076565b5f80fd5b3461037b57602036600319011261037b5761039b600435610e33565b50906103ac6040519283928361061a565b0390f35b3461037b57608036600319011261037b576103c96104ea565b6064359067ffffffffffffffff821161037b576103ed61040f92369060040161054e565b604051916103fc602084610500565b5f83525f3681376044359060043561081f565b906103ac6040519283928361061a565b3461037b5760a036600319011261037b576104386104ea565b60643567ffffffffffffffff811161037b5761045890369060040161054e565b6084359067ffffffffffffffff821161037b573660238301121561037b5781600401359261048584610536565b926104936040519485610500565b8484526024602085019560051b8201019036821161037b57602401945b8186106104ca57505061040f93506044359060043561081f565b85356001600160a01b038116810361037b578152602095860195016104b0565b602435906001600160a01b038216820361037b57565b90601f8019910116810190811067ffffffffffffffff82111761052257604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff81116105225760051b60200190565b9080601f8301121561037b57813561056581610536565b926105736040519485610500565b81845260208085019260051b82010192831161037b57602001905b82821061059b5750505090565b813581526020918201910161058e565b90602080835192838152019201905f5b8181106105c85750505090565b82516001600160a01b03168452602093840193909201916001016105bb565b90602080835192838152019201905f5b8181106106045750505090565b82518452602093840193909201916001016105f7565b909161063161063f936040845260408401906105ab565b9160208184039101526105e7565b90565b9061064c82610536565b6106596040519182610500565b828152809261066a601f1991610536565b0190602036910137565b604051907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775480835282602081017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f20925f5b8181106106e35750506106e192500383610500565b565b84546001600160a01b03168352600194850194879450602090930192016106cc565b8051156107125760200190565b634e487b7160e01b5f52603260045260245ffd5b80518210156107125760209160051b010190565b90604051915f8154908160011c92600183169283156107fa575b6020851084146107e65784875286939081156107c45750600114610780575b506106e192500383610500565b90505f9291925260205f20905f915b8183106107a85750509060206106e1928201015f610773565b602091935080600191548385890101520191019091849261078f565b9050602092506106e194915060ff191682840152151560051b8201015f610773565b634e487b7160e01b5f52602260045260245ffd5b93607f1693610754565b919082039182116102b257565b5f1981146102b25760010190565b5f516020612c775f395f51905f52545f969592939060a81c60ff16600214610db657750200000000000000000000000000000000000000000060ff60a81b195f516020612c775f395f51905f525416175f516020612c775f395f51905f525560ff5f516020612c775f395f51905f525460a01c1615610d8e574211610d66576108a781610e33565b9097919588519181518303610d3e576108bf856117d5565b506001600160a01b035f516020612c775f395f51905f525416803b1561037b575f80916044604051809481937f2b471d8e0000000000000000000000000000000000000000000000000000000083528b60048401523360248401525af18015610d3357610d1e575b50610930610674565b8492855b8c8682106109f35750505050505050507f3998bcf315dae4953d294b3ca6e1d0074c249adc136b50d1ff99b04753c73e7f9060405190815260806020820152806109af6001600160a01b0361099d61098f608085018a6105ab565b84810360408601528b6105e7565b968388036060850152169533956105ab565b0390a3750100000000000000000000000000000000000000000060ff60a81b195f516020612c775f395f51905f525416175f516020612c775f395f51905f52559190565b816109fd91610726565b51610a088284610726565b5111610cf6578a878a8f610a1d858092610726565b5115159384610ccd575b50505050610a7e575b610a3a8585610726565b515f198101908111610a6a57811015610a56575b600101610934565b93610a62600191610811565b949050610a4e565b602488634e487b7160e01b81526011600452fd5b610a936001600160a01b036102058786610726565b60ff815460201c16151580610cb1575b610c895780548e919083908e908b908f9060ff1615610bb75750506008610ae4836001600160a01b03610adc610af196610aec96610726565b511696610726565b51930161073a565b611e13565b90610afb81611a76565b15610b09575b505050610a30565b610b24816020806001600160a01b0394518301019101611c1e565b1690813b15610bb35760646001600160a01b03938b8f9394819560405197889687957f8bfb07c9000000000000000000000000000000000000000000000000000000008752600487015216602485015260448401525af18015610ba857908891610b8f575b80610b01565b81610b9991610500565b610ba457865f610b89565b8680fd5b6040513d8a823e3d90fd5b8980fd5b9160209450926001600160a01b03610bd382610bdb9496610726565b511695610726565b51604051906001600160a01b03858301937fa9059cbb000000000000000000000000000000000000000000000000000000008552166024830152604482015260448152610c29606482610500565b519082855af115610c7e5787513d610c755750803b155b610c4a5750610a30565b7f5274afe7000000000000000000000000000000000000000000000000000000008852600452602487fd5b60011415610c40565b6040513d89823e3d90fd5b6004887f584a7938000000000000000000000000000000000000000000000000000000008152fd5b50610cc78b610cc26006840161073a565b611ab5565b15610aa3565b610cec9394506001600160a01b0391610ce591610726565b51166119cd565b12878a838e610a27565b6004877fa1aabbe1000000000000000000000000000000000000000000000000000000008152fd5b610d2b9194505f90610500565b5f925f610927565b6040513d5f823e3d90fd5b7f1df89e8b000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fecdd1c29000000000000000000000000000000000000000000000000000000005f5260045ffd5b7f9e87fac8000000000000000000000000000000000000000000000000000000005f5260045ffd5b7f37ed32e8000000000000000000000000000000000000000000000000000000005f5260045ffd5b90670de0b6b3a7640000820291808304670de0b6b3a764000014901517156102b257565b818102929181159184041417156102b257565b8115610e1f570490565b634e487b7160e01b5f52601260045260245ffd5b905f91610e3e610674565b918251905f92610e4d83610642565b945f5b8481106114ea5750610e6a610e6486610642565b95610642565b935f91825b8284106112f55750505050610ebc5f516020612c975f395f51905f52546b033b2e3c9fd0803ce80000006001600160801b0382169160801c610eb2828285612260565b92091515906117c8565b95861590816112e557610ed488633b9aca0083612260565b82610e1f5788633b9aca00610eec93091515906117c8565b67ffffffffffffffff81116112ce5767ffffffffffffffff16955b938590938884116112a65760405194858660207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795492838152017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795f5260205f20925f905b80600383011061126357610fa294549181811061124f575b818110611238575b818110611221575b10611210575b500387610500565b5f9267ffffffffffffffff8a1697633b9aca0089109a8b6110a4575b50929915925f5b8a51811015611095578a81861561104357610fe390610fea92610726565b5189610e02565b9089515f1981019081116102b25761103c8f6110368f93918f8f9061102a60019967ffffffffffffffff6110228b9861103096610726565b511690610e02565b92610e02565b90610e15565b92610726565b5201610fc5565b61105361105a9161106b93610726565b518a610e02565b67ffffffffffffffff881690610e02565b908d633b9aca008102908104633b9aca00148917156102b25761103c826110368f93600196610e15565b50985098965098505050505050565b6040517f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7880548083525f918252939750928a929060208301907fcc472d1522277c093c80208a319541556b1f96243621e0d69d76c670d24184205b8160038801106111b7579161114196859261113c94549181811061119c575b81811061117e575b818110611160575b10611152575b500383610500565b611c5f565b67ffffffffffffffff16935f610fbe565b60c01c81526020015f611134565b92602060019167ffffffffffffffff8560801c16815201930161112e565b92602060019167ffffffffffffffff8560401c168152019301611126565b92602060019167ffffffffffffffff8516815201930161111e565b93959294509060016080600492865467ffffffffffffffff8116825267ffffffffffffffff8160401c16602083015267ffffffffffffffff81841c16604083015260c01c606082015201940192019492908c94926110ff565b60c01d60070b81526020015f610f9a565b9260206001918460801c60070b8152019301610f94565b9260206001918460401c60070b8152019301610f8c565b9260206001918460070b8152019301610f84565b916004919350608060019186548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b6060820152019401920189929391610f6c565b7fa2b06574000000000000000000000000000000000000000000000000000000005f5260045ffd5b6306dfcc6560e41b5f52604060045260245260445ffd5b5067ffffffffffffffff95610f07565b9091929861130e6001600160a01b036102058c86610726565b805490928b60ff8316156113fc5750600784016113356113306008870161073a565b611e5a565b92908051925f908054915b8581106113a5575050505061139b9361138e6001969460ff61138361137e6005611376670de0b6b3a764000099611394996117c8565b9c5b0161073a565b611f70565b9360181c1690612137565b90610e02565b04906117c8565b9901929190610e6f565b82811015610712578f908f91600192845f526113db6001600160a01b038460205f20015416916113d5858b6117c8565b90610726565b526113f56113e98388610726565b51916113d5848a6117c8565b5201611340565b9360206001600160a01b0361141660249596949789610726565b5116604051948580927f70a082310000000000000000000000000000000000000000000000000000000082523060048301525afa8015610d33578d935f916114b6575b5080936114669088610726565b516001600160a01b031661147a878d610726565b5261148486610811565b9561148f908d610726565b5261139460019461138e61139b9560ff61138361137e6005670de0b6b3a764000098611378565b9350506020833d82116114e2575b816114d160209383610500565b8101031261037b578c92515f611459565b3d91506114c4565b9460019060ff6115076001600160a01b036102058a879a97610726565b541661152d5761151690610811565b955b86611523828a610726565b5201939093610e50565b6115509060076115486001600160a01b036102058b8b610726565b0154906117c8565b95611518565b6001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d5416918060041161037b575f5f905f80604051956001600160a01b0360208801917fb700961300000000000000000000000000000000000000000000000000000000835216968760248201523060448201527fffffffff00000000000000000000000000000000000000000000000000000000833516606482015260648152611609608482610500565b5190885afa3d156117c0573d9061161f82611a14565b9161162d6040519384610500565b82523d5f602084013e5b61174d575b501561164c575b50505050600190565b63ffffffff16156117465776010000000000000000000000000000000000000000000060ff60b01b195f516020612c775f395f51905f525416175f516020612c775f395f51905f5255823b1561037b576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af18015610d3357611736575b5060ff60b01b195f516020612c775f395f51905f5254165f516020612c775f395f51905f52555f808080611643565b5f61174091610500565b5f611707565b5050505f90565b80519092909160408310611789575050816040918101031261037b57611781604061177a60208401611aa8565b9201611dd1565b905b5f61163c565b91602081949294101561179e575b5050611783565b819250906020918101031261037b5760206117b99101611aa8565b5f80611797565b606090611637565b919082018092116102b257565b5f516020612c975f395f51905f52546b033b2e3c9fd0803ce80000008202918083046b033b2e3c9fd0803ce800000014901517156102b25761182461182d926001600160801b03831690610e15565b9060801c610804565b90670de0b6b3a764000082118015906119b4575b6118bb575b61184f82611de2565b6001600160801b036fffffffffffffffffffffffffffffffff195f516020612c975f395f51905f52549260801b169116175f516020612c975f395f51905f52557fb4fde7403c001c7cdeafc0c3bb46e972111b7efac4e832398cbf9fabe1694ed96020604051848152a1565b6118c3610674565b9182515f915f5b828110611925575050506001600160801b03919250166fffffffffffffffffffffffffffffffff195f516020612c975f395f51905f525416175f516020612c975f395f51905f52556b033b2e3c9fd0803ce800000090611846565b61194e6b033b2e3c9fd0803ce80000006102468461023d6001600160a01b03610205878d610726565b936001600160801b03808616911601906001600160801b0382116102b257600191946119856001600160a01b03610205848b610726565b9064ffffffffff74ffffffffffffffffffffffffffffffff000000000083549260281b169116179055016118ca565b506ec097ce7bc90715b34b9f1000000000821015611841565b8151915f5b8381106119e257505050505f1990565b6001600160a01b036119f48284610726565b51166001600160a01b03841614611a0d576001016119d2565b9250505090565b67ffffffffffffffff811161052257601f01601f191660200190565b81601f8201121561037b57805190611a4782611a14565b92611a556040519485610500565b8284526020838301011161037b57815f9260208093018386015e8301015290565b60011115611a8057565b634e487b7160e01b5f52602160045260245ffd5b51906001600160a01b038216820361037b57565b5190811515820361037b57565b8051810160408282031261037b57602082015191600183101561037b5760408101519167ffffffffffffffff831161037b57611af8926020809201920101611a30565b90611b0281611a76565b805f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d6020526001600160a01b0360405f20931692835f5260205260405f2054611c16578151611b54575050505f90565b611b5d81611a76565b15611b69575b80611746565b60208180518101031261037b57611b8a60206001600160a01b039201611a94565b16908115611b63575f91604460209260405194859384927f65e4ad9e00000000000000000000000000000000000000000000000000000000845230600485015260248401525af1908115610d33575f91611be2575090565b90506020813d602011611c0e575b81611bfd60209383610500565b8101031261037b5761063f90611aa8565b3d9150611bf0565b505050600190565b9081602091031261037b57516001600160a01b038116810361037b5790565b9067ffffffffffffffff8091169116039067ffffffffffffffff82116102b257565b9190611c6b83826121a0565b801580611dab575b15611c8b575050611c849150610705565b5160070b90565b909182515f1981019081116102b2578214611d9357611caa8282610726565b5160070b9360018301918284116102b257611cd384611cc98584610726565b5160070b92610726565b5160070b900390677fffffffffffffff198212677fffffffffffffff8313176102b257611d1667ffffffffffffffff9182611d0e8789610726565b511690611c3d565b1660070b9060070b02928360070b9384036102b25767ffffffffffffffff611d0e819482611d47611d4f9686610726565b511693610726565b1660070b908115610e1f57677fffffffffffffff1981145f198314166102b2570560070b01677fffffffffffffff8113677fffffffffffffff198212176102b25790565b925050515f1981019081116102b257611c8491610726565b5067ffffffffffffffff611dbe83610705565b511667ffffffffffffffff851610611c73565b519063ffffffff8216820361037b57565b6001600160801b038111611dfc576001600160801b031690565b6306dfcc6560e41b5f52608060045260245260445ffd5b8051810160408282031261037b57602082015191600183101561037b5760408101519167ffffffffffffffff831161037b57611e56926020809201920101611a30565b9091565b606091611e675f92611e13565b90611e7181611a76565b15611e795750565b600493505f919250611e9c816020806001600160a01b0394518301019101611c1e565b16604051938480927f01e1d1140000000000000000000000000000000000000000000000000000000082525afa918215610d33575f905f93611edd57509190565b9250503d805f843e611eef8184610500565b82019160408184031261037b57805167ffffffffffffffff811161037b5781019280601f8501121561037b578351611f2681610536565b94611f346040519687610500565b81865260208087019260051b82010192831161037b57602001905b828210611f60575050506020015190565b8151815260209182019101611f4f565b8051810160a0826020830192031261037b57602082015190600a82101561037b576040830151600a81101561037b57606084015167ffffffffffffffff811161037b57826020611fc292870101611a30565b93608081015167ffffffffffffffff811161037b57836020611fe692840101611a30565b9260a08201519167ffffffffffffffff831161037b576120099201602001611a30565b50600183036120a85750505060208180518101031261037b57602001516001600160a01b03811680910361037b576020600491604051928380927f6256f2c50000000000000000000000000000000000000000000000000000000082525afa908115610d33575f91612079575090565b90506020813d6020116120a0575b8161209460209383610500565b8101031261037b575190565b3d9150612087565b6120be9293916120b791612365565b8093612797565b906120c881610dde565b670de0b6b3a7640000830290838204670de0b6b3a764000014841517156102b25781119081612100575b506120fb575090565b905090565b905061210b82610dde565b115f6120f2565b9060ff8091169116039060ff82116102b257565b60ff16604d81116102b257600a0a90565b9060ff8116601281111561215d575090611030612158601261063f94612112565b612126565b60121115612177579061138e61215861063f936012612112565b5090565b9067ffffffffffffffff8091169116029067ffffffffffffffff82169182036102b257565b8051918215611746576001925f1981018181116102b25767ffffffffffffffff92836121d887826121d1868a610726565b511661217b565b91169384911611801590612259575b61225157505b808410612205575050505f1981019081116102b25790565b61221681851860011c8286166117c8565b908267ffffffffffffffff6122316001826121d1878a610726565b16111561223e57506121ed565b9350600181018091116102b257926121ed565b935050505090565b505f6121e7565b91818302915f19818509938380861095039480860395146122f057848311156122d85790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b50509061063f9250610e15565b9080601f8301121561037b5781519061231582610536565b926123236040519485610500565b82845260208085019360051b82010191821161037b57602001915b81831061234b5750505090565b825160ff8116810361037b5781526020928301920161233e565b600a811015611a805780612571575090815182019160a0816020850194031261037b57602081015167ffffffffffffffff811161037b5781019280603f8501121561037b5760208401516123b881610536565b946123c66040519687610500565b8186526020808088019360051b830101019083821161037b57604001915b81831061255157505050604082015167ffffffffffffffff811161037b57820181603f8201121561037b5760208101519061241e82610536565b9161242c6040519384610500565b8083526020808085019260051b840101019184831161037b57604001905b82821061253957505050606083015167ffffffffffffffff811161037b57826020612477928601016122fd565b91608084015167ffffffffffffffff811161037b5760a091602061249d928701016122fd565b930151600281101561037b57670de0b6b3a76400006124c0919694929596612b06565b938351915f935b8385106124d75750505050505090565b9091929394969561252c6001916001600160a01b036124f6898c610726565b511660ff6125048a87610726565b511660ff6125128b89610726565b51169163ffffffff6125248c8b610726565b511693612b45565b96979501939291906124c7565b6020809161254684611dd1565b81520191019061244a565b82516001600160a01b038116810361037b578152602092830192016123e4565b60038103612587575050670de0b6b3a764000090565b6002810361259d575050670de0b6b3a764000090565b600481036125f0575050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa908115610d33575f91612079575090565b60058103612635575050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa908115610d33575f91612079575090565b6006810361267a5750506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa908115610d33575f91612079575090565b600781036126bf575050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa908115610d33575f91612079575090565b600881036126e057506020815191818082019384920101031261037b575190565b60090361278a5760408180518101031261037b57806020604061270c826001600160a01b039501611a94565b920151916004604051809581937fa035b1fe000000000000000000000000000000000000000000000000000000008352165afa8015610d33575f90612756575b61063f9250610e15565b506020823d602011612782575b8161277060209383610500565b8101031261037b5761063f915161274c565b3d9150612763565b50670de0b6b3a764000090565b92919092600a811015611a80578061296857508051810160a0826020830192031261037b57602082015167ffffffffffffffff811161037b5782019381603f8601121561037b5760208501516127ec81610536565b956127fa6040519788610500565b8187526020808089019360051b830101019084821161037b57604001915b81831061294857505050604083015167ffffffffffffffff811161037b5783019082603f8301121561037b5760208201519161285383610536565b926128616040519485610500565b8084526020808086019260051b840101019185831161037b57604001905b82821061293057505050606084015167ffffffffffffffff811161037b578360206128ac928701016122fd565b92608085015167ffffffffffffffff811161037b5760a09160206128d2928801016122fd565b94015190600282101561037b576128ed919694929596612b06565b938351915f935b8385106129045750505050505090565b909192939496956129236001916001600160a01b036124f6898c610726565b96979501939291906128f4565b6020809161293d84611dd1565b81520191019061287f565b82516001600160a01b038116810361037b57815260209283019201612818565b919290916003810361298357505050670de0b6b3a764000090565b600281036129915750905090565b600481036129e557505050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa908115610d33575f91612079575090565b60058103612a2b57505050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa908115610d33575f91612079575090565b60068103612a71575050506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa908115610d33575f91612079575090565b60078103612ab757505050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa908115610d33575f91612079575090565b60088103612ad95750506020815191818082019384920101031261037b575190565b6009036120fb575060408180518101031261037b57806020604061270c826001600160a01b039501611a94565b6002811015611a805761063f5750670de0b6b3a764000090565b519069ffffffffffffffffffff8216820361037b57565b604d81116102b257600a0a90565b91909360a06001600160a01b0394956004604051809781937ffeaf968c000000000000000000000000000000000000000000000000000000008352165afa908115610d33575f945f92612c20575b505f851391821592612c04575b5050612bdc5760ff16600103612bc757612bc161063f939261103092610e02565b91612b37565b612bd79061138e61063f94612b37565b610e15565b7fae193563000000000000000000000000000000000000000000000000000000005f5260045ffd5b63ffffffff919250612c169042610804565b9116105f80612ba0565b9450905060a0843d60a011612c6e575b81612c3d60a09383610500565b8101031261037b57612c4e84612b20565b506020840151612c65608060608701519601612b20565b5093905f612b93565b3d9150612c3056fe4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c754b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c76a2646970667358221220b1f47cc17d35d3146dcb17c16e275c76aba3713fe28c070c0eb7a4bb5870c54164736f6c634300081c0033", + "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f3560e01c80632e7639bc1461041f578063815822c1146103b0578063d703a0cd1461037f5763fd7daaf814610045575f80fd5b3461037b57604036600319011261037b57602435600435811515820361037b5761006f3633611556565b1580610348575b610320575f516020612c975f395f51905f5254906001600160801b038260801c9216925f146102df576b033b2e3c9fd0803ce80000008102908082046b033b2e3c9fd0803ce800000014901517156102b2576100db926100d591610e15565b906117c8565b670de0b6b3a764000081118015906102c6575b610170575b806100ff602092611de2565b6001600160801b036fffffffffffffffffffffffffffffffff195f516020612c975f395f51905f52549260801b169116175f516020612c975f395f51905f52557fb4fde7403c001c7cdeafc0c3bb46e972111b7efac4e832398cbf9fabe1694ed982604051838152a1604051908152f35b610178610674565b9081515f915f5b8281106101dc575050506001600160801b039150166fffffffffffffffffffffffffffffffff195f516020612c975f395f51905f525416175f516020612c975f395f51905f525560206b033b2e3c9fd0803ce800000090506100f3565b61024c6b033b2e3c9fd0803ce80000006102468461023d6001600160a01b03610205878c610726565b51166001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b5460281c610e02565b04611de2565b936001600160801b03808616911601906001600160801b0382116102b257600191946102836001600160a01b03610205848a610726565b9064ffffffffff74ffffffffffffffffffffffffffffffff000000000083549260281b1691161790550161017f565b634e487b7160e01b5f52601160045260245ffd5b506ec097ce7bc90715b34b9f10000000008110156100ee565b6b033b2e3c9fd0803ce80000008102908082046b033b2e3c9fd0803ce800000014901517156102b25761031b9261031591610e15565b90610804565b6100db565b7fc22a648e000000000000000000000000000000000000000000000000000000005f5260045ffd5b50335f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7b60205260405f205415610076565b5f80fd5b3461037b57602036600319011261037b5761039b600435610e33565b50906103ac6040519283928361061a565b0390f35b3461037b57608036600319011261037b576103c96104ea565b6064359067ffffffffffffffff821161037b576103ed61040f92369060040161054e565b604051916103fc602084610500565b5f83525f3681376044359060043561081f565b906103ac6040519283928361061a565b3461037b5760a036600319011261037b576104386104ea565b60643567ffffffffffffffff811161037b5761045890369060040161054e565b6084359067ffffffffffffffff821161037b573660238301121561037b5781600401359261048584610536565b926104936040519485610500565b8484526024602085019560051b8201019036821161037b57602401945b8186106104ca57505061040f93506044359060043561081f565b85356001600160a01b038116810361037b578152602095860195016104b0565b602435906001600160a01b038216820361037b57565b90601f8019910116810190811067ffffffffffffffff82111761052257604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff81116105225760051b60200190565b9080601f8301121561037b57813561056581610536565b926105736040519485610500565b81845260208085019260051b82010192831161037b57602001905b82821061059b5750505090565b813581526020918201910161058e565b90602080835192838152019201905f5b8181106105c85750505090565b82516001600160a01b03168452602093840193909201916001016105bb565b90602080835192838152019201905f5b8181106106045750505090565b82518452602093840193909201916001016105f7565b909161063161063f936040845260408401906105ab565b9160208184039101526105e7565b90565b9061064c82610536565b6106596040519182610500565b828152809261066a601f1991610536565b0190602036910137565b604051907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775480835282602081017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f20925f5b8181106106e35750506106e192500383610500565b565b84546001600160a01b03168352600194850194879450602090930192016106cc565b8051156107125760200190565b634e487b7160e01b5f52603260045260245ffd5b80518210156107125760209160051b010190565b90604051915f8154908160011c92600183169283156107fa575b6020851084146107e65784875286939081156107c45750600114610780575b506106e192500383610500565b90505f9291925260205f20905f915b8183106107a85750509060206106e1928201015f610773565b602091935080600191548385890101520191019091849261078f565b9050602092506106e194915060ff191682840152151560051b8201015f610773565b634e487b7160e01b5f52602260045260245ffd5b93607f1693610754565b919082039182116102b257565b5f1981146102b25760010190565b5f516020612c775f395f51905f52545f969592939060a81c60ff16600214610db657750200000000000000000000000000000000000000000060ff60a81b195f516020612c775f395f51905f525416175f516020612c775f395f51905f525560ff5f516020612c775f395f51905f525460a01c1615610d8e574211610d66576108a781610e33565b9097919588519181518303610d3e576108bf856117d5565b506001600160a01b035f516020612c775f395f51905f525416803b1561037b575f80916044604051809481937f2b471d8e0000000000000000000000000000000000000000000000000000000083528b60048401523360248401525af18015610d3357610d1e575b50610930610674565b8492855b8c8682106109f35750505050505050507f3998bcf315dae4953d294b3ca6e1d0074c249adc136b50d1ff99b04753c73e7f9060405190815260806020820152806109af6001600160a01b0361099d61098f608085018a6105ab565b84810360408601528b6105e7565b968388036060850152169533956105ab565b0390a3750100000000000000000000000000000000000000000060ff60a81b195f516020612c775f395f51905f525416175f516020612c775f395f51905f52559190565b816109fd91610726565b51610a088284610726565b5111610cf6578a878a8f610a1d858092610726565b5115159384610ccd575b50505050610a7e575b610a3a8585610726565b515f198101908111610a6a57811015610a56575b600101610934565b93610a62600191610811565b949050610a4e565b602488634e487b7160e01b81526011600452fd5b610a936001600160a01b036102058786610726565b60ff815460201c16151580610cb1575b610c895780548e919083908e908b908f9060ff1615610bb75750506008610ae4836001600160a01b03610adc610af196610aec96610726565b511696610726565b51930161073a565b611e13565b90610afb81611a76565b15610b09575b505050610a30565b610b24816020806001600160a01b0394518301019101611c1e565b1690813b15610bb35760646001600160a01b03938b8f9394819560405197889687957f8bfb07c9000000000000000000000000000000000000000000000000000000008752600487015216602485015260448401525af18015610ba857908891610b8f575b80610b01565b81610b9991610500565b610ba457865f610b89565b8680fd5b6040513d8a823e3d90fd5b8980fd5b9160209450926001600160a01b03610bd382610bdb9496610726565b511695610726565b51604051906001600160a01b03858301937fa9059cbb000000000000000000000000000000000000000000000000000000008552166024830152604482015260448152610c29606482610500565b519082855af115610c7e5787513d610c755750803b155b610c4a5750610a30565b7f5274afe7000000000000000000000000000000000000000000000000000000008852600452602487fd5b60011415610c40565b6040513d89823e3d90fd5b6004887f584a7938000000000000000000000000000000000000000000000000000000008152fd5b50610cc78b610cc26006840161073a565b611ab5565b15610aa3565b610cec9394506001600160a01b0391610ce591610726565b51166119cd565b12878a838e610a27565b6004877fa1aabbe1000000000000000000000000000000000000000000000000000000008152fd5b610d2b9194505f90610500565b5f925f610927565b6040513d5f823e3d90fd5b7f1df89e8b000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fecdd1c29000000000000000000000000000000000000000000000000000000005f5260045ffd5b7f9e87fac8000000000000000000000000000000000000000000000000000000005f5260045ffd5b7f37ed32e8000000000000000000000000000000000000000000000000000000005f5260045ffd5b90670de0b6b3a7640000820291808304670de0b6b3a764000014901517156102b257565b818102929181159184041417156102b257565b8115610e1f570490565b634e487b7160e01b5f52601260045260245ffd5b905f91610e3e610674565b918251905f92610e4d83610642565b945f5b8481106114ea5750610e6a610e6486610642565b95610642565b935f91825b8284106112f55750505050610ebc5f516020612c975f395f51905f52546b033b2e3c9fd0803ce80000006001600160801b0382169160801c610eb2828285612260565b92091515906117c8565b95861590816112e557610ed488633b9aca0083612260565b82610e1f5788633b9aca00610eec93091515906117c8565b67ffffffffffffffff81116112ce5767ffffffffffffffff16955b938590938884116112a65760405194858660207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795492838152017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795f5260205f20925f905b80600383011061126357610fa294549181811061124f575b818110611238575b818110611221575b10611210575b500387610500565b5f9267ffffffffffffffff8a1697633b9aca0089109a8b6110a4575b50929915925f5b8a51811015611095578a81861561104357610fe390610fea92610726565b5189610e02565b9089515f1981019081116102b25761103c8f6110368f93918f8f9061102a60019967ffffffffffffffff6110228b9861103096610726565b511690610e02565b92610e02565b90610e15565b92610726565b5201610fc5565b61105361105a9161106b93610726565b518a610e02565b67ffffffffffffffff881690610e02565b908d633b9aca008102908104633b9aca00148917156102b25761103c826110368f93600196610e15565b50985098965098505050505050565b6040517f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7880548083525f918252939750928a929060208301907fcc472d1522277c093c80208a319541556b1f96243621e0d69d76c670d24184205b8160038801106111b7579161114196859261113c94549181811061119c575b81811061117e575b818110611160575b10611152575b500383610500565b611c5f565b67ffffffffffffffff16935f610fbe565b60c01c81526020015f611134565b92602060019167ffffffffffffffff8560801c16815201930161112e565b92602060019167ffffffffffffffff8560401c168152019301611126565b92602060019167ffffffffffffffff8516815201930161111e565b93959294509060016080600492865467ffffffffffffffff8116825267ffffffffffffffff8160401c16602083015267ffffffffffffffff81841c16604083015260c01c606082015201940192019492908c94926110ff565b60c01d60070b81526020015f610f9a565b9260206001918460801c60070b8152019301610f94565b9260206001918460401c60070b8152019301610f8c565b9260206001918460070b8152019301610f84565b916004919350608060019186548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b6060820152019401920189929391610f6c565b7fa2b06574000000000000000000000000000000000000000000000000000000005f5260045ffd5b6306dfcc6560e41b5f52604060045260245260445ffd5b5067ffffffffffffffff95610f07565b9091929861130e6001600160a01b036102058c86610726565b805490928b60ff8316156113fc5750600784016113356113306008870161073a565b611e5a565b92908051925f908054915b8581106113a5575050505061139b9361138e6001969460ff61138361137e6005611376670de0b6b3a764000099611394996117c8565b9c5b0161073a565b611f70565b9360181c1690612137565b90610e02565b04906117c8565b9901929190610e6f565b82811015610712578f908f91600192845f526113db6001600160a01b038460205f20015416916113d5858b6117c8565b90610726565b526113f56113e98388610726565b51916113d5848a6117c8565b5201611340565b9360206001600160a01b0361141660249596949789610726565b5116604051948580927f70a082310000000000000000000000000000000000000000000000000000000082523060048301525afa8015610d33578d935f916114b6575b5080936114669088610726565b516001600160a01b031661147a878d610726565b5261148486610811565b9561148f908d610726565b5261139460019461138e61139b9560ff61138361137e6005670de0b6b3a764000098611378565b9350506020833d82116114e2575b816114d160209383610500565b8101031261037b578c92515f611459565b3d91506114c4565b9460019060ff6115076001600160a01b036102058a879a97610726565b541661152d5761151690610811565b955b86611523828a610726565b5201939093610e50565b6115509060076115486001600160a01b036102058b8b610726565b0154906117c8565b95611518565b6001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d5416918060041161037b575f5f905f80604051956001600160a01b0360208801917fb700961300000000000000000000000000000000000000000000000000000000835216968760248201523060448201527fffffffff00000000000000000000000000000000000000000000000000000000833516606482015260648152611609608482610500565b5190885afa3d156117c0573d9061161f82611a14565b9161162d6040519384610500565b82523d5f602084013e5b61174d575b501561164c575b50505050600190565b63ffffffff16156117465776010000000000000000000000000000000000000000000060ff60b01b195f516020612c775f395f51905f525416175f516020612c775f395f51905f5255823b1561037b576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af18015610d3357611736575b5060ff60b01b195f516020612c775f395f51905f5254165f516020612c775f395f51905f52555f808080611643565b5f61174091610500565b5f611707565b5050505f90565b80519092909160408310611789575050816040918101031261037b57611781604061177a60208401611aa8565b9201611dd1565b905b5f61163c565b91602081949294101561179e575b5050611783565b819250906020918101031261037b5760206117b99101611aa8565b5f80611797565b606090611637565b919082018092116102b257565b5f516020612c975f395f51905f52546b033b2e3c9fd0803ce80000008202918083046b033b2e3c9fd0803ce800000014901517156102b25761182461182d926001600160801b03831690610e15565b9060801c610804565b90670de0b6b3a764000082118015906119b4575b6118bb575b61184f82611de2565b6001600160801b036fffffffffffffffffffffffffffffffff195f516020612c975f395f51905f52549260801b169116175f516020612c975f395f51905f52557fb4fde7403c001c7cdeafc0c3bb46e972111b7efac4e832398cbf9fabe1694ed96020604051848152a1565b6118c3610674565b9182515f915f5b828110611925575050506001600160801b03919250166fffffffffffffffffffffffffffffffff195f516020612c975f395f51905f525416175f516020612c975f395f51905f52556b033b2e3c9fd0803ce800000090611846565b61194e6b033b2e3c9fd0803ce80000006102468461023d6001600160a01b03610205878d610726565b936001600160801b03808616911601906001600160801b0382116102b257600191946119856001600160a01b03610205848b610726565b9064ffffffffff74ffffffffffffffffffffffffffffffff000000000083549260281b169116179055016118ca565b506ec097ce7bc90715b34b9f1000000000821015611841565b8151915f5b8381106119e257505050505f1990565b6001600160a01b036119f48284610726565b51166001600160a01b03841614611a0d576001016119d2565b9250505090565b67ffffffffffffffff811161052257601f01601f191660200190565b81601f8201121561037b57805190611a4782611a14565b92611a556040519485610500565b8284526020838301011161037b57815f9260208093018386015e8301015290565b60011115611a8057565b634e487b7160e01b5f52602160045260245ffd5b51906001600160a01b038216820361037b57565b5190811515820361037b57565b8051810160408282031261037b57602082015191600183101561037b5760408101519167ffffffffffffffff831161037b57611af8926020809201920101611a30565b90611b0281611a76565b805f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d6020526001600160a01b0360405f20931692835f5260205260405f2054611c16578151611b54575050505f90565b611b5d81611a76565b15611b69575b80611746565b60208180518101031261037b57611b8a60206001600160a01b039201611a94565b16908115611b63575f91604460209260405194859384927f65e4ad9e00000000000000000000000000000000000000000000000000000000845230600485015260248401525af1908115610d33575f91611be2575090565b90506020813d602011611c0e575b81611bfd60209383610500565b8101031261037b5761063f90611aa8565b3d9150611bf0565b505050600190565b9081602091031261037b57516001600160a01b038116810361037b5790565b9067ffffffffffffffff8091169116039067ffffffffffffffff82116102b257565b9190611c6b83826121a0565b801580611dab575b15611c8b575050611c849150610705565b5160070b90565b909182515f1981019081116102b2578214611d9357611caa8282610726565b5160070b9360018301918284116102b257611cd384611cc98584610726565b5160070b92610726565b5160070b900390677fffffffffffffff198212677fffffffffffffff8313176102b257611d1667ffffffffffffffff9182611d0e8789610726565b511690611c3d565b1660070b9060070b02928360070b9384036102b25767ffffffffffffffff611d0e819482611d47611d4f9686610726565b511693610726565b1660070b908115610e1f57677fffffffffffffff1981145f198314166102b2570560070b01677fffffffffffffff8113677fffffffffffffff198212176102b25790565b925050515f1981019081116102b257611c8491610726565b5067ffffffffffffffff611dbe83610705565b511667ffffffffffffffff851610611c73565b519063ffffffff8216820361037b57565b6001600160801b038111611dfc576001600160801b031690565b6306dfcc6560e41b5f52608060045260245260445ffd5b8051810160408282031261037b57602082015191600183101561037b5760408101519167ffffffffffffffff831161037b57611e56926020809201920101611a30565b9091565b606091611e675f92611e13565b90611e7181611a76565b15611e795750565b600493505f919250611e9c816020806001600160a01b0394518301019101611c1e565b16604051938480927f01e1d1140000000000000000000000000000000000000000000000000000000082525afa918215610d33575f905f93611edd57509190565b9250503d805f843e611eef8184610500565b82019160408184031261037b57805167ffffffffffffffff811161037b5781019280601f8501121561037b578351611f2681610536565b94611f346040519687610500565b81865260208087019260051b82010192831161037b57602001905b828210611f60575050506020015190565b8151815260209182019101611f4f565b8051810160a0826020830192031261037b57602082015190600a82101561037b576040830151600a81101561037b57606084015167ffffffffffffffff811161037b57826020611fc292870101611a30565b93608081015167ffffffffffffffff811161037b57836020611fe692840101611a30565b9260a08201519167ffffffffffffffff831161037b576120099201602001611a30565b50600183036120a85750505060208180518101031261037b57602001516001600160a01b03811680910361037b576020600491604051928380927f6256f2c50000000000000000000000000000000000000000000000000000000082525afa908115610d33575f91612079575090565b90506020813d6020116120a0575b8161209460209383610500565b8101031261037b575190565b3d9150612087565b6120be9293916120b791612365565b8093612797565b906120c881610dde565b670de0b6b3a7640000830290838204670de0b6b3a764000014841517156102b25781119081612100575b506120fb575090565b905090565b905061210b82610dde565b115f6120f2565b9060ff8091169116039060ff82116102b257565b60ff16604d81116102b257600a0a90565b9060ff8116601281111561215d575090611030612158601261063f94612112565b612126565b60121115612177579061138e61215861063f936012612112565b5090565b9067ffffffffffffffff8091169116029067ffffffffffffffff82169182036102b257565b8051918215611746576001925f1981018181116102b25767ffffffffffffffff92836121d887826121d1868a610726565b511661217b565b91169384911611801590612259575b61225157505b808410612205575050505f1981019081116102b25790565b61221681851860011c8286166117c8565b908267ffffffffffffffff6122316001826121d1878a610726565b16111561223e57506121ed565b9350600181018091116102b257926121ed565b935050505090565b505f6121e7565b91818302915f19818509938380861095039480860395146122f057848311156122d85790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b50509061063f9250610e15565b9080601f8301121561037b5781519061231582610536565b926123236040519485610500565b82845260208085019360051b82010191821161037b57602001915b81831061234b5750505090565b825160ff8116810361037b5781526020928301920161233e565b600a811015611a805780612571575090815182019160a0816020850194031261037b57602081015167ffffffffffffffff811161037b5781019280603f8501121561037b5760208401516123b881610536565b946123c66040519687610500565b8186526020808088019360051b830101019083821161037b57604001915b81831061255157505050604082015167ffffffffffffffff811161037b57820181603f8201121561037b5760208101519061241e82610536565b9161242c6040519384610500565b8083526020808085019260051b840101019184831161037b57604001905b82821061253957505050606083015167ffffffffffffffff811161037b57826020612477928601016122fd565b91608084015167ffffffffffffffff811161037b5760a091602061249d928701016122fd565b930151600281101561037b57670de0b6b3a76400006124c0919694929596612b06565b938351915f935b8385106124d75750505050505090565b9091929394969561252c6001916001600160a01b036124f6898c610726565b511660ff6125048a87610726565b511660ff6125128b89610726565b51169163ffffffff6125248c8b610726565b511693612b45565b96979501939291906124c7565b6020809161254684611dd1565b81520191019061244a565b82516001600160a01b038116810361037b578152602092830192016123e4565b60038103612587575050670de0b6b3a764000090565b6002810361259d575050670de0b6b3a764000090565b600481036125f0575050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa908115610d33575f91612079575090565b60058103612635575050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa908115610d33575f91612079575090565b6006810361267a5750506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa908115610d33575f91612079575090565b600781036126bf575050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa908115610d33575f91612079575090565b600881036126e057506020815191818082019384920101031261037b575190565b60090361278a5760408180518101031261037b57806020604061270c826001600160a01b039501611a94565b920151916004604051809581937fa035b1fe000000000000000000000000000000000000000000000000000000008352165afa8015610d33575f90612756575b61063f9250610e15565b506020823d602011612782575b8161277060209383610500565b8101031261037b5761063f915161274c565b3d9150612763565b50670de0b6b3a764000090565b92919092600a811015611a80578061296857508051810160a0826020830192031261037b57602082015167ffffffffffffffff811161037b5782019381603f8601121561037b5760208501516127ec81610536565b956127fa6040519788610500565b8187526020808089019360051b830101019084821161037b57604001915b81831061294857505050604083015167ffffffffffffffff811161037b5783019082603f8301121561037b5760208201519161285383610536565b926128616040519485610500565b8084526020808086019260051b840101019185831161037b57604001905b82821061293057505050606084015167ffffffffffffffff811161037b578360206128ac928701016122fd565b92608085015167ffffffffffffffff811161037b5760a09160206128d2928801016122fd565b94015190600282101561037b576128ed919694929596612b06565b938351915f935b8385106129045750505050505090565b909192939496956129236001916001600160a01b036124f6898c610726565b96979501939291906128f4565b6020809161293d84611dd1565b81520191019061287f565b82516001600160a01b038116810361037b57815260209283019201612818565b919290916003810361298357505050670de0b6b3a764000090565b600281036129915750905090565b600481036129e557505050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa908115610d33575f91612079575090565b60058103612a2b57505050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa908115610d33575f91612079575090565b60068103612a71575050506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa908115610d33575f91612079575090565b60078103612ab757505050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa908115610d33575f91612079575090565b60088103612ad95750506020815191818082019384920101031261037b575190565b6009036120fb575060408180518101031261037b57806020604061270c826001600160a01b039501611a94565b6002811015611a805761063f5750670de0b6b3a764000090565b519069ffffffffffffffffffff8216820361037b57565b604d81116102b257600a0a90565b91909360a06001600160a01b0394956004604051809781937ffeaf968c000000000000000000000000000000000000000000000000000000008352165afa908115610d33575f945f92612c20575b505f851391821592612c04575b5050612bdc5760ff16600103612bc757612bc161063f939261103092610e02565b91612b37565b612bd79061138e61063f94612b37565b610e15565b7fae193563000000000000000000000000000000000000000000000000000000005f5260045ffd5b63ffffffff919250612c169042610804565b9116105f80612ba0565b9450905060a0843d60a011612c6e575b81612c3d60a09383610500565b8101031261037b57612c4e84612b20565b506020840151612c65608060608701519601612b20565b5093905f612b93565b3d9150612c3056fe4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c754b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c76a2646970667358221220b1f47cc17d35d3146dcb17c16e275c76aba3713fe28c070c0eb7a4bb5870c54164736f6c634300081c0033", + "devdoc": { + "author": "Cooper Labs", + "custom:contact": "security@cooperlabs.xyz", + "details": "This contract is an authorized fork of Angle's `Redeemer` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/Redeemer.sol", + "errors": { + "SafeCastOverflowedUintDowncast(uint8,uint256)": [ + { + "details": "Value doesn't fit in an uint of `bits` size." + } + ], + "SafeERC20FailedOperation(address)": [ + { + "details": "An operation with an ERC-20 token failed." + } + ] + }, + "kind": "dev", + "methods": { + "quoteRedemptionCurve(uint256)": { + "returns": { + "amounts": "Amount that would be obtained for each token in the `tokens` array", + "tokens": "List of tokens that would be given" + } + }, + "redeem(uint256,address,uint256,uint256[])": { + "details": "The `minAmountOuts` list must reflect the amount of `tokens` returnedIn normal conditions, the amount of tokens outputted by this function should be the amount of collateral assets supported by the system, following their order in the `collateralList`.If one collateral has its liquidity managed through strategies, then it's possible that this asset has sub-collaterals with it. In this situation, these sub-collaterals may be sent during the redemption process and the `minAmountOuts` will be bigger than the `collateralList` length. If there are 3 collateral assets and the 2nd collateral asset in the list (at index 1) consists of 3 sub-collaterals, then the ordering of the token list will be as follows: `[collat 1, sub-collat 1 of collat 2, sub-collat 2 of collat 2, sub-collat 3 of collat 2, collat 3]`The list of tokens outputted (and hence the minimum length of the `minAmountOuts` list) can be obtained by calling the `quoteRedemptionCurve` functionTokens requiring a whitelist must be forfeited if the redemption is to an address that is not in the whitelist, otherwise this function revertsNo approval is needed before calling this function", + "params": { + "deadline": "Timestamp before which the redemption should have occured", + "minAmountOuts": "Minimum amount of each token given back in the redemption to obtain", + "receiver": "Address which should be receiving the output tokens" + }, + "returns": { + "amounts": "Amount given for each token in the `tokens` array", + "tokens": "List of tokens returned" + } + }, + "redeemWithForfeit(uint256,address,uint256,uint256[],address[])": { + "details": "Beware that if a token is given in the `forfeitTokens` list, the redemption will not try to send token even if it has enough immediately available to send the amount" + }, + "updateNormalizer(uint256,bool)": { + "details": "This function may be called by trusted addresses: these could be for instance savings contract minting stablecoins when they notice a profit" + } + }, + "title": "Redeemer", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "quoteRedemptionCurve(uint256)": { + "notice": "Simulate the exact output that a redemption of `amount` of stablecoins would give at a given block" + }, + "redeem(uint256,address,uint256,uint256[])": { + "notice": "Redeems `amount` of stablecoins from the system" + }, + "redeemWithForfeit(uint256,address,uint256,uint256[],address[])": { + "notice": "Same as the redeem function above with the additional feature to specify a list of `forfeitTokens` for which the Parallelizer system will not try to do a transfer to `receiver`." + }, + "updateNormalizer(uint256,bool)": { + "notice": "Updates the normalizer variable by `amount`" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/RewardHandler.json b/deployments/sepolia/RewardHandler.json new file mode 100644 index 0000000..98f04ef --- /dev/null +++ b/deployments/sepolia/RewardHandler.json @@ -0,0 +1,139 @@ +{ + "address": "0xad58Fc13a682a121e5fe2f8E45D4D988A7e51B0D", + "abi": [ + { + "inputs": [], + "name": "InvalidSwap", + "type": "error" + }, + { + "inputs": [], + "name": "NotTrusted", + "type": "error" + }, + { + "inputs": [], + "name": "OdosSwapFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrantCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "TooSmallAmountOut", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenObtained", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceUpdate", + "type": "uint256" + } + ], + "name": "RewardsSoldFor", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minAmountOut", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "payload", + "type": "bytes" + } + ], + "name": "sellRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x8835870decb168e7f5b0904bef5544a4104bb68e0057bf963166272c5aec352e", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0xad58Fc13a682a121e5fe2f8E45D4D988A7e51B0D", + "transactionIndex": 106, + "gasUsed": "738884", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3077d9971c6e6bbee296b967acc88d05ef2ddc93ee7bf1a0f4467bdac66dceaf", + "transactionHash": "0x8835870decb168e7f5b0904bef5544a4104bb68e0057bf963166272c5aec352e", + "logs": [], + "blockNumber": 8411097, + "cumulativeGasUsed": "19386924", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9d44d918681c9ad36f866ebee034a3d1", + "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidSwap\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotTrusted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OdosSwapFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooSmallAmountOut\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenObtained\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"balanceUpdate\",\"type\":\"uint256\"}],\"name\":\"RewardsSoldFor\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minAmountOut\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"sellRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Cooper Labs\",\"custom:contact\":\"security@cooperlabs.xyz\",\"details\":\"This contract is an authorized fork of Angle's `RewardHandler` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/RewardHandler.sol\",\"errors\":{\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC-20 token failed.\"}]},\"kind\":\"dev\",\"methods\":{\"sellRewards(uint256,bytes)\":{\"details\":\"It is impossible to sell a token that is a collateral through this functionTrusted sellers and governance only may call this functionOnly governance can set which tokens can be swapped through this function by passing a prior approval transaction to Odos router for the token to be swapped\"}},\"title\":\"RewardHandler\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"sellRewards(uint256,bytes)\":{\"notice\":\"IRewardHandler\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/parallelizer/facets/RewardHandler.sol\":\"RewardHandler\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAuthority} from \\\"./IAuthority.sol\\\";\\n\\nlibrary AuthorityUtils {\\n /**\\n * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\\n * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\\n * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\\n */\\n function canCallWithDelay(\\n address authority,\\n address caller,\\n address target,\\n bytes4 selector\\n ) internal view returns (bool immediate, uint32 delay) {\\n (bool success, bytes memory data) = authority.staticcall(\\n abi.encodeCall(IAuthority.canCall, (caller, target, selector))\\n );\\n if (success) {\\n if (data.length >= 0x40) {\\n (immediate, delay) = abi.decode(data, (bool, uint32));\\n } else if (data.length >= 0x20) {\\n immediate = abi.decode(data, (bool));\\n }\\n }\\n return (immediate, delay);\\n }\\n}\\n\",\"keccak256\":\"0xb3875997b0d8705e29aa20fee88e1dfef93df438794ae1ad8ba2eb016a4dd4e4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAccessManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\ninterface IAccessManager {\\n /**\\n * @dev A delayed operation was scheduled.\\n */\\n event OperationScheduled(\\n bytes32 indexed operationId,\\n uint32 indexed nonce,\\n uint48 schedule,\\n address caller,\\n address target,\\n bytes data\\n );\\n\\n /**\\n * @dev A scheduled operation was executed.\\n */\\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev A scheduled operation was canceled.\\n */\\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev Informational labelling for a roleId.\\n */\\n event RoleLabel(uint64 indexed roleId, string label);\\n\\n /**\\n * @dev Emitted when `account` is granted `roleId`.\\n *\\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\\n * otherwise it indicates the execution delay for this account and roleId is updated.\\n */\\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\\n\\n /**\\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\\n */\\n event RoleRevoked(uint64 indexed roleId, address indexed account);\\n\\n /**\\n * @dev Role acting as admin over a given `roleId` is updated.\\n */\\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\\n\\n /**\\n * @dev Role acting as guardian over a given `roleId` is updated.\\n */\\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\\n\\n /**\\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\\n */\\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\\n\\n /**\\n * @dev Target mode is updated (true = closed, false = open).\\n */\\n event TargetClosed(address indexed target, bool closed);\\n\\n /**\\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\\n */\\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\\n\\n /**\\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\\n */\\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\\n\\n error AccessManagerAlreadyScheduled(bytes32 operationId);\\n error AccessManagerNotScheduled(bytes32 operationId);\\n error AccessManagerNotReady(bytes32 operationId);\\n error AccessManagerExpired(bytes32 operationId);\\n error AccessManagerLockedRole(uint64 roleId);\\n error AccessManagerBadConfirmation();\\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\\n error AccessManagerUnauthorizedConsume(address target);\\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\\n\\n /**\\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\\n * & {execute} workflow.\\n *\\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\\n * for future execution.\\n *\\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\\n * the operation can be executed if and only if delay is greater than 0.\\n *\\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\\n *\\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\\n * {AccessManager} documentation.\\n */\\n function canCall(\\n address caller,\\n address target,\\n bytes4 selector\\n ) external view returns (bool allowed, uint32 delay);\\n\\n /**\\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\\n *\\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\\n * disabling any scheduling usage.\\n */\\n function expiration() external view returns (uint32);\\n\\n /**\\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\\n * can be increased without setback (and reset via {revokeRole} in the case event of an\\n * accidental increase). Defaults to 5 days.\\n */\\n function minSetback() external view returns (uint32);\\n\\n /**\\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\\n *\\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\\n */\\n function isTargetClosed(address target) external view returns (bool);\\n\\n /**\\n * @dev Get the role required to call a function.\\n */\\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\\n\\n /**\\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\\n */\\n function getTargetAdminDelay(address target) external view returns (uint32);\\n\\n /**\\n * @dev Get the id of the role that acts as an admin for the given role.\\n *\\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\\n * an operation that is restricted to this role.\\n */\\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role that acts as a guardian for a given role.\\n *\\n * The guardian permission allows canceling operations that have been scheduled under the role.\\n */\\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role current grant delay.\\n *\\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\\n */\\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\\n\\n /**\\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\\n * level.\\n *\\n * Returns:\\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\\n * [1] Current execution delay for the account.\\n * [2] Pending execution delay for the account.\\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\\n */\\n function getAccess(\\n uint64 roleId,\\n address account\\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\\n\\n /**\\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\\n * permission might be associated with an execution delay. {getAccess} can provide more details.\\n */\\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\\n\\n /**\\n * @dev Give a label to a role, for improved role discoverability by UIs.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleLabel} event.\\n */\\n function labelRole(uint64 roleId, string calldata label) external;\\n\\n /**\\n * @dev Add `account` to `roleId`, or change its execution delay.\\n *\\n * This gives the account the authorization to call any function that is restricted to this role. An optional\\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\\n *\\n * If the account has already been granted this role, the execution delay will be updated. This update is not\\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - granted role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleGranted} event.\\n */\\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\\n\\n /**\\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\\n * no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - revoked role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function revokeRole(uint64 roleId, address account) external;\\n\\n /**\\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\\n * the role this call has no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function renounceRole(uint64 roleId, address callerConfirmation) external;\\n\\n /**\\n * @dev Change admin role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleAdminChanged} event\\n */\\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\\n\\n /**\\n * @dev Change guardian role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGuardianChanged} event\\n */\\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\\n\\n /**\\n * @dev Update the delay for granting a `roleId`.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGrantDelayChanged} event.\\n */\\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetFunctionRoleUpdated} event per selector.\\n */\\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\\n\\n /**\\n * @dev Set the delay for changing the configuration of a given target contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetAdminDelayUpdated} event.\\n */\\n function setTargetAdminDelay(address target, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the closed flag for a contract.\\n *\\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetClosed} event.\\n */\\n function setTargetClosed(address target, bool closed) external;\\n\\n /**\\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\\n * operation is not yet scheduled, has expired, was executed, or was canceled.\\n */\\n function getSchedule(bytes32 id) external view returns (uint48);\\n\\n /**\\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\\n * been scheduled.\\n */\\n function getNonce(bytes32 id) external view returns (uint32);\\n\\n /**\\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\\n * required for the caller. The special value zero will automatically set the earliest possible time.\\n *\\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\\n *\\n * Emits a {OperationScheduled} event.\\n *\\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\\n * contract if it is using standard Solidity ABI encoding.\\n */\\n function schedule(\\n address target,\\n bytes calldata data,\\n uint48 when\\n ) external returns (bytes32 operationId, uint32 nonce);\\n\\n /**\\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\\n * execution delay is 0.\\n *\\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\\n *\\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\\n */\\n function execute(address target, bytes calldata data) external payable returns (uint32);\\n\\n /**\\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\\n * operation that is cancelled.\\n *\\n * Requirements:\\n *\\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\\n *\\n * Emits a {OperationCanceled} event.\\n */\\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\\n\\n /**\\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\\n *\\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\\n * with all the verifications that it implies.\\n *\\n * Emit a {OperationExecuted} event.\\n */\\n function consumeScheduledOp(address caller, bytes calldata data) external;\\n\\n /**\\n * @dev Hashing function for delayed operations.\\n */\\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\\n\\n /**\\n * @dev Changes the authority of a target managed by this manager instance.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n */\\n function updateAuthority(address target, address newAuthority) external;\\n}\\n\",\"keccak256\":\"0x9be2d08a326515805bc9cf6315b7953f8d1ebe88abf48c2d645fb1fa8211a0e2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAuthority.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard interface for permissioning originally defined in Dappsys.\\n */\\ninterface IAuthority {\\n /**\\n * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\\n */\\n function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\\n}\\n\",\"keccak256\":\"0x4cc0766bd7fb7b3bafb70afa2a93b6e313a0baec7a35ad1b57505be7861c1030\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1363.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"./IERC20.sol\\\";\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @title IERC1363\\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\\n *\\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\\n */\\ninterface IERC1363 is IERC20, IERC165 {\\n /*\\n * Note: the ERC-165 identifier for this interface is 0xb0202a11.\\n * 0xb0202a11 ===\\n * bytes4(keccak256('transferAndCall(address,uint256)')) ^\\n * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\\n * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\\n * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\\n * bytes4(keccak256('approveAndCall(address,uint256)')) ^\\n * bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\\n */\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferAndCall(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @param data Additional data with no specified format, sent in call to `to`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param from The address which you want to send tokens from.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param from The address which you want to send tokens from.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @param data Additional data with no specified format, sent in call to `to`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to be spent.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function approveAndCall(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to be spent.\\n * @param data Additional data with no specified format, sent in call to `spender`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9b6b3e7803bc5f2f8cd7ad57db8ac1def61a9930a5a3107df4882e028a9605d7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\n\",\"keccak256\":\"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC1363} from \\\"../../../interfaces/IERC1363.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n /**\\n * @dev An operation with an ERC-20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n *\\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n *\\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n *\\n * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\\n * only sets the \\\"standard\\\" allowance. Any temporary allowance will remain active, in addition to the value being\\n * set here.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n if (to.code.length == 0) {\\n safeTransfer(token, to, value);\\n } else if (!token.transferAndCall(to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\\n * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function transferFromAndCallRelaxed(\\n IERC1363 token,\\n address from,\\n address to,\\n uint256 value,\\n bytes memory data\\n ) internal {\\n if (to.code.length == 0) {\\n safeTransferFrom(token, from, to, value);\\n } else if (!token.transferFromAndCall(from, to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\\n * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\\n * once without retrying, and relies on the returned value to be true.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n if (to.code.length == 0) {\\n forceApprove(token, to, value);\\n } else if (!token.approveAndCall(to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n uint256 returnSize;\\n uint256 returnValue;\\n assembly (\\\"memory-safe\\\") {\\n let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n // bubble errors\\n if iszero(success) {\\n let ptr := mload(0x40)\\n returndatacopy(ptr, 0, returndatasize())\\n revert(ptr, returndatasize())\\n }\\n returnSize := returndatasize()\\n returnValue := mload(0)\\n }\\n\\n if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n bool success;\\n uint256 returnSize;\\n uint256 returnValue;\\n assembly (\\\"memory-safe\\\") {\\n success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n returnSize := returndatasize()\\n returnValue := mload(0)\\n }\\n return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\\n }\\n}\\n\",\"keccak256\":\"0x4ea01544758fd2c7045961904686bfe232d2220a04ecaa2d6b08dac17827febf\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/interfaces/IManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IManager` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IManager.sol\\ninterface IManager {\\n /// @notice Returns the amount of collateral managed by the Manager\\n /// @return balances Balances of all the subCollaterals handled by the manager\\n /// @dev MUST NOT revert\\n function totalAssets() external view returns (uint256[] memory balances, uint256 totalValue);\\n\\n /// @notice Hook to invest `amount` of `collateral`\\n /// @dev MUST revert if the manager cannot accept these funds\\n /// @dev MUST have received the funds beforehand\\n function invest(uint256 amount) external;\\n\\n /// @notice Sends `amount` of `collateral` to the `to` address\\n /// @dev Called when `tokenP` are burnt and during redemptions\\n // @dev MUST revert if there are not funds enough available\\n /// @dev MUST be callable only by the parallelizer\\n function release(address asset, address to, uint256 amount) external;\\n\\n /// @notice Gives the maximum amount of collateral immediately available for a transfer\\n /// @dev Useful for integrators using `quoteIn` and `quoteOut`\\n function maxAvailable() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8507172834f0243643fcf366bff6bae8f20523d102f5896f2140946975458e2c\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IRewardHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IRewardHandler\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IRewardHandler` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IRewardHandler.sol\\ninterface IRewardHandler {\\n /// @notice Sells some external tokens through a odos call\\n /// @param minAmountOut Minimum amount of the outToken to get\\n /// @param payload Payload to pass to odos\\n /// @return amountOut Amount obtained of the outToken\\n function sellRewards(uint256 minAmountOut, bytes memory payload) external returns (uint256 amountOut);\\n}\\n\",\"keccak256\":\"0xff2afcbc8d1c25297324159d3684a323e60b3c9408129aba70d3d6938d093255\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/ITokenP.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title ITokenP\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Interface for the stablecoins `tokenP` contracts\\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\\ninterface ITokenP is IERC20 {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MINTER ROLE ONLY FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Lets a whitelisted contract mint tokenPs\\n /// @param account Address to mint to\\n /// @param amount Amount to mint\\n function mint(address account, uint256 amount) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @param sender Address which requested the burn from `burner`\\n /// @dev This method is to be called by a contract with the minter right after being requested\\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\\n /// @dev The method checks the allowance between the `sender` and the `burner`\\n function burnFrom(uint256 amount, address burner, address sender) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\\n /// requested to do so by an address willing to burn tokens from its address\\n function burnSelf(uint256 amount, address burner) external;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Amount of decimals of the stablecoin\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x64a1305faa8c5c91767a11af0eae16e4b463aa0bfe10f11b74aae9d96681a5eb\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/coinbase/ICbETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ICbETH\\n/// @notice Interface for the `cbETH` contract\\ninterface ICbETH {\\n function exchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb159341cb0e25c478912b274cdda2d50fa84692aeac87b6823d281aaea2aed04\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/frax/ISfrxETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ISfrxETH\\n/// @notice Interface for the `sfrxETH` contract\\ninterface ISfrxETH {\\n function pricePerShare() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x914cbea276f817c7db62bfca21e15bd8f7892faa9f39d86baaef574cf12b859f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/lido/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IStETH\\n/// @notice Interface for the `StETH` contract\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n\\n function submit(address) external payable returns (uint256);\\n\\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf21e3d8bdadc236b34bf2122b0e0b939d2d6bb6e2889b508636cbb7b84f59680\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/rocketPool/IRETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IRETH\\n/// @notice Interface for the `rETH` contract\\ninterface IRETH {\\n function getExchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x567a378e95d40160e297c1adb617ccaa69c03e49c4ad72a6ce651dd43cdbd5cd\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/Storage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ENUMS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nenum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n}\\n\\nenum ManagerType {\\n EXTERNAL\\n}\\n\\nenum ActionType {\\n Mint,\\n Burn,\\n Redeem\\n}\\n\\nenum TrustedType {\\n Updater,\\n Seller\\n}\\n\\nenum QuoteType {\\n MintExactInput,\\n MintExactOutput,\\n BurnExactInput,\\n BurnExactOutput\\n}\\n\\nenum OracleReadType {\\n CHAINLINK_FEEDS,\\n EXTERNAL,\\n NO_ORACLE,\\n STABLE,\\n WSTETH,\\n CBETH,\\n RETH,\\n SFRXETH,\\n MAX,\\n MORPHO_ORACLE\\n}\\n\\nenum OracleQuoteType {\\n UNIT,\\n TARGET\\n}\\n\\nenum WhitelistType {\\n BACKED\\n}\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STRUCTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nstruct Permit2Details {\\n address to; // Address that will receive the funds\\n uint256 nonce; // Nonce of the transaction\\n bytes signature; // Permit signature of the user\\n}\\n\\nstruct FacetCut {\\n address facetAddress; // Facet contract address\\n FacetCutAction action; // Can be add, remove or replace\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct Facet {\\n address facetAddress; // Facet contract address\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct FacetInfo {\\n address facetAddress; // Facet contract address\\n uint16 selectorPosition; // Position in the list of all selectors\\n}\\n\\nstruct DiamondStorage {\\n bytes4[] selectors; // List of all available selectors\\n mapping(bytes4 => FacetInfo) selectorInfo; // Selector to (address, position in list)\\n IAccessManager accessManager; // Contract handling access management\\n}\\n\\nstruct ImplementationStorage {\\n address implementation; // Dummy implementation address for Etherscan usability\\n}\\n\\nstruct ManagerStorage {\\n IERC20[] subCollaterals; // Subtokens handled by the manager or strategies\\n bytes config; // Additional configuration data\\n}\\n\\nstruct Collateral {\\n uint8 isManaged; // If the collateral is managed through external strategies\\n uint8 isMintLive; // If minting from this asset is unpaused\\n uint8 isBurnLive; // If burning to this asset is unpaused\\n uint8 decimals; // IERC20Metadata(collateral).decimals()\\n uint8 onlyWhitelisted; // If only whitelisted addresses can burn or redeem for this token\\n uint216 normalizedStables; // Normalized amount of stablecoins issued from this collateral\\n uint64[] xFeeMint; // Increasing exposures in [0,BASE_9[\\n int64[] yFeeMint; // Mint fees at the exposures specified in `xFeeMint`\\n uint64[] xFeeBurn; // Decreasing exposures in ]0,BASE_9]\\n int64[] yFeeBurn; // Burn fees at the exposures specified in `xFeeBurn`\\n bytes oracleConfig; // Data about the oracle used for the collateral\\n bytes whitelistData; // For whitelisted collateral, data used to verify whitelists\\n ManagerStorage managerData; // For managed collateral, data used to handle the strategies\\n uint256 stablecoinCap; // Cap on the amount of stablecoins that can be issued from this collateral\\n}\\n\\nstruct ParallelizerStorage {\\n ITokenP tokenP; // tokenP handled by the system\\n uint8 isRedemptionLive; // If redemption is unpaused\\n uint8 statusReentrant; // If call is reentrant or not\\n bool consumingSchedule; // If the contract is consuming a scheduled operation\\n uint128 normalizedStables; // Normalized amount of stablecoins issued by the system\\n uint128 normalizer; // To reconcile `normalizedStables` values with the actual amount\\n address[] collateralList; // List of collateral assets supported by the system\\n uint64[] xRedemptionCurve; // Increasing collateral ratios > 0\\n int64[] yRedemptionCurve; // Value of the redemption fees at `xRedemptionCurve`\\n mapping(address => Collateral) collaterals; // Maps a collateral asset to its parameters\\n mapping(address => uint256) isTrusted; // If an address is trusted to update the normalizer value\\n mapping(address => uint256) isSellerTrusted; // If an address is trusted to sell accruing reward tokens or to run\\n // keeper jobs on oracles\\n mapping(WhitelistType => mapping(address => uint256)) isWhitelistedForType;\\n}\\n// Whether an address is whitelisted for a specific whitelist type\\n\",\"keccak256\":\"0x3f4313dd110dbe390038320b2d3cf24dcbe9b75cd9573e7f048f7233c02dd227\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/AccessManagedModifiers.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { LibDiamond } from \\\"../libraries/LibDiamond.sol\\\";\\nimport { LibStorage as s, ParallelizerStorage } from \\\"../libraries/LibStorage.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\n\\n/// @title AccessManagedModifiers\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This contract is an authorized fork of Angle's `AccessControlModifiers` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/AccessControlModifiers.sol\\n/// update access logic to use OpenZeppelin's `AccessManaged` logic\\ncontract AccessManagedModifiers {\\n /// @notice Checks whether the `msg.sender` can call a function with a given selector\\n modifier restricted() {\\n if (!LibDiamond.checkCanCall(msg.sender, msg.data)) revert AccessManagedUnauthorized(msg.sender);\\n _;\\n }\\n\\n /// @notice Prevents a contract from calling itself, directly or indirectly\\n /// @dev This implementation is an adaptation of the OpenZepellin `ReentrancyGuard` for the purpose of this\\n /// Diamond Proxy system. The base implementation can be found here\\n /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol\\n modifier nonReentrant() {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n // Reentrant protection\\n // On the first call, `ts.statusReentrant` will be `NOT_ENTERED`\\n if (ts.statusReentrant == ENTERED) revert ReentrantCall();\\n // Any calls to the `nonReentrant` modifier after this point will fail\\n ts.statusReentrant = ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n ts.statusReentrant = NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0xa23f4434f86462af0594992bd826ba6af88f55201f2a7f79ce5fde05b5f10073\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/RewardHandler.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport { IRewardHandler } from \\\"contracts/interfaces/IRewardHandler.sol\\\";\\n\\nimport { AccessManagedModifiers } from \\\"./AccessManagedModifiers.sol\\\";\\n\\nimport { LibDiamond } from \\\"../libraries/LibDiamond.sol\\\";\\nimport { LibStorage as s } from \\\"../libraries/LibStorage.sol\\\";\\nimport { LibManager } from \\\"../libraries/LibManager.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title RewardHandler\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This contract is an authorized fork of Angle's `RewardHandler` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/RewardHandler.sol\\ncontract RewardHandler is IRewardHandler, AccessManagedModifiers {\\n using SafeERC20 for IERC20;\\n\\n event RewardsSoldFor(address indexed tokenObtained, uint256 balanceUpdate);\\n\\n /// @notice IRewardHandler\\n /// @dev It is impossible to sell a token that is a collateral through this function\\n /// @dev Trusted sellers and governance only may call this function\\n /// @dev Only governance can set which tokens can be swapped through this function by passing a prior approval\\n /// transaction to Odos router for the token to be swapped\\n function sellRewards(uint256 minAmountOut, bytes memory payload) external nonReentrant returns (uint256 amountOut) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n if (!LibDiamond.checkCanCall(msg.sender, msg.data) && ts.isSellerTrusted[msg.sender] == 0) revert NotTrusted();\\n address[] memory list = ts.collateralList;\\n uint256 listLength = list.length;\\n uint256[] memory balances = new uint256[](listLength);\\n // Getting the balances of all collateral assets of the protocol to see if those do not decrease during\\n // the swap: this is the only way to check that collateral assets have not been sold\\n // Not checking the `subCollaterals` here as swaps should try to increase the balance of one collateral\\n for (uint256 i; i < listLength; ++i) {\\n balances[i] = IERC20(list[i]).balanceOf(address(this));\\n }\\n //solhint-disable-next-line\\n (bool success, bytes memory result) = ODOS_ROUTER.call(payload);\\n if (!success) _revertBytes(result);\\n amountOut = abi.decode(result, (uint256));\\n if (amountOut < minAmountOut) revert TooSmallAmountOut();\\n bool hasIncreased;\\n address collateral;\\n for (uint256 i; i < listLength; ++i) {\\n uint256 newBalance = IERC20(list[i]).balanceOf(address(this));\\n if (newBalance < balances[i]) {\\n revert InvalidSwap();\\n } else if (newBalance > balances[i]) {\\n hasIncreased = true;\\n collateral = list[i];\\n emit RewardsSoldFor(list[i], newBalance - balances[i]);\\n }\\n }\\n if (!hasIncreased) revert InvalidSwap();\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.isManaged > 0) {\\n IERC20(collateral).safeTransfer(LibManager.transferRecipient(collatInfo.managerData.config), amountOut);\\n LibManager.invest(amountOut, collatInfo.managerData.config);\\n }\\n }\\n\\n /// @notice Processes odos revert messages\\n function _revertBytes(bytes memory errMsg) private pure {\\n if (errMsg.length > 0) {\\n //solhint-disable-next-line\\n assembly (\\\"memory-safe\\\") {\\n revert(add(32, errMsg), mload(errMsg))\\n }\\n }\\n revert OdosSwapFailed();\\n }\\n}\\n\",\"keccak256\":\"0x4fb133110a6cb28703c362afdeacbfb88c26bd61c6babd6f60ba9bee2acfd7de\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibDiamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { AuthorityUtils } from \\\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibDiamond\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Helper library to deal with diamond proxies.\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/libraries/LibDiamond.sol by mudgen\\nlibrary LibDiamond {\\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n function isGovernor(address caller) internal view returns (bool) {\\n (bool isMember,) = s.diamondStorage().accessManager.hasRole(GOVERNOR_ROLE, caller);\\n return isMember;\\n }\\n\\n /// @notice Checks whether `caller` can call `data` on `this`\\n function checkCanCall(address caller, bytes calldata data) internal returns (bool) {\\n IAccessManager accessManager = s.diamondStorage().accessManager;\\n (bool immediate, uint32 delay) =\\n AuthorityUtils.canCallWithDelay(address(accessManager), caller, address(this), bytes4(data[0:4]));\\n if (!immediate) {\\n if (delay > 0) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n ts.consumingSchedule = true;\\n accessManager.consumeScheduledOp(caller, data);\\n ts.consumingSchedule = false;\\n } else {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @notice Internal function version of `diamondCut`\\n function diamondCut(FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {\\n uint256 diamondCutLength = _diamondCut.length;\\n for (uint256 facetIndex; facetIndex < diamondCutLength; facetIndex++) {\\n bytes4[] memory functionSelectors = _diamondCut[facetIndex].functionSelectors;\\n address facetAddress = _diamondCut[facetIndex].facetAddress;\\n\\n if (functionSelectors.length == 0) {\\n revert NoSelectorsProvidedForFacetForCut(facetAddress);\\n }\\n\\n FacetCutAction action = _diamondCut[facetIndex].action;\\n if (action == FacetCutAction.Add) {\\n _addFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Replace) {\\n _replaceFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Remove) {\\n _removeFunctions(facetAddress, functionSelectors);\\n }\\n }\\n\\n emit DiamondCut(_diamondCut, _init, _calldata);\\n _initializeDiamondCut(_init, _calldata);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n PRIVATE FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Does a delegate call on `_init` with `_calldata`\\n function _initializeDiamondCut(address _init, bytes memory _calldata) private {\\n if (_init == address(0)) {\\n return;\\n }\\n _enforceHasContractCode(_init);\\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n if (!success) {\\n if (error.length > 0) {\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(error)\\n revert(add(32, error), returndata_size)\\n }\\n } else {\\n revert InitializationFunctionReverted(_init, _calldata);\\n }\\n }\\n }\\n\\n /// @notice Adds a new function to the diamond proxy\\n /// @dev Reverts if selectors are already existing\\n function _addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n if (_facetAddress == address(0)) {\\n revert CannotAddSelectorsToZeroAddress(_functionSelectors);\\n }\\n DiamondStorage storage ds = s.diamondStorage();\\n uint16 selectorCount = uint16(ds.selectors.length);\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n if (oldFacetAddress != address(0)) {\\n revert CannotAddFunctionToDiamondThatAlreadyExists(selector);\\n }\\n ds.selectorInfo[selector] = FacetInfo(_facetAddress, selectorCount);\\n ds.selectors.push(selector);\\n selectorCount++;\\n }\\n }\\n\\n /// @notice Upgrades a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n if (_facetAddress == address(0)) {\\n revert CannotReplaceFunctionsFromFacetWithZeroAddress(_functionSelectors);\\n }\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n // Can't replace immutable functions -- functions defined directly in the diamond in this case\\n if (oldFacetAddress == address(this)) {\\n revert CannotReplaceImmutableFunction(selector);\\n }\\n if (oldFacetAddress == _facetAddress) {\\n revert CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(selector);\\n }\\n if (oldFacetAddress == address(0)) {\\n revert CannotReplaceFunctionThatDoesNotExists(selector);\\n }\\n // Replace old facet address\\n ds.selectorInfo[selector].facetAddress = _facetAddress;\\n }\\n }\\n\\n /// @notice Removes a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n uint256 selectorCount = ds.selectors.length;\\n if (_facetAddress != address(0)) {\\n revert RemoveFacetAddressMustBeZeroAddress(_facetAddress);\\n }\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n FacetInfo memory oldFacetAddressAndSelectorPosition = ds.selectorInfo[selector];\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(0)) {\\n revert CannotRemoveFunctionThatDoesNotExist(selector);\\n }\\n\\n // Can't remove immutable functions -- functions defined directly in the diamond\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(this)) {\\n revert CannotRemoveImmutableFunction(selector);\\n }\\n // Replace selector with last selector\\n selectorCount--;\\n if (oldFacetAddressAndSelectorPosition.selectorPosition != selectorCount) {\\n bytes4 lastSelector = ds.selectors[selectorCount];\\n ds.selectors[oldFacetAddressAndSelectorPosition.selectorPosition] = lastSelector;\\n ds.selectorInfo[lastSelector].selectorPosition = oldFacetAddressAndSelectorPosition.selectorPosition;\\n }\\n // Delete last selector\\n ds.selectors.pop();\\n delete ds.selectorInfo[selector];\\n }\\n }\\n\\n /// @notice Checks that an address has a non void bytecode\\n function _enforceHasContractCode(address _contract) private view {\\n uint256 contractSize;\\n assembly (\\\"memory-safe\\\") {\\n contractSize := extcodesize(_contract)\\n }\\n if (contractSize == 0) {\\n revert ContractHasNoCode();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x10bde4c13cc3d3c4aec15b793565bfe05b5f770eafeb839bfd159dbe6351dc62\",\"license\":\"MIT\"},\"contracts/parallelizer/libraries/LibManager.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IManager } from \\\"contracts/interfaces/IManager.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Managed collateral assets may be handled through external smart contracts or directly through this library\\n/// @dev There is no implementation at this point for a managed collateral handled through this library, and\\n/// a new specific `ManagerType` would need to be added in this case\\n/// @dev This library is an authorized fork of Angle's `LibManager` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibManager.sol\\nlibrary LibManager {\\n /// @notice Checks to which address managed funds must be transferred\\n function transferRecipient(bytes memory config) internal view returns (address recipient) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n recipient = address(this);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (address));\\n }\\n\\n /// @notice Performs a transfer of `token` for a collateral that is managed to a `to` address\\n /// @dev `token` may not be the actual collateral itself, as some collaterals have subcollaterals associated\\n /// with it\\n /// @dev Eventually pulls funds from strategies\\n function release(address token, address to, uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).release(token, to, amount);\\n }\\n\\n /// @notice Gets the balances of all the tokens controlled through `managerData`\\n /// @return balances An array of size `subCollaterals` with current balances of all subCollaterals\\n /// including the one corresponding to the `managerData` given\\n /// @return totalValue The value of all the `subCollaterals` in `collateral`\\n /// @dev `subCollaterals` must always have as first token (index 0) the collateral itself\\n function totalAssets(bytes memory config) internal view returns (uint256[] memory balances, uint256 totalValue) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).totalAssets();\\n }\\n\\n /// @notice Calls a hook if needed after new funds have been transfered to a manager\\n function invest(uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).invest(amount);\\n }\\n\\n /// @notice Returns available underlying tokens, for instance if liquidity is fully used and\\n /// not withdrawable the function will return 0\\n function maxAvailable(bytes memory config) internal view returns (uint256 available) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).maxAvailable();\\n }\\n\\n /// @notice Decodes the `managerData` associated to a collateral\\n function parseManagerConfig(bytes memory config) internal pure returns (ManagerType managerType, bytes memory data) {\\n (managerType, data) = abi.decode(config, (ManagerType, bytes));\\n }\\n}\\n\",\"keccak256\":\"0x18282c744bc34bd9ae937c0c49e909c9c4e50c15e69fb485aa68fc56e549d1a1\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibStorage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport { DiamondStorage, ImplementationStorage, ParallelizerStorage } from \\\"../Storage.sol\\\";\\n\\n/// @title LibStorage\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibStorage` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibStorage.sol\\nlibrary LibStorage {\\n /// @notice Returns the storage struct stored at the `DIAMOND_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic of the different facets used in the diamond proxy\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ds.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `TRANSMUTER_STORAGE_POSITION` slot\\n /// @dev This struct handles the particular logic of the Parallelizer system\\n function transmuterStorage() internal pure returns (ParallelizerStorage storage ts) {\\n bytes32 position = TRANSMUTER_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ts.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `IMPLEMENTATION_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic for making the contract easily usable on Etherscan\\n function implementationStorage() internal pure returns (ImplementationStorage storage ims) {\\n bytes32 position = IMPLEMENTATION_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ims.slot := position\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf8c333898ca14d3e8696c232f669a839dddbf705a609a1b0795ecc6b8f1b2d73\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ICbETH } from \\\"contracts/interfaces/external/coinbase/ICbETH.sol\\\";\\nimport { ISfrxETH } from \\\"contracts/interfaces/external/frax/ISfrxETH.sol\\\";\\nimport { IStETH } from \\\"contracts/interfaces/external/lido/IStETH.sol\\\";\\nimport { IRETH } from \\\"contracts/interfaces/external/rocketPool/IRETH.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STORAGE SLOTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n/// @dev Storage position of `DiamondStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.diamond.storage\\\") - 1`\\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\\n\\n/// @dev Storage position of `ParallelizerStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.parallelizer.storage\\\") - 1`\\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\\n\\n/// @dev Storage position of `ImplementationStorage` structure\\n/// @dev Equals `keccak256(\\\"eip1967.proxy.implementation\\\") - 1`\\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MATHS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nuint256 constant BASE_6 = 1e6;\\nuint256 constant BASE_8 = 1e8;\\nuint256 constant BASE_9 = 1e9;\\nuint256 constant BASE_12 = 1e12;\\nuint256 constant BPS = 1e14;\\nuint256 constant BASE_18 = 1e18;\\nuint256 constant HALF_BASE_27 = 1e27 / 2;\\nuint256 constant BASE_27 = 1e27;\\nuint256 constant BASE_36 = 1e36;\\nuint256 constant MAX_BURN_FEE = 999_000_000;\\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// The values being non-zero value makes deployment a bit more expensive,\\n// but in exchange the refund on every call to nonReentrant will be lower in\\n// amount. Since refunds are capped to a percentage of the total\\n// transaction's gas, it is best to keep them low in cases like this one, to\\n// increase the likelihood of the full refund coming into effect.\\nuint8 constant NOT_ENTERED = 1;\\nuint8 constant ENTERED = 2;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// Role IDs for the AccessManager\\nuint64 constant GOVERNOR_ROLE = 10;\\nuint64 constant GUARDIAN_ROLE = 20;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n COMMON ADDRESSES \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\\n\",\"keccak256\":\"0x3306bdd0d4e4f364e0d35893a7ffb59c8eb9e94a5bd861f58b8d7ba8a7b336e5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nerror AccessManagedUnauthorized(address caller);\\nerror AlreadyAdded();\\nerror CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);\\nerror CannotAddSelectorsToZeroAddress(bytes4[] _selectors);\\nerror CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);\\nerror CannotRemoveImmutableFunction(bytes4 _selector);\\nerror CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);\\nerror CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);\\nerror CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);\\nerror CannotReplaceImmutableFunction(bytes4 _selector);\\nerror ContractHasNoCode();\\nerror CollateralBacked();\\nerror FunctionNotFound(bytes4 _functionSelector);\\nerror IncorrectFacetCutAction(uint8 _action);\\nerror InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);\\nerror InvalidChainlinkRate();\\nerror InvalidLengths();\\nerror InvalidNegativeFees();\\nerror InvalidOracleType();\\nerror InvalidParam();\\nerror InvalidParams();\\nerror InvalidRate();\\nerror InvalidSwap();\\nerror InvalidTokens();\\nerror InvalidAccessManager();\\nerror ManagerHasAssets();\\nerror NoSelectorsProvidedForFacetForCut(address _facetAddress);\\nerror NotAllowed();\\nerror NotCollateral();\\nerror NotGovernor();\\nerror NotGuardian();\\nerror NotTrusted();\\nerror NotTrustedOrGuardian();\\nerror NotWhitelisted();\\nerror OdosSwapFailed();\\nerror OracleUpdateFailed();\\nerror Paused();\\nerror ReentrantCall();\\nerror RemoveFacetAddressMustBeZeroAddress(address _facetAddress);\\nerror TooBigAmountIn();\\nerror TooLate();\\nerror TooSmallAmountOut();\\nerror ZeroAddress();\\nerror ZeroAmount();\\nerror SwapError();\\nerror SlippageTooHigh();\\nerror InsufficientFunds();\\n\",\"keccak256\":\"0x1e2f6812ef78e948e5155d32213b52afff8c0ba5463d18bee10694efbf886130\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x60808060405234601557610c75908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c6305b4193414610024575f80fd5b346104275760403660031901126104275760243567ffffffffffffffff8111610427573660238201121561042757806004013561006081610778565b9061006e6040519283610742565b8082526020820192366024838301011161042757815f92602460209301863783010152600260ff7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755460a81c161461071a57750200000000000000000000000000000000000000000060ff60a81b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755561012d36336108cf565b15806106e7575b6106bf5760405190818260207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775492838152017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f20925f5b81811061069d5750506101a692500383610742565b8151926101b284610794565b916101c06040519384610742565b848352601f196101cf86610794565b013660208501375f5b85811061061757505f91829151908273cf5540fffcdc3d510b18bfca6d2b9987b07725595af16102066107d4565b90156105e2576020815191818082019384920101031261042757519260043584106105ba575f915f935f5b838110610482575050505015610473576001600160a01b0316805f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2060ff8154166102ed575b602083750100000000000000000000000000000000000000000060ff60a81b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7555604051908152f35b6008019060205f61030561030085610803565b610b6b565b6040516001600160a01b03848201927fa9059cbb00000000000000000000000000000000000000000000000000000000845216602482015286604482015260448152610352606482610742565b519082855af11561041c575f513d61046a5750803b155b61043f575061037a61037f91610803565b610bbd565b90600181101561042b5715610395575b8061027f565b6020818051810103126104275760200151906001600160a01b03821680920361042757813b15610427575f80926024604051809581937f2afcf4800000000000000000000000000000000000000000000000000000000083528660048401525af191821561041c5760209261040c575b509061038f565b5f61041691610742565b5f610405565b6040513d5f823e3d90fd5b5f80fd5b634e487b7160e01b5f52602160045260245ffd5b7f5274afe7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b60011415610369565b631115766760e01b5f5260045ffd5b602460206001600160a01b0361049884866107ac565b5116604051928380926370a0823160e01b82523060048301525afa90811561041c575f91610589575b506104cc82856107ac565b518110156104e357631115766760e01b5f5260045ffd5b6104ed82856107ac565b5181116104fe575b50600101610231565b945094506001936001600160a01b0361051787846107ac565b5116956001600160a01b0361052c82856107ac565b511661053882866107ac565b518303928311610575577fbe1da12e92b73d3ecd35edcc32270e8ffaa4ee9fe30f671989b3d2e88a2c2ea26020600194604051908152a2906104f5565b634e487b7160e01b5f52601160045260245ffd5b90506020813d82116105b2575b816105a360209383610742565b8101031261042757515f6104c1565b3d9150610596565b7fa1aabbe1000000000000000000000000000000000000000000000000000000005f5260045ffd5b80519081610612577f45d4013e000000000000000000000000000000000000000000000000000000005f5260045ffd5b602001fd5b8060206001600160a01b0361062e602494896107ac565b5116604051938480926370a0823160e01b82523060048301525afa801561041c575f9061066b575b6001925061066482876107ac565b52016101d8565b506020823d8211610695575b8161068460209383610742565b810103126104275760019151610656565b3d9150610677565b84546001600160a01b0316835260019485019487945060209093019201610191565b7fc22a648e000000000000000000000000000000000000000000000000000000005f5260045ffd5b50335f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7c60205260405f205415610134565b7f37ed32e8000000000000000000000000000000000000000000000000000000005f5260045ffd5b90601f8019910116810190811067ffffffffffffffff82111761076457604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff811161076457601f01601f191660200190565b67ffffffffffffffff81116107645760051b60200190565b80518210156107c05760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b3d156107fe573d906107e582610778565b916107f36040519384610742565b82523d5f602084013e565b606090565b90604051915f8154908160011c92600183169283156108c5575b6020851084146108b157848752869390811561088f575060011461084b575b5061084992500383610742565b565b90505f9291925260205f20905f915b818310610873575050906020610849928201015f61083c565b602091935080600191548385890101520191019091849261085a565b90506020925061084994915060ff191682840152151560051b8201015f61083c565b634e487b7160e01b5f52602260045260245ffd5b93607f169361081d565b6001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54169180600411610427575f5f905f80604051956001600160a01b0360208801917fb700961300000000000000000000000000000000000000000000000000000000835216968760248201523060448201527fffffffff00000000000000000000000000000000000000000000000000000000833516606482015260648152610982608482610742565b5190885afa61098f6107d4565b90610af2575b50156109a5575b50505050600190565b63ffffffff1615610aeb5776010000000000000000000000000000000000000000000060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7555823b15610427576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af1801561041c57610adb575b5060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7554167f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75555f80808061099c565b5f610ae591610742565b5f610a86565b5050505f90565b80519092909160408310610b345750508160409181010312610427576040610b1c60208301610bb0565b91015163ffffffff8116810361042757905b5f610995565b916020819492941015610b49575b5050610b2e565b8192509060209181010312610427576020610b649101610bb0565b5f80610b42565b610b7490610bbd565b309291600181101561042b5715610b885750565b90915060208180518101031261042757602001516001600160a01b0381168091036104275790565b5190811515820361042757565b80518101604082602083019203126104275760208201519160018310156104275760408101519067ffffffffffffffff8211610427570181603f8201121561042757602081015190610c0e82610778565b92610c1c6040519485610742565b8284526040828401011161042757815f926040602093018386015e83010152909156fea264697066735822122074e2d6efa3d43e9861a17fc058c7827109cbed1e843c1d03961d7f44ec71e16064736f6c634300081c0033", + "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f3560e01c6305b4193414610024575f80fd5b346104275760403660031901126104275760243567ffffffffffffffff8111610427573660238201121561042757806004013561006081610778565b9061006e6040519283610742565b8082526020820192366024838301011161042757815f92602460209301863783010152600260ff7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755460a81c161461071a57750200000000000000000000000000000000000000000060ff60a81b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755561012d36336108cf565b15806106e7575b6106bf5760405190818260207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775492838152017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f20925f5b81811061069d5750506101a692500383610742565b8151926101b284610794565b916101c06040519384610742565b848352601f196101cf86610794565b013660208501375f5b85811061061757505f91829151908273cf5540fffcdc3d510b18bfca6d2b9987b07725595af16102066107d4565b90156105e2576020815191818082019384920101031261042757519260043584106105ba575f915f935f5b838110610482575050505015610473576001600160a01b0316805f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2060ff8154166102ed575b602083750100000000000000000000000000000000000000000060ff60a81b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7555604051908152f35b6008019060205f61030561030085610803565b610b6b565b6040516001600160a01b03848201927fa9059cbb00000000000000000000000000000000000000000000000000000000845216602482015286604482015260448152610352606482610742565b519082855af11561041c575f513d61046a5750803b155b61043f575061037a61037f91610803565b610bbd565b90600181101561042b5715610395575b8061027f565b6020818051810103126104275760200151906001600160a01b03821680920361042757813b15610427575f80926024604051809581937f2afcf4800000000000000000000000000000000000000000000000000000000083528660048401525af191821561041c5760209261040c575b509061038f565b5f61041691610742565b5f610405565b6040513d5f823e3d90fd5b5f80fd5b634e487b7160e01b5f52602160045260245ffd5b7f5274afe7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b60011415610369565b631115766760e01b5f5260045ffd5b602460206001600160a01b0361049884866107ac565b5116604051928380926370a0823160e01b82523060048301525afa90811561041c575f91610589575b506104cc82856107ac565b518110156104e357631115766760e01b5f5260045ffd5b6104ed82856107ac565b5181116104fe575b50600101610231565b945094506001936001600160a01b0361051787846107ac565b5116956001600160a01b0361052c82856107ac565b511661053882866107ac565b518303928311610575577fbe1da12e92b73d3ecd35edcc32270e8ffaa4ee9fe30f671989b3d2e88a2c2ea26020600194604051908152a2906104f5565b634e487b7160e01b5f52601160045260245ffd5b90506020813d82116105b2575b816105a360209383610742565b8101031261042757515f6104c1565b3d9150610596565b7fa1aabbe1000000000000000000000000000000000000000000000000000000005f5260045ffd5b80519081610612577f45d4013e000000000000000000000000000000000000000000000000000000005f5260045ffd5b602001fd5b8060206001600160a01b0361062e602494896107ac565b5116604051938480926370a0823160e01b82523060048301525afa801561041c575f9061066b575b6001925061066482876107ac565b52016101d8565b506020823d8211610695575b8161068460209383610742565b810103126104275760019151610656565b3d9150610677565b84546001600160a01b0316835260019485019487945060209093019201610191565b7fc22a648e000000000000000000000000000000000000000000000000000000005f5260045ffd5b50335f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7c60205260405f205415610134565b7f37ed32e8000000000000000000000000000000000000000000000000000000005f5260045ffd5b90601f8019910116810190811067ffffffffffffffff82111761076457604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff811161076457601f01601f191660200190565b67ffffffffffffffff81116107645760051b60200190565b80518210156107c05760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b3d156107fe573d906107e582610778565b916107f36040519384610742565b82523d5f602084013e565b606090565b90604051915f8154908160011c92600183169283156108c5575b6020851084146108b157848752869390811561088f575060011461084b575b5061084992500383610742565b565b90505f9291925260205f20905f915b818310610873575050906020610849928201015f61083c565b602091935080600191548385890101520191019091849261085a565b90506020925061084994915060ff191682840152151560051b8201015f61083c565b634e487b7160e01b5f52602260045260245ffd5b93607f169361081d565b6001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54169180600411610427575f5f905f80604051956001600160a01b0360208801917fb700961300000000000000000000000000000000000000000000000000000000835216968760248201523060448201527fffffffff00000000000000000000000000000000000000000000000000000000833516606482015260648152610982608482610742565b5190885afa61098f6107d4565b90610af2575b50156109a5575b50505050600190565b63ffffffff1615610aeb5776010000000000000000000000000000000000000000000060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7555823b15610427576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af1801561041c57610adb575b5060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7554167f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75555f80808061099c565b5f610ae591610742565b5f610a86565b5050505f90565b80519092909160408310610b345750508160409181010312610427576040610b1c60208301610bb0565b91015163ffffffff8116810361042757905b5f610995565b916020819492941015610b49575b5050610b2e565b8192509060209181010312610427576020610b649101610bb0565b5f80610b42565b610b7490610bbd565b309291600181101561042b5715610b885750565b90915060208180518101031261042757602001516001600160a01b0381168091036104275790565b5190811515820361042757565b80518101604082602083019203126104275760208201519160018310156104275760408101519067ffffffffffffffff8211610427570181603f8201121561042757602081015190610c0e82610778565b92610c1c6040519485610742565b8284526040828401011161042757815f926040602093018386015e83010152909156fea264697066735822122074e2d6efa3d43e9861a17fc058c7827109cbed1e843c1d03961d7f44ec71e16064736f6c634300081c0033", + "devdoc": { + "author": "Cooper Labs", + "custom:contact": "security@cooperlabs.xyz", + "details": "This contract is an authorized fork of Angle's `RewardHandler` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/RewardHandler.sol", + "errors": { + "SafeERC20FailedOperation(address)": [ + { + "details": "An operation with an ERC-20 token failed." + } + ] + }, + "kind": "dev", + "methods": { + "sellRewards(uint256,bytes)": { + "details": "It is impossible to sell a token that is a collateral through this functionTrusted sellers and governance only may call this functionOnly governance can set which tokens can be swapped through this function by passing a prior approval transaction to Odos router for the token to be swapped" + } + }, + "title": "RewardHandler", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "sellRewards(uint256,bytes)": { + "notice": "IRewardHandler" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/SavingsNameable.json b/deployments/sepolia/SavingsNameable.json new file mode 100644 index 0000000..3c8d96b --- /dev/null +++ b/deployments/sepolia/SavingsNameable.json @@ -0,0 +1,1762 @@ +{ + "address": "0xeB197439D1425F3129F01F7763EC511DF2489095", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AccessManagedInvalidAuthority", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delay", + "type": "uint32" + } + ], + "name": "AccessManagedRequiredDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC20InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC20InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC20InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "ERC20InvalidSpender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxMint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxRedeem", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxWithdraw", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRate", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "NotTrusted", + "type": "error" + }, + { + "inputs": [], + "name": "Paused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "interest", + "type": "uint256" + } + ], + "name": "Accrued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxRate", + "type": "uint256" + } + ], + "name": "MaxRateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newRate", + "type": "uint256" + } + ], + "name": "RateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "pauseStatus", + "type": "uint128" + } + ], + "name": "ToggledPause", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "trustedAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "trustedStatus", + "type": "uint256" + } + ], + "name": "ToggledTrusted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "asset", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "authority", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_totalAssets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "exp", + "type": "uint256" + } + ], + "name": "computeUpdatedAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "convertToAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "convertToShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "estimatedAPR", + "outputs": [ + { + "internalType": "uint256", + "name": "apr", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_authority", + "type": "address" + }, + { + "internalType": "contract IERC20Metadata", + "name": "asset_", + "type": "address" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "uint256", + "name": "divizer", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isConsumingScheduledOp", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isTrustedUpdater", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastUpdate", + "outputs": [ + { + "internalType": "uint40", + "name": "", + "type": "uint40" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxMint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "maxRedeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "maxWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "previewDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "previewMint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "previewRedeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "previewWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rate", + "outputs": [ + { + "internalType": "uint208", + "name": "", + "type": "uint208" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "redeem", + "outputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAuthority", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMaxRate", + "type": "uint256" + } + ], + "name": "setMaxRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newName", + "type": "string" + }, + { + "internalType": "string", + "name": "newSymbol", + "type": "string" + } + ], + "name": "setNameAndSymbol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint208", + "name": "newRate", + "type": "uint208" + } + ], + "name": "setRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "togglePause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "trustedAddress", + "type": "address" + } + ], + "name": "toggleTrusted", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xb68ac1d2f34d6e8f2b743e8949b955ec0e739b40fa2a4fef746d1481657bb7c0", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0xeB197439D1425F3129F01F7763EC511DF2489095", + "transactionIndex": 119, + "gasUsed": "2783652", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000800000000000000000000000080000000000000020000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5428f51d7d430e2aec1d3459d43c2dc4e96f8c78ac4e90516e17af9272dfc928", + "transactionHash": "0xb68ac1d2f34d6e8f2b743e8949b955ec0e739b40fa2a4fef746d1481657bb7c0", + "logs": [ + { + "transactionIndex": 119, + "blockNumber": 8411132, + "transactionHash": "0xb68ac1d2f34d6e8f2b743e8949b955ec0e739b40fa2a4fef746d1481657bb7c0", + "address": "0xeB197439D1425F3129F01F7763EC511DF2489095", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 411, + "blockHash": "0x5428f51d7d430e2aec1d3459d43c2dc4e96f8c78ac4e90516e17af9272dfc928" + } + ], + "blockNumber": 8411132, + "cumulativeGasUsed": "21315141", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9d44d918681c9ad36f866ebee034a3d1", + "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"authority\",\"type\":\"address\"}],\"name\":\"AccessManagedInvalidAuthority\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"delay\",\"type\":\"uint32\"}],\"name\":\"AccessManagedRequiredDelay\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AccessManagedUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"ERC1967InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC1967NonPayable\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSpender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxRedeem\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxWithdraw\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotTrusted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Paused\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"interest\",\"type\":\"uint256\"}],\"name\":\"Accrued\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"authority\",\"type\":\"address\"}],\"name\":\"AuthorityUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMaxRate\",\"type\":\"uint256\"}],\"name\":\"MaxRateUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newRate\",\"type\":\"uint256\"}],\"name\":\"RateUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"pauseStatus\",\"type\":\"uint128\"}],\"name\":\"ToggledPause\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"trustedAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"trustedStatus\",\"type\":\"uint256\"}],\"name\":\"ToggledTrusted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"UPGRADE_INTERFACE_VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"asset\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"authority\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalAssets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"exp\",\"type\":\"uint256\"}],\"name\":\"computeUpdatedAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"convertToAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"convertToShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"estimatedAPR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"apr\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_authority\",\"type\":\"address\"},{\"internalType\":\"contract IERC20Metadata\",\"name\":\"asset_\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"divizer\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isConsumingScheduledOp\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isTrustedUpdater\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastUpdate\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"maxDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"maxMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rate\",\"outputs\":[{\"internalType\":\"uint208\",\"name\":\"\",\"type\":\"uint208\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"redeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAuthority\",\"type\":\"address\"}],\"name\":\"setAuthority\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newMaxRate\",\"type\":\"uint256\"}],\"name\":\"setMaxRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"newName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"newSymbol\",\"type\":\"string\"}],\"name\":\"setNameAndSymbol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint208\",\"name\":\"newRate\",\"type\":\"uint208\"}],\"name\":\"setRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"togglePause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"trustedAddress\",\"type\":\"address\"}],\"name\":\"toggleTrusted\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Cooper Labs\",\"custom:contact\":\"security@cooperlabs.xyz\",\"details\":\"This contract is an authorized fork of Angle's SavingsNameable contract: https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/savings/nameable/SavingsNameable.sol\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"ERC1967InvalidImplementation(address)\":[{\"details\":\"The `implementation` of the proxy is invalid.\"}],\"ERC1967NonPayable()\":[{\"details\":\"An upgrade function sees `msg.value > 0` that may be lost.\"}],\"ERC20InsufficientAllowance(address,uint256,uint256)\":[{\"details\":\"Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\",\"params\":{\"allowance\":\"Amount of tokens a `spender` is allowed to operate with.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC20InsufficientBalance(address,uint256,uint256)\":[{\"details\":\"Indicates an error related to the current `balance` of a `sender`. Used in transfers.\",\"params\":{\"balance\":\"Current balance for the interacting account.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC20InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC20InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidSpender(address)\":[{\"details\":\"Indicates a failure with the `spender` to be approved. Used in approvals.\",\"params\":{\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC4626ExceededMaxDeposit(address,uint256,uint256)\":[{\"details\":\"Attempted to deposit more assets than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxMint(address,uint256,uint256)\":[{\"details\":\"Attempted to mint more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxRedeem(address,uint256,uint256)\":[{\"details\":\"Attempted to redeem more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxWithdraw(address,uint256,uint256)\":[{\"details\":\"Attempted to withdraw more assets than the max amount for `receiver`.\"}],\"FailedCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC-20 token failed.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"AuthorityUpdated(address)\":{\"details\":\"Authority that manages this contract was updated.\"},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `value` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"asset()\":{\"details\":\"See {IERC4626-asset}. \"},\"authority()\":{\"details\":\"Returns the current authority.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"convertToAssets(uint256)\":{\"details\":\"See {IERC4626-convertToAssets}. \"},\"convertToShares(uint256)\":{\"details\":\"See {IERC4626-convertToShares}. \"},\"decimals()\":{\"details\":\"Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals. See {IERC20Metadata-decimals}.\"},\"deposit(uint256,address)\":{\"details\":\"See {IERC4626-deposit}. \"},\"initialize(address,address,string,string,uint256)\":{\"details\":\"A first deposit is done at initialization to protect for the classical issue of ERC4626 contracts where the the first user of the contract tries to steal everyone else's tokens\",\"params\":{\"_authority\":\"Reference to the `AccessManagerContract` contract\",\"divizer\":\"Quantifies the first initial deposit (should be typically 1 for tokens like agEUR)\",\"name_\":\"Name of the savings contract\",\"symbol_\":\"Symbol of the savings contract\"}},\"isConsumingScheduledOp()\":{\"details\":\"Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs attacker controlled calls.\"},\"maxDeposit(address)\":{\"details\":\"See {IERC4626-maxDeposit}. \"},\"maxMint(address)\":{\"details\":\"See {IERC4626-maxMint}. \"},\"maxRedeem(address)\":{\"details\":\"See {IERC4626-maxRedeem}. \"},\"maxWithdraw(address)\":{\"details\":\"See {IERC4626-maxWithdraw}. \"},\"mint(uint256,address)\":{\"details\":\"See {IERC4626-mint}. \"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"previewDeposit(uint256)\":{\"details\":\"See {IERC4626-previewDeposit}. \"},\"previewMint(uint256)\":{\"details\":\"See {IERC4626-previewMint}. \"},\"previewRedeem(uint256)\":{\"details\":\"See {IERC4626-previewRedeem}. \"},\"previewWithdraw(uint256)\":{\"details\":\"See {IERC4626-previewWithdraw}. \"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"redeem(uint256,address,address)\":{\"details\":\"See {IERC4626-redeem}. \"},\"setAuthority(address)\":{\"details\":\"Transfers control to a new authority. The caller must be the current authority.\"},\"setRate(uint208)\":{\"details\":\"Any `rate` can be set by the guardian or by a trusted address provided that it is inferior to the `maxRate` settable by a governor address\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalAssets()\":{\"details\":\"See {IERC4626-totalAssets}. \"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Skips emitting an {Approval} event indicating an allowance update. This is not required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve]. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`.\"},\"upgradeToAndCall(address,bytes)\":{\"custom:oz-upgrades-unsafe-allow-reachable\":\"delegatecall\",\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"withdraw(uint256,address,address)\":{\"details\":\"See {IERC4626-withdraw}. \"}},\"title\":\"SavingsNameable\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"computeUpdatedAssets(uint256,uint256)\":{\"notice\":\"Wrapper on top of the `computeUpdatedAssets` function\"},\"estimatedAPR()\":{\"notice\":\"Provides an estimated Annual Percentage Rate for base depositors on this contract\"},\"initialize(address,address,string,string,uint256)\":{\"notice\":\"Initializes the contract\"},\"isTrustedUpdater(address)\":{\"notice\":\"Checks whether the address is trusted to set the rate\"},\"lastUpdate()\":{\"notice\":\"Last time rewards were accrued\"},\"maxRate()\":{\"notice\":\"Maximum inflation rate\"},\"paused()\":{\"notice\":\"Whether the contract is paused or not\"},\"rate()\":{\"notice\":\"Inflation rate (per second) in BASE_27\"},\"setMaxRate(uint256)\":{\"notice\":\"Updates the maximum rate settable\"},\"setNameAndSymbol(string,string)\":{\"notice\":\"Updates the name and symbol of the token\"},\"setRate(uint208)\":{\"notice\":\"Updates the inflation rate for depositing `asset` in this contract\"},\"togglePause()\":{\"notice\":\"Pauses the contract\"},\"toggleTrusted(address)\":{\"notice\":\"Toggles an address\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/savings/nameable/SavingsNameable.sol\":\"SavingsNameable\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error InvalidInitialization();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\\n * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\\n * production.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n // Cache values to avoid duplicated sloads\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n\\n // Allowed calls:\\n // - initialSetup: the contract is not in the initializing state and no previous version was\\n // initialized\\n // - construction: the contract is initialized at version 1 (no reininitialization) and the\\n // current contract is just being deployed\\n bool initialSetup = initialized == 0 && isTopLevelCall;\\n bool construction = initialized == 1 && address(this).code.length == 0;\\n\\n if (!initialSetup && !construction) {\\n revert InvalidInitialization();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert InvalidInitialization();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert InvalidInitialization();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0x631188737069917d2f909d29ce62c4d48611d326686ba6683e26b72a23bfac0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.2.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.22;\\n\\nimport {IERC1822Proxiable} from \\\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\\\";\\nimport {ERC1967Utils} from \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\\\";\\nimport {Initializable} from \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\\n * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\\n * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\\n * If the getter returns `\\\"5.0.0\\\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\\n * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\\n * during an upgrade.\\n */\\n string public constant UPGRADE_INTERFACE_VERSION = \\\"5.0.0\\\";\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n _checkProxy();\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n _checkNotDelegated();\\n _;\\n }\\n\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /**\\n * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual notDelegated returns (bytes32) {\\n return ERC1967Utils.IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n *\\n * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data);\\n }\\n\\n /**\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\\n * See {_onlyProxy}.\\n */\\n function _checkProxy() internal view virtual {\\n if (\\n address(this) == __self || // Must be called through delegatecall\\n ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\\n ) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n }\\n\\n /**\\n * @dev Reverts if the execution is performed via delegatecall.\\n * See {notDelegated}.\\n */\\n function _checkNotDelegated() internal view virtual {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\\n *\\n * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\\n * is expected to be the implementation slot in ERC-1967.\\n *\\n * Emits an {IERC1967-Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n ERC1967Utils.upgradeToAndCall(newImplementation, data);\\n } catch {\\n // The implementation is not UUPS\\n revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd861907d1168dcaec2a7846edbaed12feb8bad2d6781dba987be01374f90b495\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {ContextUpgradeable} from \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport {IERC20Errors} from \\\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\\\";\\nimport {Initializable} from \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC-20\\n * applications.\\n */\\nabstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {\\n /// @custom:storage-location erc7201:openzeppelin.storage.ERC20\\n struct ERC20Storage {\\n mapping(address account => uint256) _balances;\\n\\n mapping(address account => mapping(address spender => uint256)) _allowances;\\n\\n uint256 _totalSupply;\\n\\n string _name;\\n string _symbol;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.ERC20\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;\\n\\n function _getERC20Storage() private pure returns (ERC20Storage storage $) {\\n assembly {\\n $.slot := ERC20StorageLocation\\n }\\n }\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\\n ERC20Storage storage $ = _getERC20Storage();\\n $._name = name_;\\n $._symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual returns (string memory) {\\n ERC20Storage storage $ = _getERC20Storage();\\n return $._name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual returns (string memory) {\\n ERC20Storage storage $ = _getERC20Storage();\\n return $._symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n ERC20Storage storage $ = _getERC20Storage();\\n return $._totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual returns (uint256) {\\n ERC20Storage storage $ = _getERC20Storage();\\n return $._balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `value`.\\n */\\n function transfer(address to, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual returns (uint256) {\\n ERC20Storage storage $ = _getERC20Storage();\\n return $._allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Skips emitting an {Approval} event indicating an allowance update. This is not\\n * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `value`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `value`.\\n */\\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, value);\\n _transfer(from, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _transfer(address from, address to, uint256 value) internal {\\n if (from == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n if (to == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(from, to, value);\\n }\\n\\n /**\\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\\n * this function.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _update(address from, address to, uint256 value) internal virtual {\\n ERC20Storage storage $ = _getERC20Storage();\\n if (from == address(0)) {\\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\\n $._totalSupply += value;\\n } else {\\n uint256 fromBalance = $._balances[from];\\n if (fromBalance < value) {\\n revert ERC20InsufficientBalance(from, fromBalance, value);\\n }\\n unchecked {\\n // Overflow not possible: value <= fromBalance <= totalSupply.\\n $._balances[from] = fromBalance - value;\\n }\\n }\\n\\n if (to == address(0)) {\\n unchecked {\\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\\n $._totalSupply -= value;\\n }\\n } else {\\n unchecked {\\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\\n $._balances[to] += value;\\n }\\n }\\n\\n emit Transfer(from, to, value);\\n }\\n\\n /**\\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\\n * Relies on the `_update` mechanism\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _mint(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(address(0), account, value);\\n }\\n\\n /**\\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\\n * Relies on the `_update` mechanism.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead\\n */\\n function _burn(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n _update(account, address(0), value);\\n }\\n\\n /**\\n * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address owner, address spender, uint256 value) internal {\\n _approve(owner, spender, value, true);\\n }\\n\\n /**\\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\\n *\\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\\n * `Approval` event during `transferFrom` operations.\\n *\\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\\n * true using the following override:\\n *\\n * ```solidity\\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\\n * super._approve(owner, spender, value, true);\\n * }\\n * ```\\n *\\n * Requirements are the same as {_approve}.\\n */\\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\\n ERC20Storage storage $ = _getERC20Storage();\\n if (owner == address(0)) {\\n revert ERC20InvalidApprover(address(0));\\n }\\n if (spender == address(0)) {\\n revert ERC20InvalidSpender(address(0));\\n }\\n $._allowances[owner][spender] = value;\\n if (emitEvent) {\\n emit Approval(owner, spender, value);\\n }\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `value`.\\n *\\n * Does not update the allowance value in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Does not emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance < type(uint256).max) {\\n if (currentAllowance < value) {\\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\\n }\\n unchecked {\\n _approve(owner, spender, currentAllowance - value, false);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5c54228bbb2f1f8616179c51bdb90b7960f4a3414c390ad5c6ead6763eb55a59\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/ERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {ERC20Upgradeable} from \\\"../ERC20Upgradeable.sol\\\";\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {IERC4626} from \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\nimport {Math} from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport {Initializable} from \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC-4626 \\\"Tokenized Vault Standard\\\" as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\\n *\\n * This extension allows the minting and burning of \\\"shares\\\" (represented using the ERC-20 inheritance) in exchange for\\n * underlying \\\"assets\\\" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends\\n * the ERC-20 standard. Any additional extensions included along it would affect the \\\"shares\\\" token represented by this\\n * contract and not the \\\"assets\\\" token which is an independent contract.\\n *\\n * [CAUTION]\\n * ====\\n * In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning\\n * with a \\\"donation\\\" to the vault that inflates the price of a share. This is variously known as a donation or inflation\\n * attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial\\n * deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may\\n * similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by\\n * verifying the amount received is as expected, using a wrapper that performs these checks such as\\n * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].\\n *\\n * Since v4.9, this implementation introduces configurable virtual assets and shares to help developers mitigate that risk.\\n * The `_decimalsOffset()` corresponds to an offset in the decimal representation between the underlying asset's decimals\\n * and the vault decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which\\n * itself determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default\\n * offset (0) makes it non-profitable even if an attacker is able to capture value from multiple user deposits, as a result\\n * of the value being captured by the virtual shares (out of the attacker's donation) matching the attacker's expected gains.\\n * With a larger offset, the attack becomes orders of magnitude more expensive than it is profitable. More details about the\\n * underlying math can be found xref:erc4626.adoc#inflation-attack[here].\\n *\\n * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued\\n * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets\\n * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience\\n * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the\\n * `_convertToShares` and `_convertToAssets` functions.\\n *\\n * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].\\n * ====\\n */\\nabstract contract ERC4626Upgradeable is Initializable, ERC20Upgradeable, IERC4626 {\\n using Math for uint256;\\n\\n /// @custom:storage-location erc7201:openzeppelin.storage.ERC4626\\n struct ERC4626Storage {\\n IERC20 _asset;\\n uint8 _underlyingDecimals;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.ERC4626\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant ERC4626StorageLocation = 0x0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00;\\n\\n function _getERC4626Storage() private pure returns (ERC4626Storage storage $) {\\n assembly {\\n $.slot := ERC4626StorageLocation\\n }\\n }\\n\\n /**\\n * @dev Attempted to deposit more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to mint more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Attempted to withdraw more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to redeem more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC-20 or ERC-777).\\n */\\n function __ERC4626_init(IERC20 asset_) internal onlyInitializing {\\n __ERC4626_init_unchained(asset_);\\n }\\n\\n function __ERC4626_init_unchained(IERC20 asset_) internal onlyInitializing {\\n ERC4626Storage storage $ = _getERC4626Storage();\\n (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);\\n $._underlyingDecimals = success ? assetDecimals : 18;\\n $._asset = asset_;\\n }\\n\\n /**\\n * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.\\n */\\n function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool ok, uint8 assetDecimals) {\\n (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(\\n abi.encodeCall(IERC20Metadata.decimals, ())\\n );\\n if (success && encodedDecimals.length >= 32) {\\n uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));\\n if (returnedDecimals <= type(uint8).max) {\\n return (true, uint8(returnedDecimals));\\n }\\n }\\n return (false, 0);\\n }\\n\\n /**\\n * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This\\n * \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the\\n * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.\\n *\\n * See {IERC20Metadata-decimals}.\\n */\\n function decimals() public view virtual override(IERC20Metadata, ERC20Upgradeable) returns (uint8) {\\n ERC4626Storage storage $ = _getERC4626Storage();\\n return $._underlyingDecimals + _decimalsOffset();\\n }\\n\\n /** @dev See {IERC4626-asset}. */\\n function asset() public view virtual returns (address) {\\n ERC4626Storage storage $ = _getERC4626Storage();\\n return address($._asset);\\n }\\n\\n /** @dev See {IERC4626-totalAssets}. */\\n function totalAssets() public view virtual returns (uint256) {\\n ERC4626Storage storage $ = _getERC4626Storage();\\n return $._asset.balanceOf(address(this));\\n }\\n\\n /** @dev See {IERC4626-convertToShares}. */\\n function convertToShares(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-convertToAssets}. */\\n function convertToAssets(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxDeposit}. */\\n function maxDeposit(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxMint}. */\\n function maxMint(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxWithdraw}. */\\n function maxWithdraw(address owner) public view virtual returns (uint256) {\\n return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxRedeem}. */\\n function maxRedeem(address owner) public view virtual returns (uint256) {\\n return balanceOf(owner);\\n }\\n\\n /** @dev See {IERC4626-previewDeposit}. */\\n function previewDeposit(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-previewMint}. */\\n function previewMint(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewWithdraw}. */\\n function previewWithdraw(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewRedeem}. */\\n function previewRedeem(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-deposit}. */\\n function deposit(uint256 assets, address receiver) public virtual returns (uint256) {\\n uint256 maxAssets = maxDeposit(receiver);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);\\n }\\n\\n uint256 shares = previewDeposit(assets);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-mint}. */\\n function mint(uint256 shares, address receiver) public virtual returns (uint256) {\\n uint256 maxShares = maxMint(receiver);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxMint(receiver, shares, maxShares);\\n }\\n\\n uint256 assets = previewMint(shares);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return assets;\\n }\\n\\n /** @dev See {IERC4626-withdraw}. */\\n function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxAssets = maxWithdraw(owner);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);\\n }\\n\\n uint256 shares = previewWithdraw(assets);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-redeem}. */\\n function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxShares = maxRedeem(owner);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);\\n }\\n\\n uint256 assets = previewRedeem(shares);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return assets;\\n }\\n\\n /**\\n * @dev Internal conversion function (from assets to shares) with support for rounding direction.\\n */\\n function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);\\n }\\n\\n /**\\n * @dev Internal conversion function (from shares to assets) with support for rounding direction.\\n */\\n function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);\\n }\\n\\n /**\\n * @dev Deposit/mint common workflow.\\n */\\n function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {\\n ERC4626Storage storage $ = _getERC4626Storage();\\n // If _asset is ERC-777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the\\n // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the\\n // assets are transferred and before the shares are minted, which is a valid state.\\n // slither-disable-next-line reentrancy-no-eth\\n SafeERC20.safeTransferFrom($._asset, caller, address(this), assets);\\n _mint(receiver, shares);\\n\\n emit Deposit(caller, receiver, assets, shares);\\n }\\n\\n /**\\n * @dev Withdraw/redeem common workflow.\\n */\\n function _withdraw(\\n address caller,\\n address receiver,\\n address owner,\\n uint256 assets,\\n uint256 shares\\n ) internal virtual {\\n ERC4626Storage storage $ = _getERC4626Storage();\\n if (caller != owner) {\\n _spendAllowance(owner, caller, shares);\\n }\\n\\n // If _asset is ERC-777, `transfer` can trigger a reentrancy AFTER the transfer happens through the\\n // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the\\n // shares are burned and after the assets are transferred, which is a valid state.\\n _burn(owner, shares);\\n SafeERC20.safeTransfer($._asset, receiver, assets);\\n\\n emit Withdraw(caller, receiver, owner, assets, shares);\\n }\\n\\n function _decimalsOffset() internal view virtual returns (uint8) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa683afe511eb3a2e8a039c5aa18feda651c6de04b92e101532ac76661fdaad8f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\nimport {Initializable} from \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAuthority} from \\\"./IAuthority.sol\\\";\\n\\nlibrary AuthorityUtils {\\n /**\\n * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\\n * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\\n * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\\n */\\n function canCallWithDelay(\\n address authority,\\n address caller,\\n address target,\\n bytes4 selector\\n ) internal view returns (bool immediate, uint32 delay) {\\n (bool success, bytes memory data) = authority.staticcall(\\n abi.encodeCall(IAuthority.canCall, (caller, target, selector))\\n );\\n if (success) {\\n if (data.length >= 0x40) {\\n (immediate, delay) = abi.decode(data, (bool, uint32));\\n } else if (data.length >= 0x20) {\\n immediate = abi.decode(data, (bool));\\n }\\n }\\n return (immediate, delay);\\n }\\n}\\n\",\"keccak256\":\"0xb3875997b0d8705e29aa20fee88e1dfef93df438794ae1ad8ba2eb016a4dd4e4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAccessManaged.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAccessManaged.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IAccessManaged {\\n /**\\n * @dev Authority that manages this contract was updated.\\n */\\n event AuthorityUpdated(address authority);\\n\\n error AccessManagedUnauthorized(address caller);\\n error AccessManagedRequiredDelay(address caller, uint32 delay);\\n error AccessManagedInvalidAuthority(address authority);\\n\\n /**\\n * @dev Returns the current authority.\\n */\\n function authority() external view returns (address);\\n\\n /**\\n * @dev Transfers control to a new authority. The caller must be the current authority.\\n */\\n function setAuthority(address) external;\\n\\n /**\\n * @dev Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is\\n * being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs\\n * attacker controlled calls.\\n */\\n function isConsumingScheduledOp() external view returns (bytes4);\\n}\\n\",\"keccak256\":\"0xaba93d42cd70e1418782951132d97b31ddce5f50ad81090884b6d0e41caac9d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAccessManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\ninterface IAccessManager {\\n /**\\n * @dev A delayed operation was scheduled.\\n */\\n event OperationScheduled(\\n bytes32 indexed operationId,\\n uint32 indexed nonce,\\n uint48 schedule,\\n address caller,\\n address target,\\n bytes data\\n );\\n\\n /**\\n * @dev A scheduled operation was executed.\\n */\\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev A scheduled operation was canceled.\\n */\\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev Informational labelling for a roleId.\\n */\\n event RoleLabel(uint64 indexed roleId, string label);\\n\\n /**\\n * @dev Emitted when `account` is granted `roleId`.\\n *\\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\\n * otherwise it indicates the execution delay for this account and roleId is updated.\\n */\\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\\n\\n /**\\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\\n */\\n event RoleRevoked(uint64 indexed roleId, address indexed account);\\n\\n /**\\n * @dev Role acting as admin over a given `roleId` is updated.\\n */\\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\\n\\n /**\\n * @dev Role acting as guardian over a given `roleId` is updated.\\n */\\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\\n\\n /**\\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\\n */\\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\\n\\n /**\\n * @dev Target mode is updated (true = closed, false = open).\\n */\\n event TargetClosed(address indexed target, bool closed);\\n\\n /**\\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\\n */\\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\\n\\n /**\\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\\n */\\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\\n\\n error AccessManagerAlreadyScheduled(bytes32 operationId);\\n error AccessManagerNotScheduled(bytes32 operationId);\\n error AccessManagerNotReady(bytes32 operationId);\\n error AccessManagerExpired(bytes32 operationId);\\n error AccessManagerLockedRole(uint64 roleId);\\n error AccessManagerBadConfirmation();\\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\\n error AccessManagerUnauthorizedConsume(address target);\\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\\n\\n /**\\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\\n * & {execute} workflow.\\n *\\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\\n * for future execution.\\n *\\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\\n * the operation can be executed if and only if delay is greater than 0.\\n *\\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\\n *\\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\\n * {AccessManager} documentation.\\n */\\n function canCall(\\n address caller,\\n address target,\\n bytes4 selector\\n ) external view returns (bool allowed, uint32 delay);\\n\\n /**\\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\\n *\\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\\n * disabling any scheduling usage.\\n */\\n function expiration() external view returns (uint32);\\n\\n /**\\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\\n * can be increased without setback (and reset via {revokeRole} in the case event of an\\n * accidental increase). Defaults to 5 days.\\n */\\n function minSetback() external view returns (uint32);\\n\\n /**\\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\\n *\\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\\n */\\n function isTargetClosed(address target) external view returns (bool);\\n\\n /**\\n * @dev Get the role required to call a function.\\n */\\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\\n\\n /**\\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\\n */\\n function getTargetAdminDelay(address target) external view returns (uint32);\\n\\n /**\\n * @dev Get the id of the role that acts as an admin for the given role.\\n *\\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\\n * an operation that is restricted to this role.\\n */\\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role that acts as a guardian for a given role.\\n *\\n * The guardian permission allows canceling operations that have been scheduled under the role.\\n */\\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role current grant delay.\\n *\\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\\n */\\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\\n\\n /**\\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\\n * level.\\n *\\n * Returns:\\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\\n * [1] Current execution delay for the account.\\n * [2] Pending execution delay for the account.\\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\\n */\\n function getAccess(\\n uint64 roleId,\\n address account\\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\\n\\n /**\\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\\n * permission might be associated with an execution delay. {getAccess} can provide more details.\\n */\\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\\n\\n /**\\n * @dev Give a label to a role, for improved role discoverability by UIs.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleLabel} event.\\n */\\n function labelRole(uint64 roleId, string calldata label) external;\\n\\n /**\\n * @dev Add `account` to `roleId`, or change its execution delay.\\n *\\n * This gives the account the authorization to call any function that is restricted to this role. An optional\\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\\n *\\n * If the account has already been granted this role, the execution delay will be updated. This update is not\\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - granted role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleGranted} event.\\n */\\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\\n\\n /**\\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\\n * no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - revoked role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function revokeRole(uint64 roleId, address account) external;\\n\\n /**\\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\\n * the role this call has no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function renounceRole(uint64 roleId, address callerConfirmation) external;\\n\\n /**\\n * @dev Change admin role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleAdminChanged} event\\n */\\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\\n\\n /**\\n * @dev Change guardian role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGuardianChanged} event\\n */\\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\\n\\n /**\\n * @dev Update the delay for granting a `roleId`.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGrantDelayChanged} event.\\n */\\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetFunctionRoleUpdated} event per selector.\\n */\\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\\n\\n /**\\n * @dev Set the delay for changing the configuration of a given target contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetAdminDelayUpdated} event.\\n */\\n function setTargetAdminDelay(address target, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the closed flag for a contract.\\n *\\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetClosed} event.\\n */\\n function setTargetClosed(address target, bool closed) external;\\n\\n /**\\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\\n * operation is not yet scheduled, has expired, was executed, or was canceled.\\n */\\n function getSchedule(bytes32 id) external view returns (uint48);\\n\\n /**\\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\\n * been scheduled.\\n */\\n function getNonce(bytes32 id) external view returns (uint32);\\n\\n /**\\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\\n * required for the caller. The special value zero will automatically set the earliest possible time.\\n *\\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\\n *\\n * Emits a {OperationScheduled} event.\\n *\\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\\n * contract if it is using standard Solidity ABI encoding.\\n */\\n function schedule(\\n address target,\\n bytes calldata data,\\n uint48 when\\n ) external returns (bytes32 operationId, uint32 nonce);\\n\\n /**\\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\\n * execution delay is 0.\\n *\\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\\n *\\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\\n */\\n function execute(address target, bytes calldata data) external payable returns (uint32);\\n\\n /**\\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\\n * operation that is cancelled.\\n *\\n * Requirements:\\n *\\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\\n *\\n * Emits a {OperationCanceled} event.\\n */\\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\\n\\n /**\\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\\n *\\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\\n * with all the verifications that it implies.\\n *\\n * Emit a {OperationExecuted} event.\\n */\\n function consumeScheduledOp(address caller, bytes calldata data) external;\\n\\n /**\\n * @dev Hashing function for delayed operations.\\n */\\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\\n\\n /**\\n * @dev Changes the authority of a target managed by this manager instance.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n */\\n function updateAuthority(address target, address newAuthority) external;\\n}\\n\",\"keccak256\":\"0x9be2d08a326515805bc9cf6315b7953f8d1ebe88abf48c2d645fb1fa8211a0e2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAuthority.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard interface for permissioning originally defined in Dappsys.\\n */\\ninterface IAuthority {\\n /**\\n * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\\n */\\n function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\\n}\\n\",\"keccak256\":\"0x4cc0766bd7fb7b3bafb70afa2a93b6e313a0baec7a35ad1b57505be7861c1030\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1363.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"./IERC20.sol\\\";\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @title IERC1363\\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\\n *\\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\\n */\\ninterface IERC1363 is IERC20, IERC165 {\\n /*\\n * Note: the ERC-165 identifier for this interface is 0xb0202a11.\\n * 0xb0202a11 ===\\n * bytes4(keccak256('transferAndCall(address,uint256)')) ^\\n * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\\n * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\\n * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\\n * bytes4(keccak256('approveAndCall(address,uint256)')) ^\\n * bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\\n */\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferAndCall(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @param data Additional data with no specified format, sent in call to `to`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param from The address which you want to send tokens from.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param from The address which you want to send tokens from.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @param data Additional data with no specified format, sent in call to `to`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to be spent.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function approveAndCall(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to be spent.\\n * @param data Additional data with no specified format, sent in call to `spender`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9b6b3e7803bc5f2f8cd7ad57db8ac1def61a9930a5a3107df4882e028a9605d7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0xb25a4f11fa80c702bf5cd85adec90e6f6f507f32f4a8e6f5dbc31e8c10029486\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\n\",\"keccak256\":\"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"../token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\n/**\\n * @dev Interface of the ERC-4626 \\\"Tokenized Vault Standard\\\", as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\\n */\\ninterface IERC4626 is IERC20, IERC20Metadata {\\n event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\\n\\n event Withdraw(\\n address indexed sender,\\n address indexed receiver,\\n address indexed owner,\\n uint256 assets,\\n uint256 shares\\n );\\n\\n /**\\n * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\\n *\\n * - MUST be an ERC-20 token contract.\\n * - MUST NOT revert.\\n */\\n function asset() external view returns (address assetTokenAddress);\\n\\n /**\\n * @dev Returns the total amount of the underlying asset that is \\u201cmanaged\\u201d by Vault.\\n *\\n * - SHOULD include any compounding that occurs from yield.\\n * - MUST be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT revert.\\n */\\n function totalAssets() external view returns (uint256 totalManagedAssets);\\n\\n /**\\n * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToShares(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToAssets(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\\n * through a deposit call.\\n *\\n * - MUST return a limited value if receiver is subject to some deposit limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\\n * - MUST NOT revert.\\n */\\n function maxDeposit(address receiver) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\\n * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\\n * in the same transaction.\\n * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\\n * deposit would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewDeposit(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * deposit execution, and are accounted for during deposit.\\n * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function deposit(uint256 assets, address receiver) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\\n * - MUST return a limited value if receiver is subject to some mint limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\\n * - MUST NOT revert.\\n */\\n function maxMint(address receiver) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\\n * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\\n * same transaction.\\n * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\\n * would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by minting.\\n */\\n function previewMint(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\\n * execution, and are accounted for during mint.\\n * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function mint(uint256 shares, address receiver) external returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\\n * Vault, through a withdraw call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxWithdraw(address owner) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\\n * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\\n * called\\n * in the same transaction.\\n * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\\n * the withdrawal would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewWithdraw(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * withdraw execution, and are accounted for during withdraw.\\n * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\\n * through a redeem call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxRedeem(address owner) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\\n * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\\n * same transaction.\\n * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\\n * redemption would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\\n */\\n function previewRedeem(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * redeem execution, and are accounted for during redeem.\\n * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\\n}\\n\",\"keccak256\":\"0x666c704c58d4cf404eecd6e4a898a87e25b00b45416678de914e160582c3ff17\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xc42facb5094f2f35f066a7155bda23545e39a3156faef3ddc00185544443ba7d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC-20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC-721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC-1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x880da465c203cec76b10d72dbd87c80f387df4102274f23eea1f9c9b0918792b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.2.0) (proxy/ERC1967/ERC1967Utils.sol)\\n\\npragma solidity ^0.8.22;\\n\\nimport {IBeacon} from \\\"../beacon/IBeacon.sol\\\";\\nimport {IERC1967} from \\\"../../interfaces/IERC1967.sol\\\";\\nimport {Address} from \\\"../../utils/Address.sol\\\";\\nimport {StorageSlot} from \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This library provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\\n */\\nlibrary ERC1967Utils {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1.\\n */\\n // solhint-disable-next-line private-vars-leading-underscore\\n bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev The `implementation` of the proxy is invalid.\\n */\\n error ERC1967InvalidImplementation(address implementation);\\n\\n /**\\n * @dev The `admin` of the proxy is invalid.\\n */\\n error ERC1967InvalidAdmin(address admin);\\n\\n /**\\n * @dev The `beacon` of the proxy is invalid.\\n */\\n error ERC1967InvalidBeacon(address beacon);\\n\\n /**\\n * @dev An upgrade function sees `msg.value > 0` that may be lost.\\n */\\n error ERC1967NonPayable();\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the ERC-1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n if (newImplementation.code.length == 0) {\\n revert ERC1967InvalidImplementation(newImplementation);\\n }\\n StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Performs implementation upgrade with additional setup call if data is nonempty.\\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\\n * to avoid stuck value in the contract.\\n *\\n * Emits an {IERC1967-Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) internal {\\n _setImplementation(newImplementation);\\n emit IERC1967.Upgraded(newImplementation);\\n\\n if (data.length > 0) {\\n Address.functionDelegateCall(newImplementation, data);\\n } else {\\n _checkNonPayable();\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1.\\n */\\n // solhint-disable-next-line private-vars-leading-underscore\\n bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\\n * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the ERC-1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n if (newAdmin == address(0)) {\\n revert ERC1967InvalidAdmin(address(0));\\n }\\n StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {IERC1967-AdminChanged} event.\\n */\\n function changeAdmin(address newAdmin) internal {\\n emit IERC1967.AdminChanged(getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.beacon\\\" subtracted by 1.\\n */\\n // solhint-disable-next-line private-vars-leading-underscore\\n bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the ERC-1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n if (newBeacon.code.length == 0) {\\n revert ERC1967InvalidBeacon(newBeacon);\\n }\\n\\n StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\\n\\n address beaconImplementation = IBeacon(newBeacon).implementation();\\n if (beaconImplementation.code.length == 0) {\\n revert ERC1967InvalidImplementation(beaconImplementation);\\n }\\n }\\n\\n /**\\n * @dev Change the beacon and trigger a setup call if data is nonempty.\\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\\n * to avoid stuck value in the contract.\\n *\\n * Emits an {IERC1967-BeaconUpgraded} event.\\n *\\n * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\\n * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\\n * efficiency.\\n */\\n function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\\n _setBeacon(newBeacon);\\n emit IERC1967.BeaconUpgraded(newBeacon);\\n\\n if (data.length > 0) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n } else {\\n _checkNonPayable();\\n }\\n }\\n\\n /**\\n * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\\n * if an upgrade doesn't perform an initialization call.\\n */\\n function _checkNonPayable() private {\\n if (msg.value > 0) {\\n revert ERC1967NonPayable();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8decfa54cec979c824b044b8128cd91d713f72c71fd7dfa54974624d8c949898\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {UpgradeableBeacon} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xc59a78b07b44b2cf2e8ab4175fca91e8eca1eee2df7357b8d2a8833e5ea1f64c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x70f2f713b13b7ce4610bcd0ac9fec0f3cc43693b043abcb8dc40a42a726eb330\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC1363} from \\\"../../../interfaces/IERC1363.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n /**\\n * @dev An operation with an ERC-20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n *\\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n *\\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n *\\n * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\\n * only sets the \\\"standard\\\" allowance. Any temporary allowance will remain active, in addition to the value being\\n * set here.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n if (to.code.length == 0) {\\n safeTransfer(token, to, value);\\n } else if (!token.transferAndCall(to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\\n * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function transferFromAndCallRelaxed(\\n IERC1363 token,\\n address from,\\n address to,\\n uint256 value,\\n bytes memory data\\n ) internal {\\n if (to.code.length == 0) {\\n safeTransferFrom(token, from, to, value);\\n } else if (!token.transferFromAndCall(from, to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\\n * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\\n * once without retrying, and relies on the returned value to be true.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n if (to.code.length == 0) {\\n forceApprove(token, to, value);\\n } else if (!token.approveAndCall(to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n uint256 returnSize;\\n uint256 returnValue;\\n assembly (\\\"memory-safe\\\") {\\n let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n // bubble errors\\n if iszero(success) {\\n let ptr := mload(0x40)\\n returndatacopy(ptr, 0, returndatasize())\\n revert(ptr, returndatasize())\\n }\\n returnSize := returndatasize()\\n returnValue := mload(0)\\n }\\n\\n if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n bool success;\\n uint256 returnSize;\\n uint256 returnValue;\\n assembly (\\\"memory-safe\\\") {\\n success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n returnSize := returndatasize()\\n returnValue := mload(0)\\n }\\n return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\\n }\\n}\\n\",\"keccak256\":\"0x4ea01544758fd2c7045961904686bfe232d2220a04ecaa2d6b08dac17827febf\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.2.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n\\n (bool success, bytes memory returndata) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n _revert(returndata);\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {Errors.FailedCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\\n * of an unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {Errors.FailedCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert Errors.FailedCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaaa1d17c1129b127a4a401db2fbd72960e2671474be3d08cae71ccdc42f7624c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedCall();\\n\\n /**\\n * @dev The deployment failed.\\n */\\n error FailedDeployment();\\n\\n /**\\n * @dev A necessary precompile is missing.\\n */\\n error MissingPrecompile(address);\\n}\\n\",\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/interfaces/ITokenP.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title ITokenP\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Interface for the stablecoins `tokenP` contracts\\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\\ninterface ITokenP is IERC20 {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MINTER ROLE ONLY FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Lets a whitelisted contract mint tokenPs\\n /// @param account Address to mint to\\n /// @param amount Amount to mint\\n function mint(address account, uint256 amount) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @param sender Address which requested the burn from `burner`\\n /// @dev This method is to be called by a contract with the minter right after being requested\\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\\n /// @dev The method checks the allowance between the `sender` and the `burner`\\n function burnFrom(uint256 amount, address burner, address sender) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\\n /// requested to do so by an address willing to burn tokens from its address\\n function burnSelf(uint256 amount, address burner) external;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Amount of decimals of the stablecoin\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x64a1305faa8c5c91767a11af0eae16e4b463aa0bfe10f11b74aae9d96681a5eb\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/coinbase/ICbETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ICbETH\\n/// @notice Interface for the `cbETH` contract\\ninterface ICbETH {\\n function exchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb159341cb0e25c478912b274cdda2d50fa84692aeac87b6823d281aaea2aed04\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/frax/ISfrxETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ISfrxETH\\n/// @notice Interface for the `sfrxETH` contract\\ninterface ISfrxETH {\\n function pricePerShare() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x914cbea276f817c7db62bfca21e15bd8f7892faa9f39d86baaef574cf12b859f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/lido/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IStETH\\n/// @notice Interface for the `StETH` contract\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n\\n function submit(address) external payable returns (uint256);\\n\\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf21e3d8bdadc236b34bf2122b0e0b939d2d6bb6e2889b508636cbb7b84f59680\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/rocketPool/IRETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IRETH\\n/// @notice Interface for the `rETH` contract\\ninterface IRETH {\\n function getExchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x567a378e95d40160e297c1adb617ccaa69c03e49c4ad72a6ce651dd43cdbd5cd\",\"license\":\"GPL-3.0\"},\"contracts/savings/BaseSavings.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ERC4626Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol\\\";\\nimport { ERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\nimport { UUPSUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\nimport { Initializable } from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport { IERC20Metadata } from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\nimport { AccessManagedUpgradeable, IAccessManager } from \\\"../utils/AccessManagedUpgradeable.sol\\\";\\n\\nimport \\\"../utils/Constants.sol\\\";\\nimport \\\"../utils/Errors.sol\\\";\\n\\n/// @title BaseSavings\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Parallel Savings contracts are contracts where users can deposit an `asset` and earn a yield on this asset\\n/// when it is distributed\\n/// @dev These contracts are functional within the Parallelizer system if they have mint right on `asset` and\\n/// if they are trusted by the Parallelizer contract\\n/// @dev Implementations assume that `asset` is safe to interact with, on which there cannot be reentrancy attacks\\n/// @dev The ERC4626 interface does not allow users to specify a slippage protection parameter for the main entry\\n/// points\\n/// (like `deposit`, `mint`, `redeem` or `withdraw`). Even though there should be no specific sandwiching\\n/// issue with current implementations, it is still recommended to interact with Parallel Savings contracts\\n/// through a router that can implement such a protection.\\n/// @dev This contract is an authorized fork of Angle's Savings contract:\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/savings/BaseSavings.sol\\nabstract contract BaseSavings is Initializable, AccessManagedUpgradeable, ERC4626Upgradeable, UUPSUpgradeable {\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Upgrade the implementation of the contract\\n /// @dev This function can only be called by the governor only\\n /// @param newImplementation The address of the new implementation\\n function _authorizeUpgrade(address newImplementation) internal override restricted { }\\n}\\n\",\"keccak256\":\"0x06f591d6fe6fe004433a7983330d9cc45d27d69c2cf9693804c43c1a49272596\",\"license\":\"BUSL-1.1\"},\"contracts/savings/Savings.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"./BaseSavings.sol\\\";\\n\\n/// @title Savings\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice In this implementation, assets in the contract increase in value following a `rate` chosen by governance\\n/// @dev This contract is an authorized fork of Angle's Savings contract:\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/savings/Savings.sol\\ncontract Savings is BaseSavings {\\n using SafeERC20 for IERC20Metadata;\\n using Math for uint256;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n PARAMETERS / REFERENCES \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Inflation rate (per second) in BASE_27\\n uint208 public rate;\\n\\n /// @notice Last time rewards were accrued\\n uint40 public lastUpdate;\\n\\n /// @notice Whether the contract is paused or not\\n uint8 public paused;\\n\\n /// @notice Maximum inflation rate\\n /// @dev Note that `rate` can still be greater than `maxRate` if this `maxRate` is reduced by governance\\n /// to a level inferior to the current rate\\n uint256 public maxRate;\\n\\n /// @notice Checks whether the address is trusted to set the rate\\n mapping(address => uint256) public isTrustedUpdater;\\n\\n uint256[48] private __gap;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EVENTS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n event Accrued(uint256 interest);\\n event MaxRateUpdated(uint256 newMaxRate);\\n event ToggledPause(uint128 pauseStatus);\\n event ToggledTrusted(address indexed trustedAddress, uint256 trustedStatus);\\n event RateUpdated(uint256 newRate);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INITIALIZATION \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Initializes the contract\\n /// @param _authority Reference to the `AccessManagerContract` contract\\n /// @param name_ Name of the savings contract\\n /// @param symbol_ Symbol of the savings contract\\n /// @param divizer Quantifies the first initial deposit (should be typically 1 for tokens like agEUR)\\n /// @dev A first deposit is done at initialization to protect for the classical issue of ERC4626 contracts\\n /// where the the first user of the contract tries to steal everyone else's tokens\\n function initialize(\\n address _authority,\\n IERC20Metadata asset_,\\n string memory name_,\\n string memory symbol_,\\n uint256 divizer\\n )\\n public\\n initializer\\n {\\n if (address(_authority) == address(0)) revert ZeroAddress();\\n __ERC4626_init(asset_);\\n __ERC20_init(name_, symbol_);\\n __UUPSUpgradeable_init();\\n __AccessManaged_init(_authority);\\n _setNameAndSymbol(name_, symbol_);\\n _deposit(msg.sender, address(this), 10 ** (asset_.decimals()) / divizer, BASE_18 / divizer);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MODIFIERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Checks whether the whole contract is paused or not\\n modifier whenNotPaused() {\\n if (paused > 0) revert Paused();\\n _;\\n }\\n\\n /// @notice Checks whether the sender is allowed to update the rate\\n modifier onlyTrustedOrRestricted() {\\n if (isTrustedUpdater[msg.sender] == 0 && !_checkCanCall(_msgSender(), _msgData())) {\\n revert NotTrusted();\\n }\\n _;\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n CONTRACT LOGIC \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Accrues interest to this contract by minting tokenPs\\n function _accrue() internal returns (uint256 newTotalAssets) {\\n uint256 currentBalance = super.totalAssets();\\n newTotalAssets = _computeUpdatedAssets(currentBalance, block.timestamp - lastUpdate);\\n lastUpdate = uint40(block.timestamp);\\n uint256 earned = newTotalAssets - currentBalance;\\n if (earned > 0) {\\n ITokenP(asset()).mint(address(this), earned);\\n emit Accrued(earned);\\n }\\n }\\n\\n /// @notice Computes how much `currentBalance` held in the contract would be after `exp` time following\\n /// the `rate` of increase\\n function _computeUpdatedAssets(uint256 currentBalance, uint256 exp) internal view returns (uint256) {\\n uint256 ratePerSecond = rate;\\n if (exp == 0 || ratePerSecond == 0) return currentBalance;\\n uint256 expMinusOne = exp - 1;\\n uint256 expMinusTwo = exp > 2 ? exp - 2 : 0;\\n uint256 basePowerTwo = (ratePerSecond * ratePerSecond + HALF_BASE_27) / BASE_27;\\n uint256 basePowerThree = (basePowerTwo * ratePerSecond + HALF_BASE_27) / BASE_27;\\n uint256 secondTerm = (exp * expMinusOne * basePowerTwo) / 2;\\n uint256 thirdTerm = (exp * expMinusOne * expMinusTwo * basePowerThree) / 6;\\n return (currentBalance * (BASE_27 + ratePerSecond * exp + secondTerm + thirdTerm)) / BASE_27;\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ERC4626 VIEW FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @inheritdoc ERC4626Upgradeable\\n function totalAssets() public view override returns (uint256) {\\n return _computeUpdatedAssets(super.totalAssets(), block.timestamp - lastUpdate);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ERC4626 INTERACTION FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @inheritdoc ERC4626Upgradeable\\n function deposit(uint256 assets, address receiver) public override whenNotPaused returns (uint256 shares) {\\n uint256 newTotalAssets = _accrue();\\n shares = _convertToShares(assets, newTotalAssets, Math.Rounding.Floor);\\n _deposit(_msgSender(), receiver, assets, shares);\\n }\\n\\n /// @inheritdoc ERC4626Upgradeable\\n function mint(uint256 shares, address receiver) public override whenNotPaused returns (uint256 assets) {\\n uint256 newTotalAssets = _accrue();\\n assets = _convertToAssets(shares, newTotalAssets, Math.Rounding.Ceil);\\n _deposit(_msgSender(), receiver, assets, shares);\\n }\\n\\n /// @inheritdoc ERC4626Upgradeable\\n function withdraw(\\n uint256 assets,\\n address receiver,\\n address owner\\n )\\n public\\n override\\n whenNotPaused\\n returns (uint256 shares)\\n {\\n uint256 newTotalAssets = _accrue();\\n shares = _convertToShares(assets, newTotalAssets, Math.Rounding.Ceil);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n }\\n\\n /// @inheritdoc ERC4626Upgradeable\\n function redeem(\\n uint256 shares,\\n address receiver,\\n address owner\\n )\\n public\\n override\\n whenNotPaused\\n returns (uint256 assets)\\n {\\n uint256 newTotalAssets = _accrue();\\n assets = _convertToAssets(shares, newTotalAssets, Math.Rounding.Floor);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @inheritdoc ERC4626Upgradeable\\n function _convertToShares(uint256 assets, Math.Rounding rounding) internal view override returns (uint256 shares) {\\n return _convertToShares(assets, totalAssets(), rounding);\\n }\\n\\n /// @notice Same as the function above except that the `totalAssets` value does not have to be recomputed here\\n function _convertToShares(\\n uint256 assets,\\n uint256 newTotalAssets,\\n Math.Rounding rounding\\n )\\n internal\\n view\\n returns (uint256 shares)\\n {\\n uint256 supply = totalSupply();\\n return (assets == 0 || supply == 0)\\n ? assets.mulDiv(BASE_18, 10 ** (IERC20Metadata(asset()).decimals()), rounding)\\n : assets.mulDiv(supply, newTotalAssets, rounding);\\n }\\n\\n /// @inheritdoc ERC4626Upgradeable\\n function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view override returns (uint256 assets) {\\n return _convertToAssets(shares, totalAssets(), rounding);\\n }\\n\\n /// @notice Same as the function above except that the `totalAssets` value does not have to be recomputed here\\n function _convertToAssets(\\n uint256 shares,\\n uint256 newTotalAssets,\\n Math.Rounding rounding\\n )\\n internal\\n view\\n returns (uint256 assets)\\n {\\n uint256 supply = totalSupply();\\n return (supply == 0)\\n ? shares.mulDiv(10 ** (IERC20Metadata(asset()).decimals()), BASE_18, rounding)\\n : shares.mulDiv(newTotalAssets, supply, rounding);\\n }\\n\\n function _setNameAndSymbol(string memory newName, string memory newSymbol) internal virtual { }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Provides an estimated Annual Percentage Rate for base depositors on this contract\\n function estimatedAPR() external view returns (uint256 apr) {\\n // 365 days = 31536000 seconds\\n return _computeUpdatedAssets(BASE_18, 31_536_000) - BASE_18;\\n }\\n\\n /// @notice Wrapper on top of the `computeUpdatedAssets` function\\n function computeUpdatedAssets(uint256 _totalAssets, uint256 exp) external view returns (uint256) {\\n return _computeUpdatedAssets(_totalAssets, exp);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n GOVERNANCE \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Pauses the contract\\n function togglePause() external restricted {\\n uint8 pauseStatus = 1 - paused;\\n paused = pauseStatus;\\n emit ToggledPause(pauseStatus);\\n }\\n\\n /// @notice Toggles an address\\n function toggleTrusted(address trustedAddress) external restricted {\\n uint256 trustedStatus = 1 - isTrustedUpdater[trustedAddress];\\n isTrustedUpdater[trustedAddress] = trustedStatus;\\n emit ToggledTrusted(trustedAddress, trustedStatus);\\n }\\n\\n /// @notice Updates the inflation rate for depositing `asset` in this contract\\n /// @dev Any `rate` can be set by the guardian or by a trusted address provided that it is inferior to\\n ///the `maxRate` settable by a governor address\\n function setRate(uint208 newRate) external onlyTrustedOrRestricted {\\n if (newRate > maxRate) revert InvalidRate();\\n _accrue();\\n rate = newRate;\\n emit RateUpdated(newRate);\\n }\\n\\n /// @notice Updates the maximum rate settable\\n function setMaxRate(uint256 newMaxRate) external restricted {\\n maxRate = newMaxRate;\\n emit MaxRateUpdated(newMaxRate);\\n }\\n}\\n\",\"keccak256\":\"0xfb2b8f7eb7551250e463cb06b3ef212dc43c199f13dda8f6451ce0e88bab24a1\",\"license\":\"BUSL-1.1\"},\"contracts/savings/nameable/SavingsNameable.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"../Savings.sol\\\";\\n\\n/// @title SavingsNameable\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This contract is an authorized fork of Angle's SavingsNameable contract:\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/savings/nameable/SavingsNameable.sol\\ncontract SavingsNameable is Savings {\\n string internal __name;\\n\\n string internal __symbol;\\n\\n uint256[48] private __gapNameable;\\n\\n /// @inheritdoc ERC20Upgradeable\\n function name() public view override(ERC20Upgradeable, IERC20Metadata) returns (string memory) {\\n return __name;\\n }\\n\\n /// @inheritdoc ERC20Upgradeable\\n function symbol() public view override(ERC20Upgradeable, IERC20Metadata) returns (string memory) {\\n return __symbol;\\n }\\n\\n /// @notice Updates the name and symbol of the token\\n function setNameAndSymbol(string memory newName, string memory newSymbol) external restricted {\\n _setNameAndSymbol(newName, newSymbol);\\n }\\n\\n function _setNameAndSymbol(string memory newName, string memory newSymbol) internal override {\\n __name = newName;\\n __symbol = newSymbol;\\n }\\n}\\n\",\"keccak256\":\"0x96c15f05b1e7c1c949faf56fcc4c253df991636d8aa1998587f94dc4d038dabb\",\"license\":\"BUSL-1.1\"},\"contracts/utils/AccessManagedUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/AccessManaged.sol)\\npragma solidity 0.8.28;\\n\\nimport { AuthorityUtils } from \\\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { IAccessManaged } from \\\"@openzeppelin/contracts/access/manager/IAccessManaged.sol\\\";\\nimport { ContextUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\\\";\\nimport { Initializable } from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\n\\n/// @title AccessControl\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Fork of OpenZeppelin's `AccessManagedUpgradeable` contract\\n/// updated to make _checkCanCall to return bool\\n/* solhint-disable max-line-length */\\n/// https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/access/manager/AccessManagedUpgradeable.sol\\n/* solhint-enable max-line-length */\\nabstract contract AccessManagedUpgradeable is Initializable, ContextUpgradeable, IAccessManaged {\\n /// @custom:storage-location erc7201:openzeppelin.storage.AccessManaged\\n struct AccessManagedStorage {\\n address _authority;\\n bool _consumingSchedule;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.AccessManaged\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant AccessManagedStorageLocation =\\n 0xf3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a00;\\n\\n function _getAccessManagedStorage() private pure returns (AccessManagedStorage storage $) {\\n assembly (\\\"memory-safe\\\") {\\n $.slot := AccessManagedStorageLocation\\n }\\n }\\n\\n /**\\n * @dev Initializes the contract connected to an initial authority.\\n */\\n function __AccessManaged_init(address initialAuthority) internal onlyInitializing {\\n __AccessManaged_init_unchained(initialAuthority);\\n }\\n\\n function __AccessManaged_init_unchained(address initialAuthority) internal onlyInitializing {\\n _setAuthority(initialAuthority);\\n }\\n\\n /**\\n * @dev Restricts access to a function as defined by the connected Authority for this contract and the\\n * caller and selector of the function that entered the contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * In general, this modifier should only be used on `external` functions. It is okay to use it on `public`\\n * functions that are used as external entry points and are not called internally. Unless you know what you're\\n * doing, it should never be used on `internal` functions. Failure to follow these rules can have critical security\\n * implications! This is because the permissions are determined by the function that entered the contract, i.e. the\\n * function at the bottom of the call stack, and not the function where the modifier is visible in the source code.\\n * ====\\n *\\n * [WARNING]\\n * ====\\n * Avoid adding this modifier to the\\n * https://docs.soliditylang.org/en/v0.8.20/contracts.html#receive-ether-function[`receive()`]\\n * function or the https://docs.soliditylang.org/en/v0.8.20/contracts.html#fallback-function[`fallback()`]. These\\n * functions are the only execution paths where a function selector cannot be unambiguously determined from the\\n * calldata\\n * since the selector defaults to `0x00000000` in the `receive()` function and similarly in the `fallback()`\\n * function\\n * if no calldata is provided. (See {_checkCanCall}).\\n *\\n * The `receive()` function will always panic whereas the `fallback()` may panic depending on the calldata length.\\n * ====\\n */\\n modifier restricted() {\\n address caller = _msgSender();\\n require(_checkCanCall(caller, _msgData()), AccessManagedUnauthorized(caller));\\n _;\\n }\\n\\n /// @inheritdoc IAccessManaged\\n function authority() public view virtual returns (address) {\\n AccessManagedStorage storage $ = _getAccessManagedStorage();\\n return $._authority;\\n }\\n\\n /// @inheritdoc IAccessManaged\\n function setAuthority(address newAuthority) public virtual {\\n address caller = _msgSender();\\n if (caller != authority()) {\\n revert AccessManagedUnauthorized(caller);\\n }\\n if (newAuthority.code.length == 0) {\\n revert AccessManagedInvalidAuthority(newAuthority);\\n }\\n _setAuthority(newAuthority);\\n }\\n\\n /// @inheritdoc IAccessManaged\\n function isConsumingScheduledOp() public view returns (bytes4) {\\n AccessManagedStorage storage $ = _getAccessManagedStorage();\\n return $._consumingSchedule ? this.isConsumingScheduledOp.selector : bytes4(0);\\n }\\n\\n /**\\n * @dev Transfers control to a new authority. Internal function with no access restriction. Allows bypassing the\\n * permissions set by the current authority.\\n */\\n function _setAuthority(address newAuthority) internal virtual {\\n AccessManagedStorage storage $ = _getAccessManagedStorage();\\n $._authority = newAuthority;\\n emit AuthorityUpdated(newAuthority);\\n }\\n\\n /**\\n * @dev Reverts if the caller is not allowed to call the function identified by a selector. Panics if the calldata\\n * is less than 4 bytes long.\\n */\\n function _checkCanCall(address caller, bytes calldata data) internal virtual returns (bool) {\\n AccessManagedStorage storage $ = _getAccessManagedStorage();\\n (bool immediate, uint32 delay) =\\n AuthorityUtils.canCallWithDelay(authority(), caller, address(this), bytes4(data[0:4]));\\n if (!immediate) {\\n if (delay > 0) {\\n $._consumingSchedule = true;\\n IAccessManager(authority()).consumeScheduledOp(caller, data);\\n $._consumingSchedule = false;\\n } else {\\n return false;\\n }\\n }\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0x54e098edbcb4e4e232733f1be4adecdc201460ee1d500115ef8b1c0dba4857d0\",\"license\":\"MIT\"},\"contracts/utils/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ICbETH } from \\\"contracts/interfaces/external/coinbase/ICbETH.sol\\\";\\nimport { ISfrxETH } from \\\"contracts/interfaces/external/frax/ISfrxETH.sol\\\";\\nimport { IStETH } from \\\"contracts/interfaces/external/lido/IStETH.sol\\\";\\nimport { IRETH } from \\\"contracts/interfaces/external/rocketPool/IRETH.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STORAGE SLOTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n/// @dev Storage position of `DiamondStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.diamond.storage\\\") - 1`\\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\\n\\n/// @dev Storage position of `ParallelizerStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.parallelizer.storage\\\") - 1`\\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\\n\\n/// @dev Storage position of `ImplementationStorage` structure\\n/// @dev Equals `keccak256(\\\"eip1967.proxy.implementation\\\") - 1`\\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MATHS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nuint256 constant BASE_6 = 1e6;\\nuint256 constant BASE_8 = 1e8;\\nuint256 constant BASE_9 = 1e9;\\nuint256 constant BASE_12 = 1e12;\\nuint256 constant BPS = 1e14;\\nuint256 constant BASE_18 = 1e18;\\nuint256 constant HALF_BASE_27 = 1e27 / 2;\\nuint256 constant BASE_27 = 1e27;\\nuint256 constant BASE_36 = 1e36;\\nuint256 constant MAX_BURN_FEE = 999_000_000;\\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// The values being non-zero value makes deployment a bit more expensive,\\n// but in exchange the refund on every call to nonReentrant will be lower in\\n// amount. Since refunds are capped to a percentage of the total\\n// transaction's gas, it is best to keep them low in cases like this one, to\\n// increase the likelihood of the full refund coming into effect.\\nuint8 constant NOT_ENTERED = 1;\\nuint8 constant ENTERED = 2;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// Role IDs for the AccessManager\\nuint64 constant GOVERNOR_ROLE = 10;\\nuint64 constant GUARDIAN_ROLE = 20;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n COMMON ADDRESSES \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\\n\",\"keccak256\":\"0x3306bdd0d4e4f364e0d35893a7ffb59c8eb9e94a5bd861f58b8d7ba8a7b336e5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nerror AccessManagedUnauthorized(address caller);\\nerror AlreadyAdded();\\nerror CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);\\nerror CannotAddSelectorsToZeroAddress(bytes4[] _selectors);\\nerror CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);\\nerror CannotRemoveImmutableFunction(bytes4 _selector);\\nerror CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);\\nerror CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);\\nerror CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);\\nerror CannotReplaceImmutableFunction(bytes4 _selector);\\nerror ContractHasNoCode();\\nerror CollateralBacked();\\nerror FunctionNotFound(bytes4 _functionSelector);\\nerror IncorrectFacetCutAction(uint8 _action);\\nerror InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);\\nerror InvalidChainlinkRate();\\nerror InvalidLengths();\\nerror InvalidNegativeFees();\\nerror InvalidOracleType();\\nerror InvalidParam();\\nerror InvalidParams();\\nerror InvalidRate();\\nerror InvalidSwap();\\nerror InvalidTokens();\\nerror InvalidAccessManager();\\nerror ManagerHasAssets();\\nerror NoSelectorsProvidedForFacetForCut(address _facetAddress);\\nerror NotAllowed();\\nerror NotCollateral();\\nerror NotGovernor();\\nerror NotGuardian();\\nerror NotTrusted();\\nerror NotTrustedOrGuardian();\\nerror NotWhitelisted();\\nerror OdosSwapFailed();\\nerror OracleUpdateFailed();\\nerror Paused();\\nerror ReentrantCall();\\nerror RemoveFacetAddressMustBeZeroAddress(address _facetAddress);\\nerror TooBigAmountIn();\\nerror TooLate();\\nerror TooSmallAmountOut();\\nerror ZeroAddress();\\nerror ZeroAmount();\\nerror SwapError();\\nerror SlippageTooHigh();\\nerror InsufficientFunds();\\n\",\"keccak256\":\"0x1e2f6812ef78e948e5155d32213b52afff8c0ba5463d18bee10694efbf886130\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x60a080604052346100c257306080525f5160206131dd5f395f51905f525460ff8160401c166100b3576002600160401b03196001600160401b03821601610060575b60405161311690816100c7823960805181818161128001526113470152f35b6001600160401b0319166001600160401b039081175f5160206131dd5f395f51905f525581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a15f80610041565b63f92ee8a960e01b5f5260045ffd5b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c806301e1d1141461189257806306fdde03146117ed57806307a2d13a146115c4578063095ea7b3146116f25780630a28a477146116cc57806318160ddd1461169057806323b872dd146116585780632c4e722e14611633578063313ce567146115fb57806338d52e0f146115c9578063402d267d1461037a5780634cdad506146115c45780634d0046d51461158c5780634f1ef286146112f857806352d1902d146112665780635a446215146112025780635a5cd45e146111cc5780635c975abb146111ad5780636e553f651461116757806370a08231146102c5578063763e9023146110625780637a9e5e4b14610fbf5780637ee8434914610f3d5780638fb3603714610eaa57806393d239231461076857806394bf804d1461072457806395d89b411461064e578063a9059cbb1461061d578063aa4abe7f146105cb578063ad3cb1cc14610570578063b3d7f6b91461054a578063b460af9414610510578063ba087652146104af578063bf7e214f1461046a578063c046371114610444578063c4ae31681461037f578063c63d75b61461037a578063c6e6f5921461022a578063ce96cb771461031a578063d905777e146102c5578063dd62ed3e1461024c578063ece1d6e51461022f578063ef8b30f71461022a5763f4f9b040146101fd575f80fd5b3461022657604036600319011261022657602061021e602435600435611ce9565b604051908152f35b5f80fd5b611a19565b34610226575f366003190112610226576020600154604051908152f35b34610226576040366003190112610226576102656118fc565b6001600160a01b036102af610278611912565b926001600160a01b03165f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0160205260405f2090565b91165f52602052602060405f2054604051908152f35b3461022657602036600319011261022657602061021e6102e36118fc565b6001600160a01b03165f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0060205260405f205490565b34610226576020366003190112610226576001600160a01b0361033b6118fc565b165f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00602052602061021e60405f2054610374611a4c565b90612ade565b611928565b34610226575f366003190112610226576103a23361039d3633612082565b611aaa565b5f548060f81c6001039060ff821161043057816020917effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fff000000000000000000000000000000000000000000000000000000000000007f1e47f7115d10ca14b574b88c5c0bb005076141cea47318c3a8a7fe177142e8a29560f81b169116175f5560ff60405191168152a1005b634e487b7160e01b5f52601160045260245ffd5b34610226575f36600319011261022657602064ffffffffff5f5460d01c16604051908152f35b34610226575f3660031901126102265760206001600160a01b037ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a005416604051908152f35b34610226576104bd366119df565b905f5460f81c6104e85760209261021e916104df6104d96125fd565b83612ade565b93849133612b53565b7f9e87fac8000000000000000000000000000000000000000000000000000000005f5260045ffd5b346102265761051e366119df565b90915f5460f81c6104e85760209261021e9161054161053b6125fd565b8261272f565b93849233612b53565b3461022657602036600319011261022657602061021e610568611a4c565b600435612a62565b34610226575f366003190112610226576105c760405161059160408261194d565b600581527f352e302e300000000000000000000000000000000000000000000000000000006020820152604051918291826118ac565b0390f35b34610226576020366003190112610226577fcdfe38c4a8f52b3ca6577340cfb5046c68d9854c712200f932e420775132f0b960206004356106103361039d3633612082565b80600155604051908152a1005b34610226576040366003190112610226576106436106396118fc565b6024359033611f33565b602060405160018152f35b34610226575f366003190112610226576040515f60345461066e81611a72565b808452906001811690811561070057506001146106a2575b6105c7836106968185038261194d565b604051918291826118ac565b91905060345f527f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1915f905b8082106106e657509091508101602001610696610686565b9192600181602092548385880101520191019092916106ce565b60ff191660208086019190915291151560051b840190910191506106969050610686565b3461022657604036600319011261022657600435610740611912565b5f5460f81c6104e85761021e60209261076061075a6125fd565b82612a62565b80933361287a565b346102265760a0366003190112610226576107816118fc565b6024356001600160a01b0381168091036102265760443567ffffffffffffffff8111610226576107b59036906004016119c1565b9060643567ffffffffffffffff8111610226576107d69036906004016119c1565b90608435917ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549360ff8560401c16159467ffffffffffffffff811680159081610ea2575b6001149081610e98575b159081610e8f575b50610e675767ffffffffffffffff1981166001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005585610e28575b506001600160a01b03861615610e0057610881612e54565b610889612e54565b8261089381612fb5565b9015610df8575b7fffffffffffffffffffffff00000000000000000000000000000000000000000074ff00000000000000000000000000000000000000005f5160206130c15f395f51905f52549260a01b16911617175f5160206130c15f395f51905f5255610900612e54565b610908612e54565b805167ffffffffffffffff8111610cb5576109437f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0354611a72565b601f8111610d76575b50806020601f8211600114610cd4575f91610cc9575b508160011b915f199060031b1c1916177f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03555b81519567ffffffffffffffff8711610cb5576109d17f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0454611a72565b601f8111610c33575b50602096601f8111600114610b845791610a53602095949284610a58956004999a9b5f91610b79575b508160011b915f199060031b1c1916177f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace04555b610a3e612e54565b610a46612e54565b610a4e612e54565b6129cf565b6122ff565b6040519283809263313ce56760e01b82525afa8015610b6e57610a878391610a8c935f91610b3f575b50611ae6565b611af7565b8115610b2b57610aa891670de0b6b3a76400000490303361287a565b610aae57005b68ff0000000000000000197ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b634e487b7160e01b5f52601260045260245ffd5b610b61915060203d602011610b67575b610b59818361194d565b810190611acd565b86610a81565b503d610b4f565b6040513d5f823e3d90fd5b90508501518c610a03565b601f1981167f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace045f52885f20905f5b818110610c1b575092600183610a539360049a9b9c610a58989660209b9a9810610c03575b5050811b017f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0455610a36565b8701515f1960f88460031b161c191690558c80610bd7565b868b0151835560209a8b019a60019093019201610bb2565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace045f527f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa601f890160051c81019160208a10610cab575b601f0160051c01905b818110610ca057506109da565b5f8155600101610c93565b9091508190610c8a565b634e487b7160e01b5f52604160045260245ffd5b905082015188610962565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace035f9081528181209250601f198416905b818110610d5e57509083600194939210610d46575b5050811b017f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0355610995565b8401515f1960f88460031b161c191690558880610d1a565b91926020600181928689015181550194019201610d05565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace035f527f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0601f830160051c81019160208410610dee575b601f0160051c01905b818110610de3575061094c565b5f8155600101610dd6565b9091508190610dcd565b50601261089a565b7fd92e233d000000000000000000000000000000000000000000000000000000005f5260045ffd5b68ffffffffffffffffff191668010000000000000001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005586610869565b7ff92ee8a9000000000000000000000000000000000000000000000000000000005f5260045ffd5b9050158861082d565b303b159150610825565b87915061081b565b34610226575f366003190112610226577ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a005460a01c60ff1615610f355760207f8fb36037000000000000000000000000000000000000000000000000000000005b7fffffffff0000000000000000000000000000000000000000000000000000000060405191168152f35b60205f610f0b565b34610226576020366003190112610226576001600160a01b03610f5e6118fc565b610f6c3361039d3633612082565b16805f52600260205260405f2054600103600181116104305760207fb4e4c17380256b9cc49fc909cfd80b70b57e922b2ada0ff351665e1da6493bd591835f52600282528060405f2055604051908152a2005b3461022657602036600319011261022657610fd86118fc565b6001600160a01b037ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a005416330361105057803b1561101b57611019906129cf565b005b6001600160a01b03907fc2f31e5e000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b62d1953b60e31b5f523360045260245ffd5b34610226576020366003190112610226576004356001600160d01b03811680910361022657335f52600260205260405f20541580611156575b61112e5760015481116111065760207fe65c987b2e4668e09ba867026921588005b2b2063607a1e7e7d91683c8f91b7b916110d46125fd565b50807fffffffffffff00000000000000000000000000000000000000000000000000005f5416175f55604051908152a1005b7f6a43f8d1000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fc22a648e000000000000000000000000000000000000000000000000000000005f5260045ffd5b506111613633612082565b1561109b565b3461022657604036600319011261022657600435611183611912565b905f5460f81c6104e85761021e6020926111a461119e6125fd565b846127e8565b9283913361287a565b34610226575f3660031901126102265760205f5460f81c604051908152f35b34610226575f366003190112610226576111e4611baf565b670de0b6b3a763ffff19810190811161043057602090604051908152f35b346102265760403660031901126102265760043567ffffffffffffffff8111610226576112339036906004016119c1565b6024359067ffffffffffffffff8211610226576112576110199236906004016119c1565b90610a533361039d3633612082565b34610226575f366003190112610226576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036112d05760206040517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b7fe07c8dba000000000000000000000000000000000000000000000000000000005f5260045ffd5b60403660031901126102265761130c6118fc565b60243567ffffffffffffffff811161022657366023820112156102265761133d90369060248160040135910161198b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803014908115611557575b506112d0576113853361039d3633612082565b6001600160a01b038216916040517f52d1902d000000000000000000000000000000000000000000000000000000008152602081600481875afa5f9181611523575b506113df5783634c9c8ce360e01b5f5260045260245ffd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8592036114f85750813b156114e6578073ffffffffffffffffffffffffffffffffffffffff197f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416177f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28151156114b5575f8083602061101995519101845af46114af612d16565b91613034565b5050346114be57005b7fb398979f000000000000000000000000000000000000000000000000000000005f5260045ffd5b634c9c8ce360e01b5f5260045260245ffd5b7faa1d49a4000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b9091506020813d60201161154f575b8161153f6020938361194d565b81010312610226575190856113c7565b3d9150611532565b90506001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416141583611372565b34610226576020366003190112610226576001600160a01b036115ad6118fc565b165f526002602052602060405f2054604051908152f35b6118d6565b34610226575f3660031901126102265760206001600160a01b035f5160206130c15f395f51905f525416604051908152f35b34610226575f3660031901126102265760ff5f5160206130c15f395f51905f525460a01c1660ff811161043057602090604051908152f35b34610226575f3660031901126102265760206001600160d01b035f5416604051908152f35b34610226576060366003190112610226576106436116746118fc565b61167c611912565b6044359161168b833383611e17565b611f33565b34610226575f3660031901126102265760207f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0254604051908152f35b3461022657602036600319011261022657602061021e6116ea611a4c565b60043561272f565b346102265760403660031901126102265761170b6118fc565b6024359033156117c1576001600160a01b031690811561179557335f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0160205260409020825f526020528060405f20556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b7f94280d62000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b7fe602df05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b34610226575f366003190112610226576040515f60335461180d81611a72565b80845290600181169081156107005750600114611834576105c7836106968185038261194d565b91905060335f527f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a82915f905b80821061187857509091508101602001610696610686565b919260018160209254838588010152019101909291611860565b34610226575f36600319011261022657602061021e611a4c565b602060409281835280519182918282860152018484015e5f828201840152601f01601f1916010190565b3461022657602036600319011261022657602061021e6118f4611a4c565b600435612ade565b600435906001600160a01b038216820361022657565b602435906001600160a01b038216820361022657565b34610226576020366003190112610226576119416118fc565b5060206040515f198152f35b90601f8019910116810190811067ffffffffffffffff821117610cb557604052565b67ffffffffffffffff8111610cb557601f01601f191660200190565b9291926119978261196f565b916119a5604051938461194d565b829481845281830111610226578281602093845f960137010152565b9080601f83011215610226578160206119dc9335910161198b565b90565b606090600319011261022657600435906024356001600160a01b038116810361022657906044356001600160a01b03811681036102265790565b3461022657602036600319011261022657602061021e611a37611a4c565b6004356127e8565b9190820391821161043057565b6119dc611a57611b01565b611a6c64ffffffffff5f5460d01c1642611a3f565b90611ce9565b90600182811c92168015611aa0575b6020831014611a8c57565b634e487b7160e01b5f52602260045260245ffd5b91607f1691611a81565b15611ab25750565b6001600160a01b039062d1953b60e31b5f521660045260245ffd5b90816020910312610226575160ff811681036102265790565b60ff16604d811161043057600a0a90565b8115610b2b570490565b602460206001600160a01b035f5160206130c15f395f51905f525416604051928380927f70a082310000000000000000000000000000000000000000000000000000000082523060048301525afa908115610b6e575f91611b60575090565b90506020813d602011611b87575b81611b7b6020938361194d565b81010312610226575190565b3d9150611b6e565b8181029291811591840414171561043057565b9190820180921161043057565b6001600160d01b035f5416801580611cdb576301e1337e91611bd18180611b8f565b6b019d971e4fe8401e740000008101809111610430576b033b2e3c9fd0803ce8000000900491611c018284611b8f565b936b019d971e4fe8401e740000008501809511610430576301e1337f946301e1338094660388828f7b0c8090611c379082611b8f565b60011c96868204148615171561043057828102928184041490151715610430576006916b033b2e3c9fd0803ce8000000611c72920490611b8f565b0492808302928304141715610430576b033b2e3c9fd0803ce800000001806b033b2e3c9fd0803ce80000001161043057611cb492611caf91611ba2565b611ba2565b670de0b6b3a76400008181029190820403610430576b033b2e3c9fd0803ce8000000900490565b5050670de0b6b3a764000090565b906001600160d01b035f54169181158015611e0f575b611e09575f198201828111610430576002831115611e0257600119830183811161043057925b611d2f8580611b8f565b6b019d971e4fe8401e740000008101809111610430576b033b2e3c9fd0803ce80000009004611d5e8682611b8f565b946b019d971e4fe8401e7400000086018096116104305783611da0611db192611da06b033b2e3c9fd0803ce8000000611da5600697611da0611db89b8b611b8f565b611b8f565b60011c9a049387611b8f565b0494611b8f565b6b033b2e3c9fd0803ce80000000191826b033b2e3c9fd0803ce800000011610430576b033b2e3c9fd0803ce800000093611caf611df892611dfe95611ba2565b90611b8f565b0490565b5f92611d25565b91505090565b508215611cff565b9190611e53836001600160a01b03165f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0160205260405f2090565b6001600160a01b0382165f5260205260405f2054925f198410611e77575b50505050565b828410611ef6576001600160a01b038116156117c1576001600160a01b0382161561179557611ede6001600160a01b03916001600160a01b03165f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0160205260405f2090565b91165f5260205260405f20910390555f808080611e71565b506001600160a01b0383917ffb8f41b2000000000000000000000000000000000000000000000000000000005f521660045260245260445260645ffd5b6001600160a01b0316908115612056576001600160a01b031691821561202a57815f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0060205260405f205481811061201157817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92602092855f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0084520360405f2055845f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00825260405f20818154019055604051908152a3565b8263391434e360e21b5f5260045260245260445260645ffd5b7fec442f05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b7f96c6fd1e000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b7ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a0054916001600160a01b0383169281600411610226575f5f905f80604051966001600160a01b0360208901917fb700961300000000000000000000000000000000000000000000000000000000835216978860248201523060448201527fffffffff0000000000000000000000000000000000000000000000000000000083351660648201526064815261213760848261194d565b5190895afa612144612d16565b90612286575b501561215b575b5050505050600190565b63ffffffff161561227e5760ff60a01b191674010000000000000000000000000000000000000000177ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a0055823b15610226576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af18015610b6e5761226e575b5060ff60a01b197ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a0054167ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a00555f80808080612151565b5f6122789161194d565b5f612218565b505050505f90565b805190929091604083106122c857505081604091810103126102265760406122b060208301612d45565b91015163ffffffff8116810361022657905b5f61214a565b9160208194929410156122dd575b50506122c2565b81925090602091810103126102265760206122f89101612d45565b5f806122d6565b91825167ffffffffffffffff8111610cb55761231c603354611a72565b601f811161255c575b506020601f82116001146124db57819293945f926124d0575b50508160011b915f199060031b1c1916176033555b815167ffffffffffffffff8111610cb55761236f603454611a72565b601f811161242f575b50602092601f82116001146123b357928192935f926123a8575b50508160011b915f199060031b1c191617603455565b015190505f80612392565b601f1982169360345f527f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1915f5b86811061241757508360019596106123ff575b505050811b01603455565b01515f1960f88460031b161c191690555f80806123f4565b919260206001819286850151815501940192016123e1565b60345f52601f820160051c7f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c10190602083106124a8575b601f0160051c7f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c101905b81811061249d5750612378565b5f8155600101612490565b7f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c19150612466565b015190505f8061233e565b601f1982169060335f527f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a82915f5b8181106125445750958360019596971061252c575b505050811b01603355612353565b01515f1960f88460031b161c191690555f808061251e565b9192602060018192868b015181550194019201612509565b60335f52601f820160051c7f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a820190602083106125d5575b601f0160051c7f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a8201905b8181106125ca5750612325565b5f81556001016125bd565b7f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a829150612593565b612605611b01565b9061267b5f549261262961262364ffffffffff8660d01c1642611a3f565b82611ce9565b937fff0000000000ffffffffffffffffffffffffffffffffffffffffffffffffffff7effffffffff00000000000000000000000000000000000000000000000000004260d01b169116175f5583611a3f565b806126835750565b6001600160a01b035f5160206130c15f395f51905f52541690813b15610226576040517f40c10f1900000000000000000000000000000000000000000000000000000000815230600482015260248101829052915f908390604490829084905af1908115610b6e577ff3486c8be7415104f077b000d812e60c482b6824642b7673b3f73d6faeca29a69260209261271f575b50604051908152a1565b5f6127299161194d565b5f612715565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace025491811580156127e0575b156127d457506004915060206001600160a01b035f5160206130c15f395f51905f5254166040519384809263313ce56760e01b82525afa908115610b6e576127af6001926119dc945f916127b55750611ae6565b90612d52565b6127ce915060203d602011610b6757610b59818361194d565b5f610a81565b6119dc92600192612e0a565b50821561275b565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02549181158015612872575b1561286757506004915060206001600160a01b035f5160206130c15f395f51905f5254166040519384809263313ce56760e01b82525afa908115610b6e576127af5f926119dc9484916127b55750611ae6565b6119dc925f92612e0a565b508215612814565b91906001600160a01b03906128ed825f5160206130c15f395f51905f5254169483604051917f23b872dd0000000000000000000000000000000000000000000000000000000060208401521695866024830152306044830152856064830152606482526128e860848361194d565b612f48565b1692831561202a577fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d791816129456040937f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0254611ba2565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0255855f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00602052825f20818154019055855f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60208651858152a382519182526020820152a3565b60206001600160a01b037f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad92168073ffffffffffffffffffffffffffffffffffffffff197ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a005416177ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a0055604051908152a1565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0254806127d457506004915060206001600160a01b035f5160206130c15f395f51905f5254166040519384809263313ce56760e01b82525afa908115610b6e57612ad86001926119dc945f916127b55750611ae6565b90612dbe565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02548061286757506004915060206001600160a01b035f5160206130c15f395f51905f5254166040519384809263313ce56760e01b82525afa908115610b6e57612ad85f926119dc9484916127b55750611ae6565b91936001600160a01b03851694816001600160a01b03851694878603612d05575b505050841561205657845f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0060205260405f2054818110612cec577ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db92826040936001600160a01b0393895f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0060205203845f2055807f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0254037f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02555f887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60208751858152a35f5160206130c15f395f51905f525484517fa9059cbb0000000000000000000000000000000000000000000000000000000060208201526001600160a01b038416602482015260448082018a90528152612cdd9185166128e860648361194d565b835196875260208701521693a4565b8563391434e360e21b5f5260045260245260445260645ffd5b612d0e92611e17565b5f8181612b74565b3d15612d40573d90612d278261196f565b91612d35604051938461194d565b82523d5f602084013e565b606090565b5190811515820361022657565b9190612d6781670de0b6b3a764000085612eab565b916004811015612daa576001809116149081612d8c575b506119dc9250151590611ba2565b80915015610b2b57670de0b6b3a76400006119dc930915155f612d7e565b634e487b7160e01b5f52602160045260245ffd5b612dd1670de0b6b3a76400008383612eab565b916004841015612daa576001806119dc9516149182612df5575b5050151590611ba2565b670de0b6b3a764000092500915155f80612deb565b9291612e17818386612eab565b926004811015612daa576001809116149182612e3d575b50506119dc9250151590611ba2565b9080925015610b2b576119dc930915155f80612e2e565b60ff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460401c1615612e8357565b7fd7e6bcf8000000000000000000000000000000000000000000000000000000005f5260045ffd5b91818302915f1981850993838086109503948086039514612f3b5784831115612f235790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b5050906119dc9250611af7565b905f602091828151910182855af115610b6e575f513d612fac57506001600160a01b0381163b155b612f775750565b6001600160a01b03907f5274afe7000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b60011415612f70565b5f80916040516001600160a01b03602082019163313ce56760e01b835260048152612fe160248261194d565b5192165afa612fee612d16565b9080613028575b613001575b505f905f90565b60208151918180820193849201010312610226575160ff8111612ffa579060ff6001921690565b50602081511015612ff5565b90613071575080511561304957805190602001fd5b7fd6bda275000000000000000000000000000000000000000000000000000000005f5260045ffd5b815115806130b7575b613082575090565b6001600160a01b03907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b1561307a56fe0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00a2646970667358221220e4e4a2766cc1aa55da29fc794c6d7f1dbd8bf459dfd5c50e14bf562a5addf10964736f6c634300081c0033f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00", + "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f3560e01c806301e1d1141461189257806306fdde03146117ed57806307a2d13a146115c4578063095ea7b3146116f25780630a28a477146116cc57806318160ddd1461169057806323b872dd146116585780632c4e722e14611633578063313ce567146115fb57806338d52e0f146115c9578063402d267d1461037a5780634cdad506146115c45780634d0046d51461158c5780634f1ef286146112f857806352d1902d146112665780635a446215146112025780635a5cd45e146111cc5780635c975abb146111ad5780636e553f651461116757806370a08231146102c5578063763e9023146110625780637a9e5e4b14610fbf5780637ee8434914610f3d5780638fb3603714610eaa57806393d239231461076857806394bf804d1461072457806395d89b411461064e578063a9059cbb1461061d578063aa4abe7f146105cb578063ad3cb1cc14610570578063b3d7f6b91461054a578063b460af9414610510578063ba087652146104af578063bf7e214f1461046a578063c046371114610444578063c4ae31681461037f578063c63d75b61461037a578063c6e6f5921461022a578063ce96cb771461031a578063d905777e146102c5578063dd62ed3e1461024c578063ece1d6e51461022f578063ef8b30f71461022a5763f4f9b040146101fd575f80fd5b3461022657604036600319011261022657602061021e602435600435611ce9565b604051908152f35b5f80fd5b611a19565b34610226575f366003190112610226576020600154604051908152f35b34610226576040366003190112610226576102656118fc565b6001600160a01b036102af610278611912565b926001600160a01b03165f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0160205260405f2090565b91165f52602052602060405f2054604051908152f35b3461022657602036600319011261022657602061021e6102e36118fc565b6001600160a01b03165f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0060205260405f205490565b34610226576020366003190112610226576001600160a01b0361033b6118fc565b165f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00602052602061021e60405f2054610374611a4c565b90612ade565b611928565b34610226575f366003190112610226576103a23361039d3633612082565b611aaa565b5f548060f81c6001039060ff821161043057816020917effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fff000000000000000000000000000000000000000000000000000000000000007f1e47f7115d10ca14b574b88c5c0bb005076141cea47318c3a8a7fe177142e8a29560f81b169116175f5560ff60405191168152a1005b634e487b7160e01b5f52601160045260245ffd5b34610226575f36600319011261022657602064ffffffffff5f5460d01c16604051908152f35b34610226575f3660031901126102265760206001600160a01b037ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a005416604051908152f35b34610226576104bd366119df565b905f5460f81c6104e85760209261021e916104df6104d96125fd565b83612ade565b93849133612b53565b7f9e87fac8000000000000000000000000000000000000000000000000000000005f5260045ffd5b346102265761051e366119df565b90915f5460f81c6104e85760209261021e9161054161053b6125fd565b8261272f565b93849233612b53565b3461022657602036600319011261022657602061021e610568611a4c565b600435612a62565b34610226575f366003190112610226576105c760405161059160408261194d565b600581527f352e302e300000000000000000000000000000000000000000000000000000006020820152604051918291826118ac565b0390f35b34610226576020366003190112610226577fcdfe38c4a8f52b3ca6577340cfb5046c68d9854c712200f932e420775132f0b960206004356106103361039d3633612082565b80600155604051908152a1005b34610226576040366003190112610226576106436106396118fc565b6024359033611f33565b602060405160018152f35b34610226575f366003190112610226576040515f60345461066e81611a72565b808452906001811690811561070057506001146106a2575b6105c7836106968185038261194d565b604051918291826118ac565b91905060345f527f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1915f905b8082106106e657509091508101602001610696610686565b9192600181602092548385880101520191019092916106ce565b60ff191660208086019190915291151560051b840190910191506106969050610686565b3461022657604036600319011261022657600435610740611912565b5f5460f81c6104e85761021e60209261076061075a6125fd565b82612a62565b80933361287a565b346102265760a0366003190112610226576107816118fc565b6024356001600160a01b0381168091036102265760443567ffffffffffffffff8111610226576107b59036906004016119c1565b9060643567ffffffffffffffff8111610226576107d69036906004016119c1565b90608435917ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549360ff8560401c16159467ffffffffffffffff811680159081610ea2575b6001149081610e98575b159081610e8f575b50610e675767ffffffffffffffff1981166001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005585610e28575b506001600160a01b03861615610e0057610881612e54565b610889612e54565b8261089381612fb5565b9015610df8575b7fffffffffffffffffffffff00000000000000000000000000000000000000000074ff00000000000000000000000000000000000000005f5160206130c15f395f51905f52549260a01b16911617175f5160206130c15f395f51905f5255610900612e54565b610908612e54565b805167ffffffffffffffff8111610cb5576109437f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0354611a72565b601f8111610d76575b50806020601f8211600114610cd4575f91610cc9575b508160011b915f199060031b1c1916177f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03555b81519567ffffffffffffffff8711610cb5576109d17f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0454611a72565b601f8111610c33575b50602096601f8111600114610b845791610a53602095949284610a58956004999a9b5f91610b79575b508160011b915f199060031b1c1916177f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace04555b610a3e612e54565b610a46612e54565b610a4e612e54565b6129cf565b6122ff565b6040519283809263313ce56760e01b82525afa8015610b6e57610a878391610a8c935f91610b3f575b50611ae6565b611af7565b8115610b2b57610aa891670de0b6b3a76400000490303361287a565b610aae57005b68ff0000000000000000197ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b634e487b7160e01b5f52601260045260245ffd5b610b61915060203d602011610b67575b610b59818361194d565b810190611acd565b86610a81565b503d610b4f565b6040513d5f823e3d90fd5b90508501518c610a03565b601f1981167f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace045f52885f20905f5b818110610c1b575092600183610a539360049a9b9c610a58989660209b9a9810610c03575b5050811b017f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0455610a36565b8701515f1960f88460031b161c191690558c80610bd7565b868b0151835560209a8b019a60019093019201610bb2565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace045f527f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa601f890160051c81019160208a10610cab575b601f0160051c01905b818110610ca057506109da565b5f8155600101610c93565b9091508190610c8a565b634e487b7160e01b5f52604160045260245ffd5b905082015188610962565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace035f9081528181209250601f198416905b818110610d5e57509083600194939210610d46575b5050811b017f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0355610995565b8401515f1960f88460031b161c191690558880610d1a565b91926020600181928689015181550194019201610d05565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace035f527f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0601f830160051c81019160208410610dee575b601f0160051c01905b818110610de3575061094c565b5f8155600101610dd6565b9091508190610dcd565b50601261089a565b7fd92e233d000000000000000000000000000000000000000000000000000000005f5260045ffd5b68ffffffffffffffffff191668010000000000000001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005586610869565b7ff92ee8a9000000000000000000000000000000000000000000000000000000005f5260045ffd5b9050158861082d565b303b159150610825565b87915061081b565b34610226575f366003190112610226577ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a005460a01c60ff1615610f355760207f8fb36037000000000000000000000000000000000000000000000000000000005b7fffffffff0000000000000000000000000000000000000000000000000000000060405191168152f35b60205f610f0b565b34610226576020366003190112610226576001600160a01b03610f5e6118fc565b610f6c3361039d3633612082565b16805f52600260205260405f2054600103600181116104305760207fb4e4c17380256b9cc49fc909cfd80b70b57e922b2ada0ff351665e1da6493bd591835f52600282528060405f2055604051908152a2005b3461022657602036600319011261022657610fd86118fc565b6001600160a01b037ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a005416330361105057803b1561101b57611019906129cf565b005b6001600160a01b03907fc2f31e5e000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b62d1953b60e31b5f523360045260245ffd5b34610226576020366003190112610226576004356001600160d01b03811680910361022657335f52600260205260405f20541580611156575b61112e5760015481116111065760207fe65c987b2e4668e09ba867026921588005b2b2063607a1e7e7d91683c8f91b7b916110d46125fd565b50807fffffffffffff00000000000000000000000000000000000000000000000000005f5416175f55604051908152a1005b7f6a43f8d1000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fc22a648e000000000000000000000000000000000000000000000000000000005f5260045ffd5b506111613633612082565b1561109b565b3461022657604036600319011261022657600435611183611912565b905f5460f81c6104e85761021e6020926111a461119e6125fd565b846127e8565b9283913361287a565b34610226575f3660031901126102265760205f5460f81c604051908152f35b34610226575f366003190112610226576111e4611baf565b670de0b6b3a763ffff19810190811161043057602090604051908152f35b346102265760403660031901126102265760043567ffffffffffffffff8111610226576112339036906004016119c1565b6024359067ffffffffffffffff8211610226576112576110199236906004016119c1565b90610a533361039d3633612082565b34610226575f366003190112610226576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036112d05760206040517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b7fe07c8dba000000000000000000000000000000000000000000000000000000005f5260045ffd5b60403660031901126102265761130c6118fc565b60243567ffffffffffffffff811161022657366023820112156102265761133d90369060248160040135910161198b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803014908115611557575b506112d0576113853361039d3633612082565b6001600160a01b038216916040517f52d1902d000000000000000000000000000000000000000000000000000000008152602081600481875afa5f9181611523575b506113df5783634c9c8ce360e01b5f5260045260245ffd5b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8592036114f85750813b156114e6578073ffffffffffffffffffffffffffffffffffffffff197f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416177f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28151156114b5575f8083602061101995519101845af46114af612d16565b91613034565b5050346114be57005b7fb398979f000000000000000000000000000000000000000000000000000000005f5260045ffd5b634c9c8ce360e01b5f5260045260245ffd5b7faa1d49a4000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b9091506020813d60201161154f575b8161153f6020938361194d565b81010312610226575190856113c7565b3d9150611532565b90506001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416141583611372565b34610226576020366003190112610226576001600160a01b036115ad6118fc565b165f526002602052602060405f2054604051908152f35b6118d6565b34610226575f3660031901126102265760206001600160a01b035f5160206130c15f395f51905f525416604051908152f35b34610226575f3660031901126102265760ff5f5160206130c15f395f51905f525460a01c1660ff811161043057602090604051908152f35b34610226575f3660031901126102265760206001600160d01b035f5416604051908152f35b34610226576060366003190112610226576106436116746118fc565b61167c611912565b6044359161168b833383611e17565b611f33565b34610226575f3660031901126102265760207f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0254604051908152f35b3461022657602036600319011261022657602061021e6116ea611a4c565b60043561272f565b346102265760403660031901126102265761170b6118fc565b6024359033156117c1576001600160a01b031690811561179557335f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0160205260409020825f526020528060405f20556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b7f94280d62000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b7fe602df05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b34610226575f366003190112610226576040515f60335461180d81611a72565b80845290600181169081156107005750600114611834576105c7836106968185038261194d565b91905060335f527f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a82915f905b80821061187857509091508101602001610696610686565b919260018160209254838588010152019101909291611860565b34610226575f36600319011261022657602061021e611a4c565b602060409281835280519182918282860152018484015e5f828201840152601f01601f1916010190565b3461022657602036600319011261022657602061021e6118f4611a4c565b600435612ade565b600435906001600160a01b038216820361022657565b602435906001600160a01b038216820361022657565b34610226576020366003190112610226576119416118fc565b5060206040515f198152f35b90601f8019910116810190811067ffffffffffffffff821117610cb557604052565b67ffffffffffffffff8111610cb557601f01601f191660200190565b9291926119978261196f565b916119a5604051938461194d565b829481845281830111610226578281602093845f960137010152565b9080601f83011215610226578160206119dc9335910161198b565b90565b606090600319011261022657600435906024356001600160a01b038116810361022657906044356001600160a01b03811681036102265790565b3461022657602036600319011261022657602061021e611a37611a4c565b6004356127e8565b9190820391821161043057565b6119dc611a57611b01565b611a6c64ffffffffff5f5460d01c1642611a3f565b90611ce9565b90600182811c92168015611aa0575b6020831014611a8c57565b634e487b7160e01b5f52602260045260245ffd5b91607f1691611a81565b15611ab25750565b6001600160a01b039062d1953b60e31b5f521660045260245ffd5b90816020910312610226575160ff811681036102265790565b60ff16604d811161043057600a0a90565b8115610b2b570490565b602460206001600160a01b035f5160206130c15f395f51905f525416604051928380927f70a082310000000000000000000000000000000000000000000000000000000082523060048301525afa908115610b6e575f91611b60575090565b90506020813d602011611b87575b81611b7b6020938361194d565b81010312610226575190565b3d9150611b6e565b8181029291811591840414171561043057565b9190820180921161043057565b6001600160d01b035f5416801580611cdb576301e1337e91611bd18180611b8f565b6b019d971e4fe8401e740000008101809111610430576b033b2e3c9fd0803ce8000000900491611c018284611b8f565b936b019d971e4fe8401e740000008501809511610430576301e1337f946301e1338094660388828f7b0c8090611c379082611b8f565b60011c96868204148615171561043057828102928184041490151715610430576006916b033b2e3c9fd0803ce8000000611c72920490611b8f565b0492808302928304141715610430576b033b2e3c9fd0803ce800000001806b033b2e3c9fd0803ce80000001161043057611cb492611caf91611ba2565b611ba2565b670de0b6b3a76400008181029190820403610430576b033b2e3c9fd0803ce8000000900490565b5050670de0b6b3a764000090565b906001600160d01b035f54169181158015611e0f575b611e09575f198201828111610430576002831115611e0257600119830183811161043057925b611d2f8580611b8f565b6b019d971e4fe8401e740000008101809111610430576b033b2e3c9fd0803ce80000009004611d5e8682611b8f565b946b019d971e4fe8401e7400000086018096116104305783611da0611db192611da06b033b2e3c9fd0803ce8000000611da5600697611da0611db89b8b611b8f565b611b8f565b60011c9a049387611b8f565b0494611b8f565b6b033b2e3c9fd0803ce80000000191826b033b2e3c9fd0803ce800000011610430576b033b2e3c9fd0803ce800000093611caf611df892611dfe95611ba2565b90611b8f565b0490565b5f92611d25565b91505090565b508215611cff565b9190611e53836001600160a01b03165f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0160205260405f2090565b6001600160a01b0382165f5260205260405f2054925f198410611e77575b50505050565b828410611ef6576001600160a01b038116156117c1576001600160a01b0382161561179557611ede6001600160a01b03916001600160a01b03165f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0160205260405f2090565b91165f5260205260405f20910390555f808080611e71565b506001600160a01b0383917ffb8f41b2000000000000000000000000000000000000000000000000000000005f521660045260245260445260645ffd5b6001600160a01b0316908115612056576001600160a01b031691821561202a57815f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0060205260405f205481811061201157817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92602092855f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0084520360405f2055845f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00825260405f20818154019055604051908152a3565b8263391434e360e21b5f5260045260245260445260645ffd5b7fec442f05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b7f96c6fd1e000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b7ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a0054916001600160a01b0383169281600411610226575f5f905f80604051966001600160a01b0360208901917fb700961300000000000000000000000000000000000000000000000000000000835216978860248201523060448201527fffffffff0000000000000000000000000000000000000000000000000000000083351660648201526064815261213760848261194d565b5190895afa612144612d16565b90612286575b501561215b575b5050505050600190565b63ffffffff161561227e5760ff60a01b191674010000000000000000000000000000000000000000177ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a0055823b15610226576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af18015610b6e5761226e575b5060ff60a01b197ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a0054167ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a00555f80808080612151565b5f6122789161194d565b5f612218565b505050505f90565b805190929091604083106122c857505081604091810103126102265760406122b060208301612d45565b91015163ffffffff8116810361022657905b5f61214a565b9160208194929410156122dd575b50506122c2565b81925090602091810103126102265760206122f89101612d45565b5f806122d6565b91825167ffffffffffffffff8111610cb55761231c603354611a72565b601f811161255c575b506020601f82116001146124db57819293945f926124d0575b50508160011b915f199060031b1c1916176033555b815167ffffffffffffffff8111610cb55761236f603454611a72565b601f811161242f575b50602092601f82116001146123b357928192935f926123a8575b50508160011b915f199060031b1c191617603455565b015190505f80612392565b601f1982169360345f527f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1915f5b86811061241757508360019596106123ff575b505050811b01603455565b01515f1960f88460031b161c191690555f80806123f4565b919260206001819286850151815501940192016123e1565b60345f52601f820160051c7f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c10190602083106124a8575b601f0160051c7f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c101905b81811061249d5750612378565b5f8155600101612490565b7f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c19150612466565b015190505f8061233e565b601f1982169060335f527f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a82915f5b8181106125445750958360019596971061252c575b505050811b01603355612353565b01515f1960f88460031b161c191690555f808061251e565b9192602060018192868b015181550194019201612509565b60335f52601f820160051c7f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a820190602083106125d5575b601f0160051c7f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a8201905b8181106125ca5750612325565b5f81556001016125bd565b7f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a829150612593565b612605611b01565b9061267b5f549261262961262364ffffffffff8660d01c1642611a3f565b82611ce9565b937fff0000000000ffffffffffffffffffffffffffffffffffffffffffffffffffff7effffffffff00000000000000000000000000000000000000000000000000004260d01b169116175f5583611a3f565b806126835750565b6001600160a01b035f5160206130c15f395f51905f52541690813b15610226576040517f40c10f1900000000000000000000000000000000000000000000000000000000815230600482015260248101829052915f908390604490829084905af1908115610b6e577ff3486c8be7415104f077b000d812e60c482b6824642b7673b3f73d6faeca29a69260209261271f575b50604051908152a1565b5f6127299161194d565b5f612715565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace025491811580156127e0575b156127d457506004915060206001600160a01b035f5160206130c15f395f51905f5254166040519384809263313ce56760e01b82525afa908115610b6e576127af6001926119dc945f916127b55750611ae6565b90612d52565b6127ce915060203d602011610b6757610b59818361194d565b5f610a81565b6119dc92600192612e0a565b50821561275b565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02549181158015612872575b1561286757506004915060206001600160a01b035f5160206130c15f395f51905f5254166040519384809263313ce56760e01b82525afa908115610b6e576127af5f926119dc9484916127b55750611ae6565b6119dc925f92612e0a565b508215612814565b91906001600160a01b03906128ed825f5160206130c15f395f51905f5254169483604051917f23b872dd0000000000000000000000000000000000000000000000000000000060208401521695866024830152306044830152856064830152606482526128e860848361194d565b612f48565b1692831561202a577fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d791816129456040937f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0254611ba2565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0255855f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00602052825f20818154019055855f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60208651858152a382519182526020820152a3565b60206001600160a01b037f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad92168073ffffffffffffffffffffffffffffffffffffffff197ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a005416177ff3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a0055604051908152a1565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0254806127d457506004915060206001600160a01b035f5160206130c15f395f51905f5254166040519384809263313ce56760e01b82525afa908115610b6e57612ad86001926119dc945f916127b55750611ae6565b90612dbe565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02548061286757506004915060206001600160a01b035f5160206130c15f395f51905f5254166040519384809263313ce56760e01b82525afa908115610b6e57612ad85f926119dc9484916127b55750611ae6565b91936001600160a01b03851694816001600160a01b03851694878603612d05575b505050841561205657845f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0060205260405f2054818110612cec577ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db92826040936001600160a01b0393895f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0060205203845f2055807f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0254037f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02555f887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60208751858152a35f5160206130c15f395f51905f525484517fa9059cbb0000000000000000000000000000000000000000000000000000000060208201526001600160a01b038416602482015260448082018a90528152612cdd9185166128e860648361194d565b835196875260208701521693a4565b8563391434e360e21b5f5260045260245260445260645ffd5b612d0e92611e17565b5f8181612b74565b3d15612d40573d90612d278261196f565b91612d35604051938461194d565b82523d5f602084013e565b606090565b5190811515820361022657565b9190612d6781670de0b6b3a764000085612eab565b916004811015612daa576001809116149081612d8c575b506119dc9250151590611ba2565b80915015610b2b57670de0b6b3a76400006119dc930915155f612d7e565b634e487b7160e01b5f52602160045260245ffd5b612dd1670de0b6b3a76400008383612eab565b916004841015612daa576001806119dc9516149182612df5575b5050151590611ba2565b670de0b6b3a764000092500915155f80612deb565b9291612e17818386612eab565b926004811015612daa576001809116149182612e3d575b50506119dc9250151590611ba2565b9080925015610b2b576119dc930915155f80612e2e565b60ff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460401c1615612e8357565b7fd7e6bcf8000000000000000000000000000000000000000000000000000000005f5260045ffd5b91818302915f1981850993838086109503948086039514612f3b5784831115612f235790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b5050906119dc9250611af7565b905f602091828151910182855af115610b6e575f513d612fac57506001600160a01b0381163b155b612f775750565b6001600160a01b03907f5274afe7000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b60011415612f70565b5f80916040516001600160a01b03602082019163313ce56760e01b835260048152612fe160248261194d565b5192165afa612fee612d16565b9080613028575b613001575b505f905f90565b60208151918180820193849201010312610226575160ff8111612ffa579060ff6001921690565b50602081511015612ff5565b90613071575080511561304957805190602001fd5b7fd6bda275000000000000000000000000000000000000000000000000000000005f5260045ffd5b815115806130b7575b613082575090565b6001600160a01b03907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b1561307a56fe0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00a2646970667358221220e4e4a2766cc1aa55da29fc794c6d7f1dbd8bf459dfd5c50e14bf562a5addf10964736f6c634300081c0033", + "devdoc": { + "author": "Cooper Labs", + "custom:contact": "security@cooperlabs.xyz", + "details": "This contract is an authorized fork of Angle's SavingsNameable contract: https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/savings/nameable/SavingsNameable.sol", + "errors": { + "AddressEmptyCode(address)": [ + { + "details": "There's no code at `target` (it is not a contract)." + } + ], + "ERC1967InvalidImplementation(address)": [ + { + "details": "The `implementation` of the proxy is invalid." + } + ], + "ERC1967NonPayable()": [ + { + "details": "An upgrade function sees `msg.value > 0` that may be lost." + } + ], + "ERC20InsufficientAllowance(address,uint256,uint256)": [ + { + "details": "Indicates a failure with the `spender`’s `allowance`. Used in transfers.", + "params": { + "allowance": "Amount of tokens a `spender` is allowed to operate with.", + "needed": "Minimum amount required to perform a transfer.", + "spender": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "ERC20InsufficientBalance(address,uint256,uint256)": [ + { + "details": "Indicates an error related to the current `balance` of a `sender`. Used in transfers.", + "params": { + "balance": "Current balance for the interacting account.", + "needed": "Minimum amount required to perform a transfer.", + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC20InvalidApprover(address)": [ + { + "details": "Indicates a failure with the `approver` of a token to be approved. Used in approvals.", + "params": { + "approver": "Address initiating an approval operation." + } + } + ], + "ERC20InvalidReceiver(address)": [ + { + "details": "Indicates a failure with the token `receiver`. Used in transfers.", + "params": { + "receiver": "Address to which tokens are being transferred." + } + } + ], + "ERC20InvalidSender(address)": [ + { + "details": "Indicates a failure with the token `sender`. Used in transfers.", + "params": { + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC20InvalidSpender(address)": [ + { + "details": "Indicates a failure with the `spender` to be approved. Used in approvals.", + "params": { + "spender": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "ERC4626ExceededMaxDeposit(address,uint256,uint256)": [ + { + "details": "Attempted to deposit more assets than the max amount for `receiver`." + } + ], + "ERC4626ExceededMaxMint(address,uint256,uint256)": [ + { + "details": "Attempted to mint more shares than the max amount for `receiver`." + } + ], + "ERC4626ExceededMaxRedeem(address,uint256,uint256)": [ + { + "details": "Attempted to redeem more shares than the max amount for `receiver`." + } + ], + "ERC4626ExceededMaxWithdraw(address,uint256,uint256)": [ + { + "details": "Attempted to withdraw more assets than the max amount for `receiver`." + } + ], + "FailedCall()": [ + { + "details": "A call to an address target failed. The target may have reverted." + } + ], + "InvalidInitialization()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "SafeERC20FailedOperation(address)": [ + { + "details": "An operation with an ERC-20 token failed." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "AuthorityUpdated(address)": { + "details": "Authority that manages this contract was updated." + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `value` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "asset()": { + "details": "See {IERC4626-asset}. " + }, + "authority()": { + "details": "Returns the current authority." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "convertToAssets(uint256)": { + "details": "See {IERC4626-convertToAssets}. " + }, + "convertToShares(uint256)": { + "details": "See {IERC4626-convertToShares}. " + }, + "decimals()": { + "details": "Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This \"original\" value is cached during construction of the vault contract. If this read operation fails (e.g., the asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals. See {IERC20Metadata-decimals}." + }, + "deposit(uint256,address)": { + "details": "See {IERC4626-deposit}. " + }, + "initialize(address,address,string,string,uint256)": { + "details": "A first deposit is done at initialization to protect for the classical issue of ERC4626 contracts where the the first user of the contract tries to steal everyone else's tokens", + "params": { + "_authority": "Reference to the `AccessManagerContract` contract", + "divizer": "Quantifies the first initial deposit (should be typically 1 for tokens like agEUR)", + "name_": "Name of the savings contract", + "symbol_": "Symbol of the savings contract" + } + }, + "isConsumingScheduledOp()": { + "details": "Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs attacker controlled calls." + }, + "maxDeposit(address)": { + "details": "See {IERC4626-maxDeposit}. " + }, + "maxMint(address)": { + "details": "See {IERC4626-maxMint}. " + }, + "maxRedeem(address)": { + "details": "See {IERC4626-maxRedeem}. " + }, + "maxWithdraw(address)": { + "details": "See {IERC4626-maxWithdraw}. " + }, + "mint(uint256,address)": { + "details": "See {IERC4626-mint}. " + }, + "name()": { + "details": "Returns the name of the token." + }, + "previewDeposit(uint256)": { + "details": "See {IERC4626-previewDeposit}. " + }, + "previewMint(uint256)": { + "details": "See {IERC4626-previewMint}. " + }, + "previewRedeem(uint256)": { + "details": "See {IERC4626-previewRedeem}. " + }, + "previewWithdraw(uint256)": { + "details": "See {IERC4626-previewWithdraw}. " + }, + "proxiableUUID()": { + "details": "Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "redeem(uint256,address,address)": { + "details": "See {IERC4626-redeem}. " + }, + "setAuthority(address)": { + "details": "Transfers control to a new authority. The caller must be the current authority." + }, + "setRate(uint208)": { + "details": "Any `rate` can be set by the guardian or by a trusted address provided that it is inferior to the `maxRate` settable by a governor address" + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalAssets()": { + "details": "See {IERC4626-totalAssets}. " + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Skips emitting an {Approval} event indicating an allowance update. This is not required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve]. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`." + }, + "upgradeToAndCall(address,bytes)": { + "custom:oz-upgrades-unsafe-allow-reachable": "delegatecall", + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "withdraw(uint256,address,address)": { + "details": "See {IERC4626-withdraw}. " + } + }, + "title": "SavingsNameable", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "computeUpdatedAssets(uint256,uint256)": { + "notice": "Wrapper on top of the `computeUpdatedAssets` function" + }, + "estimatedAPR()": { + "notice": "Provides an estimated Annual Percentage Rate for base depositors on this contract" + }, + "initialize(address,address,string,string,uint256)": { + "notice": "Initializes the contract" + }, + "isTrustedUpdater(address)": { + "notice": "Checks whether the address is trusted to set the rate" + }, + "lastUpdate()": { + "notice": "Last time rewards were accrued" + }, + "maxRate()": { + "notice": "Maximum inflation rate" + }, + "paused()": { + "notice": "Whether the contract is paused or not" + }, + "rate()": { + "notice": "Inflation rate (per second) in BASE_27" + }, + "setMaxRate(uint256)": { + "notice": "Updates the maximum rate settable" + }, + "setNameAndSymbol(string,string)": { + "notice": "Updates the name and symbol of the token" + }, + "setRate(uint208)": { + "notice": "Updates the inflation rate for depositing `asset` in this contract" + }, + "togglePause()": { + "notice": "Pauses the contract" + }, + "toggleTrusted(address)": { + "notice": "Toggles an address" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 22143, + "contract": "contracts/savings/nameable/SavingsNameable.sol:SavingsNameable", + "label": "rate", + "offset": 0, + "slot": "0", + "type": "t_uint208" + }, + { + "astId": 22146, + "contract": "contracts/savings/nameable/SavingsNameable.sol:SavingsNameable", + "label": "lastUpdate", + "offset": 26, + "slot": "0", + "type": "t_uint40" + }, + { + "astId": 22149, + "contract": "contracts/savings/nameable/SavingsNameable.sol:SavingsNameable", + "label": "paused", + "offset": 31, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 22152, + "contract": "contracts/savings/nameable/SavingsNameable.sol:SavingsNameable", + "label": "maxRate", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 22157, + "contract": "contracts/savings/nameable/SavingsNameable.sol:SavingsNameable", + "label": "isTrustedUpdater", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 22161, + "contract": "contracts/savings/nameable/SavingsNameable.sol:SavingsNameable", + "label": "__gap", + "offset": 0, + "slot": "3", + "type": "t_array(t_uint256)48_storage" + }, + { + "astId": 22899, + "contract": "contracts/savings/nameable/SavingsNameable.sol:SavingsNameable", + "label": "__name", + "offset": 0, + "slot": "51", + "type": "t_string_storage" + }, + { + "astId": 22901, + "contract": "contracts/savings/nameable/SavingsNameable.sol:SavingsNameable", + "label": "__symbol", + "offset": 0, + "slot": "52", + "type": "t_string_storage" + }, + { + "astId": 22905, + "contract": "contracts/savings/nameable/SavingsNameable.sol:SavingsNameable", + "label": "__gapNameable", + "offset": 0, + "slot": "53", + "type": "t_array(t_uint256)48_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)48_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[48]", + "numberOfBytes": "1536" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint208": { + "encoding": "inplace", + "label": "uint208", + "numberOfBytes": "26" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint40": { + "encoding": "inplace", + "label": "uint40", + "numberOfBytes": "5" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/Savings_USDp.json b/deployments/sepolia/Savings_USDp.json new file mode 100644 index 0000000..28b2848 --- /dev/null +++ b/deployments/sepolia/Savings_USDp.json @@ -0,0 +1,1503 @@ +{ + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AccessManagedInvalidAuthority", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delay", + "type": "uint32" + } + ], + "name": "AccessManagedRequiredDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC20InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC20InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC20InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "ERC20InvalidSpender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxMint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxRedeem", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxWithdraw", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRate", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "NotTrusted", + "type": "error" + }, + { + "inputs": [], + "name": "Paused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "interest", + "type": "uint256" + } + ], + "name": "Accrued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxRate", + "type": "uint256" + } + ], + "name": "MaxRateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newRate", + "type": "uint256" + } + ], + "name": "RateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "pauseStatus", + "type": "uint128" + } + ], + "name": "ToggledPause", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "trustedAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "trustedStatus", + "type": "uint256" + } + ], + "name": "ToggledTrusted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "asset", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "authority", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_totalAssets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "exp", + "type": "uint256" + } + ], + "name": "computeUpdatedAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "convertToAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "convertToShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "estimatedAPR", + "outputs": [ + { + "internalType": "uint256", + "name": "apr", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_authority", + "type": "address" + }, + { + "internalType": "contract IERC20Metadata", + "name": "asset_", + "type": "address" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "uint256", + "name": "divizer", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isConsumingScheduledOp", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isTrustedUpdater", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastUpdate", + "outputs": [ + { + "internalType": "uint40", + "name": "", + "type": "uint40" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxMint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "maxRedeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "maxWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "previewDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "previewMint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "previewRedeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "previewWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rate", + "outputs": [ + { + "internalType": "uint208", + "name": "", + "type": "uint208" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "redeem", + "outputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAuthority", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMaxRate", + "type": "uint256" + } + ], + "name": "setMaxRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newName", + "type": "string" + }, + { + "internalType": "string", + "name": "newSymbol", + "type": "string" + } + ], + "name": "setNameAndSymbol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint208", + "name": "newRate", + "type": "uint208" + } + ], + "name": "setRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "togglePause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "trustedAddress", + "type": "address" + } + ], + "name": "toggleTrusted", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "transactionIndex": 93, + "gasUsed": "539511", + "logsBloom": "0x0000000000000000000000000000000040000000000000000000400000000000000000000000000000010000000000000000000000000000100000000000000000080040000000000000000804000200000002000000000000000000000000100000000002000000000000000000080000000000000400000000001000000000000000000000000000080000000000000800080001008000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002200000000002010000000000000000000000c000000000000000020800000002000000000000008000000008000000000000000000000080000000000", + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52", + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "logs": [ + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000eb197439d1425f3129f01f7763ec511df2489095" + ], + "data": "0x", + "logIndex": 383, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + }, + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "topics": [ + "0x2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad" + ], + "data": "0x000000000000000000000000fd28f108e95f4d41daae9dbfff707d677985998e", + "logIndex": 384, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + }, + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0xe8a3DA6f5ed1cf04c58ac7f6A7383641e877517b", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000066ccec236bbce5f1bbd1b2fc0a4014e57a55ad02", + "0x00000000000000000000000023d491aa7c0972087f8a607f6f4c7106a02ba95d" + ], + "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "logIndex": 385, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + }, + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000023d491aa7c0972087f8a607f6f4c7106a02ba95d" + ], + "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "logIndex": 386, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + }, + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "topics": [ + "0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7", + "0x00000000000000000000000066ccec236bbce5f1bbd1b2fc0a4014e57a55ad02", + "0x00000000000000000000000023d491aa7c0972087f8a607f6f4c7106a02ba95d" + ], + "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000", + "logIndex": 387, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + }, + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 388, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + } + ], + "blockNumber": 8411143, + "cumulativeGasUsed": "16548928", + "status": 1, + "byzantium": true + }, + "args": [ + "0xeB197439D1425F3129F01F7763EC511DF2489095", + "0x93d23923000000000000000000000000fd28f108e95f4d41daae9dbfff707d677985998e000000000000000000000000e8a3da6f5ed1cf04c58ac7f6a7383641e877517b00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000b5374616b6564205553447000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000057355534470000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [ + "0xfD28f108e95f4D41daAE9dbfFf707D677985998E", + "0xe8a3DA6f5ed1cf04c58ac7f6A7383641e877517b", + "Staked USDp", + "sUSDp", + "1" + ] + }, + "implementation": "0xeB197439D1425F3129F01F7763EC511DF2489095", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/Savings_USDp_Proxy.json b/deployments/sepolia/Savings_USDp_Proxy.json new file mode 100644 index 0000000..91df770 --- /dev/null +++ b/deployments/sepolia/Savings_USDp_Proxy.json @@ -0,0 +1,198 @@ +{ + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "transactionIndex": 93, + "gasUsed": "539511", + "logsBloom": "0x0000000000000000000000000000000040000000000000000000400000000000000000000000000000010000000000000000000000000000100000000000000000080040000000000000000804000200000002000000000000000000000000100000000002000000000000000000080000000000000400000000001000000000000000000000000000080000000000000800080001008000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002200000000002010000000000000000000000c000000000000000020800000002000000000000008000000008000000000000000000000080000000000", + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52", + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "logs": [ + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000eb197439d1425f3129f01f7763ec511df2489095" + ], + "data": "0x", + "logIndex": 383, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + }, + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "topics": [ + "0x2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad" + ], + "data": "0x000000000000000000000000fd28f108e95f4d41daae9dbfff707d677985998e", + "logIndex": 384, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + }, + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0xe8a3DA6f5ed1cf04c58ac7f6A7383641e877517b", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000066ccec236bbce5f1bbd1b2fc0a4014e57a55ad02", + "0x00000000000000000000000023d491aa7c0972087f8a607f6f4c7106a02ba95d" + ], + "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "logIndex": 385, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + }, + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000023d491aa7c0972087f8a607f6f4c7106a02ba95d" + ], + "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "logIndex": 386, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + }, + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "topics": [ + "0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7", + "0x00000000000000000000000066ccec236bbce5f1bbd1b2fc0a4014e57a55ad02", + "0x00000000000000000000000023d491aa7c0972087f8a607f6f4c7106a02ba95d" + ], + "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000", + "logIndex": 387, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + }, + { + "transactionIndex": 93, + "blockNumber": 8411143, + "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", + "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 388, + "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" + } + ], + "blockNumber": 8411143, + "cumulativeGasUsed": "16548928", + "status": 1, + "byzantium": true + }, + "args": [ + "0xeB197439D1425F3129F01F7763EC511DF2489095", + "0x93d23923000000000000000000000000fd28f108e95f4d41daae9dbfff707d677985998e000000000000000000000000e8a3da6f5ed1cf04c58ac7f6a7383641e877517b00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000b5374616b6564205553447000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000057355534470000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/SettersGovernor.json b/deployments/sepolia/SettersGovernor.json new file mode 100644 index 0000000..ff60619 --- /dev/null +++ b/deployments/sepolia/SettersGovernor.json @@ -0,0 +1,639 @@ +{ + "address": "0xA360E5aD9F17caff53715346888aA0d13541c2F5", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "AlreadyAdded", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralBacked", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAccessManager", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidChainlinkRate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidParams", + "type": "error" + }, + { + "inputs": [], + "name": "ManagerHasAssets", + "type": "error" + }, + { + "inputs": [], + "name": "NotCollateral", + "type": "error" + }, + { + "inputs": [], + "name": "NotTrusted", + "type": "error" + }, + { + "inputs": [], + "name": "OracleUpdateFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requestedDecrease", + "type": "uint256" + } + ], + "name": "SafeERC20FailedDecreaseAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "CollateralAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IERC20[]", + "name": "subCollaterals", + "type": "address[]" + }, + { + "internalType": "bytes", + "name": "config", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct ManagerStorage", + "name": "managerData", + "type": "tuple" + } + ], + "name": "CollateralManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "CollateralRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "whitelistData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "whitelistStatus", + "type": "uint8" + } + ], + "name": "CollateralWhitelistStatusUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "oracleConfig", + "type": "bytes" + } + ], + "name": "OracleSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Recovered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "increase", + "type": "bool" + } + ], + "name": "ReservesAdjusted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isTrusted", + "type": "bool" + }, + { + "indexed": false, + "internalType": "enum TrustedType", + "name": "trustedType", + "type": "uint8" + } + ], + "name": "TrustedToggled", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "addCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "internalType": "uint128", + "name": "amount", + "type": "uint128" + }, + { + "internalType": "bool", + "name": "increase", + "type": "bool" + } + ], + "name": "adjustStablecoins", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "changeAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "recoverERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "internalType": "bool", + "name": "checkExternalManagerBalance", + "type": "bool" + } + ], + "name": "revokeCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newAccessManager", + "type": "address" + } + ], + "name": "setAccessManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "internalType": "bool", + "name": "checkExternalManagerBalance", + "type": "bool" + }, + { + "components": [ + { + "internalType": "contract IERC20[]", + "name": "subCollaterals", + "type": "address[]" + }, + { + "internalType": "bytes", + "name": "config", + "type": "bytes" + } + ], + "internalType": "struct ManagerStorage", + "name": "managerData", + "type": "tuple" + } + ], + "name": "setCollateralManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "internalType": "bytes", + "name": "oracleConfig", + "type": "bytes" + } + ], + "name": "setOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "internalType": "uint8", + "name": "whitelistStatus", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "whitelistData", + "type": "bytes" + } + ], + "name": "setWhitelistStatus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "enum TrustedType", + "name": "t", + "type": "uint8" + } + ], + "name": "toggleTrusted", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "updateOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x32342667fc3d535696f1101e049c5a67f15965709c086eb2b2e2b90c8a9d4b9f", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0xA360E5aD9F17caff53715346888aA0d13541c2F5", + "transactionIndex": 108, + "gasUsed": "2916305", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x18c790bc6b009731934f472b082ed45a8ebeb2b8d6dfa5e3a6081f6862c07173", + "transactionHash": "0x32342667fc3d535696f1101e049c5a67f15965709c086eb2b2e2b90c8a9d4b9f", + "logs": [], + "blockNumber": 8411098, + "cumulativeGasUsed": "21426243", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9d44d918681c9ad36f866ebee034a3d1", + "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AccessManagedUnauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyAdded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CollateralBacked\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAccessManager\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidChainlinkRate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManagerHasAssets\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotCollateral\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotTrusted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleUpdateFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentAllowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestedDecrease\",\"type\":\"uint256\"}],\"name\":\"SafeERC20FailedDecreaseAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"CollateralAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"contract IERC20[]\",\"name\":\"subCollaterals\",\"type\":\"address[]\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct ManagerStorage\",\"name\":\"managerData\",\"type\":\"tuple\"}],\"name\":\"CollateralManagerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"CollateralRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"whitelistData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"whitelistStatus\",\"type\":\"uint8\"}],\"name\":\"CollateralWhitelistStatusUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"oracleConfig\",\"type\":\"bytes\"}],\"name\":\"OracleSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Recovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"increase\",\"type\":\"bool\"}],\"name\":\"ReservesAdjusted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isTrusted\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"enum TrustedType\",\"name\":\"trustedType\",\"type\":\"uint8\"}],\"name\":\"TrustedToggled\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"addCollateral\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"internalType\":\"bool\",\"name\":\"increase\",\"type\":\"bool\"}],\"name\":\"adjustStablecoins\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"changeAllowance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"recoverERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"checkExternalManagerBalance\",\"type\":\"bool\"}],\"name\":\"revokeCollateral\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newAccessManager\",\"type\":\"address\"}],\"name\":\"setAccessManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"checkExternalManagerBalance\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"contract IERC20[]\",\"name\":\"subCollaterals\",\"type\":\"address[]\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"struct ManagerStorage\",\"name\":\"managerData\",\"type\":\"tuple\"}],\"name\":\"setCollateralManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"oracleConfig\",\"type\":\"bytes\"}],\"name\":\"setOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"whitelistStatus\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"whitelistData\",\"type\":\"bytes\"}],\"name\":\"setWhitelistStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"enum TrustedType\",\"name\":\"t\",\"type\":\"uint8\"}],\"name\":\"toggleTrusted\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"}],\"name\":\"updateOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Cooper Labs\",\"custom:contact\":\"security@cooperlabs.xyz\",\"details\":\"This contract is an authorized fork of Angle's `SettersGovernor` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/SettersGovernor.sol\",\"errors\":{\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}],\"SafeERC20FailedDecreaseAllowance(address,uint256,uint256)\":[{\"details\":\"Indicates a failed `decreaseAllowance` request.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC-20 token failed.\"}]},\"kind\":\"dev\",\"methods\":{\"addCollateral(address)\":{\"details\":\"Collateral assets with a fee on transfer are not supported by the system\"},\"adjustStablecoins(address,uint128,bool)\":{\"details\":\"The amount passed here must be an absolute amount\"},\"changeAllowance(address,address,uint256)\":{\"details\":\"This function can typically be used to grant allowance to a newly added manager for it to pull the funds associated to the collateral it corresponds to\"},\"recoverERC20(address,address,address,uint256)\":{\"details\":\"No check is made on the collateral that is redeemed: this function could typically be used by a governance during a manual rebalance of the reserves of the system`collateral` is different from `token` only in the case of a managed collateral\"},\"revokeCollateral(address,bool)\":{\"details\":\"Require `collatInfo.normalizedStables == 0`, that is to say that the collateral is not used to back stablesThe system may still have a non null balance of the collateral that is revoked: this should later be handled through a recoverERC20 callFunds needs to have been withdrew from the manager prior to this call if `checkExternalManagerBalance` is true\"},\"setCollateralManager(address,bool,(address[],bytes))\":{\"details\":\"Funds need to have been withdrawn from the eventual previous manager prior to this call\"}},\"title\":\"SettersGovernor\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addCollateral(address)\":{\"notice\":\"Add `collateral` as a supported collateral in the system\"},\"adjustStablecoins(address,uint128,bool)\":{\"notice\":\"Adjusts the amount of stablecoins issued from `collateral` by `amount`\"},\"changeAllowance(address,address,uint256)\":{\"notice\":\"Sets the allowance of the contract on `token` for `spender` to `amount`\"},\"recoverERC20(address,address,address,uint256)\":{\"notice\":\"Recovers `amount` of `token` from the Parallelizer contract\"},\"revokeCollateral(address,bool)\":{\"notice\":\"Revokes `collateral` from the system\"},\"setAccessManager(address)\":{\"notice\":\"Sets a new access manager address\"},\"setCollateralManager(address,bool,(address[],bytes))\":{\"notice\":\"Sets (or unsets) a collateral manager `collateral`\"},\"setOracle(address,bytes)\":{\"notice\":\"Sets the `oracleConfig` used to read the value of `collateral` for the mint, burn and redemption operations\"},\"setWhitelistStatus(address,uint8,bytes)\":{\"notice\":\"Changes whether a `collateral` can only be handled during burns and redemptions by whitelisted addresses and sets the data used to read into the whitelist\"},\"toggleTrusted(address,uint8)\":{\"notice\":\"Changes the trusted status for `sender` when for selling rewards or updating the normalizer\"},\"updateOracle(address)\":{\"notice\":\"Update oracle data for a given `collateral`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/parallelizer/facets/SettersGovernor.sol\":\"SettersGovernor\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAuthority} from \\\"./IAuthority.sol\\\";\\n\\nlibrary AuthorityUtils {\\n /**\\n * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\\n * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\\n * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\\n */\\n function canCallWithDelay(\\n address authority,\\n address caller,\\n address target,\\n bytes4 selector\\n ) internal view returns (bool immediate, uint32 delay) {\\n (bool success, bytes memory data) = authority.staticcall(\\n abi.encodeCall(IAuthority.canCall, (caller, target, selector))\\n );\\n if (success) {\\n if (data.length >= 0x40) {\\n (immediate, delay) = abi.decode(data, (bool, uint32));\\n } else if (data.length >= 0x20) {\\n immediate = abi.decode(data, (bool));\\n }\\n }\\n return (immediate, delay);\\n }\\n}\\n\",\"keccak256\":\"0xb3875997b0d8705e29aa20fee88e1dfef93df438794ae1ad8ba2eb016a4dd4e4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAccessManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\ninterface IAccessManager {\\n /**\\n * @dev A delayed operation was scheduled.\\n */\\n event OperationScheduled(\\n bytes32 indexed operationId,\\n uint32 indexed nonce,\\n uint48 schedule,\\n address caller,\\n address target,\\n bytes data\\n );\\n\\n /**\\n * @dev A scheduled operation was executed.\\n */\\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev A scheduled operation was canceled.\\n */\\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev Informational labelling for a roleId.\\n */\\n event RoleLabel(uint64 indexed roleId, string label);\\n\\n /**\\n * @dev Emitted when `account` is granted `roleId`.\\n *\\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\\n * otherwise it indicates the execution delay for this account and roleId is updated.\\n */\\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\\n\\n /**\\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\\n */\\n event RoleRevoked(uint64 indexed roleId, address indexed account);\\n\\n /**\\n * @dev Role acting as admin over a given `roleId` is updated.\\n */\\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\\n\\n /**\\n * @dev Role acting as guardian over a given `roleId` is updated.\\n */\\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\\n\\n /**\\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\\n */\\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\\n\\n /**\\n * @dev Target mode is updated (true = closed, false = open).\\n */\\n event TargetClosed(address indexed target, bool closed);\\n\\n /**\\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\\n */\\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\\n\\n /**\\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\\n */\\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\\n\\n error AccessManagerAlreadyScheduled(bytes32 operationId);\\n error AccessManagerNotScheduled(bytes32 operationId);\\n error AccessManagerNotReady(bytes32 operationId);\\n error AccessManagerExpired(bytes32 operationId);\\n error AccessManagerLockedRole(uint64 roleId);\\n error AccessManagerBadConfirmation();\\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\\n error AccessManagerUnauthorizedConsume(address target);\\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\\n\\n /**\\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\\n * & {execute} workflow.\\n *\\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\\n * for future execution.\\n *\\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\\n * the operation can be executed if and only if delay is greater than 0.\\n *\\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\\n *\\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\\n * {AccessManager} documentation.\\n */\\n function canCall(\\n address caller,\\n address target,\\n bytes4 selector\\n ) external view returns (bool allowed, uint32 delay);\\n\\n /**\\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\\n *\\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\\n * disabling any scheduling usage.\\n */\\n function expiration() external view returns (uint32);\\n\\n /**\\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\\n * can be increased without setback (and reset via {revokeRole} in the case event of an\\n * accidental increase). Defaults to 5 days.\\n */\\n function minSetback() external view returns (uint32);\\n\\n /**\\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\\n *\\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\\n */\\n function isTargetClosed(address target) external view returns (bool);\\n\\n /**\\n * @dev Get the role required to call a function.\\n */\\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\\n\\n /**\\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\\n */\\n function getTargetAdminDelay(address target) external view returns (uint32);\\n\\n /**\\n * @dev Get the id of the role that acts as an admin for the given role.\\n *\\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\\n * an operation that is restricted to this role.\\n */\\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role that acts as a guardian for a given role.\\n *\\n * The guardian permission allows canceling operations that have been scheduled under the role.\\n */\\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role current grant delay.\\n *\\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\\n */\\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\\n\\n /**\\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\\n * level.\\n *\\n * Returns:\\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\\n * [1] Current execution delay for the account.\\n * [2] Pending execution delay for the account.\\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\\n */\\n function getAccess(\\n uint64 roleId,\\n address account\\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\\n\\n /**\\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\\n * permission might be associated with an execution delay. {getAccess} can provide more details.\\n */\\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\\n\\n /**\\n * @dev Give a label to a role, for improved role discoverability by UIs.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleLabel} event.\\n */\\n function labelRole(uint64 roleId, string calldata label) external;\\n\\n /**\\n * @dev Add `account` to `roleId`, or change its execution delay.\\n *\\n * This gives the account the authorization to call any function that is restricted to this role. An optional\\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\\n *\\n * If the account has already been granted this role, the execution delay will be updated. This update is not\\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - granted role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleGranted} event.\\n */\\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\\n\\n /**\\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\\n * no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - revoked role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function revokeRole(uint64 roleId, address account) external;\\n\\n /**\\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\\n * the role this call has no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function renounceRole(uint64 roleId, address callerConfirmation) external;\\n\\n /**\\n * @dev Change admin role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleAdminChanged} event\\n */\\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\\n\\n /**\\n * @dev Change guardian role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGuardianChanged} event\\n */\\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\\n\\n /**\\n * @dev Update the delay for granting a `roleId`.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGrantDelayChanged} event.\\n */\\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetFunctionRoleUpdated} event per selector.\\n */\\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\\n\\n /**\\n * @dev Set the delay for changing the configuration of a given target contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetAdminDelayUpdated} event.\\n */\\n function setTargetAdminDelay(address target, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the closed flag for a contract.\\n *\\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetClosed} event.\\n */\\n function setTargetClosed(address target, bool closed) external;\\n\\n /**\\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\\n * operation is not yet scheduled, has expired, was executed, or was canceled.\\n */\\n function getSchedule(bytes32 id) external view returns (uint48);\\n\\n /**\\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\\n * been scheduled.\\n */\\n function getNonce(bytes32 id) external view returns (uint32);\\n\\n /**\\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\\n * required for the caller. The special value zero will automatically set the earliest possible time.\\n *\\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\\n *\\n * Emits a {OperationScheduled} event.\\n *\\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\\n * contract if it is using standard Solidity ABI encoding.\\n */\\n function schedule(\\n address target,\\n bytes calldata data,\\n uint48 when\\n ) external returns (bytes32 operationId, uint32 nonce);\\n\\n /**\\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\\n * execution delay is 0.\\n *\\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\\n *\\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\\n */\\n function execute(address target, bytes calldata data) external payable returns (uint32);\\n\\n /**\\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\\n * operation that is cancelled.\\n *\\n * Requirements:\\n *\\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\\n *\\n * Emits a {OperationCanceled} event.\\n */\\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\\n\\n /**\\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\\n *\\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\\n * with all the verifications that it implies.\\n *\\n * Emit a {OperationExecuted} event.\\n */\\n function consumeScheduledOp(address caller, bytes calldata data) external;\\n\\n /**\\n * @dev Hashing function for delayed operations.\\n */\\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\\n\\n /**\\n * @dev Changes the authority of a target managed by this manager instance.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n */\\n function updateAuthority(address target, address newAuthority) external;\\n}\\n\",\"keccak256\":\"0x9be2d08a326515805bc9cf6315b7953f8d1ebe88abf48c2d645fb1fa8211a0e2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAuthority.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard interface for permissioning originally defined in Dappsys.\\n */\\ninterface IAuthority {\\n /**\\n * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\\n */\\n function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\\n}\\n\",\"keccak256\":\"0x4cc0766bd7fb7b3bafb70afa2a93b6e313a0baec7a35ad1b57505be7861c1030\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1363.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"./IERC20.sol\\\";\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @title IERC1363\\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\\n *\\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\\n */\\ninterface IERC1363 is IERC20, IERC165 {\\n /*\\n * Note: the ERC-165 identifier for this interface is 0xb0202a11.\\n * 0xb0202a11 ===\\n * bytes4(keccak256('transferAndCall(address,uint256)')) ^\\n * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\\n * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\\n * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\\n * bytes4(keccak256('approveAndCall(address,uint256)')) ^\\n * bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\\n */\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferAndCall(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @param data Additional data with no specified format, sent in call to `to`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param from The address which you want to send tokens from.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param from The address which you want to send tokens from.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @param data Additional data with no specified format, sent in call to `to`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to be spent.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function approveAndCall(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to be spent.\\n * @param data Additional data with no specified format, sent in call to `spender`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9b6b3e7803bc5f2f8cd7ad57db8ac1def61a9930a5a3107df4882e028a9605d7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\n\",\"keccak256\":\"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x70f2f713b13b7ce4610bcd0ac9fec0f3cc43693b043abcb8dc40a42a726eb330\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC1363} from \\\"../../../interfaces/IERC1363.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n /**\\n * @dev An operation with an ERC-20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n *\\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n *\\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n *\\n * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\\n * only sets the \\\"standard\\\" allowance. Any temporary allowance will remain active, in addition to the value being\\n * set here.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n if (to.code.length == 0) {\\n safeTransfer(token, to, value);\\n } else if (!token.transferAndCall(to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\\n * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function transferFromAndCallRelaxed(\\n IERC1363 token,\\n address from,\\n address to,\\n uint256 value,\\n bytes memory data\\n ) internal {\\n if (to.code.length == 0) {\\n safeTransferFrom(token, from, to, value);\\n } else if (!token.transferFromAndCall(from, to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\\n * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\\n * once without retrying, and relies on the returned value to be true.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n if (to.code.length == 0) {\\n forceApprove(token, to, value);\\n } else if (!token.approveAndCall(to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n uint256 returnSize;\\n uint256 returnValue;\\n assembly (\\\"memory-safe\\\") {\\n let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n // bubble errors\\n if iszero(success) {\\n let ptr := mload(0x40)\\n returndatacopy(ptr, 0, returndatasize())\\n revert(ptr, returndatasize())\\n }\\n returnSize := returndatasize()\\n returnValue := mload(0)\\n }\\n\\n if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n bool success;\\n uint256 returnSize;\\n uint256 returnValue;\\n assembly (\\\"memory-safe\\\") {\\n success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n returnSize := returndatasize()\\n returnValue := mload(0)\\n }\\n return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\\n }\\n}\\n\",\"keccak256\":\"0x4ea01544758fd2c7045961904686bfe232d2220a04ecaa2d6b08dac17827febf\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/interfaces/IManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IManager` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IManager.sol\\ninterface IManager {\\n /// @notice Returns the amount of collateral managed by the Manager\\n /// @return balances Balances of all the subCollaterals handled by the manager\\n /// @dev MUST NOT revert\\n function totalAssets() external view returns (uint256[] memory balances, uint256 totalValue);\\n\\n /// @notice Hook to invest `amount` of `collateral`\\n /// @dev MUST revert if the manager cannot accept these funds\\n /// @dev MUST have received the funds beforehand\\n function invest(uint256 amount) external;\\n\\n /// @notice Sends `amount` of `collateral` to the `to` address\\n /// @dev Called when `tokenP` are burnt and during redemptions\\n // @dev MUST revert if there are not funds enough available\\n /// @dev MUST be callable only by the parallelizer\\n function release(address asset, address to, uint256 amount) external;\\n\\n /// @notice Gives the maximum amount of collateral immediately available for a transfer\\n /// @dev Useful for integrators using `quoteIn` and `quoteOut`\\n function maxAvailable() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8507172834f0243643fcf366bff6bae8f20523d102f5896f2140946975458e2c\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IParallelizerOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IParallelizerOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IParallelizerOracle` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IParallelizerOracle.sol\\ninterface IParallelizerOracle {\\n /// @notice Reads the oracle value for asset to use in a redemption to compute the collateral ratio\\n function readRedemption() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a mint. It should be comprehensive of the\\n /// deviation from the target price\\n function readMint() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a burn transaction as well as the ratio\\n /// between the current price and the target price for the asset\\n function readBurn() external view returns (uint256 oracleValue, uint256 ratio);\\n\\n /// @notice Reads the oracle value for asset\\n function read() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb7287bfcade62fa4dfb07ea1cd6c1fc8be1525320f3faca44d8d9a6a01e99110\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/ISetters.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/interfaces/IERC20.sol\\\";\\n\\nimport \\\"../parallelizer/Storage.sol\\\";\\n\\n/// @title ISettersGovernor\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `ISettersGovernor` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/ISetters.sol\\ninterface ISettersGovernor {\\n /// @notice Recovers `amount` of `token` from the Parallelizer contract\\n function recoverERC20(address collateral, IERC20 token, address to, uint256 amount) external;\\n\\n /// @notice Sets a new access manager address\\n function setAccessManager(address _newAccessManager) external;\\n\\n /// @notice Sets (or unsets) a collateral manager `collateral`\\n /// @dev If `checkExternalManagerBalance` is true, the function will check that the current manager no longer has\\n /// assets before setting the new manager\\n function setCollateralManager(\\n address collateral,\\n bool checkExternalManagerBalance,\\n ManagerStorage memory managerData\\n )\\n external;\\n\\n /// @notice Sets the allowance of the contract on `token` for `spender` to `amount`\\n function changeAllowance(IERC20 token, address spender, uint256 amount) external;\\n\\n /// @notice Changes the trusted status for `sender` when for selling rewards or updating the normalizer\\n function toggleTrusted(address sender, TrustedType t) external;\\n\\n /// @notice Changes whether a `collateral` can only be handled during burns and redemptions by whitelisted\\n /// addresses\\n /// and sets the data used to read into the whitelist\\n function setWhitelistStatus(address collateral, uint8 whitelistStatus, bytes memory whitelistData) external;\\n\\n /// @notice Add `collateral` as a supported collateral in the system\\n function addCollateral(address collateral) external;\\n\\n /// @notice Adjusts the amount of stablecoins issued from `collateral` by `amount`\\n function adjustStablecoins(address collateral, uint128 amount, bool increase) external;\\n\\n /// @notice Revokes `collateral` from the system\\n /// @dev If `checkExternalManagerBalance` is true, the function will check that the current manager no longer has\\n /// assets before revoking the collateral\\n function revokeCollateral(address collateral, bool checkExternalManagerBalance) external;\\n\\n /// @notice Sets the `oracleConfig` used to read the value of `collateral` for the mint, burn and redemption\\n /// operations\\n function setOracle(address collateral, bytes memory oracleConfig) external;\\n\\n /// @notice Update oracle data for a given `collateral`\\n function updateOracle(address collateral) external;\\n}\\n\\n/// @title ISettersGovernor\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\ninterface ISettersGuardian {\\n /// @notice Changes the pause status for mint or burn transactions for `collateral`\\n function togglePause(address collateral, ActionType action) external;\\n\\n /// @notice Sets the mint or burn fees for `collateral`\\n function setFees(address collateral, uint64[] memory xFee, int64[] memory yFee, bool mint) external;\\n\\n /// @notice Sets the parameters for the redemption curve\\n function setRedemptionCurveParams(uint64[] memory xFee, int64[] memory yFee) external;\\n\\n /// @notice Changes the whitelist status for a collateral with `whitelistType` for an address `who`\\n function toggleWhitelist(WhitelistType whitelistType, address who) external;\\n\\n /// @notice Sets the stablecoin cap that can be issued from a `collateral`\\n function setStablecoinCap(address collateral, uint256 stablecoinCap) external;\\n}\\n\",\"keccak256\":\"0xc3fb2012e7c2f97ae93b12276afc4293aaeb97a6fe4d60109acaa94ef6945575\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/ITokenP.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title ITokenP\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Interface for the stablecoins `tokenP` contracts\\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\\ninterface ITokenP is IERC20 {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MINTER ROLE ONLY FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Lets a whitelisted contract mint tokenPs\\n /// @param account Address to mint to\\n /// @param amount Amount to mint\\n function mint(address account, uint256 amount) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @param sender Address which requested the burn from `burner`\\n /// @dev This method is to be called by a contract with the minter right after being requested\\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\\n /// @dev The method checks the allowance between the `sender` and the `burner`\\n function burnFrom(uint256 amount, address burner, address sender) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\\n /// requested to do so by an address willing to burn tokens from its address\\n function burnSelf(uint256 amount, address burner) external;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Amount of decimals of the stablecoin\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x64a1305faa8c5c91767a11af0eae16e4b463aa0bfe10f11b74aae9d96681a5eb\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\ninterface AggregatorV3Interface {\\n function decimals() external view returns (uint8);\\n\\n function description() external view returns (string memory);\\n\\n function version() external view returns (uint256);\\n\\n // getRoundData and latestRoundData should both raise \\\"No data present\\\"\\n // if they do not have data to report, instead of returning unset values\\n // which could be misinterpreted as actual reported values.\\n function getRoundData(uint80 _roundId)\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n\\n function latestRoundData()\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n}\\n\",\"keccak256\":\"0x94da577160ebb1bfeb7008676c8e7d43dda926d9c0beee29077e9ed774707373\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/coinbase/ICbETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ICbETH\\n/// @notice Interface for the `cbETH` contract\\ninterface ICbETH {\\n function exchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb159341cb0e25c478912b274cdda2d50fa84692aeac87b6823d281aaea2aed04\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/frax/ISfrxETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ISfrxETH\\n/// @notice Interface for the `sfrxETH` contract\\ninterface ISfrxETH {\\n function pricePerShare() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x914cbea276f817c7db62bfca21e15bd8f7892faa9f39d86baaef574cf12b859f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/keyring/IKeyringGuard.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IKeyringGuard\\n/// @notice Interface for the `KeyringGuard` contract\\ninterface IKeyringGuard {\\n function isAuthorized(address from, address to) external returns (bool passed);\\n}\\n\",\"keccak256\":\"0x30bdab602ba0a6e2571372803ae35f7bebcc354d69408be627c04c57f7071f90\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/lido/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IStETH\\n/// @notice Interface for the `StETH` contract\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n\\n function submit(address) external payable returns (uint256);\\n\\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf21e3d8bdadc236b34bf2122b0e0b939d2d6bb6e2889b508636cbb7b84f59680\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/morpho/IMorphoOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IMorphoOracle\\n/// @notice Interface for the oracle contracts used within Morpho\\ninterface IMorphoOracle {\\n function price() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x0d1849803b554763f1dce55eba5a6e8d7c5b12d4cc8dfe23637e827d2ee91d17\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/rocketPool/IRETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IRETH\\n/// @notice Interface for the `rETH` contract\\ninterface IRETH {\\n function getExchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x567a378e95d40160e297c1adb617ccaa69c03e49c4ad72a6ce651dd43cdbd5cd\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/Storage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ENUMS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nenum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n}\\n\\nenum ManagerType {\\n EXTERNAL\\n}\\n\\nenum ActionType {\\n Mint,\\n Burn,\\n Redeem\\n}\\n\\nenum TrustedType {\\n Updater,\\n Seller\\n}\\n\\nenum QuoteType {\\n MintExactInput,\\n MintExactOutput,\\n BurnExactInput,\\n BurnExactOutput\\n}\\n\\nenum OracleReadType {\\n CHAINLINK_FEEDS,\\n EXTERNAL,\\n NO_ORACLE,\\n STABLE,\\n WSTETH,\\n CBETH,\\n RETH,\\n SFRXETH,\\n MAX,\\n MORPHO_ORACLE\\n}\\n\\nenum OracleQuoteType {\\n UNIT,\\n TARGET\\n}\\n\\nenum WhitelistType {\\n BACKED\\n}\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STRUCTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nstruct Permit2Details {\\n address to; // Address that will receive the funds\\n uint256 nonce; // Nonce of the transaction\\n bytes signature; // Permit signature of the user\\n}\\n\\nstruct FacetCut {\\n address facetAddress; // Facet contract address\\n FacetCutAction action; // Can be add, remove or replace\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct Facet {\\n address facetAddress; // Facet contract address\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct FacetInfo {\\n address facetAddress; // Facet contract address\\n uint16 selectorPosition; // Position in the list of all selectors\\n}\\n\\nstruct DiamondStorage {\\n bytes4[] selectors; // List of all available selectors\\n mapping(bytes4 => FacetInfo) selectorInfo; // Selector to (address, position in list)\\n IAccessManager accessManager; // Contract handling access management\\n}\\n\\nstruct ImplementationStorage {\\n address implementation; // Dummy implementation address for Etherscan usability\\n}\\n\\nstruct ManagerStorage {\\n IERC20[] subCollaterals; // Subtokens handled by the manager or strategies\\n bytes config; // Additional configuration data\\n}\\n\\nstruct Collateral {\\n uint8 isManaged; // If the collateral is managed through external strategies\\n uint8 isMintLive; // If minting from this asset is unpaused\\n uint8 isBurnLive; // If burning to this asset is unpaused\\n uint8 decimals; // IERC20Metadata(collateral).decimals()\\n uint8 onlyWhitelisted; // If only whitelisted addresses can burn or redeem for this token\\n uint216 normalizedStables; // Normalized amount of stablecoins issued from this collateral\\n uint64[] xFeeMint; // Increasing exposures in [0,BASE_9[\\n int64[] yFeeMint; // Mint fees at the exposures specified in `xFeeMint`\\n uint64[] xFeeBurn; // Decreasing exposures in ]0,BASE_9]\\n int64[] yFeeBurn; // Burn fees at the exposures specified in `xFeeBurn`\\n bytes oracleConfig; // Data about the oracle used for the collateral\\n bytes whitelistData; // For whitelisted collateral, data used to verify whitelists\\n ManagerStorage managerData; // For managed collateral, data used to handle the strategies\\n uint256 stablecoinCap; // Cap on the amount of stablecoins that can be issued from this collateral\\n}\\n\\nstruct ParallelizerStorage {\\n ITokenP tokenP; // tokenP handled by the system\\n uint8 isRedemptionLive; // If redemption is unpaused\\n uint8 statusReentrant; // If call is reentrant or not\\n bool consumingSchedule; // If the contract is consuming a scheduled operation\\n uint128 normalizedStables; // Normalized amount of stablecoins issued by the system\\n uint128 normalizer; // To reconcile `normalizedStables` values with the actual amount\\n address[] collateralList; // List of collateral assets supported by the system\\n uint64[] xRedemptionCurve; // Increasing collateral ratios > 0\\n int64[] yRedemptionCurve; // Value of the redemption fees at `xRedemptionCurve`\\n mapping(address => Collateral) collaterals; // Maps a collateral asset to its parameters\\n mapping(address => uint256) isTrusted; // If an address is trusted to update the normalizer value\\n mapping(address => uint256) isSellerTrusted; // If an address is trusted to sell accruing reward tokens or to run\\n // keeper jobs on oracles\\n mapping(WhitelistType => mapping(address => uint256)) isWhitelistedForType;\\n}\\n// Whether an address is whitelisted for a specific whitelist type\\n\",\"keccak256\":\"0x3f4313dd110dbe390038320b2d3cf24dcbe9b75cd9573e7f048f7233c02dd227\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/AccessManagedModifiers.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { LibDiamond } from \\\"../libraries/LibDiamond.sol\\\";\\nimport { LibStorage as s, ParallelizerStorage } from \\\"../libraries/LibStorage.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\n\\n/// @title AccessManagedModifiers\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This contract is an authorized fork of Angle's `AccessControlModifiers` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/AccessControlModifiers.sol\\n/// update access logic to use OpenZeppelin's `AccessManaged` logic\\ncontract AccessManagedModifiers {\\n /// @notice Checks whether the `msg.sender` can call a function with a given selector\\n modifier restricted() {\\n if (!LibDiamond.checkCanCall(msg.sender, msg.data)) revert AccessManagedUnauthorized(msg.sender);\\n _;\\n }\\n\\n /// @notice Prevents a contract from calling itself, directly or indirectly\\n /// @dev This implementation is an adaptation of the OpenZepellin `ReentrancyGuard` for the purpose of this\\n /// Diamond Proxy system. The base implementation can be found here\\n /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol\\n modifier nonReentrant() {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n // Reentrant protection\\n // On the first call, `ts.statusReentrant` will be `NOT_ENTERED`\\n if (ts.statusReentrant == ENTERED) revert ReentrantCall();\\n // Any calls to the `nonReentrant` modifier after this point will fail\\n ts.statusReentrant = ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n ts.statusReentrant = NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0xa23f4434f86462af0594992bd826ba6af88f55201f2a7f79ce5fde05b5f10073\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/SettersGovernor.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/interfaces/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport { ISettersGovernor } from \\\"contracts/interfaces/ISetters.sol\\\";\\n\\nimport { LibManager } from \\\"../libraries/LibManager.sol\\\";\\nimport { LibOracle } from \\\"../libraries/LibOracle.sol\\\";\\nimport { LibSetters } from \\\"../libraries/LibSetters.sol\\\";\\nimport { LibStorage as s } from \\\"../libraries/LibStorage.sol\\\";\\nimport { AccessManagedModifiers } from \\\"./AccessManagedModifiers.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title SettersGovernor\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This contract is an authorized fork of Angle's `SettersGovernor` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/SettersGovernor.sol\\ncontract SettersGovernor is AccessManagedModifiers, ISettersGovernor {\\n using SafeERC20 for IERC20;\\n\\n event Recovered(address indexed token, address indexed to, uint256 amount);\\n\\n /// @inheritdoc ISettersGovernor\\n /// @dev No check is made on the collateral that is redeemed: this function could typically be used by a\\n /// governance during a manual rebalance of the reserves of the system\\n /// @dev `collateral` is different from `token` only in the case of a managed collateral\\n function recoverERC20(address collateral, IERC20 token, address to, uint256 amount) external restricted {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.isManaged > 0) LibManager.release(address(token), to, amount, collatInfo.managerData.config);\\n else token.safeTransfer(to, amount);\\n emit Recovered(address(token), to, amount);\\n }\\n\\n /// @inheritdoc ISettersGovernor\\n function setAccessManager(address _newAccessManager) external restricted {\\n LibSetters.setAccessManager(IAccessManager(_newAccessManager));\\n }\\n\\n /// @inheritdoc ISettersGovernor\\n /// @dev Funds need to have been withdrawn from the eventual previous manager prior to this call\\n function setCollateralManager(\\n address collateral,\\n bool checkExternalManagerBalance,\\n ManagerStorage memory managerData\\n )\\n external\\n restricted\\n {\\n LibSetters.setCollateralManager(collateral, checkExternalManagerBalance, managerData);\\n }\\n\\n /// @inheritdoc ISettersGovernor\\n /// @dev This function can typically be used to grant allowance to a newly added manager for it to pull the\\n /// funds associated to the collateral it corresponds to\\n function changeAllowance(IERC20 token, address spender, uint256 amount) external restricted {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < amount) {\\n token.safeIncreaseAllowance(spender, amount - currentAllowance);\\n } else if (currentAllowance > amount) {\\n token.safeDecreaseAllowance(spender, currentAllowance - amount);\\n }\\n }\\n\\n /// @inheritdoc ISettersGovernor\\n function toggleTrusted(address sender, TrustedType t) external restricted {\\n LibSetters.toggleTrusted(sender, t);\\n }\\n\\n /// @inheritdoc ISettersGovernor\\n /// @dev Collateral assets with a fee on transfer are not supported by the system\\n function addCollateral(address collateral) external restricted {\\n LibSetters.addCollateral(collateral);\\n }\\n\\n /// @inheritdoc ISettersGovernor\\n /// @dev The amount passed here must be an absolute amount\\n function adjustStablecoins(address collateral, uint128 amount, bool increase) external restricted {\\n LibSetters.adjustStablecoins(collateral, amount, increase);\\n }\\n\\n /// @inheritdoc ISettersGovernor\\n /// @dev Require `collatInfo.normalizedStables == 0`, that is to say that the collateral\\n /// is not used to back stables\\n /// @dev The system may still have a non null balance of the collateral that is revoked: this should later\\n /// be handled through a recoverERC20 call\\n /// @dev Funds needs to have been withdrew from the manager prior to this call if `checkExternalManagerBalance` is\\n /// true\\n function revokeCollateral(address collateral, bool checkExternalManagerBalance) external restricted {\\n LibSetters.revokeCollateral(collateral, checkExternalManagerBalance);\\n }\\n\\n /// @inheritdoc ISettersGovernor\\n function setOracle(address collateral, bytes memory oracleConfig) external restricted {\\n LibSetters.setOracle(collateral, oracleConfig);\\n }\\n\\n function updateOracle(address collateral) external {\\n if (s.transmuterStorage().isSellerTrusted[msg.sender] == 0) revert NotTrusted();\\n LibOracle.updateOracle(collateral);\\n }\\n\\n /// @inheritdoc ISettersGovernor\\n function setWhitelistStatus(\\n address collateral,\\n uint8 whitelistStatus,\\n bytes memory whitelistData\\n )\\n external\\n restricted\\n {\\n LibSetters.setWhitelistStatus(collateral, whitelistStatus, whitelistData);\\n }\\n}\\n\",\"keccak256\":\"0x93505a5a25783512cc9ebe557b4383b194de5bd18931430df40d7c85e75b2612\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibDiamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { AuthorityUtils } from \\\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibDiamond\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Helper library to deal with diamond proxies.\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/libraries/LibDiamond.sol by mudgen\\nlibrary LibDiamond {\\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n function isGovernor(address caller) internal view returns (bool) {\\n (bool isMember,) = s.diamondStorage().accessManager.hasRole(GOVERNOR_ROLE, caller);\\n return isMember;\\n }\\n\\n /// @notice Checks whether `caller` can call `data` on `this`\\n function checkCanCall(address caller, bytes calldata data) internal returns (bool) {\\n IAccessManager accessManager = s.diamondStorage().accessManager;\\n (bool immediate, uint32 delay) =\\n AuthorityUtils.canCallWithDelay(address(accessManager), caller, address(this), bytes4(data[0:4]));\\n if (!immediate) {\\n if (delay > 0) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n ts.consumingSchedule = true;\\n accessManager.consumeScheduledOp(caller, data);\\n ts.consumingSchedule = false;\\n } else {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @notice Internal function version of `diamondCut`\\n function diamondCut(FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {\\n uint256 diamondCutLength = _diamondCut.length;\\n for (uint256 facetIndex; facetIndex < diamondCutLength; facetIndex++) {\\n bytes4[] memory functionSelectors = _diamondCut[facetIndex].functionSelectors;\\n address facetAddress = _diamondCut[facetIndex].facetAddress;\\n\\n if (functionSelectors.length == 0) {\\n revert NoSelectorsProvidedForFacetForCut(facetAddress);\\n }\\n\\n FacetCutAction action = _diamondCut[facetIndex].action;\\n if (action == FacetCutAction.Add) {\\n _addFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Replace) {\\n _replaceFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Remove) {\\n _removeFunctions(facetAddress, functionSelectors);\\n }\\n }\\n\\n emit DiamondCut(_diamondCut, _init, _calldata);\\n _initializeDiamondCut(_init, _calldata);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n PRIVATE FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Does a delegate call on `_init` with `_calldata`\\n function _initializeDiamondCut(address _init, bytes memory _calldata) private {\\n if (_init == address(0)) {\\n return;\\n }\\n _enforceHasContractCode(_init);\\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n if (!success) {\\n if (error.length > 0) {\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(error)\\n revert(add(32, error), returndata_size)\\n }\\n } else {\\n revert InitializationFunctionReverted(_init, _calldata);\\n }\\n }\\n }\\n\\n /// @notice Adds a new function to the diamond proxy\\n /// @dev Reverts if selectors are already existing\\n function _addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n if (_facetAddress == address(0)) {\\n revert CannotAddSelectorsToZeroAddress(_functionSelectors);\\n }\\n DiamondStorage storage ds = s.diamondStorage();\\n uint16 selectorCount = uint16(ds.selectors.length);\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n if (oldFacetAddress != address(0)) {\\n revert CannotAddFunctionToDiamondThatAlreadyExists(selector);\\n }\\n ds.selectorInfo[selector] = FacetInfo(_facetAddress, selectorCount);\\n ds.selectors.push(selector);\\n selectorCount++;\\n }\\n }\\n\\n /// @notice Upgrades a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n if (_facetAddress == address(0)) {\\n revert CannotReplaceFunctionsFromFacetWithZeroAddress(_functionSelectors);\\n }\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n // Can't replace immutable functions -- functions defined directly in the diamond in this case\\n if (oldFacetAddress == address(this)) {\\n revert CannotReplaceImmutableFunction(selector);\\n }\\n if (oldFacetAddress == _facetAddress) {\\n revert CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(selector);\\n }\\n if (oldFacetAddress == address(0)) {\\n revert CannotReplaceFunctionThatDoesNotExists(selector);\\n }\\n // Replace old facet address\\n ds.selectorInfo[selector].facetAddress = _facetAddress;\\n }\\n }\\n\\n /// @notice Removes a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n uint256 selectorCount = ds.selectors.length;\\n if (_facetAddress != address(0)) {\\n revert RemoveFacetAddressMustBeZeroAddress(_facetAddress);\\n }\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n FacetInfo memory oldFacetAddressAndSelectorPosition = ds.selectorInfo[selector];\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(0)) {\\n revert CannotRemoveFunctionThatDoesNotExist(selector);\\n }\\n\\n // Can't remove immutable functions -- functions defined directly in the diamond\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(this)) {\\n revert CannotRemoveImmutableFunction(selector);\\n }\\n // Replace selector with last selector\\n selectorCount--;\\n if (oldFacetAddressAndSelectorPosition.selectorPosition != selectorCount) {\\n bytes4 lastSelector = ds.selectors[selectorCount];\\n ds.selectors[oldFacetAddressAndSelectorPosition.selectorPosition] = lastSelector;\\n ds.selectorInfo[lastSelector].selectorPosition = oldFacetAddressAndSelectorPosition.selectorPosition;\\n }\\n // Delete last selector\\n ds.selectors.pop();\\n delete ds.selectorInfo[selector];\\n }\\n }\\n\\n /// @notice Checks that an address has a non void bytecode\\n function _enforceHasContractCode(address _contract) private view {\\n uint256 contractSize;\\n assembly (\\\"memory-safe\\\") {\\n contractSize := extcodesize(_contract)\\n }\\n if (contractSize == 0) {\\n revert ContractHasNoCode();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x10bde4c13cc3d3c4aec15b793565bfe05b5f770eafeb839bfd159dbe6351dc62\",\"license\":\"MIT\"},\"contracts/parallelizer/libraries/LibManager.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IManager } from \\\"contracts/interfaces/IManager.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Managed collateral assets may be handled through external smart contracts or directly through this library\\n/// @dev There is no implementation at this point for a managed collateral handled through this library, and\\n/// a new specific `ManagerType` would need to be added in this case\\n/// @dev This library is an authorized fork of Angle's `LibManager` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibManager.sol\\nlibrary LibManager {\\n /// @notice Checks to which address managed funds must be transferred\\n function transferRecipient(bytes memory config) internal view returns (address recipient) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n recipient = address(this);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (address));\\n }\\n\\n /// @notice Performs a transfer of `token` for a collateral that is managed to a `to` address\\n /// @dev `token` may not be the actual collateral itself, as some collaterals have subcollaterals associated\\n /// with it\\n /// @dev Eventually pulls funds from strategies\\n function release(address token, address to, uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).release(token, to, amount);\\n }\\n\\n /// @notice Gets the balances of all the tokens controlled through `managerData`\\n /// @return balances An array of size `subCollaterals` with current balances of all subCollaterals\\n /// including the one corresponding to the `managerData` given\\n /// @return totalValue The value of all the `subCollaterals` in `collateral`\\n /// @dev `subCollaterals` must always have as first token (index 0) the collateral itself\\n function totalAssets(bytes memory config) internal view returns (uint256[] memory balances, uint256 totalValue) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).totalAssets();\\n }\\n\\n /// @notice Calls a hook if needed after new funds have been transfered to a manager\\n function invest(uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).invest(amount);\\n }\\n\\n /// @notice Returns available underlying tokens, for instance if liquidity is fully used and\\n /// not withdrawable the function will return 0\\n function maxAvailable(bytes memory config) internal view returns (uint256 available) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).maxAvailable();\\n }\\n\\n /// @notice Decodes the `managerData` associated to a collateral\\n function parseManagerConfig(bytes memory config) internal pure returns (ManagerType managerType, bytes memory data) {\\n (managerType, data) = abi.decode(config, (ManagerType, bytes));\\n }\\n}\\n\",\"keccak256\":\"0x18282c744bc34bd9ae937c0c49e909c9c4e50c15e69fb485aa68fc56e549d1a1\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IParallelizerOracle } from \\\"contracts/interfaces/IParallelizerOracle.sol\\\";\\nimport { AggregatorV3Interface } from \\\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\\\";\\nimport { IMorphoOracle } from \\\"contracts/interfaces/external/morpho/IMorphoOracle.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibOracle` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibOracle.sol\\nlibrary LibOracle {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ACTIONS SPECIFIC ORACLES \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads the oracle value used during a redemption to compute collateral ratio for `oracleConfig`\\n /// @dev This value is only sensitive to compute the collateral ratio and deduce a penalty factor\\n function readRedemption(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (OracleReadType oracleType, OracleReadType targetType, bytes memory oracleData, bytes memory targetData,) =\\n _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readRedemption();\\n } else {\\n (oracleValue,) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, 0);\\n return oracleValue;\\n }\\n }\\n\\n /// @notice Reads the oracle value used during mint operations for an asset with `oracleConfig`\\n /// @dev For assets which do not rely on external oracles, this value is the minimum between the processed oracle\\n /// value for the asset and its target price\\n function readMint(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readMint();\\n }\\n\\n (uint128 userDeviation,) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n if (targetPrice < oracleValue) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads the oracle value used for a burn operation for an asset with `oracleConfig`\\n /// @return oracleValue The actual oracle value obtained\\n /// @return ratio If `oracle value < target price`, the ratio between the oracle value and the target\\n /// price, otherwise `BASE_18`\\n function readBurn(bytes memory oracleConfig) internal view returns (uint256 oracleValue, uint256 ratio) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readBurn();\\n }\\n (uint128 userDeviation, uint128 burnRatioDeviation) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n // Firewall in case the oracle value reported is low compared to the target\\n // If the oracle value is slightly below its target, then no deviation is reported for the oracle and\\n // the price of burning the stablecoin for other assets is not impacted. Also, the oracle value of this asset\\n // is set to the target price, to not be open to direct arbitrage\\n ratio = BASE_18;\\n if (oracleValue * BASE_18 < targetPrice * (BASE_18 - burnRatioDeviation)) {\\n ratio = (oracleValue * BASE_18) / targetPrice;\\n } else if (oracleValue < targetPrice) {\\n oracleValue = targetPrice;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n VIEW FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of the `getOracle` function\\n function getOracle(address collateral)\\n internal\\n view\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return _parseOracleConfig(s.transmuterStorage().collaterals[collateral].oracleConfig);\\n }\\n\\n /// @notice Gets the oracle value and the ratio with respect to the target price when it comes to\\n /// burning for `collateral`\\n function getBurnOracle(\\n address collateral,\\n bytes memory oracleConfig\\n )\\n internal\\n view\\n returns (uint256 minRatio, uint256 oracleValue)\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n minRatio = BASE_18;\\n address[] memory collateralList = ts.collateralList;\\n uint256 length = collateralList.length;\\n for (uint256 i; i < length; ++i) {\\n uint256 ratioObserved = BASE_18;\\n if (collateralList[i] != collateral) {\\n (, ratioObserved) = readBurn(ts.collaterals[collateralList[i]].oracleConfig);\\n } else {\\n (oracleValue, ratioObserved) = readBurn(oracleConfig);\\n }\\n if (ratioObserved < minRatio) minRatio = ratioObserved;\\n }\\n }\\n\\n /// @notice Computes the `quoteAmount` (for Chainlink oracles) depending on a `quoteType` and a base value\\n /// (e.g the target price of the asset)\\n /// @dev For cases where the Chainlink feed directly looks into the value of the asset, `quoteAmount` is `BASE_18`.\\n /// For others, like wstETH for which Chainlink only has an oracle for stETH, `quoteAmount` is the target price\\n function quoteAmount(OracleQuoteType quoteType, uint256 baseValue) internal pure returns (uint256) {\\n if (quoteType == OracleQuoteType.UNIT) return BASE_18;\\n else return baseValue;\\n }\\n\\n function readSpotAndTarget(\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n uint256 deviation\\n )\\n internal\\n view\\n returns (uint256 oracleValue, uint256 targetPrice)\\n {\\n targetPrice = read(targetType, BASE_18, targetData);\\n oracleValue = read(oracleType, targetPrice, oracleData);\\n // System may tolerate small deviations from target\\n // If the oracle value reported is reasonably close to the target\\n // --> disregard the oracle value and return the target price\\n if (\\n targetPrice * (BASE_18 - deviation) < oracleValue * BASE_18\\n && oracleValue * BASE_18 < targetPrice * (BASE_18 + deviation)\\n ) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads an oracle value (or a target oracle value) for an asset based on its data parsed `oracleConfig`\\n function read(OracleReadType readType, uint256 baseValue, bytes memory data) internal view returns (uint256) {\\n if (readType == OracleReadType.CHAINLINK_FEEDS) {\\n (\\n AggregatorV3Interface[] memory circuitChainlink,\\n uint32[] memory stalePeriods,\\n uint8[] memory circuitChainIsMultiplied,\\n uint8[] memory chainlinkDecimals,\\n OracleQuoteType quoteType\\n ) = abi.decode(data, (AggregatorV3Interface[], uint32[], uint8[], uint8[], OracleQuoteType));\\n uint256 quotePrice = quoteAmount(quoteType, baseValue);\\n uint256 listLength = circuitChainlink.length;\\n for (uint256 i; i < listLength; ++i) {\\n quotePrice = readChainlinkFeed(\\n quotePrice, circuitChainlink[i], circuitChainIsMultiplied[i], chainlinkDecimals[i], stalePeriods[i]\\n );\\n }\\n return quotePrice;\\n } else if (readType == OracleReadType.STABLE) {\\n return BASE_18;\\n } else if (readType == OracleReadType.NO_ORACLE) {\\n return baseValue;\\n } else if (readType == OracleReadType.WSTETH) {\\n return STETH.getPooledEthByShares(1 ether);\\n } else if (readType == OracleReadType.CBETH) {\\n return CBETH.exchangeRate();\\n } else if (readType == OracleReadType.RETH) {\\n return RETH.getExchangeRate();\\n } else if (readType == OracleReadType.SFRXETH) {\\n return SFRXETH.pricePerShare();\\n } else if (readType == OracleReadType.MAX) {\\n uint256 maxValue = abi.decode(data, (uint256));\\n return maxValue;\\n } else if (readType == OracleReadType.MORPHO_ORACLE) {\\n (address contractAddress, uint256 normalizationFactor) = abi.decode(data, (address, uint256));\\n return IMorphoOracle(contractAddress).price() / normalizationFactor;\\n }\\n // If the `OracleReadType` is `EXTERNAL`, it means that this function is called to compute a\\n // `targetPrice` in which case the `baseValue` is returned here\\n else {\\n return baseValue;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n SPECIFIC HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads a Chainlink feed using a quote amount and converts the quote amount to the out-currency\\n /// @param _quoteAmount The amount for which to compute the price expressed in `BASE_18`\\n /// @param feed Chainlink feed to query\\n /// @param multiplied Whether the ratio outputted by Chainlink should be multiplied or divided to the `quoteAmount`\\n /// @param decimals Number of decimals of the corresponding Chainlink pair\\n /// @return The `quoteAmount` converted in out-currency\\n function readChainlinkFeed(\\n uint256 _quoteAmount,\\n AggregatorV3Interface feed,\\n uint8 multiplied,\\n uint256 decimals,\\n uint32 stalePeriod\\n )\\n internal\\n view\\n returns (uint256)\\n {\\n (, int256 ratio,, uint256 updatedAt,) = feed.latestRoundData();\\n if (ratio <= 0 || block.timestamp - updatedAt > stalePeriod) revert InvalidChainlinkRate();\\n // Checking whether we should multiply or divide by the ratio computed\\n if (multiplied == 1) return (_quoteAmount * uint256(ratio)) / (10 ** decimals);\\n else return (_quoteAmount * (10 ** decimals)) / uint256(ratio);\\n }\\n\\n /// @notice Parses an `oracleConfig` into several sub fields\\n function _parseOracleConfig(bytes memory oracleConfig)\\n private\\n pure\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return abi.decode(oracleConfig, (OracleReadType, OracleReadType, bytes, bytes, bytes));\\n }\\n\\n function updateOracle(address collateral) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n if (ts.collaterals[collateral].decimals == 0) revert NotCollateral();\\n\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(ts.collaterals[collateral].oracleConfig);\\n\\n if (targetType != OracleReadType.MAX) revert OracleUpdateFailed();\\n uint256 oracleValue = read(oracleType, BASE_18, oracleData);\\n\\n uint256 maxValue = abi.decode(targetData, (uint256));\\n if (oracleValue > maxValue) {\\n ts.collaterals[collateral].oracleConfig = abi.encode(\\n oracleType,\\n targetType,\\n oracleData,\\n // There are no checks whether the value increased or not\\n abi.encode(oracleValue),\\n hyperparameters\\n );\\n } else {\\n revert OracleUpdateFailed();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x24f504bdd0b7346a447d646a2b2b19afe1a71ee829a59e5cb2ac5fac320611d7\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibSetters.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { SafeCast } from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport { IERC20Metadata } from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\nimport { LibManager } from \\\"./LibManager.sol\\\";\\nimport { LibOracle } from \\\"./LibOracle.sol\\\";\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\nimport { LibDiamond } from \\\"./LibDiamond.sol\\\";\\nimport { LibWhitelist } from \\\"./LibWhitelist.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibSetters\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibSetters` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibSetters.sol\\nlibrary LibSetters {\\n using SafeCast for uint256;\\n\\n event CollateralAdded(address indexed collateral);\\n event CollateralManagerSet(address indexed collateral, ManagerStorage managerData);\\n event CollateralRevoked(address indexed collateral);\\n event CollateralWhitelistStatusUpdated(address indexed collateral, bytes whitelistData, uint8 whitelistStatus);\\n event FeesSet(address indexed collateral, uint64[] xFee, int64[] yFee, bool mint);\\n event OracleSet(address indexed collateral, bytes oracleConfig);\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n event PauseToggled(address indexed collateral, uint256 pausedType, bool isPaused);\\n event RedemptionCurveParamsSet(uint64[] xFee, int64[] yFee);\\n event ReservesAdjusted(address indexed collateral, uint256 amount, bool increase);\\n event StablecoinCapSet(address indexed collateral, uint256 stablecoinCap);\\n event TrustedToggled(address indexed sender, bool isTrusted, TrustedType trustedType);\\n event WhitelistStatusToggled(WhitelistType whitelistType, address indexed who, uint256 whitelistStatus);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ONLY GOVERNOR ACTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of `setAccessManager`\\n function setAccessManager(IAccessManager _newAccessManager) internal {\\n if (address(_newAccessManager).code.length == 0) revert InvalidAccessManager();\\n DiamondStorage storage ds = s.diamondStorage();\\n address previousAccessManager = address(ds.accessManager);\\n ds.accessManager = _newAccessManager;\\n emit OwnershipTransferred(previousAccessManager, address(_newAccessManager));\\n }\\n\\n /// @notice Internal version of `setCollateralManager`\\n function setCollateralManager(\\n address collateral,\\n bool checkExternalManagerBalance,\\n ManagerStorage memory managerData\\n )\\n internal\\n {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n uint8 isManaged = collatInfo.isManaged;\\n if (isManaged > 0 && checkExternalManagerBalance) {\\n (, uint256 totalValue) = LibManager.totalAssets(collatInfo.managerData.config);\\n if (totalValue > 0) revert ManagerHasAssets();\\n }\\n if (managerData.config.length != 0) {\\n // The first subCollateral given should be the actual collateral asset\\n if (address(managerData.subCollaterals[0]) != collateral) revert InvalidParams();\\n // Sanity check on the manager data that is passed\\n LibManager.parseManagerConfig(managerData.config);\\n collatInfo.isManaged = 1;\\n } else {\\n collatInfo.isManaged = 0;\\n }\\n collatInfo.managerData = managerData;\\n emit CollateralManagerSet(collateral, managerData);\\n }\\n\\n /// @notice Internal version of `toggleTrusted`\\n function toggleTrusted(address sender, TrustedType t) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint256 trustedStatus;\\n if (t == TrustedType.Updater) {\\n trustedStatus = 1 - ts.isTrusted[sender];\\n ts.isTrusted[sender] = trustedStatus;\\n } else {\\n trustedStatus = 1 - ts.isSellerTrusted[sender];\\n ts.isSellerTrusted[sender] = trustedStatus;\\n }\\n emit TrustedToggled(sender, trustedStatus == 1, t);\\n }\\n\\n /// @notice Internal version of `addCollateral`\\n function addCollateral(address collateral) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals != 0) revert AlreadyAdded();\\n collatInfo.decimals = uint8(IERC20Metadata(collateral).decimals());\\n ts.collateralList.push(collateral);\\n emit CollateralAdded(collateral);\\n }\\n\\n /// @notice Internal version of `adjustStablecoins`\\n function adjustStablecoins(address collateral, uint128 amount, bool increase) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n uint128 normalizedAmount = ((amount * BASE_27) / ts.normalizer).toUint128();\\n if (increase) {\\n collatInfo.normalizedStables = collatInfo.normalizedStables + uint216(normalizedAmount);\\n ts.normalizedStables = ts.normalizedStables + normalizedAmount;\\n } else {\\n collatInfo.normalizedStables = collatInfo.normalizedStables - uint216(normalizedAmount);\\n ts.normalizedStables = ts.normalizedStables - normalizedAmount;\\n }\\n emit ReservesAdjusted(collateral, amount, increase);\\n }\\n\\n /// @notice Internal version of `revokeCollateral`\\n function revokeCollateral(address collateral, bool checkExternalManagerBalance) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n if (collatInfo.normalizedStables > 0) revert CollateralBacked();\\n uint8 isManaged = collatInfo.isManaged;\\n if (isManaged > 0 && checkExternalManagerBalance) {\\n (, uint256 totalValue) = LibManager.totalAssets(collatInfo.managerData.config);\\n if (totalValue > 0) revert ManagerHasAssets();\\n }\\n delete ts.collaterals[collateral];\\n address[] memory collateralListMem = ts.collateralList;\\n uint256 length = collateralListMem.length;\\n for (uint256 i; i < length - 1; ++i) {\\n if (collateralListMem[i] == collateral) {\\n ts.collateralList[i] = collateralListMem[length - 1];\\n break;\\n }\\n }\\n ts.collateralList.pop();\\n emit CollateralRevoked(collateral);\\n }\\n\\n /// @notice Internal version of `setOracle`\\n function setOracle(address collateral, bytes memory oracleConfig) internal {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n // Checks oracle validity\\n LibOracle.readMint(oracleConfig);\\n collatInfo.oracleConfig = oracleConfig;\\n emit OracleSet(collateral, oracleConfig);\\n }\\n\\n /// @notice Internal version of `setWhitelistStatus`\\n function setWhitelistStatus(address collateral, uint8 whitelistStatus, bytes memory whitelistData) internal {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n if (whitelistStatus == 1) {\\n // Sanity check\\n LibWhitelist.checkWhitelist(whitelistData, address(this));\\n collatInfo.whitelistData = whitelistData;\\n } else {\\n // If whitelist is revoked, clear the whitelist data\\n collatInfo.whitelistData = \\\"\\\";\\n }\\n collatInfo.onlyWhitelisted = whitelistStatus;\\n emit CollateralWhitelistStatusUpdated(collateral, collatInfo.whitelistData, whitelistStatus);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ONLY GUARDIAN ACTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of `togglePause`\\n function togglePause(address collateral, ActionType action) internal {\\n uint8 isLive;\\n if (action == ActionType.Mint || action == ActionType.Burn) {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n if (action == ActionType.Mint) {\\n isLive = 1 - collatInfo.isMintLive;\\n collatInfo.isMintLive = isLive;\\n } else {\\n isLive = 1 - collatInfo.isBurnLive;\\n collatInfo.isBurnLive = isLive;\\n }\\n } else {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n isLive = 1 - ts.isRedemptionLive;\\n ts.isRedemptionLive = isLive;\\n }\\n emit PauseToggled(collateral, uint256(action), isLive == 0);\\n }\\n\\n /// @notice Internal version of `setFees`\\n function setFees(address collateral, uint64[] memory xFee, int64[] memory yFee, bool mint) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n checkFees(xFee, yFee, mint ? ActionType.Mint : ActionType.Burn);\\n if (mint) {\\n collatInfo.xFeeMint = xFee;\\n collatInfo.yFeeMint = yFee;\\n } else {\\n collatInfo.xFeeBurn = xFee;\\n collatInfo.yFeeBurn = yFee;\\n }\\n emit FeesSet(collateral, xFee, yFee, mint);\\n }\\n\\n /// @notice Internal version of `setRedemptionCurveParams`\\n function setRedemptionCurveParams(uint64[] memory xFee, int64[] memory yFee) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n LibSetters.checkFees(xFee, yFee, ActionType.Redeem);\\n ts.xRedemptionCurve = xFee;\\n ts.yRedemptionCurve = yFee;\\n emit RedemptionCurveParamsSet(xFee, yFee);\\n }\\n\\n /// @notice Internal version of `toggleWhitelist`\\n function toggleWhitelist(WhitelistType whitelistType, address who) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint256 whitelistStatus = 1 - ts.isWhitelistedForType[whitelistType][who];\\n ts.isWhitelistedForType[whitelistType][who] = whitelistStatus;\\n emit WhitelistStatusToggled(whitelistType, who, whitelistStatus);\\n }\\n\\n /// @notice Sets the stablecoin cap that can be issued from a collateral\\n function setStablecoinCap(address collateral, uint256 stablecoinCap) internal {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n collatInfo.stablecoinCap = stablecoinCap;\\n emit StablecoinCapSet(collateral, stablecoinCap);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Checks the fee values given for the `mint`, `burn`, and `redeem` functions\\n function checkFees(uint64[] memory xFee, int64[] memory yFee, ActionType action) internal view {\\n uint256 n = xFee.length;\\n if (n != yFee.length || n == 0) revert InvalidParams();\\n if (\\n // Mint inflexion points should be in [0,BASE_9[\\n // We have: amountPostFee * (BASE_9 + yFeeMint) = amountPreFee * BASE_9\\n // Hence we consider BASE_12 as the max value (100% fees) for yFeeMint\\n // Burn inflexion points should be in [0,BASE_9] but fees should be constant in\\n // the first segment [BASE_9, x_{n-1}[\\n // Redemption inflexion points should be in [0,BASE_9]\\n (action == ActionType.Mint && (xFee[n - 1] >= BASE_9 || xFee[0] != 0 || yFee[n - 1] > int256(BASE_12)))\\n || (\\n action == ActionType.Burn\\n && (xFee[0] != BASE_9 || yFee[n - 1] > int256(BASE_9) || (n > 1 && (yFee[0] != yFee[1])))\\n ) || (action == ActionType.Redeem && (xFee[n - 1] > BASE_9 || yFee[n - 1] < 0 || yFee[n - 1] > int256(BASE_9)))\\n ) {\\n revert InvalidParams();\\n }\\n\\n for (uint256 i; i < n - 1; ++i) {\\n if (\\n // xFee strictly increasing and yFee increasing for mints\\n // xFee strictly decreasing and yFee increasing for burns\\n // xFee strictly increasing and yFee should be in [0,BASE_9] for redemptions\\n (action == ActionType.Mint && (xFee[i] >= xFee[i + 1] || (yFee[i + 1] < yFee[i])))\\n || (action == ActionType.Burn && (xFee[i] <= xFee[i + 1] || (yFee[i + 1] < yFee[i])))\\n || (action == ActionType.Redeem && (xFee[i] >= xFee[i + 1] || yFee[i] < 0 || yFee[i] > int256(BASE_9)))\\n ) revert InvalidParams();\\n }\\n\\n // If a mint or burn fee is negative, we need to check that accounts atomically minting\\n // (from any collateral) and then burning cannot get more than their initial value\\n if (yFee[0] < 0) {\\n if (!LibDiamond.isGovernor(msg.sender)) revert NotGovernor(); // Only governor can set negative fees\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n address[] memory collateralListMem = ts.collateralList;\\n uint256 length = collateralListMem.length;\\n if (action == ActionType.Mint) {\\n // This can be mathematically expressed by `(1-min_c(burnFee_c))<=(1+mintFee[0])`\\n for (uint256 i; i < length; ++i) {\\n int64[] memory burnFees = ts.collaterals[collateralListMem[i]].yFeeBurn;\\n if (burnFees[0] + yFee[0] < 0) revert InvalidNegativeFees();\\n }\\n }\\n if (action == ActionType.Burn) {\\n // This can be mathematically expressed by `(1-burnFee[0])<=(1+min_c(mintFee_c))`\\n for (uint256 i; i < length; ++i) {\\n int64[] memory mintFees = ts.collaterals[collateralListMem[i]].yFeeMint;\\n if (yFee[0] + mintFees[0] < 0) revert InvalidNegativeFees();\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x82116bafaf14b59de009ab43fc4489a478cd78f150fa60a1f9f89c2b93173471\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibStorage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport { DiamondStorage, ImplementationStorage, ParallelizerStorage } from \\\"../Storage.sol\\\";\\n\\n/// @title LibStorage\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibStorage` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibStorage.sol\\nlibrary LibStorage {\\n /// @notice Returns the storage struct stored at the `DIAMOND_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic of the different facets used in the diamond proxy\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ds.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `TRANSMUTER_STORAGE_POSITION` slot\\n /// @dev This struct handles the particular logic of the Parallelizer system\\n function transmuterStorage() internal pure returns (ParallelizerStorage storage ts) {\\n bytes32 position = TRANSMUTER_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ts.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `IMPLEMENTATION_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic for making the contract easily usable on Etherscan\\n function implementationStorage() internal pure returns (ImplementationStorage storage ims) {\\n bytes32 position = IMPLEMENTATION_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ims.slot := position\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf8c333898ca14d3e8696c232f669a839dddbf705a609a1b0795ecc6b8f1b2d73\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibWhitelist.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IKeyringGuard } from \\\"contracts/interfaces/external/keyring/IKeyringGuard.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibWhitelist\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibWhitelist` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibWhitelist.sol\\nlibrary LibWhitelist {\\n /// @notice Checks whether `sender` is whitelisted for a collateral with `whitelistData`\\n function checkWhitelist(bytes memory whitelistData, address sender) internal returns (bool) {\\n (WhitelistType whitelistType, bytes memory data) = abi.decode(whitelistData, (WhitelistType, bytes));\\n if (s.transmuterStorage().isWhitelistedForType[whitelistType][sender] > 0) return true;\\n if (data.length != 0) {\\n if (whitelistType == WhitelistType.BACKED) {\\n address keyringGuard = abi.decode(data, (address));\\n if (keyringGuard != address(0)) return IKeyringGuard(keyringGuard).isAuthorized(address(this), sender);\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x72595e0b49dfce76ba70d9f69af54ffbc84650c8c696caa20f858ef2438d94b5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ICbETH } from \\\"contracts/interfaces/external/coinbase/ICbETH.sol\\\";\\nimport { ISfrxETH } from \\\"contracts/interfaces/external/frax/ISfrxETH.sol\\\";\\nimport { IStETH } from \\\"contracts/interfaces/external/lido/IStETH.sol\\\";\\nimport { IRETH } from \\\"contracts/interfaces/external/rocketPool/IRETH.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STORAGE SLOTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n/// @dev Storage position of `DiamondStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.diamond.storage\\\") - 1`\\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\\n\\n/// @dev Storage position of `ParallelizerStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.parallelizer.storage\\\") - 1`\\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\\n\\n/// @dev Storage position of `ImplementationStorage` structure\\n/// @dev Equals `keccak256(\\\"eip1967.proxy.implementation\\\") - 1`\\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MATHS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nuint256 constant BASE_6 = 1e6;\\nuint256 constant BASE_8 = 1e8;\\nuint256 constant BASE_9 = 1e9;\\nuint256 constant BASE_12 = 1e12;\\nuint256 constant BPS = 1e14;\\nuint256 constant BASE_18 = 1e18;\\nuint256 constant HALF_BASE_27 = 1e27 / 2;\\nuint256 constant BASE_27 = 1e27;\\nuint256 constant BASE_36 = 1e36;\\nuint256 constant MAX_BURN_FEE = 999_000_000;\\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// The values being non-zero value makes deployment a bit more expensive,\\n// but in exchange the refund on every call to nonReentrant will be lower in\\n// amount. Since refunds are capped to a percentage of the total\\n// transaction's gas, it is best to keep them low in cases like this one, to\\n// increase the likelihood of the full refund coming into effect.\\nuint8 constant NOT_ENTERED = 1;\\nuint8 constant ENTERED = 2;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// Role IDs for the AccessManager\\nuint64 constant GOVERNOR_ROLE = 10;\\nuint64 constant GUARDIAN_ROLE = 20;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n COMMON ADDRESSES \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\\n\",\"keccak256\":\"0x3306bdd0d4e4f364e0d35893a7ffb59c8eb9e94a5bd861f58b8d7ba8a7b336e5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nerror AccessManagedUnauthorized(address caller);\\nerror AlreadyAdded();\\nerror CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);\\nerror CannotAddSelectorsToZeroAddress(bytes4[] _selectors);\\nerror CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);\\nerror CannotRemoveImmutableFunction(bytes4 _selector);\\nerror CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);\\nerror CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);\\nerror CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);\\nerror CannotReplaceImmutableFunction(bytes4 _selector);\\nerror ContractHasNoCode();\\nerror CollateralBacked();\\nerror FunctionNotFound(bytes4 _functionSelector);\\nerror IncorrectFacetCutAction(uint8 _action);\\nerror InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);\\nerror InvalidChainlinkRate();\\nerror InvalidLengths();\\nerror InvalidNegativeFees();\\nerror InvalidOracleType();\\nerror InvalidParam();\\nerror InvalidParams();\\nerror InvalidRate();\\nerror InvalidSwap();\\nerror InvalidTokens();\\nerror InvalidAccessManager();\\nerror ManagerHasAssets();\\nerror NoSelectorsProvidedForFacetForCut(address _facetAddress);\\nerror NotAllowed();\\nerror NotCollateral();\\nerror NotGovernor();\\nerror NotGuardian();\\nerror NotTrusted();\\nerror NotTrustedOrGuardian();\\nerror NotWhitelisted();\\nerror OdosSwapFailed();\\nerror OracleUpdateFailed();\\nerror Paused();\\nerror ReentrantCall();\\nerror RemoveFacetAddressMustBeZeroAddress(address _facetAddress);\\nerror TooBigAmountIn();\\nerror TooLate();\\nerror TooSmallAmountOut();\\nerror ZeroAddress();\\nerror ZeroAmount();\\nerror SwapError();\\nerror SlippageTooHigh();\\nerror InsufficientFunds();\\n\",\"keccak256\":\"0x1e2f6812ef78e948e5155d32213b52afff8c0ba5463d18bee10694efbf886130\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x608080604052346015576133de908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f5f3560e01c80631b0c718214611a0c5780631cb44dfc146117465780634591f148146113ff5780634d2b3e1414610fae5780635c3eebda14610d845780637c0343a114610baa57806387c8ab7a1461094f578063b13b08471461075a578063c1cdee7e14610391578063c9580804146102975763f0d2d5a814610093575f80fd5b34610294576020366003190112610294576100ac611ceb565b6100b63633611ea7565b15610282576100e2816001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b9081549160ff8360181c1661025a576001600160a01b038216926040517f313ce567000000000000000000000000000000000000000000000000000000008152602081600481885afa801561024f57869061020e575b63ff000000915060181b169063ff00000019161790557f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7754680100000000000000008110156101fa57906101b48260016101d394017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7755612287565b9091906001600160a01b038084549260031b9316831b921b1916179055565b7f7db05e63d635a68c62fd7fd8f3107ae8ab584a383e102d1bd8a40f4c977e465f8280a280f35b602484634e487b7160e01b81526041600452fd5b506020813d602011610247575b8161022860209383611d17565b810103126102435761023e63ff0000009161232e565b610138565b8580fd5b3d915061021b565b6040513d88823e3d90fd5b6004847ff411c327000000000000000000000000000000000000000000000000000000008152fd5b60248262d1953b60e31b815233600452fd5b80fd5b5034610294576020366003190112610294576102b1611ceb565b6102bb3633611ea7565b15610282576001600160a01b0316803b15610369576001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216177fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b6004827fa98154e2000000000000000000000000000000000000000000000000000000008152fd5b5034610294576060366003190112610294576103ab611ceb565b602435906001600160801b0382168092036107565760443580151590818103610752576103d83633611ea7565b1561074057610404836001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b80549160ff8360181c1615610731576b033b2e3c9fd0803ce800000086028681046b033b2e3c9fd0803ce8000000148715171561071d5761046a907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c765460801c90612310565b6001600160801b0381116106ed576001600160801b0316928391156105d65750815460281c01907affffffffffffffffffffffffffffffffffffffffffffffffffffff82116105c257805464ffffffffff1660289290921b64ffffffffff19169190911790556001600160801b037f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c765416016001600160801b0381116105ae577f2347e219eb6e83e63152eb917ddb1df919c0f9208fa91dda0bd14822c6be1d079260409261059e6001600160a01b03936001600160801b03166fffffffffffffffffffffffffffffffff197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c765416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7655565b835195865260208601521692a280f35b602485634e487b7160e01b81526011600452fd5b602487634e487b7160e01b81526011600452fd5b60281c03907affffffffffffffffffffffffffffffffffffffffffffffffffffff82116105c257805464ffffffffff1660289290921b64ffffffffff19169190911790556001600160801b037f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c765416036001600160801b0381116105ae577f2347e219eb6e83e63152eb917ddb1df919c0f9208fa91dda0bd14822c6be1d07926040926106e86001600160a01b03936001600160801b03166fffffffffffffffffffffffffffffffff197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c765416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7655565b61059e565b7f6dfcc6500000000000000000000000000000000000000000000000000000000088526080600452602452604487fd5b602488634e487b7160e01b81526011600452fd5b600487630dcfc57f60e21b8152fd5b60248562d1953b60e31b815233600452fd5b8480fd5b8280fd5b503461029457604036600319011261029457610774611ceb565b60243567ffffffffffffffff811161075657610794903690600401611d55565b9061079f3633611ea7565b1561093d576107cb816001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b60ff815460181c161561092e576005906107e4846130a2565b5001825167ffffffffffffffff811161091a5761080b816108058454611dc2565b8461217b565b6020601f82116001146108905791610863827fba11329c0b0f98b91c254755aa8d698feac3b46fab65b65fe5ab7570de2ff92895936001600160a01b03958991610885575b508160011b915f199060031b1c19161790565b90555b61087f60405192839260208452169460208301906121cb565b0390a280f35b90508701515f610850565b82865280862090601f198316875b8181106109025750926001600160a01b039492600192827fba11329c0b0f98b91c254755aa8d698feac3b46fab65b65fe5ab7570de2ff9289896106108ea575b5050811b019055610866565b8801515f1960f88460031b161c191690555f806108de565b9192602060018192868b01518155019401920161089e565b602485634e487b7160e01b81526041600452fd5b600484630dcfc57f60e21b8152fd5b60248362d1953b60e31b815233600452fd5b503461029457606036600319011261029457610969611ceb565b90610972611d01565b604435906109803633611ea7565b1561093d57604051636eb1769f60e11b81523060048201526001600160a01b038281166024830152851692602082604481875afa918215610b9f578592610b6b575b5080821015610a8057906109d591611e9a565b604051636eb1769f60e11b81523060048201526001600160a01b038316602482015292602090849060449082905afa928315610a75578493610a3d575b508201809211610a2957610a269293612fce565b80f35b602483634e487b7160e01b81526011600452fd5b9092506020813d602011610a6d575b81610a5960209383611d17565b81010312610a695751915f610a12565b5f80fd5b3d9150610a4c565b6040513d86823e3d90fd5b90818196949611610a95575b50505050905080f35b90610a9f91611e9a565b604051636eb1769f60e11b81523060048201526001600160a01b038316602482015294602090869060449082905afa948515610a75578495610b37575b50808510610afa57610af093940391612fce565b805f808080610a8c565b9150926001600160a01b036064947fe570110f00000000000000000000000000000000000000000000000000000000855216600452602452604452fd5b9094506020813d602011610b63575b81610b5360209383611d17565b81010312610a695751935f610adc565b3d9150610b46565b9091506020813d602011610b97575b81610b8760209383611d17565b81010312610a695751905f6109c2565b3d9150610b7a565b6040513d87823e3d90fd5b503461029457604036600319011261029457610bc4611ceb565b60243590600282101561075657610bdb3633611ea7565b1561093d57610be982612306565b81610ccf57610c28816001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7b60205260405f2090565b546001039160018311610cbb576001600160a01b037ff659c9a30c41638c696d64b6e8cc1ee8fff543e973ffc1e9e2d794225ae0178a9260409285610c9d836001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7b60205260405f2090565b555b6001845196148652610cb081612306565b60208601521692a280f35b602484634e487b7160e01b81526011600452fd5b610d09816001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7c60205260405f2090565b546001039160018311610cbb576001600160a01b037ff659c9a30c41638c696d64b6e8cc1ee8fff543e973ffc1e9e2d794225ae0178a9260409285610d7e836001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7c60205260405f2090565b55610c9f565b5034610a69576080366003190112610a6957610d9e611ceb565b610da6611d01565b90604435916001600160a01b03831692838103610a695760643592610dcb3633611ea7565b15610f9c57610df884916001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b805490929060ff1615610f00575050610e166008610e1b9201611dfa565b612f1a565b90610e25816122dd565b15610e65575b5060206001600160a01b037ffff3b3844276f57024e0b42afec1a37f75db36511e43819a4f2a63ab7862b648925b6040519485521692a380f35b610e80816020806001600160a01b03945183010191016122e7565b16803b15610a69575f80916064604051809481937f8bfb07c90000000000000000000000000000000000000000000000000000000083526001600160a01b03881660048401528960248401528860448401525af18015610ef55715610e2b57610eec9194505f90611d17565b5f926020610e2b565b6040513d5f823e3d90fd5b6020925092610f976001600160a01b0392610f917ffff3b3844276f57024e0b42afec1a37f75db36511e43819a4f2a63ab7862b64896610f836040519384927fa9059cbb000000000000000000000000000000000000000000000000000000008a85015260248401602090939291936001600160a01b0360408201951681520152565b03601f198101835282611d17565b82612f61565b610e59565b62d1953b60e31b5f523360045260245ffd5b34610a69576060366003190112610a6957610fc7611ceb565b610fcf611d9b565b60443567ffffffffffffffff8111610a695760406003198236030112610a6957604051906040820182811067ffffffffffffffff8211176112ef57604052806004013567ffffffffffffffff8111610a6957810136602382011215610a6957600481013561103c81611daa565b9161104a6040519384611d17565b818352602060048185019360051b8301010190368211610a6957602401915b8183106113df57505050825260248101359067ffffffffffffffff8211610a695760046110999236920101611d55565b91602082019283526110ab3633611ea7565b15610f9c576110d7846001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b90815460ff8160181c16156113d05760ff16151590816113c8575b50611384575b825151156113775781518051156113635760206001600160a01b03910151166001600160a01b0385160361133b576111308351612f1a565b5050805460ff191660011781555b6007810182519081519167ffffffffffffffff83116112ef576801000000000000000083116112ef576020908254848455808510611320575b5001905f5260205f205f5b8381106113035750505050600801825180519067ffffffffffffffff82116112ef576111b8826111b28554611dc2565b8561217b565b602090601f831160011461128c576111e792915f9183611281575b50508160011b915f199060031b1c19161790565b90555b6040519160208352606083019151916040602085015282518091526020608085019301905f5b81811061126257867f174af9868421277c39ff3056a92d06c83d74df4c7f64258add97ea2bdc022d81878061125d896001600160a01b038a5196601f1985840301604086015216956121cb565b0390a2005b82516001600160a01b0316855260209485019490920191600101611210565b0151905087806111d3565b90601f19831691845f52815f20925f5b8181106112d757509084600195949392106112bf575b505050811b0190556111ea565b01515f1960f88460031b161c191690558680806112b2565b9293602060018192878601518155019501930161129c565b634e487b7160e01b5f52604160045260245ffd5b60019060206001600160a01b038551169401938184015501611182565b61133590845f5285845f209182019101612165565b88611177565b7fa86b6512000000000000000000000000000000000000000000000000000000005f5260045ffd5b634e487b7160e01b5f52603260045260245ffd5b805460ff1916815561113e565b61139861139360088301611dfa565b612e04565b9050156110f8575b7f9e7761b0000000000000000000000000000000000000000000000000000000005f5260045ffd5b9050856110f2565b630dcfc57f60e21b5f5260045ffd5b82356001600160a01b0381168103610a6957815260209283019201611069565b34610a69576040366003190112610a6957611418611ceb565b611420611d9b565b61142a3633611ea7565b15610f9c57611456826001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b90815460ff8160181c16156113d0578060281c61171e5760ff1615159081611716575b506116fb575b505f60096114aa836001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b8281556114bf60018201805490858155612202565b6114d160028201805490858155612202565b6114e360038201805490858155612202565b6114f560048201805490858155612202565b61150160058201612225565b61150d60068201612225565b600781018054848255806116e1575b505061152a60088201612225565b01556040517f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7780548083525f91825260208301917f83745245930c5ea665f7d67c93434aa3e54c73e6ed3f6f245cc3d5c311286bfa91905b8181106116c2576001600160a01b03868661159f81880382611d17565b8051905f5f19830192831194859416945b6116ae57828110156116a557846001600160a01b036115cf8385612273565b5116146115df57600101836115b0565b9161160293506115fa6001600160a01b03916101b493612273565b511691612287565b7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77548015611691575f190161163681612287565b6001600160a01b0382549160031b1b191690557f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77557f10d8ed8cba916885e339cb21deefb3842b3f417eac81a7f34b2978b4ecc2040f5f80a2005b634e487b7160e01b5f52603160045260245ffd5b50505050611602565b634e487b7160e01b5f52601160045260245ffd5b82546001600160a01b0316845260209093019260019283019201611582565b6116f49185526020852090810190612165565b848061151c565b611393600861170a9201611dfa565b90506113a0578161147f565b905083611479565b7fba80a364000000000000000000000000000000000000000000000000000000005f5260045ffd5b34610a69576020366003190112610a695761175f611ceb565b335f9081527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7c6020526040902054156119e45760ff6117bb826001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b5460181c16156113d0576117ff6117fa60056117f4846001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b01611dfa565b612529565b93600a8496939410156119d057600886036119a85761181e848261262f565b9160208151918180820193849201010312610a6957518211156119a8576118bd6005956118ab6118cb946118996118ee9861188861187e9c6040519460208601526020855261186e604086611d17565b6040519d8e9960208b01906121be565b60408901906121be565b60a0606088015260c08701906121cb565b858103601f19016080870152906121cb565b838103601f190160a0850152906121cb565b03601f198101865285611d17565b6001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b01815167ffffffffffffffff81116112ef5761190e816108058454611dc2565b602092601f821160011461194c5761193d929382915f926119415750508160011b915f199060031b1c19161790565b9055005b0151905084806111d3565b601f19821693835f52805f20915f5b8681106119905750836001959610611978575b505050811b019055005b01515f1960f88460031b161c1916905583808061196e565b9192602060018192868501518155019401920161195b565b7faa2d4fb6000000000000000000000000000000000000000000000000000000005f5260045ffd5b634e487b7160e01b5f52602160045260245ffd5b7fc22a648e000000000000000000000000000000000000000000000000000000005f5260045ffd5b34610a69576060366003190112610a6957611a25611ceb565b6024359060ff8216808303610a695760443567ffffffffffffffff8111610a6957611a54903690600401611d55565b92611a5f3633611ea7565b15610f9c57611a8b836001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b9060ff825460181c16156113d05760018303611ca857611aab30866123b4565b5060068201855167ffffffffffffffff81116112ef57611acf816108058454611dc2565b6020601f8211600114611c42579080611b019260069798995f92611c375750508160011b915f199060031b1c19161790565b90555b64ff0000000082549160201b169064ff000000001916178155019160405191604083525f93805490611b3582611dc2565b918260408701526001811690815f14611beb5750600114611b8a575b602085018390526001600160a01b0384167f191460c727cbee9e6c46ead7c01c84a1fe8f0b99186af38917ac57de17e6ba9986880387a2005b5f90815260208120929550915b818310611bd45750508201606001926001600160a01b037f191460c727cbee9e6c46ead7c01c84a1fe8f0b99186af38917ac57de17e6ba99611b51565b805460608487010152602090920191600101611b97565b60ff191660608088019190915292151560051b860190920195506001600160a01b0391507f191460c727cbee9e6c46ead7c01c84a1fe8f0b99186af38917ac57de17e6ba999050611b51565b0151905089806111d3565b601f19821697835f52815f20985f5b818110611c90575091600697989991846001959410611c78575b505050811b019055611b04565b01515f1960f88460031b161c19169055888080611c6b565b838301518b556001909a019960209384019301611c51565b6006929394505f838301611cbc8154611dc2565b601f8111611ccc575b5055611b04565b81835260208320611ce591601f0160051c810190612165565b87611cc5565b600435906001600160a01b0382168203610a6957565b602435906001600160a01b0382168203610a6957565b90601f8019910116810190811067ffffffffffffffff8211176112ef57604052565b67ffffffffffffffff81116112ef57601f01601f191660200190565b81601f82011215610a6957803590611d6c82611d39565b92611d7a6040519485611d17565b82845260208383010111610a6957815f926020809301838601378301015290565b602435908115158203610a6957565b67ffffffffffffffff81116112ef5760051b60200190565b90600182811c92168015611df0575b6020831014611ddc57565b634e487b7160e01b5f52602260045260245ffd5b91607f1691611dd1565b9060405191825f825492611e0d84611dc2565b8084529360018116908115611e785750600114611e34575b50611e3292500383611d17565b565b90505f9291925260205f20905f915b818310611e5c575050906020611e32928201015f611e25565b6020919350806001915483858901015201910190918492611e43565b905060209250611e3294915060ff191682840152151560051b8201015f611e25565b919082039182116116ae57565b6001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54169180600411610a69575f5f905f80604051956001600160a01b0360208801917fb700961300000000000000000000000000000000000000000000000000000000835216968760248201523060448201527fffffffff00000000000000000000000000000000000000000000000000000000833516606482015260648152611f5a608482611d17565b5190885afa3d1561215d573d90611f7082611d39565b91611f7e6040519384611d17565b82523d5f602084013e5b6120ea575b5015611f9d575b50505050600190565b63ffffffff16156120e35776010000000000000000000000000000000000000000000060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7555823b15610a69576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af18015610ef5576120d3575b5060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7554167f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75555f808080611f94565b5f6120dd91611d17565b5f61207e565b5050505f90565b805190929091604083106121265750508160409181010312610a695761211e60406121176020840161233c565b9201612349565b905b5f611f8d565b91602081949294101561213b575b5050612120565b8192509060209181010312610a69576020612156910161233c565b5f80612134565b606090611f88565b818110612170575050565b5f8155600101612165565b9190601f811161218a57505050565b611e32925f5260205f20906020601f840160051c830193106121b4575b601f0160051c0190612165565b90915081906121a7565b90600a8210156119d05752565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b818102929181159184041417156116ae57565b908061220c575050565b611e32915f52600360205f20910160021c810190612165565b61222f8154611dc2565b9081612239575050565b81601f5f931160011461224a575055565b8183526020832061226691601f0160051c810190600101612165565b8082528160208120915555565b80518210156113635760209160051b010190565b7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7754811015611363577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f2001905f90565b600111156119d057565b90816020910312610a6957516001600160a01b0381168103610a695790565b600211156119d057565b811561231a570490565b634e487b7160e01b5f52601260045260245ffd5b519060ff82168203610a6957565b51908115158203610a6957565b519063ffffffff82168203610a6957565b81601f82011215610a695780519061237182611d39565b9261237f6040519485611d17565b82845260208383010111610a6957815f9260208093018386015e8301015290565b51906001600160a01b0382168203610a6957565b80518101604082820312610a69576020820151916001831015610a695760408101519167ffffffffffffffff8311610a69576123f792602080920192010161235a565b90612401816122dd565b805f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d60205260405f206001600160a01b0384165f5260205260405f2054612521578151612451575050505f90565b61245a816122dd565b15612466575b806120e3565b602081805181010312610a695761248760206001600160a01b0392016123a0565b168015612460576040517f65e4ad9e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03929092166024830152602090829060449082905f905af1908115610ef5575f916124ea575090565b90506020813d602011612519575b8161250560209383611d17565b81010312610a69576125169061233c565b90565b3d91506124f8565b505050600190565b8051810160a08260208301920312610a69576020820151600a811015610a6957604083015193600a851015610a6957606084015167ffffffffffffffff8111610a695783602061257b9287010161235a565b93608081015167ffffffffffffffff8111610a695784602061259f9284010161235a565b9360a08201519167ffffffffffffffff8311610a69576125c2920160200161235a565b919493929190565b9080601f83011215610a695781516125e181611daa565b926125ef6040519485611d17565b81845260208085019260051b820101928311610a6957602001905b8282106126175750505090565b602080916126248461232e565b81520191019061260a565b600a8110156119d0578061283b575090815182019160a08160208501940312610a6957602081015167ffffffffffffffff8111610a695781019280603f85011215610a6957602084015161268281611daa565b946126906040519687611d17565b8186526020808088019360051b8301010190838211610a6957604001915b81831061281b57505050604082015167ffffffffffffffff8111610a6957820181603f82011215610a69576020810151906126e882611daa565b916126f66040519384611d17565b8083526020808085019260051b8401010191848311610a6957604001905b82821061280357505050606083015167ffffffffffffffff8111610a6957826020612741928601016125ca565b91608084015167ffffffffffffffff8111610a695760a0916020612767928701016125ca565b9301516002811015610a6957670de0b6b3a764000061278a91969492959661320c565b938351915f935b8385106127a15750505050505090565b909192939496956127f66001916001600160a01b036127c0898c612273565b511660ff6127ce8a87612273565b511660ff6127dc8b89612273565b51169163ffffffff6127ee8c8b612273565b51169361324b565b9697950193929190612791565b6020809161281084612349565b815201910190612714565b82516001600160a01b0381168103610a69578152602092830192016126ae565b60038103612851575050670de0b6b3a764000090565b60028103612867575050670de0b6b3a764000090565b600481036128e9575050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa908115610ef5575f916128ba575090565b90506020813d6020116128e1575b816128d560209383611d17565b81010312610a69575190565b3d91506128c8565b6005810361292e575050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa908115610ef5575f916128ba575090565b600681036129735750506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa908115610ef5575f916128ba575090565b600781036129b8575050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa908115610ef5575f916128ba575090565b600881036129d9575060208151918180820193849201010312610a69575190565b600903612a8357604081805181010312610a69578060206040612a05826001600160a01b0395016123a0565b920151916004604051809581937fa035b1fe000000000000000000000000000000000000000000000000000000008352165afa8015610ef5575f90612a4f575b6125169250612310565b506020823d602011612a7b575b81612a6960209383611d17565b81010312610a69576125169151612a45565b3d9150612a5c565b50670de0b6b3a764000090565b92919092600a8110156119d05780612c6157508051810160a08260208301920312610a6957602082015167ffffffffffffffff8111610a695782019381603f86011215610a69576020850151612ae581611daa565b95612af36040519788611d17565b8187526020808089019360051b8301010190848211610a6957604001915b818310612c4157505050604083015167ffffffffffffffff8111610a695783019082603f83011215610a6957602082015191612b4c83611daa565b92612b5a6040519485611d17565b8084526020808086019260051b8401010191858311610a6957604001905b828210612c2957505050606084015167ffffffffffffffff8111610a6957836020612ba5928701016125ca565b92608085015167ffffffffffffffff8111610a695760a0916020612bcb928801016125ca565b940151906002821015610a6957612be691969492959661320c565b938351915f935b838510612bfd5750505050505090565b90919293949695612c1c6001916001600160a01b036127c0898c612273565b9697950193929190612bed565b60208091612c3684612349565b815201910190612b78565b82516001600160a01b0381168103610a6957815260209283019201612b11565b9192909160038103612c7c57505050670de0b6b3a764000090565b60028103612c8a5750905090565b60048103612cde57505050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa908115610ef5575f916128ba575090565b60058103612d2457505050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa908115610ef5575f916128ba575090565b60068103612d6a575050506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa908115610ef5575f916128ba575090565b60078103612db057505050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa908115610ef5575f916128ba575090565b60088103612dd257505060208151918180820193849201010312610a69575190565b600903612dff5750604081805181010312610a69578060206040612a05826001600160a01b0395016123a0565b905090565b606091612e115f92612f1a565b90612e1b816122dd565b15612e235750565b600493505f919250612e46816020806001600160a01b03945183010191016122e7565b16604051938480927f01e1d1140000000000000000000000000000000000000000000000000000000082525afa918215610ef5575f905f93612e8757509190565b9250503d805f843e612e998184611d17565b820191604081840312610a6957805167ffffffffffffffff8111610a695781019280601f85011215610a69578351612ed081611daa565b94612ede6040519687611d17565b81865260208087019260051b820101928311610a6957602001905b828210612f0a575050506020015190565b8151815260209182019101612ef9565b80518101604082820312610a69576020820151916001831015610a695760408101519167ffffffffffffffff8311610a6957612f5d92602080920192010161235a565b9091565b905f602091828151910182855af115610ef5575f513d612fc557506001600160a01b0381163b155b612f905750565b6001600160a01b03907f5274afe7000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b60011415612f89565b60405163095ea7b360e01b60208083019182526001600160a01b0385166024840152604480840196909652948252929390925f9061300d606486611d17565b84519082855af15f513d82613069575b50501561302957505050565b613064611e32936001600160a01b036040519163095ea7b360e01b60208401521660248201525f604482015260448152610f91606482611d17565b612f61565b90915061308657506001600160a01b0381163b15155b5f8061301d565b60011461307f565b51906001600160801b0382168203610a6957565b6130ab90612529565b600a8594969593929310156119d057600184146131a057604081805181010312610a6957613106926001600160801b03826130f760406130f060206130ff970161308e565b920161308e565b50169661262f565b8093612a90565b9280670de0b6b3a764000003670de0b6b3a764000081116116ae5761312b90836121ef565b670de0b6b3a7640000850290858204670de0b6b3a764000014861517156116ae5781119182613172575b505061316a575b8281106131665750565b9150565b91508161315c565b909150670de0b6b3a76400000180670de0b6b3a7640000116116ae5761319890836121ef565b115f80613155565b5080939450602092508091505181010312610a6957602001516001600160a01b038116809103610a69576020600491604051928380927f5ade93550000000000000000000000000000000000000000000000000000000082525afa908115610ef5575f916128ba575090565b61321581612306565b6125165750670de0b6b3a764000090565b519069ffffffffffffffffffff82168203610a6957565b604d81116116ae57600a0a90565b91909360a06001600160a01b0394956004604051809781937ffeaf968c000000000000000000000000000000000000000000000000000000008352165afa908115610ef5575f945f92613332575b505f851391821592613316575b50506132ee5760ff166001036132d3576132c761251693926132cd926121ef565b9161323d565b90612310565b6132e9906132e36125169461323d565b906121ef565b612310565b7fae193563000000000000000000000000000000000000000000000000000000005f5260045ffd5b63ffffffff9192506133289042611e9a565b9116105f806132a6565b9450905060a0843d60a011613380575b8161334f60a09383611d17565b81010312610a695761336084613226565b506020840151613377608060608701519601613226565b5093905f613299565b3d915061334256fe4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7aa2646970667358221220d9daf4483d184f8d85487bbed72b2914e918db08ec2dc31bb4e1aafbc5753abb64736f6c634300081c0033", + "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f5f3560e01c80631b0c718214611a0c5780631cb44dfc146117465780634591f148146113ff5780634d2b3e1414610fae5780635c3eebda14610d845780637c0343a114610baa57806387c8ab7a1461094f578063b13b08471461075a578063c1cdee7e14610391578063c9580804146102975763f0d2d5a814610093575f80fd5b34610294576020366003190112610294576100ac611ceb565b6100b63633611ea7565b15610282576100e2816001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b9081549160ff8360181c1661025a576001600160a01b038216926040517f313ce567000000000000000000000000000000000000000000000000000000008152602081600481885afa801561024f57869061020e575b63ff000000915060181b169063ff00000019161790557f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7754680100000000000000008110156101fa57906101b48260016101d394017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7755612287565b9091906001600160a01b038084549260031b9316831b921b1916179055565b7f7db05e63d635a68c62fd7fd8f3107ae8ab584a383e102d1bd8a40f4c977e465f8280a280f35b602484634e487b7160e01b81526041600452fd5b506020813d602011610247575b8161022860209383611d17565b810103126102435761023e63ff0000009161232e565b610138565b8580fd5b3d915061021b565b6040513d88823e3d90fd5b6004847ff411c327000000000000000000000000000000000000000000000000000000008152fd5b60248262d1953b60e31b815233600452fd5b80fd5b5034610294576020366003190112610294576102b1611ceb565b6102bb3633611ea7565b15610282576001600160a01b0316803b15610369576001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216177fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b6004827fa98154e2000000000000000000000000000000000000000000000000000000008152fd5b5034610294576060366003190112610294576103ab611ceb565b602435906001600160801b0382168092036107565760443580151590818103610752576103d83633611ea7565b1561074057610404836001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b80549160ff8360181c1615610731576b033b2e3c9fd0803ce800000086028681046b033b2e3c9fd0803ce8000000148715171561071d5761046a907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c765460801c90612310565b6001600160801b0381116106ed576001600160801b0316928391156105d65750815460281c01907affffffffffffffffffffffffffffffffffffffffffffffffffffff82116105c257805464ffffffffff1660289290921b64ffffffffff19169190911790556001600160801b037f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c765416016001600160801b0381116105ae577f2347e219eb6e83e63152eb917ddb1df919c0f9208fa91dda0bd14822c6be1d079260409261059e6001600160a01b03936001600160801b03166fffffffffffffffffffffffffffffffff197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c765416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7655565b835195865260208601521692a280f35b602485634e487b7160e01b81526011600452fd5b602487634e487b7160e01b81526011600452fd5b60281c03907affffffffffffffffffffffffffffffffffffffffffffffffffffff82116105c257805464ffffffffff1660289290921b64ffffffffff19169190911790556001600160801b037f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c765416036001600160801b0381116105ae577f2347e219eb6e83e63152eb917ddb1df919c0f9208fa91dda0bd14822c6be1d07926040926106e86001600160a01b03936001600160801b03166fffffffffffffffffffffffffffffffff197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c765416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7655565b61059e565b7f6dfcc6500000000000000000000000000000000000000000000000000000000088526080600452602452604487fd5b602488634e487b7160e01b81526011600452fd5b600487630dcfc57f60e21b8152fd5b60248562d1953b60e31b815233600452fd5b8480fd5b8280fd5b503461029457604036600319011261029457610774611ceb565b60243567ffffffffffffffff811161075657610794903690600401611d55565b9061079f3633611ea7565b1561093d576107cb816001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b60ff815460181c161561092e576005906107e4846130a2565b5001825167ffffffffffffffff811161091a5761080b816108058454611dc2565b8461217b565b6020601f82116001146108905791610863827fba11329c0b0f98b91c254755aa8d698feac3b46fab65b65fe5ab7570de2ff92895936001600160a01b03958991610885575b508160011b915f199060031b1c19161790565b90555b61087f60405192839260208452169460208301906121cb565b0390a280f35b90508701515f610850565b82865280862090601f198316875b8181106109025750926001600160a01b039492600192827fba11329c0b0f98b91c254755aa8d698feac3b46fab65b65fe5ab7570de2ff9289896106108ea575b5050811b019055610866565b8801515f1960f88460031b161c191690555f806108de565b9192602060018192868b01518155019401920161089e565b602485634e487b7160e01b81526041600452fd5b600484630dcfc57f60e21b8152fd5b60248362d1953b60e31b815233600452fd5b503461029457606036600319011261029457610969611ceb565b90610972611d01565b604435906109803633611ea7565b1561093d57604051636eb1769f60e11b81523060048201526001600160a01b038281166024830152851692602082604481875afa918215610b9f578592610b6b575b5080821015610a8057906109d591611e9a565b604051636eb1769f60e11b81523060048201526001600160a01b038316602482015292602090849060449082905afa928315610a75578493610a3d575b508201809211610a2957610a269293612fce565b80f35b602483634e487b7160e01b81526011600452fd5b9092506020813d602011610a6d575b81610a5960209383611d17565b81010312610a695751915f610a12565b5f80fd5b3d9150610a4c565b6040513d86823e3d90fd5b90818196949611610a95575b50505050905080f35b90610a9f91611e9a565b604051636eb1769f60e11b81523060048201526001600160a01b038316602482015294602090869060449082905afa948515610a75578495610b37575b50808510610afa57610af093940391612fce565b805f808080610a8c565b9150926001600160a01b036064947fe570110f00000000000000000000000000000000000000000000000000000000855216600452602452604452fd5b9094506020813d602011610b63575b81610b5360209383611d17565b81010312610a695751935f610adc565b3d9150610b46565b9091506020813d602011610b97575b81610b8760209383611d17565b81010312610a695751905f6109c2565b3d9150610b7a565b6040513d87823e3d90fd5b503461029457604036600319011261029457610bc4611ceb565b60243590600282101561075657610bdb3633611ea7565b1561093d57610be982612306565b81610ccf57610c28816001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7b60205260405f2090565b546001039160018311610cbb576001600160a01b037ff659c9a30c41638c696d64b6e8cc1ee8fff543e973ffc1e9e2d794225ae0178a9260409285610c9d836001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7b60205260405f2090565b555b6001845196148652610cb081612306565b60208601521692a280f35b602484634e487b7160e01b81526011600452fd5b610d09816001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7c60205260405f2090565b546001039160018311610cbb576001600160a01b037ff659c9a30c41638c696d64b6e8cc1ee8fff543e973ffc1e9e2d794225ae0178a9260409285610d7e836001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7c60205260405f2090565b55610c9f565b5034610a69576080366003190112610a6957610d9e611ceb565b610da6611d01565b90604435916001600160a01b03831692838103610a695760643592610dcb3633611ea7565b15610f9c57610df884916001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b805490929060ff1615610f00575050610e166008610e1b9201611dfa565b612f1a565b90610e25816122dd565b15610e65575b5060206001600160a01b037ffff3b3844276f57024e0b42afec1a37f75db36511e43819a4f2a63ab7862b648925b6040519485521692a380f35b610e80816020806001600160a01b03945183010191016122e7565b16803b15610a69575f80916064604051809481937f8bfb07c90000000000000000000000000000000000000000000000000000000083526001600160a01b03881660048401528960248401528860448401525af18015610ef55715610e2b57610eec9194505f90611d17565b5f926020610e2b565b6040513d5f823e3d90fd5b6020925092610f976001600160a01b0392610f917ffff3b3844276f57024e0b42afec1a37f75db36511e43819a4f2a63ab7862b64896610f836040519384927fa9059cbb000000000000000000000000000000000000000000000000000000008a85015260248401602090939291936001600160a01b0360408201951681520152565b03601f198101835282611d17565b82612f61565b610e59565b62d1953b60e31b5f523360045260245ffd5b34610a69576060366003190112610a6957610fc7611ceb565b610fcf611d9b565b60443567ffffffffffffffff8111610a695760406003198236030112610a6957604051906040820182811067ffffffffffffffff8211176112ef57604052806004013567ffffffffffffffff8111610a6957810136602382011215610a6957600481013561103c81611daa565b9161104a6040519384611d17565b818352602060048185019360051b8301010190368211610a6957602401915b8183106113df57505050825260248101359067ffffffffffffffff8211610a695760046110999236920101611d55565b91602082019283526110ab3633611ea7565b15610f9c576110d7846001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b90815460ff8160181c16156113d05760ff16151590816113c8575b50611384575b825151156113775781518051156113635760206001600160a01b03910151166001600160a01b0385160361133b576111308351612f1a565b5050805460ff191660011781555b6007810182519081519167ffffffffffffffff83116112ef576801000000000000000083116112ef576020908254848455808510611320575b5001905f5260205f205f5b8381106113035750505050600801825180519067ffffffffffffffff82116112ef576111b8826111b28554611dc2565b8561217b565b602090601f831160011461128c576111e792915f9183611281575b50508160011b915f199060031b1c19161790565b90555b6040519160208352606083019151916040602085015282518091526020608085019301905f5b81811061126257867f174af9868421277c39ff3056a92d06c83d74df4c7f64258add97ea2bdc022d81878061125d896001600160a01b038a5196601f1985840301604086015216956121cb565b0390a2005b82516001600160a01b0316855260209485019490920191600101611210565b0151905087806111d3565b90601f19831691845f52815f20925f5b8181106112d757509084600195949392106112bf575b505050811b0190556111ea565b01515f1960f88460031b161c191690558680806112b2565b9293602060018192878601518155019501930161129c565b634e487b7160e01b5f52604160045260245ffd5b60019060206001600160a01b038551169401938184015501611182565b61133590845f5285845f209182019101612165565b88611177565b7fa86b6512000000000000000000000000000000000000000000000000000000005f5260045ffd5b634e487b7160e01b5f52603260045260245ffd5b805460ff1916815561113e565b61139861139360088301611dfa565b612e04565b9050156110f8575b7f9e7761b0000000000000000000000000000000000000000000000000000000005f5260045ffd5b9050856110f2565b630dcfc57f60e21b5f5260045ffd5b82356001600160a01b0381168103610a6957815260209283019201611069565b34610a69576040366003190112610a6957611418611ceb565b611420611d9b565b61142a3633611ea7565b15610f9c57611456826001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b90815460ff8160181c16156113d0578060281c61171e5760ff1615159081611716575b506116fb575b505f60096114aa836001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b8281556114bf60018201805490858155612202565b6114d160028201805490858155612202565b6114e360038201805490858155612202565b6114f560048201805490858155612202565b61150160058201612225565b61150d60068201612225565b600781018054848255806116e1575b505061152a60088201612225565b01556040517f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7780548083525f91825260208301917f83745245930c5ea665f7d67c93434aa3e54c73e6ed3f6f245cc3d5c311286bfa91905b8181106116c2576001600160a01b03868661159f81880382611d17565b8051905f5f19830192831194859416945b6116ae57828110156116a557846001600160a01b036115cf8385612273565b5116146115df57600101836115b0565b9161160293506115fa6001600160a01b03916101b493612273565b511691612287565b7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77548015611691575f190161163681612287565b6001600160a01b0382549160031b1b191690557f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77557f10d8ed8cba916885e339cb21deefb3842b3f417eac81a7f34b2978b4ecc2040f5f80a2005b634e487b7160e01b5f52603160045260245ffd5b50505050611602565b634e487b7160e01b5f52601160045260245ffd5b82546001600160a01b0316845260209093019260019283019201611582565b6116f49185526020852090810190612165565b848061151c565b611393600861170a9201611dfa565b90506113a0578161147f565b905083611479565b7fba80a364000000000000000000000000000000000000000000000000000000005f5260045ffd5b34610a69576020366003190112610a695761175f611ceb565b335f9081527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7c6020526040902054156119e45760ff6117bb826001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b5460181c16156113d0576117ff6117fa60056117f4846001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b01611dfa565b612529565b93600a8496939410156119d057600886036119a85761181e848261262f565b9160208151918180820193849201010312610a6957518211156119a8576118bd6005956118ab6118cb946118996118ee9861188861187e9c6040519460208601526020855261186e604086611d17565b6040519d8e9960208b01906121be565b60408901906121be565b60a0606088015260c08701906121cb565b858103601f19016080870152906121cb565b838103601f190160a0850152906121cb565b03601f198101865285611d17565b6001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b01815167ffffffffffffffff81116112ef5761190e816108058454611dc2565b602092601f821160011461194c5761193d929382915f926119415750508160011b915f199060031b1c19161790565b9055005b0151905084806111d3565b601f19821693835f52805f20915f5b8681106119905750836001959610611978575b505050811b019055005b01515f1960f88460031b161c1916905583808061196e565b9192602060018192868501518155019401920161195b565b7faa2d4fb6000000000000000000000000000000000000000000000000000000005f5260045ffd5b634e487b7160e01b5f52602160045260245ffd5b7fc22a648e000000000000000000000000000000000000000000000000000000005f5260045ffd5b34610a69576060366003190112610a6957611a25611ceb565b6024359060ff8216808303610a695760443567ffffffffffffffff8111610a6957611a54903690600401611d55565b92611a5f3633611ea7565b15610f9c57611a8b836001600160a01b03165f525f5160206133895f395f51905f5260205260405f2090565b9060ff825460181c16156113d05760018303611ca857611aab30866123b4565b5060068201855167ffffffffffffffff81116112ef57611acf816108058454611dc2565b6020601f8211600114611c42579080611b019260069798995f92611c375750508160011b915f199060031b1c19161790565b90555b64ff0000000082549160201b169064ff000000001916178155019160405191604083525f93805490611b3582611dc2565b918260408701526001811690815f14611beb5750600114611b8a575b602085018390526001600160a01b0384167f191460c727cbee9e6c46ead7c01c84a1fe8f0b99186af38917ac57de17e6ba9986880387a2005b5f90815260208120929550915b818310611bd45750508201606001926001600160a01b037f191460c727cbee9e6c46ead7c01c84a1fe8f0b99186af38917ac57de17e6ba99611b51565b805460608487010152602090920191600101611b97565b60ff191660608088019190915292151560051b860190920195506001600160a01b0391507f191460c727cbee9e6c46ead7c01c84a1fe8f0b99186af38917ac57de17e6ba999050611b51565b0151905089806111d3565b601f19821697835f52815f20985f5b818110611c90575091600697989991846001959410611c78575b505050811b019055611b04565b01515f1960f88460031b161c19169055888080611c6b565b838301518b556001909a019960209384019301611c51565b6006929394505f838301611cbc8154611dc2565b601f8111611ccc575b5055611b04565b81835260208320611ce591601f0160051c810190612165565b87611cc5565b600435906001600160a01b0382168203610a6957565b602435906001600160a01b0382168203610a6957565b90601f8019910116810190811067ffffffffffffffff8211176112ef57604052565b67ffffffffffffffff81116112ef57601f01601f191660200190565b81601f82011215610a6957803590611d6c82611d39565b92611d7a6040519485611d17565b82845260208383010111610a6957815f926020809301838601378301015290565b602435908115158203610a6957565b67ffffffffffffffff81116112ef5760051b60200190565b90600182811c92168015611df0575b6020831014611ddc57565b634e487b7160e01b5f52602260045260245ffd5b91607f1691611dd1565b9060405191825f825492611e0d84611dc2565b8084529360018116908115611e785750600114611e34575b50611e3292500383611d17565b565b90505f9291925260205f20905f915b818310611e5c575050906020611e32928201015f611e25565b6020919350806001915483858901015201910190918492611e43565b905060209250611e3294915060ff191682840152151560051b8201015f611e25565b919082039182116116ae57565b6001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54169180600411610a69575f5f905f80604051956001600160a01b0360208801917fb700961300000000000000000000000000000000000000000000000000000000835216968760248201523060448201527fffffffff00000000000000000000000000000000000000000000000000000000833516606482015260648152611f5a608482611d17565b5190885afa3d1561215d573d90611f7082611d39565b91611f7e6040519384611d17565b82523d5f602084013e5b6120ea575b5015611f9d575b50505050600190565b63ffffffff16156120e35776010000000000000000000000000000000000000000000060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7555823b15610a69576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af18015610ef5576120d3575b5060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7554167f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75555f808080611f94565b5f6120dd91611d17565b5f61207e565b5050505f90565b805190929091604083106121265750508160409181010312610a695761211e60406121176020840161233c565b9201612349565b905b5f611f8d565b91602081949294101561213b575b5050612120565b8192509060209181010312610a69576020612156910161233c565b5f80612134565b606090611f88565b818110612170575050565b5f8155600101612165565b9190601f811161218a57505050565b611e32925f5260205f20906020601f840160051c830193106121b4575b601f0160051c0190612165565b90915081906121a7565b90600a8210156119d05752565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b818102929181159184041417156116ae57565b908061220c575050565b611e32915f52600360205f20910160021c810190612165565b61222f8154611dc2565b9081612239575050565b81601f5f931160011461224a575055565b8183526020832061226691601f0160051c810190600101612165565b8082528160208120915555565b80518210156113635760209160051b010190565b7f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7754811015611363577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f2001905f90565b600111156119d057565b90816020910312610a6957516001600160a01b0381168103610a695790565b600211156119d057565b811561231a570490565b634e487b7160e01b5f52601260045260245ffd5b519060ff82168203610a6957565b51908115158203610a6957565b519063ffffffff82168203610a6957565b81601f82011215610a695780519061237182611d39565b9261237f6040519485611d17565b82845260208383010111610a6957815f9260208093018386015e8301015290565b51906001600160a01b0382168203610a6957565b80518101604082820312610a69576020820151916001831015610a695760408101519167ffffffffffffffff8311610a69576123f792602080920192010161235a565b90612401816122dd565b805f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d60205260405f206001600160a01b0384165f5260205260405f2054612521578151612451575050505f90565b61245a816122dd565b15612466575b806120e3565b602081805181010312610a695761248760206001600160a01b0392016123a0565b168015612460576040517f65e4ad9e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03929092166024830152602090829060449082905f905af1908115610ef5575f916124ea575090565b90506020813d602011612519575b8161250560209383611d17565b81010312610a69576125169061233c565b90565b3d91506124f8565b505050600190565b8051810160a08260208301920312610a69576020820151600a811015610a6957604083015193600a851015610a6957606084015167ffffffffffffffff8111610a695783602061257b9287010161235a565b93608081015167ffffffffffffffff8111610a695784602061259f9284010161235a565b9360a08201519167ffffffffffffffff8311610a69576125c2920160200161235a565b919493929190565b9080601f83011215610a695781516125e181611daa565b926125ef6040519485611d17565b81845260208085019260051b820101928311610a6957602001905b8282106126175750505090565b602080916126248461232e565b81520191019061260a565b600a8110156119d0578061283b575090815182019160a08160208501940312610a6957602081015167ffffffffffffffff8111610a695781019280603f85011215610a6957602084015161268281611daa565b946126906040519687611d17565b8186526020808088019360051b8301010190838211610a6957604001915b81831061281b57505050604082015167ffffffffffffffff8111610a6957820181603f82011215610a69576020810151906126e882611daa565b916126f66040519384611d17565b8083526020808085019260051b8401010191848311610a6957604001905b82821061280357505050606083015167ffffffffffffffff8111610a6957826020612741928601016125ca565b91608084015167ffffffffffffffff8111610a695760a0916020612767928701016125ca565b9301516002811015610a6957670de0b6b3a764000061278a91969492959661320c565b938351915f935b8385106127a15750505050505090565b909192939496956127f66001916001600160a01b036127c0898c612273565b511660ff6127ce8a87612273565b511660ff6127dc8b89612273565b51169163ffffffff6127ee8c8b612273565b51169361324b565b9697950193929190612791565b6020809161281084612349565b815201910190612714565b82516001600160a01b0381168103610a69578152602092830192016126ae565b60038103612851575050670de0b6b3a764000090565b60028103612867575050670de0b6b3a764000090565b600481036128e9575050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa908115610ef5575f916128ba575090565b90506020813d6020116128e1575b816128d560209383611d17565b81010312610a69575190565b3d91506128c8565b6005810361292e575050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa908115610ef5575f916128ba575090565b600681036129735750506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa908115610ef5575f916128ba575090565b600781036129b8575050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa908115610ef5575f916128ba575090565b600881036129d9575060208151918180820193849201010312610a69575190565b600903612a8357604081805181010312610a69578060206040612a05826001600160a01b0395016123a0565b920151916004604051809581937fa035b1fe000000000000000000000000000000000000000000000000000000008352165afa8015610ef5575f90612a4f575b6125169250612310565b506020823d602011612a7b575b81612a6960209383611d17565b81010312610a69576125169151612a45565b3d9150612a5c565b50670de0b6b3a764000090565b92919092600a8110156119d05780612c6157508051810160a08260208301920312610a6957602082015167ffffffffffffffff8111610a695782019381603f86011215610a69576020850151612ae581611daa565b95612af36040519788611d17565b8187526020808089019360051b8301010190848211610a6957604001915b818310612c4157505050604083015167ffffffffffffffff8111610a695783019082603f83011215610a6957602082015191612b4c83611daa565b92612b5a6040519485611d17565b8084526020808086019260051b8401010191858311610a6957604001905b828210612c2957505050606084015167ffffffffffffffff8111610a6957836020612ba5928701016125ca565b92608085015167ffffffffffffffff8111610a695760a0916020612bcb928801016125ca565b940151906002821015610a6957612be691969492959661320c565b938351915f935b838510612bfd5750505050505090565b90919293949695612c1c6001916001600160a01b036127c0898c612273565b9697950193929190612bed565b60208091612c3684612349565b815201910190612b78565b82516001600160a01b0381168103610a6957815260209283019201612b11565b9192909160038103612c7c57505050670de0b6b3a764000090565b60028103612c8a5750905090565b60048103612cde57505050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa908115610ef5575f916128ba575090565b60058103612d2457505050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa908115610ef5575f916128ba575090565b60068103612d6a575050506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa908115610ef5575f916128ba575090565b60078103612db057505050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa908115610ef5575f916128ba575090565b60088103612dd257505060208151918180820193849201010312610a69575190565b600903612dff5750604081805181010312610a69578060206040612a05826001600160a01b0395016123a0565b905090565b606091612e115f92612f1a565b90612e1b816122dd565b15612e235750565b600493505f919250612e46816020806001600160a01b03945183010191016122e7565b16604051938480927f01e1d1140000000000000000000000000000000000000000000000000000000082525afa918215610ef5575f905f93612e8757509190565b9250503d805f843e612e998184611d17565b820191604081840312610a6957805167ffffffffffffffff8111610a695781019280601f85011215610a69578351612ed081611daa565b94612ede6040519687611d17565b81865260208087019260051b820101928311610a6957602001905b828210612f0a575050506020015190565b8151815260209182019101612ef9565b80518101604082820312610a69576020820151916001831015610a695760408101519167ffffffffffffffff8311610a6957612f5d92602080920192010161235a565b9091565b905f602091828151910182855af115610ef5575f513d612fc557506001600160a01b0381163b155b612f905750565b6001600160a01b03907f5274afe7000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b60011415612f89565b60405163095ea7b360e01b60208083019182526001600160a01b0385166024840152604480840196909652948252929390925f9061300d606486611d17565b84519082855af15f513d82613069575b50501561302957505050565b613064611e32936001600160a01b036040519163095ea7b360e01b60208401521660248201525f604482015260448152610f91606482611d17565b612f61565b90915061308657506001600160a01b0381163b15155b5f8061301d565b60011461307f565b51906001600160801b0382168203610a6957565b6130ab90612529565b600a8594969593929310156119d057600184146131a057604081805181010312610a6957613106926001600160801b03826130f760406130f060206130ff970161308e565b920161308e565b50169661262f565b8093612a90565b9280670de0b6b3a764000003670de0b6b3a764000081116116ae5761312b90836121ef565b670de0b6b3a7640000850290858204670de0b6b3a764000014861517156116ae5781119182613172575b505061316a575b8281106131665750565b9150565b91508161315c565b909150670de0b6b3a76400000180670de0b6b3a7640000116116ae5761319890836121ef565b115f80613155565b5080939450602092508091505181010312610a6957602001516001600160a01b038116809103610a69576020600491604051928380927f5ade93550000000000000000000000000000000000000000000000000000000082525afa908115610ef5575f916128ba575090565b61321581612306565b6125165750670de0b6b3a764000090565b519069ffffffffffffffffffff82168203610a6957565b604d81116116ae57600a0a90565b91909360a06001600160a01b0394956004604051809781937ffeaf968c000000000000000000000000000000000000000000000000000000008352165afa908115610ef5575f945f92613332575b505f851391821592613316575b50506132ee5760ff166001036132d3576132c761251693926132cd926121ef565b9161323d565b90612310565b6132e9906132e36125169461323d565b906121ef565b612310565b7fae193563000000000000000000000000000000000000000000000000000000005f5260045ffd5b63ffffffff9192506133289042611e9a565b9116105f806132a6565b9450905060a0843d60a011613380575b8161334f60a09383611d17565b81010312610a695761336084613226565b506020840151613377608060608701519601613226565b5093905f613299565b3d915061334256fe4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7aa2646970667358221220d9daf4483d184f8d85487bbed72b2914e918db08ec2dc31bb4e1aafbc5753abb64736f6c634300081c0033", + "devdoc": { + "author": "Cooper Labs", + "custom:contact": "security@cooperlabs.xyz", + "details": "This contract is an authorized fork of Angle's `SettersGovernor` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/SettersGovernor.sol", + "errors": { + "SafeCastOverflowedUintDowncast(uint8,uint256)": [ + { + "details": "Value doesn't fit in an uint of `bits` size." + } + ], + "SafeERC20FailedDecreaseAllowance(address,uint256,uint256)": [ + { + "details": "Indicates a failed `decreaseAllowance` request." + } + ], + "SafeERC20FailedOperation(address)": [ + { + "details": "An operation with an ERC-20 token failed." + } + ] + }, + "kind": "dev", + "methods": { + "addCollateral(address)": { + "details": "Collateral assets with a fee on transfer are not supported by the system" + }, + "adjustStablecoins(address,uint128,bool)": { + "details": "The amount passed here must be an absolute amount" + }, + "changeAllowance(address,address,uint256)": { + "details": "This function can typically be used to grant allowance to a newly added manager for it to pull the funds associated to the collateral it corresponds to" + }, + "recoverERC20(address,address,address,uint256)": { + "details": "No check is made on the collateral that is redeemed: this function could typically be used by a governance during a manual rebalance of the reserves of the system`collateral` is different from `token` only in the case of a managed collateral" + }, + "revokeCollateral(address,bool)": { + "details": "Require `collatInfo.normalizedStables == 0`, that is to say that the collateral is not used to back stablesThe system may still have a non null balance of the collateral that is revoked: this should later be handled through a recoverERC20 callFunds needs to have been withdrew from the manager prior to this call if `checkExternalManagerBalance` is true" + }, + "setCollateralManager(address,bool,(address[],bytes))": { + "details": "Funds need to have been withdrawn from the eventual previous manager prior to this call" + } + }, + "title": "SettersGovernor", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addCollateral(address)": { + "notice": "Add `collateral` as a supported collateral in the system" + }, + "adjustStablecoins(address,uint128,bool)": { + "notice": "Adjusts the amount of stablecoins issued from `collateral` by `amount`" + }, + "changeAllowance(address,address,uint256)": { + "notice": "Sets the allowance of the contract on `token` for `spender` to `amount`" + }, + "recoverERC20(address,address,address,uint256)": { + "notice": "Recovers `amount` of `token` from the Parallelizer contract" + }, + "revokeCollateral(address,bool)": { + "notice": "Revokes `collateral` from the system" + }, + "setAccessManager(address)": { + "notice": "Sets a new access manager address" + }, + "setCollateralManager(address,bool,(address[],bytes))": { + "notice": "Sets (or unsets) a collateral manager `collateral`" + }, + "setOracle(address,bytes)": { + "notice": "Sets the `oracleConfig` used to read the value of `collateral` for the mint, burn and redemption operations" + }, + "setWhitelistStatus(address,uint8,bytes)": { + "notice": "Changes whether a `collateral` can only be handled during burns and redemptions by whitelisted addresses and sets the data used to read into the whitelist" + }, + "toggleTrusted(address,uint8)": { + "notice": "Changes the trusted status for `sender` when for selling rewards or updating the normalizer" + }, + "updateOracle(address)": { + "notice": "Update oracle data for a given `collateral`" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/SettersGuardian.json b/deployments/sepolia/SettersGuardian.json new file mode 100644 index 0000000..a3a1155 --- /dev/null +++ b/deployments/sepolia/SettersGuardian.json @@ -0,0 +1,311 @@ +{ + "address": "0xa9C21Cf291ad935e0C9B05a55A42254fB159181d", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidNegativeFees", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidParams", + "type": "error" + }, + { + "inputs": [], + "name": "NotCollateral", + "type": "error" + }, + { + "inputs": [], + "name": "NotGovernor", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64[]", + "name": "xFee", + "type": "uint64[]" + }, + { + "indexed": false, + "internalType": "int64[]", + "name": "yFee", + "type": "int64[]" + }, + { + "indexed": false, + "internalType": "bool", + "name": "mint", + "type": "bool" + } + ], + "name": "FeesSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "pausedType", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isPaused", + "type": "bool" + } + ], + "name": "PauseToggled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64[]", + "name": "xFee", + "type": "uint64[]" + }, + { + "indexed": false, + "internalType": "int64[]", + "name": "yFee", + "type": "int64[]" + } + ], + "name": "RedemptionCurveParamsSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stablecoinCap", + "type": "uint256" + } + ], + "name": "StablecoinCapSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum WhitelistType", + "name": "whitelistType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "who", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "whitelistStatus", + "type": "uint256" + } + ], + "name": "WhitelistStatusToggled", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "internalType": "uint64[]", + "name": "xFee", + "type": "uint64[]" + }, + { + "internalType": "int64[]", + "name": "yFee", + "type": "int64[]" + }, + { + "internalType": "bool", + "name": "mint", + "type": "bool" + } + ], + "name": "setFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64[]", + "name": "xFee", + "type": "uint64[]" + }, + { + "internalType": "int64[]", + "name": "yFee", + "type": "int64[]" + } + ], + "name": "setRedemptionCurveParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "stablecoinCap", + "type": "uint256" + } + ], + "name": "setStablecoinCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateral", + "type": "address" + }, + { + "internalType": "enum ActionType", + "name": "pausedType", + "type": "uint8" + } + ], + "name": "togglePause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum WhitelistType", + "name": "whitelistType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "who", + "type": "address" + } + ], + "name": "toggleWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x07f4551cc121bc610d2899d4fc27f732cfffa098c46c7250ba5579eb498a4fce", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0xa9C21Cf291ad935e0C9B05a55A42254fB159181d", + "transactionIndex": 129, + "gasUsed": "1793207", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x6aa7b30a79d0ee60d30d20d0faaedbe7042cc8750f081e61e7d9de41d46d4901", + "transactionHash": "0x07f4551cc121bc610d2899d4fc27f732cfffa098c46c7250ba5579eb498a4fce", + "logs": [], + "blockNumber": 8411099, + "cumulativeGasUsed": "19598777", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9d44d918681c9ad36f866ebee034a3d1", + "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AccessManagedUnauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNegativeFees\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotCollateral\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotGovernor\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"xFee\",\"type\":\"uint64[]\"},{\"indexed\":false,\"internalType\":\"int64[]\",\"name\":\"yFee\",\"type\":\"int64[]\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"mint\",\"type\":\"bool\"}],\"name\":\"FeesSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"pausedType\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isPaused\",\"type\":\"bool\"}],\"name\":\"PauseToggled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"xFee\",\"type\":\"uint64[]\"},{\"indexed\":false,\"internalType\":\"int64[]\",\"name\":\"yFee\",\"type\":\"int64[]\"}],\"name\":\"RedemptionCurveParamsSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stablecoinCap\",\"type\":\"uint256\"}],\"name\":\"StablecoinCapSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum WhitelistType\",\"name\":\"whitelistType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"who\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"whitelistStatus\",\"type\":\"uint256\"}],\"name\":\"WhitelistStatusToggled\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"internalType\":\"uint64[]\",\"name\":\"xFee\",\"type\":\"uint64[]\"},{\"internalType\":\"int64[]\",\"name\":\"yFee\",\"type\":\"int64[]\"},{\"internalType\":\"bool\",\"name\":\"mint\",\"type\":\"bool\"}],\"name\":\"setFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"xFee\",\"type\":\"uint64[]\"},{\"internalType\":\"int64[]\",\"name\":\"yFee\",\"type\":\"int64[]\"}],\"name\":\"setRedemptionCurveParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"stablecoinCap\",\"type\":\"uint256\"}],\"name\":\"setStablecoinCap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collateral\",\"type\":\"address\"},{\"internalType\":\"enum ActionType\",\"name\":\"pausedType\",\"type\":\"uint8\"}],\"name\":\"togglePause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum WhitelistType\",\"name\":\"whitelistType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"who\",\"type\":\"address\"}],\"name\":\"toggleWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Cooper Labs\",\"custom:contact\":\"security@cooperlabs.xyz\",\"details\":\"This contract is an authorized fork of Angle's `SettersGuardian` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/SettersGuardian.sol\",\"kind\":\"dev\",\"methods\":{},\"title\":\"SettersGuardian\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"setFees(address,uint64[],int64[],bool)\":{\"notice\":\"Sets the mint or burn fees for `collateral`\"},\"setRedemptionCurveParams(uint64[],int64[])\":{\"notice\":\"Sets the parameters for the redemption curve\"},\"setStablecoinCap(address,uint256)\":{\"notice\":\"Sets the stablecoin cap that can be issued from a `collateral`\"},\"togglePause(address,uint8)\":{\"notice\":\"Changes the pause status for mint or burn transactions for `collateral`\"},\"toggleWhitelist(uint8,address)\":{\"notice\":\"Changes the whitelist status for a collateral with `whitelistType` for an address `who`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/parallelizer/facets/SettersGuardian.sol\":\"SettersGuardian\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAuthority} from \\\"./IAuthority.sol\\\";\\n\\nlibrary AuthorityUtils {\\n /**\\n * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\\n * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\\n * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\\n */\\n function canCallWithDelay(\\n address authority,\\n address caller,\\n address target,\\n bytes4 selector\\n ) internal view returns (bool immediate, uint32 delay) {\\n (bool success, bytes memory data) = authority.staticcall(\\n abi.encodeCall(IAuthority.canCall, (caller, target, selector))\\n );\\n if (success) {\\n if (data.length >= 0x40) {\\n (immediate, delay) = abi.decode(data, (bool, uint32));\\n } else if (data.length >= 0x20) {\\n immediate = abi.decode(data, (bool));\\n }\\n }\\n return (immediate, delay);\\n }\\n}\\n\",\"keccak256\":\"0xb3875997b0d8705e29aa20fee88e1dfef93df438794ae1ad8ba2eb016a4dd4e4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAccessManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\ninterface IAccessManager {\\n /**\\n * @dev A delayed operation was scheduled.\\n */\\n event OperationScheduled(\\n bytes32 indexed operationId,\\n uint32 indexed nonce,\\n uint48 schedule,\\n address caller,\\n address target,\\n bytes data\\n );\\n\\n /**\\n * @dev A scheduled operation was executed.\\n */\\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev A scheduled operation was canceled.\\n */\\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev Informational labelling for a roleId.\\n */\\n event RoleLabel(uint64 indexed roleId, string label);\\n\\n /**\\n * @dev Emitted when `account` is granted `roleId`.\\n *\\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\\n * otherwise it indicates the execution delay for this account and roleId is updated.\\n */\\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\\n\\n /**\\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\\n */\\n event RoleRevoked(uint64 indexed roleId, address indexed account);\\n\\n /**\\n * @dev Role acting as admin over a given `roleId` is updated.\\n */\\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\\n\\n /**\\n * @dev Role acting as guardian over a given `roleId` is updated.\\n */\\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\\n\\n /**\\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\\n */\\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\\n\\n /**\\n * @dev Target mode is updated (true = closed, false = open).\\n */\\n event TargetClosed(address indexed target, bool closed);\\n\\n /**\\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\\n */\\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\\n\\n /**\\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\\n */\\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\\n\\n error AccessManagerAlreadyScheduled(bytes32 operationId);\\n error AccessManagerNotScheduled(bytes32 operationId);\\n error AccessManagerNotReady(bytes32 operationId);\\n error AccessManagerExpired(bytes32 operationId);\\n error AccessManagerLockedRole(uint64 roleId);\\n error AccessManagerBadConfirmation();\\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\\n error AccessManagerUnauthorizedConsume(address target);\\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\\n\\n /**\\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\\n * & {execute} workflow.\\n *\\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\\n * for future execution.\\n *\\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\\n * the operation can be executed if and only if delay is greater than 0.\\n *\\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\\n *\\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\\n * {AccessManager} documentation.\\n */\\n function canCall(\\n address caller,\\n address target,\\n bytes4 selector\\n ) external view returns (bool allowed, uint32 delay);\\n\\n /**\\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\\n *\\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\\n * disabling any scheduling usage.\\n */\\n function expiration() external view returns (uint32);\\n\\n /**\\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\\n * can be increased without setback (and reset via {revokeRole} in the case event of an\\n * accidental increase). Defaults to 5 days.\\n */\\n function minSetback() external view returns (uint32);\\n\\n /**\\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\\n *\\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\\n */\\n function isTargetClosed(address target) external view returns (bool);\\n\\n /**\\n * @dev Get the role required to call a function.\\n */\\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\\n\\n /**\\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\\n */\\n function getTargetAdminDelay(address target) external view returns (uint32);\\n\\n /**\\n * @dev Get the id of the role that acts as an admin for the given role.\\n *\\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\\n * an operation that is restricted to this role.\\n */\\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role that acts as a guardian for a given role.\\n *\\n * The guardian permission allows canceling operations that have been scheduled under the role.\\n */\\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role current grant delay.\\n *\\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\\n */\\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\\n\\n /**\\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\\n * level.\\n *\\n * Returns:\\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\\n * [1] Current execution delay for the account.\\n * [2] Pending execution delay for the account.\\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\\n */\\n function getAccess(\\n uint64 roleId,\\n address account\\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\\n\\n /**\\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\\n * permission might be associated with an execution delay. {getAccess} can provide more details.\\n */\\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\\n\\n /**\\n * @dev Give a label to a role, for improved role discoverability by UIs.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleLabel} event.\\n */\\n function labelRole(uint64 roleId, string calldata label) external;\\n\\n /**\\n * @dev Add `account` to `roleId`, or change its execution delay.\\n *\\n * This gives the account the authorization to call any function that is restricted to this role. An optional\\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\\n *\\n * If the account has already been granted this role, the execution delay will be updated. This update is not\\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - granted role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleGranted} event.\\n */\\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\\n\\n /**\\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\\n * no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - revoked role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function revokeRole(uint64 roleId, address account) external;\\n\\n /**\\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\\n * the role this call has no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function renounceRole(uint64 roleId, address callerConfirmation) external;\\n\\n /**\\n * @dev Change admin role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleAdminChanged} event\\n */\\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\\n\\n /**\\n * @dev Change guardian role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGuardianChanged} event\\n */\\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\\n\\n /**\\n * @dev Update the delay for granting a `roleId`.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGrantDelayChanged} event.\\n */\\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetFunctionRoleUpdated} event per selector.\\n */\\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\\n\\n /**\\n * @dev Set the delay for changing the configuration of a given target contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetAdminDelayUpdated} event.\\n */\\n function setTargetAdminDelay(address target, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the closed flag for a contract.\\n *\\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetClosed} event.\\n */\\n function setTargetClosed(address target, bool closed) external;\\n\\n /**\\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\\n * operation is not yet scheduled, has expired, was executed, or was canceled.\\n */\\n function getSchedule(bytes32 id) external view returns (uint48);\\n\\n /**\\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\\n * been scheduled.\\n */\\n function getNonce(bytes32 id) external view returns (uint32);\\n\\n /**\\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\\n * required for the caller. The special value zero will automatically set the earliest possible time.\\n *\\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\\n *\\n * Emits a {OperationScheduled} event.\\n *\\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\\n * contract if it is using standard Solidity ABI encoding.\\n */\\n function schedule(\\n address target,\\n bytes calldata data,\\n uint48 when\\n ) external returns (bytes32 operationId, uint32 nonce);\\n\\n /**\\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\\n * execution delay is 0.\\n *\\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\\n *\\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\\n */\\n function execute(address target, bytes calldata data) external payable returns (uint32);\\n\\n /**\\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\\n * operation that is cancelled.\\n *\\n * Requirements:\\n *\\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\\n *\\n * Emits a {OperationCanceled} event.\\n */\\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\\n\\n /**\\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\\n *\\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\\n * with all the verifications that it implies.\\n *\\n * Emit a {OperationExecuted} event.\\n */\\n function consumeScheduledOp(address caller, bytes calldata data) external;\\n\\n /**\\n * @dev Hashing function for delayed operations.\\n */\\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\\n\\n /**\\n * @dev Changes the authority of a target managed by this manager instance.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n */\\n function updateAuthority(address target, address newAuthority) external;\\n}\\n\",\"keccak256\":\"0x9be2d08a326515805bc9cf6315b7953f8d1ebe88abf48c2d645fb1fa8211a0e2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAuthority.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard interface for permissioning originally defined in Dappsys.\\n */\\ninterface IAuthority {\\n /**\\n * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\\n */\\n function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\\n}\\n\",\"keccak256\":\"0x4cc0766bd7fb7b3bafb70afa2a93b6e313a0baec7a35ad1b57505be7861c1030\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\n\",\"keccak256\":\"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x70f2f713b13b7ce4610bcd0ac9fec0f3cc43693b043abcb8dc40a42a726eb330\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/interfaces/IManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IManager` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IManager.sol\\ninterface IManager {\\n /// @notice Returns the amount of collateral managed by the Manager\\n /// @return balances Balances of all the subCollaterals handled by the manager\\n /// @dev MUST NOT revert\\n function totalAssets() external view returns (uint256[] memory balances, uint256 totalValue);\\n\\n /// @notice Hook to invest `amount` of `collateral`\\n /// @dev MUST revert if the manager cannot accept these funds\\n /// @dev MUST have received the funds beforehand\\n function invest(uint256 amount) external;\\n\\n /// @notice Sends `amount` of `collateral` to the `to` address\\n /// @dev Called when `tokenP` are burnt and during redemptions\\n // @dev MUST revert if there are not funds enough available\\n /// @dev MUST be callable only by the parallelizer\\n function release(address asset, address to, uint256 amount) external;\\n\\n /// @notice Gives the maximum amount of collateral immediately available for a transfer\\n /// @dev Useful for integrators using `quoteIn` and `quoteOut`\\n function maxAvailable() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8507172834f0243643fcf366bff6bae8f20523d102f5896f2140946975458e2c\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IParallelizerOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IParallelizerOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IParallelizerOracle` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IParallelizerOracle.sol\\ninterface IParallelizerOracle {\\n /// @notice Reads the oracle value for asset to use in a redemption to compute the collateral ratio\\n function readRedemption() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a mint. It should be comprehensive of the\\n /// deviation from the target price\\n function readMint() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a burn transaction as well as the ratio\\n /// between the current price and the target price for the asset\\n function readBurn() external view returns (uint256 oracleValue, uint256 ratio);\\n\\n /// @notice Reads the oracle value for asset\\n function read() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb7287bfcade62fa4dfb07ea1cd6c1fc8be1525320f3faca44d8d9a6a01e99110\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/ISetters.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/interfaces/IERC20.sol\\\";\\n\\nimport \\\"../parallelizer/Storage.sol\\\";\\n\\n/// @title ISettersGovernor\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `ISettersGovernor` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/ISetters.sol\\ninterface ISettersGovernor {\\n /// @notice Recovers `amount` of `token` from the Parallelizer contract\\n function recoverERC20(address collateral, IERC20 token, address to, uint256 amount) external;\\n\\n /// @notice Sets a new access manager address\\n function setAccessManager(address _newAccessManager) external;\\n\\n /// @notice Sets (or unsets) a collateral manager `collateral`\\n /// @dev If `checkExternalManagerBalance` is true, the function will check that the current manager no longer has\\n /// assets before setting the new manager\\n function setCollateralManager(\\n address collateral,\\n bool checkExternalManagerBalance,\\n ManagerStorage memory managerData\\n )\\n external;\\n\\n /// @notice Sets the allowance of the contract on `token` for `spender` to `amount`\\n function changeAllowance(IERC20 token, address spender, uint256 amount) external;\\n\\n /// @notice Changes the trusted status for `sender` when for selling rewards or updating the normalizer\\n function toggleTrusted(address sender, TrustedType t) external;\\n\\n /// @notice Changes whether a `collateral` can only be handled during burns and redemptions by whitelisted\\n /// addresses\\n /// and sets the data used to read into the whitelist\\n function setWhitelistStatus(address collateral, uint8 whitelistStatus, bytes memory whitelistData) external;\\n\\n /// @notice Add `collateral` as a supported collateral in the system\\n function addCollateral(address collateral) external;\\n\\n /// @notice Adjusts the amount of stablecoins issued from `collateral` by `amount`\\n function adjustStablecoins(address collateral, uint128 amount, bool increase) external;\\n\\n /// @notice Revokes `collateral` from the system\\n /// @dev If `checkExternalManagerBalance` is true, the function will check that the current manager no longer has\\n /// assets before revoking the collateral\\n function revokeCollateral(address collateral, bool checkExternalManagerBalance) external;\\n\\n /// @notice Sets the `oracleConfig` used to read the value of `collateral` for the mint, burn and redemption\\n /// operations\\n function setOracle(address collateral, bytes memory oracleConfig) external;\\n\\n /// @notice Update oracle data for a given `collateral`\\n function updateOracle(address collateral) external;\\n}\\n\\n/// @title ISettersGovernor\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\ninterface ISettersGuardian {\\n /// @notice Changes the pause status for mint or burn transactions for `collateral`\\n function togglePause(address collateral, ActionType action) external;\\n\\n /// @notice Sets the mint or burn fees for `collateral`\\n function setFees(address collateral, uint64[] memory xFee, int64[] memory yFee, bool mint) external;\\n\\n /// @notice Sets the parameters for the redemption curve\\n function setRedemptionCurveParams(uint64[] memory xFee, int64[] memory yFee) external;\\n\\n /// @notice Changes the whitelist status for a collateral with `whitelistType` for an address `who`\\n function toggleWhitelist(WhitelistType whitelistType, address who) external;\\n\\n /// @notice Sets the stablecoin cap that can be issued from a `collateral`\\n function setStablecoinCap(address collateral, uint256 stablecoinCap) external;\\n}\\n\",\"keccak256\":\"0xc3fb2012e7c2f97ae93b12276afc4293aaeb97a6fe4d60109acaa94ef6945575\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/ITokenP.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title ITokenP\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Interface for the stablecoins `tokenP` contracts\\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\\ninterface ITokenP is IERC20 {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MINTER ROLE ONLY FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Lets a whitelisted contract mint tokenPs\\n /// @param account Address to mint to\\n /// @param amount Amount to mint\\n function mint(address account, uint256 amount) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @param sender Address which requested the burn from `burner`\\n /// @dev This method is to be called by a contract with the minter right after being requested\\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\\n /// @dev The method checks the allowance between the `sender` and the `burner`\\n function burnFrom(uint256 amount, address burner, address sender) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\\n /// requested to do so by an address willing to burn tokens from its address\\n function burnSelf(uint256 amount, address burner) external;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Amount of decimals of the stablecoin\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x64a1305faa8c5c91767a11af0eae16e4b463aa0bfe10f11b74aae9d96681a5eb\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\ninterface AggregatorV3Interface {\\n function decimals() external view returns (uint8);\\n\\n function description() external view returns (string memory);\\n\\n function version() external view returns (uint256);\\n\\n // getRoundData and latestRoundData should both raise \\\"No data present\\\"\\n // if they do not have data to report, instead of returning unset values\\n // which could be misinterpreted as actual reported values.\\n function getRoundData(uint80 _roundId)\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n\\n function latestRoundData()\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n}\\n\",\"keccak256\":\"0x94da577160ebb1bfeb7008676c8e7d43dda926d9c0beee29077e9ed774707373\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/coinbase/ICbETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ICbETH\\n/// @notice Interface for the `cbETH` contract\\ninterface ICbETH {\\n function exchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb159341cb0e25c478912b274cdda2d50fa84692aeac87b6823d281aaea2aed04\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/frax/ISfrxETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ISfrxETH\\n/// @notice Interface for the `sfrxETH` contract\\ninterface ISfrxETH {\\n function pricePerShare() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x914cbea276f817c7db62bfca21e15bd8f7892faa9f39d86baaef574cf12b859f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/keyring/IKeyringGuard.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IKeyringGuard\\n/// @notice Interface for the `KeyringGuard` contract\\ninterface IKeyringGuard {\\n function isAuthorized(address from, address to) external returns (bool passed);\\n}\\n\",\"keccak256\":\"0x30bdab602ba0a6e2571372803ae35f7bebcc354d69408be627c04c57f7071f90\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/lido/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IStETH\\n/// @notice Interface for the `StETH` contract\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n\\n function submit(address) external payable returns (uint256);\\n\\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf21e3d8bdadc236b34bf2122b0e0b939d2d6bb6e2889b508636cbb7b84f59680\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/morpho/IMorphoOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IMorphoOracle\\n/// @notice Interface for the oracle contracts used within Morpho\\ninterface IMorphoOracle {\\n function price() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x0d1849803b554763f1dce55eba5a6e8d7c5b12d4cc8dfe23637e827d2ee91d17\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/rocketPool/IRETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IRETH\\n/// @notice Interface for the `rETH` contract\\ninterface IRETH {\\n function getExchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x567a378e95d40160e297c1adb617ccaa69c03e49c4ad72a6ce651dd43cdbd5cd\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/Storage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ENUMS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nenum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n}\\n\\nenum ManagerType {\\n EXTERNAL\\n}\\n\\nenum ActionType {\\n Mint,\\n Burn,\\n Redeem\\n}\\n\\nenum TrustedType {\\n Updater,\\n Seller\\n}\\n\\nenum QuoteType {\\n MintExactInput,\\n MintExactOutput,\\n BurnExactInput,\\n BurnExactOutput\\n}\\n\\nenum OracleReadType {\\n CHAINLINK_FEEDS,\\n EXTERNAL,\\n NO_ORACLE,\\n STABLE,\\n WSTETH,\\n CBETH,\\n RETH,\\n SFRXETH,\\n MAX,\\n MORPHO_ORACLE\\n}\\n\\nenum OracleQuoteType {\\n UNIT,\\n TARGET\\n}\\n\\nenum WhitelistType {\\n BACKED\\n}\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STRUCTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nstruct Permit2Details {\\n address to; // Address that will receive the funds\\n uint256 nonce; // Nonce of the transaction\\n bytes signature; // Permit signature of the user\\n}\\n\\nstruct FacetCut {\\n address facetAddress; // Facet contract address\\n FacetCutAction action; // Can be add, remove or replace\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct Facet {\\n address facetAddress; // Facet contract address\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct FacetInfo {\\n address facetAddress; // Facet contract address\\n uint16 selectorPosition; // Position in the list of all selectors\\n}\\n\\nstruct DiamondStorage {\\n bytes4[] selectors; // List of all available selectors\\n mapping(bytes4 => FacetInfo) selectorInfo; // Selector to (address, position in list)\\n IAccessManager accessManager; // Contract handling access management\\n}\\n\\nstruct ImplementationStorage {\\n address implementation; // Dummy implementation address for Etherscan usability\\n}\\n\\nstruct ManagerStorage {\\n IERC20[] subCollaterals; // Subtokens handled by the manager or strategies\\n bytes config; // Additional configuration data\\n}\\n\\nstruct Collateral {\\n uint8 isManaged; // If the collateral is managed through external strategies\\n uint8 isMintLive; // If minting from this asset is unpaused\\n uint8 isBurnLive; // If burning to this asset is unpaused\\n uint8 decimals; // IERC20Metadata(collateral).decimals()\\n uint8 onlyWhitelisted; // If only whitelisted addresses can burn or redeem for this token\\n uint216 normalizedStables; // Normalized amount of stablecoins issued from this collateral\\n uint64[] xFeeMint; // Increasing exposures in [0,BASE_9[\\n int64[] yFeeMint; // Mint fees at the exposures specified in `xFeeMint`\\n uint64[] xFeeBurn; // Decreasing exposures in ]0,BASE_9]\\n int64[] yFeeBurn; // Burn fees at the exposures specified in `xFeeBurn`\\n bytes oracleConfig; // Data about the oracle used for the collateral\\n bytes whitelistData; // For whitelisted collateral, data used to verify whitelists\\n ManagerStorage managerData; // For managed collateral, data used to handle the strategies\\n uint256 stablecoinCap; // Cap on the amount of stablecoins that can be issued from this collateral\\n}\\n\\nstruct ParallelizerStorage {\\n ITokenP tokenP; // tokenP handled by the system\\n uint8 isRedemptionLive; // If redemption is unpaused\\n uint8 statusReentrant; // If call is reentrant or not\\n bool consumingSchedule; // If the contract is consuming a scheduled operation\\n uint128 normalizedStables; // Normalized amount of stablecoins issued by the system\\n uint128 normalizer; // To reconcile `normalizedStables` values with the actual amount\\n address[] collateralList; // List of collateral assets supported by the system\\n uint64[] xRedemptionCurve; // Increasing collateral ratios > 0\\n int64[] yRedemptionCurve; // Value of the redemption fees at `xRedemptionCurve`\\n mapping(address => Collateral) collaterals; // Maps a collateral asset to its parameters\\n mapping(address => uint256) isTrusted; // If an address is trusted to update the normalizer value\\n mapping(address => uint256) isSellerTrusted; // If an address is trusted to sell accruing reward tokens or to run\\n // keeper jobs on oracles\\n mapping(WhitelistType => mapping(address => uint256)) isWhitelistedForType;\\n}\\n// Whether an address is whitelisted for a specific whitelist type\\n\",\"keccak256\":\"0x3f4313dd110dbe390038320b2d3cf24dcbe9b75cd9573e7f048f7233c02dd227\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/AccessManagedModifiers.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { LibDiamond } from \\\"../libraries/LibDiamond.sol\\\";\\nimport { LibStorage as s, ParallelizerStorage } from \\\"../libraries/LibStorage.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\n\\n/// @title AccessManagedModifiers\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This contract is an authorized fork of Angle's `AccessControlModifiers` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/AccessControlModifiers.sol\\n/// update access logic to use OpenZeppelin's `AccessManaged` logic\\ncontract AccessManagedModifiers {\\n /// @notice Checks whether the `msg.sender` can call a function with a given selector\\n modifier restricted() {\\n if (!LibDiamond.checkCanCall(msg.sender, msg.data)) revert AccessManagedUnauthorized(msg.sender);\\n _;\\n }\\n\\n /// @notice Prevents a contract from calling itself, directly or indirectly\\n /// @dev This implementation is an adaptation of the OpenZepellin `ReentrancyGuard` for the purpose of this\\n /// Diamond Proxy system. The base implementation can be found here\\n /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol\\n modifier nonReentrant() {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n // Reentrant protection\\n // On the first call, `ts.statusReentrant` will be `NOT_ENTERED`\\n if (ts.statusReentrant == ENTERED) revert ReentrantCall();\\n // Any calls to the `nonReentrant` modifier after this point will fail\\n ts.statusReentrant = ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n ts.statusReentrant = NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0xa23f4434f86462af0594992bd826ba6af88f55201f2a7f79ce5fde05b5f10073\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/SettersGuardian.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ISettersGuardian } from \\\"contracts/interfaces/ISetters.sol\\\";\\n\\nimport { LibSetters } from \\\"../libraries/LibSetters.sol\\\";\\nimport { AccessManagedModifiers } from \\\"./AccessManagedModifiers.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title SettersGuardian\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This contract is an authorized fork of Angle's `SettersGuardian` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/SettersGuardian.sol\\ncontract SettersGuardian is AccessManagedModifiers, ISettersGuardian {\\n /// @inheritdoc ISettersGuardian\\n function togglePause(address collateral, ActionType pausedType) external restricted {\\n LibSetters.togglePause(collateral, pausedType);\\n }\\n\\n /// @inheritdoc ISettersGuardian\\n function setFees(address collateral, uint64[] memory xFee, int64[] memory yFee, bool mint) external restricted {\\n LibSetters.setFees(collateral, xFee, yFee, mint);\\n }\\n\\n /// @inheritdoc ISettersGuardian\\n function setRedemptionCurveParams(uint64[] memory xFee, int64[] memory yFee) external restricted {\\n LibSetters.setRedemptionCurveParams(xFee, yFee);\\n }\\n\\n /// @inheritdoc ISettersGuardian\\n function toggleWhitelist(WhitelistType whitelistType, address who) external restricted {\\n LibSetters.toggleWhitelist(whitelistType, who);\\n }\\n\\n /// @inheritdoc ISettersGuardian\\n function setStablecoinCap(address collateral, uint256 stablecoinCap) external restricted {\\n LibSetters.setStablecoinCap(collateral, stablecoinCap);\\n }\\n}\\n\",\"keccak256\":\"0x681943adfb6215e081ebdb44a25df051214f3d3185e9faf3f7cc3ff1eabb3769\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibDiamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { AuthorityUtils } from \\\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibDiamond\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Helper library to deal with diamond proxies.\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/libraries/LibDiamond.sol by mudgen\\nlibrary LibDiamond {\\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n function isGovernor(address caller) internal view returns (bool) {\\n (bool isMember,) = s.diamondStorage().accessManager.hasRole(GOVERNOR_ROLE, caller);\\n return isMember;\\n }\\n\\n /// @notice Checks whether `caller` can call `data` on `this`\\n function checkCanCall(address caller, bytes calldata data) internal returns (bool) {\\n IAccessManager accessManager = s.diamondStorage().accessManager;\\n (bool immediate, uint32 delay) =\\n AuthorityUtils.canCallWithDelay(address(accessManager), caller, address(this), bytes4(data[0:4]));\\n if (!immediate) {\\n if (delay > 0) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n ts.consumingSchedule = true;\\n accessManager.consumeScheduledOp(caller, data);\\n ts.consumingSchedule = false;\\n } else {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @notice Internal function version of `diamondCut`\\n function diamondCut(FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {\\n uint256 diamondCutLength = _diamondCut.length;\\n for (uint256 facetIndex; facetIndex < diamondCutLength; facetIndex++) {\\n bytes4[] memory functionSelectors = _diamondCut[facetIndex].functionSelectors;\\n address facetAddress = _diamondCut[facetIndex].facetAddress;\\n\\n if (functionSelectors.length == 0) {\\n revert NoSelectorsProvidedForFacetForCut(facetAddress);\\n }\\n\\n FacetCutAction action = _diamondCut[facetIndex].action;\\n if (action == FacetCutAction.Add) {\\n _addFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Replace) {\\n _replaceFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Remove) {\\n _removeFunctions(facetAddress, functionSelectors);\\n }\\n }\\n\\n emit DiamondCut(_diamondCut, _init, _calldata);\\n _initializeDiamondCut(_init, _calldata);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n PRIVATE FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Does a delegate call on `_init` with `_calldata`\\n function _initializeDiamondCut(address _init, bytes memory _calldata) private {\\n if (_init == address(0)) {\\n return;\\n }\\n _enforceHasContractCode(_init);\\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n if (!success) {\\n if (error.length > 0) {\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(error)\\n revert(add(32, error), returndata_size)\\n }\\n } else {\\n revert InitializationFunctionReverted(_init, _calldata);\\n }\\n }\\n }\\n\\n /// @notice Adds a new function to the diamond proxy\\n /// @dev Reverts if selectors are already existing\\n function _addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n if (_facetAddress == address(0)) {\\n revert CannotAddSelectorsToZeroAddress(_functionSelectors);\\n }\\n DiamondStorage storage ds = s.diamondStorage();\\n uint16 selectorCount = uint16(ds.selectors.length);\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n if (oldFacetAddress != address(0)) {\\n revert CannotAddFunctionToDiamondThatAlreadyExists(selector);\\n }\\n ds.selectorInfo[selector] = FacetInfo(_facetAddress, selectorCount);\\n ds.selectors.push(selector);\\n selectorCount++;\\n }\\n }\\n\\n /// @notice Upgrades a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n if (_facetAddress == address(0)) {\\n revert CannotReplaceFunctionsFromFacetWithZeroAddress(_functionSelectors);\\n }\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n // Can't replace immutable functions -- functions defined directly in the diamond in this case\\n if (oldFacetAddress == address(this)) {\\n revert CannotReplaceImmutableFunction(selector);\\n }\\n if (oldFacetAddress == _facetAddress) {\\n revert CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(selector);\\n }\\n if (oldFacetAddress == address(0)) {\\n revert CannotReplaceFunctionThatDoesNotExists(selector);\\n }\\n // Replace old facet address\\n ds.selectorInfo[selector].facetAddress = _facetAddress;\\n }\\n }\\n\\n /// @notice Removes a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n uint256 selectorCount = ds.selectors.length;\\n if (_facetAddress != address(0)) {\\n revert RemoveFacetAddressMustBeZeroAddress(_facetAddress);\\n }\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n FacetInfo memory oldFacetAddressAndSelectorPosition = ds.selectorInfo[selector];\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(0)) {\\n revert CannotRemoveFunctionThatDoesNotExist(selector);\\n }\\n\\n // Can't remove immutable functions -- functions defined directly in the diamond\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(this)) {\\n revert CannotRemoveImmutableFunction(selector);\\n }\\n // Replace selector with last selector\\n selectorCount--;\\n if (oldFacetAddressAndSelectorPosition.selectorPosition != selectorCount) {\\n bytes4 lastSelector = ds.selectors[selectorCount];\\n ds.selectors[oldFacetAddressAndSelectorPosition.selectorPosition] = lastSelector;\\n ds.selectorInfo[lastSelector].selectorPosition = oldFacetAddressAndSelectorPosition.selectorPosition;\\n }\\n // Delete last selector\\n ds.selectors.pop();\\n delete ds.selectorInfo[selector];\\n }\\n }\\n\\n /// @notice Checks that an address has a non void bytecode\\n function _enforceHasContractCode(address _contract) private view {\\n uint256 contractSize;\\n assembly (\\\"memory-safe\\\") {\\n contractSize := extcodesize(_contract)\\n }\\n if (contractSize == 0) {\\n revert ContractHasNoCode();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x10bde4c13cc3d3c4aec15b793565bfe05b5f770eafeb839bfd159dbe6351dc62\",\"license\":\"MIT\"},\"contracts/parallelizer/libraries/LibManager.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IManager } from \\\"contracts/interfaces/IManager.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Managed collateral assets may be handled through external smart contracts or directly through this library\\n/// @dev There is no implementation at this point for a managed collateral handled through this library, and\\n/// a new specific `ManagerType` would need to be added in this case\\n/// @dev This library is an authorized fork of Angle's `LibManager` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibManager.sol\\nlibrary LibManager {\\n /// @notice Checks to which address managed funds must be transferred\\n function transferRecipient(bytes memory config) internal view returns (address recipient) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n recipient = address(this);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (address));\\n }\\n\\n /// @notice Performs a transfer of `token` for a collateral that is managed to a `to` address\\n /// @dev `token` may not be the actual collateral itself, as some collaterals have subcollaterals associated\\n /// with it\\n /// @dev Eventually pulls funds from strategies\\n function release(address token, address to, uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).release(token, to, amount);\\n }\\n\\n /// @notice Gets the balances of all the tokens controlled through `managerData`\\n /// @return balances An array of size `subCollaterals` with current balances of all subCollaterals\\n /// including the one corresponding to the `managerData` given\\n /// @return totalValue The value of all the `subCollaterals` in `collateral`\\n /// @dev `subCollaterals` must always have as first token (index 0) the collateral itself\\n function totalAssets(bytes memory config) internal view returns (uint256[] memory balances, uint256 totalValue) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).totalAssets();\\n }\\n\\n /// @notice Calls a hook if needed after new funds have been transfered to a manager\\n function invest(uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).invest(amount);\\n }\\n\\n /// @notice Returns available underlying tokens, for instance if liquidity is fully used and\\n /// not withdrawable the function will return 0\\n function maxAvailable(bytes memory config) internal view returns (uint256 available) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).maxAvailable();\\n }\\n\\n /// @notice Decodes the `managerData` associated to a collateral\\n function parseManagerConfig(bytes memory config) internal pure returns (ManagerType managerType, bytes memory data) {\\n (managerType, data) = abi.decode(config, (ManagerType, bytes));\\n }\\n}\\n\",\"keccak256\":\"0x18282c744bc34bd9ae937c0c49e909c9c4e50c15e69fb485aa68fc56e549d1a1\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IParallelizerOracle } from \\\"contracts/interfaces/IParallelizerOracle.sol\\\";\\nimport { AggregatorV3Interface } from \\\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\\\";\\nimport { IMorphoOracle } from \\\"contracts/interfaces/external/morpho/IMorphoOracle.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibOracle` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibOracle.sol\\nlibrary LibOracle {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ACTIONS SPECIFIC ORACLES \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads the oracle value used during a redemption to compute collateral ratio for `oracleConfig`\\n /// @dev This value is only sensitive to compute the collateral ratio and deduce a penalty factor\\n function readRedemption(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (OracleReadType oracleType, OracleReadType targetType, bytes memory oracleData, bytes memory targetData,) =\\n _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readRedemption();\\n } else {\\n (oracleValue,) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, 0);\\n return oracleValue;\\n }\\n }\\n\\n /// @notice Reads the oracle value used during mint operations for an asset with `oracleConfig`\\n /// @dev For assets which do not rely on external oracles, this value is the minimum between the processed oracle\\n /// value for the asset and its target price\\n function readMint(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readMint();\\n }\\n\\n (uint128 userDeviation,) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n if (targetPrice < oracleValue) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads the oracle value used for a burn operation for an asset with `oracleConfig`\\n /// @return oracleValue The actual oracle value obtained\\n /// @return ratio If `oracle value < target price`, the ratio between the oracle value and the target\\n /// price, otherwise `BASE_18`\\n function readBurn(bytes memory oracleConfig) internal view returns (uint256 oracleValue, uint256 ratio) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readBurn();\\n }\\n (uint128 userDeviation, uint128 burnRatioDeviation) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n // Firewall in case the oracle value reported is low compared to the target\\n // If the oracle value is slightly below its target, then no deviation is reported for the oracle and\\n // the price of burning the stablecoin for other assets is not impacted. Also, the oracle value of this asset\\n // is set to the target price, to not be open to direct arbitrage\\n ratio = BASE_18;\\n if (oracleValue * BASE_18 < targetPrice * (BASE_18 - burnRatioDeviation)) {\\n ratio = (oracleValue * BASE_18) / targetPrice;\\n } else if (oracleValue < targetPrice) {\\n oracleValue = targetPrice;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n VIEW FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of the `getOracle` function\\n function getOracle(address collateral)\\n internal\\n view\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return _parseOracleConfig(s.transmuterStorage().collaterals[collateral].oracleConfig);\\n }\\n\\n /// @notice Gets the oracle value and the ratio with respect to the target price when it comes to\\n /// burning for `collateral`\\n function getBurnOracle(\\n address collateral,\\n bytes memory oracleConfig\\n )\\n internal\\n view\\n returns (uint256 minRatio, uint256 oracleValue)\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n minRatio = BASE_18;\\n address[] memory collateralList = ts.collateralList;\\n uint256 length = collateralList.length;\\n for (uint256 i; i < length; ++i) {\\n uint256 ratioObserved = BASE_18;\\n if (collateralList[i] != collateral) {\\n (, ratioObserved) = readBurn(ts.collaterals[collateralList[i]].oracleConfig);\\n } else {\\n (oracleValue, ratioObserved) = readBurn(oracleConfig);\\n }\\n if (ratioObserved < minRatio) minRatio = ratioObserved;\\n }\\n }\\n\\n /// @notice Computes the `quoteAmount` (for Chainlink oracles) depending on a `quoteType` and a base value\\n /// (e.g the target price of the asset)\\n /// @dev For cases where the Chainlink feed directly looks into the value of the asset, `quoteAmount` is `BASE_18`.\\n /// For others, like wstETH for which Chainlink only has an oracle for stETH, `quoteAmount` is the target price\\n function quoteAmount(OracleQuoteType quoteType, uint256 baseValue) internal pure returns (uint256) {\\n if (quoteType == OracleQuoteType.UNIT) return BASE_18;\\n else return baseValue;\\n }\\n\\n function readSpotAndTarget(\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n uint256 deviation\\n )\\n internal\\n view\\n returns (uint256 oracleValue, uint256 targetPrice)\\n {\\n targetPrice = read(targetType, BASE_18, targetData);\\n oracleValue = read(oracleType, targetPrice, oracleData);\\n // System may tolerate small deviations from target\\n // If the oracle value reported is reasonably close to the target\\n // --> disregard the oracle value and return the target price\\n if (\\n targetPrice * (BASE_18 - deviation) < oracleValue * BASE_18\\n && oracleValue * BASE_18 < targetPrice * (BASE_18 + deviation)\\n ) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads an oracle value (or a target oracle value) for an asset based on its data parsed `oracleConfig`\\n function read(OracleReadType readType, uint256 baseValue, bytes memory data) internal view returns (uint256) {\\n if (readType == OracleReadType.CHAINLINK_FEEDS) {\\n (\\n AggregatorV3Interface[] memory circuitChainlink,\\n uint32[] memory stalePeriods,\\n uint8[] memory circuitChainIsMultiplied,\\n uint8[] memory chainlinkDecimals,\\n OracleQuoteType quoteType\\n ) = abi.decode(data, (AggregatorV3Interface[], uint32[], uint8[], uint8[], OracleQuoteType));\\n uint256 quotePrice = quoteAmount(quoteType, baseValue);\\n uint256 listLength = circuitChainlink.length;\\n for (uint256 i; i < listLength; ++i) {\\n quotePrice = readChainlinkFeed(\\n quotePrice, circuitChainlink[i], circuitChainIsMultiplied[i], chainlinkDecimals[i], stalePeriods[i]\\n );\\n }\\n return quotePrice;\\n } else if (readType == OracleReadType.STABLE) {\\n return BASE_18;\\n } else if (readType == OracleReadType.NO_ORACLE) {\\n return baseValue;\\n } else if (readType == OracleReadType.WSTETH) {\\n return STETH.getPooledEthByShares(1 ether);\\n } else if (readType == OracleReadType.CBETH) {\\n return CBETH.exchangeRate();\\n } else if (readType == OracleReadType.RETH) {\\n return RETH.getExchangeRate();\\n } else if (readType == OracleReadType.SFRXETH) {\\n return SFRXETH.pricePerShare();\\n } else if (readType == OracleReadType.MAX) {\\n uint256 maxValue = abi.decode(data, (uint256));\\n return maxValue;\\n } else if (readType == OracleReadType.MORPHO_ORACLE) {\\n (address contractAddress, uint256 normalizationFactor) = abi.decode(data, (address, uint256));\\n return IMorphoOracle(contractAddress).price() / normalizationFactor;\\n }\\n // If the `OracleReadType` is `EXTERNAL`, it means that this function is called to compute a\\n // `targetPrice` in which case the `baseValue` is returned here\\n else {\\n return baseValue;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n SPECIFIC HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads a Chainlink feed using a quote amount and converts the quote amount to the out-currency\\n /// @param _quoteAmount The amount for which to compute the price expressed in `BASE_18`\\n /// @param feed Chainlink feed to query\\n /// @param multiplied Whether the ratio outputted by Chainlink should be multiplied or divided to the `quoteAmount`\\n /// @param decimals Number of decimals of the corresponding Chainlink pair\\n /// @return The `quoteAmount` converted in out-currency\\n function readChainlinkFeed(\\n uint256 _quoteAmount,\\n AggregatorV3Interface feed,\\n uint8 multiplied,\\n uint256 decimals,\\n uint32 stalePeriod\\n )\\n internal\\n view\\n returns (uint256)\\n {\\n (, int256 ratio,, uint256 updatedAt,) = feed.latestRoundData();\\n if (ratio <= 0 || block.timestamp - updatedAt > stalePeriod) revert InvalidChainlinkRate();\\n // Checking whether we should multiply or divide by the ratio computed\\n if (multiplied == 1) return (_quoteAmount * uint256(ratio)) / (10 ** decimals);\\n else return (_quoteAmount * (10 ** decimals)) / uint256(ratio);\\n }\\n\\n /// @notice Parses an `oracleConfig` into several sub fields\\n function _parseOracleConfig(bytes memory oracleConfig)\\n private\\n pure\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return abi.decode(oracleConfig, (OracleReadType, OracleReadType, bytes, bytes, bytes));\\n }\\n\\n function updateOracle(address collateral) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n if (ts.collaterals[collateral].decimals == 0) revert NotCollateral();\\n\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(ts.collaterals[collateral].oracleConfig);\\n\\n if (targetType != OracleReadType.MAX) revert OracleUpdateFailed();\\n uint256 oracleValue = read(oracleType, BASE_18, oracleData);\\n\\n uint256 maxValue = abi.decode(targetData, (uint256));\\n if (oracleValue > maxValue) {\\n ts.collaterals[collateral].oracleConfig = abi.encode(\\n oracleType,\\n targetType,\\n oracleData,\\n // There are no checks whether the value increased or not\\n abi.encode(oracleValue),\\n hyperparameters\\n );\\n } else {\\n revert OracleUpdateFailed();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x24f504bdd0b7346a447d646a2b2b19afe1a71ee829a59e5cb2ac5fac320611d7\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibSetters.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { SafeCast } from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport { IERC20Metadata } from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\nimport { LibManager } from \\\"./LibManager.sol\\\";\\nimport { LibOracle } from \\\"./LibOracle.sol\\\";\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\nimport { LibDiamond } from \\\"./LibDiamond.sol\\\";\\nimport { LibWhitelist } from \\\"./LibWhitelist.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibSetters\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibSetters` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibSetters.sol\\nlibrary LibSetters {\\n using SafeCast for uint256;\\n\\n event CollateralAdded(address indexed collateral);\\n event CollateralManagerSet(address indexed collateral, ManagerStorage managerData);\\n event CollateralRevoked(address indexed collateral);\\n event CollateralWhitelistStatusUpdated(address indexed collateral, bytes whitelistData, uint8 whitelistStatus);\\n event FeesSet(address indexed collateral, uint64[] xFee, int64[] yFee, bool mint);\\n event OracleSet(address indexed collateral, bytes oracleConfig);\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n event PauseToggled(address indexed collateral, uint256 pausedType, bool isPaused);\\n event RedemptionCurveParamsSet(uint64[] xFee, int64[] yFee);\\n event ReservesAdjusted(address indexed collateral, uint256 amount, bool increase);\\n event StablecoinCapSet(address indexed collateral, uint256 stablecoinCap);\\n event TrustedToggled(address indexed sender, bool isTrusted, TrustedType trustedType);\\n event WhitelistStatusToggled(WhitelistType whitelistType, address indexed who, uint256 whitelistStatus);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ONLY GOVERNOR ACTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of `setAccessManager`\\n function setAccessManager(IAccessManager _newAccessManager) internal {\\n if (address(_newAccessManager).code.length == 0) revert InvalidAccessManager();\\n DiamondStorage storage ds = s.diamondStorage();\\n address previousAccessManager = address(ds.accessManager);\\n ds.accessManager = _newAccessManager;\\n emit OwnershipTransferred(previousAccessManager, address(_newAccessManager));\\n }\\n\\n /// @notice Internal version of `setCollateralManager`\\n function setCollateralManager(\\n address collateral,\\n bool checkExternalManagerBalance,\\n ManagerStorage memory managerData\\n )\\n internal\\n {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n uint8 isManaged = collatInfo.isManaged;\\n if (isManaged > 0 && checkExternalManagerBalance) {\\n (, uint256 totalValue) = LibManager.totalAssets(collatInfo.managerData.config);\\n if (totalValue > 0) revert ManagerHasAssets();\\n }\\n if (managerData.config.length != 0) {\\n // The first subCollateral given should be the actual collateral asset\\n if (address(managerData.subCollaterals[0]) != collateral) revert InvalidParams();\\n // Sanity check on the manager data that is passed\\n LibManager.parseManagerConfig(managerData.config);\\n collatInfo.isManaged = 1;\\n } else {\\n collatInfo.isManaged = 0;\\n }\\n collatInfo.managerData = managerData;\\n emit CollateralManagerSet(collateral, managerData);\\n }\\n\\n /// @notice Internal version of `toggleTrusted`\\n function toggleTrusted(address sender, TrustedType t) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint256 trustedStatus;\\n if (t == TrustedType.Updater) {\\n trustedStatus = 1 - ts.isTrusted[sender];\\n ts.isTrusted[sender] = trustedStatus;\\n } else {\\n trustedStatus = 1 - ts.isSellerTrusted[sender];\\n ts.isSellerTrusted[sender] = trustedStatus;\\n }\\n emit TrustedToggled(sender, trustedStatus == 1, t);\\n }\\n\\n /// @notice Internal version of `addCollateral`\\n function addCollateral(address collateral) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals != 0) revert AlreadyAdded();\\n collatInfo.decimals = uint8(IERC20Metadata(collateral).decimals());\\n ts.collateralList.push(collateral);\\n emit CollateralAdded(collateral);\\n }\\n\\n /// @notice Internal version of `adjustStablecoins`\\n function adjustStablecoins(address collateral, uint128 amount, bool increase) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n uint128 normalizedAmount = ((amount * BASE_27) / ts.normalizer).toUint128();\\n if (increase) {\\n collatInfo.normalizedStables = collatInfo.normalizedStables + uint216(normalizedAmount);\\n ts.normalizedStables = ts.normalizedStables + normalizedAmount;\\n } else {\\n collatInfo.normalizedStables = collatInfo.normalizedStables - uint216(normalizedAmount);\\n ts.normalizedStables = ts.normalizedStables - normalizedAmount;\\n }\\n emit ReservesAdjusted(collateral, amount, increase);\\n }\\n\\n /// @notice Internal version of `revokeCollateral`\\n function revokeCollateral(address collateral, bool checkExternalManagerBalance) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n if (collatInfo.normalizedStables > 0) revert CollateralBacked();\\n uint8 isManaged = collatInfo.isManaged;\\n if (isManaged > 0 && checkExternalManagerBalance) {\\n (, uint256 totalValue) = LibManager.totalAssets(collatInfo.managerData.config);\\n if (totalValue > 0) revert ManagerHasAssets();\\n }\\n delete ts.collaterals[collateral];\\n address[] memory collateralListMem = ts.collateralList;\\n uint256 length = collateralListMem.length;\\n for (uint256 i; i < length - 1; ++i) {\\n if (collateralListMem[i] == collateral) {\\n ts.collateralList[i] = collateralListMem[length - 1];\\n break;\\n }\\n }\\n ts.collateralList.pop();\\n emit CollateralRevoked(collateral);\\n }\\n\\n /// @notice Internal version of `setOracle`\\n function setOracle(address collateral, bytes memory oracleConfig) internal {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n // Checks oracle validity\\n LibOracle.readMint(oracleConfig);\\n collatInfo.oracleConfig = oracleConfig;\\n emit OracleSet(collateral, oracleConfig);\\n }\\n\\n /// @notice Internal version of `setWhitelistStatus`\\n function setWhitelistStatus(address collateral, uint8 whitelistStatus, bytes memory whitelistData) internal {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n if (whitelistStatus == 1) {\\n // Sanity check\\n LibWhitelist.checkWhitelist(whitelistData, address(this));\\n collatInfo.whitelistData = whitelistData;\\n } else {\\n // If whitelist is revoked, clear the whitelist data\\n collatInfo.whitelistData = \\\"\\\";\\n }\\n collatInfo.onlyWhitelisted = whitelistStatus;\\n emit CollateralWhitelistStatusUpdated(collateral, collatInfo.whitelistData, whitelistStatus);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ONLY GUARDIAN ACTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of `togglePause`\\n function togglePause(address collateral, ActionType action) internal {\\n uint8 isLive;\\n if (action == ActionType.Mint || action == ActionType.Burn) {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n if (action == ActionType.Mint) {\\n isLive = 1 - collatInfo.isMintLive;\\n collatInfo.isMintLive = isLive;\\n } else {\\n isLive = 1 - collatInfo.isBurnLive;\\n collatInfo.isBurnLive = isLive;\\n }\\n } else {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n isLive = 1 - ts.isRedemptionLive;\\n ts.isRedemptionLive = isLive;\\n }\\n emit PauseToggled(collateral, uint256(action), isLive == 0);\\n }\\n\\n /// @notice Internal version of `setFees`\\n function setFees(address collateral, uint64[] memory xFee, int64[] memory yFee, bool mint) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n Collateral storage collatInfo = ts.collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n checkFees(xFee, yFee, mint ? ActionType.Mint : ActionType.Burn);\\n if (mint) {\\n collatInfo.xFeeMint = xFee;\\n collatInfo.yFeeMint = yFee;\\n } else {\\n collatInfo.xFeeBurn = xFee;\\n collatInfo.yFeeBurn = yFee;\\n }\\n emit FeesSet(collateral, xFee, yFee, mint);\\n }\\n\\n /// @notice Internal version of `setRedemptionCurveParams`\\n function setRedemptionCurveParams(uint64[] memory xFee, int64[] memory yFee) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n LibSetters.checkFees(xFee, yFee, ActionType.Redeem);\\n ts.xRedemptionCurve = xFee;\\n ts.yRedemptionCurve = yFee;\\n emit RedemptionCurveParamsSet(xFee, yFee);\\n }\\n\\n /// @notice Internal version of `toggleWhitelist`\\n function toggleWhitelist(WhitelistType whitelistType, address who) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint256 whitelistStatus = 1 - ts.isWhitelistedForType[whitelistType][who];\\n ts.isWhitelistedForType[whitelistType][who] = whitelistStatus;\\n emit WhitelistStatusToggled(whitelistType, who, whitelistStatus);\\n }\\n\\n /// @notice Sets the stablecoin cap that can be issued from a collateral\\n function setStablecoinCap(address collateral, uint256 stablecoinCap) internal {\\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\\n if (collatInfo.decimals == 0) revert NotCollateral();\\n collatInfo.stablecoinCap = stablecoinCap;\\n emit StablecoinCapSet(collateral, stablecoinCap);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Checks the fee values given for the `mint`, `burn`, and `redeem` functions\\n function checkFees(uint64[] memory xFee, int64[] memory yFee, ActionType action) internal view {\\n uint256 n = xFee.length;\\n if (n != yFee.length || n == 0) revert InvalidParams();\\n if (\\n // Mint inflexion points should be in [0,BASE_9[\\n // We have: amountPostFee * (BASE_9 + yFeeMint) = amountPreFee * BASE_9\\n // Hence we consider BASE_12 as the max value (100% fees) for yFeeMint\\n // Burn inflexion points should be in [0,BASE_9] but fees should be constant in\\n // the first segment [BASE_9, x_{n-1}[\\n // Redemption inflexion points should be in [0,BASE_9]\\n (action == ActionType.Mint && (xFee[n - 1] >= BASE_9 || xFee[0] != 0 || yFee[n - 1] > int256(BASE_12)))\\n || (\\n action == ActionType.Burn\\n && (xFee[0] != BASE_9 || yFee[n - 1] > int256(BASE_9) || (n > 1 && (yFee[0] != yFee[1])))\\n ) || (action == ActionType.Redeem && (xFee[n - 1] > BASE_9 || yFee[n - 1] < 0 || yFee[n - 1] > int256(BASE_9)))\\n ) {\\n revert InvalidParams();\\n }\\n\\n for (uint256 i; i < n - 1; ++i) {\\n if (\\n // xFee strictly increasing and yFee increasing for mints\\n // xFee strictly decreasing and yFee increasing for burns\\n // xFee strictly increasing and yFee should be in [0,BASE_9] for redemptions\\n (action == ActionType.Mint && (xFee[i] >= xFee[i + 1] || (yFee[i + 1] < yFee[i])))\\n || (action == ActionType.Burn && (xFee[i] <= xFee[i + 1] || (yFee[i + 1] < yFee[i])))\\n || (action == ActionType.Redeem && (xFee[i] >= xFee[i + 1] || yFee[i] < 0 || yFee[i] > int256(BASE_9)))\\n ) revert InvalidParams();\\n }\\n\\n // If a mint or burn fee is negative, we need to check that accounts atomically minting\\n // (from any collateral) and then burning cannot get more than their initial value\\n if (yFee[0] < 0) {\\n if (!LibDiamond.isGovernor(msg.sender)) revert NotGovernor(); // Only governor can set negative fees\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n address[] memory collateralListMem = ts.collateralList;\\n uint256 length = collateralListMem.length;\\n if (action == ActionType.Mint) {\\n // This can be mathematically expressed by `(1-min_c(burnFee_c))<=(1+mintFee[0])`\\n for (uint256 i; i < length; ++i) {\\n int64[] memory burnFees = ts.collaterals[collateralListMem[i]].yFeeBurn;\\n if (burnFees[0] + yFee[0] < 0) revert InvalidNegativeFees();\\n }\\n }\\n if (action == ActionType.Burn) {\\n // This can be mathematically expressed by `(1-burnFee[0])<=(1+min_c(mintFee_c))`\\n for (uint256 i; i < length; ++i) {\\n int64[] memory mintFees = ts.collaterals[collateralListMem[i]].yFeeMint;\\n if (yFee[0] + mintFees[0] < 0) revert InvalidNegativeFees();\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x82116bafaf14b59de009ab43fc4489a478cd78f150fa60a1f9f89c2b93173471\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibStorage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport { DiamondStorage, ImplementationStorage, ParallelizerStorage } from \\\"../Storage.sol\\\";\\n\\n/// @title LibStorage\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibStorage` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibStorage.sol\\nlibrary LibStorage {\\n /// @notice Returns the storage struct stored at the `DIAMOND_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic of the different facets used in the diamond proxy\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ds.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `TRANSMUTER_STORAGE_POSITION` slot\\n /// @dev This struct handles the particular logic of the Parallelizer system\\n function transmuterStorage() internal pure returns (ParallelizerStorage storage ts) {\\n bytes32 position = TRANSMUTER_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ts.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `IMPLEMENTATION_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic for making the contract easily usable on Etherscan\\n function implementationStorage() internal pure returns (ImplementationStorage storage ims) {\\n bytes32 position = IMPLEMENTATION_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ims.slot := position\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf8c333898ca14d3e8696c232f669a839dddbf705a609a1b0795ecc6b8f1b2d73\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibWhitelist.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IKeyringGuard } from \\\"contracts/interfaces/external/keyring/IKeyringGuard.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibWhitelist\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibWhitelist` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibWhitelist.sol\\nlibrary LibWhitelist {\\n /// @notice Checks whether `sender` is whitelisted for a collateral with `whitelistData`\\n function checkWhitelist(bytes memory whitelistData, address sender) internal returns (bool) {\\n (WhitelistType whitelistType, bytes memory data) = abi.decode(whitelistData, (WhitelistType, bytes));\\n if (s.transmuterStorage().isWhitelistedForType[whitelistType][sender] > 0) return true;\\n if (data.length != 0) {\\n if (whitelistType == WhitelistType.BACKED) {\\n address keyringGuard = abi.decode(data, (address));\\n if (keyringGuard != address(0)) return IKeyringGuard(keyringGuard).isAuthorized(address(this), sender);\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x72595e0b49dfce76ba70d9f69af54ffbc84650c8c696caa20f858ef2438d94b5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ICbETH } from \\\"contracts/interfaces/external/coinbase/ICbETH.sol\\\";\\nimport { ISfrxETH } from \\\"contracts/interfaces/external/frax/ISfrxETH.sol\\\";\\nimport { IStETH } from \\\"contracts/interfaces/external/lido/IStETH.sol\\\";\\nimport { IRETH } from \\\"contracts/interfaces/external/rocketPool/IRETH.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STORAGE SLOTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n/// @dev Storage position of `DiamondStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.diamond.storage\\\") - 1`\\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\\n\\n/// @dev Storage position of `ParallelizerStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.parallelizer.storage\\\") - 1`\\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\\n\\n/// @dev Storage position of `ImplementationStorage` structure\\n/// @dev Equals `keccak256(\\\"eip1967.proxy.implementation\\\") - 1`\\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MATHS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nuint256 constant BASE_6 = 1e6;\\nuint256 constant BASE_8 = 1e8;\\nuint256 constant BASE_9 = 1e9;\\nuint256 constant BASE_12 = 1e12;\\nuint256 constant BPS = 1e14;\\nuint256 constant BASE_18 = 1e18;\\nuint256 constant HALF_BASE_27 = 1e27 / 2;\\nuint256 constant BASE_27 = 1e27;\\nuint256 constant BASE_36 = 1e36;\\nuint256 constant MAX_BURN_FEE = 999_000_000;\\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// The values being non-zero value makes deployment a bit more expensive,\\n// but in exchange the refund on every call to nonReentrant will be lower in\\n// amount. Since refunds are capped to a percentage of the total\\n// transaction's gas, it is best to keep them low in cases like this one, to\\n// increase the likelihood of the full refund coming into effect.\\nuint8 constant NOT_ENTERED = 1;\\nuint8 constant ENTERED = 2;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// Role IDs for the AccessManager\\nuint64 constant GOVERNOR_ROLE = 10;\\nuint64 constant GUARDIAN_ROLE = 20;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n COMMON ADDRESSES \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\\n\",\"keccak256\":\"0x3306bdd0d4e4f364e0d35893a7ffb59c8eb9e94a5bd861f58b8d7ba8a7b336e5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nerror AccessManagedUnauthorized(address caller);\\nerror AlreadyAdded();\\nerror CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);\\nerror CannotAddSelectorsToZeroAddress(bytes4[] _selectors);\\nerror CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);\\nerror CannotRemoveImmutableFunction(bytes4 _selector);\\nerror CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);\\nerror CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);\\nerror CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);\\nerror CannotReplaceImmutableFunction(bytes4 _selector);\\nerror ContractHasNoCode();\\nerror CollateralBacked();\\nerror FunctionNotFound(bytes4 _functionSelector);\\nerror IncorrectFacetCutAction(uint8 _action);\\nerror InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);\\nerror InvalidChainlinkRate();\\nerror InvalidLengths();\\nerror InvalidNegativeFees();\\nerror InvalidOracleType();\\nerror InvalidParam();\\nerror InvalidParams();\\nerror InvalidRate();\\nerror InvalidSwap();\\nerror InvalidTokens();\\nerror InvalidAccessManager();\\nerror ManagerHasAssets();\\nerror NoSelectorsProvidedForFacetForCut(address _facetAddress);\\nerror NotAllowed();\\nerror NotCollateral();\\nerror NotGovernor();\\nerror NotGuardian();\\nerror NotTrusted();\\nerror NotTrustedOrGuardian();\\nerror NotWhitelisted();\\nerror OdosSwapFailed();\\nerror OracleUpdateFailed();\\nerror Paused();\\nerror ReentrantCall();\\nerror RemoveFacetAddressMustBeZeroAddress(address _facetAddress);\\nerror TooBigAmountIn();\\nerror TooLate();\\nerror TooSmallAmountOut();\\nerror ZeroAddress();\\nerror ZeroAmount();\\nerror SwapError();\\nerror SlippageTooHigh();\\nerror InsufficientFunds();\\n\",\"keccak256\":\"0x1e2f6812ef78e948e5155d32213b52afff8c0ba5463d18bee10694efbf886130\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x60808060405234601557611f78908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f5f3560e01c80634eec47b914611245578063603b432714611184578063629feb6214610333578063a9e6a1a4146101275763b607d09914610051575f80fd5b3461012457604036600319011261012457600435600181101561012257602435906001600160a01b03821680920361011e5761008d3633611aa9565b1561010c5761009b81611e64565b825f5260205260405f2054600103600181116100f857816040916100df7f70d8c44c5d0ca6e337ab06f375d16c97b2dd59b50c9987f04c044fc167c329be94611e64565b855f5260205280835f205582519182526020820152a280f35b602484634e487b7160e01b81526011600452fd5b60248362d1953b60e31b815233600452fd5b8280fd5b505b80fd5b503461012457604036600319011261012457610141611a93565b60243590600382101561011e576101583633611aa9565b1561010c57811583818015610327575b1561028c576101a7836001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b9182549060ff8260181c161561027d5782610269571561024057508154916101d460ff8460081c16611e53565b9261ff008460081b169061ff0019161790555b61022c576001600160a01b037f3da495aea17ab24773f3161f4707961a797e39147ce4f8a8fbac0309a4a2d2e49260ff6040938451968752161560208601521692a280f35b602484634e487b7160e01b81526021600452fd5b9161025060ff8460101c16611e53565b9262ff00008460101b169062ff000019161790556101e7565b602487634e487b7160e01b81526021600452fd5b600487630dcfc57f60e21b8152fd5b90507f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7554906102c060ff8360a01c16611e53565b917fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff00000000000000000000000000000000000000008460a01b169116177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75556101e7565b50508360018414610168565b50346101245760803660031901126101245761034d611a93565b9060243567ffffffffffffffff81116101225761036e9036906004016119bc565b60443567ffffffffffffffff811161011e5761038e903690600401611a2b565b9060643591821515808403611180576103a73633611aa9565b1561116e576103e6866001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460181c161561115f5784156111575785915b8451978451891480159061114f575b611140576003841015928361112c5784159788806110b4575b801561100e575b858115610f55575b50610f46575f198b019a8b119a8a8c5b610f32578181101561061d5786610525578a806105b2575b8015610539575b878115610487575b50610478576001018c610443565b60048c635435b28960e11b8152fd5b905061052557600288148061049d575b8761046a565b5067ffffffffffffffff6104b1828c611f06565b511660018201808311610511576104d167ffffffffffffffff918d611f06565b5116118015906104fb575b806104975750633b9aca006104f1828b611f06565b5160070b13610497565b508b610507828b611f06565b5160070b126104dc565b60248e634e487b7160e01b81526011600452fd5b60248c634e487b7160e01b81526021600452fd5b508b9650600188148015610462575067ffffffffffffffff61055b828c611f06565b511660018201908183116105115767ffffffffffffffff61057c838e611f06565b5116109081159161058e575b50610462565b61059991508a611f06565b5160070b6105a7828b611f06565b5160070b135f610588565b5067ffffffffffffffff6105c6828c611f06565b511660018201908183116105115767ffffffffffffffff6105e7838e611f06565b511611908115916105f9575b5061045b565b61060491508a611f06565b5160070b610612828b611f06565b5160070b135f6105f3565b5050929790939195948961063087611ee5565b5160070b12610b45575b5050505f146108ee5760018101845167ffffffffffffffff81116108da576801000000000000000081116108da5761067781835481855584611d83565b60208601918852602088208160021c91895b83811061089457506003198116900380610839575b50505050600201815167ffffffffffffffff811161082557680100000000000000008111610825576106d581835481855584611d83565b60208301918752602087208160021c91885b8381106107df57506003198116900380610763575b50505050916001600160a01b03610747926107557f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad955b604051958695606087526060870190611de0565b908582036020870152611e1d565b95604084015216930390a280f35b928893895b8181106107a65750505001556001600160a01b03826107557f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad6106fc565b90919460206107d5600192885160070b908560031b67ffffffffffffffff809160031b9316831b921b19161790565b9601929101610768565b898a5b600481106107f75750838201556001016106e7565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b17920196016107e2565b602487634e487b7160e01b81526041600452fd5b9289938a5b818110610854575050500155600287808061069e565b909194602061088a60019267ffffffffffffffff895116908560031b67ffffffffffffffff809160031b9316831b921b19161790565b960192910161083e565b8a8b5b600481106108ac575083820155600101610689565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b1792019601610897565b602488634e487b7160e01b81526041600452fd5b60038101845167ffffffffffffffff81116108da576801000000000000000081116108da5761092281835481855584611d83565b60208601918852602088208160021c91895b838110610aff57506003198116900380610aa4575b50505050600401815167ffffffffffffffff8111610825576801000000000000000081116108255761098081835481855584611d83565b60208301918752602087208160021c91885b838110610a5e575060031981169003806109e2575b50505050916001600160a01b03610747926107557f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad95610733565b928893895b818110610a255750505001556001600160a01b03826107557f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad6109a7565b9091946020610a54600192885160070b908560031b67ffffffffffffffff809160031b9316831b921b19161790565b96019291016109e7565b898a5b60048110610a76575083820155600101610992565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b1792019601610a61565b9289938a5b818110610abf5750505001556004878080610949565b9091946020610af560019267ffffffffffffffff895116908560031b67ffffffffffffffff809160031b9316831b921b19161790565b9601929101610aa9565b8a8b5b60048110610b17575083820155600101610934565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b1792019601610b02565b604460406001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54168151928380926368fc2b7760e11b8252600a60048301523360248301525afa908115610f27578b91610ef7575b5015610ee857604051918a83809460207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77549182815201907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77845260208420935b818110610ec6575050610c1792500384611982565b825193610eb257610dbe575b600114610c31575b8061063a565b885b828110610c405750610c2b565b6002610c8f6001600160a01b03610c578486611f06565b51166001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b018a60405180602084549182815201938352602083209083915b816003840110610d795794610ce7928492610d0796975491818110610d65575b818110610d4e575b818110610d37575b10610d26575b500382611982565b610cfd610cf38a611ee5565b5160070b91611ee5565b5160070b90611f1a565b60070b12610d1757600101610c33565b60048a631133612160e01b8152fd5b60c01d60070b81526020015f610cdf565b9260206001918460801c60070b8152019301610cd9565b9260206001918460401c60070b8152019301610cd1565b9260206001918460070b8152019301610cc9565b93509091936001608060049286548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b60608201520194019201908e939492610ca9565b895b838110610dcd5750610c23565b8a6004610de56001600160a01b03610c578588611f06565b016040519081602082549182815201918452602084209084915b816003840110610e6d5793610e41938193610e3c93610e4e975491818110610d6557818110610d4e57818110610d375710610d2657500382611982565b611ee5565b5160070b610cfd8a611ee5565b60070b12610e5e57600101610dc0565b60048b631133612160e01b8152fd5b93945090916001608060049286548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b60608201520194019201908f949392610dff565b60248b634e487b7160e01b81526021600452fd5b84546001600160a01b0316835260019485019488945060209093019201610c02565b60048a633b8d9d7560e21b8152fd5b610f19915060403d604011610f20575b610f118183611982565b810190611ebb565b508b610ba1565b503d610f07565b6040513d8d823e3d90fd5b60248c634e487b7160e01b81526011600452fd5b60048a635435b28960e11b8152fd5b9050610ffa576002861480610f6b575b85610433565b505f198b018b81119081610f3257633b9aca0067ffffffffffffffff610f91838d611f06565b511611918215610fe0575b8215610faa575b5050610f65565b909150610fcc57610fc0633b9aca009189611f06565b5160070b135f80610fa3565b60248b634e487b7160e01b81526011600452fd5b508b915081610fef828b611f06565b5160070b1291610f9c565b60248a634e487b7160e01b81526021600452fd5b508994506001861480611021575b61042b565b50633b9aca0067ffffffffffffffff6110398a611ee5565b51161480159061108f575b8061042b575060018b11801561101c575061105e87611ee5565b5160070b87516001101561107b57604088015160070b141561042b565b60248b634e487b7160e01b81526032600452fd5b505f198b018b8111610fcc576110aa633b9aca009189611f06565b5160070b13611044565b505f198b018b8111610fcc57633b9aca0067ffffffffffffffff6110d8838c611f06565b5116109081159161110e575b81156110f1575b50610424565b64e8d4a5100091506111039089611f06565b5160070b135f6110eb565b905067ffffffffffffffff6111228a611ee5565b51161515906110e4565b602489634e487b7160e01b81526021600452fd5b600488635435b28960e11b8152fd5b50881561040b565b6001916103fc565b600486630dcfc57f60e21b8152fd5b60248562d1953b60e31b815233600452fd5b8480fd5b50346101245760403660031901126101245761119e611a93565b602435906111ac3633611aa9565b1561010c576111eb816001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460181c1615611236576001600160a01b037feb6fe4a9f159360e971932dac27da07532267236a5423eaa27ea9f1cc641354e9284600960209401556040519485521692a280f35b600484630dcfc57f60e21b8152fd5b3461197e57604036600319011261197e5760043567ffffffffffffffff811161197e576112769036906004016119bc565b60243567ffffffffffffffff811161197e57611296903690600401611a2b565b6112a03633611aa9565b1561196c5781519181518314801590611964575b611364575f5f198401848111806113a357633b9aca0067ffffffffffffffff6112dd8487611f06565b51161190811561194b575b811561192b575b5061136457938411935f91855b61191757818310156113cb57806113b757505f91600167ffffffffffffffff6113258387611f06565b51169082018083116113a35761134467ffffffffffffffff9187611f06565b51161180159061138d575b8015611373575b6113645760010191856112fc565b635435b28960e11b5f5260045ffd5b50633b9aca006113838287611f06565b5160070b13611356565b505f6113998287611f06565b5160070b1261134f565b634e487b7160e01b5f52601160045260245ffd5b80634e487b7160e01b602492526021600452fd5b848491806113d883611ee5565b5160070b126117de575b50815167ffffffffffffffff81116116d7576801000000000000000081116116d7577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7854817f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c785580821061178b575b5060208301907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c785f5260205f208160021c915f5b838110611745575060031981169003806116eb575b50505050805167ffffffffffffffff81116116d7576801000000000000000081116116d7577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7954817f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7955808210611662575b5060208201907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795f5260205f208160021c915f5b83811061161c575060031981169003806115a5575b7fdd1690e851f57f138700d42b0a081b3b1b9a97dd2cb2aabc25c9265873629064611592876115a088604051938493604085526040850190611de0565b908382036020850152611e1d565b0390a1005b925f935f5b8181106115e3575050500155816115a06115927fdd1690e851f57f138700d42b0a081b3b1b9a97dd2cb2aabc25c9265873629064611555565b9091946020611612600192885160070b908560031b67ffffffffffffffff809160031b9316831b921b19161790565b96019291016115aa565b5f5f5b60048110611634575083820155600101611540565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b179201960161161f565b6116b0907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795f5260205f20600380850160021c820192601886831b16806116b6575b500160021c0190611d6d565b8361150c565b6116d1905f198601908154905f199060200360031b1c169055565b886116a4565b634e487b7160e01b5f52604160045260245ffd5b925f935f5b8181106117055750505001558280808061149a565b909194602061173b60019267ffffffffffffffff895116908560031b67ffffffffffffffff809160031b9316831b921b19161790565b96019291016116f0565b5f5f5b6004811061175d575083820155600101611485565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b1792019601611748565b6117d8907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c785f5260205f20600380850160021c820192601886831b16806116b657500160021c0190611d6d565b83611451565b604460406001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54168151928380926368fc2b7760e11b8252600a60048301523360248301525afa90811561190c5782916118ec575b50156118dd57806040518060207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77549182815201907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7784526020842090845b8181106118bb5750505090806118b0920390611982565b6113b757505f6113e2565b82546001600160a01b0316845286955060209093019260019283019201611899565b80633b8d9d7560e21b60049252fd5b611905915060403d604011610f2057610f118183611982565b508461183a565b6040513d84823e3d90fd5b80634e487b7160e01b602492526011600452fd5b90506113a357633b9aca006119408286611f06565b5160070b13866112ef565b50505f5f6119598387611f06565b5160070b12906112e8565b5082156112b4565b62d1953b60e31b5f523360045260245ffd5b5f80fd5b90601f8019910116810190811067ffffffffffffffff8211176116d757604052565b67ffffffffffffffff81116116d75760051b60200190565b9080601f8301121561197e578135906119d4826119a4565b926119e26040519485611982565b82845260208085019360051b82010191821161197e57602001915b818310611a0a5750505090565b823567ffffffffffffffff8116810361197e578152602092830192016119fd565b9080601f8301121561197e57813590611a43826119a4565b92611a516040519485611982565b82845260208085019360051b82010191821161197e57602001915b818310611a795750505090565b82358060070b810361197e57815260209283019201611a6c565b600435906001600160a01b038216820361197e57565b6001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d5416918060041161197e575f5f905f80604051956001600160a01b0360208801917fb700961300000000000000000000000000000000000000000000000000000000835216968760248201523060448201527fffffffff00000000000000000000000000000000000000000000000000000000833516606482015260648152611b5c608482611982565b5190885afa3d15611d65573d9067ffffffffffffffff82116116d75760405191611b90601f8201601f191660200184611982565b82523d5f602084013e5b611d07575b5015611baf575b50505050600190565b63ffffffff1615611d005776010000000000000000000000000000000000000000000060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7555823b1561197e576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af18015611cf557611ce5575b5060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7554167f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75555f808080611ba6565b5f611cef91611982565b5f611c90565b6040513d5f823e3d90fd5b5050505f90565b805192909160408410611d2f575050602080611d27938301019101611ebb565b905b5f611b9f565b9190926020811015611d43575b5050611d29565b819250906020918101031261197e576020611d5e9101611eae565b5f80611d3c565b606090611b9a565b818110611d78575050565b5f8155600101611d6d565b9190808210611d9157505050565b611dbd925f52600360205f2091601882850160021c840194831b1680611dbf57500160021c0190611d6d565b565b611dda905f198601908154905f199060200360031b1c169055565b5f6116a4565b90602080835192838152019201905f5b818110611dfd5750505090565b825167ffffffffffffffff16845260209384019390920191600101611df0565b90602080835192838152019201905f5b818110611e3a5750505090565b825160070b845260209384019390920191600101611e2d565b60ff166001039060ff82116113a357565b6001811015611e9a575f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d60205260405f2090565b634e487b7160e01b5f52602160045260245ffd5b5190811515820361197e57565b919082604091031261197e576020611ed283611eae565b92015163ffffffff8116810361197e5790565b805115611ef25760200190565b634e487b7160e01b5f52603260045260245ffd5b8051821015611ef25760209160051b010190565b9060070b9060070b0190677fffffffffffffff198212677fffffffffffffff8313176113a35756fea2646970667358221220eb1ad0178a1038e8e76b2ab03dc69ef51aaae98c833362affd149bd71b93a27264736f6c634300081c0033", + "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f5f3560e01c80634eec47b914611245578063603b432714611184578063629feb6214610333578063a9e6a1a4146101275763b607d09914610051575f80fd5b3461012457604036600319011261012457600435600181101561012257602435906001600160a01b03821680920361011e5761008d3633611aa9565b1561010c5761009b81611e64565b825f5260205260405f2054600103600181116100f857816040916100df7f70d8c44c5d0ca6e337ab06f375d16c97b2dd59b50c9987f04c044fc167c329be94611e64565b855f5260205280835f205582519182526020820152a280f35b602484634e487b7160e01b81526011600452fd5b60248362d1953b60e31b815233600452fd5b8280fd5b505b80fd5b503461012457604036600319011261012457610141611a93565b60243590600382101561011e576101583633611aa9565b1561010c57811583818015610327575b1561028c576101a7836001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b9182549060ff8260181c161561027d5782610269571561024057508154916101d460ff8460081c16611e53565b9261ff008460081b169061ff0019161790555b61022c576001600160a01b037f3da495aea17ab24773f3161f4707961a797e39147ce4f8a8fbac0309a4a2d2e49260ff6040938451968752161560208601521692a280f35b602484634e487b7160e01b81526021600452fd5b9161025060ff8460101c16611e53565b9262ff00008460101b169062ff000019161790556101e7565b602487634e487b7160e01b81526021600452fd5b600487630dcfc57f60e21b8152fd5b90507f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7554906102c060ff8360a01c16611e53565b917fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff00000000000000000000000000000000000000008460a01b169116177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75556101e7565b50508360018414610168565b50346101245760803660031901126101245761034d611a93565b9060243567ffffffffffffffff81116101225761036e9036906004016119bc565b60443567ffffffffffffffff811161011e5761038e903690600401611a2b565b9060643591821515808403611180576103a73633611aa9565b1561116e576103e6866001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460181c161561115f5784156111575785915b8451978451891480159061114f575b611140576003841015928361112c5784159788806110b4575b801561100e575b858115610f55575b50610f46575f198b019a8b119a8a8c5b610f32578181101561061d5786610525578a806105b2575b8015610539575b878115610487575b50610478576001018c610443565b60048c635435b28960e11b8152fd5b905061052557600288148061049d575b8761046a565b5067ffffffffffffffff6104b1828c611f06565b511660018201808311610511576104d167ffffffffffffffff918d611f06565b5116118015906104fb575b806104975750633b9aca006104f1828b611f06565b5160070b13610497565b508b610507828b611f06565b5160070b126104dc565b60248e634e487b7160e01b81526011600452fd5b60248c634e487b7160e01b81526021600452fd5b508b9650600188148015610462575067ffffffffffffffff61055b828c611f06565b511660018201908183116105115767ffffffffffffffff61057c838e611f06565b5116109081159161058e575b50610462565b61059991508a611f06565b5160070b6105a7828b611f06565b5160070b135f610588565b5067ffffffffffffffff6105c6828c611f06565b511660018201908183116105115767ffffffffffffffff6105e7838e611f06565b511611908115916105f9575b5061045b565b61060491508a611f06565b5160070b610612828b611f06565b5160070b135f6105f3565b5050929790939195948961063087611ee5565b5160070b12610b45575b5050505f146108ee5760018101845167ffffffffffffffff81116108da576801000000000000000081116108da5761067781835481855584611d83565b60208601918852602088208160021c91895b83811061089457506003198116900380610839575b50505050600201815167ffffffffffffffff811161082557680100000000000000008111610825576106d581835481855584611d83565b60208301918752602087208160021c91885b8381106107df57506003198116900380610763575b50505050916001600160a01b03610747926107557f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad955b604051958695606087526060870190611de0565b908582036020870152611e1d565b95604084015216930390a280f35b928893895b8181106107a65750505001556001600160a01b03826107557f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad6106fc565b90919460206107d5600192885160070b908560031b67ffffffffffffffff809160031b9316831b921b19161790565b9601929101610768565b898a5b600481106107f75750838201556001016106e7565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b17920196016107e2565b602487634e487b7160e01b81526041600452fd5b9289938a5b818110610854575050500155600287808061069e565b909194602061088a60019267ffffffffffffffff895116908560031b67ffffffffffffffff809160031b9316831b921b19161790565b960192910161083e565b8a8b5b600481106108ac575083820155600101610689565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b1792019601610897565b602488634e487b7160e01b81526041600452fd5b60038101845167ffffffffffffffff81116108da576801000000000000000081116108da5761092281835481855584611d83565b60208601918852602088208160021c91895b838110610aff57506003198116900380610aa4575b50505050600401815167ffffffffffffffff8111610825576801000000000000000081116108255761098081835481855584611d83565b60208301918752602087208160021c91885b838110610a5e575060031981169003806109e2575b50505050916001600160a01b03610747926107557f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad95610733565b928893895b818110610a255750505001556001600160a01b03826107557f8abfb482e6f6ae87066f0006f10aff1738f4182d4f66b7a084685e4a6c51cfad6109a7565b9091946020610a54600192885160070b908560031b67ffffffffffffffff809160031b9316831b921b19161790565b96019291016109e7565b898a5b60048110610a76575083820155600101610992565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b1792019601610a61565b9289938a5b818110610abf5750505001556004878080610949565b9091946020610af560019267ffffffffffffffff895116908560031b67ffffffffffffffff809160031b9316831b921b19161790565b9601929101610aa9565b8a8b5b60048110610b17575083820155600101610934565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b1792019601610b02565b604460406001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54168151928380926368fc2b7760e11b8252600a60048301523360248301525afa908115610f27578b91610ef7575b5015610ee857604051918a83809460207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77549182815201907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77845260208420935b818110610ec6575050610c1792500384611982565b825193610eb257610dbe575b600114610c31575b8061063a565b885b828110610c405750610c2b565b6002610c8f6001600160a01b03610c578486611f06565b51166001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b018a60405180602084549182815201938352602083209083915b816003840110610d795794610ce7928492610d0796975491818110610d65575b818110610d4e575b818110610d37575b10610d26575b500382611982565b610cfd610cf38a611ee5565b5160070b91611ee5565b5160070b90611f1a565b60070b12610d1757600101610c33565b60048a631133612160e01b8152fd5b60c01d60070b81526020015f610cdf565b9260206001918460801c60070b8152019301610cd9565b9260206001918460401c60070b8152019301610cd1565b9260206001918460070b8152019301610cc9565b93509091936001608060049286548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b60608201520194019201908e939492610ca9565b895b838110610dcd5750610c23565b8a6004610de56001600160a01b03610c578588611f06565b016040519081602082549182815201918452602084209084915b816003840110610e6d5793610e41938193610e3c93610e4e975491818110610d6557818110610d4e57818110610d375710610d2657500382611982565b611ee5565b5160070b610cfd8a611ee5565b60070b12610e5e57600101610dc0565b60048b631133612160e01b8152fd5b93945090916001608060049286548060070b82528060401c60070b602083015280831c60070b604083015260c01d60070b60608201520194019201908f949392610dff565b60248b634e487b7160e01b81526021600452fd5b84546001600160a01b0316835260019485019488945060209093019201610c02565b60048a633b8d9d7560e21b8152fd5b610f19915060403d604011610f20575b610f118183611982565b810190611ebb565b508b610ba1565b503d610f07565b6040513d8d823e3d90fd5b60248c634e487b7160e01b81526011600452fd5b60048a635435b28960e11b8152fd5b9050610ffa576002861480610f6b575b85610433565b505f198b018b81119081610f3257633b9aca0067ffffffffffffffff610f91838d611f06565b511611918215610fe0575b8215610faa575b5050610f65565b909150610fcc57610fc0633b9aca009189611f06565b5160070b135f80610fa3565b60248b634e487b7160e01b81526011600452fd5b508b915081610fef828b611f06565b5160070b1291610f9c565b60248a634e487b7160e01b81526021600452fd5b508994506001861480611021575b61042b565b50633b9aca0067ffffffffffffffff6110398a611ee5565b51161480159061108f575b8061042b575060018b11801561101c575061105e87611ee5565b5160070b87516001101561107b57604088015160070b141561042b565b60248b634e487b7160e01b81526032600452fd5b505f198b018b8111610fcc576110aa633b9aca009189611f06565b5160070b13611044565b505f198b018b8111610fcc57633b9aca0067ffffffffffffffff6110d8838c611f06565b5116109081159161110e575b81156110f1575b50610424565b64e8d4a5100091506111039089611f06565b5160070b135f6110eb565b905067ffffffffffffffff6111228a611ee5565b51161515906110e4565b602489634e487b7160e01b81526021600452fd5b600488635435b28960e11b8152fd5b50881561040b565b6001916103fc565b600486630dcfc57f60e21b8152fd5b60248562d1953b60e31b815233600452fd5b8480fd5b50346101245760403660031901126101245761119e611a93565b602435906111ac3633611aa9565b1561010c576111eb816001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460181c1615611236576001600160a01b037feb6fe4a9f159360e971932dac27da07532267236a5423eaa27ea9f1cc641354e9284600960209401556040519485521692a280f35b600484630dcfc57f60e21b8152fd5b3461197e57604036600319011261197e5760043567ffffffffffffffff811161197e576112769036906004016119bc565b60243567ffffffffffffffff811161197e57611296903690600401611a2b565b6112a03633611aa9565b1561196c5781519181518314801590611964575b611364575f5f198401848111806113a357633b9aca0067ffffffffffffffff6112dd8487611f06565b51161190811561194b575b811561192b575b5061136457938411935f91855b61191757818310156113cb57806113b757505f91600167ffffffffffffffff6113258387611f06565b51169082018083116113a35761134467ffffffffffffffff9187611f06565b51161180159061138d575b8015611373575b6113645760010191856112fc565b635435b28960e11b5f5260045ffd5b50633b9aca006113838287611f06565b5160070b13611356565b505f6113998287611f06565b5160070b1261134f565b634e487b7160e01b5f52601160045260245ffd5b80634e487b7160e01b602492526021600452fd5b848491806113d883611ee5565b5160070b126117de575b50815167ffffffffffffffff81116116d7576801000000000000000081116116d7577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7854817f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c785580821061178b575b5060208301907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c785f5260205f208160021c915f5b838110611745575060031981169003806116eb575b50505050805167ffffffffffffffff81116116d7576801000000000000000081116116d7577f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7954817f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7955808210611662575b5060208201907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795f5260205f208160021c915f5b83811061161c575060031981169003806115a5575b7fdd1690e851f57f138700d42b0a081b3b1b9a97dd2cb2aabc25c9265873629064611592876115a088604051938493604085526040850190611de0565b908382036020850152611e1d565b0390a1005b925f935f5b8181106115e3575050500155816115a06115927fdd1690e851f57f138700d42b0a081b3b1b9a97dd2cb2aabc25c9265873629064611555565b9091946020611612600192885160070b908560031b67ffffffffffffffff809160031b9316831b921b19161790565b96019291016115aa565b5f5f5b60048110611634575083820155600101611540565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b179201960161161f565b6116b0907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c795f5260205f20600380850160021c820192601886831b16806116b6575b500160021c0190611d6d565b8361150c565b6116d1905f198601908154905f199060200360031b1c169055565b886116a4565b634e487b7160e01b5f52604160045260245ffd5b925f935f5b8181106117055750505001558280808061149a565b909194602061173b60019267ffffffffffffffff895116908560031b67ffffffffffffffff809160031b9316831b921b19161790565b96019291016116f0565b5f5f5b6004811061175d575083820155600101611485565b865190969160019160209167ffffffffffffffff60068b901b81811b199092169216901b1792019601611748565b6117d8907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c785f5260205f20600380850160021c820192601886831b16806116b657500160021c0190611d6d565b83611451565b604460406001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d54168151928380926368fc2b7760e11b8252600a60048301523360248301525afa90811561190c5782916118ec575b50156118dd57806040518060207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c77549182815201907f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7784526020842090845b8181106118bb5750505090806118b0920390611982565b6113b757505f6113e2565b82546001600160a01b0316845286955060209093019260019283019201611899565b80633b8d9d7560e21b60049252fd5b611905915060403d604011610f2057610f118183611982565b508461183a565b6040513d84823e3d90fd5b80634e487b7160e01b602492526011600452fd5b90506113a357633b9aca006119408286611f06565b5160070b13866112ef565b50505f5f6119598387611f06565b5160070b12906112e8565b5082156112b4565b62d1953b60e31b5f523360045260245ffd5b5f80fd5b90601f8019910116810190811067ffffffffffffffff8211176116d757604052565b67ffffffffffffffff81116116d75760051b60200190565b9080601f8301121561197e578135906119d4826119a4565b926119e26040519485611982565b82845260208085019360051b82010191821161197e57602001915b818310611a0a5750505090565b823567ffffffffffffffff8116810361197e578152602092830192016119fd565b9080601f8301121561197e57813590611a43826119a4565b92611a516040519485611982565b82845260208085019360051b82010191821161197e57602001915b818310611a795750505090565b82358060070b810361197e57815260209283019201611a6c565b600435906001600160a01b038216820361197e57565b6001600160a01b037fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d5416918060041161197e575f5f905f80604051956001600160a01b0360208801917fb700961300000000000000000000000000000000000000000000000000000000835216968760248201523060448201527fffffffff00000000000000000000000000000000000000000000000000000000833516606482015260648152611b5c608482611982565b5190885afa3d15611d65573d9067ffffffffffffffff82116116d75760405191611b90601f8201601f191660200184611982565b82523d5f602084013e5b611d07575b5015611baf575b50505050600190565b63ffffffff1615611d005776010000000000000000000000000000000000000000000060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c755416177f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7555823b1561197e576064925f92836040519586809581947f94c7d7ee0000000000000000000000000000000000000000000000000000000083526004830152604060248301528060448301528084848401378181018301849052601f01601f191681010301925af18015611cf557611ce5575b5060ff60b01b197f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7554167f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75555f808080611ba6565b5f611cef91611982565b5f611c90565b6040513d5f823e3d90fd5b5050505f90565b805192909160408410611d2f575050602080611d27938301019101611ebb565b905b5f611b9f565b9190926020811015611d43575b5050611d29565b819250906020918101031261197e576020611d5e9101611eae565b5f80611d3c565b606090611b9a565b818110611d78575050565b5f8155600101611d6d565b9190808210611d9157505050565b611dbd925f52600360205f2091601882850160021c840194831b1680611dbf57500160021c0190611d6d565b565b611dda905f198601908154905f199060200360031b1c169055565b5f6116a4565b90602080835192838152019201905f5b818110611dfd5750505090565b825167ffffffffffffffff16845260209384019390920191600101611df0565b90602080835192838152019201905f5b818110611e3a5750505090565b825160070b845260209384019390920191600101611e2d565b60ff166001039060ff82116113a357565b6001811015611e9a575f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d60205260405f2090565b634e487b7160e01b5f52602160045260245ffd5b5190811515820361197e57565b919082604091031261197e576020611ed283611eae565b92015163ffffffff8116810361197e5790565b805115611ef25760200190565b634e487b7160e01b5f52603260045260245ffd5b8051821015611ef25760209160051b010190565b9060070b9060070b0190677fffffffffffffff198212677fffffffffffffff8313176113a35756fea2646970667358221220eb1ad0178a1038e8e76b2ab03dc69ef51aaae98c833362affd149bd71b93a27264736f6c634300081c0033", + "devdoc": { + "author": "Cooper Labs", + "custom:contact": "security@cooperlabs.xyz", + "details": "This contract is an authorized fork of Angle's `SettersGuardian` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/SettersGuardian.sol", + "kind": "dev", + "methods": {}, + "title": "SettersGuardian", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "setFees(address,uint64[],int64[],bool)": { + "notice": "Sets the mint or burn fees for `collateral`" + }, + "setRedemptionCurveParams(uint64[],int64[])": { + "notice": "Sets the parameters for the redemption curve" + }, + "setStablecoinCap(address,uint256)": { + "notice": "Sets the stablecoin cap that can be issued from a `collateral`" + }, + "togglePause(address,uint8)": { + "notice": "Changes the pause status for mint or burn transactions for `collateral`" + }, + "toggleWhitelist(uint8,address)": { + "notice": "Changes the whitelist status for a collateral with `whitelistType` for an address `who`" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/Swapper.json b/deployments/sepolia/Swapper.json new file mode 100644 index 0000000..f299f0f --- /dev/null +++ b/deployments/sepolia/Swapper.json @@ -0,0 +1,507 @@ +{ + "address": "0x1bB46FC55E3fd91Ca0F162DCC0B3ef574C8ff97E", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidChainlinkRate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSwap", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokens", + "type": "error" + }, + { + "inputs": [], + "name": "NotWhitelisted", + "type": "error" + }, + { + "inputs": [], + "name": "Paused", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrantCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "TooBigAmountIn", + "type": "error" + }, + { + "inputs": [], + "name": "TooLate", + "type": "error" + }, + { + "inputs": [], + "name": "TooSmallAmountOut", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "Swap", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + } + ], + "name": "quoteIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + } + ], + "name": "quoteOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactInput", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "permitData", + "type": "bytes" + } + ], + "name": "swapExactInputWithPermit", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactOutput", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "permitData", + "type": "bytes" + } + ], + "name": "swapExactOutputWithPermit", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x3789231d31ad167a6c3399b205440124ae2568cc6ffb416ee8b86da03ba9d5ef", + "receipt": { + "to": null, + "from": "0x66CcEC236bbcE5f1bBd1b2fC0a4014e57A55ad02", + "contractAddress": "0x1bB46FC55E3fd91Ca0F162DCC0B3ef574C8ff97E", + "transactionIndex": 104, + "gasUsed": "4917358", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xd00083810e39d87d3c7e9434b37694d96c7cc5da0e039f765a74823c4142ea01", + "transactionHash": "0x3789231d31ad167a6c3399b205440124ae2568cc6ffb416ee8b86da03ba9d5ef", + "logs": [], + "blockNumber": 8411100, + "cumulativeGasUsed": "20431885", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9d44d918681c9ad36f866ebee034a3d1", + "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidChainlinkRate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSwap\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWhitelisted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Paused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooBigAmountIn\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooLate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooSmallAmountOut\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"Swap\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"}],\"name\":\"quoteIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"}],\"name\":\"quoteOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactInput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"permitData\",\"type\":\"bytes\"}],\"name\":\"swapExactInputWithPermit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactOutput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"permitData\",\"type\":\"bytes\"}],\"name\":\"swapExactOutputWithPermit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Cooper Labs\",\"custom:contact\":\"security@cooperlabs.xyz\",\"details\":\"In all the functions of this contract, one of `tokenIn` or `tokenOut` must be the stablecoin, and one of `tokenOut` or `tokenIn` must be an accepted collateral. Depending on the `tokenIn` or `tokenOut` given, the functions will either handle a mint or a burn operationIn case of a burn, they will also revert if the system does not have enough of `amountOut` for `tokenOut`. This balance must be available either directly on the contract or, when applicable, through the underlying strategies that manage the collateralFunctions here may be paused for some collateral assets (for either mint or burn), in which case they'll revertIn case of a burn again, the swap functions will revert if the call concerns a collateral that requires a whitelist but the `to` address does not have it. The quote functions will not revert in this case.Calling one of the swap functions in a burn case does not require any prior token approvalThis contract is an authorized fork of Angle's `Swapper` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/transmuter/facets/Swapper.sol\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"FailedCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"InsufficientBalance(uint256,uint256)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC-20 token failed.\"}]},\"kind\":\"dev\",\"methods\":{\"swapExactInput(uint256,uint256,address,address,address,uint256)\":{\"details\":\"`msg.sender` must have approved this contract for at least `amountIn` for `tokenIn` for mint transactions\",\"params\":{\"amountIn\":\"Amount of `tokenIn` to bring\",\"amountOutMin\":\"Minimum amount of `tokenOut` to get: if `amountOut` is inferior to this amount, the function will revert\",\"deadline\":\"Timestamp before which the transaction must be executed\",\"to\":\"Address to which `tokenOut` must be sent\",\"tokenIn\":\"Token to bring for the swap\",\"tokenOut\":\"Token to get out of the swap\"},\"returns\":{\"amountOut\":\"Amount of `tokenOut` obtained through the swap\"}},\"swapExactInputWithPermit(uint256,uint256,address,address,uint256,bytes)\":{\"details\":\"Can only be used to mint, hence `tokenOut` is not needed\"},\"swapExactOutput(uint256,uint256,address,address,address,uint256)\":{\"details\":\"`msg.sender` must have approved this contract for an amount bigger than what `amountIn` will be before calling this function for a mint. Approving the contract for `tokenIn` with `amountInMax` will always be enough in this case\",\"params\":{\"amountInMax\":\"Maximum amount of `tokenIn` to bring in order to get `amountOut` of `tokenOut`\",\"amountOut\":\"Amount of `tokenOut` to obtain from the swap\",\"deadline\":\"Timestamp before which the transaction must be executed\",\"to\":\"Address to which `tokenOut` must be sent\",\"tokenIn\":\"Token to bring for the swap\",\"tokenOut\":\"Token to get out of the swap\"},\"returns\":{\"amountIn\":\"Amount of `tokenIn` used to perform the swap\"}},\"swapExactOutputWithPermit(uint256,uint256,address,address,uint256,bytes)\":{\"details\":\"Can only be used to mint, hence `tokenOut` is not needed\"}},\"title\":\"Swapper\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"quoteIn(uint256,address,address)\":{\"notice\":\"Simulates what a call to `swapExactInput` with `amountIn` of `tokenIn` for `tokenOut` would give. If called right before and at the same block, the `amountOut` outputted by this function is exactly the amount that will be obtained with `swapExactInput`\"},\"quoteOut(uint256,address,address)\":{\"notice\":\"Simulates what a call to `swapExactOutput` for `amountOut` of `tokenOut` with `tokenIn` would give. If called right before and at the same block, the `amountIn` outputted by this function is exactly the amount that will be obtained with `swapExactOutput`\"},\"swapExactInput(uint256,uint256,address,address,address,uint256)\":{\"notice\":\"Swaps (that is to say mints or burns) an exact amount of `tokenIn` for an amount of `tokenOut`\"},\"swapExactInputWithPermit(uint256,uint256,address,address,uint256,bytes)\":{\"notice\":\"Same as `swapExactInput`, but using Permit2 signatures for `tokenIn`\"},\"swapExactOutput(uint256,uint256,address,address,address,uint256)\":{\"notice\":\"Swaps (that is to say mints or burns) an amount of `tokenIn` for an exact amount of `tokenOut`\"},\"swapExactOutputWithPermit(uint256,uint256,address,address,uint256,bytes)\":{\"notice\":\"Same as `swapExactOutput`, but using Permit2 signatures for `tokenIn`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/parallelizer/facets/Swapper.sol\":\"Swapper\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAuthority} from \\\"./IAuthority.sol\\\";\\n\\nlibrary AuthorityUtils {\\n /**\\n * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\\n * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\\n * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\\n */\\n function canCallWithDelay(\\n address authority,\\n address caller,\\n address target,\\n bytes4 selector\\n ) internal view returns (bool immediate, uint32 delay) {\\n (bool success, bytes memory data) = authority.staticcall(\\n abi.encodeCall(IAuthority.canCall, (caller, target, selector))\\n );\\n if (success) {\\n if (data.length >= 0x40) {\\n (immediate, delay) = abi.decode(data, (bool, uint32));\\n } else if (data.length >= 0x20) {\\n immediate = abi.decode(data, (bool));\\n }\\n }\\n return (immediate, delay);\\n }\\n}\\n\",\"keccak256\":\"0xb3875997b0d8705e29aa20fee88e1dfef93df438794ae1ad8ba2eb016a4dd4e4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAccessManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\ninterface IAccessManager {\\n /**\\n * @dev A delayed operation was scheduled.\\n */\\n event OperationScheduled(\\n bytes32 indexed operationId,\\n uint32 indexed nonce,\\n uint48 schedule,\\n address caller,\\n address target,\\n bytes data\\n );\\n\\n /**\\n * @dev A scheduled operation was executed.\\n */\\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev A scheduled operation was canceled.\\n */\\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\\n\\n /**\\n * @dev Informational labelling for a roleId.\\n */\\n event RoleLabel(uint64 indexed roleId, string label);\\n\\n /**\\n * @dev Emitted when `account` is granted `roleId`.\\n *\\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\\n * otherwise it indicates the execution delay for this account and roleId is updated.\\n */\\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\\n\\n /**\\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\\n */\\n event RoleRevoked(uint64 indexed roleId, address indexed account);\\n\\n /**\\n * @dev Role acting as admin over a given `roleId` is updated.\\n */\\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\\n\\n /**\\n * @dev Role acting as guardian over a given `roleId` is updated.\\n */\\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\\n\\n /**\\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\\n */\\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\\n\\n /**\\n * @dev Target mode is updated (true = closed, false = open).\\n */\\n event TargetClosed(address indexed target, bool closed);\\n\\n /**\\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\\n */\\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\\n\\n /**\\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\\n */\\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\\n\\n error AccessManagerAlreadyScheduled(bytes32 operationId);\\n error AccessManagerNotScheduled(bytes32 operationId);\\n error AccessManagerNotReady(bytes32 operationId);\\n error AccessManagerExpired(bytes32 operationId);\\n error AccessManagerLockedRole(uint64 roleId);\\n error AccessManagerBadConfirmation();\\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\\n error AccessManagerUnauthorizedConsume(address target);\\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\\n\\n /**\\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\\n * & {execute} workflow.\\n *\\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\\n * for future execution.\\n *\\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\\n * the operation can be executed if and only if delay is greater than 0.\\n *\\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\\n *\\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\\n * {AccessManager} documentation.\\n */\\n function canCall(\\n address caller,\\n address target,\\n bytes4 selector\\n ) external view returns (bool allowed, uint32 delay);\\n\\n /**\\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\\n *\\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\\n * disabling any scheduling usage.\\n */\\n function expiration() external view returns (uint32);\\n\\n /**\\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\\n * can be increased without setback (and reset via {revokeRole} in the case event of an\\n * accidental increase). Defaults to 5 days.\\n */\\n function minSetback() external view returns (uint32);\\n\\n /**\\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\\n *\\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\\n */\\n function isTargetClosed(address target) external view returns (bool);\\n\\n /**\\n * @dev Get the role required to call a function.\\n */\\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\\n\\n /**\\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\\n */\\n function getTargetAdminDelay(address target) external view returns (uint32);\\n\\n /**\\n * @dev Get the id of the role that acts as an admin for the given role.\\n *\\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\\n * an operation that is restricted to this role.\\n */\\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role that acts as a guardian for a given role.\\n *\\n * The guardian permission allows canceling operations that have been scheduled under the role.\\n */\\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\\n\\n /**\\n * @dev Get the role current grant delay.\\n *\\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\\n */\\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\\n\\n /**\\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\\n * level.\\n *\\n * Returns:\\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\\n * [1] Current execution delay for the account.\\n * [2] Pending execution delay for the account.\\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\\n */\\n function getAccess(\\n uint64 roleId,\\n address account\\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\\n\\n /**\\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\\n * permission might be associated with an execution delay. {getAccess} can provide more details.\\n */\\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\\n\\n /**\\n * @dev Give a label to a role, for improved role discoverability by UIs.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleLabel} event.\\n */\\n function labelRole(uint64 roleId, string calldata label) external;\\n\\n /**\\n * @dev Add `account` to `roleId`, or change its execution delay.\\n *\\n * This gives the account the authorization to call any function that is restricted to this role. An optional\\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\\n *\\n * If the account has already been granted this role, the execution delay will be updated. This update is not\\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - granted role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleGranted} event.\\n */\\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\\n\\n /**\\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\\n * no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be an admin for the role (see {getRoleAdmin})\\n * - revoked role must not be the `PUBLIC_ROLE`\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function revokeRole(uint64 roleId, address account) external;\\n\\n /**\\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\\n * the role this call has no effect.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * Emits a {RoleRevoked} event if the account had the role.\\n */\\n function renounceRole(uint64 roleId, address callerConfirmation) external;\\n\\n /**\\n * @dev Change admin role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleAdminChanged} event\\n */\\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\\n\\n /**\\n * @dev Change guardian role for a given role.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGuardianChanged} event\\n */\\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\\n\\n /**\\n * @dev Update the delay for granting a `roleId`.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {RoleGrantDelayChanged} event.\\n */\\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetFunctionRoleUpdated} event per selector.\\n */\\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\\n\\n /**\\n * @dev Set the delay for changing the configuration of a given target contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetAdminDelayUpdated} event.\\n */\\n function setTargetAdminDelay(address target, uint32 newDelay) external;\\n\\n /**\\n * @dev Set the closed flag for a contract.\\n *\\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n *\\n * Emits a {TargetClosed} event.\\n */\\n function setTargetClosed(address target, bool closed) external;\\n\\n /**\\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\\n * operation is not yet scheduled, has expired, was executed, or was canceled.\\n */\\n function getSchedule(bytes32 id) external view returns (uint48);\\n\\n /**\\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\\n * been scheduled.\\n */\\n function getNonce(bytes32 id) external view returns (uint32);\\n\\n /**\\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\\n * required for the caller. The special value zero will automatically set the earliest possible time.\\n *\\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\\n *\\n * Emits a {OperationScheduled} event.\\n *\\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\\n * contract if it is using standard Solidity ABI encoding.\\n */\\n function schedule(\\n address target,\\n bytes calldata data,\\n uint48 when\\n ) external returns (bytes32 operationId, uint32 nonce);\\n\\n /**\\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\\n * execution delay is 0.\\n *\\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\\n *\\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\\n */\\n function execute(address target, bytes calldata data) external payable returns (uint32);\\n\\n /**\\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\\n * operation that is cancelled.\\n *\\n * Requirements:\\n *\\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\\n *\\n * Emits a {OperationCanceled} event.\\n */\\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\\n\\n /**\\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\\n *\\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\\n * with all the verifications that it implies.\\n *\\n * Emit a {OperationExecuted} event.\\n */\\n function consumeScheduledOp(address caller, bytes calldata data) external;\\n\\n /**\\n * @dev Hashing function for delayed operations.\\n */\\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\\n\\n /**\\n * @dev Changes the authority of a target managed by this manager instance.\\n *\\n * Requirements:\\n *\\n * - the caller must be a global admin\\n */\\n function updateAuthority(address target, address newAuthority) external;\\n}\\n\",\"keccak256\":\"0x9be2d08a326515805bc9cf6315b7953f8d1ebe88abf48c2d645fb1fa8211a0e2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/manager/IAuthority.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard interface for permissioning originally defined in Dappsys.\\n */\\ninterface IAuthority {\\n /**\\n * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\\n */\\n function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\\n}\\n\",\"keccak256\":\"0x4cc0766bd7fb7b3bafb70afa2a93b6e313a0baec7a35ad1b57505be7861c1030\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1363.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"./IERC20.sol\\\";\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @title IERC1363\\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\\n *\\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\\n */\\ninterface IERC1363 is IERC20, IERC165 {\\n /*\\n * Note: the ERC-165 identifier for this interface is 0xb0202a11.\\n * 0xb0202a11 ===\\n * bytes4(keccak256('transferAndCall(address,uint256)')) ^\\n * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\\n * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\\n * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\\n * bytes4(keccak256('approveAndCall(address,uint256)')) ^\\n * bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\\n */\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferAndCall(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @param data Additional data with no specified format, sent in call to `to`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param from The address which you want to send tokens from.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\\n * @param from The address which you want to send tokens from.\\n * @param to The address which you want to transfer to.\\n * @param value The amount of tokens to be transferred.\\n * @param data Additional data with no specified format, sent in call to `to`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to be spent.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function approveAndCall(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\\n * @param spender The address which will spend the funds.\\n * @param value The amount of tokens to be spent.\\n * @param data Additional data with no specified format, sent in call to `spender`.\\n * @return A boolean value indicating whether the operation succeeded unless throwing.\\n */\\n function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9b6b3e7803bc5f2f8cd7ad57db8ac1def61a9930a5a3107df4882e028a9605d7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\n\",\"keccak256\":\"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC1363} from \\\"../../../interfaces/IERC1363.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n /**\\n * @dev An operation with an ERC-20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n *\\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n *\\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \\\"client\\\"\\n * smart contract uses ERC-7674 to set temporary allowances, then the \\\"client\\\" smart contract should avoid using\\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n *\\n * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\\n * only sets the \\\"standard\\\" allowance. Any temporary allowance will remain active, in addition to the value being\\n * set here.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n if (to.code.length == 0) {\\n safeTransfer(token, to, value);\\n } else if (!token.transferAndCall(to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\\n * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function transferFromAndCallRelaxed(\\n IERC1363 token,\\n address from,\\n address to,\\n uint256 value,\\n bytes memory data\\n ) internal {\\n if (to.code.length == 0) {\\n safeTransferFrom(token, from, to, value);\\n } else if (!token.transferFromAndCall(from, to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\\n * targeting contracts.\\n *\\n * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\\n * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\\n * once without retrying, and relies on the returned value to be true.\\n *\\n * Reverts if the returned value is other than `true`.\\n */\\n function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\\n if (to.code.length == 0) {\\n forceApprove(token, to, value);\\n } else if (!token.approveAndCall(to, value, data)) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n uint256 returnSize;\\n uint256 returnValue;\\n assembly (\\\"memory-safe\\\") {\\n let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n // bubble errors\\n if iszero(success) {\\n let ptr := mload(0x40)\\n returndatacopy(ptr, 0, returndatasize())\\n revert(ptr, returndatasize())\\n }\\n returnSize := returndatasize()\\n returnValue := mload(0)\\n }\\n\\n if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n bool success;\\n uint256 returnSize;\\n uint256 returnValue;\\n assembly (\\\"memory-safe\\\") {\\n success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n returnSize := returndatasize()\\n returnValue := mload(0)\\n }\\n return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\\n }\\n}\\n\",\"keccak256\":\"0x4ea01544758fd2c7045961904686bfe232d2220a04ecaa2d6b08dac17827febf\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.2.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n\\n (bool success, bytes memory returndata) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n _revert(returndata);\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {Errors.FailedCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\\n * of an unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {Errors.FailedCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert Errors.FailedCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaaa1d17c1129b127a4a401db2fbd72960e2671474be3d08cae71ccdc42f7624c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedCall();\\n\\n /**\\n * @dev The deployment failed.\\n */\\n error FailedDeployment();\\n\\n /**\\n * @dev A necessary precompile is missing.\\n */\\n error MissingPrecompile(address);\\n}\\n\",\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/interfaces/IManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IManager` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IManager.sol\\ninterface IManager {\\n /// @notice Returns the amount of collateral managed by the Manager\\n /// @return balances Balances of all the subCollaterals handled by the manager\\n /// @dev MUST NOT revert\\n function totalAssets() external view returns (uint256[] memory balances, uint256 totalValue);\\n\\n /// @notice Hook to invest `amount` of `collateral`\\n /// @dev MUST revert if the manager cannot accept these funds\\n /// @dev MUST have received the funds beforehand\\n function invest(uint256 amount) external;\\n\\n /// @notice Sends `amount` of `collateral` to the `to` address\\n /// @dev Called when `tokenP` are burnt and during redemptions\\n // @dev MUST revert if there are not funds enough available\\n /// @dev MUST be callable only by the parallelizer\\n function release(address asset, address to, uint256 amount) external;\\n\\n /// @notice Gives the maximum amount of collateral immediately available for a transfer\\n /// @dev Useful for integrators using `quoteIn` and `quoteOut`\\n function maxAvailable() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8507172834f0243643fcf366bff6bae8f20523d102f5896f2140946975458e2c\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IParallelizerOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title IParallelizerOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `IParallelizerOracle` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IParallelizerOracle.sol\\ninterface IParallelizerOracle {\\n /// @notice Reads the oracle value for asset to use in a redemption to compute the collateral ratio\\n function readRedemption() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a mint. It should be comprehensive of the\\n /// deviation from the target price\\n function readMint() external view returns (uint256);\\n\\n /// @notice Reads the oracle value for asset to use in a burn transaction as well as the ratio\\n /// between the current price and the target price for the asset\\n function readBurn() external view returns (uint256 oracleValue, uint256 ratio);\\n\\n /// @notice Reads the oracle value for asset\\n function read() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb7287bfcade62fa4dfb07ea1cd6c1fc8be1525320f3faca44d8d9a6a01e99110\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/ISwapper.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\n/// @title ISwapper\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This interface is an authorized fork of Angle's `ISwapper` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/ISwapper.sol\\ninterface ISwapper {\\n /// @notice Swaps (that is to say mints or burns) an exact amount of `tokenIn` for an amount of `tokenOut`\\n /// @param amountIn Amount of `tokenIn` to bring\\n /// @param amountOutMin Minimum amount of `tokenOut` to get: if `amountOut` is inferior to this amount, the\\n /// function will revert\\n /// @param tokenIn Token to bring for the swap\\n /// @param tokenOut Token to get out of the swap\\n /// @param to Address to which `tokenOut` must be sent\\n /// @param deadline Timestamp before which the transaction must be executed\\n /// @return amountOut Amount of `tokenOut` obtained through the swap\\n function swapExactInput(\\n uint256 amountIn,\\n uint256 amountOutMin,\\n address tokenIn,\\n address tokenOut,\\n address to,\\n uint256 deadline\\n )\\n external\\n returns (uint256 amountOut);\\n\\n /// @notice Same as `swapExactInput`, but using Permit2 signatures for `tokenIn`\\n /// @dev Can only be used to mint, hence `tokenOut` is not needed\\n function swapExactInputWithPermit(\\n uint256 amountIn,\\n uint256 amountOutMin,\\n address tokenIn,\\n address to,\\n uint256 deadline,\\n bytes calldata permitData\\n )\\n external\\n returns (uint256 amountOut);\\n\\n /// @notice Swaps (that is to say mints or burns) an amount of `tokenIn` for an exact amount of `tokenOut`\\n /// @param amountOut Amount of `tokenOut` to obtain from the swap\\n /// @param amountInMax Maximum amount of `tokenIn` to bring in order to get `amountOut` of `tokenOut`\\n /// @param tokenIn Token to bring for the swap\\n /// @param tokenOut Token to get out of the swap\\n /// @param to Address to which `tokenOut` must be sent\\n /// @param deadline Timestamp before which the transaction must be executed\\n /// @return amountIn Amount of `tokenIn` used to perform the swap\\n function swapExactOutput(\\n uint256 amountOut,\\n uint256 amountInMax,\\n address tokenIn,\\n address tokenOut,\\n address to,\\n uint256 deadline\\n )\\n external\\n returns (uint256 amountIn);\\n\\n /// @notice Same as `swapExactOutput`, but using Permit2 signatures for `tokenIn`\\n /// @dev Can only be used to mint, hence `tokenOut` is not needed\\n function swapExactOutputWithPermit(\\n uint256 amountOut,\\n uint256 amountInMax,\\n address tokenIn,\\n address to,\\n uint256 deadline,\\n bytes calldata permitData\\n )\\n external\\n returns (uint256 amountIn);\\n\\n /// @notice Simulates what a call to `swapExactInput` with `amountIn` of `tokenIn` for `tokenOut` would give.\\n /// If called right before and at the same block, the `amountOut` outputted by this function is exactly the\\n /// amount that will be obtained with `swapExactInput`\\n function quoteIn(uint256 amountIn, address tokenIn, address tokenOut) external view returns (uint256 amountOut);\\n\\n /// @notice Simulates what a call to `swapExactOutput` for `amountOut` of `tokenOut` with `tokenIn` would give.\\n /// If called right before and at the same block, the `amountIn` outputted by this function is exactly the\\n /// amount that will be obtained with `swapExactOutput`\\n function quoteOut(uint256 amountOut, address tokenIn, address tokenOut) external view returns (uint256 amountIn);\\n}\\n\",\"keccak256\":\"0x47e4b2742a51b82b9df72fb681335affe8519f4114fb540cd29d8f48ed182ffd\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/ITokenP.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title ITokenP\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Interface for the stablecoins `tokenP` contracts\\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\\ninterface ITokenP is IERC20 {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MINTER ROLE ONLY FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Lets a whitelisted contract mint tokenPs\\n /// @param account Address to mint to\\n /// @param amount Amount to mint\\n function mint(address account, uint256 amount) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @param sender Address which requested the burn from `burner`\\n /// @dev This method is to be called by a contract with the minter right after being requested\\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\\n /// @dev The method checks the allowance between the `sender` and the `burner`\\n function burnFrom(uint256 amount, address burner, address sender) external;\\n\\n /// @notice Burns `amount` tokens from a `burner` address\\n /// @param amount Amount of tokens to burn\\n /// @param burner Address to burn from\\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\\n /// requested to do so by an address willing to burn tokens from its address\\n function burnSelf(uint256 amount, address burner) external;\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Amount of decimals of the stablecoin\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x64a1305faa8c5c91767a11af0eae16e4b463aa0bfe10f11b74aae9d96681a5eb\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\ninterface AggregatorV3Interface {\\n function decimals() external view returns (uint8);\\n\\n function description() external view returns (string memory);\\n\\n function version() external view returns (uint256);\\n\\n // getRoundData and latestRoundData should both raise \\\"No data present\\\"\\n // if they do not have data to report, instead of returning unset values\\n // which could be misinterpreted as actual reported values.\\n function getRoundData(uint80 _roundId)\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n\\n function latestRoundData()\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n}\\n\",\"keccak256\":\"0x94da577160ebb1bfeb7008676c8e7d43dda926d9c0beee29077e9ed774707373\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/coinbase/ICbETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ICbETH\\n/// @notice Interface for the `cbETH` contract\\ninterface ICbETH {\\n function exchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb159341cb0e25c478912b274cdda2d50fa84692aeac87b6823d281aaea2aed04\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/frax/ISfrxETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title ISfrxETH\\n/// @notice Interface for the `sfrxETH` contract\\ninterface ISfrxETH {\\n function pricePerShare() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x914cbea276f817c7db62bfca21e15bd8f7892faa9f39d86baaef574cf12b859f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/keyring/IKeyringGuard.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IKeyringGuard\\n/// @notice Interface for the `KeyringGuard` contract\\ninterface IKeyringGuard {\\n function isAuthorized(address from, address to) external returns (bool passed);\\n}\\n\",\"keccak256\":\"0x30bdab602ba0a6e2571372803ae35f7bebcc354d69408be627c04c57f7071f90\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/lido/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IStETH\\n/// @notice Interface for the `StETH` contract\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n\\n function submit(address) external payable returns (uint256);\\n\\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf21e3d8bdadc236b34bf2122b0e0b939d2d6bb6e2889b508636cbb7b84f59680\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/morpho/IMorphoOracle.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IMorphoOracle\\n/// @notice Interface for the oracle contracts used within Morpho\\ninterface IMorphoOracle {\\n function price() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x0d1849803b554763f1dce55eba5a6e8d7c5b12d4cc8dfe23637e827d2ee91d17\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/external/permit2/IPermit2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.5.0;\\n\\n/// @notice The token and amount details for a transfer signed in the permit transfer signature\\nstruct TokenPermissions {\\n // ERC20 token address\\n address token;\\n // the maximum amount that can be spent\\n uint256 amount;\\n}\\n\\n/// @notice The signed permit message for a single token transfer\\nstruct PermitTransferFrom {\\n TokenPermissions permitted;\\n // a unique value for every token owner's signature to prevent signature replays\\n uint256 nonce;\\n // deadline on the permit signature\\n uint256 deadline;\\n}\\n\\n/// @notice Specifies the recipient address and amount for batched transfers.\\n/// @dev Recipients and amounts correspond to the index of the signed token permissions array.\\n/// @dev Reverts if the requested amount is greater than the permitted signed amount.\\nstruct SignatureTransferDetails {\\n // recipient address\\n address to;\\n // spender requested amount\\n uint256 requestedAmount;\\n}\\n\\n/// @title SignatureTransfer\\n/// @notice Handles ERC20 token transfers through signature based actions\\n/// @dev Requires user's token approval on the Permit2 contract\\ninterface IPermit2 {\\n /// @notice Transfers a token using a signed permit message\\n /// @dev Reverts if the requested amount is greater than the permitted signed amount\\n /// @param permit The permit data signed over by the owner\\n /// @param owner The owner of the tokens to transfer\\n /// @param transferDetails The spender's requested transfer details for the permitted token\\n /// @param signature The signature to verify\\n function permitTransferFrom(\\n PermitTransferFrom memory permit,\\n SignatureTransferDetails calldata transferDetails,\\n address owner,\\n bytes calldata signature\\n )\\n external;\\n}\\n\",\"keccak256\":\"0x47665656f21c6e4998c747b4315b7196336bd529bdf1010ad06f3ba634242d1a\",\"license\":\"MIT\"},\"contracts/interfaces/external/rocketPool/IRETH.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0;\\n\\n/// @title IRETH\\n/// @notice Interface for the `rETH` contract\\ninterface IRETH {\\n function getExchangeRate() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x567a378e95d40160e297c1adb617ccaa69c03e49c4ad72a6ce651dd43cdbd5cd\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/Storage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ENUMS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nenum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n}\\n\\nenum ManagerType {\\n EXTERNAL\\n}\\n\\nenum ActionType {\\n Mint,\\n Burn,\\n Redeem\\n}\\n\\nenum TrustedType {\\n Updater,\\n Seller\\n}\\n\\nenum QuoteType {\\n MintExactInput,\\n MintExactOutput,\\n BurnExactInput,\\n BurnExactOutput\\n}\\n\\nenum OracleReadType {\\n CHAINLINK_FEEDS,\\n EXTERNAL,\\n NO_ORACLE,\\n STABLE,\\n WSTETH,\\n CBETH,\\n RETH,\\n SFRXETH,\\n MAX,\\n MORPHO_ORACLE\\n}\\n\\nenum OracleQuoteType {\\n UNIT,\\n TARGET\\n}\\n\\nenum WhitelistType {\\n BACKED\\n}\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STRUCTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nstruct Permit2Details {\\n address to; // Address that will receive the funds\\n uint256 nonce; // Nonce of the transaction\\n bytes signature; // Permit signature of the user\\n}\\n\\nstruct FacetCut {\\n address facetAddress; // Facet contract address\\n FacetCutAction action; // Can be add, remove or replace\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct Facet {\\n address facetAddress; // Facet contract address\\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\\\"transfer(address,uint256)\\\"))\\n}\\n\\nstruct FacetInfo {\\n address facetAddress; // Facet contract address\\n uint16 selectorPosition; // Position in the list of all selectors\\n}\\n\\nstruct DiamondStorage {\\n bytes4[] selectors; // List of all available selectors\\n mapping(bytes4 => FacetInfo) selectorInfo; // Selector to (address, position in list)\\n IAccessManager accessManager; // Contract handling access management\\n}\\n\\nstruct ImplementationStorage {\\n address implementation; // Dummy implementation address for Etherscan usability\\n}\\n\\nstruct ManagerStorage {\\n IERC20[] subCollaterals; // Subtokens handled by the manager or strategies\\n bytes config; // Additional configuration data\\n}\\n\\nstruct Collateral {\\n uint8 isManaged; // If the collateral is managed through external strategies\\n uint8 isMintLive; // If minting from this asset is unpaused\\n uint8 isBurnLive; // If burning to this asset is unpaused\\n uint8 decimals; // IERC20Metadata(collateral).decimals()\\n uint8 onlyWhitelisted; // If only whitelisted addresses can burn or redeem for this token\\n uint216 normalizedStables; // Normalized amount of stablecoins issued from this collateral\\n uint64[] xFeeMint; // Increasing exposures in [0,BASE_9[\\n int64[] yFeeMint; // Mint fees at the exposures specified in `xFeeMint`\\n uint64[] xFeeBurn; // Decreasing exposures in ]0,BASE_9]\\n int64[] yFeeBurn; // Burn fees at the exposures specified in `xFeeBurn`\\n bytes oracleConfig; // Data about the oracle used for the collateral\\n bytes whitelistData; // For whitelisted collateral, data used to verify whitelists\\n ManagerStorage managerData; // For managed collateral, data used to handle the strategies\\n uint256 stablecoinCap; // Cap on the amount of stablecoins that can be issued from this collateral\\n}\\n\\nstruct ParallelizerStorage {\\n ITokenP tokenP; // tokenP handled by the system\\n uint8 isRedemptionLive; // If redemption is unpaused\\n uint8 statusReentrant; // If call is reentrant or not\\n bool consumingSchedule; // If the contract is consuming a scheduled operation\\n uint128 normalizedStables; // Normalized amount of stablecoins issued by the system\\n uint128 normalizer; // To reconcile `normalizedStables` values with the actual amount\\n address[] collateralList; // List of collateral assets supported by the system\\n uint64[] xRedemptionCurve; // Increasing collateral ratios > 0\\n int64[] yRedemptionCurve; // Value of the redemption fees at `xRedemptionCurve`\\n mapping(address => Collateral) collaterals; // Maps a collateral asset to its parameters\\n mapping(address => uint256) isTrusted; // If an address is trusted to update the normalizer value\\n mapping(address => uint256) isSellerTrusted; // If an address is trusted to sell accruing reward tokens or to run\\n // keeper jobs on oracles\\n mapping(WhitelistType => mapping(address => uint256)) isWhitelistedForType;\\n}\\n// Whether an address is whitelisted for a specific whitelist type\\n\",\"keccak256\":\"0x3f4313dd110dbe390038320b2d3cf24dcbe9b75cd9573e7f048f7233c02dd227\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/AccessManagedModifiers.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { LibDiamond } from \\\"../libraries/LibDiamond.sol\\\";\\nimport { LibStorage as s, ParallelizerStorage } from \\\"../libraries/LibStorage.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\n\\n/// @title AccessManagedModifiers\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This contract is an authorized fork of Angle's `AccessControlModifiers` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/AccessControlModifiers.sol\\n/// update access logic to use OpenZeppelin's `AccessManaged` logic\\ncontract AccessManagedModifiers {\\n /// @notice Checks whether the `msg.sender` can call a function with a given selector\\n modifier restricted() {\\n if (!LibDiamond.checkCanCall(msg.sender, msg.data)) revert AccessManagedUnauthorized(msg.sender);\\n _;\\n }\\n\\n /// @notice Prevents a contract from calling itself, directly or indirectly\\n /// @dev This implementation is an adaptation of the OpenZepellin `ReentrancyGuard` for the purpose of this\\n /// Diamond Proxy system. The base implementation can be found here\\n /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol\\n modifier nonReentrant() {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n // Reentrant protection\\n // On the first call, `ts.statusReentrant` will be `NOT_ENTERED`\\n if (ts.statusReentrant == ENTERED) revert ReentrantCall();\\n // Any calls to the `nonReentrant` modifier after this point will fail\\n ts.statusReentrant = ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n ts.statusReentrant = NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0xa23f4434f86462af0594992bd826ba6af88f55201f2a7f79ce5fde05b5f10073\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/facets/Swapper.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport { SafeCast } from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\n\\nimport { ITokenP } from \\\"contracts/interfaces/ITokenP.sol\\\";\\nimport { ISwapper } from \\\"contracts/interfaces/ISwapper.sol\\\";\\nimport { IPermit2, PermitTransferFrom } from \\\"contracts/interfaces/external/permit2/IPermit2.sol\\\";\\nimport { SignatureTransferDetails, TokenPermissions } from \\\"contracts/interfaces/external/permit2/IPermit2.sol\\\";\\n\\nimport { AccessManagedModifiers } from \\\"./AccessManagedModifiers.sol\\\";\\nimport { LibHelpers } from \\\"../libraries/LibHelpers.sol\\\";\\nimport { LibManager } from \\\"../libraries/LibManager.sol\\\";\\nimport { LibOracle } from \\\"../libraries/LibOracle.sol\\\";\\nimport { LibStorage as s } from \\\"../libraries/LibStorage.sol\\\";\\nimport { LibWhitelist } from \\\"../libraries/LibWhitelist.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n// Struct to help storing local variables to avoid stack too deep issues\\nstruct LocalVariables {\\n bool isMint;\\n bool isExact;\\n uint256 lowerExposure;\\n uint256 upperExposure;\\n int256 lowerFees;\\n int256 upperFees;\\n uint256 amountToNextBreakPoint;\\n uint256 stablecoinsIssued;\\n uint256 otherStablecoinSupply;\\n}\\n\\n/// @title Swapper\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev In all the functions of this contract, one of `tokenIn` or `tokenOut` must be the stablecoin, and\\n/// one of `tokenOut` or `tokenIn` must be an accepted collateral. Depending on the `tokenIn` or `tokenOut` given,\\n/// the functions will either handle a mint or a burn operation\\n/// @dev In case of a burn, they will also revert if the system does not have enough of `amountOut` for `tokenOut`.\\n/// This balance must be available either directly on the contract or, when applicable, through the underlying\\n/// strategies that manage the collateral\\n/// @dev Functions here may be paused for some collateral assets (for either mint or burn), in which case they'll\\n/// revert\\n/// @dev In case of a burn again, the swap functions will revert if the call concerns a collateral that requires a\\n/// whitelist but the `to` address does not have it. The quote functions will not revert in this case.\\n/// @dev Calling one of the swap functions in a burn case does not require any prior token approval\\n/// @dev This contract is an authorized fork of Angle's `Swapper` contract\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/transmuter/facets/Swapper.sol\\ncontract Swapper is ISwapper, AccessManagedModifiers {\\n using SafeERC20 for IERC20;\\n using SafeCast for uint256;\\n using Address for address;\\n using Math for uint256;\\n\\n // The `to` address is not indexed as there cannot be 4 indexed addresses in an event.\\n event Swap(\\n address indexed tokenIn,\\n address indexed tokenOut,\\n uint256 amountIn,\\n uint256 amountOut,\\n address indexed from,\\n address to\\n );\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n EXTERNAL ACTION FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n // For the four functions below, a value of `0` for the `deadline` parameters means that there will be no timestamp\\n // check for when the swap is actually executed.\\n\\n /// @inheritdoc ISwapper\\n /// @dev `msg.sender` must have approved this contract for at least `amountIn` for `tokenIn` for mint transactions\\n function swapExactInput(\\n uint256 amountIn,\\n uint256 amountOutMin,\\n address tokenIn,\\n address tokenOut,\\n address to,\\n uint256 deadline\\n )\\n external\\n returns (uint256 amountOut)\\n {\\n (bool mint, Collateral storage collatInfo) = _getMintBurn(tokenIn, tokenOut, deadline);\\n amountOut =\\n mint ? _quoteMintExactInput(collatInfo, amountIn) : _quoteBurnExactInput(tokenOut, collatInfo, amountIn);\\n if (amountOut < amountOutMin) revert TooSmallAmountOut();\\n _swap(amountIn, amountOut, tokenIn, tokenOut, to, mint, collatInfo, \\\"\\\");\\n }\\n\\n /// @inheritdoc ISwapper\\n function swapExactInputWithPermit(\\n uint256 amountIn,\\n uint256 amountOutMin,\\n address tokenIn,\\n address to,\\n uint256 deadline,\\n bytes memory permitData\\n )\\n external\\n returns (uint256 amountOut)\\n {\\n (address tokenOut, Collateral storage collatInfo) = _getMint(tokenIn, deadline);\\n amountOut = _quoteMintExactInput(collatInfo, amountIn);\\n if (amountOut < amountOutMin) revert TooSmallAmountOut();\\n permitData = _buildPermitTransferPayload(amountIn, amountIn, tokenIn, deadline, permitData, collatInfo);\\n _swap(amountIn, amountOut, tokenIn, tokenOut, to, true, collatInfo, permitData);\\n }\\n\\n /// @inheritdoc ISwapper\\n /// @dev `msg.sender` must have approved this contract for an amount bigger than what `amountIn` will\\n /// be before calling this function for a mint. Approving the contract for `tokenIn` with `amountInMax`\\n /// will always be enough in this case\\n function swapExactOutput(\\n uint256 amountOut,\\n uint256 amountInMax,\\n address tokenIn,\\n address tokenOut,\\n address to,\\n uint256 deadline\\n )\\n external\\n returns (uint256 amountIn)\\n {\\n (bool mint, Collateral storage collatInfo) = _getMintBurn(tokenIn, tokenOut, deadline);\\n amountIn =\\n mint ? _quoteMintExactOutput(collatInfo, amountOut) : _quoteBurnExactOutput(tokenOut, collatInfo, amountOut);\\n if (amountIn > amountInMax) revert TooBigAmountIn();\\n _swap(amountIn, amountOut, tokenIn, tokenOut, to, mint, collatInfo, \\\"\\\");\\n }\\n\\n /// @inheritdoc ISwapper\\n function swapExactOutputWithPermit(\\n uint256 amountOut,\\n uint256 amountInMax,\\n address tokenIn,\\n address to,\\n uint256 deadline,\\n bytes memory permitData\\n )\\n public\\n returns (uint256 amountIn)\\n {\\n (address tokenOut, Collateral storage collatInfo) = _getMint(tokenIn, deadline);\\n amountIn = _quoteMintExactOutput(collatInfo, amountOut);\\n if (amountIn > amountInMax) revert TooBigAmountIn();\\n permitData = _buildPermitTransferPayload(amountIn, amountInMax, tokenIn, deadline, permitData, collatInfo);\\n _swap(amountIn, amountOut, tokenIn, tokenOut, to, true, collatInfo, permitData);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n VIEW HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n // If these functions return a 0 `amountOut` or `amountIn` value, then calling one of the swap functions above\\n // will not do anything.\\n\\n /// @inheritdoc ISwapper\\n function quoteIn(uint256 amountIn, address tokenIn, address tokenOut) external view returns (uint256 amountOut) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n (bool mint, Collateral storage collatInfo) = _getMintBurn(tokenIn, tokenOut, block.timestamp);\\n if (mint) {\\n amountOut = _quoteMintExactInput(collatInfo, amountIn);\\n _checkHardCaps(collatInfo, amountOut, ts.normalizer);\\n } else {\\n amountOut = _quoteBurnExactInput(tokenOut, collatInfo, amountIn);\\n _checkAmounts(tokenOut, collatInfo, amountOut);\\n }\\n }\\n\\n /// @inheritdoc ISwapper\\n function quoteOut(uint256 amountOut, address tokenIn, address tokenOut) external view returns (uint256 amountIn) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n (bool mint, Collateral storage collatInfo) = _getMintBurn(tokenIn, tokenOut, block.timestamp);\\n if (mint) {\\n _checkHardCaps(collatInfo, amountOut, ts.normalizer);\\n return _quoteMintExactOutput(collatInfo, amountOut);\\n } else {\\n _checkAmounts(tokenOut, collatInfo, amountOut);\\n return _quoteBurnExactOutput(tokenOut, collatInfo, amountOut);\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL ACTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Processes the internal metric updates and the transfers following mint or burn operations\\n function _swap(\\n uint256 amountIn,\\n uint256 amountOut,\\n address tokenIn,\\n address tokenOut,\\n address to,\\n bool mint,\\n Collateral storage collatInfo,\\n bytes memory permitData\\n )\\n internal\\n nonReentrant\\n {\\n if (amountIn > 0 && amountOut > 0) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n if (mint) {\\n uint128 changeAmount = (amountOut.mulDiv(BASE_27, ts.normalizer, Math.Rounding.Ceil)).toUint128();\\n // The amount of stablecoins issued from a collateral are not stored as absolute variables, but\\n // as variables normalized by a `normalizer`\\n collatInfo.normalizedStables = collatInfo.normalizedStables + uint216(changeAmount);\\n _checkHardCaps(collatInfo, 0, ts.normalizer);\\n ts.normalizedStables = ts.normalizedStables + changeAmount;\\n if (permitData.length > 0) {\\n PERMIT_2.functionCall(permitData);\\n } else if (collatInfo.isManaged > 0) {\\n IERC20(tokenIn).safeTransferFrom(\\n msg.sender, LibManager.transferRecipient(collatInfo.managerData.config), amountIn\\n );\\n } else {\\n IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), amountIn);\\n }\\n if (collatInfo.isManaged > 0) {\\n LibManager.invest(amountIn, collatInfo.managerData.config);\\n }\\n ITokenP(tokenOut).mint(to, amountOut);\\n } else {\\n if (collatInfo.onlyWhitelisted > 0 && !LibWhitelist.checkWhitelist(collatInfo.whitelistData, to)) {\\n revert NotWhitelisted();\\n }\\n uint128 changeAmount = ((amountIn * BASE_27) / ts.normalizer).toUint128();\\n // This will underflow when the system is trying to burn more stablecoins than what has been issued\\n // from this collateral\\n collatInfo.normalizedStables = collatInfo.normalizedStables - uint216(changeAmount);\\n ts.normalizedStables = ts.normalizedStables - changeAmount;\\n ITokenP(tokenIn).burnSelf(amountIn, msg.sender);\\n if (collatInfo.isManaged > 0) {\\n LibManager.release(tokenOut, to, amountOut, collatInfo.managerData.config);\\n } else {\\n IERC20(tokenOut).safeTransfer(to, amountOut);\\n }\\n }\\n emit Swap(tokenIn, tokenOut, amountIn, amountOut, msg.sender, to);\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL VIEW \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Computes the `amountOut` of stablecoins to mint from `tokenIn` of a collateral with data `collatInfo`\\n function _quoteMintExactInput(\\n Collateral storage collatInfo,\\n uint256 amountIn\\n )\\n internal\\n view\\n returns (uint256 amountOut)\\n {\\n uint256 oracleValue = LibOracle.readMint(collatInfo.oracleConfig);\\n amountOut = LibHelpers.convertDecimalTo(oracleValue * amountIn, 18 + collatInfo.decimals, 18);\\n amountOut = _quoteFees(collatInfo, QuoteType.MintExactInput, amountOut);\\n }\\n\\n /// @notice Computes the `amountIn` of collateral to get during a mint of `amountOut` of stablecoins\\n function _quoteMintExactOutput(\\n Collateral storage collatInfo,\\n uint256 amountOut\\n )\\n internal\\n view\\n returns (uint256 amountIn)\\n {\\n uint256 oracleValue = LibOracle.readMint(collatInfo.oracleConfig);\\n amountIn = _quoteFees(collatInfo, QuoteType.MintExactOutput, amountOut);\\n amountIn = LibHelpers.convertDecimalTo((amountIn * BASE_18) / oracleValue, 18, collatInfo.decimals);\\n }\\n\\n /// @notice Computes the `amountIn` of stablecoins to burn to release `amountOut` of `collateral`\\n function _quoteBurnExactOutput(\\n address collateral,\\n Collateral storage collatInfo,\\n uint256 amountOut\\n )\\n internal\\n view\\n returns (uint256 amountIn)\\n {\\n (uint256 ratio, uint256 oracleValue) = LibOracle.getBurnOracle(collateral, collatInfo.oracleConfig);\\n amountIn = Math.mulDiv(LibHelpers.convertDecimalTo(amountOut, collatInfo.decimals, 18), oracleValue, ratio);\\n amountIn = _quoteFees(collatInfo, QuoteType.BurnExactOutput, amountIn);\\n }\\n\\n /// @notice Computes the `amountOut` of `collateral` to give during a burn operation of `amountIn` of stablecoins\\n function _quoteBurnExactInput(\\n address collateral,\\n Collateral storage collatInfo,\\n uint256 amountIn\\n )\\n internal\\n view\\n returns (uint256 amountOut)\\n {\\n (uint256 ratio, uint256 oracleValue) = LibOracle.getBurnOracle(collateral, collatInfo.oracleConfig);\\n amountOut = _quoteFees(collatInfo, QuoteType.BurnExactInput, amountIn);\\n amountOut = LibHelpers.convertDecimalTo((amountOut * ratio) / oracleValue, 18, collatInfo.decimals);\\n }\\n\\n /// @notice Computes the fees to apply during a mint or burn operation\\n /// @dev This function leverages the mathematical computations of the appendix of the Parallelizer whitepaper\\n /// @dev Cost of the function is linear in the length of the `xFeeMint` or `xFeeBurn` array\\n function _quoteFees(\\n Collateral storage collatInfo,\\n QuoteType quoteType,\\n uint256 amountStable\\n )\\n internal\\n view\\n returns (uint256)\\n {\\n LocalVariables memory v;\\n v.isMint = _isMint(quoteType);\\n v.isExact = _isExact(quoteType);\\n uint256 n = v.isMint ? collatInfo.xFeeMint.length : collatInfo.xFeeBurn.length;\\n\\n uint256 currentExposure;\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n uint256 normalizedStablesMem = ts.normalizedStables;\\n // Handling the initialisation and constant fees\\n if (normalizedStablesMem == 0 || n == 1) {\\n return _computeFee(quoteType, amountStable, v.isMint ? collatInfo.yFeeMint[0] : collatInfo.yFeeBurn[0]);\\n }\\n // Increasing precision for `currentExposure` because otherwise if there is a factor 1e9 between total\\n // stablecoin supply and one specific collateral, exposure can be null\\n currentExposure = uint64((collatInfo.normalizedStables * BASE_18) / normalizedStablesMem);\\n\\n uint256 normalizerMem = ts.normalizer;\\n // Store the current amount of stablecoins issued from this collateral\\n v.stablecoinsIssued = (uint256(collatInfo.normalizedStables) * normalizerMem) / BASE_27;\\n v.otherStablecoinSupply = (normalizerMem * normalizedStablesMem) / BASE_27 - v.stablecoinsIssued;\\n }\\n\\n uint256 amount;\\n // Finding in which segment the current exposure to the collateral is\\n uint256 i = LibHelpers.findLowerBound(\\n v.isMint, v.isMint ? collatInfo.xFeeMint : collatInfo.xFeeBurn, uint64(BASE_9), uint64(currentExposure)\\n );\\n\\n while (i < n - 1) {\\n // We compute a linear by part function on the amount swapped\\n // The `amountToNextBreakPoint` variable is the `b_{i+1}` value from the whitepaper\\n if (v.isMint) {\\n v.lowerExposure = collatInfo.xFeeMint[i];\\n v.upperExposure = collatInfo.xFeeMint[i + 1];\\n v.lowerFees = collatInfo.yFeeMint[i];\\n v.upperFees = collatInfo.yFeeMint[i + 1];\\n v.amountToNextBreakPoint =\\n (v.otherStablecoinSupply * v.upperExposure) / (BASE_9 - v.upperExposure) - v.stablecoinsIssued;\\n } else {\\n // The exposures in the burn case are decreasing\\n v.lowerExposure = collatInfo.xFeeBurn[i];\\n v.upperExposure = collatInfo.xFeeBurn[i + 1];\\n v.lowerFees = collatInfo.yFeeBurn[i];\\n v.upperFees = collatInfo.yFeeBurn[i + 1];\\n // The `b_{i+1}` value in the burn case is the opposite value of the mint case\\n v.amountToNextBreakPoint =\\n v.stablecoinsIssued - (v.otherStablecoinSupply * v.upperExposure) / (BASE_9 - v.upperExposure);\\n }\\n // Computing the `g_i(0)` value from the whitepaper\\n int256 currentFees;\\n // We can only enter the else in the first iteration of the loop as otherwise we will\\n // always be at the beginning of the new segment\\n if (v.lowerExposure * BASE_9 == currentExposure) {\\n currentFees = v.lowerFees;\\n } else if (v.lowerFees == v.upperFees) {\\n currentFees = v.lowerFees;\\n } else {\\n // This is the opposite of the `b_i` value from the whitepaper.\\n uint256 amountFromPrevBreakPoint = v.isMint\\n ? v.stablecoinsIssued - (v.otherStablecoinSupply * v.lowerExposure) / (BASE_9 - v.lowerExposure)\\n : (v.otherStablecoinSupply * v.lowerExposure) / (BASE_9 - v.lowerExposure) - v.stablecoinsIssued;\\n\\n // slope = (upperFees - lowerFees) / (amountToNextBreakPoint + amountFromPrevBreakPoint)\\n // `currentFees` is the `g(0)` value from the whitepaper\\n currentFees = v.lowerFees\\n + int256(\\n (uint256(v.upperFees - v.lowerFees) * amountFromPrevBreakPoint)\\n / (v.amountToNextBreakPoint + amountFromPrevBreakPoint)\\n );\\n }\\n {\\n // In the mint case, when `!v.isExact`: = `b_{i+1} * (1+(g_i(0)+f_{i+1})/2)`\\n uint256 amountToNextBreakPointNormalizer = v.isExact\\n ? v.amountToNextBreakPoint\\n : v.isMint\\n ? _invertFeeMint(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2)\\n : _applyFeeBurn(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2);\\n\\n if (amountToNextBreakPointNormalizer >= amountStable) {\\n int64 midFee;\\n if (v.isExact) {\\n // `(g_i(0) + g_i(M)) / 2 = g(0) + (f_{i+1} - g(0)) * M / (2 * b_{i+1})`\\n midFee = int64(\\n currentFees\\n + int256(\\n amountStable.mulDiv(\\n uint256((v.upperFees - currentFees)), 2 * amountToNextBreakPointNormalizer, Math.Rounding.Ceil\\n )\\n )\\n );\\n } else {\\n // Here instead of computing the closed form expression for `m_t` derived in the whitepaper,\\n // we are computing: `(g(0)+g_i(m_t))/2 = g(0)+(f_{i+1}-f_i)/(b_{i+1}-b_i)m_t/2\\n\\n // ac4 is the value of `2M(f_{i+1}-f_i)/(b_{i+1}-b_i) = 2M(f_{i+1}-g(0))/b_{i+1}` used\\n // in the computation of `m_t` in both the mint and burn case\\n uint256 ac4 = BASE_9.mulDiv(\\n 2 * amountStable * uint256(v.upperFees - currentFees), v.amountToNextBreakPoint, Math.Rounding.Ceil\\n );\\n\\n if (v.isMint) {\\n // In the mint case:\\n // `m_t = (-1-g(0)+sqrt[(1+g(0))**2+2M(f_{i+1}-g(0))/b_{i+1}])/((f_{i+1}-g(0))/b_{i+1})`\\n // And so: g(0)+(f_{i+1}-f_i)/(b_{i+1}-b_i)m_t/2\\n // = (g(0)-1+sqrt[(1+g(0))**2+2M(f_{i+1}-g(0))/b_{i+1}]) / 2\\n midFee = int64(\\n (\\n int256(Math.sqrt((uint256(int256(BASE_9) + currentFees)) ** 2 + ac4, Math.Rounding.Ceil))\\n + currentFees - int256(BASE_9)\\n ) / 2\\n );\\n } else {\\n // In the burn case:\\n // `m_t = (1-g(0)+sqrt[(1-g(0))**2-2M(f_{i+1}-g(0))/b_{i+1}])/((f_{i+1}-g(0))/b_{i+1})`\\n // And so: g(0)+(f_{i+1}-f_i)/(b_{i+1}-b_i)m_t/2\\n // = (g(0)+1-sqrt[(1-g(0))**2-2M(f_{i+1}-g(0))/b_{i+1}]) / 2\\n\\n uint256 baseMinusCurrentSquared = (uint256(int256(BASE_9) - currentFees)) ** 2;\\n // Mathematically, this condition is always verified, but rounding errors may make this\\n // mathematical invariant break, in which case we consider that the square root is null\\n if (baseMinusCurrentSquared < ac4) {\\n midFee = int64((currentFees + int256(BASE_9)) / 2);\\n } else {\\n midFee = int64(\\n int256(\\n Math.mulDiv(\\n uint256(\\n currentFees + int256(BASE_9)\\n - int256(Math.sqrt(baseMinusCurrentSquared - ac4, Math.Rounding.Floor))\\n ),\\n 1,\\n 2,\\n Math.Rounding.Ceil\\n )\\n )\\n );\\n }\\n }\\n }\\n return amount + _computeFee(quoteType, amountStable, midFee);\\n } else {\\n amountStable -= amountToNextBreakPointNormalizer;\\n amount += !v.isExact\\n ? v.amountToNextBreakPoint\\n : v.isMint\\n ? _invertFeeMint(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2)\\n : _applyFeeBurn(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2);\\n currentExposure = v.upperExposure * BASE_9;\\n ++i;\\n // Update for the rest of the swaps the stablecoins issued from the asset\\n v.stablecoinsIssued =\\n v.isMint ? v.stablecoinsIssued + v.amountToNextBreakPoint : v.stablecoinsIssued - v.amountToNextBreakPoint;\\n }\\n }\\n }\\n // If `i == n-1`, we are in an area where fees are constant\\n return\\n amount + _computeFee(quoteType, amountStable, v.isMint ? collatInfo.yFeeMint[n - 1] : collatInfo.yFeeBurn[n - 1]);\\n }\\n\\n /// @notice Checks whether there is still enough of the collateral to process the transfer\\n function _checkAmounts(address collateral, Collateral storage collatInfo, uint256 amountOut) internal view {\\n if (\\n (collatInfo.isManaged > 0 && LibManager.maxAvailable(collatInfo.managerData.config) < amountOut)\\n || (collatInfo.isManaged == 0 && IERC20(collateral).balanceOf(address(this)) < amountOut)\\n ) revert InvalidSwap();\\n }\\n\\n /// @notice Checks whether there is enough space left to mint from this collateral\\n function _checkHardCaps(Collateral storage collatInfo, uint256 amount, uint256 normalizer) internal view {\\n if (amount + (collatInfo.normalizedStables * normalizer) / BASE_27 > collatInfo.stablecoinCap) {\\n revert InvalidSwap();\\n }\\n }\\n\\n /// @notice Checks whether a swap from `tokenIn` to `tokenOut` is a mint or a burn, whether the\\n /// collateral provided is paused or not and in case of whether the swap is not occuring too late\\n /// @dev The function reverts if the `tokenIn` and `tokenOut` given do not correspond to the stablecoin\\n /// and to an accepted collateral asset of the system\\n function _getMintBurn(\\n address tokenIn,\\n address tokenOut,\\n uint256 deadline\\n )\\n internal\\n view\\n returns (bool mint, Collateral storage collatInfo)\\n {\\n if (block.timestamp > deadline) revert TooLate();\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n address _tokenP = address(ts.tokenP);\\n if (tokenIn == _tokenP) {\\n collatInfo = ts.collaterals[tokenOut];\\n if (collatInfo.isBurnLive == 0) revert Paused();\\n mint = false;\\n } else if (tokenOut == _tokenP) {\\n collatInfo = ts.collaterals[tokenIn];\\n if (collatInfo.isMintLive == 0) revert Paused();\\n mint = true;\\n } else {\\n revert InvalidTokens();\\n }\\n }\\n\\n /// @notice Checks whether `tokenIn` is a valid unpaused collateral and the deadline\\n function _getMint(\\n address tokenIn,\\n uint256 deadline\\n )\\n internal\\n view\\n returns (address tokenOut, Collateral storage collatInfo)\\n {\\n if (block.timestamp > deadline) revert TooLate();\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n collatInfo = ts.collaterals[tokenIn];\\n if (collatInfo.isMintLive == 0) revert Paused();\\n tokenOut = address(ts.tokenP);\\n }\\n\\n /// @notice Builds a permit2 `permitTransferFrom` payload for a `tokenIn` transfer\\n /// @dev The transfer should be from `msg.sender` to this contract or a manager\\n function _buildPermitTransferPayload(\\n uint256 amountIn,\\n uint256 approvedAmount,\\n address tokenIn,\\n uint256 deadline,\\n bytes memory permitData,\\n Collateral storage collatInfo\\n )\\n internal\\n view\\n returns (bytes memory payload)\\n {\\n Permit2Details memory details;\\n if (collatInfo.isManaged > 0) details.to = LibManager.transferRecipient(collatInfo.managerData.config);\\n else details.to = address(this);\\n (details.nonce, details.signature) = abi.decode(permitData, (uint256, bytes));\\n payload = abi.encodeWithSelector(\\n IPermit2.permitTransferFrom.selector,\\n PermitTransferFrom({\\n permitted: TokenPermissions({ token: tokenIn, amount: approvedAmount }),\\n nonce: details.nonce,\\n deadline: deadline\\n }),\\n SignatureTransferDetails({ to: details.to, requestedAmount: amountIn }),\\n msg.sender,\\n details.signature\\n );\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL PURE \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Applies or inverts `fees` to an `amount` based on the type of operation\\n function _computeFee(QuoteType quoteType, uint256 amount, int64 fees) internal pure returns (uint256) {\\n return quoteType == QuoteType.MintExactInput\\n ? _applyFeeMint(amount, fees)\\n : quoteType == QuoteType.MintExactOutput\\n ? _invertFeeMint(amount, fees)\\n : quoteType == QuoteType.BurnExactInput ? _applyFeeBurn(amount, fees) : _invertFeeBurn(amount, fees);\\n }\\n\\n /// @notice Checks whether an operation is a mint operation or not\\n function _isMint(QuoteType quoteType) internal pure returns (bool) {\\n return quoteType == QuoteType.MintExactInput || quoteType == QuoteType.MintExactOutput;\\n }\\n\\n /// @notice Checks whether a swap involves an amount of stablecoins that is known in exact in advance or not\\n function _isExact(QuoteType quoteType) internal pure returns (bool) {\\n return quoteType == QuoteType.MintExactOutput || quoteType == QuoteType.BurnExactInput;\\n }\\n\\n /// @notice Applies `fees` to an `amountIn` of assets to get an `amountOut` of stablecoins\\n function _applyFeeMint(uint256 amountIn, int64 fees) internal pure returns (uint256 amountOut) {\\n if (fees >= 0) {\\n uint256 castedFees = uint256(int256(fees));\\n // Consider that if fees are above `BASE_12` this is equivalent to infinite fees\\n if (castedFees >= BASE_12) revert InvalidSwap();\\n amountOut = (amountIn * BASE_9) / (BASE_9 + castedFees);\\n } else {\\n amountOut = (amountIn * BASE_9) / (BASE_9 - uint256(int256(-fees)));\\n }\\n }\\n\\n /// @notice Gets from an `amountOut` of stablecoins and with `fees`, the `amountIn` of assets\\n /// that need to be brought during a mint\\n function _invertFeeMint(uint256 amountOut, int64 fees) internal pure returns (uint256 amountIn) {\\n if (fees >= 0) {\\n uint256 castedFees = uint256(int256(fees));\\n // Consider that if fees are above `BASE_12` this is equivalent to infinite fees\\n if (castedFees >= BASE_12) revert InvalidSwap();\\n amountIn = amountOut.mulDiv(BASE_9 + castedFees, BASE_9, Math.Rounding.Ceil);\\n } else {\\n amountIn = amountOut.mulDiv(BASE_9 - uint256(int256(-fees)), BASE_9, Math.Rounding.Ceil);\\n }\\n }\\n\\n /// @notice Applies `fees` to an `amountIn` of stablecoins to get an `amountOut` of assets\\n function _applyFeeBurn(uint256 amountIn, int64 fees) internal pure returns (uint256 amountOut) {\\n if (fees >= 0) {\\n uint256 castedFees = uint256(int256(fees));\\n if (castedFees >= MAX_BURN_FEE) revert InvalidSwap();\\n amountOut = ((BASE_9 - castedFees) * amountIn) / BASE_9;\\n } else {\\n amountOut = ((BASE_9 + uint256(int256(-fees))) * amountIn) / BASE_9;\\n }\\n }\\n\\n /// @notice Gets from an `amountOut` of assets and with `fees` the `amountIn` of stablecoins that need\\n /// to be brought during a burn\\n function _invertFeeBurn(uint256 amountOut, int64 fees) internal pure returns (uint256 amountIn) {\\n if (fees >= 0) {\\n uint256 castedFees = uint256(int256(fees));\\n if (castedFees >= MAX_BURN_FEE) revert InvalidSwap();\\n amountIn = amountOut.mulDiv(BASE_9, BASE_9 - castedFees, Math.Rounding.Ceil);\\n } else {\\n amountIn = amountOut.mulDiv(BASE_9, BASE_9 + uint256(int256(-fees)), Math.Rounding.Ceil);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x21a71b9fa13a90e490274c9400d2d097fa9b02631598f9c4e2ea648be7881457\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibDiamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\nimport { IAccessManager } from \\\"@openzeppelin/contracts/access/manager/IAccessManager.sol\\\";\\nimport { AuthorityUtils } from \\\"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibDiamond\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @notice Helper library to deal with diamond proxies.\\n/// @dev Reference: EIP-2535 Diamonds\\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/libraries/LibDiamond.sol by mudgen\\nlibrary LibDiamond {\\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n INTERNAL FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n function isGovernor(address caller) internal view returns (bool) {\\n (bool isMember,) = s.diamondStorage().accessManager.hasRole(GOVERNOR_ROLE, caller);\\n return isMember;\\n }\\n\\n /// @notice Checks whether `caller` can call `data` on `this`\\n function checkCanCall(address caller, bytes calldata data) internal returns (bool) {\\n IAccessManager accessManager = s.diamondStorage().accessManager;\\n (bool immediate, uint32 delay) =\\n AuthorityUtils.canCallWithDelay(address(accessManager), caller, address(this), bytes4(data[0:4]));\\n if (!immediate) {\\n if (delay > 0) {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n ts.consumingSchedule = true;\\n accessManager.consumeScheduledOp(caller, data);\\n ts.consumingSchedule = false;\\n } else {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @notice Internal function version of `diamondCut`\\n function diamondCut(FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {\\n uint256 diamondCutLength = _diamondCut.length;\\n for (uint256 facetIndex; facetIndex < diamondCutLength; facetIndex++) {\\n bytes4[] memory functionSelectors = _diamondCut[facetIndex].functionSelectors;\\n address facetAddress = _diamondCut[facetIndex].facetAddress;\\n\\n if (functionSelectors.length == 0) {\\n revert NoSelectorsProvidedForFacetForCut(facetAddress);\\n }\\n\\n FacetCutAction action = _diamondCut[facetIndex].action;\\n if (action == FacetCutAction.Add) {\\n _addFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Replace) {\\n _replaceFunctions(facetAddress, functionSelectors);\\n } else if (action == FacetCutAction.Remove) {\\n _removeFunctions(facetAddress, functionSelectors);\\n }\\n }\\n\\n emit DiamondCut(_diamondCut, _init, _calldata);\\n _initializeDiamondCut(_init, _calldata);\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n PRIVATE FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Does a delegate call on `_init` with `_calldata`\\n function _initializeDiamondCut(address _init, bytes memory _calldata) private {\\n if (_init == address(0)) {\\n return;\\n }\\n _enforceHasContractCode(_init);\\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n if (!success) {\\n if (error.length > 0) {\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(error)\\n revert(add(32, error), returndata_size)\\n }\\n } else {\\n revert InitializationFunctionReverted(_init, _calldata);\\n }\\n }\\n }\\n\\n /// @notice Adds a new function to the diamond proxy\\n /// @dev Reverts if selectors are already existing\\n function _addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n if (_facetAddress == address(0)) {\\n revert CannotAddSelectorsToZeroAddress(_functionSelectors);\\n }\\n DiamondStorage storage ds = s.diamondStorage();\\n uint16 selectorCount = uint16(ds.selectors.length);\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n if (oldFacetAddress != address(0)) {\\n revert CannotAddFunctionToDiamondThatAlreadyExists(selector);\\n }\\n ds.selectorInfo[selector] = FacetInfo(_facetAddress, selectorCount);\\n ds.selectors.push(selector);\\n selectorCount++;\\n }\\n }\\n\\n /// @notice Upgrades a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n if (_facetAddress == address(0)) {\\n revert CannotReplaceFunctionsFromFacetWithZeroAddress(_functionSelectors);\\n }\\n _enforceHasContractCode(_facetAddress);\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\\n // Can't replace immutable functions -- functions defined directly in the diamond in this case\\n if (oldFacetAddress == address(this)) {\\n revert CannotReplaceImmutableFunction(selector);\\n }\\n if (oldFacetAddress == _facetAddress) {\\n revert CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(selector);\\n }\\n if (oldFacetAddress == address(0)) {\\n revert CannotReplaceFunctionThatDoesNotExists(selector);\\n }\\n // Replace old facet address\\n ds.selectorInfo[selector].facetAddress = _facetAddress;\\n }\\n }\\n\\n /// @notice Removes a function in the diamond proxy\\n /// @dev Reverts if selectors do not already exist\\n function _removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\\n DiamondStorage storage ds = s.diamondStorage();\\n uint256 selectorCount = ds.selectors.length;\\n if (_facetAddress != address(0)) {\\n revert RemoveFacetAddressMustBeZeroAddress(_facetAddress);\\n }\\n uint256 functionSelectorsLength = _functionSelectors.length;\\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n FacetInfo memory oldFacetAddressAndSelectorPosition = ds.selectorInfo[selector];\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(0)) {\\n revert CannotRemoveFunctionThatDoesNotExist(selector);\\n }\\n\\n // Can't remove immutable functions -- functions defined directly in the diamond\\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(this)) {\\n revert CannotRemoveImmutableFunction(selector);\\n }\\n // Replace selector with last selector\\n selectorCount--;\\n if (oldFacetAddressAndSelectorPosition.selectorPosition != selectorCount) {\\n bytes4 lastSelector = ds.selectors[selectorCount];\\n ds.selectors[oldFacetAddressAndSelectorPosition.selectorPosition] = lastSelector;\\n ds.selectorInfo[lastSelector].selectorPosition = oldFacetAddressAndSelectorPosition.selectorPosition;\\n }\\n // Delete last selector\\n ds.selectors.pop();\\n delete ds.selectorInfo[selector];\\n }\\n }\\n\\n /// @notice Checks that an address has a non void bytecode\\n function _enforceHasContractCode(address _contract) private view {\\n uint256 contractSize;\\n assembly (\\\"memory-safe\\\") {\\n contractSize := extcodesize(_contract)\\n }\\n if (contractSize == 0) {\\n revert ContractHasNoCode();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x10bde4c13cc3d3c4aec15b793565bfe05b5f770eafeb839bfd159dbe6351dc62\",\"license\":\"MIT\"},\"contracts/parallelizer/libraries/LibHelpers.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.28;\\n\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibHelpers\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibHelpers` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibHelpers.sol\\nlibrary LibHelpers {\\n /// @notice Rebases the units of `amount` from `fromDecimals` to `toDecimals`\\n function convertDecimalTo(uint256 amount, uint8 fromDecimals, uint8 toDecimals) internal pure returns (uint256) {\\n if (fromDecimals > toDecimals) return amount / 10 ** (fromDecimals - toDecimals);\\n else if (fromDecimals < toDecimals) return amount * 10 ** (toDecimals - fromDecimals);\\n else return amount;\\n }\\n\\n /// @notice Checks whether a `token` is in a list `tokens` and returns the index of the token in the list\\n /// or -1 in the other case\\n function checkList(address token, address[] memory tokens) internal pure returns (int256) {\\n uint256 tokensLength = tokens.length;\\n for (uint256 i; i < tokensLength; ++i) {\\n if (token == tokens[i]) return int256(i);\\n }\\n return -1;\\n }\\n\\n /// @notice Searches a sorted `array` and returns the first index that contains a value strictly greater\\n /// (or lower if increasingArray is false) to `element` minus 1\\n /// @dev If no such index exists (i.e. all values in the array are strictly lesser/greater than `element`),\\n /// either array length minus 1, or 0 are returned\\n /// @dev The time complexity of the search is O(log n).\\n /// @dev Inspired from OpenZeppelin Contracts v4.4.1:\\n /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Arrays.sol\\n /// @dev Modified by Angle Labs to support `uint64`, monotonous arrays and exclusive upper bounds\\n function findLowerBound(\\n bool increasingArray,\\n uint64[] memory array,\\n uint64 normalizerArray,\\n uint64 element\\n )\\n internal\\n pure\\n returns (uint256)\\n {\\n if (array.length == 0) {\\n return 0;\\n }\\n uint256 low = 1;\\n uint256 high = array.length;\\n\\n if (\\n (increasingArray && array[high - 1] * normalizerArray <= element)\\n || (!increasingArray && array[high - 1] * normalizerArray >= element)\\n ) return high - 1;\\n\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds down (it does integer division with truncation).\\n if (increasingArray ? array[mid] * normalizerArray > element : array[mid] * normalizerArray < element) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n // At this point `low` is the exclusive upper bound.\\n // `low - 1` is the inclusive lower bound.\\n return low - 1;\\n }\\n\\n /// @notice Evaluates for `x` a piecewise linear function defined with the breaking points in the arrays\\n /// `xArray` and `yArray`\\n /// @dev The values in the `xArray` must be increasing\\n function piecewiseLinear(uint64 x, uint64[] memory xArray, int64[] memory yArray) internal pure returns (int64) {\\n uint256 indexLowerBound = findLowerBound(true, xArray, 1, x);\\n if (indexLowerBound == 0 && x < xArray[0]) return yArray[0];\\n else if (indexLowerBound == xArray.length - 1) return yArray[xArray.length - 1];\\n return yArray[indexLowerBound]\\n + ((yArray[indexLowerBound + 1] - yArray[indexLowerBound]) * int64(x - xArray[indexLowerBound]))\\n / int64(xArray[indexLowerBound + 1] - xArray[indexLowerBound]);\\n }\\n}\\n\",\"keccak256\":\"0xfbda0e69409593ef0e4a176a7909d980e3cf09b2c4642cd2c6d16e1773c6e6f2\",\"license\":\"GPL-3.0\"},\"contracts/parallelizer/libraries/LibManager.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IManager } from \\\"contracts/interfaces/IManager.sol\\\";\\n\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibManager\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev Managed collateral assets may be handled through external smart contracts or directly through this library\\n/// @dev There is no implementation at this point for a managed collateral handled through this library, and\\n/// a new specific `ManagerType` would need to be added in this case\\n/// @dev This library is an authorized fork of Angle's `LibManager` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibManager.sol\\nlibrary LibManager {\\n /// @notice Checks to which address managed funds must be transferred\\n function transferRecipient(bytes memory config) internal view returns (address recipient) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n recipient = address(this);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (address));\\n }\\n\\n /// @notice Performs a transfer of `token` for a collateral that is managed to a `to` address\\n /// @dev `token` may not be the actual collateral itself, as some collaterals have subcollaterals associated\\n /// with it\\n /// @dev Eventually pulls funds from strategies\\n function release(address token, address to, uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).release(token, to, amount);\\n }\\n\\n /// @notice Gets the balances of all the tokens controlled through `managerData`\\n /// @return balances An array of size `subCollaterals` with current balances of all subCollaterals\\n /// including the one corresponding to the `managerData` given\\n /// @return totalValue The value of all the `subCollaterals` in `collateral`\\n /// @dev `subCollaterals` must always have as first token (index 0) the collateral itself\\n function totalAssets(bytes memory config) internal view returns (uint256[] memory balances, uint256 totalValue) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).totalAssets();\\n }\\n\\n /// @notice Calls a hook if needed after new funds have been transfered to a manager\\n function invest(uint256 amount, bytes memory config) internal {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).invest(amount);\\n }\\n\\n /// @notice Returns available underlying tokens, for instance if liquidity is fully used and\\n /// not withdrawable the function will return 0\\n function maxAvailable(bytes memory config) internal view returns (uint256 available) {\\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).maxAvailable();\\n }\\n\\n /// @notice Decodes the `managerData` associated to a collateral\\n function parseManagerConfig(bytes memory config) internal pure returns (ManagerType managerType, bytes memory data) {\\n (managerType, data) = abi.decode(config, (ManagerType, bytes));\\n }\\n}\\n\",\"keccak256\":\"0x18282c744bc34bd9ae937c0c49e909c9c4e50c15e69fb485aa68fc56e549d1a1\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IParallelizerOracle } from \\\"contracts/interfaces/IParallelizerOracle.sol\\\";\\nimport { AggregatorV3Interface } from \\\"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\\\";\\nimport { IMorphoOracle } from \\\"contracts/interfaces/external/morpho/IMorphoOracle.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibOracle\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibOracle` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibOracle.sol\\nlibrary LibOracle {\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n ACTIONS SPECIFIC ORACLES \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads the oracle value used during a redemption to compute collateral ratio for `oracleConfig`\\n /// @dev This value is only sensitive to compute the collateral ratio and deduce a penalty factor\\n function readRedemption(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (OracleReadType oracleType, OracleReadType targetType, bytes memory oracleData, bytes memory targetData,) =\\n _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readRedemption();\\n } else {\\n (oracleValue,) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, 0);\\n return oracleValue;\\n }\\n }\\n\\n /// @notice Reads the oracle value used during mint operations for an asset with `oracleConfig`\\n /// @dev For assets which do not rely on external oracles, this value is the minimum between the processed oracle\\n /// value for the asset and its target price\\n function readMint(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readMint();\\n }\\n\\n (uint128 userDeviation,) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n if (targetPrice < oracleValue) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads the oracle value used for a burn operation for an asset with `oracleConfig`\\n /// @return oracleValue The actual oracle value obtained\\n /// @return ratio If `oracle value < target price`, the ratio between the oracle value and the target\\n /// price, otherwise `BASE_18`\\n function readBurn(bytes memory oracleConfig) internal view returns (uint256 oracleValue, uint256 ratio) {\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(oracleConfig);\\n if (oracleType == OracleReadType.EXTERNAL) {\\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\\n return externalOracle.readBurn();\\n }\\n (uint128 userDeviation, uint128 burnRatioDeviation) = abi.decode(hyperparameters, (uint128, uint128));\\n uint256 targetPrice;\\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\\n // Firewall in case the oracle value reported is low compared to the target\\n // If the oracle value is slightly below its target, then no deviation is reported for the oracle and\\n // the price of burning the stablecoin for other assets is not impacted. Also, the oracle value of this asset\\n // is set to the target price, to not be open to direct arbitrage\\n ratio = BASE_18;\\n if (oracleValue * BASE_18 < targetPrice * (BASE_18 - burnRatioDeviation)) {\\n ratio = (oracleValue * BASE_18) / targetPrice;\\n } else if (oracleValue < targetPrice) {\\n oracleValue = targetPrice;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n VIEW FUNCTIONS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Internal version of the `getOracle` function\\n function getOracle(address collateral)\\n internal\\n view\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return _parseOracleConfig(s.transmuterStorage().collaterals[collateral].oracleConfig);\\n }\\n\\n /// @notice Gets the oracle value and the ratio with respect to the target price when it comes to\\n /// burning for `collateral`\\n function getBurnOracle(\\n address collateral,\\n bytes memory oracleConfig\\n )\\n internal\\n view\\n returns (uint256 minRatio, uint256 oracleValue)\\n {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n minRatio = BASE_18;\\n address[] memory collateralList = ts.collateralList;\\n uint256 length = collateralList.length;\\n for (uint256 i; i < length; ++i) {\\n uint256 ratioObserved = BASE_18;\\n if (collateralList[i] != collateral) {\\n (, ratioObserved) = readBurn(ts.collaterals[collateralList[i]].oracleConfig);\\n } else {\\n (oracleValue, ratioObserved) = readBurn(oracleConfig);\\n }\\n if (ratioObserved < minRatio) minRatio = ratioObserved;\\n }\\n }\\n\\n /// @notice Computes the `quoteAmount` (for Chainlink oracles) depending on a `quoteType` and a base value\\n /// (e.g the target price of the asset)\\n /// @dev For cases where the Chainlink feed directly looks into the value of the asset, `quoteAmount` is `BASE_18`.\\n /// For others, like wstETH for which Chainlink only has an oracle for stETH, `quoteAmount` is the target price\\n function quoteAmount(OracleQuoteType quoteType, uint256 baseValue) internal pure returns (uint256) {\\n if (quoteType == OracleQuoteType.UNIT) return BASE_18;\\n else return baseValue;\\n }\\n\\n function readSpotAndTarget(\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n uint256 deviation\\n )\\n internal\\n view\\n returns (uint256 oracleValue, uint256 targetPrice)\\n {\\n targetPrice = read(targetType, BASE_18, targetData);\\n oracleValue = read(oracleType, targetPrice, oracleData);\\n // System may tolerate small deviations from target\\n // If the oracle value reported is reasonably close to the target\\n // --> disregard the oracle value and return the target price\\n if (\\n targetPrice * (BASE_18 - deviation) < oracleValue * BASE_18\\n && oracleValue * BASE_18 < targetPrice * (BASE_18 + deviation)\\n ) oracleValue = targetPrice;\\n }\\n\\n /// @notice Reads an oracle value (or a target oracle value) for an asset based on its data parsed `oracleConfig`\\n function read(OracleReadType readType, uint256 baseValue, bytes memory data) internal view returns (uint256) {\\n if (readType == OracleReadType.CHAINLINK_FEEDS) {\\n (\\n AggregatorV3Interface[] memory circuitChainlink,\\n uint32[] memory stalePeriods,\\n uint8[] memory circuitChainIsMultiplied,\\n uint8[] memory chainlinkDecimals,\\n OracleQuoteType quoteType\\n ) = abi.decode(data, (AggregatorV3Interface[], uint32[], uint8[], uint8[], OracleQuoteType));\\n uint256 quotePrice = quoteAmount(quoteType, baseValue);\\n uint256 listLength = circuitChainlink.length;\\n for (uint256 i; i < listLength; ++i) {\\n quotePrice = readChainlinkFeed(\\n quotePrice, circuitChainlink[i], circuitChainIsMultiplied[i], chainlinkDecimals[i], stalePeriods[i]\\n );\\n }\\n return quotePrice;\\n } else if (readType == OracleReadType.STABLE) {\\n return BASE_18;\\n } else if (readType == OracleReadType.NO_ORACLE) {\\n return baseValue;\\n } else if (readType == OracleReadType.WSTETH) {\\n return STETH.getPooledEthByShares(1 ether);\\n } else if (readType == OracleReadType.CBETH) {\\n return CBETH.exchangeRate();\\n } else if (readType == OracleReadType.RETH) {\\n return RETH.getExchangeRate();\\n } else if (readType == OracleReadType.SFRXETH) {\\n return SFRXETH.pricePerShare();\\n } else if (readType == OracleReadType.MAX) {\\n uint256 maxValue = abi.decode(data, (uint256));\\n return maxValue;\\n } else if (readType == OracleReadType.MORPHO_ORACLE) {\\n (address contractAddress, uint256 normalizationFactor) = abi.decode(data, (address, uint256));\\n return IMorphoOracle(contractAddress).price() / normalizationFactor;\\n }\\n // If the `OracleReadType` is `EXTERNAL`, it means that this function is called to compute a\\n // `targetPrice` in which case the `baseValue` is returned here\\n else {\\n return baseValue;\\n }\\n }\\n\\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n SPECIFIC HELPERS \\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n /// @notice Reads a Chainlink feed using a quote amount and converts the quote amount to the out-currency\\n /// @param _quoteAmount The amount for which to compute the price expressed in `BASE_18`\\n /// @param feed Chainlink feed to query\\n /// @param multiplied Whether the ratio outputted by Chainlink should be multiplied or divided to the `quoteAmount`\\n /// @param decimals Number of decimals of the corresponding Chainlink pair\\n /// @return The `quoteAmount` converted in out-currency\\n function readChainlinkFeed(\\n uint256 _quoteAmount,\\n AggregatorV3Interface feed,\\n uint8 multiplied,\\n uint256 decimals,\\n uint32 stalePeriod\\n )\\n internal\\n view\\n returns (uint256)\\n {\\n (, int256 ratio,, uint256 updatedAt,) = feed.latestRoundData();\\n if (ratio <= 0 || block.timestamp - updatedAt > stalePeriod) revert InvalidChainlinkRate();\\n // Checking whether we should multiply or divide by the ratio computed\\n if (multiplied == 1) return (_quoteAmount * uint256(ratio)) / (10 ** decimals);\\n else return (_quoteAmount * (10 ** decimals)) / uint256(ratio);\\n }\\n\\n /// @notice Parses an `oracleConfig` into several sub fields\\n function _parseOracleConfig(bytes memory oracleConfig)\\n private\\n pure\\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\\n {\\n return abi.decode(oracleConfig, (OracleReadType, OracleReadType, bytes, bytes, bytes));\\n }\\n\\n function updateOracle(address collateral) internal {\\n ParallelizerStorage storage ts = s.transmuterStorage();\\n if (ts.collaterals[collateral].decimals == 0) revert NotCollateral();\\n\\n (\\n OracleReadType oracleType,\\n OracleReadType targetType,\\n bytes memory oracleData,\\n bytes memory targetData,\\n bytes memory hyperparameters\\n ) = _parseOracleConfig(ts.collaterals[collateral].oracleConfig);\\n\\n if (targetType != OracleReadType.MAX) revert OracleUpdateFailed();\\n uint256 oracleValue = read(oracleType, BASE_18, oracleData);\\n\\n uint256 maxValue = abi.decode(targetData, (uint256));\\n if (oracleValue > maxValue) {\\n ts.collaterals[collateral].oracleConfig = abi.encode(\\n oracleType,\\n targetType,\\n oracleData,\\n // There are no checks whether the value increased or not\\n abi.encode(oracleValue),\\n hyperparameters\\n );\\n } else {\\n revert OracleUpdateFailed();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x24f504bdd0b7346a447d646a2b2b19afe1a71ee829a59e5cb2ac5fac320611d7\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibStorage.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport \\\"../../utils/Constants.sol\\\";\\nimport { DiamondStorage, ImplementationStorage, ParallelizerStorage } from \\\"../Storage.sol\\\";\\n\\n/// @title LibStorage\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibStorage` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibStorage.sol\\nlibrary LibStorage {\\n /// @notice Returns the storage struct stored at the `DIAMOND_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic of the different facets used in the diamond proxy\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ds.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `TRANSMUTER_STORAGE_POSITION` slot\\n /// @dev This struct handles the particular logic of the Parallelizer system\\n function transmuterStorage() internal pure returns (ParallelizerStorage storage ts) {\\n bytes32 position = TRANSMUTER_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ts.slot := position\\n }\\n }\\n\\n /// @notice Returns the storage struct stored at the `IMPLEMENTATION_STORAGE_POSITION` slot\\n /// @dev This struct handles the logic for making the contract easily usable on Etherscan\\n function implementationStorage() internal pure returns (ImplementationStorage storage ims) {\\n bytes32 position = IMPLEMENTATION_STORAGE_POSITION;\\n assembly (\\\"memory-safe\\\") {\\n ims.slot := position\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf8c333898ca14d3e8696c232f669a839dddbf705a609a1b0795ecc6b8f1b2d73\",\"license\":\"BUSL-1.1\"},\"contracts/parallelizer/libraries/LibWhitelist.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { IKeyringGuard } from \\\"contracts/interfaces/external/keyring/IKeyringGuard.sol\\\";\\n\\nimport { LibStorage as s } from \\\"./LibStorage.sol\\\";\\n\\nimport \\\"../../utils/Errors.sol\\\";\\nimport \\\"../Storage.sol\\\";\\n\\n/// @title LibWhitelist\\n/// @author Cooper Labs\\n/// @custom:contact security@cooperlabs.xyz\\n/// @dev This library is an authorized fork of Angle's `LibWhitelist` library\\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibWhitelist.sol\\nlibrary LibWhitelist {\\n /// @notice Checks whether `sender` is whitelisted for a collateral with `whitelistData`\\n function checkWhitelist(bytes memory whitelistData, address sender) internal returns (bool) {\\n (WhitelistType whitelistType, bytes memory data) = abi.decode(whitelistData, (WhitelistType, bytes));\\n if (s.transmuterStorage().isWhitelistedForType[whitelistType][sender] > 0) return true;\\n if (data.length != 0) {\\n if (whitelistType == WhitelistType.BACKED) {\\n address keyringGuard = abi.decode(data, (address));\\n if (keyringGuard != address(0)) return IKeyringGuard(keyringGuard).isAuthorized(address(this), sender);\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x72595e0b49dfce76ba70d9f69af54ffbc84650c8c696caa20f858ef2438d94b5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nimport { ICbETH } from \\\"contracts/interfaces/external/coinbase/ICbETH.sol\\\";\\nimport { ISfrxETH } from \\\"contracts/interfaces/external/frax/ISfrxETH.sol\\\";\\nimport { IStETH } from \\\"contracts/interfaces/external/lido/IStETH.sol\\\";\\nimport { IRETH } from \\\"contracts/interfaces/external/rocketPool/IRETH.sol\\\";\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n STORAGE SLOTS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n/// @dev Storage position of `DiamondStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.diamond.storage\\\") - 1`\\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\\n\\n/// @dev Storage position of `ParallelizerStorage` structure\\n/// @dev Equals `keccak256(\\\"diamond.standard.parallelizer.storage\\\") - 1`\\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\\n\\n/// @dev Storage position of `ImplementationStorage` structure\\n/// @dev Equals `keccak256(\\\"eip1967.proxy.implementation\\\") - 1`\\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n MATHS \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\nuint256 constant BASE_6 = 1e6;\\nuint256 constant BASE_8 = 1e8;\\nuint256 constant BASE_9 = 1e9;\\nuint256 constant BASE_12 = 1e12;\\nuint256 constant BPS = 1e14;\\nuint256 constant BASE_18 = 1e18;\\nuint256 constant HALF_BASE_27 = 1e27 / 2;\\nuint256 constant BASE_27 = 1e27;\\nuint256 constant BASE_36 = 1e36;\\nuint256 constant MAX_BURN_FEE = 999_000_000;\\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// The values being non-zero value makes deployment a bit more expensive,\\n// but in exchange the refund on every call to nonReentrant will be lower in\\n// amount. Since refunds are capped to a percentage of the total\\n// transaction's gas, it is best to keep them low in cases like this one, to\\n// increase the likelihood of the full refund coming into effect.\\nuint8 constant NOT_ENTERED = 1;\\nuint8 constant ENTERED = 2;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n REENTRANT \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\n// Role IDs for the AccessManager\\nuint64 constant GOVERNOR_ROLE = 10;\\nuint64 constant GUARDIAN_ROLE = 20;\\n\\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\n COMMON ADDRESSES \\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\\n\\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\\n\",\"keccak256\":\"0x3306bdd0d4e4f364e0d35893a7ffb59c8eb9e94a5bd861f58b8d7ba8a7b336e5\",\"license\":\"BUSL-1.1\"},\"contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.28;\\n\\nerror AccessManagedUnauthorized(address caller);\\nerror AlreadyAdded();\\nerror CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);\\nerror CannotAddSelectorsToZeroAddress(bytes4[] _selectors);\\nerror CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);\\nerror CannotRemoveImmutableFunction(bytes4 _selector);\\nerror CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);\\nerror CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);\\nerror CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);\\nerror CannotReplaceImmutableFunction(bytes4 _selector);\\nerror ContractHasNoCode();\\nerror CollateralBacked();\\nerror FunctionNotFound(bytes4 _functionSelector);\\nerror IncorrectFacetCutAction(uint8 _action);\\nerror InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);\\nerror InvalidChainlinkRate();\\nerror InvalidLengths();\\nerror InvalidNegativeFees();\\nerror InvalidOracleType();\\nerror InvalidParam();\\nerror InvalidParams();\\nerror InvalidRate();\\nerror InvalidSwap();\\nerror InvalidTokens();\\nerror InvalidAccessManager();\\nerror ManagerHasAssets();\\nerror NoSelectorsProvidedForFacetForCut(address _facetAddress);\\nerror NotAllowed();\\nerror NotCollateral();\\nerror NotGovernor();\\nerror NotGuardian();\\nerror NotTrusted();\\nerror NotTrustedOrGuardian();\\nerror NotWhitelisted();\\nerror OdosSwapFailed();\\nerror OracleUpdateFailed();\\nerror Paused();\\nerror ReentrantCall();\\nerror RemoveFacetAddressMustBeZeroAddress(address _facetAddress);\\nerror TooBigAmountIn();\\nerror TooLate();\\nerror TooSmallAmountOut();\\nerror ZeroAddress();\\nerror ZeroAmount();\\nerror SwapError();\\nerror SlippageTooHigh();\\nerror InsufficientFunds();\\n\",\"keccak256\":\"0x1e2f6812ef78e948e5155d32213b52afff8c0ba5463d18bee10694efbf886130\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x60808060405234601557615802908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f5f3560e01c80633b6a1fe014610ef15780634583aea614610e865780639525f3ab14610e6c578063b92567fa146107d6578063c10a62871461046a5763d92c6cb21461005c575f80fd5b346103195761006a3661164d565b61007982859697949895611c02565b91909261008685846119cd565b97881061045b5761009b918391888780611cb1565b600260ff5f51602061578d5f395f51905f525460a81c161461044c576100e7600160a91b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b83151580610443575b610130575b602087610128600160a81b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b604051908152f35b61015361014e5f5160206157ad5f395f51905f525460801c8961428c565b614242565b6001600160801b03835460281c91168091016001600160d81b03811161042f57835464ffffffffff1660289190911b64ffffffffff19161783556001600160801b035f5160206157ad5f395f51905f52546101b18160801c86611b26565b16016001600160801b03811161041b57610202906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b80518590156103cd578082602061025694519101826e22d473030f116ddee9f6b43ac78ba35af13d156103c5573d9061023a82611632565b916102486040519384611611565b82523d87602084013e61557e565b505b60ff815416610327575b506001600160a01b031691823b15610319576040516340c10f1960e01b81526001600160a01b038716600482015260248101869052818160448183885af1801561031c57610304575b50506001600160a01b0360209560405192835285878401521660408201527f73adcdbf2d8fee0c1221daefef436a92c3c640e97ff2941e744bf5eef1ab346f60606001600160a01b0333951692a45f80808080806100f5565b61030f828092611611565b61031957806102ab565b80fd5b6040513d84823e3d90fd5b610336600861033b920161188c565b614bda565b90610345816140bf565b61026257610364816020806001600160a01b0394518301019101613f85565b16803b156103c1578380916024604051809481936255f9e960e71b83528860048401525af180156103b65790849161039d575b50610262565b816103a791611611565b6103b257825f610397565b8280fd5b6040513d86823e3d90fd5b8380fd5b60609061557e565b5050805460ff161561040657610401836103f16103ec6008850161188c565b6143da565b336001600160a01b038916614378565b610258565b6104018330336001600160a01b038916614378565b602486634e487b7160e01b81526011600452fd5b602487634e487b7160e01b81526011600452fd5b508615156100f0565b6004856306fda65d60e31b8152fd5b60048663a1aabbe160e01b8152fd5b5034610319576104793661164d565b61048882859697949895611c02565b9190926104958584611bb8565b978089116107c757918391886104ab948b611cb1565b600260ff5f51602061578d5f395f51905f525460a81c161461044c576104f7600160a91b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b861515806107be575b61053757602087610128600160a81b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b61055561014e5f5160206157ad5f395f51905f525460801c8661428c565b6001600160801b03835460281c91168091016001600160d81b03811161042f57835464ffffffffff1660289190911b64ffffffffff19161783556001600160801b035f5160206157ad5f395f51905f52546105b38160801c86611b26565b16016001600160801b03811161041b57610604906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b8051859015610785578082602061063c94519101826e22d473030f116ddee9f6b43ac78ba35af13d156103c5573d9061023a82611632565b505b60ff8154166106ff575b506001600160a01b031691823b15610319576040516340c10f1960e01b81526001600160a01b038716600482015260248101839052818160448183885af1801561031c576106ea575b50506001600160a01b0360209560405192868452878401521660408201527f73adcdbf2d8fee0c1221daefef436a92c3c640e97ff2941e744bf5eef1ab346f60606001600160a01b0333951692a45f80808080806100f5565b6106f5828092611611565b6103195780610691565b610336600861070e920161188c565b90610718816140bf565b61064857610737816020806001600160a01b0394518301019101613f85565b16803b156103c1578380916024604051809481936255f9e960e71b83528b60048401525af180156103b657908491610770575b50610648565b8161077a91611611565b6103b257825f61076a565b5050805460ff16156107a9576107a4866103f16103ec6008850161188c565b61063e565b6107a48630336001600160a01b038916614378565b50831515610500565b6004876328ac195d60e21b8152fd5b5034610319576107f56107e83661151b565b8284959792939694611739565b9096908715610e5b576108088482611bb8565b965b8711610e4c576040516020986108208a83611611565b838252600260ff5f51602061578d5f395f51905f525460a81c1614610e3d5761086f600160a91b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b881590811580610e34575b6108b1575b8a8a610128600160a81b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b15610b8d57506108d561014e5f5160206157ad5f395f51905f525460801c8761428c565b6001600160801b03835460281c91168091016001600160d81b038111610b7957835464ffffffffff1660289190911b64ffffffffff19161783556001600160801b035f5160206157ad5f395f51905f52546109338160801c86611b26565b16016001600160801b038111610b6557610984906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b8051839015610b2c5780828b6109d694519101826e22d473030f116ddee9f6b43ac78ba35af13d156103c5573d906109bb82611632565b916109c96040519384611611565b82523d858c84013e61557e565b505b60ff815416610aa7575b506001600160a01b038516803b15610aa3576040516340c10f1960e01b81526001600160a01b0384166004820152602481018590529082908290604490829084905af1801561031c57610a8e575b50506001600160a01b03905b60405192868452878401521660408201527f73adcdbf2d8fee0c1221daefef436a92c3c640e97ff2941e744bf5eef1ab346f60606001600160a01b0380339616941692a45f808080808080808061087f565b610a99828092611611565b6103195780610a30565b5080fd5b6103366008610ab6920161188c565b90610ac0816140bf565b6109e257610ade8189806001600160a01b0394518301019101613f85565b16803b15610aa3578180916024604051809481936255f9e960e71b83528c60048401525af1801561031c57908291610b17575b506109e2565b81610b2191611611565b61031957805f610b11565b5050805460ff1615610b5057610b4b876103f16103ec6008850161188c565b6109d8565b610b4b8730336001600160a01b038916614378565b602484634e487b7160e01b81526011600452fd5b602485634e487b7160e01b81526011600452fd5b905060ff82548a1c16151580610e18575b610e09576b033b2e3c9fd0803ce80000008802908882046b033b2e3c9fd0803ce8000000141715610df55761014e610be8915f5160206157ad5f395f51905f525460801c9061196b565b6001600160801b03825460281c91168091036001600160d81b038111610b6557825464ffffffffff1660289190911b64ffffffffff19161782556001600160801b035f5160206157ad5f395f51905f525416036001600160801b038111610df557610c8a906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b6001600160a01b038516803b156103b2578280916044604051809481936315a38ec760e11b83528d60048401523360248401525af18015610dea57908391610dd5575b5050805460ff1615610d83576103366008610ce8920161188c565b90610cf2816140bf565b15610d08575b50506001600160a01b0390610a3c565b610d228189806001600160a01b0394518301019101613f85565b16803b15610aa357604051638bfb07c960e01b81526001600160a01b03878116600483015284166024820152604481018590529082908290606490829084905af1801561031c5715610cf857610d79828092611611565b6103195780610cf8565b505060405163a9059cbb60e01b878201526001600160a01b038281166024830152604482018490529190610dd090610dc881606481015b03601f198101835282611611565b838716614b6d565b610a3c565b81610ddf91611611565b610aa357815f610ccd565b6040513d85823e3d90fd5b602483634e487b7160e01b81526011600452fd5b600483630b094f2760e31b8152fd5b50610e2e84610e296006850161188c565b6140dd565b15610b9e565b5086151561087a565b6004846306fda65d60e31b8152fd5b6004826328ac195d60e21b8152fd5b610e66848288611b82565b9661080a565b5034610319576020610128610e8036611571565b916116e9565b503461031957610ea7602091610e9b36611571565b93919250834291611739565b929015610ed65750610ebc61012891836119cd565b91825f5160206157ad5f395f51905f525460801c91611b4f565b610ee4610eec928483611989565b928391611a0e565b610128565b50346114a557610f036107e83661151b565b909690871561150a57610f1684826119cd565b965b87106114fb57604051602098610f2e8a83611611565b5f8252600260ff5f51602061578d5f395f51905f525460a81c16146114ec57610f7d600160a91b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b8515908115806114e3575b610fbe578a8a610128600160a81b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b156112535750610fe261014e5f5160206157ad5f395f51905f525460801c8a61428c565b6001600160801b03835460281c91168091016001600160d81b038111610b7957835464ffffffffff1660289190911b64ffffffffff19161783556001600160801b035f5160206157ad5f395f51905f52546110408160801c86611b26565b16016001600160801b038111610b6557611091906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b805183901561121a5780828b6110c894519101826e22d473030f116ddee9f6b43ac78ba35af13d156103c5573d906109bb82611632565b505b60ff815416611195575b506001600160a01b038516803b15610aa3576040516340c10f1960e01b81526001600160a01b0384166004820152602481018890529082908290604490829084905af1801561031c57611180575b50506001600160a01b03905b60405192835285878401521660408201527f73adcdbf2d8fee0c1221daefef436a92c3c640e97ff2941e744bf5eef1ab346f60606001600160a01b0380339616941692a45f808080808080808061087f565b61118b828092611611565b6103195780611122565b61033660086111a4920161188c565b906111ae816140bf565b6110d4576111cc8189806001600160a01b0394518301019101613f85565b16803b15610aa3578180916024604051809481936255f9e960e71b83528960048401525af1801561031c57908291611205575b506110d4565b8161120f91611611565b61031957805f6111ff565b5050805460ff161561123e57611239846103f16103ec6008850161188c565b6110ca565b6112398430336001600160a01b038916614378565b905060ff82548a1c161515806114cc575b6114bd576b033b2e3c9fd0803ce80000008502908582046b033b2e3c9fd0803ce80000001417156114a95761014e6112ae915f5160206157ad5f395f51905f525460801c9061196b565b6001600160801b03825460281c91168091036001600160d81b0381116114a957825464ffffffffff1660289190911b64ffffffffff19161782556001600160801b035f5160206157ad5f395f51905f525416036001600160801b0381116114a957611350906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b6001600160a01b038516803b156114a5575f80916044604051809481936315a38ec760e11b83528a60048401523360248401525af1801561149a57611485575b50805460ff16156114455761033660086113aa920161188c565b906113b4816140bf565b156113ca575b50506001600160a01b039061112e565b6113e48189806001600160a01b0394518301019101613f85565b16803b15610aa357604051638bfb07c960e01b81526001600160a01b03878116600483015284166024820152604481018890529082908290606490829084905af1801561031c57156113ba5761143b828092611611565b61031957806113ba565b505060405163a9059cbb60e01b878201526001600160a01b03828116602483015260448201879052919061148090610dc88160648101610dba565b61112e565b6114929192505f90611611565b5f905f611390565b6040513d5f823e3d90fd5b5f80fd5b634e487b7160e01b5f52601160045260245ffd5b630b094f2760e31b5f5260045ffd5b506114dd84610e296006850161188c565b15611264565b50891515610f88565b6306fda65d60e31b5f5260045ffd5b63a1aabbe160e01b5f5260045ffd5b611515848288611989565b96610f18565b60c09060031901126114a55760043590602435906044356001600160a01b03811681036114a557906064356001600160a01b03811681036114a557906084356001600160a01b03811681036114a5579060a43590565b60609060031901126114a557600435906024356001600160a01b03811681036114a557906044356001600160a01b03811681036114a55790565b606081019081106001600160401b038211176115c657604052565b634e487b7160e01b5f52604160045260245ffd5b604081019081106001600160401b038211176115c657604052565b61012081019081106001600160401b038211176115c657604052565b90601f801991011681019081106001600160401b038211176115c657604052565b6001600160401b0381116115c657601f01601f191660200190565b9060c06003198301126114a55760043591602435916044356001600160a01b03811681036114a557916064356001600160a01b03811681036114a557916084359160a4356001600160401b0381116114a557816023820112156114a5578060040135906116b982611632565b926116c76040519485611611565b828452602483830101116114a557815f92602460209301838601378301015290565b906116f690834291611739565b901561172557611722925061171d5f5160206157ad5f395f51905f525460801c8383611b4f565b611bb8565b90565b82611734838361172296611a0e565b611b82565b914211611864576001600160a01b035f51602061578d5f395f51905f525416806001600160a01b038416145f146117df57506117a691506001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460101c16156117b7575f91565b7f9e87fac8000000000000000000000000000000000000000000000000000000005f5260045ffd5b906001600160a01b0316145f1461183c5761182a906001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460081c16156117b757600191565b7f672215de000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fecdd1c29000000000000000000000000000000000000000000000000000000005f5260045ffd5b90604051915f8154908160011c926001831692831561194e575b60208510841461193a57848752869390811561191857506001146118d4575b506118d292500383611611565b565b90505f9291925260205f20905f915b8183106118fc5750509060206118d2928201015f6118c5565b60209193508060019154838589010152019101909184926118e3565b9050602092506118d294915060ff191682840152151560051b8201015f6118c5565b634e487b7160e01b5f52602260045260245ffd5b93607f16936118a6565b818102929181159184041417156114a957565b8115611975570490565b634e487b7160e01b5f52601260045260245ffd5b6119c16119b76119bc611722956119ae60ff956119a86005890161188c565b90611e80565b93909187612186565b611958565b61196b565b915460181c1690613eff565b906119e6906119b76119e16005850161188c565b613fd9565b9060ff815460181c166012019160ff83116114a95761172292611a0891613f4a565b906129d5565b909160ff835416159182159384611af9575b508315611a59575b505050611a3157565b7f11157667000000000000000000000000000000000000000000000000000000005f5260045ffd5b9192509082611a6d575b50505f8080611a28565b6001600160a01b039192506020906024604051809481937f70a08231000000000000000000000000000000000000000000000000000000008352306004840152165afa90811561149a575f91611ac7575b50105f80611a63565b90506020813d602011611af1575b81611ae260209383611611565b810103126114a557515f611abe565b3d9150611ad5565b82919450611b0c6008611b11920161188c565b61441f565b10925f611a20565b919082018092116114a957565b906b033b2e3c9fd0803ce8000000611b44600992845460281c611958565b0491015410611a3157565b916009916b033b2e3c9fd0803ce8000000611b71611b7893865460281c611958565b0490611b19565b91015410611a3157565b61172292611bad611b9c611bb2936119a86005870161188c565b91909260ff865460181c1690613f4a565b61449b565b90613186565b611bd1611bca6119e16005840161188c565b92826137dd565b91670de0b6b3a7640000830292808404670de0b6b3a764000014901517156114a9576119c160ff916117229461196b565b90421161186457611c43906001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460081c16156117b7576001600160a01b035f51602061578d5f395f51905f52541691565b81601f820112156114a557805190611c8282611632565b92611c906040519485611611565b828452602083830101116114a557815f9260208093018386015e8301015290565b9492909360405190611cc2826115ab565b5f825260208201965f885260408301956060875260ff81541615155f14611e4f57611cfa6103ec60086001600160a01b03930161188c565b1683525b81518201936040838603126114a5576020830151966040840151956001600160401b0387116114a557611de99a6117229a6101449a611d51611e10986020809c816001600160a01b039801920101611c6b565b85528252826040519a611d638c6115da565b168a52888a0152519560405198611d798a6115ab565b89528789019687526040890193845251169260405193611d98856115da565b8452868401525193604051998a977f30f28b7a00000000000000000000000000000000000000000000000000000000888a0152602489019051602080916001600160a01b0381511684520151910152565b51606487015251608486015280516001600160a01b031660a48601526020015160c4850152565b3360e4840152610100610104840152805191829182610124860152018484015e5f838284010152601f801991011681010301601f198101835282611611565b50308352611cfe565b8051821015611e6c5760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b90915f91670de0b6b3a76400009360405190818260207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775492838152017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f20925f5b818110611fc2575050611efc92500383611611565b8151925f5b848110611f0f575050505050565b6001600160a01b03611f218286611e58565b51166001600160a01b03831614611faf57611f92611f8d6005611f876001600160a01b03611f4f868a611e58565b51166001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b0161188c565b614538565b90505b888110611fa6575b50600101611f01565b97506001611f9d565b9550611fba82614538565b969096611f95565b84546001600160a01b0316835260019485019487945060209093019201611ee7565b805415611e6c575f5260205f20905f90565b9190918054831015611e6c575f52601860205f208360021c019260031b1690565b919082039182116114a957565b905f82633b9aca00039212633b9aca008312811690633b9aca008413901516176114a957565b90633b9ac9ff1982019182136001166114a957565b81810392915f1380158285131691841216176114a957565b90633b9aca008201915f633b9aca00841291129080158216911516176114a957565b9081633b9aca00019182126001166114a957565b9190915f83820193841291129080158216911516176114a957565b5f908015612180578080600114612178576002146121715760016101338210166001600b83101617612163579060019060025b600181116121275750825f1904821161211357500290565b80634e487b7160e01b602492526011600452fd5b92805f1904811161214f5760018416612146575b80029260011c6120fb565b8092029161213b565b602482634e487b7160e01b81526011600452fd5b6002900a9190806121135750565b5050600490565b505050600190565b50505f90565b9060405190612194826115f5565b5f82525f60208301525f60408301525f60608301525f60808301525f60a08301525f60c08301525f60e08301525f6101008301526004600210156125a2575f80835260016020840181905290929091906129ca565b5f5160206157ad5f395f51905f5254946001600160801b0386161580156129c1575b6129985750855460281c80670de0b6b3a7640000810204670de0b6b3a764000014811517156114a9576b033b2e3c9fd0803ce800000061228c612298926001600160801b036001600160401b0361226e828c16670de0b6b3a7640000850261196b565b16998461227f8260801c8095611958565b0460e08901521690611958565b0460e084015190612017565b6101008301525f9482511515805f1461298c578288018392915b6040519182602082549182815201915f5260205f20905f915b8160038401106129485794809387959361230d936123129854918b82821061292f575b828210612912575b8282106128f5575b50106128e7575b500383611611565b6147e4565b915b612389575b5050905115905061235b575f1982019182116114a9576123426123559260026117229601611ff6565b90549060031b1c60070b905b6002614690565b90611b19565b5f1982019182116114a9576123796123559260046117229601611ff6565b90549060031b1c60070b9061234e565b91969094915f1983018381116114a9578610156128dc57835115612828578782016001600160401b036123bc8883611ff6565b90549060031b1c1660408601528887018088116114a9576001600160401b036123e88261241794611ff6565b90549060031b1c166060870152600284016124038982611ff6565b90549060031b1c60070b6080880152611ff6565b90549060031b1c60070b60a085015261243a610100850151606086015190611958565b6060850151633b9aca000390633b9aca0082116114a9576124699161245e9161196b565b60e086015190612017565b60c08501525b6040840151633b9aca00810290808204633b9aca0014901517156114a9570361274c576080830151945b60208401511561270a5760c0840151925b8584106126205750505060208201518490156125075760a06124ce9293015161205f565b926001600160ff1b03821682036114a9576124f6612355946124fc93611722981b908561430c565b906120ad565b60070b906002614690565b50506001600160ff1b03821682036114a95761254061253561252d8560a085015161205f565b84881b611958565b60c0830151906142c5565b9051156125b6576125619061255c61255785612099565b6120c8565b611b19565b61256a81614c20565b9060048610156125a2576125936123559460029361259893896117229a505081800210016120ad565b61204a565b0560070b9061234e565b634e487b7160e01b5f52602160045260245ffd5b9093506125c561255783612024565b90808210156125e257505061172292600261259861235593612077565b6125f9906125f36125fe9394612077565b93612017565b614c20565b92612617612612611722956123559461205f565b6142ee565b60070b9061234e565b959461264d92989361263491989298612017565b946020850151155f146126b8575060c084015190611b19565b946060830151633b9aca00810290808204633b9aca0014901517156114a957905f1981146114a957835190830191901561269f578261269560e086015160c087015190611b19565b60e0860152612314565b826126b360e086015160c087015190612017565b612695565b8451156126e2576123559060026126d860c08801519260a08901516120ad565b60070b05906149cf565b6127059060026126fb60c08801519260a08901516120ad565b60070b0590614963565b612355565b83511561272f5761272960c085015160026126d88960a08901516120ad565b926124aa565b61274760c085015160026126fb8960a08901516120ad565b612729565b608083015160a08401510361276657608083015194612499565b8251156127e95760e0830151612786610100850151604086015190611958565b906040850151633b9aca000390633b9aca0082116114a9576127ae6127b4926127e39461196b565b90612017565b6124f66080860151916127dd6127d2826119b78660a08c015161205f565b9160c0890151611b19565b9061196b565b94612499565b6127fd610100840151604085015190611958565b6040840151633b9aca0003633b9aca0081116114a95761245e612823916127e39361196b565b6127b4565b600382016001600160401b0361283e8883611ff6565b90549060031b1c1660408601528887018088116114a9576001600160401b0361286a8261288594611ff6565b90549060031b1c166060870152600484016124038982611ff6565b90549060031b1c60070b60a085015260e08401516128ad610100860151606087015190611958565b906060860151633b9aca000391633b9aca0083116114a9576128d2926127ae9161196b565b60c085015261246f565b819750829550612319565b60c01c81526020015f612305565b90936020906001600160401b038560801c1681520193018b6122fe565b90936020906001600160401b038560401c1681520193018b6122f6565b6001600160401b0384168552602090940193018b6122ee565b80546001600160401b038082168652604082811c82166020880152608083811c9092169087015260c09190911c6060860152899894019360049390930192016122cb565b600388018392916122b2565b92945050506117229391505f146129b55760026123429101611fe4565b60046123799101611fe4565b5081851461220b565b6003850154926121e9565b604051916129e2836115f5565b5f83525f60208401525f60408401525f60608401525f60808401525f60a08401525f60c08401525f60e08401525f61010084015260045f10156125a25760018084525f6020850152906001830154915f5160206157ad5f395f51905f5254906001600160801b038216908115801561317c575b6131535750845460281c670de0b6b3a76400008102818104670de0b6b3a764000014821517156114a957826b033b2e3c9fd0803ce80000009283612ab66001600160401b03612aaa612acd98612ac19761196b565b169760801c8093611958565b0460e08b0152611958565b0460e087015190612017565b6101008601525f9385511515805f146131495782600183015b604051928391602081549586815201905f5260205f20945f955b8160038801106130f35791612b4196859261230d9454918181106130d9575b8181106130bc575b81811061309f575b10613091575b509b97999b0383611611565b935b5f1987018781116114a95785101561302857825115612f7357600182016001600160401b03612b728783611ff6565b90549060031b1c166040850152600186018087116114a9576001600160401b03612b9f82612bce94611ff6565b90549060031b1c16606086015260028401612bba8882611ff6565b90549060031b1c60070b6080870152611ff6565b90549060031b1c60070b60a0840152612bf1610100840151606085015190611958565b6060840151633b9aca000390633b9aca0082116114a957612c2091612c159161196b565b60e085015190612017565b60c08401525b604083015180633b9aca00810204633b9aca0014811517156114a957633b9aca000203612ea3576080820151955b602083015115612e615760c0830151945b848610612d8f57505050602081015185919015612cbe579060a0612c8a92015161205f565b6001600160ff1b03831683036114a957611722946124f6612cb3926123559560011b908561430c565b60070b905b5f614690565b919250506001600160ff1b03821682036114a957612cef612535612ce68660a085015161205f565b8460011b611958565b905115612d3657612d069061255c61255786612099565b90612d1082614c20565b93612d2c612593600292611722976123559681800210016120ad565b0560070b90612cb8565b612d44612557859395612024565b9080821015612d61575050611722926002612d2c61235593612077565b6125f9906125f3612d729394612077565b92612d86612612611722956123559461205f565b60070b90612cb8565b929693612dbb92969195612da291612017565b936020880151155f14612e28575060c087015190611b19565b936060860151633b9aca00810290808204633b9aca0014901517156114a957915f1981146114a95760010193865115155f14612e1057612e0460e088015160c089015190611b19565b60e08801529591612b43565b612e2360e088015160c089015190612017565b612e04565b875115612e48576123559060026126d860c08b01519260a08c01516120ad565b6127059060026126fb60c08b01519260a08c01516120ad565b825115612e8657612e8060c084015160026126d88a60a08801516120ad565b94612c65565b612e9e60c084015160026126fb8a60a08801516120ad565b612e80565b608082015160a083015103612ebd57608082015195612c54565b815115612f345760e0820151612edd610100840151604085015190611958565b906040840151633b9aca000390633b9aca0082116114a9576127ae612f0592612f2e9461196b565b6124f66080850151916127dd612f23826119b78660a08b015161205f565b9160c0880151611b19565b95612c54565b612f48610100830151604084015190611958565b6040830151633b9aca0003633b9aca0081116114a957612c15612f6e91612f2e9361196b565b612f05565b600382016001600160401b03612f898783611ff6565b90549060031b1c166040850152600186018087116114a9576001600160401b03612fb682612fd194611ff6565b90549060031b1c16606086015260048401612bba8882611ff6565b90549060031b1c60070b60a084015260e0830151612ff9610100850151606086015190611958565b906060850151633b9aca000391633b9aca0083116114a95761301e926127ae9161196b565b60c0840152612c26565b5090519094925015613063575f1982019182116114a9576130526123559260026117229601611ff6565b90549060031b1c60070b905f614690565b5f1982019182116114a9576130816123559260046117229601611ff6565b90549060031b1c60070b90612cb8565b60c01c81526020015f612b35565b9260206001916001600160401b038560801c168152019301612b2f565b9260206001916001600160401b038560401c168152019301612b27565b9260206001916001600160401b0385168152019301612b1f565b9395929450906001608060049286546001600160401b03811682526001600160401b038160401c1660208301526001600160401b0381841c16604083015260c01c60608201520194019201949290879492612b00565b8260038301612ae6565b92949350505061172293505f146131705760026130529101611fe4565b60046130819101611fe4565b5060018514612a55565b60405191613193836115f5565b5f83525f60208401525f60408401525f60608401525f60808401525f60a08401525f60c08401525f60e08401525f6101008401526004600310156125a2575f80845260208401819052906137d2565b5f5160206157ad5f395f51905f5254906001600160801b03821690811580156137c8575b61379f5750845460281c670de0b6b3a76400008102818104670de0b6b3a764000014821517156114a957826b033b2e3c9fd0803ce80000009283612ab66001600160401b03612aaa61325b98612ac19761196b565b6101008601525f9385511515805f146137955782600183015b604051928391602081549586815201905f5260205f20945f955b81600388011061373f57916132cb96859261230d9454918181106130d9578181106130bc5781811061309f571061309157509b97999b0383611611565b935b5f1987018781116114a9578510156136d55782511561363b57600182016001600160401b036132fc8783611ff6565b90549060031b1c166040850152600186018087116114a9576001600160401b03612b9f8261332994611ff6565b90549060031b1c60070b60a084015261334c610100840151606085015190611958565b6060840151633b9aca000390633b9aca0082116114a95761337091612c159161196b565b60c08401525b604083015180633b9aca00810204633b9aca0014811517156114a957633b9aca000203613599576080820151955b6020830151156135575760c0830151945b8486106134d75750505060208101518591901561340f579060a06133da92015161205f565b6001600160ff1b03831683036114a957611722946124f6613403926123559560011b908561430c565b60070b905b6003614690565b919250506001600160ff1b03821682036114a957613437612535612ce68660a085015161205f565b90511561347e5761344e9061255c61255786612099565b9061345882614c20565b93613474612593600292611722976123559681800210016120ad565b0560070b90613408565b61348c612557859395612024565b90808210156134a957505061172292600261347461235593612077565b6125f9906125f36134ba9394612077565b926134ce612612611722956123559461205f565b60070b90613408565b9296936134ea92969195612da291612017565b936060860151633b9aca00810290808204633b9aca0014901517156114a957915f1981146114a95760010193865115155f1461353f5761353360e088015160c089015190611b19565b60e088015295916132cd565b61355260e088015160c089015190612017565b613533565b82511561357c5761357660c084015160026126d88a60a08801516120ad565b946133b5565b61359460c084015160026126fb8a60a08801516120ad565b613576565b608082015160a0830151036135b3576080820151956133a4565b8151156136015760e08201516135d3610100840151604085015190611958565b906040840151633b9aca000390633b9aca0082116114a9576127ae612f05926135fb9461196b565b956133a4565b613615610100830151604084015190611958565b6040830151633b9aca0003633b9aca0081116114a957612c15612f6e916135fb9361196b565b600382016001600160401b036136518783611ff6565b90549060031b1c166040850152600186018087116114a9576001600160401b03612fb68261367e94611ff6565b90549060031b1c60070b60a084015260e08301516136a6610100850151606086015190611958565b906060850151633b9aca000391633b9aca0083116114a9576136cb926127ae9161196b565b60c0840152613376565b5090519094925015613711575f1982019182116114a9576136ff6123559260026117229601611ff6565b90549060031b1c60070b906003614690565b5f1982019182116114a95761372f6123559260046117229601611ff6565b90549060031b1c60070b90613408565b9395929450906001608060049286546001600160401b03811682526001600160401b038160401c1660208301526001600160401b0381841c16604083015260c01c6060820152019401920194929087949261328e565b8260038301613274565b92949350505061172293505f146137bc5760026136ff9101611fe4565b600461372f9101611fe4565b5060018514613206565b6003830154916131e2565b906040516137ea816115f5565b5f81525f60208201525f60408201525f60608201525f60808201525f60a08201525f60c08201525f60e08201525f6101008201526004600110156125a257600180825260208201819052838101545f5160206157ad5f395f51905f5254939092826001600160801b038616158015613ed1575b613ea95750855460281c80670de0b6b3a7640000810204670de0b6b3a764000014811517156114a9576b033b2e3c9fd0803ce80000006138de6138ea926001600160801b036001600160401b036138c0828c16670de0b6b3a7640000850261196b565b1699846138d18260801c8095611958565b0460e08801521690611958565b0460e083015190612017565b6101008201525f9481511515805f14613e9d578488018592915b6040519182602082549182815201915f5260205f20905f915b816003840110613e595794809387959361230d9361395b9854918b82821061292f57828210612912578282106128f55750106128e757500383611611565b915b6139b6575b50505115613998575f1983019283116114a9576139886123559360026117229701611ff6565b90549060031b1c60070b91614690565b5f1983019283116114a9576139886123559360046117229701611ff6565b9096905f1986018681116114a957881015613e5157825115613d9d578482016001600160401b036139e78a83611ff6565b90549060031b1c166040850152858901808a116114a9576001600160401b03613a1382613a2e94611ff6565b90549060031b1c16606086015260028401612bba8b82611ff6565b90549060031b1c60070b60a0840152613a51610100840151606085015190611958565b6060840151633b9aca000390633b9aca0082116114a957613a7591612c159161196b565b60c08401525b604083015180633b9aca00810204633b9aca0014811517156114a957633b9aca000203613cfb576080820151965b602083015115613cb95760c0830151955b848710613be957505050602081015186919015613b10579060a0613adf92015161205f565b6001600160ff1b03841684036114a957611722956124f6613b079261235596861b908561430c565b60070b91614690565b919350506001600160ff1b03831683036114a957613b40612535613b388760a085015161205f565b85851b611958565b905115613b9057613b579061255c61255787612099565b91613b6183614c20565b9460048310156125a257613b86612593600292611722986123559781800210016120ad565b0560070b91614690565b613b9f61255786939496612024565b9080821015613bbd57505090611722936002613b8661235594612077565b6125f990613bcf613bd5939594612077565b94612017565b93613b07612612611722966123559561205f565b95613bfc90613c15939995989298612017565b936020840151155f14613c80575060c083015190611b19565b946060820151633b9aca00810290808204633b9aca0014901517156114a957905f1981146114a9578251908501919015613c675784613c5d60e085015160c086015190611b19565b60e085015261395d565b84613c7b60e085015160c086015190612017565b613c5d565b835115613ca0576123559060026126d860c08701519260a08801516120ad565b6127059060026126fb60c08701519260a08801516120ad565b825115613cde57613cd860c084015160026126d88b60a08801516120ad565b95613aba565b613cf660c084015160026126fb8b60a08801516120ad565b613cd8565b608082015160a083015103613d1557608082015196613aa9565b815115613d635760e0820151613d35610100840151604085015190611958565b906040840151633b9aca000390633b9aca0082116114a9576127ae612f0592613d5d9461196b565b96613aa9565b613d77610100830151604084015190611958565b6040830151633b9aca0003633b9aca0081116114a957612c15612f6e91613d5d9361196b565b600382016001600160401b03613db38a83611ff6565b90549060031b1c166040850152858901808a116114a9576001600160401b03613ddf82613dfa94611ff6565b90549060031b1c16606086015260048401612bba8b82611ff6565b90549060031b1c60070b60a084015260e0830151613e22610100850151606086015190611958565b906060850151633b9aca000391633b9aca0083116114a957613e47926127ae9161196b565b60c0840152613a7b565b819750613962565b80546001600160401b038082168652604082811c82166020880152608083811c9092169087015260c09190911c60608601528b98940193600493909301920161391d565b60038801859291613904565b611722969395509193505015613ec55760026139889101611fe4565b60046139889101611fe4565b5083851461385d565b9060ff8091169116039060ff82116114a957565b60ff16604d81116114a957600a0a90565b9060ff8116806012115f14613f265750906127dd613f21611722936012613eda565b613eee565b60121015613f465790613f40613f21601261172294613eda565b90611958565b5090565b9060ff81166012811115613f6b5750906127dd613f21601261172294613eda565b60121115613f465790613f40613f21611722936012613eda565b908160209103126114a557516001600160a01b03811681036114a55790565b51906001600160801b03821682036114a557565b91908260409103126114a5576117226020613fd284613fa4565b9301613fa4565b613fe290614a2c565b600a859492939510156125a2576001841461403057906001600160801b036140178360208061401f9996518301019101613fb8565b501693614aca565b81929192811061402c5750565b9150565b5050505060206001600160a01b03614052838380600496518301019101613f85565b16604051928380927f5ade93550000000000000000000000000000000000000000000000000000000082525afa90811561149a575f91614090575090565b90506020813d6020116140b7575b816140ab60209383611611565b810103126114a5575190565b3d915061409e565b600111156125a257565b51906001600160a01b03821682036114a557565b805181016040828203126114a55760208201519160018310156114a5576040810151916001600160401b0383116114a55761411f926020809201920101611c6b565b90614129816140bf565b805f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d6020526001600160a01b0360405f20931692835f5260205260405f205461217857815161417c575b5050505f90565b614185816140bf565b15614191575b80614175565b6020818051810103126114a5576141b260206001600160a01b0392016140c9565b1690811561418b575f91604460209260405194859384927f65e4ad9e00000000000000000000000000000000000000000000000000000000845230600485015260248401525af190811561149a575f9161420a575090565b90506020813d60201161423a575b8161422560209383611611565b810103126114a5575180151581036114a55790565b3d9150614218565b6001600160801b03811161425c576001600160801b031690565b7f6dfcc650000000000000000000000000000000000000000000000000000000005f52608060045260245260445ffd5b906142a4816b033b2e3c9fd0803ce80000008461449b565b908015611975576b033b2e3c9fd0803ce80000006117229309151590611b19565b906142d58183633b9aca0061449b565b9080156119755761172292633b9aca0009151590611b19565b6142fb600260018361449b565b600260016117229309151590611b19565b9161431881838561449b565b918115611975576117229309151590611b19565b9061433c81633b9aca008461449b565b90801561197557633b9aca006117229309151590611b19565b614364633b9aca00838361449b565b9061172292633b9aca009109151590611b19565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000060208201526001600160a01b0392831660248201529290911660448301526064808301939093529181526118d2916143d5608483611611565b614b6d565b6143e390614bda565b3092916143ef816140bf565b156143f75750565b9091506020818051810103126114a55761441b60206001600160a01b0392016140c9565b1690565b9061442a5f92614bda565b90614434816140bf565b1561443c5750565b60049192506001600160a01b0361445d826020808095518301019101613f85565b16604051928380927fe8c9bee50000000000000000000000000000000000000000000000000000000082525afa90811561149a575f91614090575090565b91818302915f198185099383808610950394808603951461452b57848311156145135790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b505090611722925061196b565b61454190614a2c565b600a85949293969510156125a257600184146145ed5794614581939291614579876020806001600160801b039a518301019101613fb8565b971693614aca565b81939193670de0b6b3a764000092838202908282048514831517156114a9576001600160801b031684038481116114a9576145bc9084611958565b11156145dc57508184029184830414841517156114a9576117229161196b565b8190939293106145e95750565b9250565b5050505060406001600160a01b0361461084602080600497518301019101613f85565b168151938480927f4cb44a760000000000000000000000000000000000000000000000000000000082525afa91821561149a575f905f9361465057509190565b9250506040823d60401161467e575b8161466c60409383611611565b810103126114a5576020825192015190565b3d915061465f565b600411156125a257565b91909161469c81614686565b806147315750600781900b905f82126146f0575064e8d4a51000811015611a3157633b9aca00820291808304633b9aca0014901517156114a957633b9aca000180633b9aca00116114a9576117229161196b565b9050633b9aca00820291808304633b9aca0014901517156114a9576147149061494b565b60070b633b9aca0003633b9aca0081116114a9576117229161196b565b61473a81614686565b6001810361474c5750611722916149cf565b60029061475881614686565b036147665761172291614963565b600781900b905f821261479a5750633b8b87c0811015611a3157633b9aca0003633b9aca0081116114a9576117229161432c565b6147a4915061494b565b60070b633b9aca000180633b9aca00116114a9576117229161432c565b906001600160401b03809116911602906001600160401b0382169182036114a957565b91815192831561494357600193808280614909575b80156148c6575b6148b257505b80851061481f57505050505f1981019081116114a95790565b61483081861860011c828716611b19565b90821561488557614858633b9aca006001600160401b036148518589611e58565b51166147c1565b6001600160401b038086169116115b156148725750614806565b9450600181018091116114a95793614806565b61489f633b9aca006001600160401b036148518589611e58565b6001600160401b03808616911610614867565b9450505050505f1981019081116114a95790565b508215801561480057505f1981018181116114a957633b9aca006001600160401b036148516148f59389611e58565b6001600160401b0380861691161015614800565b505f1981018181116114a957633b9aca006001600160401b0361485161492f9389611e58565b6001600160401b03808616911611156147f9565b505050505f90565b60070b677fffffffffffffff1981146114a9575f0390565b90600781900b905f82126149a25750633b8b87c0811015611a3157633b9aca0003633b9aca0081116114a957633b9aca009161499e91611958565b0490565b6149ac915061494b565b60070b633b9aca000180633b9aca00116114a957633b9aca009161499e91611958565b90600781900b905f8212614a05575064e8d4a51000811015611a3157633b9aca000180633b9aca00116114a95761172291614355565b614a0f915061494b565b60070b633b9aca0003633b9aca0081116114a95761172291614355565b8051810160a082602083019203126114a5576020820151600a8110156114a557604083015193600a8510156114a55760608401516001600160401b0381116114a557836020614a7d92870101611c6b565b9360808101516001600160401b0381116114a557846020614aa092840101611c6b565b9360a0820151916001600160401b0383116114a557614ac29201602001611c6b565b919493929190565b939492614adb90614ae29392614dd8565b809461520a565b9280670de0b6b3a764000003670de0b6b3a764000081116114a957614b079084611958565b670de0b6b3a7640000850290858204670de0b6b3a764000014861517156114a95781119182614b3f575b5050614b3957565b91508091565b909150670de0b6b3a76400000180670de0b6b3a7640000116114a957614b659084611958565b115f80614b31565b905f602091828151910182855af11561149a575f513d614bd157506001600160a01b0381163b155b614b9c5750565b6001600160a01b03907f5274afe7000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b60011415614b95565b805181016040828203126114a55760208201519160018310156114a5576040810151916001600160401b0383116114a557614c1c926020809201920101611c6b565b9091565b600181111561172257806001700100000000000000000000000000000000831015614d43575b60048268010000000000000000614cf5941015614d36575b640100000000811015614d29575b62010000811015614d1c575b610100811015614d10575b6010811015614d04575b1015614cfc575b60030260011c614ca4818461196b565b0160011c614cb2818461196b565b0160011c614cc0818461196b565b0160011c614cce818461196b565b0160011c614cdc818461196b565b0160011c614cea818461196b565b0160011c809261196b565b8111900390565b60011b614c94565b811c9160021b91614c8d565b60081c91811b91614c83565b60101c9160081b91614c78565b60201c9160101b91614c6c565b60401c9160201b91614c5e565b5050608081901c68010000000000000000614c46565b6001600160401b0381116115c65760051b60200190565b9080601f830112156114a557815190614d8882614d59565b92614d966040519485611611565b82845260208085019360051b8201019182116114a557602001915b818310614dbe5750505090565b825160ff811681036114a557815260209283019201614db1565b600a8110156125a25780614fe4575090815182019160a081602085019403126114a55760208101516001600160401b0381116114a55781019280603f850112156114a5576020840151614e2a81614d59565b94614e386040519687611611565b8186526020808088019360051b83010101908382116114a557604001915b818310614fc45750505060408201516001600160401b0381116114a557820181603f820112156114a5576020810151614e8e81614d59565b91614e9c6040519384611611565b8183526020808085019360051b83010101908482116114a557604001915b818310614fa75750505060608301516001600160401b0381116114a557826020614ee692860101614d70565b9160808401516001600160401b0381116114a55760a0916020614f0b92870101614d70565b93015160028110156114a557670de0b6b3a7640000614f2e919694929596615621565b938351915f935b838510614f455750505050505090565b90919293949695614f9a6001916001600160a01b03614f64898c611e58565b511660ff614f728a87611e58565b511660ff614f808b89611e58565b51169163ffffffff614f928c8b611e58565b511693615660565b9697950193929190614f35565b825163ffffffff811681036114a557815260209283019201614eba565b82516001600160a01b03811681036114a557815260209283019201614e56565b60038103614ffa575050670de0b6b3a764000090565b60028103615010575050670de0b6b3a764000090565b60048103615063575050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561149a575f91614090575090565b600581036150a8575050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561149a575f91614090575090565b600681036150ed5750506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561149a575f91614090575090565b60078103615132575050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561149a575f91614090575090565b600881036151535750602081519181808201938492010103126114a5575190565b6009036151fd576040818051810103126114a557806020604061517f826001600160a01b0395016140c9565b920151916004604051809581937fa035b1fe000000000000000000000000000000000000000000000000000000008352165afa801561149a575f906151c9575b611722925061196b565b506020823d6020116151f5575b816151e360209383611611565b810103126114a55761172291516151bf565b3d91506151d6565b50670de0b6b3a764000090565b92919092600a8110156125a257806153db57508051810160a082602083019203126114a55760208201516001600160401b0381116114a55782019381603f860112156114a557602085015161525e81614d59565b9561526c6040519788611611565b8187526020808089019360051b83010101908482116114a557604001915b8183106153bb5750505060408301516001600160401b0381116114a55783019082603f830112156114a55760208201516152c381614d59565b926152d16040519485611611565b8184526020808086019360051b83010101908582116114a557604001915b81831061539e5750505060608401516001600160401b0381116114a55783602061531b92870101614d70565b9260808501516001600160401b0381116114a55760a091602061534092880101614d70565b9401519060028210156114a55761535b919694929596615621565b938351915f935b8385106153725750505050505090565b909192939496956153916001916001600160a01b03614f64898c611e58565b9697950193929190615362565b825163ffffffff811681036114a5578152602092830192016152ef565b82516001600160a01b03811681036114a55781526020928301920161528a565b91929091600381036153f657505050670de0b6b3a764000090565b600281036154045750905090565b6004810361545857505050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561149a575f91614090575090565b6005810361549e57505050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561149a575f91614090575090565b600681036154e4575050506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561149a575f91614090575090565b6007810361552a57505050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561149a575f91614090575090565b6008810361554c575050602081519181808201938492010103126114a5575190565b60090361557957506040818051810103126114a557806020604061517f826001600160a01b0395016140c9565b905090565b9091906155bd575080511561559557805190602001fd5b7fd6bda275000000000000000000000000000000000000000000000000000000005f5260045ffd5b9080511580615609575b6155ce5790565b7f9996b315000000000000000000000000000000000000000000000000000000005f526e22d473030f116ddee9f6b43ac78ba360045260245ffd5b506e22d473030f116ddee9f6b43ac78ba33b156155c7565b60028110156125a2576117225750670de0b6b3a764000090565b519069ffffffffffffffffffff821682036114a557565b604d81116114a957600a0a90565b91909360a06001600160a01b0394956004604051809781937ffeaf968c000000000000000000000000000000000000000000000000000000008352165afa90811561149a575f945f92615736575b505f85139182159261571a575b50506156f25760ff166001036156e2576156dc61172293926127dd92611958565b91615652565b6119bc90613f4061172294615652565b7fae193563000000000000000000000000000000000000000000000000000000005f5260045ffd5b63ffffffff91925061572c9042612017565b9116105f806156bb565b9450905060a0843d60a011615784575b8161575360a09383611611565b810103126114a5576157648461563b565b50602084015161577b60806060870151960161563b565b5093905f6156ae565b3d915061574656fe4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c754b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c76a26469706673582212208d4b2a0240f9148e30b24246f976cf72b9e329bdfeae4de065d0920b92563f6564736f6c634300081c0033", + "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f5f3560e01c80633b6a1fe014610ef15780634583aea614610e865780639525f3ab14610e6c578063b92567fa146107d6578063c10a62871461046a5763d92c6cb21461005c575f80fd5b346103195761006a3661164d565b61007982859697949895611c02565b91909261008685846119cd565b97881061045b5761009b918391888780611cb1565b600260ff5f51602061578d5f395f51905f525460a81c161461044c576100e7600160a91b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b83151580610443575b610130575b602087610128600160a81b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b604051908152f35b61015361014e5f5160206157ad5f395f51905f525460801c8961428c565b614242565b6001600160801b03835460281c91168091016001600160d81b03811161042f57835464ffffffffff1660289190911b64ffffffffff19161783556001600160801b035f5160206157ad5f395f51905f52546101b18160801c86611b26565b16016001600160801b03811161041b57610202906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b80518590156103cd578082602061025694519101826e22d473030f116ddee9f6b43ac78ba35af13d156103c5573d9061023a82611632565b916102486040519384611611565b82523d87602084013e61557e565b505b60ff815416610327575b506001600160a01b031691823b15610319576040516340c10f1960e01b81526001600160a01b038716600482015260248101869052818160448183885af1801561031c57610304575b50506001600160a01b0360209560405192835285878401521660408201527f73adcdbf2d8fee0c1221daefef436a92c3c640e97ff2941e744bf5eef1ab346f60606001600160a01b0333951692a45f80808080806100f5565b61030f828092611611565b61031957806102ab565b80fd5b6040513d84823e3d90fd5b610336600861033b920161188c565b614bda565b90610345816140bf565b61026257610364816020806001600160a01b0394518301019101613f85565b16803b156103c1578380916024604051809481936255f9e960e71b83528860048401525af180156103b65790849161039d575b50610262565b816103a791611611565b6103b257825f610397565b8280fd5b6040513d86823e3d90fd5b8380fd5b60609061557e565b5050805460ff161561040657610401836103f16103ec6008850161188c565b6143da565b336001600160a01b038916614378565b610258565b6104018330336001600160a01b038916614378565b602486634e487b7160e01b81526011600452fd5b602487634e487b7160e01b81526011600452fd5b508615156100f0565b6004856306fda65d60e31b8152fd5b60048663a1aabbe160e01b8152fd5b5034610319576104793661164d565b61048882859697949895611c02565b9190926104958584611bb8565b978089116107c757918391886104ab948b611cb1565b600260ff5f51602061578d5f395f51905f525460a81c161461044c576104f7600160a91b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b861515806107be575b61053757602087610128600160a81b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b61055561014e5f5160206157ad5f395f51905f525460801c8661428c565b6001600160801b03835460281c91168091016001600160d81b03811161042f57835464ffffffffff1660289190911b64ffffffffff19161783556001600160801b035f5160206157ad5f395f51905f52546105b38160801c86611b26565b16016001600160801b03811161041b57610604906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b8051859015610785578082602061063c94519101826e22d473030f116ddee9f6b43ac78ba35af13d156103c5573d9061023a82611632565b505b60ff8154166106ff575b506001600160a01b031691823b15610319576040516340c10f1960e01b81526001600160a01b038716600482015260248101839052818160448183885af1801561031c576106ea575b50506001600160a01b0360209560405192868452878401521660408201527f73adcdbf2d8fee0c1221daefef436a92c3c640e97ff2941e744bf5eef1ab346f60606001600160a01b0333951692a45f80808080806100f5565b6106f5828092611611565b6103195780610691565b610336600861070e920161188c565b90610718816140bf565b61064857610737816020806001600160a01b0394518301019101613f85565b16803b156103c1578380916024604051809481936255f9e960e71b83528b60048401525af180156103b657908491610770575b50610648565b8161077a91611611565b6103b257825f61076a565b5050805460ff16156107a9576107a4866103f16103ec6008850161188c565b61063e565b6107a48630336001600160a01b038916614378565b50831515610500565b6004876328ac195d60e21b8152fd5b5034610319576107f56107e83661151b565b8284959792939694611739565b9096908715610e5b576108088482611bb8565b965b8711610e4c576040516020986108208a83611611565b838252600260ff5f51602061578d5f395f51905f525460a81c1614610e3d5761086f600160a91b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b881590811580610e34575b6108b1575b8a8a610128600160a81b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b15610b8d57506108d561014e5f5160206157ad5f395f51905f525460801c8761428c565b6001600160801b03835460281c91168091016001600160d81b038111610b7957835464ffffffffff1660289190911b64ffffffffff19161783556001600160801b035f5160206157ad5f395f51905f52546109338160801c86611b26565b16016001600160801b038111610b6557610984906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b8051839015610b2c5780828b6109d694519101826e22d473030f116ddee9f6b43ac78ba35af13d156103c5573d906109bb82611632565b916109c96040519384611611565b82523d858c84013e61557e565b505b60ff815416610aa7575b506001600160a01b038516803b15610aa3576040516340c10f1960e01b81526001600160a01b0384166004820152602481018590529082908290604490829084905af1801561031c57610a8e575b50506001600160a01b03905b60405192868452878401521660408201527f73adcdbf2d8fee0c1221daefef436a92c3c640e97ff2941e744bf5eef1ab346f60606001600160a01b0380339616941692a45f808080808080808061087f565b610a99828092611611565b6103195780610a30565b5080fd5b6103366008610ab6920161188c565b90610ac0816140bf565b6109e257610ade8189806001600160a01b0394518301019101613f85565b16803b15610aa3578180916024604051809481936255f9e960e71b83528c60048401525af1801561031c57908291610b17575b506109e2565b81610b2191611611565b61031957805f610b11565b5050805460ff1615610b5057610b4b876103f16103ec6008850161188c565b6109d8565b610b4b8730336001600160a01b038916614378565b602484634e487b7160e01b81526011600452fd5b602485634e487b7160e01b81526011600452fd5b905060ff82548a1c16151580610e18575b610e09576b033b2e3c9fd0803ce80000008802908882046b033b2e3c9fd0803ce8000000141715610df55761014e610be8915f5160206157ad5f395f51905f525460801c9061196b565b6001600160801b03825460281c91168091036001600160d81b038111610b6557825464ffffffffff1660289190911b64ffffffffff19161782556001600160801b035f5160206157ad5f395f51905f525416036001600160801b038111610df557610c8a906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b6001600160a01b038516803b156103b2578280916044604051809481936315a38ec760e11b83528d60048401523360248401525af18015610dea57908391610dd5575b5050805460ff1615610d83576103366008610ce8920161188c565b90610cf2816140bf565b15610d08575b50506001600160a01b0390610a3c565b610d228189806001600160a01b0394518301019101613f85565b16803b15610aa357604051638bfb07c960e01b81526001600160a01b03878116600483015284166024820152604481018590529082908290606490829084905af1801561031c5715610cf857610d79828092611611565b6103195780610cf8565b505060405163a9059cbb60e01b878201526001600160a01b038281166024830152604482018490529190610dd090610dc881606481015b03601f198101835282611611565b838716614b6d565b610a3c565b81610ddf91611611565b610aa357815f610ccd565b6040513d85823e3d90fd5b602483634e487b7160e01b81526011600452fd5b600483630b094f2760e31b8152fd5b50610e2e84610e296006850161188c565b6140dd565b15610b9e565b5086151561087a565b6004846306fda65d60e31b8152fd5b6004826328ac195d60e21b8152fd5b610e66848288611b82565b9661080a565b5034610319576020610128610e8036611571565b916116e9565b503461031957610ea7602091610e9b36611571565b93919250834291611739565b929015610ed65750610ebc61012891836119cd565b91825f5160206157ad5f395f51905f525460801c91611b4f565b610ee4610eec928483611989565b928391611a0e565b610128565b50346114a557610f036107e83661151b565b909690871561150a57610f1684826119cd565b965b87106114fb57604051602098610f2e8a83611611565b5f8252600260ff5f51602061578d5f395f51905f525460a81c16146114ec57610f7d600160a91b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b8515908115806114e3575b610fbe578a8a610128600160a81b60ff60a81b195f51602061578d5f395f51905f525416175f51602061578d5f395f51905f5255565b156112535750610fe261014e5f5160206157ad5f395f51905f525460801c8a61428c565b6001600160801b03835460281c91168091016001600160d81b038111610b7957835464ffffffffff1660289190911b64ffffffffff19161783556001600160801b035f5160206157ad5f395f51905f52546110408160801c86611b26565b16016001600160801b038111610b6557611091906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b805183901561121a5780828b6110c894519101826e22d473030f116ddee9f6b43ac78ba35af13d156103c5573d906109bb82611632565b505b60ff815416611195575b506001600160a01b038516803b15610aa3576040516340c10f1960e01b81526001600160a01b0384166004820152602481018890529082908290604490829084905af1801561031c57611180575b50506001600160a01b03905b60405192835285878401521660408201527f73adcdbf2d8fee0c1221daefef436a92c3c640e97ff2941e744bf5eef1ab346f60606001600160a01b0380339616941692a45f808080808080808061087f565b61118b828092611611565b6103195780611122565b61033660086111a4920161188c565b906111ae816140bf565b6110d4576111cc8189806001600160a01b0394518301019101613f85565b16803b15610aa3578180916024604051809481936255f9e960e71b83528960048401525af1801561031c57908291611205575b506110d4565b8161120f91611611565b61031957805f6111ff565b5050805460ff161561123e57611239846103f16103ec6008850161188c565b6110ca565b6112398430336001600160a01b038916614378565b905060ff82548a1c161515806114cc575b6114bd576b033b2e3c9fd0803ce80000008502908582046b033b2e3c9fd0803ce80000001417156114a95761014e6112ae915f5160206157ad5f395f51905f525460801c9061196b565b6001600160801b03825460281c91168091036001600160d81b0381116114a957825464ffffffffff1660289190911b64ffffffffff19161782556001600160801b035f5160206157ad5f395f51905f525416036001600160801b0381116114a957611350906001600160801b03166fffffffffffffffffffffffffffffffff195f5160206157ad5f395f51905f525416175f5160206157ad5f395f51905f5255565b6001600160a01b038516803b156114a5575f80916044604051809481936315a38ec760e11b83528a60048401523360248401525af1801561149a57611485575b50805460ff16156114455761033660086113aa920161188c565b906113b4816140bf565b156113ca575b50506001600160a01b039061112e565b6113e48189806001600160a01b0394518301019101613f85565b16803b15610aa357604051638bfb07c960e01b81526001600160a01b03878116600483015284166024820152604481018890529082908290606490829084905af1801561031c57156113ba5761143b828092611611565b61031957806113ba565b505060405163a9059cbb60e01b878201526001600160a01b03828116602483015260448201879052919061148090610dc88160648101610dba565b61112e565b6114929192505f90611611565b5f905f611390565b6040513d5f823e3d90fd5b5f80fd5b634e487b7160e01b5f52601160045260245ffd5b630b094f2760e31b5f5260045ffd5b506114dd84610e296006850161188c565b15611264565b50891515610f88565b6306fda65d60e31b5f5260045ffd5b63a1aabbe160e01b5f5260045ffd5b611515848288611989565b96610f18565b60c09060031901126114a55760043590602435906044356001600160a01b03811681036114a557906064356001600160a01b03811681036114a557906084356001600160a01b03811681036114a5579060a43590565b60609060031901126114a557600435906024356001600160a01b03811681036114a557906044356001600160a01b03811681036114a55790565b606081019081106001600160401b038211176115c657604052565b634e487b7160e01b5f52604160045260245ffd5b604081019081106001600160401b038211176115c657604052565b61012081019081106001600160401b038211176115c657604052565b90601f801991011681019081106001600160401b038211176115c657604052565b6001600160401b0381116115c657601f01601f191660200190565b9060c06003198301126114a55760043591602435916044356001600160a01b03811681036114a557916064356001600160a01b03811681036114a557916084359160a4356001600160401b0381116114a557816023820112156114a5578060040135906116b982611632565b926116c76040519485611611565b828452602483830101116114a557815f92602460209301838601378301015290565b906116f690834291611739565b901561172557611722925061171d5f5160206157ad5f395f51905f525460801c8383611b4f565b611bb8565b90565b82611734838361172296611a0e565b611b82565b914211611864576001600160a01b035f51602061578d5f395f51905f525416806001600160a01b038416145f146117df57506117a691506001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460101c16156117b7575f91565b7f9e87fac8000000000000000000000000000000000000000000000000000000005f5260045ffd5b906001600160a01b0316145f1461183c5761182a906001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460081c16156117b757600191565b7f672215de000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fecdd1c29000000000000000000000000000000000000000000000000000000005f5260045ffd5b90604051915f8154908160011c926001831692831561194e575b60208510841461193a57848752869390811561191857506001146118d4575b506118d292500383611611565b565b90505f9291925260205f20905f915b8183106118fc5750509060206118d2928201015f6118c5565b60209193508060019154838589010152019101909184926118e3565b9050602092506118d294915060ff191682840152151560051b8201015f6118c5565b634e487b7160e01b5f52602260045260245ffd5b93607f16936118a6565b818102929181159184041417156114a957565b8115611975570490565b634e487b7160e01b5f52601260045260245ffd5b6119c16119b76119bc611722956119ae60ff956119a86005890161188c565b90611e80565b93909187612186565b611958565b61196b565b915460181c1690613eff565b906119e6906119b76119e16005850161188c565b613fd9565b9060ff815460181c166012019160ff83116114a95761172292611a0891613f4a565b906129d5565b909160ff835416159182159384611af9575b508315611a59575b505050611a3157565b7f11157667000000000000000000000000000000000000000000000000000000005f5260045ffd5b9192509082611a6d575b50505f8080611a28565b6001600160a01b039192506020906024604051809481937f70a08231000000000000000000000000000000000000000000000000000000008352306004840152165afa90811561149a575f91611ac7575b50105f80611a63565b90506020813d602011611af1575b81611ae260209383611611565b810103126114a557515f611abe565b3d9150611ad5565b82919450611b0c6008611b11920161188c565b61441f565b10925f611a20565b919082018092116114a957565b906b033b2e3c9fd0803ce8000000611b44600992845460281c611958565b0491015410611a3157565b916009916b033b2e3c9fd0803ce8000000611b71611b7893865460281c611958565b0490611b19565b91015410611a3157565b61172292611bad611b9c611bb2936119a86005870161188c565b91909260ff865460181c1690613f4a565b61449b565b90613186565b611bd1611bca6119e16005840161188c565b92826137dd565b91670de0b6b3a7640000830292808404670de0b6b3a764000014901517156114a9576119c160ff916117229461196b565b90421161186457611c43906001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b60ff815460081c16156117b7576001600160a01b035f51602061578d5f395f51905f52541691565b81601f820112156114a557805190611c8282611632565b92611c906040519485611611565b828452602083830101116114a557815f9260208093018386015e8301015290565b9492909360405190611cc2826115ab565b5f825260208201965f885260408301956060875260ff81541615155f14611e4f57611cfa6103ec60086001600160a01b03930161188c565b1683525b81518201936040838603126114a5576020830151966040840151956001600160401b0387116114a557611de99a6117229a6101449a611d51611e10986020809c816001600160a01b039801920101611c6b565b85528252826040519a611d638c6115da565b168a52888a0152519560405198611d798a6115ab565b89528789019687526040890193845251169260405193611d98856115da565b8452868401525193604051998a977f30f28b7a00000000000000000000000000000000000000000000000000000000888a0152602489019051602080916001600160a01b0381511684520151910152565b51606487015251608486015280516001600160a01b031660a48601526020015160c4850152565b3360e4840152610100610104840152805191829182610124860152018484015e5f838284010152601f801991011681010301601f198101835282611611565b50308352611cfe565b8051821015611e6c5760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b90915f91670de0b6b3a76400009360405190818260207f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775492838152017f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c775f5260205f20925f5b818110611fc2575050611efc92500383611611565b8151925f5b848110611f0f575050505050565b6001600160a01b03611f218286611e58565b51166001600160a01b03831614611faf57611f92611f8d6005611f876001600160a01b03611f4f868a611e58565b51166001600160a01b03165f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7a60205260405f2090565b0161188c565b614538565b90505b888110611fa6575b50600101611f01565b97506001611f9d565b9550611fba82614538565b969096611f95565b84546001600160a01b0316835260019485019487945060209093019201611ee7565b805415611e6c575f5260205f20905f90565b9190918054831015611e6c575f52601860205f208360021c019260031b1690565b919082039182116114a957565b905f82633b9aca00039212633b9aca008312811690633b9aca008413901516176114a957565b90633b9ac9ff1982019182136001166114a957565b81810392915f1380158285131691841216176114a957565b90633b9aca008201915f633b9aca00841291129080158216911516176114a957565b9081633b9aca00019182126001166114a957565b9190915f83820193841291129080158216911516176114a957565b5f908015612180578080600114612178576002146121715760016101338210166001600b83101617612163579060019060025b600181116121275750825f1904821161211357500290565b80634e487b7160e01b602492526011600452fd5b92805f1904811161214f5760018416612146575b80029260011c6120fb565b8092029161213b565b602482634e487b7160e01b81526011600452fd5b6002900a9190806121135750565b5050600490565b505050600190565b50505f90565b9060405190612194826115f5565b5f82525f60208301525f60408301525f60608301525f60808301525f60a08301525f60c08301525f60e08301525f6101008301526004600210156125a2575f80835260016020840181905290929091906129ca565b5f5160206157ad5f395f51905f5254946001600160801b0386161580156129c1575b6129985750855460281c80670de0b6b3a7640000810204670de0b6b3a764000014811517156114a9576b033b2e3c9fd0803ce800000061228c612298926001600160801b036001600160401b0361226e828c16670de0b6b3a7640000850261196b565b16998461227f8260801c8095611958565b0460e08901521690611958565b0460e084015190612017565b6101008301525f9482511515805f1461298c578288018392915b6040519182602082549182815201915f5260205f20905f915b8160038401106129485794809387959361230d936123129854918b82821061292f575b828210612912575b8282106128f5575b50106128e7575b500383611611565b6147e4565b915b612389575b5050905115905061235b575f1982019182116114a9576123426123559260026117229601611ff6565b90549060031b1c60070b905b6002614690565b90611b19565b5f1982019182116114a9576123796123559260046117229601611ff6565b90549060031b1c60070b9061234e565b91969094915f1983018381116114a9578610156128dc57835115612828578782016001600160401b036123bc8883611ff6565b90549060031b1c1660408601528887018088116114a9576001600160401b036123e88261241794611ff6565b90549060031b1c166060870152600284016124038982611ff6565b90549060031b1c60070b6080880152611ff6565b90549060031b1c60070b60a085015261243a610100850151606086015190611958565b6060850151633b9aca000390633b9aca0082116114a9576124699161245e9161196b565b60e086015190612017565b60c08501525b6040840151633b9aca00810290808204633b9aca0014901517156114a9570361274c576080830151945b60208401511561270a5760c0840151925b8584106126205750505060208201518490156125075760a06124ce9293015161205f565b926001600160ff1b03821682036114a9576124f6612355946124fc93611722981b908561430c565b906120ad565b60070b906002614690565b50506001600160ff1b03821682036114a95761254061253561252d8560a085015161205f565b84881b611958565b60c0830151906142c5565b9051156125b6576125619061255c61255785612099565b6120c8565b611b19565b61256a81614c20565b9060048610156125a2576125936123559460029361259893896117229a505081800210016120ad565b61204a565b0560070b9061234e565b634e487b7160e01b5f52602160045260245ffd5b9093506125c561255783612024565b90808210156125e257505061172292600261259861235593612077565b6125f9906125f36125fe9394612077565b93612017565b614c20565b92612617612612611722956123559461205f565b6142ee565b60070b9061234e565b959461264d92989361263491989298612017565b946020850151155f146126b8575060c084015190611b19565b946060830151633b9aca00810290808204633b9aca0014901517156114a957905f1981146114a957835190830191901561269f578261269560e086015160c087015190611b19565b60e0860152612314565b826126b360e086015160c087015190612017565b612695565b8451156126e2576123559060026126d860c08801519260a08901516120ad565b60070b05906149cf565b6127059060026126fb60c08801519260a08901516120ad565b60070b0590614963565b612355565b83511561272f5761272960c085015160026126d88960a08901516120ad565b926124aa565b61274760c085015160026126fb8960a08901516120ad565b612729565b608083015160a08401510361276657608083015194612499565b8251156127e95760e0830151612786610100850151604086015190611958565b906040850151633b9aca000390633b9aca0082116114a9576127ae6127b4926127e39461196b565b90612017565b6124f66080860151916127dd6127d2826119b78660a08c015161205f565b9160c0890151611b19565b9061196b565b94612499565b6127fd610100840151604085015190611958565b6040840151633b9aca0003633b9aca0081116114a95761245e612823916127e39361196b565b6127b4565b600382016001600160401b0361283e8883611ff6565b90549060031b1c1660408601528887018088116114a9576001600160401b0361286a8261288594611ff6565b90549060031b1c166060870152600484016124038982611ff6565b90549060031b1c60070b60a085015260e08401516128ad610100860151606087015190611958565b906060860151633b9aca000391633b9aca0083116114a9576128d2926127ae9161196b565b60c085015261246f565b819750829550612319565b60c01c81526020015f612305565b90936020906001600160401b038560801c1681520193018b6122fe565b90936020906001600160401b038560401c1681520193018b6122f6565b6001600160401b0384168552602090940193018b6122ee565b80546001600160401b038082168652604082811c82166020880152608083811c9092169087015260c09190911c6060860152899894019360049390930192016122cb565b600388018392916122b2565b92945050506117229391505f146129b55760026123429101611fe4565b60046123799101611fe4565b5081851461220b565b6003850154926121e9565b604051916129e2836115f5565b5f83525f60208401525f60408401525f60608401525f60808401525f60a08401525f60c08401525f60e08401525f61010084015260045f10156125a25760018084525f6020850152906001830154915f5160206157ad5f395f51905f5254906001600160801b038216908115801561317c575b6131535750845460281c670de0b6b3a76400008102818104670de0b6b3a764000014821517156114a957826b033b2e3c9fd0803ce80000009283612ab66001600160401b03612aaa612acd98612ac19761196b565b169760801c8093611958565b0460e08b0152611958565b0460e087015190612017565b6101008601525f9385511515805f146131495782600183015b604051928391602081549586815201905f5260205f20945f955b8160038801106130f35791612b4196859261230d9454918181106130d9575b8181106130bc575b81811061309f575b10613091575b509b97999b0383611611565b935b5f1987018781116114a95785101561302857825115612f7357600182016001600160401b03612b728783611ff6565b90549060031b1c166040850152600186018087116114a9576001600160401b03612b9f82612bce94611ff6565b90549060031b1c16606086015260028401612bba8882611ff6565b90549060031b1c60070b6080870152611ff6565b90549060031b1c60070b60a0840152612bf1610100840151606085015190611958565b6060840151633b9aca000390633b9aca0082116114a957612c2091612c159161196b565b60e085015190612017565b60c08401525b604083015180633b9aca00810204633b9aca0014811517156114a957633b9aca000203612ea3576080820151955b602083015115612e615760c0830151945b848610612d8f57505050602081015185919015612cbe579060a0612c8a92015161205f565b6001600160ff1b03831683036114a957611722946124f6612cb3926123559560011b908561430c565b60070b905b5f614690565b919250506001600160ff1b03821682036114a957612cef612535612ce68660a085015161205f565b8460011b611958565b905115612d3657612d069061255c61255786612099565b90612d1082614c20565b93612d2c612593600292611722976123559681800210016120ad565b0560070b90612cb8565b612d44612557859395612024565b9080821015612d61575050611722926002612d2c61235593612077565b6125f9906125f3612d729394612077565b92612d86612612611722956123559461205f565b60070b90612cb8565b929693612dbb92969195612da291612017565b936020880151155f14612e28575060c087015190611b19565b936060860151633b9aca00810290808204633b9aca0014901517156114a957915f1981146114a95760010193865115155f14612e1057612e0460e088015160c089015190611b19565b60e08801529591612b43565b612e2360e088015160c089015190612017565b612e04565b875115612e48576123559060026126d860c08b01519260a08c01516120ad565b6127059060026126fb60c08b01519260a08c01516120ad565b825115612e8657612e8060c084015160026126d88a60a08801516120ad565b94612c65565b612e9e60c084015160026126fb8a60a08801516120ad565b612e80565b608082015160a083015103612ebd57608082015195612c54565b815115612f345760e0820151612edd610100840151604085015190611958565b906040840151633b9aca000390633b9aca0082116114a9576127ae612f0592612f2e9461196b565b6124f66080850151916127dd612f23826119b78660a08b015161205f565b9160c0880151611b19565b95612c54565b612f48610100830151604084015190611958565b6040830151633b9aca0003633b9aca0081116114a957612c15612f6e91612f2e9361196b565b612f05565b600382016001600160401b03612f898783611ff6565b90549060031b1c166040850152600186018087116114a9576001600160401b03612fb682612fd194611ff6565b90549060031b1c16606086015260048401612bba8882611ff6565b90549060031b1c60070b60a084015260e0830151612ff9610100850151606086015190611958565b906060850151633b9aca000391633b9aca0083116114a95761301e926127ae9161196b565b60c0840152612c26565b5090519094925015613063575f1982019182116114a9576130526123559260026117229601611ff6565b90549060031b1c60070b905f614690565b5f1982019182116114a9576130816123559260046117229601611ff6565b90549060031b1c60070b90612cb8565b60c01c81526020015f612b35565b9260206001916001600160401b038560801c168152019301612b2f565b9260206001916001600160401b038560401c168152019301612b27565b9260206001916001600160401b0385168152019301612b1f565b9395929450906001608060049286546001600160401b03811682526001600160401b038160401c1660208301526001600160401b0381841c16604083015260c01c60608201520194019201949290879492612b00565b8260038301612ae6565b92949350505061172293505f146131705760026130529101611fe4565b60046130819101611fe4565b5060018514612a55565b60405191613193836115f5565b5f83525f60208401525f60408401525f60608401525f60808401525f60a08401525f60c08401525f60e08401525f6101008401526004600310156125a2575f80845260208401819052906137d2565b5f5160206157ad5f395f51905f5254906001600160801b03821690811580156137c8575b61379f5750845460281c670de0b6b3a76400008102818104670de0b6b3a764000014821517156114a957826b033b2e3c9fd0803ce80000009283612ab66001600160401b03612aaa61325b98612ac19761196b565b6101008601525f9385511515805f146137955782600183015b604051928391602081549586815201905f5260205f20945f955b81600388011061373f57916132cb96859261230d9454918181106130d9578181106130bc5781811061309f571061309157509b97999b0383611611565b935b5f1987018781116114a9578510156136d55782511561363b57600182016001600160401b036132fc8783611ff6565b90549060031b1c166040850152600186018087116114a9576001600160401b03612b9f8261332994611ff6565b90549060031b1c60070b60a084015261334c610100840151606085015190611958565b6060840151633b9aca000390633b9aca0082116114a95761337091612c159161196b565b60c08401525b604083015180633b9aca00810204633b9aca0014811517156114a957633b9aca000203613599576080820151955b6020830151156135575760c0830151945b8486106134d75750505060208101518591901561340f579060a06133da92015161205f565b6001600160ff1b03831683036114a957611722946124f6613403926123559560011b908561430c565b60070b905b6003614690565b919250506001600160ff1b03821682036114a957613437612535612ce68660a085015161205f565b90511561347e5761344e9061255c61255786612099565b9061345882614c20565b93613474612593600292611722976123559681800210016120ad565b0560070b90613408565b61348c612557859395612024565b90808210156134a957505061172292600261347461235593612077565b6125f9906125f36134ba9394612077565b926134ce612612611722956123559461205f565b60070b90613408565b9296936134ea92969195612da291612017565b936060860151633b9aca00810290808204633b9aca0014901517156114a957915f1981146114a95760010193865115155f1461353f5761353360e088015160c089015190611b19565b60e088015295916132cd565b61355260e088015160c089015190612017565b613533565b82511561357c5761357660c084015160026126d88a60a08801516120ad565b946133b5565b61359460c084015160026126fb8a60a08801516120ad565b613576565b608082015160a0830151036135b3576080820151956133a4565b8151156136015760e08201516135d3610100840151604085015190611958565b906040840151633b9aca000390633b9aca0082116114a9576127ae612f05926135fb9461196b565b956133a4565b613615610100830151604084015190611958565b6040830151633b9aca0003633b9aca0081116114a957612c15612f6e916135fb9361196b565b600382016001600160401b036136518783611ff6565b90549060031b1c166040850152600186018087116114a9576001600160401b03612fb68261367e94611ff6565b90549060031b1c60070b60a084015260e08301516136a6610100850151606086015190611958565b906060850151633b9aca000391633b9aca0083116114a9576136cb926127ae9161196b565b60c0840152613376565b5090519094925015613711575f1982019182116114a9576136ff6123559260026117229601611ff6565b90549060031b1c60070b906003614690565b5f1982019182116114a95761372f6123559260046117229601611ff6565b90549060031b1c60070b90613408565b9395929450906001608060049286546001600160401b03811682526001600160401b038160401c1660208301526001600160401b0381841c16604083015260c01c6060820152019401920194929087949261328e565b8260038301613274565b92949350505061172293505f146137bc5760026136ff9101611fe4565b600461372f9101611fe4565b5060018514613206565b6003830154916131e2565b906040516137ea816115f5565b5f81525f60208201525f60408201525f60608201525f60808201525f60a08201525f60c08201525f60e08201525f6101008201526004600110156125a257600180825260208201819052838101545f5160206157ad5f395f51905f5254939092826001600160801b038616158015613ed1575b613ea95750855460281c80670de0b6b3a7640000810204670de0b6b3a764000014811517156114a9576b033b2e3c9fd0803ce80000006138de6138ea926001600160801b036001600160401b036138c0828c16670de0b6b3a7640000850261196b565b1699846138d18260801c8095611958565b0460e08801521690611958565b0460e083015190612017565b6101008201525f9481511515805f14613e9d578488018592915b6040519182602082549182815201915f5260205f20905f915b816003840110613e595794809387959361230d9361395b9854918b82821061292f57828210612912578282106128f55750106128e757500383611611565b915b6139b6575b50505115613998575f1983019283116114a9576139886123559360026117229701611ff6565b90549060031b1c60070b91614690565b5f1983019283116114a9576139886123559360046117229701611ff6565b9096905f1986018681116114a957881015613e5157825115613d9d578482016001600160401b036139e78a83611ff6565b90549060031b1c166040850152858901808a116114a9576001600160401b03613a1382613a2e94611ff6565b90549060031b1c16606086015260028401612bba8b82611ff6565b90549060031b1c60070b60a0840152613a51610100840151606085015190611958565b6060840151633b9aca000390633b9aca0082116114a957613a7591612c159161196b565b60c08401525b604083015180633b9aca00810204633b9aca0014811517156114a957633b9aca000203613cfb576080820151965b602083015115613cb95760c0830151955b848710613be957505050602081015186919015613b10579060a0613adf92015161205f565b6001600160ff1b03841684036114a957611722956124f6613b079261235596861b908561430c565b60070b91614690565b919350506001600160ff1b03831683036114a957613b40612535613b388760a085015161205f565b85851b611958565b905115613b9057613b579061255c61255787612099565b91613b6183614c20565b9460048310156125a257613b86612593600292611722986123559781800210016120ad565b0560070b91614690565b613b9f61255786939496612024565b9080821015613bbd57505090611722936002613b8661235594612077565b6125f990613bcf613bd5939594612077565b94612017565b93613b07612612611722966123559561205f565b95613bfc90613c15939995989298612017565b936020840151155f14613c80575060c083015190611b19565b946060820151633b9aca00810290808204633b9aca0014901517156114a957905f1981146114a9578251908501919015613c675784613c5d60e085015160c086015190611b19565b60e085015261395d565b84613c7b60e085015160c086015190612017565b613c5d565b835115613ca0576123559060026126d860c08701519260a08801516120ad565b6127059060026126fb60c08701519260a08801516120ad565b825115613cde57613cd860c084015160026126d88b60a08801516120ad565b95613aba565b613cf660c084015160026126fb8b60a08801516120ad565b613cd8565b608082015160a083015103613d1557608082015196613aa9565b815115613d635760e0820151613d35610100840151604085015190611958565b906040840151633b9aca000390633b9aca0082116114a9576127ae612f0592613d5d9461196b565b96613aa9565b613d77610100830151604084015190611958565b6040830151633b9aca0003633b9aca0081116114a957612c15612f6e91613d5d9361196b565b600382016001600160401b03613db38a83611ff6565b90549060031b1c166040850152858901808a116114a9576001600160401b03613ddf82613dfa94611ff6565b90549060031b1c16606086015260048401612bba8b82611ff6565b90549060031b1c60070b60a084015260e0830151613e22610100850151606086015190611958565b906060850151633b9aca000391633b9aca0083116114a957613e47926127ae9161196b565b60c0840152613a7b565b819750613962565b80546001600160401b038082168652604082811c82166020880152608083811c9092169087015260c09190911c60608601528b98940193600493909301920161391d565b60038801859291613904565b611722969395509193505015613ec55760026139889101611fe4565b60046139889101611fe4565b5083851461385d565b9060ff8091169116039060ff82116114a957565b60ff16604d81116114a957600a0a90565b9060ff8116806012115f14613f265750906127dd613f21611722936012613eda565b613eee565b60121015613f465790613f40613f21601261172294613eda565b90611958565b5090565b9060ff81166012811115613f6b5750906127dd613f21601261172294613eda565b60121115613f465790613f40613f21611722936012613eda565b908160209103126114a557516001600160a01b03811681036114a55790565b51906001600160801b03821682036114a557565b91908260409103126114a5576117226020613fd284613fa4565b9301613fa4565b613fe290614a2c565b600a859492939510156125a2576001841461403057906001600160801b036140178360208061401f9996518301019101613fb8565b501693614aca565b81929192811061402c5750565b9150565b5050505060206001600160a01b03614052838380600496518301019101613f85565b16604051928380927f5ade93550000000000000000000000000000000000000000000000000000000082525afa90811561149a575f91614090575090565b90506020813d6020116140b7575b816140ab60209383611611565b810103126114a5575190565b3d915061409e565b600111156125a257565b51906001600160a01b03821682036114a557565b805181016040828203126114a55760208201519160018310156114a5576040810151916001600160401b0383116114a55761411f926020809201920101611c6b565b90614129816140bf565b805f527f4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c7d6020526001600160a01b0360405f20931692835f5260205260405f205461217857815161417c575b5050505f90565b614185816140bf565b15614191575b80614175565b6020818051810103126114a5576141b260206001600160a01b0392016140c9565b1690811561418b575f91604460209260405194859384927f65e4ad9e00000000000000000000000000000000000000000000000000000000845230600485015260248401525af190811561149a575f9161420a575090565b90506020813d60201161423a575b8161422560209383611611565b810103126114a5575180151581036114a55790565b3d9150614218565b6001600160801b03811161425c576001600160801b031690565b7f6dfcc650000000000000000000000000000000000000000000000000000000005f52608060045260245260445ffd5b906142a4816b033b2e3c9fd0803ce80000008461449b565b908015611975576b033b2e3c9fd0803ce80000006117229309151590611b19565b906142d58183633b9aca0061449b565b9080156119755761172292633b9aca0009151590611b19565b6142fb600260018361449b565b600260016117229309151590611b19565b9161431881838561449b565b918115611975576117229309151590611b19565b9061433c81633b9aca008461449b565b90801561197557633b9aca006117229309151590611b19565b614364633b9aca00838361449b565b9061172292633b9aca009109151590611b19565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000060208201526001600160a01b0392831660248201529290911660448301526064808301939093529181526118d2916143d5608483611611565b614b6d565b6143e390614bda565b3092916143ef816140bf565b156143f75750565b9091506020818051810103126114a55761441b60206001600160a01b0392016140c9565b1690565b9061442a5f92614bda565b90614434816140bf565b1561443c5750565b60049192506001600160a01b0361445d826020808095518301019101613f85565b16604051928380927fe8c9bee50000000000000000000000000000000000000000000000000000000082525afa90811561149a575f91614090575090565b91818302915f198185099383808610950394808603951461452b57848311156145135790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b505090611722925061196b565b61454190614a2c565b600a85949293969510156125a257600184146145ed5794614581939291614579876020806001600160801b039a518301019101613fb8565b971693614aca565b81939193670de0b6b3a764000092838202908282048514831517156114a9576001600160801b031684038481116114a9576145bc9084611958565b11156145dc57508184029184830414841517156114a9576117229161196b565b8190939293106145e95750565b9250565b5050505060406001600160a01b0361461084602080600497518301019101613f85565b168151938480927f4cb44a760000000000000000000000000000000000000000000000000000000082525afa91821561149a575f905f9361465057509190565b9250506040823d60401161467e575b8161466c60409383611611565b810103126114a5576020825192015190565b3d915061465f565b600411156125a257565b91909161469c81614686565b806147315750600781900b905f82126146f0575064e8d4a51000811015611a3157633b9aca00820291808304633b9aca0014901517156114a957633b9aca000180633b9aca00116114a9576117229161196b565b9050633b9aca00820291808304633b9aca0014901517156114a9576147149061494b565b60070b633b9aca0003633b9aca0081116114a9576117229161196b565b61473a81614686565b6001810361474c5750611722916149cf565b60029061475881614686565b036147665761172291614963565b600781900b905f821261479a5750633b8b87c0811015611a3157633b9aca0003633b9aca0081116114a9576117229161432c565b6147a4915061494b565b60070b633b9aca000180633b9aca00116114a9576117229161432c565b906001600160401b03809116911602906001600160401b0382169182036114a957565b91815192831561494357600193808280614909575b80156148c6575b6148b257505b80851061481f57505050505f1981019081116114a95790565b61483081861860011c828716611b19565b90821561488557614858633b9aca006001600160401b036148518589611e58565b51166147c1565b6001600160401b038086169116115b156148725750614806565b9450600181018091116114a95793614806565b61489f633b9aca006001600160401b036148518589611e58565b6001600160401b03808616911610614867565b9450505050505f1981019081116114a95790565b508215801561480057505f1981018181116114a957633b9aca006001600160401b036148516148f59389611e58565b6001600160401b0380861691161015614800565b505f1981018181116114a957633b9aca006001600160401b0361485161492f9389611e58565b6001600160401b03808616911611156147f9565b505050505f90565b60070b677fffffffffffffff1981146114a9575f0390565b90600781900b905f82126149a25750633b8b87c0811015611a3157633b9aca0003633b9aca0081116114a957633b9aca009161499e91611958565b0490565b6149ac915061494b565b60070b633b9aca000180633b9aca00116114a957633b9aca009161499e91611958565b90600781900b905f8212614a05575064e8d4a51000811015611a3157633b9aca000180633b9aca00116114a95761172291614355565b614a0f915061494b565b60070b633b9aca0003633b9aca0081116114a95761172291614355565b8051810160a082602083019203126114a5576020820151600a8110156114a557604083015193600a8510156114a55760608401516001600160401b0381116114a557836020614a7d92870101611c6b565b9360808101516001600160401b0381116114a557846020614aa092840101611c6b565b9360a0820151916001600160401b0383116114a557614ac29201602001611c6b565b919493929190565b939492614adb90614ae29392614dd8565b809461520a565b9280670de0b6b3a764000003670de0b6b3a764000081116114a957614b079084611958565b670de0b6b3a7640000850290858204670de0b6b3a764000014861517156114a95781119182614b3f575b5050614b3957565b91508091565b909150670de0b6b3a76400000180670de0b6b3a7640000116114a957614b659084611958565b115f80614b31565b905f602091828151910182855af11561149a575f513d614bd157506001600160a01b0381163b155b614b9c5750565b6001600160a01b03907f5274afe7000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b60011415614b95565b805181016040828203126114a55760208201519160018310156114a5576040810151916001600160401b0383116114a557614c1c926020809201920101611c6b565b9091565b600181111561172257806001700100000000000000000000000000000000831015614d43575b60048268010000000000000000614cf5941015614d36575b640100000000811015614d29575b62010000811015614d1c575b610100811015614d10575b6010811015614d04575b1015614cfc575b60030260011c614ca4818461196b565b0160011c614cb2818461196b565b0160011c614cc0818461196b565b0160011c614cce818461196b565b0160011c614cdc818461196b565b0160011c614cea818461196b565b0160011c809261196b565b8111900390565b60011b614c94565b811c9160021b91614c8d565b60081c91811b91614c83565b60101c9160081b91614c78565b60201c9160101b91614c6c565b60401c9160201b91614c5e565b5050608081901c68010000000000000000614c46565b6001600160401b0381116115c65760051b60200190565b9080601f830112156114a557815190614d8882614d59565b92614d966040519485611611565b82845260208085019360051b8201019182116114a557602001915b818310614dbe5750505090565b825160ff811681036114a557815260209283019201614db1565b600a8110156125a25780614fe4575090815182019160a081602085019403126114a55760208101516001600160401b0381116114a55781019280603f850112156114a5576020840151614e2a81614d59565b94614e386040519687611611565b8186526020808088019360051b83010101908382116114a557604001915b818310614fc45750505060408201516001600160401b0381116114a557820181603f820112156114a5576020810151614e8e81614d59565b91614e9c6040519384611611565b8183526020808085019360051b83010101908482116114a557604001915b818310614fa75750505060608301516001600160401b0381116114a557826020614ee692860101614d70565b9160808401516001600160401b0381116114a55760a0916020614f0b92870101614d70565b93015160028110156114a557670de0b6b3a7640000614f2e919694929596615621565b938351915f935b838510614f455750505050505090565b90919293949695614f9a6001916001600160a01b03614f64898c611e58565b511660ff614f728a87611e58565b511660ff614f808b89611e58565b51169163ffffffff614f928c8b611e58565b511693615660565b9697950193929190614f35565b825163ffffffff811681036114a557815260209283019201614eba565b82516001600160a01b03811681036114a557815260209283019201614e56565b60038103614ffa575050670de0b6b3a764000090565b60028103615010575050670de0b6b3a764000090565b60048103615063575050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561149a575f91614090575090565b600581036150a8575050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561149a575f91614090575090565b600681036150ed5750506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561149a575f91614090575090565b60078103615132575050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561149a575f91614090575090565b600881036151535750602081519181808201938492010103126114a5575190565b6009036151fd576040818051810103126114a557806020604061517f826001600160a01b0395016140c9565b920151916004604051809581937fa035b1fe000000000000000000000000000000000000000000000000000000008352165afa801561149a575f906151c9575b611722925061196b565b506020823d6020116151f5575b816151e360209383611611565b810103126114a55761172291516151bf565b3d91506151d6565b50670de0b6b3a764000090565b92919092600a8110156125a257806153db57508051810160a082602083019203126114a55760208201516001600160401b0381116114a55782019381603f860112156114a557602085015161525e81614d59565b9561526c6040519788611611565b8187526020808089019360051b83010101908482116114a557604001915b8183106153bb5750505060408301516001600160401b0381116114a55783019082603f830112156114a55760208201516152c381614d59565b926152d16040519485611611565b8184526020808086019360051b83010101908582116114a557604001915b81831061539e5750505060608401516001600160401b0381116114a55783602061531b92870101614d70565b9260808501516001600160401b0381116114a55760a091602061534092880101614d70565b9401519060028210156114a55761535b919694929596615621565b938351915f935b8385106153725750505050505090565b909192939496956153916001916001600160a01b03614f64898c611e58565b9697950193929190615362565b825163ffffffff811681036114a5578152602092830192016152ef565b82516001600160a01b03811681036114a55781526020928301920161528a565b91929091600381036153f657505050670de0b6b3a764000090565b600281036154045750905090565b6004810361545857505050604051630f451f7160e31b8152670de0b6b3a7640000600482015260208160248173ae7ab96520de3a18e5e111b5eaab095312d7fe845afa90811561149a575f91614090575090565b6005810361549e57505050604051633ba0b9a960e01b815260208160048173be9895146f7af43049ca1c1ae358b0541ea497045afa90811561149a575f91614090575090565b600681036154e4575050506040516339aa885b60e21b815260208160048173ae78736cd615f374d3085123a210448e74fc63935afa90811561149a575f91614090575090565b6007810361552a57505050604051634ca9858360e11b815260208160048173ac3e018457b222d93114458476f3e3416abbe38f5afa90811561149a575f91614090575090565b6008810361554c575050602081519181808201938492010103126114a5575190565b60090361557957506040818051810103126114a557806020604061517f826001600160a01b0395016140c9565b905090565b9091906155bd575080511561559557805190602001fd5b7fd6bda275000000000000000000000000000000000000000000000000000000005f5260045ffd5b9080511580615609575b6155ce5790565b7f9996b315000000000000000000000000000000000000000000000000000000005f526e22d473030f116ddee9f6b43ac78ba360045260245ffd5b506e22d473030f116ddee9f6b43ac78ba33b156155c7565b60028110156125a2576117225750670de0b6b3a764000090565b519069ffffffffffffffffffff821682036114a557565b604d81116114a957600a0a90565b91909360a06001600160a01b0394956004604051809781937ffeaf968c000000000000000000000000000000000000000000000000000000008352165afa90811561149a575f945f92615736575b505f85139182159261571a575b50506156f25760ff166001036156e2576156dc61172293926127dd92611958565b91615652565b6119bc90613f4061172294615652565b7fae193563000000000000000000000000000000000000000000000000000000005f5260045ffd5b63ffffffff91925061572c9042612017565b9116105f806156bb565b9450905060a0843d60a011615784575b8161575360a09383611611565b810103126114a5576157648461563b565b50602084015161577b60806060870151960161563b565b5093905f6156ae565b3d915061574656fe4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c754b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c76a26469706673582212208d4b2a0240f9148e30b24246f976cf72b9e329bdfeae4de065d0920b92563f6564736f6c634300081c0033", + "devdoc": { + "author": "Cooper Labs", + "custom:contact": "security@cooperlabs.xyz", + "details": "In all the functions of this contract, one of `tokenIn` or `tokenOut` must be the stablecoin, and one of `tokenOut` or `tokenIn` must be an accepted collateral. Depending on the `tokenIn` or `tokenOut` given, the functions will either handle a mint or a burn operationIn case of a burn, they will also revert if the system does not have enough of `amountOut` for `tokenOut`. This balance must be available either directly on the contract or, when applicable, through the underlying strategies that manage the collateralFunctions here may be paused for some collateral assets (for either mint or burn), in which case they'll revertIn case of a burn again, the swap functions will revert if the call concerns a collateral that requires a whitelist but the `to` address does not have it. The quote functions will not revert in this case.Calling one of the swap functions in a burn case does not require any prior token approvalThis contract is an authorized fork of Angle's `Swapper` contract https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/transmuter/facets/Swapper.sol", + "errors": { + "AddressEmptyCode(address)": [ + { + "details": "There's no code at `target` (it is not a contract)." + } + ], + "FailedCall()": [ + { + "details": "A call to an address target failed. The target may have reverted." + } + ], + "InsufficientBalance(uint256,uint256)": [ + { + "details": "The ETH balance of the account is not enough to perform the operation." + } + ], + "SafeCastOverflowedUintDowncast(uint8,uint256)": [ + { + "details": "Value doesn't fit in an uint of `bits` size." + } + ], + "SafeERC20FailedOperation(address)": [ + { + "details": "An operation with an ERC-20 token failed." + } + ] + }, + "kind": "dev", + "methods": { + "swapExactInput(uint256,uint256,address,address,address,uint256)": { + "details": "`msg.sender` must have approved this contract for at least `amountIn` for `tokenIn` for mint transactions", + "params": { + "amountIn": "Amount of `tokenIn` to bring", + "amountOutMin": "Minimum amount of `tokenOut` to get: if `amountOut` is inferior to this amount, the function will revert", + "deadline": "Timestamp before which the transaction must be executed", + "to": "Address to which `tokenOut` must be sent", + "tokenIn": "Token to bring for the swap", + "tokenOut": "Token to get out of the swap" + }, + "returns": { + "amountOut": "Amount of `tokenOut` obtained through the swap" + } + }, + "swapExactInputWithPermit(uint256,uint256,address,address,uint256,bytes)": { + "details": "Can only be used to mint, hence `tokenOut` is not needed" + }, + "swapExactOutput(uint256,uint256,address,address,address,uint256)": { + "details": "`msg.sender` must have approved this contract for an amount bigger than what `amountIn` will be before calling this function for a mint. Approving the contract for `tokenIn` with `amountInMax` will always be enough in this case", + "params": { + "amountInMax": "Maximum amount of `tokenIn` to bring in order to get `amountOut` of `tokenOut`", + "amountOut": "Amount of `tokenOut` to obtain from the swap", + "deadline": "Timestamp before which the transaction must be executed", + "to": "Address to which `tokenOut` must be sent", + "tokenIn": "Token to bring for the swap", + "tokenOut": "Token to get out of the swap" + }, + "returns": { + "amountIn": "Amount of `tokenIn` used to perform the swap" + } + }, + "swapExactOutputWithPermit(uint256,uint256,address,address,uint256,bytes)": { + "details": "Can only be used to mint, hence `tokenOut` is not needed" + } + }, + "title": "Swapper", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "quoteIn(uint256,address,address)": { + "notice": "Simulates what a call to `swapExactInput` with `amountIn` of `tokenIn` for `tokenOut` would give. If called right before and at the same block, the `amountOut` outputted by this function is exactly the amount that will be obtained with `swapExactInput`" + }, + "quoteOut(uint256,address,address)": { + "notice": "Simulates what a call to `swapExactOutput` for `amountOut` of `tokenOut` with `tokenIn` would give. If called right before and at the same block, the `amountIn` outputted by this function is exactly the amount that will be obtained with `swapExactOutput`" + }, + "swapExactInput(uint256,uint256,address,address,address,uint256)": { + "notice": "Swaps (that is to say mints or burns) an exact amount of `tokenIn` for an amount of `tokenOut`" + }, + "swapExactInputWithPermit(uint256,uint256,address,address,uint256,bytes)": { + "notice": "Same as `swapExactInput`, but using Permit2 signatures for `tokenIn`" + }, + "swapExactOutput(uint256,uint256,address,address,address,uint256)": { + "notice": "Swaps (that is to say mints or burns) an amount of `tokenIn` for an exact amount of `tokenOut`" + }, + "swapExactOutputWithPermit(uint256,uint256,address,address,uint256,bytes)": { + "notice": "Same as `swapExactOutput`, but using Permit2 signatures for `tokenIn`" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/solcInputs/0e89febeebc7444140de8e67c9067d2c.json b/deployments/sepolia/solcInputs/0e89febeebc7444140de8e67c9067d2c.json new file mode 100644 index 0000000..6eb5ed9 --- /dev/null +++ b/deployments/sepolia/solcInputs/0e89febeebc7444140de8e67c9067d2c.json @@ -0,0 +1,80 @@ +{ + "language": "Solidity", + "sources": { + "solc_0.8/openzeppelin/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor (address initialOwner) {\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "solc_0.8/openzeppelin/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n\n constructor (address initialOwner) Ownable(initialOwner) {}\n\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n TransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view virtual returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(Address.isContract(IBeacon(newBeacon).implementation()), \"ERC1967: beacon implementation is not a contract\");\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "solc_0.8/openzeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "solc_0.8/openzeppelin/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract OptimizedTransparentUpgradeableProxy is ERC1967Proxy {\n address internal immutable _ADMIN;\n\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _ADMIN = admin_;\n\n // still store it to work with EIP-1967\n bytes32 slot = _ADMIN_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, admin_)\n }\n emit AdminChanged(address(0), admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n\n function _getAdmin() internal view virtual override returns (address) {\n return _ADMIN;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate that the this implementation remains valid after an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/UpgradeableBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n\n constructor(address implementation_, address initialOwner) Ownable(initialOwner) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/BeaconProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/BeaconProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../Proxy.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the proxy with `beacon`.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\n * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity\n * constructor.\n *\n * Requirements:\n *\n * - `beacon` must be a contract with the interface {IBeacon}.\n */\n constructor(address beacon, bytes memory data) payable {\n assert(_BEACON_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.beacon\")) - 1));\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 999999 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/solcInputs/9d44d918681c9ad36f866ebee034a3d1.json b/deployments/sepolia/solcInputs/9d44d918681c9ad36f866ebee034a3d1.json new file mode 100644 index 0000000..5a22e0c --- /dev/null +++ b/deployments/sepolia/solcInputs/9d44d918681c9ad36f866ebee034a3d1.json @@ -0,0 +1,307 @@ +{ + "language": "Solidity", + "sources": { + "@helpers/RouterSwapper.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\nimport { SafeERC20, IERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @title Swapper\n/// @author Angle Labs, Inc.\n/// @dev Abstract contract for swapping tokens using a router/aggregator\n/// @dev This contract is an authorized fork of Angle's `RouterSwapper` contract\n/// https://github.com/AngleProtocol/utils/blob/main/src/RouterSwapper.sol\nabstract contract RouterSwapper {\n using SafeERC20 for IERC20;\n\n /*//////////////////////////////////////////////////////////////\n ERRORS\n //////////////////////////////////////////////////////////////*/\n\n error SwapError();\n error ZeroAddress();\n\n /*//////////////////////////////////////////////////////////////\n EVENTS\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @notice Event emitted when the swap router is updated\n */\n event SwapRouterUpdated(address newSwapRouter);\n /**\n * @notice Event emitted when the token proxy is updated\n */\n event TokenTransferAddressUpdated(address newTokenTransferAddress);\n\n /*//////////////////////////////////////////////////////////////\n MODIFIERS\n //////////////////////////////////////////////////////////////*/\n\n modifier noZeroAddress(address targetAddress) {\n if (targetAddress == address(0)) {\n revert ZeroAddress();\n }\n _;\n }\n\n /*//////////////////////////////////////////////////////////////\n MUTABLE VARIABLES\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @notice address of the router/aggregator\n */\n address public swapRouter;\n /**\n * @notice address to approve to transfer tokens to\n */\n address public tokenTransferAddress;\n\n /*//////////////////////////////////////////////////////////////\n CONSTRUCTOR\n //////////////////////////////////////////////////////////////*/\n\n constructor(address initialSwapRouter, address initialTokenTransferAddress) {\n swapRouter = initialSwapRouter;\n tokenTransferAddress = initialTokenTransferAddress;\n }\n\n /*//////////////////////////////////////////////////////////////\n ADMIN FUNCTIONS\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @notice Set the router/aggregator address\n * @param newSwapRouter address of the new router/aggregator\n */\n function setSwapRouter(address newSwapRouter) public virtual noZeroAddress(newSwapRouter) {\n swapRouter = newSwapRouter;\n\n emit SwapRouterUpdated(newSwapRouter);\n }\n\n /**\n * @notice Set the token transfer address\n * @param newTokenTransferAddress address of the new token transfer address\n */\n function setTokenTransferAddress(address newTokenTransferAddress)\n public\n virtual\n noZeroAddress(newTokenTransferAddress)\n {\n tokenTransferAddress = newTokenTransferAddress;\n\n emit TokenTransferAddressUpdated(newTokenTransferAddress);\n }\n\n /*//////////////////////////////////////////////////////////////\n SWAP FUNCTIONS\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @notice Approve the router/aggregator to spend the token if needed\n * @param token address of the token to approve\n * @param spender address of the router/aggregator\n * @param amount amount to approve\n */\n function _approveTokenIfNeeded(address token, address spender, uint256 amount) internal {\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance < amount) {\n IERC20(token).safeIncreaseAllowance(spender, amount - allowance);\n }\n }\n\n /**\n * @notice Perform the swap using the router/aggregator\n * @param callData bytes to call the router/aggregator\n */\n function _performRouterSwap(bytes memory callData) internal {\n (bool success, bytes memory retData) = swapRouter.call(callData);\n\n if (!success) {\n if (retData.length != 0) {\n assembly (\"memory-safe\") {\n revert(add(32, retData), mload(retData))\n }\n }\n revert SwapError();\n }\n }\n\n /**\n * @notice Swap tokens using the router/aggregator\n * @param tokens array of tokens to swap\n * @param callDatas array of bytes to call the router/aggregator\n * @param amounts array of amounts to swap\n */\n function _swapCalldata(address[] calldata tokens, bytes[] calldata callDatas, uint256[] calldata amounts) internal {\n uint256 length = tokens.length;\n for (uint256 i; i < length; ++i) {\n _approveTokenIfNeeded(tokens[i], tokenTransferAddress, amounts[i]);\n _performRouterSwap(callDatas[i]);\n }\n }\n\n /**\n * @notice Swap tokens using the router/aggregator\n * @param tokens array of tokens to swap\n * @param callDatas array of bytes to call the router/aggregator\n * @param amounts array of amounts to swap\n */\n function _swap(address[] memory tokens, bytes[] memory callDatas, uint256[] memory amounts) internal {\n uint256 length = tokens.length;\n for (uint256 i; i < length; ++i) {\n _approveTokenIfNeeded(tokens[i], tokenTransferAddress, amounts[i]);\n _performRouterSwap(callDatas[i]);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Storage of the initializable contract.\n *\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n * when using with upgradeable contracts.\n *\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n */\n struct InitializableStorage {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n uint64 _initialized;\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool _initializing;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n /**\n * @dev The contract is already initialized.\n */\n error InvalidInitialization();\n\n /**\n * @dev The contract is not initializing.\n */\n error NotInitializing();\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint64 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n * production.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n // Cache values to avoid duplicated sloads\n bool isTopLevelCall = !$._initializing;\n uint64 initialized = $._initialized;\n\n // Allowed calls:\n // - initialSetup: the contract is not in the initializing state and no previous version was\n // initialized\n // - construction: the contract is initialized at version 1 (no reininitialization) and the\n // current contract is just being deployed\n bool initialSetup = initialized == 0 && isTopLevelCall;\n bool construction = initialized == 1 && address(this).code.length == 0;\n\n if (!initialSetup && !construction) {\n revert InvalidInitialization();\n }\n $._initialized = 1;\n if (isTopLevelCall) {\n $._initializing = true;\n }\n _;\n if (isTopLevelCall) {\n $._initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint64 version) {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing || $._initialized >= version) {\n revert InvalidInitialization();\n }\n $._initialized = version;\n $._initializing = true;\n _;\n $._initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n _checkInitializing();\n _;\n }\n\n /**\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n */\n function _checkInitializing() internal view virtual {\n if (!_isInitializing()) {\n revert NotInitializing();\n }\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing) {\n revert InvalidInitialization();\n }\n if ($._initialized != type(uint64).max) {\n $._initialized = type(uint64).max;\n emit Initialized(type(uint64).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint64) {\n return _getInitializableStorage()._initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _getInitializableStorage()._initializing;\n }\n\n /**\n * @dev Returns a pointer to the storage namespace.\n */\n // solhint-disable-next-line var-name-mixedcase\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n assembly {\n $.slot := INITIALIZABLE_STORAGE\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.22;\n\nimport {IERC1822Proxiable} from \"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\nimport {Initializable} from \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable __self = address(this);\n\n /**\n * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\n * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\n * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\n * If the getter returns `\"5.0.0\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\n * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\n * during an upgrade.\n */\n string public constant UPGRADE_INTERFACE_VERSION = \"5.0.0\";\n\n /**\n * @dev The call is from an unauthorized context.\n */\n error UUPSUnauthorizedCallContext();\n\n /**\n * @dev The storage `slot` is unsupported as a UUID.\n */\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n _checkProxy();\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n _checkNotDelegated();\n _;\n }\n\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual notDelegated returns (bytes32) {\n return ERC1967Utils.IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n *\n * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data);\n }\n\n /**\n * @dev Reverts if the execution is not performed via delegatecall or the execution\n * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\n * See {_onlyProxy}.\n */\n function _checkProxy() internal view virtual {\n if (\n address(this) == __self || // Must be called through delegatecall\n ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\n ) {\n revert UUPSUnauthorizedCallContext();\n }\n }\n\n /**\n * @dev Reverts if the execution is performed via delegatecall.\n * See {notDelegated}.\n */\n function _checkNotDelegated() internal view virtual {\n if (address(this) != __self) {\n // Must not be called through delegatecall\n revert UUPSUnauthorizedCallContext();\n }\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\n *\n * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\n * is expected to be the implementation slot in ERC-1967.\n *\n * Emits an {IERC1967-Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\n revert UUPSUnsupportedProxiableUUID(slot);\n }\n ERC1967Utils.upgradeToAndCall(newImplementation, data);\n } catch {\n // The implementation is not UUPS\n revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {ContextUpgradeable} from \"../../utils/ContextUpgradeable.sol\";\nimport {IERC20Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC-20\n * applications.\n */\nabstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {\n /// @custom:storage-location erc7201:openzeppelin.storage.ERC20\n struct ERC20Storage {\n mapping(address account => uint256) _balances;\n\n mapping(address account => mapping(address spender => uint256)) _allowances;\n\n uint256 _totalSupply;\n\n string _name;\n string _symbol;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC20\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;\n\n function _getERC20Storage() private pure returns (ERC20Storage storage $) {\n assembly {\n $.slot := ERC20StorageLocation\n }\n }\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n ERC20Storage storage $ = _getERC20Storage();\n $._name = name_;\n $._symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n ERC20Storage storage $ = _getERC20Storage();\n return $._name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n ERC20Storage storage $ = _getERC20Storage();\n return $._symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n ERC20Storage storage $ = _getERC20Storage();\n return $._totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual returns (uint256) {\n ERC20Storage storage $ = _getERC20Storage();\n return $._balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `value`.\n */\n function transfer(address to, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual returns (uint256) {\n ERC20Storage storage $ = _getERC20Storage();\n return $._allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Skips emitting an {Approval} event indicating an allowance update. This is not\n * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `value`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `value`.\n */\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, value);\n _transfer(from, to, value);\n return true;\n }\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n if (to == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(from, to, value);\n }\n\n /**\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n * this function.\n *\n * Emits a {Transfer} event.\n */\n function _update(address from, address to, uint256 value) internal virtual {\n ERC20Storage storage $ = _getERC20Storage();\n if (from == address(0)) {\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\n $._totalSupply += value;\n } else {\n uint256 fromBalance = $._balances[from];\n if (fromBalance < value) {\n revert ERC20InsufficientBalance(from, fromBalance, value);\n }\n unchecked {\n // Overflow not possible: value <= fromBalance <= totalSupply.\n $._balances[from] = fromBalance - value;\n }\n }\n\n if (to == address(0)) {\n unchecked {\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n $._totalSupply -= value;\n }\n } else {\n unchecked {\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n $._balances[to] += value;\n }\n }\n\n emit Transfer(from, to, value);\n }\n\n /**\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n * Relies on the `_update` mechanism\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(address(0), account, value);\n }\n\n /**\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n * Relies on the `_update` mechanism.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead\n */\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n _update(account, address(0), value);\n }\n\n /**\n * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n /**\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n *\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n * `Approval` event during `transferFrom` operations.\n *\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n * true using the following override:\n *\n * ```solidity\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n * super._approve(owner, spender, value, true);\n * }\n * ```\n *\n * Requirements are the same as {_approve}.\n */\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n ERC20Storage storage $ = _getERC20Storage();\n if (owner == address(0)) {\n revert ERC20InvalidApprover(address(0));\n }\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n $._allowances[owner][spender] = value;\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `value`.\n *\n * Does not update the allowance value in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Does not emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance < type(uint256).max) {\n if (currentAllowance < value) {\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n }\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/ERC4626.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {ERC20Upgradeable} from \"../ERC20Upgradeable.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {IERC4626} from \"@openzeppelin/contracts/interfaces/IERC4626.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {Initializable} from \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC-4626 \"Tokenized Vault Standard\" as defined in\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\n *\n * This extension allows the minting and burning of \"shares\" (represented using the ERC-20 inheritance) in exchange for\n * underlying \"assets\" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends\n * the ERC-20 standard. Any additional extensions included along it would affect the \"shares\" token represented by this\n * contract and not the \"assets\" token which is an independent contract.\n *\n * [CAUTION]\n * ====\n * In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning\n * with a \"donation\" to the vault that inflates the price of a share. This is variously known as a donation or inflation\n * attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial\n * deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may\n * similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by\n * verifying the amount received is as expected, using a wrapper that performs these checks such as\n * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].\n *\n * Since v4.9, this implementation introduces configurable virtual assets and shares to help developers mitigate that risk.\n * The `_decimalsOffset()` corresponds to an offset in the decimal representation between the underlying asset's decimals\n * and the vault decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which\n * itself determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default\n * offset (0) makes it non-profitable even if an attacker is able to capture value from multiple user deposits, as a result\n * of the value being captured by the virtual shares (out of the attacker's donation) matching the attacker's expected gains.\n * With a larger offset, the attack becomes orders of magnitude more expensive than it is profitable. More details about the\n * underlying math can be found xref:erc4626.adoc#inflation-attack[here].\n *\n * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued\n * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets\n * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience\n * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the\n * `_convertToShares` and `_convertToAssets` functions.\n *\n * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].\n * ====\n */\nabstract contract ERC4626Upgradeable is Initializable, ERC20Upgradeable, IERC4626 {\n using Math for uint256;\n\n /// @custom:storage-location erc7201:openzeppelin.storage.ERC4626\n struct ERC4626Storage {\n IERC20 _asset;\n uint8 _underlyingDecimals;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC4626\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant ERC4626StorageLocation = 0x0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00;\n\n function _getERC4626Storage() private pure returns (ERC4626Storage storage $) {\n assembly {\n $.slot := ERC4626StorageLocation\n }\n }\n\n /**\n * @dev Attempted to deposit more assets than the max amount for `receiver`.\n */\n error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max);\n\n /**\n * @dev Attempted to mint more shares than the max amount for `receiver`.\n */\n error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max);\n\n /**\n * @dev Attempted to withdraw more assets than the max amount for `receiver`.\n */\n error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max);\n\n /**\n * @dev Attempted to redeem more shares than the max amount for `receiver`.\n */\n error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max);\n\n /**\n * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC-20 or ERC-777).\n */\n function __ERC4626_init(IERC20 asset_) internal onlyInitializing {\n __ERC4626_init_unchained(asset_);\n }\n\n function __ERC4626_init_unchained(IERC20 asset_) internal onlyInitializing {\n ERC4626Storage storage $ = _getERC4626Storage();\n (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);\n $._underlyingDecimals = success ? assetDecimals : 18;\n $._asset = asset_;\n }\n\n /**\n * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.\n */\n function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool ok, uint8 assetDecimals) {\n (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(\n abi.encodeCall(IERC20Metadata.decimals, ())\n );\n if (success && encodedDecimals.length >= 32) {\n uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));\n if (returnedDecimals <= type(uint8).max) {\n return (true, uint8(returnedDecimals));\n }\n }\n return (false, 0);\n }\n\n /**\n * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This\n * \"original\" value is cached during construction of the vault contract. If this read operation fails (e.g., the\n * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.\n *\n * See {IERC20Metadata-decimals}.\n */\n function decimals() public view virtual override(IERC20Metadata, ERC20Upgradeable) returns (uint8) {\n ERC4626Storage storage $ = _getERC4626Storage();\n return $._underlyingDecimals + _decimalsOffset();\n }\n\n /** @dev See {IERC4626-asset}. */\n function asset() public view virtual returns (address) {\n ERC4626Storage storage $ = _getERC4626Storage();\n return address($._asset);\n }\n\n /** @dev See {IERC4626-totalAssets}. */\n function totalAssets() public view virtual returns (uint256) {\n ERC4626Storage storage $ = _getERC4626Storage();\n return $._asset.balanceOf(address(this));\n }\n\n /** @dev See {IERC4626-convertToShares}. */\n function convertToShares(uint256 assets) public view virtual returns (uint256) {\n return _convertToShares(assets, Math.Rounding.Floor);\n }\n\n /** @dev See {IERC4626-convertToAssets}. */\n function convertToAssets(uint256 shares) public view virtual returns (uint256) {\n return _convertToAssets(shares, Math.Rounding.Floor);\n }\n\n /** @dev See {IERC4626-maxDeposit}. */\n function maxDeposit(address) public view virtual returns (uint256) {\n return type(uint256).max;\n }\n\n /** @dev See {IERC4626-maxMint}. */\n function maxMint(address) public view virtual returns (uint256) {\n return type(uint256).max;\n }\n\n /** @dev See {IERC4626-maxWithdraw}. */\n function maxWithdraw(address owner) public view virtual returns (uint256) {\n return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);\n }\n\n /** @dev See {IERC4626-maxRedeem}. */\n function maxRedeem(address owner) public view virtual returns (uint256) {\n return balanceOf(owner);\n }\n\n /** @dev See {IERC4626-previewDeposit}. */\n function previewDeposit(uint256 assets) public view virtual returns (uint256) {\n return _convertToShares(assets, Math.Rounding.Floor);\n }\n\n /** @dev See {IERC4626-previewMint}. */\n function previewMint(uint256 shares) public view virtual returns (uint256) {\n return _convertToAssets(shares, Math.Rounding.Ceil);\n }\n\n /** @dev See {IERC4626-previewWithdraw}. */\n function previewWithdraw(uint256 assets) public view virtual returns (uint256) {\n return _convertToShares(assets, Math.Rounding.Ceil);\n }\n\n /** @dev See {IERC4626-previewRedeem}. */\n function previewRedeem(uint256 shares) public view virtual returns (uint256) {\n return _convertToAssets(shares, Math.Rounding.Floor);\n }\n\n /** @dev See {IERC4626-deposit}. */\n function deposit(uint256 assets, address receiver) public virtual returns (uint256) {\n uint256 maxAssets = maxDeposit(receiver);\n if (assets > maxAssets) {\n revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);\n }\n\n uint256 shares = previewDeposit(assets);\n _deposit(_msgSender(), receiver, assets, shares);\n\n return shares;\n }\n\n /** @dev See {IERC4626-mint}. */\n function mint(uint256 shares, address receiver) public virtual returns (uint256) {\n uint256 maxShares = maxMint(receiver);\n if (shares > maxShares) {\n revert ERC4626ExceededMaxMint(receiver, shares, maxShares);\n }\n\n uint256 assets = previewMint(shares);\n _deposit(_msgSender(), receiver, assets, shares);\n\n return assets;\n }\n\n /** @dev See {IERC4626-withdraw}. */\n function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {\n uint256 maxAssets = maxWithdraw(owner);\n if (assets > maxAssets) {\n revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);\n }\n\n uint256 shares = previewWithdraw(assets);\n _withdraw(_msgSender(), receiver, owner, assets, shares);\n\n return shares;\n }\n\n /** @dev See {IERC4626-redeem}. */\n function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {\n uint256 maxShares = maxRedeem(owner);\n if (shares > maxShares) {\n revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);\n }\n\n uint256 assets = previewRedeem(shares);\n _withdraw(_msgSender(), receiver, owner, assets, shares);\n\n return assets;\n }\n\n /**\n * @dev Internal conversion function (from assets to shares) with support for rounding direction.\n */\n function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {\n return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);\n }\n\n /**\n * @dev Internal conversion function (from shares to assets) with support for rounding direction.\n */\n function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256) {\n return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);\n }\n\n /**\n * @dev Deposit/mint common workflow.\n */\n function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {\n ERC4626Storage storage $ = _getERC4626Storage();\n // If _asset is ERC-777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the\n // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,\n // calls the vault, which is assumed not malicious.\n //\n // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the\n // assets are transferred and before the shares are minted, which is a valid state.\n // slither-disable-next-line reentrancy-no-eth\n SafeERC20.safeTransferFrom($._asset, caller, address(this), assets);\n _mint(receiver, shares);\n\n emit Deposit(caller, receiver, assets, shares);\n }\n\n /**\n * @dev Withdraw/redeem common workflow.\n */\n function _withdraw(\n address caller,\n address receiver,\n address owner,\n uint256 assets,\n uint256 shares\n ) internal virtual {\n ERC4626Storage storage $ = _getERC4626Storage();\n if (caller != owner) {\n _spendAllowance(owner, caller, shares);\n }\n\n // If _asset is ERC-777, `transfer` can trigger a reentrancy AFTER the transfer happens through the\n // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,\n // calls the vault, which is assumed not malicious.\n //\n // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the\n // shares are burned and after the assets are transferred, which is a valid state.\n _burn(owner, shares);\n SafeERC20.safeTransfer($._asset, receiver, assets);\n\n emit Withdraw(caller, receiver, owner, assets, shares);\n }\n\n function _decimalsOffset() internal view virtual returns (uint8) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/access/manager/AuthorityUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAuthority} from \"./IAuthority.sol\";\n\nlibrary AuthorityUtils {\n /**\n * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\n * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\n * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\n */\n function canCallWithDelay(\n address authority,\n address caller,\n address target,\n bytes4 selector\n ) internal view returns (bool immediate, uint32 delay) {\n (bool success, bytes memory data) = authority.staticcall(\n abi.encodeCall(IAuthority.canCall, (caller, target, selector))\n );\n if (success) {\n if (data.length >= 0x40) {\n (immediate, delay) = abi.decode(data, (bool, uint32));\n } else if (data.length >= 0x20) {\n immediate = abi.decode(data, (bool));\n }\n }\n return (immediate, delay);\n }\n}\n" + }, + "@openzeppelin/contracts/access/manager/IAccessManaged.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAccessManaged.sol)\n\npragma solidity ^0.8.20;\n\ninterface IAccessManaged {\n /**\n * @dev Authority that manages this contract was updated.\n */\n event AuthorityUpdated(address authority);\n\n error AccessManagedUnauthorized(address caller);\n error AccessManagedRequiredDelay(address caller, uint32 delay);\n error AccessManagedInvalidAuthority(address authority);\n\n /**\n * @dev Returns the current authority.\n */\n function authority() external view returns (address);\n\n /**\n * @dev Transfers control to a new authority. The caller must be the current authority.\n */\n function setAuthority(address) external;\n\n /**\n * @dev Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is\n * being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs\n * attacker controlled calls.\n */\n function isConsumingScheduledOp() external view returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/access/manager/IAccessManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/IAccessManager.sol)\n\npragma solidity ^0.8.20;\n\nimport {Time} from \"../../utils/types/Time.sol\";\n\ninterface IAccessManager {\n /**\n * @dev A delayed operation was scheduled.\n */\n event OperationScheduled(\n bytes32 indexed operationId,\n uint32 indexed nonce,\n uint48 schedule,\n address caller,\n address target,\n bytes data\n );\n\n /**\n * @dev A scheduled operation was executed.\n */\n event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\n\n /**\n * @dev A scheduled operation was canceled.\n */\n event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\n\n /**\n * @dev Informational labelling for a roleId.\n */\n event RoleLabel(uint64 indexed roleId, string label);\n\n /**\n * @dev Emitted when `account` is granted `roleId`.\n *\n * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\n * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\n * otherwise it indicates the execution delay for this account and roleId is updated.\n */\n event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\n\n /**\n * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\n */\n event RoleRevoked(uint64 indexed roleId, address indexed account);\n\n /**\n * @dev Role acting as admin over a given `roleId` is updated.\n */\n event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\n\n /**\n * @dev Role acting as guardian over a given `roleId` is updated.\n */\n event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\n\n /**\n * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\n */\n event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\n\n /**\n * @dev Target mode is updated (true = closed, false = open).\n */\n event TargetClosed(address indexed target, bool closed);\n\n /**\n * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\n */\n event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\n\n /**\n * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\n */\n event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\n\n error AccessManagerAlreadyScheduled(bytes32 operationId);\n error AccessManagerNotScheduled(bytes32 operationId);\n error AccessManagerNotReady(bytes32 operationId);\n error AccessManagerExpired(bytes32 operationId);\n error AccessManagerLockedRole(uint64 roleId);\n error AccessManagerBadConfirmation();\n error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\n error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\n error AccessManagerUnauthorizedConsume(address target);\n error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\n error AccessManagerInvalidInitialAdmin(address initialAdmin);\n\n /**\n * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\n * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\n * & {execute} workflow.\n *\n * This function is usually called by the targeted contract to control immediate execution of restricted functions.\n * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\n * previously set delay (not zero), then the function should return false and the caller should schedule the operation\n * for future execution.\n *\n * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\n * the operation can be executed if and only if delay is greater than 0.\n *\n * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\n * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\n * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\n *\n * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\n * {AccessManager} documentation.\n */\n function canCall(\n address caller,\n address target,\n bytes4 selector\n ) external view returns (bool allowed, uint32 delay);\n\n /**\n * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\n *\n * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\n * disabling any scheduling usage.\n */\n function expiration() external view returns (uint32);\n\n /**\n * @dev Minimum setback for all delay updates, with the exception of execution delays. It\n * can be increased without setback (and reset via {revokeRole} in the case event of an\n * accidental increase). Defaults to 5 days.\n */\n function minSetback() external view returns (uint32);\n\n /**\n * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\n *\n * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\n */\n function isTargetClosed(address target) external view returns (bool);\n\n /**\n * @dev Get the role required to call a function.\n */\n function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\n\n /**\n * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\n */\n function getTargetAdminDelay(address target) external view returns (uint32);\n\n /**\n * @dev Get the id of the role that acts as an admin for the given role.\n *\n * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\n * an operation that is restricted to this role.\n */\n function getRoleAdmin(uint64 roleId) external view returns (uint64);\n\n /**\n * @dev Get the role that acts as a guardian for a given role.\n *\n * The guardian permission allows canceling operations that have been scheduled under the role.\n */\n function getRoleGuardian(uint64 roleId) external view returns (uint64);\n\n /**\n * @dev Get the role current grant delay.\n *\n * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\n * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\n */\n function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\n\n /**\n * @dev Get the access details for a given account for a given role. These details include the timepoint at which\n * membership becomes active, and the delay applied to all operation by this user that requires this permission\n * level.\n *\n * Returns:\n * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\n * [1] Current execution delay for the account.\n * [2] Pending execution delay for the account.\n * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\n */\n function getAccess(\n uint64 roleId,\n address account\n ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\n\n /**\n * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\n * permission might be associated with an execution delay. {getAccess} can provide more details.\n */\n function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\n\n /**\n * @dev Give a label to a role, for improved role discoverability by UIs.\n *\n * Requirements:\n *\n * - the caller must be a global admin\n *\n * Emits a {RoleLabel} event.\n */\n function labelRole(uint64 roleId, string calldata label) external;\n\n /**\n * @dev Add `account` to `roleId`, or change its execution delay.\n *\n * This gives the account the authorization to call any function that is restricted to this role. An optional\n * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\n * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\n * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\n *\n * If the account has already been granted this role, the execution delay will be updated. This update is not\n * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\n * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\n * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\n *\n * Requirements:\n *\n * - the caller must be an admin for the role (see {getRoleAdmin})\n * - granted role must not be the `PUBLIC_ROLE`\n *\n * Emits a {RoleGranted} event.\n */\n function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\n\n /**\n * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\n * no effect.\n *\n * Requirements:\n *\n * - the caller must be an admin for the role (see {getRoleAdmin})\n * - revoked role must not be the `PUBLIC_ROLE`\n *\n * Emits a {RoleRevoked} event if the account had the role.\n */\n function revokeRole(uint64 roleId, address account) external;\n\n /**\n * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\n * the role this call has no effect.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * Emits a {RoleRevoked} event if the account had the role.\n */\n function renounceRole(uint64 roleId, address callerConfirmation) external;\n\n /**\n * @dev Change admin role for a given role.\n *\n * Requirements:\n *\n * - the caller must be a global admin\n *\n * Emits a {RoleAdminChanged} event\n */\n function setRoleAdmin(uint64 roleId, uint64 admin) external;\n\n /**\n * @dev Change guardian role for a given role.\n *\n * Requirements:\n *\n * - the caller must be a global admin\n *\n * Emits a {RoleGuardianChanged} event\n */\n function setRoleGuardian(uint64 roleId, uint64 guardian) external;\n\n /**\n * @dev Update the delay for granting a `roleId`.\n *\n * Requirements:\n *\n * - the caller must be a global admin\n *\n * Emits a {RoleGrantDelayChanged} event.\n */\n function setGrantDelay(uint64 roleId, uint32 newDelay) external;\n\n /**\n * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\n *\n * Requirements:\n *\n * - the caller must be a global admin\n *\n * Emits a {TargetFunctionRoleUpdated} event per selector.\n */\n function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\n\n /**\n * @dev Set the delay for changing the configuration of a given target contract.\n *\n * Requirements:\n *\n * - the caller must be a global admin\n *\n * Emits a {TargetAdminDelayUpdated} event.\n */\n function setTargetAdminDelay(address target, uint32 newDelay) external;\n\n /**\n * @dev Set the closed flag for a contract.\n *\n * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\n *\n * Requirements:\n *\n * - the caller must be a global admin\n *\n * Emits a {TargetClosed} event.\n */\n function setTargetClosed(address target, bool closed) external;\n\n /**\n * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\n * operation is not yet scheduled, has expired, was executed, or was canceled.\n */\n function getSchedule(bytes32 id) external view returns (uint48);\n\n /**\n * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\n * been scheduled.\n */\n function getNonce(bytes32 id) external view returns (uint32);\n\n /**\n * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\n * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\n * required for the caller. The special value zero will automatically set the earliest possible time.\n *\n * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\n * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\n * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\n *\n * Emits a {OperationScheduled} event.\n *\n * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\n * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\n * contract if it is using standard Solidity ABI encoding.\n */\n function schedule(\n address target,\n bytes calldata data,\n uint48 when\n ) external returns (bytes32 operationId, uint32 nonce);\n\n /**\n * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\n * execution delay is 0.\n *\n * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\n * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\n *\n * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\n */\n function execute(address target, bytes calldata data) external payable returns (uint32);\n\n /**\n * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\n * operation that is cancelled.\n *\n * Requirements:\n *\n * - the caller must be the proposer, a guardian of the targeted function, or a global admin\n *\n * Emits a {OperationCanceled} event.\n */\n function cancel(address caller, address target, bytes calldata data) external returns (uint32);\n\n /**\n * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\n * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\n *\n * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\n * with all the verifications that it implies.\n *\n * Emit a {OperationExecuted} event.\n */\n function consumeScheduledOp(address caller, bytes calldata data) external;\n\n /**\n * @dev Hashing function for delayed operations.\n */\n function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\n\n /**\n * @dev Changes the authority of a target managed by this manager instance.\n *\n * Requirements:\n *\n * - the caller must be a global admin\n */\n function updateAuthority(address target, address newAuthority) external;\n}\n" + }, + "@openzeppelin/contracts/access/manager/IAuthority.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard interface for permissioning originally defined in Dappsys.\n */\ninterface IAuthority {\n /**\n * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\n */\n function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1363.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @title IERC1363\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\n *\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\n */\ninterface IERC1363 is IERC20, IERC165 {\n /*\n * Note: the ERC-165 identifier for this interface is 0xb0202a11.\n * 0xb0202a11 ===\n * bytes4(keccak256('transferAndCall(address,uint256)')) ^\n * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\n * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\n * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\n * bytes4(keccak256('approveAndCall(address,uint256)')) ^\n * bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\n */\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferAndCall(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @param data Additional data with no specified format, sent in call to `to`.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param from The address which you want to send tokens from.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param from The address which you want to send tokens from.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @param data Additional data with no specified format, sent in call to `to`.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n * @param spender The address which will spend the funds.\n * @param value The amount of tokens to be spent.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function approveAndCall(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n * @param spender The address which will spend the funds.\n * @param value The amount of tokens to be spent.\n * @param data Additional data with no specified format, sent in call to `spender`.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC1967.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC3156FlashBorrower.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC3156FlashBorrower.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-3156 FlashBorrower, as defined in\n * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].\n */\ninterface IERC3156FlashBorrower {\n /**\n * @dev Receive a flash loan.\n * @param initiator The initiator of the loan.\n * @param token The loan currency.\n * @param amount The amount of tokens lent.\n * @param fee The additional amount of tokens to repay.\n * @param data Arbitrary data structure, intended to contain user-defined parameters.\n * @return The keccak256 hash of \"ERC3156FlashBorrower.onFlashLoan\"\n */\n function onFlashLoan(\n address initiator,\n address token,\n uint256 amount,\n uint256 fee,\n bytes calldata data\n ) external returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC3156FlashLender.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC3156FlashLender.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC3156FlashBorrower} from \"./IERC3156FlashBorrower.sol\";\n\n/**\n * @dev Interface of the ERC-3156 FlashLender, as defined in\n * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].\n */\ninterface IERC3156FlashLender {\n /**\n * @dev The amount of currency available to be lended.\n * @param token The loan currency.\n * @return The amount of `token` that can be borrowed.\n */\n function maxFlashLoan(address token) external view returns (uint256);\n\n /**\n * @dev The fee to be charged for a given loan.\n * @param token The loan currency.\n * @param amount The amount of tokens lent.\n * @return The amount of `token` to be charged for the loan, on top of the returned principal.\n */\n function flashFee(address token, uint256 amount) external view returns (uint256);\n\n /**\n * @dev Initiate a flash loan.\n * @param receiver The receiver of the tokens in the loan, and the receiver of the callback.\n * @param token The loan currency.\n * @param amount The amount of tokens lent.\n * @param data Arbitrary data structure, intended to contain user-defined parameters.\n */\n function flashLoan(\n IERC3156FlashBorrower receiver,\n address token,\n uint256 amount,\n bytes calldata data\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC4626.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4626.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"../token/ERC20/extensions/IERC20Metadata.sol\";\n\n/**\n * @dev Interface of the ERC-4626 \"Tokenized Vault Standard\", as defined in\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\n */\ninterface IERC4626 is IERC20, IERC20Metadata {\n event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\n\n event Withdraw(\n address indexed sender,\n address indexed receiver,\n address indexed owner,\n uint256 assets,\n uint256 shares\n );\n\n /**\n * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\n *\n * - MUST be an ERC-20 token contract.\n * - MUST NOT revert.\n */\n function asset() external view returns (address assetTokenAddress);\n\n /**\n * @dev Returns the total amount of the underlying asset that is “managed” by Vault.\n *\n * - SHOULD include any compounding that occurs from yield.\n * - MUST be inclusive of any fees that are charged against assets in the Vault.\n * - MUST NOT revert.\n */\n function totalAssets() external view returns (uint256 totalManagedAssets);\n\n /**\n * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\n * scenario where all the conditions are met.\n *\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n * - MUST NOT show any variations depending on the caller.\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n * - MUST NOT revert.\n *\n * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n * from.\n */\n function convertToShares(uint256 assets) external view returns (uint256 shares);\n\n /**\n * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\n * scenario where all the conditions are met.\n *\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n * - MUST NOT show any variations depending on the caller.\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n * - MUST NOT revert.\n *\n * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n * from.\n */\n function convertToAssets(uint256 shares) external view returns (uint256 assets);\n\n /**\n * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\n * through a deposit call.\n *\n * - MUST return a limited value if receiver is subject to some deposit limit.\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\n * - MUST NOT revert.\n */\n function maxDeposit(address receiver) external view returns (uint256 maxAssets);\n\n /**\n * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\n * current on-chain conditions.\n *\n * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\n * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\n * in the same transaction.\n * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\n * deposit would be accepted, regardless if the user has enough tokens approved, etc.\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n * - MUST NOT revert.\n *\n * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n */\n function previewDeposit(uint256 assets) external view returns (uint256 shares);\n\n /**\n * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\n *\n * - MUST emit the Deposit event.\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n * deposit execution, and are accounted for during deposit.\n * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\n * approving enough underlying tokens to the Vault contract, etc).\n *\n * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n */\n function deposit(uint256 assets, address receiver) external returns (uint256 shares);\n\n /**\n * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\n * - MUST return a limited value if receiver is subject to some mint limit.\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\n * - MUST NOT revert.\n */\n function maxMint(address receiver) external view returns (uint256 maxShares);\n\n /**\n * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\n * current on-chain conditions.\n *\n * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\n * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\n * same transaction.\n * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\n * would be accepted, regardless if the user has enough tokens approved, etc.\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n * - MUST NOT revert.\n *\n * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\n * share price or some other type of condition, meaning the depositor will lose assets by minting.\n */\n function previewMint(uint256 shares) external view returns (uint256 assets);\n\n /**\n * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\n *\n * - MUST emit the Deposit event.\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\n * execution, and are accounted for during mint.\n * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\n * approving enough underlying tokens to the Vault contract, etc).\n *\n * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n */\n function mint(uint256 shares, address receiver) external returns (uint256 assets);\n\n /**\n * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\n * Vault, through a withdraw call.\n *\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n * - MUST NOT revert.\n */\n function maxWithdraw(address owner) external view returns (uint256 maxAssets);\n\n /**\n * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\n * given current on-chain conditions.\n *\n * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\n * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\n * called\n * in the same transaction.\n * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\n * the withdrawal would be accepted, regardless if the user has enough shares, etc.\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n * - MUST NOT revert.\n *\n * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n */\n function previewWithdraw(uint256 assets) external view returns (uint256 shares);\n\n /**\n * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\n *\n * - MUST emit the Withdraw event.\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n * withdraw execution, and are accounted for during withdraw.\n * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\n * not having enough shares, etc).\n *\n * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n * Those methods should be performed separately.\n */\n function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\n\n /**\n * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\n * through a redeem call.\n *\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\n * - MUST NOT revert.\n */\n function maxRedeem(address owner) external view returns (uint256 maxShares);\n\n /**\n * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\n * given current on-chain conditions.\n *\n * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\n * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\n * same transaction.\n * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\n * redemption would be accepted, regardless if the user has enough shares, etc.\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n * - MUST NOT revert.\n *\n * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\n * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\n */\n function previewRedeem(uint256 shares) external view returns (uint256 assets);\n\n /**\n * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\n *\n * - MUST emit the Withdraw event.\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n * redeem execution, and are accounted for during redeem.\n * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\n * not having enough shares, etc).\n *\n * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n * Those methods should be performed separately.\n */\n function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {UpgradeableBeacon} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.22;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {IERC1967} from \"../../interfaces/IERC1967.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This library provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\n */\nlibrary ERC1967Utils {\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1.\n */\n // solhint-disable-next-line private-vars-leading-underscore\n bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev The `implementation` of the proxy is invalid.\n */\n error ERC1967InvalidImplementation(address implementation);\n\n /**\n * @dev The `admin` of the proxy is invalid.\n */\n error ERC1967InvalidAdmin(address admin);\n\n /**\n * @dev The `beacon` of the proxy is invalid.\n */\n error ERC1967InvalidBeacon(address beacon);\n\n /**\n * @dev An upgrade function sees `msg.value > 0` that may be lost.\n */\n error ERC1967NonPayable();\n\n /**\n * @dev Returns the current implementation address.\n */\n function getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the ERC-1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n if (newImplementation.code.length == 0) {\n revert ERC1967InvalidImplementation(newImplementation);\n }\n StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Performs implementation upgrade with additional setup call if data is nonempty.\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n * to avoid stuck value in the contract.\n *\n * Emits an {IERC1967-Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) internal {\n _setImplementation(newImplementation);\n emit IERC1967.Upgraded(newImplementation);\n\n if (data.length > 0) {\n Address.functionDelegateCall(newImplementation, data);\n } else {\n _checkNonPayable();\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1.\n */\n // solhint-disable-next-line private-vars-leading-underscore\n bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\n * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the ERC-1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n if (newAdmin == address(0)) {\n revert ERC1967InvalidAdmin(address(0));\n }\n StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {IERC1967-AdminChanged} event.\n */\n function changeAdmin(address newAdmin) internal {\n emit IERC1967.AdminChanged(getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is the keccak-256 hash of \"eip1967.proxy.beacon\" subtracted by 1.\n */\n // solhint-disable-next-line private-vars-leading-underscore\n bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the ERC-1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n if (newBeacon.code.length == 0) {\n revert ERC1967InvalidBeacon(newBeacon);\n }\n\n StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n address beaconImplementation = IBeacon(newBeacon).implementation();\n if (beaconImplementation.code.length == 0) {\n revert ERC1967InvalidImplementation(beaconImplementation);\n }\n }\n\n /**\n * @dev Change the beacon and trigger a setup call if data is nonempty.\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n * to avoid stuck value in the contract.\n *\n * Emits an {IERC1967-BeaconUpgraded} event.\n *\n * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\n * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\n * efficiency.\n */\n function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\n _setBeacon(newBeacon);\n emit IERC1967.BeaconUpgraded(newBeacon);\n\n if (data.length > 0) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n } else {\n _checkNonPayable();\n }\n }\n\n /**\n * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\n * if an upgrade doesn't perform an initialization call.\n */\n function _checkNonPayable() private {\n if (msg.value > 0) {\n revert ERC1967NonPayable();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC1363} from \"../../../interfaces/IERC1363.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n /**\n * @dev An operation with an ERC-20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n *\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n *\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance < requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n *\n * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\n * only sets the \"standard\" allowance. Any temporary allowance will remain active, in addition to the value being\n * set here.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n * targeting contracts.\n *\n * Reverts if the returned value is other than `true`.\n */\n function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n if (to.code.length == 0) {\n safeTransfer(token, to, value);\n } else if (!token.transferAndCall(to, value, data)) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\n * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n * targeting contracts.\n *\n * Reverts if the returned value is other than `true`.\n */\n function transferFromAndCallRelaxed(\n IERC1363 token,\n address from,\n address to,\n uint256 value,\n bytes memory data\n ) internal {\n if (to.code.length == 0) {\n safeTransferFrom(token, from, to, value);\n } else if (!token.transferFromAndCall(from, to, value, data)) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n * targeting contracts.\n *\n * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\n * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\n * once without retrying, and relies on the returned value to be true.\n *\n * Reverts if the returned value is other than `true`.\n */\n function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n if (to.code.length == 0) {\n forceApprove(token, to, value);\n } else if (!token.approveAndCall(to, value, data)) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n uint256 returnSize;\n uint256 returnValue;\n assembly (\"memory-safe\") {\n let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n // bubble errors\n if iszero(success) {\n let ptr := mload(0x40)\n returndatacopy(ptr, 0, returndatasize())\n revert(ptr, returndatasize())\n }\n returnSize := returndatasize()\n returnValue := mload(0)\n }\n\n if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n bool success;\n uint256 returnSize;\n uint256 returnValue;\n assembly (\"memory-safe\") {\n success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n returnSize := returndatasize()\n returnValue := mload(0)\n }\n return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert Errors.InsufficientBalance(address(this).balance, amount);\n }\n\n (bool success, bytes memory returndata) = recipient.call{value: amount}(\"\");\n if (!success) {\n _revert(returndata);\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {Errors.FailedCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert Errors.InsufficientBalance(address(this).balance, value);\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n * of an unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {Errors.FailedCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n assembly (\"memory-safe\") {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert Errors.FailedCall();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Errors.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error InsufficientBalance(uint256 balance, uint256 needed);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedCall();\n\n /**\n * @dev The deployment failed.\n */\n error FailedDeployment();\n\n /**\n * @dev A necessary precompile is missing.\n */\n error MissingPrecompile(address);\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return ternary(a > b, a, b);\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return ternary(a < b, a, b);\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/types/Time.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n using Time for *;\n\n /**\n * @dev Get the block timestamp as a Timepoint.\n */\n function timestamp() internal view returns (uint48) {\n return SafeCast.toUint48(block.timestamp);\n }\n\n /**\n * @dev Get the block number as a Timepoint.\n */\n function blockNumber() internal view returns (uint48) {\n return SafeCast.toUint48(block.number);\n }\n\n // ==================================================== Delay =====================================================\n /**\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n * This allows updating the delay applied to some operation while keeping some guarantees.\n *\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n * still apply for some time.\n *\n *\n * The `Delay` type is 112 bits long, and packs the following:\n *\n * ```\n * | [uint48]: effect date (timepoint)\n * | | [uint32]: value before (duration)\n * ↓ ↓ ↓ [uint32]: value after (duration)\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n * ```\n *\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n * supported.\n */\n type Delay is uint112;\n\n /**\n * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n */\n function toDelay(uint32 duration) internal pure returns (Delay) {\n return Delay.wrap(duration);\n }\n\n /**\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n */\n function _getFullAt(\n Delay self,\n uint48 timepoint\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n (valueBefore, valueAfter, effect) = self.unpack();\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n * effect timepoint is 0, then the pending value should not be considered.\n */\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n return _getFullAt(self, timestamp());\n }\n\n /**\n * @dev Get the current value.\n */\n function get(Delay self) internal view returns (uint32) {\n (uint32 delay, , ) = self.getFull();\n return delay;\n }\n\n /**\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n * new delay becomes effective.\n */\n function withUpdate(\n Delay self,\n uint32 newValue,\n uint32 minSetback\n ) internal view returns (Delay updatedDelay, uint48 effect) {\n uint32 value = self.get();\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n effect = timestamp() + setback;\n return (pack(value, newValue, effect), effect);\n }\n\n /**\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n */\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n uint112 raw = Delay.unwrap(self);\n\n valueAfter = uint32(raw);\n valueBefore = uint32(raw >> 32);\n effect = uint48(raw >> 64);\n\n return (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev pack the components into a Delay object.\n */\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n }\n}\n" + }, + "contracts/helpers/BaseHarvester.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { AccessManaged } from \"../utils/AccessManaged.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { IParallelizer } from \"contracts/interfaces/IParallelizer.sol\";\nimport { ITokenP } from \"contracts/interfaces/ITokenP.sol\";\nimport \"contracts/interfaces/IHarvester.sol\";\n\nimport \"../utils/Errors.sol\";\n\nstruct YieldBearingParams {\n // Address of the asset used to mint the yield bearing asset\n address asset;\n // Target exposure to the collateral yield bearing asset used\n uint64 targetExposure;\n // Maximum exposure within the Parallelizer to the deposit asset\n uint64 maxExposure;\n // Minimum exposure within the Parallelizer to the deposit asset\n uint64 minExposure;\n // Whether limit exposures should be overriden or read onchain through the Parallelizer\n // This value should be 1 to override exposures or 2 if these shouldn't be overriden\n uint64 overrideExposures;\n // Maximum slippage when dealing with the Parallelizer\n uint96 maxSlippage;\n}\n\n/// @title BaseHarvester\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev Abstract contract for a harvester that aims at rebalancing a Parallelizer\n/// @dev This contract is an authorized fork of Angle's BaseHarvester contract:\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/helpers/BaseHarvester.sol\nabstract contract BaseHarvester is IHarvester, AccessManaged {\n using SafeERC20 for IERC20;\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n MODIFIERS\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /**\n * @notice Checks whether the `msg.sender` is trusted to update\n * target exposure and do others non critical operations\n */\n modifier onlyTrusted() {\n if (!isTrusted[msg.sender]) revert NotTrusted();\n _;\n }\n\n /**\n * @notice Checks whether the `msg.sender` is trusted or guardian to update\n * target exposure and do others non critical operations\n */\n modifier onlyTrustedOrRestricted() {\n if (!isTrusted[msg.sender] && !_checkCanCall(_msgSender(), _msgData())) {\n revert NotTrustedOrGuardian();\n }\n _;\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n VARIABLES\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Reference to the `parallelizer` implementation this contract aims at rebalancing\n IParallelizer public immutable parallelizer;\n /// @notice TokenP handled by the `parallelizer` of interest\n ITokenP public immutable tokenP;\n /// @notice Max slippage when dealing with the Parallelizer\n mapping(address => uint96) public maxTokenSlippage;\n /// @notice Data associated to a yield bearing asset\n mapping(address => YieldBearingParams) public yieldBearingData;\n /// @notice trusted addresses that can update target exposure and do others non critical operations\n mapping(address => bool) public isTrusted;\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n EVENTS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n event Recovered(address token, uint256 amount, address to);\n event TrustedToggled(address trusted, bool status);\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n CONSTRUCTOR\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n constructor(\n address initialAuthority,\n ITokenP definitiveTokenP,\n IParallelizer definitiveParallelizer\n )\n AccessManaged(initialAuthority)\n {\n tokenP = definitiveTokenP;\n parallelizer = definitiveParallelizer;\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n GUARDIAN FUNCTIONS\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /**\n * @notice Set the yieldBearingAsset data\n * @param yieldBearingAsset address of the yieldBearingAsset\n * @param asset address of the asset\n * @param targetExposure target exposure to the yieldBearingAsset asset used\n * @param minExposure minimum exposure within the Parallelizer to the asset\n * @param maxExposure maximum exposure within the Parallelizer to the asset\n * @param overrideExposures whether limit exposures should be overriden or read onchain through the Parallelizer\n */\n function setYieldBearingAssetData(\n address yieldBearingAsset,\n address asset,\n uint64 targetExposure,\n uint64 minExposure,\n uint64 maxExposure,\n uint64 overrideExposures,\n uint96 maxSlippage\n )\n external\n restricted\n {\n _setYieldBearingAssetData(\n yieldBearingAsset, asset, targetExposure, minExposure, maxExposure, overrideExposures, maxSlippage\n );\n }\n\n /**\n * @notice Set the limit exposures to the asset linked to the yield bearing asset\n * @param yieldBearingAsset address of the yield bearing asset\n */\n function updateLimitExposuresYieldAsset(address yieldBearingAsset) public virtual {\n YieldBearingParams storage yieldBearingInfo = yieldBearingData[yieldBearingAsset];\n if (yieldBearingInfo.overrideExposures == 2) {\n _updateLimitExposuresYieldAsset(yieldBearingInfo.asset, yieldBearingInfo);\n }\n }\n\n /**\n * @notice Set the max allowed slippage\n * @param newMaxSlippage new max allowed slippage\n */\n function setMaxSlippage(address yieldBearingAsset, uint96 newMaxSlippage) external restricted {\n _setMaxSlippage(yieldBearingAsset, newMaxSlippage);\n }\n\n /**\n * @notice Toggle the trusted status of an address\n * @param trusted address to toggle the trusted status\n */\n function toggleTrusted(address trusted) external restricted {\n emit TrustedToggled(trusted, isTrusted[trusted]);\n isTrusted[trusted] = !isTrusted[trusted];\n }\n\n /**\n * @notice Recover ERC20 tokens\n * @param tokenAddress address of the token to recover\n * @param amountToRecover amount to recover\n * @param to address to send the recovered tokens\n */\n function recoverERC20(address tokenAddress, uint256 amountToRecover, address to) external restricted {\n emit Recovered(tokenAddress, amountToRecover, to);\n IERC20(tokenAddress).safeTransfer(to, amountToRecover);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n TRUSTED FUNCTIONS\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /**\n * @notice Set the target exposure of a yield bearing asset\n * @param yieldBearingAsset address of the yield bearing asset\n * @param targetExposure target exposure to the yield bearing asset used\n */\n function setTargetExposure(address yieldBearingAsset, uint64 targetExposure) external onlyTrustedOrRestricted {\n yieldBearingData[yieldBearingAsset].targetExposure = targetExposure;\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n VIEW FUNCTIONS\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /**\n * @notice Compute the amount needed to rebalance the Parallelizer\n * @param yieldBearingAsset address of the yield bearing asset\n * @return increase whether the exposure should be increased\n * @return amount amount to be rebalanced\n */\n function computeRebalanceAmount(address yieldBearingAsset) external view returns (uint8 increase, uint256 amount) {\n return _computeRebalanceAmount(yieldBearingAsset, yieldBearingData[yieldBearingAsset]);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n INTERNAL FUNCTIONS\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n function _computeRebalanceAmount(\n address yieldBearingAsset,\n YieldBearingParams memory yieldBearingInfo\n )\n internal\n view\n returns (uint8 increase, uint256 amount)\n {\n (uint256 stablecoinsFromYieldBearingAsset, uint256 stablecoinsIssued) =\n parallelizer.getIssuedByCollateral(yieldBearingAsset);\n (uint256 stablecoinsFromAsset,) = parallelizer.getIssuedByCollateral(yieldBearingInfo.asset);\n uint256 targetExposureScaled = yieldBearingInfo.targetExposure * stablecoinsIssued;\n if (stablecoinsFromYieldBearingAsset * 1e9 > targetExposureScaled) {\n // Need to decrease exposure to yield bearing asset\n amount = stablecoinsFromYieldBearingAsset - targetExposureScaled / 1e9;\n uint256 maxValueScaled = yieldBearingInfo.maxExposure * stablecoinsIssued;\n // These checks assume that there are no transaction fees on the stablecoin->collateral conversion and so\n // it's still possible that exposure goes above the max exposure in some rare cases\n if (stablecoinsFromAsset * 1e9 > maxValueScaled) {\n amount = 0;\n } else if ((stablecoinsFromAsset + amount) * 1e9 > maxValueScaled) {\n amount = maxValueScaled / 1e9 - stablecoinsFromAsset;\n }\n } else {\n // In this case, exposure after the operation might remain slightly below the targetExposure as less\n // collateral may be obtained by burning stablecoins for the yield asset and unwrapping it\n increase = 1;\n amount = targetExposureScaled / 1e9 - stablecoinsFromYieldBearingAsset;\n uint256 minValueScaled = yieldBearingInfo.minExposure * stablecoinsIssued;\n if (stablecoinsFromAsset * 1e9 < minValueScaled) {\n amount = 0;\n } else if (stablecoinsFromAsset * 1e9 < minValueScaled + amount * 1e9) {\n amount = stablecoinsFromAsset - minValueScaled / 1e9;\n }\n }\n }\n\n function _setYieldBearingAssetData(\n address yieldBearingAsset,\n address asset,\n uint64 targetExposure,\n uint64 minExposure,\n uint64 maxExposure,\n uint64 overrideExposures,\n uint96 maxSlippage\n )\n internal\n virtual\n {\n YieldBearingParams storage yieldBearingInfo = yieldBearingData[yieldBearingAsset];\n yieldBearingInfo.asset = asset;\n if (targetExposure >= 1e9) revert InvalidParam();\n if (maxSlippage >= 1e9) revert InvalidParam();\n yieldBearingInfo.targetExposure = targetExposure;\n yieldBearingInfo.overrideExposures = overrideExposures;\n yieldBearingInfo.maxSlippage = maxSlippage;\n if (overrideExposures == 1) {\n if (maxExposure >= 1e9 || minExposure >= maxExposure) revert InvalidParam();\n yieldBearingInfo.maxExposure = maxExposure;\n yieldBearingInfo.minExposure = minExposure;\n } else {\n yieldBearingInfo.overrideExposures = 2;\n _updateLimitExposuresYieldAsset(asset, yieldBearingInfo);\n }\n }\n\n function _updateLimitExposuresYieldAsset(\n address asset,\n YieldBearingParams storage yieldBearingInfo\n )\n internal\n virtual\n {\n uint64[] memory xFeeMint;\n (xFeeMint,) = parallelizer.getCollateralMintFees(asset);\n uint256 length = xFeeMint.length;\n if (length <= 1) yieldBearingInfo.maxExposure = 1e9;\n else yieldBearingInfo.maxExposure = xFeeMint[length - 2];\n\n uint64[] memory xFeeBurn;\n (xFeeBurn,) = parallelizer.getCollateralBurnFees(asset);\n length = xFeeBurn.length;\n if (length <= 1) yieldBearingInfo.minExposure = 0;\n else yieldBearingInfo.minExposure = xFeeBurn[length - 2];\n }\n\n function _setMaxSlippage(address yieldBearingAsset, uint96 newMaxSlippage) internal virtual {\n if (newMaxSlippage > 1e9) revert InvalidParam();\n maxTokenSlippage[yieldBearingAsset] = newMaxSlippage;\n }\n\n function _scaleAmountBasedOnDecimals(\n uint256 decimalsTokenIn,\n uint256 decimalsTokenOut,\n uint256 amountIn,\n bool assetIn\n )\n internal\n pure\n returns (uint256)\n {\n if (decimalsTokenIn > decimalsTokenOut) {\n if (assetIn) {\n amountIn /= 10 ** (decimalsTokenIn - decimalsTokenOut);\n } else {\n amountIn *= 10 ** (decimalsTokenIn - decimalsTokenOut);\n }\n } else if (decimalsTokenIn < decimalsTokenOut) {\n if (assetIn) {\n amountIn *= 10 ** (decimalsTokenOut - decimalsTokenIn);\n } else {\n amountIn /= 10 ** (decimalsTokenOut - decimalsTokenIn);\n }\n }\n return amountIn;\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n HELPER \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n function _adjustAllowance(address token, address sender, uint256 amountIn) internal {\n uint256 allowance = IERC20(token).allowance(address(this), sender);\n if (allowance < amountIn) IERC20(token).safeIncreaseAllowance(sender, type(uint256).max - allowance);\n }\n}\n" + }, + "contracts/helpers/GenericHarvester.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { IERC20Metadata } from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport { IERC3156FlashBorrower } from \"@openzeppelin/contracts/interfaces/IERC3156FlashBorrower.sol\";\nimport { IERC3156FlashLender } from \"@openzeppelin/contracts/interfaces/IERC3156FlashLender.sol\";\nimport { RouterSwapper } from \"@helpers/RouterSwapper.sol\";\n\nimport { IParallelizer } from \"contracts/interfaces/IParallelizer.sol\";\nimport { ITokenP } from \"contracts/interfaces/ITokenP.sol\";\nimport { IERC4626 } from \"contracts/interfaces/external/IERC4626.sol\";\n\nimport \"../utils/Constants.sol\";\nimport \"../utils/Errors.sol\";\n\nimport { BaseHarvester, YieldBearingParams } from \"./BaseHarvester.sol\";\n\nenum SwapType {\n VAULT,\n SWAP\n}\n\n/// @title GenericHarvester\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev Generic contract for anyone to permissionlessly adjust the reserves of Angle Parallelizer\n/// @dev This contract is an authorized fork of Angle's GenericHarvester contract:\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/helpers/GenericHarvester.sol\ncontract GenericHarvester is BaseHarvester, IERC3156FlashBorrower, RouterSwapper {\n using SafeCast for uint256;\n using SafeERC20 for IERC20;\n\n bytes32 public constant CALLBACK_SUCCESS = keccak256(\"ERC3156FlashBorrower.onFlashLoan\");\n\n /// @notice Parallel stablecoin flashloan contract\n IERC3156FlashLender public immutable flashloan;\n /// @notice Budget of tokenP available for each users\n mapping(address => uint256) public budget;\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n INITIALIZATION \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n constructor(\n address initialTokenTransferAddress,\n address initialSwapRouter,\n ITokenP definitivetokenP,\n IParallelizer definitiveParallelizer,\n address initialAuthority,\n IERC3156FlashLender definitiveFlashloan\n )\n RouterSwapper(initialSwapRouter, initialTokenTransferAddress)\n BaseHarvester(initialAuthority, definitivetokenP, definitiveParallelizer)\n {\n if (address(definitiveFlashloan) == address(0)) revert ZeroAddress();\n flashloan = definitiveFlashloan;\n\n IERC20(tokenP).approve(address(definitiveFlashloan), type(uint256).max);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n BUDGET HANDLING\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /**\n * @notice Add budget to be spent by the receiver during the flashloan\n * @param amount amount of tokenP to add to the budget\n * @param receiver address of the receiver\n */\n function addBudget(uint256 amount, address receiver) public virtual {\n budget[receiver] += amount;\n\n IERC20(tokenP).safeTransferFrom(msg.sender, address(this), amount);\n }\n\n /**\n * @notice Remove budget from the owner and send it to the receiver\n * @param amount amount of tokenP to remove from the budget\n * @param receiver address of the receiver\n */\n function removeBudget(uint256 amount, address receiver) public virtual {\n budget[msg.sender] -= amount; // Will revert if not enough funds\n\n IERC20(tokenP).safeTransfer(receiver, amount);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n HARVEST\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Invests or divests from the yield asset associated to `yieldBearingAsset` based on the current exposure\n /// to this yieldBearingAsset\n /// @dev This transaction either reduces the exposure to `yieldBearingAsset` in the Parallelizer or frees up\n /// some yieldBearingAsset that can then be used for people looking to burn deposit tokens\n /// @dev Due to potential transaction fees within the Parallelizer, this function doesn't exactly bring\n /// `yieldBearingAsset` to the target exposure\n /// @dev scale is a number between 0 and 1e9 that represents the proportion of the tokenP to harvest,\n /// it is used to lower the amount of the asset to harvest for example to have a lower slippage\n function harvest(address yieldBearingAsset, uint256 scale, bytes calldata extraData) public virtual {\n if (scale > 1e9) revert InvalidParam();\n updateLimitExposuresYieldAsset(yieldBearingAsset);\n YieldBearingParams memory yieldBearingInfo = yieldBearingData[yieldBearingAsset];\n (uint8 increase, uint256 amount) = _computeRebalanceAmount(yieldBearingAsset, yieldBearingInfo);\n amount = (amount * scale) / 1e9;\n if (amount == 0) revert ZeroAmount();\n (SwapType swapType, bytes memory data) = abi.decode(extraData, (SwapType, bytes));\n try parallelizer.updateOracle(yieldBearingAsset) { } catch { }\n _adjustYieldExposure(\n amount,\n increase,\n yieldBearingAsset,\n yieldBearingInfo.asset,\n (amount * (1e9 - yieldBearingInfo.maxSlippage)) / 1e9,\n swapType,\n data\n );\n }\n\n /// @inheritdoc IERC3156FlashBorrower\n function onFlashLoan(\n address initiator,\n address,\n uint256 amount,\n uint256 fee,\n bytes calldata data\n )\n public\n virtual\n returns (bytes32)\n {\n if (msg.sender != address(flashloan) || initiator != address(this) || fee != 0) revert NotTrusted();\n address sender;\n uint256 typeAction;\n uint256 minAmountOut;\n SwapType swapType;\n bytes memory callData;\n address tokenOut;\n address tokenIn;\n {\n address yieldBearingAsset;\n address asset;\n (sender, typeAction, yieldBearingAsset, asset, minAmountOut, swapType, callData) =\n abi.decode(data, (address, uint256, address, address, uint256, SwapType, bytes));\n if (typeAction == 1) {\n // Increase yield exposure action: we bring in the yield bearing asset\n tokenOut = yieldBearingAsset;\n tokenIn = asset;\n } else {\n // Decrease yield exposure action: we bring in the deposit asset\n tokenIn = yieldBearingAsset;\n tokenOut = asset;\n }\n }\n uint256 amountOut =\n parallelizer.swapExactInput(amount, 0, address(tokenP), tokenIn, address(this), block.timestamp);\n\n // Swap to tokenIn\n amountOut = _swapToTokenOut(typeAction, tokenIn, tokenOut, amountOut, swapType, callData);\n\n _adjustAllowance(tokenOut, address(parallelizer), amountOut);\n uint256 amountStableOut =\n parallelizer.swapExactInput(amountOut, minAmountOut, tokenOut, address(tokenP), address(this), block.timestamp);\n if (amount > amountStableOut) {\n budget[sender] -= amount - amountStableOut; // Will revert if not enough funds\n }\n return CALLBACK_SUCCESS;\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n SETTERS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /**\n * @notice Set the token transfer address\n * @param newTokenTransferAddress address of the token transfer contract\n */\n function setTokenTransferAddress(address newTokenTransferAddress) public override restricted {\n super.setTokenTransferAddress(newTokenTransferAddress);\n }\n\n /**\n * @notice Set the swap router\n * @param newSwapRouter address of the swap router\n */\n function setSwapRouter(address newSwapRouter) public override restricted {\n super.setSwapRouter(newSwapRouter);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n INTERNALS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Burns `amountStablecoins` for one yieldBearing asset, swap for asset then mints deposit tokens\n /// from the proceeds of the swap.\n /// @dev If `increase` is 1, then the system tries to increase its exposure to the yield bearing asset which means\n /// burning tokenP for the deposit asset, swapping for the yield bearing asset, then minting the tokenP\n /// @dev This function reverts if the second tokenP mint gives less than `minAmountOut` of ag tokens\n /// @dev This function reverts if the swap slippage is higher than `maxSlippage`\n function _adjustYieldExposure(\n uint256 amountStablecoins,\n uint8 increase,\n address yieldBearingAsset,\n address asset,\n uint256 minAmountOut,\n SwapType swapType,\n bytes memory extraData\n )\n internal\n {\n flashloan.flashLoan(\n IERC3156FlashBorrower(address(this)),\n address(tokenP),\n amountStablecoins,\n abi.encode(msg.sender, increase, yieldBearingAsset, asset, minAmountOut, swapType, extraData)\n );\n }\n\n function _swapToTokenOut(\n uint256 typeAction,\n address tokenIn,\n address tokenOut,\n uint256 amount,\n SwapType swapType,\n bytes memory callData\n )\n internal\n returns (uint256 amountOut)\n {\n if (swapType == SwapType.SWAP) {\n amountOut = _swapToTokenOutSwap(tokenIn, tokenOut, amount, callData);\n } else if (swapType == SwapType.VAULT) {\n amountOut = _swapToTokenOutVault(typeAction, tokenIn, tokenOut, amount);\n }\n }\n\n /**\n * @notice Swap token using the router/aggregator\n * @param tokenIn address of the token to swap\n * @param tokenOut address of the token to receive\n * @param amount amount of token to swap\n * @param callData bytes to call the router/aggregator\n */\n function _swapToTokenOutSwap(\n address tokenIn,\n address tokenOut,\n uint256 amount,\n bytes memory callData\n )\n internal\n returns (uint256)\n {\n uint256 balance = IERC20(tokenOut).balanceOf(address(this));\n\n address[] memory tokens = new address[](1);\n tokens[0] = tokenIn;\n bytes[] memory callDatas = new bytes[](1);\n callDatas[0] = callData;\n uint256[] memory amounts = new uint256[](1);\n amounts[0] = amount;\n _swap(tokens, callDatas, amounts);\n\n return IERC20(tokenOut).balanceOf(address(this)) - balance;\n }\n\n /**\n * @dev Deposit or redeem the vault asset\n * @param typeAction 1 for deposit, 2 for redeem\n * @param tokenIn address of the token to swap\n * @param tokenOut address of the token to receive\n * @param amount amount of token to swap\n */\n function _swapToTokenOutVault(\n uint256 typeAction,\n address tokenIn,\n address tokenOut,\n uint256 amount\n )\n internal\n returns (uint256 amountOut)\n {\n if (typeAction == 1) {\n // Granting allowance with the yieldBearingAsset for the vault asset\n _adjustAllowance(tokenIn, tokenOut, amount);\n amountOut = IERC4626(tokenOut).deposit(amount, address(this));\n } else {\n amountOut = IERC4626(tokenIn).redeem(amount, address(this), address(this));\n }\n }\n}\n" + }, + "contracts/helpers/MultiBlockHarvester.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\nimport { IERC20Metadata } from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { Math } from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { BaseHarvester, YieldBearingParams } from \"./BaseHarvester.sol\";\nimport { IParallelizer } from \"contracts/interfaces/IParallelizer.sol\";\nimport { ITokenP } from \"contracts/interfaces/ITokenP.sol\";\nimport { IPool } from \"contracts/interfaces/IPool.sol\";\n\nimport \"../utils/Errors.sol\";\nimport \"../utils/Constants.sol\";\n\n/// @title MultiBlockHarvester\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev Contract to harvest yield from multiple yield bearing assets in multiple blocks transactions\n/// @dev This contract is an authorized fork of Angle's MultiBlockHarvester contract:\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/helpers/MultiBlockHarvester.sol\ncontract MultiBlockHarvester is BaseHarvester {\n using SafeERC20 for IERC20;\n using Math for uint256;\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n VARIABLES\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice address to deposit to receive yieldBearingAsset\n mapping(address => address) public yieldBearingToDepositAddress;\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n CONSTRUCTOR\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n constructor(\n address initialAuthority,\n ITokenP definitivetokenP,\n IParallelizer definitiveParallelizer\n )\n BaseHarvester(initialAuthority, definitivetokenP, definitiveParallelizer)\n { }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n GUARDIAN FUNCTIONS\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /**\n * @notice Set the deposit address for a yieldBearingAsset\n * @param yieldBearingAsset address of the yieldBearingAsset\n * @param newDepositAddress address to deposit to receive yieldBearingAsset\n */\n function setYieldBearingToDepositAddress(address yieldBearingAsset, address newDepositAddress) external restricted {\n yieldBearingToDepositAddress[yieldBearingAsset] = newDepositAddress;\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n TRUSTED FUNCTIONS\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /**\n * @notice Initiate a rebalance\n * @param scale scale to apply to the rebalance amount\n * @param yieldBearingAsset address of the yieldBearingAsset\n */\n function harvest(address yieldBearingAsset, uint256 scale, bytes calldata) external onlyTrusted {\n if (scale > 1e9) revert InvalidParam();\n updateLimitExposuresYieldAsset(yieldBearingAsset);\n YieldBearingParams memory yieldBearingInfo = yieldBearingData[yieldBearingAsset];\n (uint8 increase, uint256 amount) = _computeRebalanceAmount(yieldBearingAsset, yieldBearingInfo);\n amount = (amount * scale) / 1e9;\n if (amount == 0) revert ZeroAmount();\n\n try parallelizer.updateOracle(yieldBearingAsset) { } catch { }\n _rebalance(increase, yieldBearingAsset, yieldBearingInfo, amount);\n }\n\n /**\n * @notice Finalize a rebalance\n * @param yieldBearingAsset address of the yieldBearingAsset\n */\n function finalizeRebalance(address yieldBearingAsset, uint256 balance) external onlyTrusted {\n try parallelizer.updateOracle(yieldBearingAsset) { } catch { }\n _adjustAllowance(yieldBearingAsset, address(parallelizer), balance);\n uint256 amountOut =\n parallelizer.swapExactInput(balance, 0, yieldBearingAsset, address(tokenP), address(this), block.timestamp);\n address depositAddress = yieldBearingAsset == XEVT ? yieldBearingToDepositAddress[yieldBearingAsset] : address(0);\n _checkSlippage(\n balance, amountOut, yieldBearingAsset, depositAddress, true, yieldBearingData[yieldBearingAsset].maxSlippage\n );\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n INTERNAL FUNCTIONS\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n function _rebalance(\n uint8 typeAction,\n address yieldBearingAsset,\n YieldBearingParams memory yieldBearingInfo,\n uint256 amount\n )\n internal\n {\n address depositAddress = yieldBearingToDepositAddress[yieldBearingAsset];\n if (typeAction == 1) {\n uint256 amountOut =\n parallelizer.swapExactInput(amount, 0, address(tokenP), yieldBearingInfo.asset, address(this), block.timestamp);\n if (yieldBearingAsset == XEVT) {\n _adjustAllowance(yieldBearingInfo.asset, address(depositAddress), amountOut);\n (uint256 shares,) = IPool(depositAddress).deposit(amountOut, address(this));\n _adjustAllowance(yieldBearingAsset, address(parallelizer), shares);\n amountOut =\n parallelizer.swapExactInput(shares, 0, yieldBearingAsset, address(tokenP), address(this), block.timestamp);\n _checkSlippage(amount, amountOut, address(tokenP), depositAddress, false, yieldBearingInfo.maxSlippage);\n } else if (yieldBearingAsset == USDM) {\n IERC20(yieldBearingInfo.asset).safeTransfer(depositAddress, amountOut);\n _checkSlippage(amount, amountOut, yieldBearingInfo.asset, depositAddress, false, yieldBearingInfo.maxSlippage);\n }\n } else {\n uint256 amountOut =\n parallelizer.swapExactInput(amount, 0, address(tokenP), yieldBearingAsset, address(this), block.timestamp);\n if (yieldBearingAsset == USDM) amountOut = IERC20(yieldBearingAsset).balanceOf(address(this));\n _checkSlippage(amount, amountOut, yieldBearingAsset, depositAddress, false, yieldBearingInfo.maxSlippage);\n if (yieldBearingAsset == XEVT) {\n IPool(depositAddress).requestRedeem(amountOut);\n } else if (yieldBearingAsset == USDM) {\n IERC20(yieldBearingAsset).safeTransfer(depositAddress, amountOut);\n }\n }\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n HELPER \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n function _checkSlippage(\n uint256 amountIn,\n uint256 amountOut,\n address asset,\n address depositAddress,\n bool assetIn,\n uint96 maxSlippage\n )\n internal\n view\n {\n // Divide or multiply the amountIn to match the decimals of the asset\n amountIn = _scaleAmountBasedOnDecimals(IERC20Metadata(asset).decimals(), 18, amountIn, assetIn);\n\n uint256 result;\n if (asset == USDC || asset == USDM || asset == EURC || asset == address(tokenP)) {\n // Assume 1:1 ratio between stablecoins\n (, result) = amountIn.trySub(amountOut);\n } else if (asset == XEVT) {\n // Assume 1:1 ratio between the underlying asset of the vault\n if (assetIn) {\n (, result) = IPool(depositAddress).convertToAssets(amountIn).trySub(amountOut);\n } else {\n (, result) = amountIn.trySub(IPool(depositAddress).convertToAssets(amountOut));\n }\n } else {\n revert InvalidParam();\n }\n\n uint256 slippage = (result * 1e9) / amountIn;\n if (slippage > maxSlippage) revert SlippageTooHigh();\n }\n}\n" + }, + "contracts/interfaces/external/chainlink/AggregatorV3Interface.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.5.0;\n\ninterface AggregatorV3Interface {\n function decimals() external view returns (uint8);\n\n function description() external view returns (string memory);\n\n function version() external view returns (uint256);\n\n // getRoundData and latestRoundData should both raise \"No data present\"\n // if they do not have data to report, instead of returning unset values\n // which could be misinterpreted as actual reported values.\n function getRoundData(uint80 _roundId)\n external\n view\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\n\n function latestRoundData()\n external\n view\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\n}\n" + }, + "contracts/interfaces/external/coinbase/ICbETH.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.5.0;\n\n/// @title ICbETH\n/// @notice Interface for the `cbETH` contract\ninterface ICbETH {\n function exchangeRate() external view returns (uint256);\n}\n" + }, + "contracts/interfaces/external/frax/ISfrxETH.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.5.0;\n\n/// @title ISfrxETH\n/// @notice Interface for the `sfrxETH` contract\ninterface ISfrxETH {\n function pricePerShare() external view returns (uint256);\n}\n" + }, + "contracts/interfaces/external/IERC4626.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\n// OpenZeppelin Contracts (last updated v4.7.0) (interfaces/IERC4626.sol)\n\npragma solidity >=0.5.0;\n\n/// @notice ERC4626 interface\n/// @author OpenZeppelin\n/// @dev In this implementation, the interface only contains the functions that the IERC4626 interface adds on top of\n/// the IERC20 interface\ninterface IERC4626 {\n /**\n * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\n *\n * - MUST be an ERC-20 token contract.\n * - MUST NOT revert.\n */\n function asset() external view returns (address assetTokenAddress);\n\n /**\n * @dev Returns the total amount of the underlying asset that is “managed” by Vault.\n *\n * - SHOULD include any compounding that occurs from yield.\n * - MUST be inclusive of any fees that are charged against assets in the Vault.\n * - MUST NOT revert.\n */\n function totalAssets() external view returns (uint256 totalManagedAssets);\n\n /**\n * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\n * scenario where all the conditions are met.\n *\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n * - MUST NOT show any variations depending on the caller.\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n * - MUST NOT revert.\n *\n * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n * from.\n */\n function convertToShares(uint256 assets) external view returns (uint256 shares);\n\n /**\n * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\n * scenario where all the conditions are met.\n *\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n * - MUST NOT show any variations depending on the caller.\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n * - MUST NOT revert.\n *\n * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n * from.\n */\n function convertToAssets(uint256 shares) external view returns (uint256 assets);\n\n /**\n * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\n * through a deposit call.\n *\n * - MUST return a limited value if receiver is subject to some deposit limit.\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\n * - MUST NOT revert.\n */\n function maxDeposit(address receiver) external view returns (uint256 maxAssets);\n\n /**\n * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\n * current on-chain conditions.\n *\n * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\n * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\n * in the same transaction.\n * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\n * deposit would be accepted, regardless if the user has enough tokens approved, etc.\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n * - MUST NOT revert.\n *\n * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n */\n function previewDeposit(uint256 assets) external view returns (uint256 shares);\n\n /**\n * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\n *\n * - MUST emit the Deposit event.\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n * deposit execution, and are accounted for during deposit.\n * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\n * approving enough underlying tokens to the Vault contract, etc).\n *\n * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n */\n function deposit(uint256 assets, address receiver) external returns (uint256 shares);\n\n /**\n * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\n * - MUST return a limited value if receiver is subject to some mint limit.\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\n * - MUST NOT revert.\n */\n function maxMint(address receiver) external view returns (uint256 maxShares);\n\n /**\n * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\n * current on-chain conditions.\n *\n * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\n * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\n * same transaction.\n * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\n * would be accepted, regardless if the user has enough tokens approved, etc.\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n * - MUST NOT revert.\n *\n * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\n * share price or some other type of condition, meaning the depositor will lose assets by minting.\n */\n function previewMint(uint256 shares) external view returns (uint256 assets);\n\n /**\n * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\n *\n * - MUST emit the Deposit event.\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\n * execution, and are accounted for during mint.\n * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\n * approving enough underlying tokens to the Vault contract, etc).\n *\n * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n */\n function mint(uint256 shares, address receiver) external returns (uint256 assets);\n\n /**\n * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\n * Vault, through a withdraw call.\n *\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n * - MUST NOT revert.\n */\n function maxWithdraw(address owner) external view returns (uint256 maxAssets);\n\n /**\n * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\n * given current on-chain conditions.\n *\n * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\n * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\n * called\n * in the same transaction.\n * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\n * the withdrawal would be accepted, regardless if the user has enough shares, etc.\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n * - MUST NOT revert.\n *\n * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n */\n function previewWithdraw(uint256 assets) external view returns (uint256 shares);\n\n /**\n * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\n *\n * - MUST emit the Withdraw event.\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n * withdraw execution, and are accounted for during withdraw.\n * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\n * not having enough shares, etc).\n *\n * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n * Those methods should be performed separately.\n */\n function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\n\n /**\n * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\n * through a redeem call.\n *\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\n * - MUST NOT revert.\n */\n function maxRedeem(address owner) external view returns (uint256 maxShares);\n\n /**\n * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\n * given current on-chain conditions.\n *\n * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\n * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\n * same transaction.\n * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\n * redemption would be accepted, regardless if the user has enough shares, etc.\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n * - MUST NOT revert.\n *\n * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\n * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\n */\n function previewRedeem(uint256 shares) external view returns (uint256 assets);\n\n /**\n * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\n *\n * - MUST emit the Withdraw event.\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n * redeem execution, and are accounted for during redeem.\n * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\n * not having enough shares, etc).\n *\n * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n * Those methods should be performed separately.\n */\n function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\n}\n" + }, + "contracts/interfaces/external/keyring/IKeyringGuard.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.5.0;\n\n/// @title IKeyringGuard\n/// @notice Interface for the `KeyringGuard` contract\ninterface IKeyringGuard {\n function isAuthorized(address from, address to) external returns (bool passed);\n}\n" + }, + "contracts/interfaces/external/lido/IStETH.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.5.0;\n\n/// @title IStETH\n/// @notice Interface for the `StETH` contract\ninterface IStETH {\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\n\n function submit(address) external payable returns (uint256);\n\n function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);\n}\n" + }, + "contracts/interfaces/external/morpho/IMorphoOracle.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.5.0;\n\n/// @title IMorphoOracle\n/// @notice Interface for the oracle contracts used within Morpho\ninterface IMorphoOracle {\n function price() external view returns (uint256);\n}\n" + }, + "contracts/interfaces/external/permit2/IPermit2.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.5.0;\n\n/// @notice The token and amount details for a transfer signed in the permit transfer signature\nstruct TokenPermissions {\n // ERC20 token address\n address token;\n // the maximum amount that can be spent\n uint256 amount;\n}\n\n/// @notice The signed permit message for a single token transfer\nstruct PermitTransferFrom {\n TokenPermissions permitted;\n // a unique value for every token owner's signature to prevent signature replays\n uint256 nonce;\n // deadline on the permit signature\n uint256 deadline;\n}\n\n/// @notice Specifies the recipient address and amount for batched transfers.\n/// @dev Recipients and amounts correspond to the index of the signed token permissions array.\n/// @dev Reverts if the requested amount is greater than the permitted signed amount.\nstruct SignatureTransferDetails {\n // recipient address\n address to;\n // spender requested amount\n uint256 requestedAmount;\n}\n\n/// @title SignatureTransfer\n/// @notice Handles ERC20 token transfers through signature based actions\n/// @dev Requires user's token approval on the Permit2 contract\ninterface IPermit2 {\n /// @notice Transfers a token using a signed permit message\n /// @dev Reverts if the requested amount is greater than the permitted signed amount\n /// @param permit The permit data signed over by the owner\n /// @param owner The owner of the tokens to transfer\n /// @param transferDetails The spender's requested transfer details for the permitted token\n /// @param signature The signature to verify\n function permitTransferFrom(\n PermitTransferFrom memory permit,\n SignatureTransferDetails calldata transferDetails,\n address owner,\n bytes calldata signature\n )\n external;\n}\n" + }, + "contracts/interfaces/external/rocketPool/IRETH.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.5.0;\n\n/// @title IRETH\n/// @notice Interface for the `rETH` contract\ninterface IRETH {\n function getExchangeRate() external view returns (uint256);\n}\n" + }, + "contracts/interfaces/IDiamondCut.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"../parallelizer/Storage.sol\";\n\n/// @title IDiamondCut\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev Reference: EIP-2535 Diamonds\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/interfaces/IDiamondCut.sol by mudgen\n/// @dev This interface is an authorized fork of Angle's `IDiamondCut` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IDiamondCut.sol\ninterface IDiamondCut {\n /// @notice Add/replace/remove any number of functions and optionally execute a function with delegatecall\n /// @param _diamondCut Contains the facet addresses and function selectors\n /// @param _init The address of the contract or facet to execute _calldata\n /// @param _calldata A function call, including function selector and arguments, executed with delegatecall on\n /// _init\n function diamondCut(FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata) external;\n}\n" + }, + "contracts/interfaces/IDiamondEtherscan.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\n/// @title IDiamondEtherscan\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\ninterface IDiamondEtherscan {\n /// @notice Sets a dummy implementation with the same layout at the diamond proxy contract with all its facets\n function setDummyImplementation(address _implementation) external;\n\n /// @notice Address of the dummy implementation used to make the DiamondProxy contract interpretable by Etherscan\n function implementation() external view returns (address);\n}\n" + }, + "contracts/interfaces/IDiamondLoupe.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"../parallelizer/Storage.sol\";\n\n/// @notice IDiamondLoupe\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev Reference: EIP-2535 Diamonds\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/interfaces/IDiamondLoupe.sol by mudgen\ninterface IDiamondLoupe {\n /// @notice Gets all facet addresses and their four byte function selectors.\n /// @return facets_ Facet\n function facets() external view returns (Facet[] memory facets_);\n\n /// @notice Gets all the function selectors supported by a specific facet.\n /// @param _facet The facet address.\n /// @return facetFunctionSelectors_\n function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_);\n\n /// @notice Get all the facet addresses used by a diamond.\n /// @return facetAddresses_\n function facetAddresses() external view returns (address[] memory facetAddresses_);\n\n /// @notice Gets the facet that supports the given selector.\n /// @dev If facet is not found return address(0).\n /// @param _functionSelector The function selector.\n /// @return facetAddress_ The facet address.\n function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_);\n}\n" + }, + "contracts/interfaces/IGetters.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\nimport { ITokenP } from \"contracts/interfaces/ITokenP.sol\";\n\nimport \"../parallelizer/Storage.sol\";\n\n/// @title IGetters\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This interface is an authorized fork of Angle's `IGetters` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IGetters.sol\ninterface IGetters {\n /// @notice Checks whether a given `selector` is actually a valid selector corresponding to a function in one of\n /// the\n /// facets of the proxy\n function isValidSelector(bytes4 selector) external view returns (bool);\n\n /// @notice Stablecoin minted by parallelizer\n function tokenP() external view returns (ITokenP);\n\n /// @notice Returns the list of collateral assets supported by the system\n function getCollateralList() external view returns (address[] memory);\n\n /// @notice Returns all the info in storage associated to a `collateral`\n function getCollateralInfo(address collateral) external view returns (Collateral memory);\n\n /// @notice Returns the decimals of a given `collateral`\n function getCollateralDecimals(address collateral) external view returns (uint8);\n\n /// @notice Returns the `xFee` and `yFee` arrays from which fees are computed when coming to mint\n /// with `collateral`\n function getCollateralMintFees(address collateral) external view returns (uint64[] memory, int64[] memory);\n\n /// @notice Returns the `xFee` and `yFee` arrays from which fees are computed when coming to burn\n /// for `collateral`\n function getCollateralBurnFees(address collateral) external view returns (uint64[] memory, int64[] memory);\n\n /// @notice Returns the `xFee` and `yFee` arrays used to compute the penalty factor depending on the collateral\n /// ratio when users come to redeem\n function getRedemptionFees() external view returns (uint64[] memory, int64[] memory);\n\n /// @notice Returns the collateral ratio of Parallelizer in base `10**9` and a rounded version of the total amount\n /// of stablecoins issued\n function getCollateralRatio() external view returns (uint64 collatRatio, uint256 stablecoinsIssued);\n\n /// @notice Returns the total amount of stablecoins issued through Parallelizer\n function getTotalIssued() external view returns (uint256 stablecoinsIssued);\n\n /// @notice Returns the amount of stablecoins issued from `collateral` and the total amount of stablecoins issued\n /// through Parallelizer\n function getIssuedByCollateral(address collateral)\n external\n view\n returns (uint256 stablecoinsFromCollateral, uint256 stablecoinsIssued);\n\n /// @notice Returns if a collateral is \"managed\" and the associated manager configuration\n function getManagerData(address collateral)\n external\n view\n returns (bool isManaged, IERC20[] memory subCollaterals, bytes memory config);\n\n /// @notice Returns the oracle values associated to `collateral`\n /// @return mint Oracle value to be used for a mint transaction with `collateral`\n /// @return burn Oracle value that will be used for `collateral` for a burn transaction. This value\n /// is then used along with oracle values for all other collateral assets to get a global burn value for the oracle\n /// @return ratio Ratio, in base `10**18` between the oracle value of the `collateral` and its target price.\n /// This value is 10**18 if the oracle is greater than the collateral price\n /// @return minRatio Minimum ratio across all collateral assets between a collateral burn price and its target\n /// price. This value is independent of `collateral` and is used to normalize the burn oracle value for burn\n /// transactions.\n /// @return redemption Oracle value that would be used to price `collateral` when computing the collateral ratio\n /// during a redemption\n function getOracleValues(address collateral)\n external\n view\n returns (uint256 mint, uint256 burn, uint256 ratio, uint256 minRatio, uint256 redemption);\n\n /// @notice Returns the data used to compute oracle values for `collateral`\n /// @return oracleType Type of oracle (Chainlink, external smart contract, ...)\n /// @return targetType Type passed to read the value of the target price\n /// @return oracleData Extra data needed to read the oracle. For Chainlink oracles, this data is supposed to give\n /// the addresses of the Chainlink feeds to read, the stale periods for each feed, ...\n /// @return targetData Extra data needed to read the target price of the asset\n function getOracle(address collateral)\n external\n view\n returns (\n OracleReadType oracleType,\n OracleReadType targetType,\n bytes memory oracleData,\n bytes memory targetData,\n bytes memory hyperparameters\n );\n\n /// @notice Returns if the associated functionality is paused or not\n function isPaused(address collateral, ActionType action) external view returns (bool);\n\n /// @notice Returns if `sender` is trusted to update normalizers\n function isTrusted(address sender) external view returns (bool);\n\n /// @notice Returns if `sender` is trusted to update sell rewards\n function isTrustedSeller(address sender) external view returns (bool);\n\n /// @notice Checks whether `sender` has a non null entry in the `isWhitelistedForType` storage mapping\n /// @dev Note that ultimately whitelisting may depend as well on external providers\n function isWhitelistedForType(WhitelistType whitelistType, address sender) external view returns (bool);\n\n /// @notice Checks whether `sender` can deal with `collateral` during burns and redemptions\n function isWhitelistedForCollateral(address collateral, address sender) external returns (bool);\n\n /// @notice Checks whether only whitelisted address can deal with `collateral` during burns and redemptions\n function isWhitelistedCollateral(address collateral) external view returns (bool);\n\n /// @notice Gets the data needed to deal with whitelists for `collateral`\n function getCollateralWhitelistData(address collateral) external view returns (bytes memory);\n\n /// @notice Returns the stablecoin cap for `collateral`\n function getStablecoinCap(address collateral) external view returns (uint256);\n\n /// @notice Returns the address of the `accessManager` contract\n function accessManager() external view returns (address);\n\n /// @dev Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is\n /// being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs\n /// attacker controlled calls.\n function isConsumingScheduledOp() external view returns (bytes4);\n}\n" + }, + "contracts/interfaces/IHarvester.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\n/// @title IHarvester\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This interface is an authorized fork of Angle's `IHarvester` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IHarvester.sol\ninterface IHarvester {\n function setYieldBearingAssetData(\n address yieldBearingAsset,\n address stablecoin,\n uint64 targetExposure,\n uint64 minExposureYieldAsset,\n uint64 maxExposureYieldAsset,\n uint64 overrideExposures,\n uint96 maxSlippage\n )\n external;\n\n function updateLimitExposuresYieldAsset(address yieldBearingAsset) external;\n\n function setMaxSlippage(address yieldBearingAsset, uint96 newMaxSlippage) external;\n\n function harvest(address yieldBearingAsset, uint256 scale, bytes calldata extraData) external;\n}\n" + }, + "contracts/interfaces/IManager.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\n/// @title IManager\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This interface is an authorized fork of Angle's `IManager` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IManager.sol\ninterface IManager {\n /// @notice Returns the amount of collateral managed by the Manager\n /// @return balances Balances of all the subCollaterals handled by the manager\n /// @dev MUST NOT revert\n function totalAssets() external view returns (uint256[] memory balances, uint256 totalValue);\n\n /// @notice Hook to invest `amount` of `collateral`\n /// @dev MUST revert if the manager cannot accept these funds\n /// @dev MUST have received the funds beforehand\n function invest(uint256 amount) external;\n\n /// @notice Sends `amount` of `collateral` to the `to` address\n /// @dev Called when `tokenP` are burnt and during redemptions\n // @dev MUST revert if there are not funds enough available\n /// @dev MUST be callable only by the parallelizer\n function release(address asset, address to, uint256 amount) external;\n\n /// @notice Gives the maximum amount of collateral immediately available for a transfer\n /// @dev Useful for integrators using `quoteIn` and `quoteOut`\n function maxAvailable() external view returns (uint256);\n}\n" + }, + "contracts/interfaces/IParallelizer.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\nimport { IDiamondCut } from \"./IDiamondCut.sol\";\nimport { IDiamondEtherscan } from \"./IDiamondEtherscan.sol\";\nimport { IDiamondLoupe } from \"./IDiamondLoupe.sol\";\nimport { IGetters } from \"./IGetters.sol\";\nimport { IRedeemer } from \"./IRedeemer.sol\";\nimport { IRewardHandler } from \"./IRewardHandler.sol\";\nimport { ISettersGovernor, ISettersGuardian } from \"./ISetters.sol\";\nimport { ISwapper } from \"./ISwapper.sol\";\n\n/// @title IParallelizer\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This interface is an authorized fork of Angle's `IParallelizer` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IParallelizer.sol\ninterface IParallelizer is\n IDiamondCut,\n IDiamondEtherscan,\n IDiamondLoupe,\n IGetters,\n IRedeemer,\n IRewardHandler,\n ISettersGovernor,\n ISettersGuardian,\n ISwapper\n{ }\n" + }, + "contracts/interfaces/IParallelizerOracle.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\n/// @title IParallelizerOracle\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This interface is an authorized fork of Angle's `IParallelizerOracle` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IParallelizerOracle.sol\ninterface IParallelizerOracle {\n /// @notice Reads the oracle value for asset to use in a redemption to compute the collateral ratio\n function readRedemption() external view returns (uint256);\n\n /// @notice Reads the oracle value for asset to use in a mint. It should be comprehensive of the\n /// deviation from the target price\n function readMint() external view returns (uint256);\n\n /// @notice Reads the oracle value for asset to use in a burn transaction as well as the ratio\n /// between the current price and the target price for the asset\n function readBurn() external view returns (uint256 oracleValue, uint256 ratio);\n\n /// @notice Reads the oracle value for asset\n function read() external view returns (uint256);\n}\n" + }, + "contracts/interfaces/IPool.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\n/// @title IPool\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This interface is an authorized fork of Angle's `IPool` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IPool.sol\ninterface IPool {\n function deposit(uint256 assets, address lender) external returns (uint256 shares, uint256 transferInDayTimestamp);\n\n function requestRedeem(uint256 shares) external returns (uint256 assets);\n\n function convertToAssets(uint256 shares) external view returns (uint256 assets);\n\n function convertToShares(uint256 assets) external view returns (uint256 shares);\n}\n" + }, + "contracts/interfaces/IRedeemer.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\n/// @title IRedeemer\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This interface is an authorized fork of Angle's `IRedeemer` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IRedeemer.sol\ninterface IRedeemer {\n /// @notice Redeems `amount` of stablecoins from the system\n /// @param receiver Address which should be receiving the output tokens\n /// @param deadline Timestamp before which the redemption should have occured\n /// @param minAmountOuts Minimum amount of each token given back in the redemption to obtain\n /// @return tokens List of tokens returned\n /// @return amounts Amount given for each token in the `tokens` array\n function redeem(\n uint256 amount,\n address receiver,\n uint256 deadline,\n uint256[] memory minAmountOuts\n )\n external\n returns (address[] memory tokens, uint256[] memory amounts);\n\n /// @notice Same as the redeem function above with the additional feature to specify a list of `forfeitTokens` for\n /// which the Parallelizer system will not try to do a transfer to `receiver`.\n function redeemWithForfeit(\n uint256 amount,\n address receiver,\n uint256 deadline,\n uint256[] memory minAmountOuts,\n address[] memory forfeitTokens\n )\n external\n returns (address[] memory tokens, uint256[] memory amounts);\n\n /// @notice Simulate the exact output that a redemption of `amount` of stablecoins would give at a given block\n /// @return tokens List of tokens that would be given\n /// @return amounts Amount that would be obtained for each token in the `tokens` array\n function quoteRedemptionCurve(uint256 amount)\n external\n view\n returns (address[] memory tokens, uint256[] memory amounts);\n\n /// @notice Updates the normalizer variable by `amount`\n function updateNormalizer(uint256 amount, bool increase) external returns (uint256);\n}\n" + }, + "contracts/interfaces/IRewardHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\n/// @title IRewardHandler\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This interface is an authorized fork of Angle's `IRewardHandler` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IRewardHandler.sol\ninterface IRewardHandler {\n /// @notice Sells some external tokens through a odos call\n /// @param minAmountOut Minimum amount of the outToken to get\n /// @param payload Payload to pass to odos\n /// @return amountOut Amount obtained of the outToken\n function sellRewards(uint256 minAmountOut, bytes memory payload) external returns (uint256 amountOut);\n}\n" + }, + "contracts/interfaces/ISetters.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\nimport { IERC20 } from \"@openzeppelin/contracts/interfaces/IERC20.sol\";\n\nimport \"../parallelizer/Storage.sol\";\n\n/// @title ISettersGovernor\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This interface is an authorized fork of Angle's `ISettersGovernor` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/ISetters.sol\ninterface ISettersGovernor {\n /// @notice Recovers `amount` of `token` from the Parallelizer contract\n function recoverERC20(address collateral, IERC20 token, address to, uint256 amount) external;\n\n /// @notice Sets a new access manager address\n function setAccessManager(address _newAccessManager) external;\n\n /// @notice Sets (or unsets) a collateral manager `collateral`\n /// @dev If `checkExternalManagerBalance` is true, the function will check that the current manager no longer has\n /// assets before setting the new manager\n function setCollateralManager(\n address collateral,\n bool checkExternalManagerBalance,\n ManagerStorage memory managerData\n )\n external;\n\n /// @notice Sets the allowance of the contract on `token` for `spender` to `amount`\n function changeAllowance(IERC20 token, address spender, uint256 amount) external;\n\n /// @notice Changes the trusted status for `sender` when for selling rewards or updating the normalizer\n function toggleTrusted(address sender, TrustedType t) external;\n\n /// @notice Changes whether a `collateral` can only be handled during burns and redemptions by whitelisted\n /// addresses\n /// and sets the data used to read into the whitelist\n function setWhitelistStatus(address collateral, uint8 whitelistStatus, bytes memory whitelistData) external;\n\n /// @notice Add `collateral` as a supported collateral in the system\n function addCollateral(address collateral) external;\n\n /// @notice Adjusts the amount of stablecoins issued from `collateral` by `amount`\n function adjustStablecoins(address collateral, uint128 amount, bool increase) external;\n\n /// @notice Revokes `collateral` from the system\n /// @dev If `checkExternalManagerBalance` is true, the function will check that the current manager no longer has\n /// assets before revoking the collateral\n function revokeCollateral(address collateral, bool checkExternalManagerBalance) external;\n\n /// @notice Sets the `oracleConfig` used to read the value of `collateral` for the mint, burn and redemption\n /// operations\n function setOracle(address collateral, bytes memory oracleConfig) external;\n\n /// @notice Update oracle data for a given `collateral`\n function updateOracle(address collateral) external;\n}\n\n/// @title ISettersGovernor\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\ninterface ISettersGuardian {\n /// @notice Changes the pause status for mint or burn transactions for `collateral`\n function togglePause(address collateral, ActionType action) external;\n\n /// @notice Sets the mint or burn fees for `collateral`\n function setFees(address collateral, uint64[] memory xFee, int64[] memory yFee, bool mint) external;\n\n /// @notice Sets the parameters for the redemption curve\n function setRedemptionCurveParams(uint64[] memory xFee, int64[] memory yFee) external;\n\n /// @notice Changes the whitelist status for a collateral with `whitelistType` for an address `who`\n function toggleWhitelist(WhitelistType whitelistType, address who) external;\n\n /// @notice Sets the stablecoin cap that can be issued from a `collateral`\n function setStablecoinCap(address collateral, uint256 stablecoinCap) external;\n}\n" + }, + "contracts/interfaces/ISwapper.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\n/// @title ISwapper\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This interface is an authorized fork of Angle's `ISwapper` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/ISwapper.sol\ninterface ISwapper {\n /// @notice Swaps (that is to say mints or burns) an exact amount of `tokenIn` for an amount of `tokenOut`\n /// @param amountIn Amount of `tokenIn` to bring\n /// @param amountOutMin Minimum amount of `tokenOut` to get: if `amountOut` is inferior to this amount, the\n /// function will revert\n /// @param tokenIn Token to bring for the swap\n /// @param tokenOut Token to get out of the swap\n /// @param to Address to which `tokenOut` must be sent\n /// @param deadline Timestamp before which the transaction must be executed\n /// @return amountOut Amount of `tokenOut` obtained through the swap\n function swapExactInput(\n uint256 amountIn,\n uint256 amountOutMin,\n address tokenIn,\n address tokenOut,\n address to,\n uint256 deadline\n )\n external\n returns (uint256 amountOut);\n\n /// @notice Same as `swapExactInput`, but using Permit2 signatures for `tokenIn`\n /// @dev Can only be used to mint, hence `tokenOut` is not needed\n function swapExactInputWithPermit(\n uint256 amountIn,\n uint256 amountOutMin,\n address tokenIn,\n address to,\n uint256 deadline,\n bytes calldata permitData\n )\n external\n returns (uint256 amountOut);\n\n /// @notice Swaps (that is to say mints or burns) an amount of `tokenIn` for an exact amount of `tokenOut`\n /// @param amountOut Amount of `tokenOut` to obtain from the swap\n /// @param amountInMax Maximum amount of `tokenIn` to bring in order to get `amountOut` of `tokenOut`\n /// @param tokenIn Token to bring for the swap\n /// @param tokenOut Token to get out of the swap\n /// @param to Address to which `tokenOut` must be sent\n /// @param deadline Timestamp before which the transaction must be executed\n /// @return amountIn Amount of `tokenIn` used to perform the swap\n function swapExactOutput(\n uint256 amountOut,\n uint256 amountInMax,\n address tokenIn,\n address tokenOut,\n address to,\n uint256 deadline\n )\n external\n returns (uint256 amountIn);\n\n /// @notice Same as `swapExactOutput`, but using Permit2 signatures for `tokenIn`\n /// @dev Can only be used to mint, hence `tokenOut` is not needed\n function swapExactOutputWithPermit(\n uint256 amountOut,\n uint256 amountInMax,\n address tokenIn,\n address to,\n uint256 deadline,\n bytes calldata permitData\n )\n external\n returns (uint256 amountIn);\n\n /// @notice Simulates what a call to `swapExactInput` with `amountIn` of `tokenIn` for `tokenOut` would give.\n /// If called right before and at the same block, the `amountOut` outputted by this function is exactly the\n /// amount that will be obtained with `swapExactInput`\n function quoteIn(uint256 amountIn, address tokenIn, address tokenOut) external view returns (uint256 amountOut);\n\n /// @notice Simulates what a call to `swapExactOutput` for `amountOut` of `tokenOut` with `tokenIn` would give.\n /// If called right before and at the same block, the `amountIn` outputted by this function is exactly the\n /// amount that will be obtained with `swapExactOutput`\n function quoteOut(uint256 amountOut, address tokenIn, address tokenOut) external view returns (uint256 amountIn);\n}\n" + }, + "contracts/interfaces/ITokenP.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/// @title ITokenP\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @notice Interface for the stablecoins `tokenP` contracts\n/// @dev This interface is an authorized fork of Angle's `IAgToken` interface\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/interfaces/IAgToken.sol\ninterface ITokenP is IERC20 {\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n MINTER ROLE ONLY FUNCTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Lets a whitelisted contract mint tokenPs\n /// @param account Address to mint to\n /// @param amount Amount to mint\n function mint(address account, uint256 amount) external;\n\n /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`\n /// @param amount Amount of tokens to burn\n /// @param burner Address to burn from\n /// @param sender Address which requested the burn from `burner`\n /// @dev This method is to be called by a contract with the minter right after being requested\n /// to do so by a `sender` address willing to burn tokens from another `burner` address\n /// @dev The method checks the allowance between the `sender` and the `burner`\n function burnFrom(uint256 amount, address burner, address sender) external;\n\n /// @notice Burns `amount` tokens from a `burner` address\n /// @param amount Amount of tokens to burn\n /// @param burner Address to burn from\n /// @dev This method is to be called by a contract with a minter right on the tokenP after being\n /// requested to do so by an address willing to burn tokens from its address\n function burnSelf(uint256 amount, address burner) external;\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n EXTERNAL FUNCTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Amount of decimals of the stablecoin\n function decimals() external view returns (uint8);\n}\n" + }, + "contracts/parallelizer/configs/DiamondInitializer.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport \"./DiamondInitializerTypes.sol\";\n\n/// @dev This contract is used only once to initialize the diamond proxy.\ncontract DiamondInitializer {\n function initialize(\n IAccessManager _accessManager,\n address _tokenP,\n CollateralSetup[] memory _collaterals,\n RedemptionSetup memory _redemptionSetup\n )\n external\n {\n LibSetters.setAccessManager(_accessManager);\n\n ParallelizerStorage storage ts = s.transmuterStorage();\n ts.statusReentrant = NOT_ENTERED;\n ts.normalizer = uint128(BASE_27);\n ts.tokenP = ITokenP(_tokenP);\n\n // Setup each collateral\n uint256 collateralsLength = _collaterals.length;\n for (uint256 i; i < collateralsLength; i++) {\n CollateralSetup memory collateral = _collaterals[i];\n LibSetters.addCollateral(collateral.token);\n LibSetters.setOracle(collateral.token, collateral.oracleConfig);\n // Mint fees\n LibSetters.setFees(collateral.token, collateral.xMintFee, collateral.yMintFee, true);\n // Burn fees\n LibSetters.setFees(collateral.token, collateral.xBurnFee, collateral.yBurnFee, false);\n LibSetters.togglePause(collateral.token, ActionType.Mint);\n LibSetters.togglePause(collateral.token, ActionType.Burn);\n }\n\n // setRedemptionCurveParams\n if (_redemptionSetup.xRedeemFee.length > 0) {\n LibSetters.togglePause(address(0), ActionType.Redeem);\n LibSetters.setRedemptionCurveParams(_redemptionSetup.xRedeemFee, _redemptionSetup.yRedeemFee);\n }\n }\n}\n" + }, + "contracts/parallelizer/configs/DiamondInitializerTypes.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { IAccessManager } from \"@openzeppelin/contracts/access/manager/IAccessManager.sol\";\n\nimport { LibDiamondEtherscan } from \"../libraries/LibDiamondEtherscan.sol\";\nimport { LibOracle } from \"../libraries/LibOracle.sol\";\nimport { LibSetters } from \"../libraries/LibSetters.sol\";\nimport { LibStorage as s } from \"../libraries/LibStorage.sol\";\n\nimport \"../../utils/Constants.sol\";\nimport \"../Storage.sol\";\n\nstruct CollateralSetup {\n address token;\n bytes oracleConfig;\n uint64[] xMintFee;\n int64[] yMintFee;\n uint64[] xBurnFee;\n int64[] yBurnFee;\n}\n\nstruct RedemptionSetup {\n uint64[] xRedeemFee;\n int64[] yRedeemFee;\n}\n" + }, + "contracts/parallelizer/configs/Test.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport \"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\";\n\nimport \"../libraries/LibOracle.sol\";\nimport { LibSetters } from \"../libraries/LibSetters.sol\";\nimport { LibStorage as s } from \"../libraries/LibStorage.sol\";\n\nimport \"../../utils/Constants.sol\";\nimport \"../Storage.sol\";\n\nstruct CollateralSetup {\n address collateral;\n address oracle;\n}\n\n/// @dev This contract is used only once to initialize the diamond proxy.\ncontract Test {\n function initialize(\n IAccessManager _accessManager,\n address _tokenP,\n CollateralSetup calldata eurA,\n CollateralSetup calldata eurB,\n CollateralSetup calldata eurY\n )\n external\n {\n LibSetters.setAccessManager(_accessManager);\n\n ParallelizerStorage storage ts = s.transmuterStorage();\n ts.statusReentrant = NOT_ENTERED;\n ts.normalizer = uint128(BASE_27);\n ts.tokenP = ITokenP(_tokenP);\n\n // Setup first collateral\n LibSetters.addCollateral(eurA.collateral);\n AggregatorV3Interface[] memory circuitChainlink = new AggregatorV3Interface[](1);\n uint32[] memory stalePeriods = new uint32[](1);\n uint8[] memory circuitChainIsMultiplied = new uint8[](1);\n uint8[] memory chainlinkDecimals = new uint8[](1);\n circuitChainlink[0] = AggregatorV3Interface(eurA.oracle);\n stalePeriods[0] = 1 hours;\n circuitChainIsMultiplied[0] = 1;\n chainlinkDecimals[0] = 8;\n OracleQuoteType quoteType = OracleQuoteType.UNIT;\n bytes memory readData =\n abi.encode(circuitChainlink, stalePeriods, circuitChainIsMultiplied, chainlinkDecimals, quoteType);\n bytes memory targetData;\n LibSetters.setOracle(\n eurA.collateral,\n abi.encode(\n OracleReadType.CHAINLINK_FEEDS, OracleReadType.STABLE, readData, targetData, abi.encode(uint128(0), uint128(0))\n )\n );\n\n // Fees\n uint64[] memory xMintFee = new uint64[](4);\n xMintFee[0] = uint64(0);\n xMintFee[1] = uint64((40 * BASE_9) / 100);\n xMintFee[2] = uint64((45 * BASE_9) / 100);\n xMintFee[3] = uint64((70 * BASE_9) / 100);\n\n // Linear at 1%, 3% at 45%, then steep to 100%\n int64[] memory yMintFee = new int64[](4);\n yMintFee[0] = int64(uint64(BASE_9 / 99));\n yMintFee[1] = int64(uint64(BASE_9 / 99));\n yMintFee[2] = int64(uint64((3 * BASE_9) / 97));\n yMintFee[3] = int64(uint64(BASE_12 - 1));\n\n LibSetters.setFees(eurA.collateral, xMintFee, yMintFee, true);\n LibSetters.togglePause(eurA.collateral, ActionType.Mint);\n\n uint64[] memory xBurnFee = new uint64[](4);\n xBurnFee[0] = uint64(BASE_9);\n xBurnFee[1] = uint64((40 * BASE_9) / 100);\n xBurnFee[2] = uint64((35 * BASE_9) / 100);\n xBurnFee[3] = uint64(BASE_9 / 100);\n\n // Linear at 1%, 3% at 35%, then steep to 100%\n int64[] memory yBurnFee = new int64[](4);\n yBurnFee[0] = int64(uint64(BASE_9 / 99));\n yBurnFee[1] = int64(uint64(BASE_9 / 99));\n yBurnFee[2] = int64(uint64((3 * BASE_9) / 97));\n yBurnFee[3] = int64(uint64(MAX_BURN_FEE - 1));\n\n LibSetters.setFees(eurA.collateral, xBurnFee, yBurnFee, false);\n LibSetters.togglePause(eurA.collateral, ActionType.Burn);\n\n // Setup second collateral\n LibSetters.addCollateral(eurB.collateral);\n circuitChainlink = new AggregatorV3Interface[](1);\n stalePeriods = new uint32[](1);\n circuitChainIsMultiplied = new uint8[](1);\n chainlinkDecimals = new uint8[](1);\n circuitChainlink[0] = AggregatorV3Interface(eurB.oracle);\n stalePeriods[0] = 1 hours;\n circuitChainIsMultiplied[0] = 1;\n chainlinkDecimals[0] = 8;\n quoteType = OracleQuoteType.UNIT;\n readData = abi.encode(circuitChainlink, stalePeriods, circuitChainIsMultiplied, chainlinkDecimals, quoteType);\n LibSetters.setOracle(\n eurB.collateral,\n abi.encode(\n OracleReadType.CHAINLINK_FEEDS, OracleReadType.STABLE, readData, targetData, abi.encode(uint128(0), uint128(0))\n )\n );\n\n // Fees\n xMintFee = new uint64[](4);\n xMintFee[0] = uint64(0);\n xMintFee[1] = uint64((40 * BASE_9) / 100);\n xMintFee[2] = uint64((42 * BASE_9) / 100);\n xMintFee[3] = uint64((70 * BASE_9) / 100);\n\n // Linear at 1%, 5% at 42%, then steep to 100%\n yMintFee = new int64[](4);\n yMintFee[0] = int64(uint64(BASE_9 / 100));\n yMintFee[1] = int64(uint64(BASE_9 / 100));\n yMintFee[2] = int64(uint64((5 * BASE_9) / 100));\n yMintFee[3] = int64(uint64(BASE_12 - 1));\n\n LibSetters.setFees(eurB.collateral, xMintFee, yMintFee, true);\n LibSetters.togglePause(eurB.collateral, ActionType.Mint);\n\n xBurnFee = new uint64[](4);\n xBurnFee[0] = uint64(BASE_9);\n xBurnFee[1] = uint64((40 * BASE_9) / 100);\n xBurnFee[2] = uint64((37 * BASE_9) / 100);\n xBurnFee[3] = uint64(BASE_9 / 100);\n\n // Linear at 1%, 5% at 37%, then steep to 100%\n yBurnFee = new int64[](4);\n yBurnFee[0] = int64(uint64(BASE_9 / 100));\n yBurnFee[1] = int64(uint64(BASE_9 / 100));\n yBurnFee[2] = int64(uint64((5 * BASE_9) / 100));\n yBurnFee[3] = int64(uint64(MAX_BURN_FEE - 1));\n\n LibSetters.setFees(eurB.collateral, xBurnFee, yBurnFee, false);\n LibSetters.togglePause(eurB.collateral, ActionType.Burn);\n\n // Setup third collateral\n LibSetters.addCollateral(eurY.collateral);\n circuitChainlink = new AggregatorV3Interface[](1);\n stalePeriods = new uint32[](1);\n circuitChainIsMultiplied = new uint8[](1);\n chainlinkDecimals = new uint8[](1);\n circuitChainlink[0] = AggregatorV3Interface(eurY.oracle);\n stalePeriods[0] = 1 hours;\n circuitChainIsMultiplied[0] = 1;\n chainlinkDecimals[0] = 8;\n quoteType = OracleQuoteType.UNIT;\n readData = abi.encode(circuitChainlink, stalePeriods, circuitChainIsMultiplied, chainlinkDecimals, quoteType);\n LibSetters.setOracle(\n eurY.collateral,\n abi.encode(\n OracleReadType.CHAINLINK_FEEDS, OracleReadType.STABLE, readData, targetData, abi.encode(uint128(0), uint128(0))\n )\n );\n\n // Fees\n xMintFee = new uint64[](4);\n xMintFee[0] = uint64(0);\n xMintFee[1] = uint64((40 * BASE_9) / 100);\n xMintFee[2] = uint64((42 * BASE_9) / 100);\n xMintFee[3] = uint64((70 * BASE_9) / 100);\n\n // Linear at 1%, 5% at 42%, then steep to 100%\n yMintFee = new int64[](4);\n yMintFee[0] = int64(uint64(BASE_9 / 100));\n yMintFee[1] = int64(uint64(BASE_9 / 100));\n yMintFee[2] = int64(uint64((5 * BASE_9) / 100));\n yMintFee[3] = int64(uint64(BASE_12 - 1));\n\n LibSetters.setFees(eurY.collateral, xMintFee, yMintFee, true);\n LibSetters.togglePause(eurY.collateral, ActionType.Mint);\n\n xBurnFee = new uint64[](4);\n xBurnFee[0] = uint64(BASE_9);\n xBurnFee[1] = uint64((40 * BASE_9) / 100);\n xBurnFee[2] = uint64((37 * BASE_9) / 100);\n xBurnFee[3] = uint64(BASE_9 / 100);\n\n // Linear at 1%, 5% at 37%, then steep to 100%\n yBurnFee = new int64[](4);\n yBurnFee[0] = int64(uint64(BASE_9 / 100));\n yBurnFee[1] = int64(uint64(BASE_9 / 100));\n yBurnFee[2] = int64(uint64((5 * BASE_9) / 100));\n yBurnFee[3] = int64(uint64(MAX_BURN_FEE - 1));\n\n LibSetters.setFees(eurY.collateral, xBurnFee, yBurnFee, false);\n LibSetters.togglePause(eurY.collateral, ActionType.Burn);\n\n // Set no hard limits on stablecoin minting per collateral\n LibSetters.setStablecoinCap(eurA.collateral, type(uint256).max);\n LibSetters.setStablecoinCap(eurB.collateral, type(uint256).max);\n LibSetters.setStablecoinCap(eurY.collateral, type(uint256).max);\n\n // Redeem\n LibSetters.togglePause(eurA.collateral, ActionType.Redeem);\n }\n}\n" + }, + "contracts/parallelizer/DiamondProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport { LibDiamond } from \"./libraries/LibDiamond.sol\";\nimport { LibStorage as s } from \"./libraries/LibStorage.sol\";\n\nimport \"../utils/Errors.sol\";\nimport \"./Storage.sol\";\n\n/// @title DiamondProxy\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @notice Implementation of a Diamond Proxy\n/// @dev Reference: EIP-2535 Diamonds\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/Diamond.sol by mudgen\ncontract DiamondProxy {\n constructor(FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) payable {\n LibDiamond.diamondCut(_diamondCut, _init, _calldata);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n FALLBACK \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @dev 1. Find the facet for the function that is called.\n /// @dev 2. Delegate the execution to the found facet via `delegatecall`.\n fallback() external payable {\n DiamondStorage storage ds = s.diamondStorage();\n // Get facet from function selector\n address facetAddress = ds.selectorInfo[msg.sig].facetAddress;\n if (facetAddress == address(0)) {\n revert FunctionNotFound(msg.sig);\n }\n\n assembly (\"memory-safe\") {\n // The pointer to the free memory slot\n let ptr := mload(0x40)\n // Copy function signature and arguments from calldata at zero position into memory at pointer position\n calldatacopy(ptr, 0, calldatasize())\n // Delegatecall method of the implementation contract returns 0 on error\n let result := delegatecall(gas(), facetAddress, ptr, calldatasize(), 0, 0)\n // Get the size of the last return data\n let size := returndatasize()\n // Copy the size length of bytes from return data at zero position to pointer position\n returndatacopy(ptr, 0, size)\n // Depending on the result value\n switch result\n case 0 {\n // End execution and revert state changes\n revert(ptr, size)\n }\n default {\n // Return data with length of size at pointers position\n return(ptr, size)\n }\n }\n }\n}\n" + }, + "contracts/parallelizer/facets/AccessManagedModifiers.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { LibDiamond } from \"../libraries/LibDiamond.sol\";\nimport { LibStorage as s, ParallelizerStorage } from \"../libraries/LibStorage.sol\";\nimport \"../../utils/Errors.sol\";\nimport \"../../utils/Constants.sol\";\n\n/// @title AccessManagedModifiers\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This contract is an authorized fork of Angle's `AccessControlModifiers` contract\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/AccessControlModifiers.sol\n/// update access logic to use OpenZeppelin's `AccessManaged` logic\ncontract AccessManagedModifiers {\n /// @notice Checks whether the `msg.sender` can call a function with a given selector\n modifier restricted() {\n if (!LibDiamond.checkCanCall(msg.sender, msg.data)) revert AccessManagedUnauthorized(msg.sender);\n _;\n }\n\n /// @notice Prevents a contract from calling itself, directly or indirectly\n /// @dev This implementation is an adaptation of the OpenZepellin `ReentrancyGuard` for the purpose of this\n /// Diamond Proxy system. The base implementation can be found here\n /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol\n modifier nonReentrant() {\n ParallelizerStorage storage ts = s.transmuterStorage();\n // Reentrant protection\n // On the first call, `ts.statusReentrant` will be `NOT_ENTERED`\n if (ts.statusReentrant == ENTERED) revert ReentrantCall();\n // Any calls to the `nonReentrant` modifier after this point will fail\n ts.statusReentrant = ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n ts.statusReentrant = NOT_ENTERED;\n }\n}\n" + }, + "contracts/parallelizer/facets/DiamondCut.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport { IDiamondCut } from \"contracts/interfaces/IDiamondCut.sol\";\n\nimport { LibDiamond } from \"../libraries/LibDiamond.sol\";\n\nimport { AccessManagedModifiers } from \"./AccessManagedModifiers.sol\";\nimport \"../Storage.sol\";\n\n/// @title DiamondCut\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev Reference: EIP-2535 Diamonds\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/facets/DiamondCutFacet.sol by mudgen\ncontract DiamondCut is IDiamondCut, AccessManagedModifiers {\n /// @inheritdoc IDiamondCut\n function diamondCut(FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata) external restricted {\n LibDiamond.diamondCut(_diamondCut, _init, _calldata);\n }\n}\n" + }, + "contracts/parallelizer/facets/DiamondEtherscan.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport { IDiamondEtherscan } from \"contracts/interfaces/IDiamondEtherscan.sol\";\n\nimport { LibDiamondEtherscan } from \"../libraries/LibDiamondEtherscan.sol\";\nimport { AccessManagedModifiers } from \"./AccessManagedModifiers.sol\";\n\n/// @title DiamondEtherscan\n/// @author Forked from:\n/// https://github.com/zdenham/diamond-etherscan/blob/main/contracts/libraries/LibDiamondEtherscan.sol\ncontract DiamondEtherscan is IDiamondEtherscan, AccessManagedModifiers {\n /// @inheritdoc IDiamondEtherscan\n function setDummyImplementation(address _implementation) external restricted {\n LibDiamondEtherscan.setDummyImplementation(_implementation);\n }\n\n /// @inheritdoc IDiamondEtherscan\n function implementation() external view returns (address) {\n return LibDiamondEtherscan.dummyImplementation();\n }\n}\n" + }, + "contracts/parallelizer/facets/DiamondLoupe.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport { IDiamondLoupe } from \"contracts/interfaces/IDiamondLoupe.sol\";\n\nimport { LibStorage as s } from \"../libraries/LibStorage.sol\";\n\nimport \"../Storage.sol\";\n\n/// @title DiamondLoupe\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev Reference: EIP-2535 Diamonds\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/facets/DiamondLoupeFacet.sol by mudgen\ncontract DiamondLoupe is IDiamondLoupe {\n /// @inheritdoc IDiamondLoupe\n function facets() external view override returns (Facet[] memory facets_) {\n DiamondStorage storage ds = s.diamondStorage();\n uint256 selectorCount = ds.selectors.length;\n facets_ = new Facet[](selectorCount);\n uint16[] memory numFacetSelectors = new uint16[](selectorCount);\n uint256 numFacets;\n\n for (uint256 selectorIndex; selectorIndex < selectorCount; selectorIndex++) {\n bytes4 selector = ds.selectors[selectorIndex];\n address facetAddress_ = ds.selectorInfo[selector].facetAddress;\n bool continueLoop = false;\n // Find the functionSelectors array for selector and add selector to it\n for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) {\n if (facets_[facetIndex].facetAddress == facetAddress_) {\n facets_[facetIndex].functionSelectors[numFacetSelectors[facetIndex]] = selector;\n numFacetSelectors[facetIndex]++;\n continueLoop = true;\n break;\n }\n }\n // If functionSelectors array exists for selector then continue loop\n if (continueLoop) {\n continueLoop = false;\n continue;\n }\n\n // Create a new functionSelectors array for selector\n facets_[numFacets].facetAddress = facetAddress_;\n facets_[numFacets].functionSelectors = new bytes4[](selectorCount);\n facets_[numFacets].functionSelectors[0] = selector;\n numFacetSelectors[numFacets] = 1;\n numFacets++;\n }\n for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) {\n uint256 numSelectors = numFacetSelectors[facetIndex];\n bytes4[] memory selectors = facets_[facetIndex].functionSelectors;\n // Set the number of selectors\n assembly (\"memory-safe\") {\n mstore(selectors, numSelectors)\n }\n }\n // Set the number of facets\n assembly (\"memory-safe\") {\n mstore(facets_, numFacets)\n }\n }\n\n /// @inheritdoc IDiamondLoupe\n function facetFunctionSelectors(address _facet)\n external\n view\n override\n returns (bytes4[] memory _facetFunctionSelectors)\n {\n DiamondStorage storage ds = s.diamondStorage();\n uint256 selectorCount = ds.selectors.length;\n uint256 numSelectors;\n _facetFunctionSelectors = new bytes4[](selectorCount);\n\n for (uint256 selectorIndex; selectorIndex < selectorCount; selectorIndex++) {\n bytes4 selector = ds.selectors[selectorIndex];\n address facetAddress_ = ds.selectorInfo[selector].facetAddress;\n if (_facet == facetAddress_) {\n _facetFunctionSelectors[numSelectors] = selector;\n numSelectors++;\n }\n }\n // Set the number of selectors in the array\n assembly (\"memory-safe\") {\n mstore(_facetFunctionSelectors, numSelectors)\n }\n }\n\n /// @inheritdoc IDiamondLoupe\n function facetAddresses() external view override returns (address[] memory facetAddresses_) {\n DiamondStorage storage ds = s.diamondStorage();\n uint256 selectorCount = ds.selectors.length;\n // Create an array set to the maximum size possible\n facetAddresses_ = new address[](selectorCount);\n uint256 numFacets;\n // Loop through function selectors\n for (uint256 selectorIndex; selectorIndex < selectorCount; selectorIndex++) {\n bytes4 selector = ds.selectors[selectorIndex];\n address facetAddress_ = ds.selectorInfo[selector].facetAddress;\n bool continueLoop = false;\n // See if we have collected the address already and break out of loop if we have\n for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) {\n if (facetAddress_ == facetAddresses_[facetIndex]) {\n continueLoop = true;\n break;\n }\n }\n // Continue loop if we already have the address\n if (continueLoop) {\n continueLoop = false;\n continue;\n }\n // Include address\n facetAddresses_[numFacets] = facetAddress_;\n numFacets++;\n }\n // Set the number of facet addresses in the array\n assembly (\"memory-safe\") {\n mstore(facetAddresses_, numFacets)\n }\n }\n\n /// @inheritdoc IDiamondLoupe\n function facetAddress(bytes4 _functionSelector) external view override returns (address facetAddress_) {\n DiamondStorage storage ds = s.diamondStorage();\n facetAddress_ = ds.selectorInfo[_functionSelector].facetAddress;\n }\n}\n" + }, + "contracts/parallelizer/facets/Getters.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { IGetters } from \"contracts/interfaces/IGetters.sol\";\n\nimport { LibOracle } from \"../libraries/LibOracle.sol\";\nimport { LibGetters } from \"../libraries/LibGetters.sol\";\nimport { LibStorage as s } from \"../libraries/LibStorage.sol\";\nimport { LibWhitelist } from \"../libraries/LibWhitelist.sol\";\n\nimport \"../../utils/Constants.sol\";\nimport \"../../utils/Errors.sol\";\nimport \"../Storage.sol\";\n\n/// @title Getters\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev There may be duplicates in the info provided by the getters defined here\n/// @dev This contract is an authorized fork of Angle's `Getters` contract\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/Getters.sol\ncontract Getters is IGetters {\n /// @inheritdoc IGetters\n function isValidSelector(bytes4 selector) external view returns (bool) {\n return s.diamondStorage().selectorInfo[selector].facetAddress != address(0);\n }\n\n /// @inheritdoc IGetters\n function tokenP() external view returns (ITokenP) {\n return s.transmuterStorage().tokenP;\n }\n\n /// @inheritdoc IGetters\n function getCollateralList() external view returns (address[] memory) {\n return s.transmuterStorage().collateralList;\n }\n\n /// @inheritdoc IGetters\n function getCollateralInfo(address collateral) external view returns (Collateral memory) {\n return s.transmuterStorage().collaterals[collateral];\n }\n\n /// @inheritdoc IGetters\n function getCollateralDecimals(address collateral) external view returns (uint8) {\n return s.transmuterStorage().collaterals[collateral].decimals;\n }\n\n /// @inheritdoc IGetters\n function getCollateralMintFees(address collateral)\n external\n view\n returns (uint64[] memory xFeeMint, int64[] memory yFeeMint)\n {\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n return (collatInfo.xFeeMint, collatInfo.yFeeMint);\n }\n\n /// @inheritdoc IGetters\n function getCollateralBurnFees(address collateral)\n external\n view\n returns (uint64[] memory xFeeBurn, int64[] memory yFeeBurn)\n {\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n return (collatInfo.xFeeBurn, collatInfo.yFeeBurn);\n }\n\n /// @inheritdoc IGetters\n function getRedemptionFees()\n external\n view\n returns (uint64[] memory xRedemptionCurve, int64[] memory yRedemptionCurve)\n {\n ParallelizerStorage storage ts = s.transmuterStorage();\n return (ts.xRedemptionCurve, ts.yRedemptionCurve);\n }\n\n /// @inheritdoc IGetters\n /// @dev This function may revert and overflow if the collateral ratio is too big due to a too small\n /// amount of `stablecoinsIssued`. Due to this, it is recommended to initialize the system with a non\n /// negligible amount of `stablecoinsIssued` so DoS attacks on redemptions which use this function\n /// become economically impossible\n function getCollateralRatio() external view returns (uint64 collatRatio, uint256 stablecoinsIssued) {\n ParallelizerStorage storage ts = s.transmuterStorage();\n // Reentrant protection\n if (ts.statusReentrant == ENTERED) revert ReentrantCall();\n\n (collatRatio, stablecoinsIssued,,,) = LibGetters.getCollateralRatio();\n }\n\n /// @inheritdoc IGetters\n function getIssuedByCollateral(address collateral)\n external\n view\n returns (uint256 stablecoinsFromCollateral, uint256 stablecoinsIssued)\n {\n ParallelizerStorage storage ts = s.transmuterStorage();\n uint256 _normalizer = ts.normalizer;\n return (\n (uint256(ts.collaterals[collateral].normalizedStables) * _normalizer) / BASE_27,\n (uint256(ts.normalizedStables) * _normalizer) / BASE_27\n );\n }\n\n /// @inheritdoc IGetters\n function getTotalIssued() external view returns (uint256) {\n ParallelizerStorage storage ts = s.transmuterStorage();\n return (uint256(ts.normalizedStables) * uint256(ts.normalizer)) / BASE_27;\n }\n\n /// @inheritdoc IGetters\n function getManagerData(address collateral) external view returns (bool, IERC20[] memory, bytes memory) {\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n if (collatInfo.isManaged > 0) {\n return (true, collatInfo.managerData.subCollaterals, collatInfo.managerData.config);\n }\n return (false, new IERC20[](0), \"\");\n }\n\n /// @inheritdoc IGetters\n /// @dev This function is not optimized for gas consumption as for instance the `burn` value for collateral\n /// is computed twice: once in `readBurn` and once in `getBurnOracle`\n function getOracleValues(address collateral)\n external\n view\n returns (uint256 mint, uint256 burn, uint256 ratio, uint256 minRatio, uint256 redemption)\n {\n bytes memory oracleConfig = s.transmuterStorage().collaterals[collateral].oracleConfig;\n (burn, ratio) = LibOracle.readBurn(oracleConfig);\n (minRatio,) = LibOracle.getBurnOracle(collateral, oracleConfig);\n return (LibOracle.readMint(oracleConfig), burn, ratio, minRatio, LibOracle.readRedemption(oracleConfig));\n }\n\n /// @inheritdoc IGetters\n function getOracle(address collateral)\n external\n view\n returns (\n OracleReadType oracleType,\n OracleReadType targetType,\n bytes memory oracleData,\n bytes memory targetData,\n bytes memory hyperparameters\n )\n {\n return LibOracle.getOracle(collateral);\n }\n\n /// @inheritdoc IGetters\n function isPaused(address collateral, ActionType action) external view returns (bool) {\n if (action == ActionType.Mint || action == ActionType.Burn) {\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n if (collatInfo.decimals == 0) revert NotCollateral();\n if (action == ActionType.Mint) {\n return collatInfo.isMintLive == 0;\n } else {\n return collatInfo.isBurnLive == 0;\n }\n } else {\n return s.transmuterStorage().isRedemptionLive == 0;\n }\n }\n\n /// @inheritdoc IGetters\n function isTrusted(address sender) external view returns (bool) {\n return s.transmuterStorage().isTrusted[sender] == 1;\n }\n\n /// @inheritdoc IGetters\n function isTrustedSeller(address sender) external view returns (bool) {\n return s.transmuterStorage().isSellerTrusted[sender] == 1;\n }\n\n /// @inheritdoc IGetters\n function isWhitelistedForType(WhitelistType whitelistType, address sender) external view returns (bool) {\n return s.transmuterStorage().isWhitelistedForType[whitelistType][sender] > 0;\n }\n\n /// @inheritdoc IGetters\n /// @dev This function is non view as it may consult external non view functions from whitelist providers\n function isWhitelistedForCollateral(address collateral, address sender) external returns (bool) {\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n return (collatInfo.onlyWhitelisted == 0 || LibWhitelist.checkWhitelist(collatInfo.whitelistData, sender));\n }\n\n /// @inheritdoc IGetters\n function isWhitelistedCollateral(address collateral) external view returns (bool) {\n return s.transmuterStorage().collaterals[collateral].onlyWhitelisted == 1;\n }\n\n /// @inheritdoc IGetters\n function getCollateralWhitelistData(address collateral) external view returns (bytes memory) {\n return s.transmuterStorage().collaterals[collateral].whitelistData;\n }\n\n /// @inheritdoc IGetters\n function getStablecoinCap(address collateral) external view returns (uint256) {\n return s.transmuterStorage().collaterals[collateral].stablecoinCap;\n }\n\n /// @inheritdoc IGetters\n function accessManager() external view returns (address) {\n return address(s.diamondStorage().accessManager);\n }\n\n /// @inheritdoc IGetters\n function isConsumingScheduledOp() external view returns (bytes4) {\n return s.transmuterStorage().consumingSchedule ? this.isConsumingScheduledOp.selector : bytes4(0);\n }\n}\n" + }, + "contracts/parallelizer/facets/Redeemer.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { Math } from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\nimport { ITokenP } from \"contracts/interfaces/ITokenP.sol\";\nimport { IRedeemer } from \"contracts/interfaces/IRedeemer.sol\";\n\nimport { AccessManagedModifiers } from \"./AccessManagedModifiers.sol\";\nimport { LibDiamond } from \"../libraries/LibDiamond.sol\";\nimport { LibHelpers } from \"../libraries/LibHelpers.sol\";\nimport { LibGetters } from \"../libraries/LibGetters.sol\";\nimport { LibManager } from \"../libraries/LibManager.sol\";\nimport { LibStorage as s } from \"../libraries/LibStorage.sol\";\nimport { LibWhitelist } from \"../libraries/LibWhitelist.sol\";\n\nimport \"../../utils/Constants.sol\";\nimport \"../../utils/Errors.sol\";\nimport \"../Storage.sol\";\n\n/// @title Redeemer\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This contract is an authorized fork of Angle's `Redeemer` contract\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/Redeemer.sol\ncontract Redeemer is IRedeemer, AccessManagedModifiers {\n using SafeERC20 for IERC20;\n using Math for uint256;\n using SafeCast for uint256;\n\n event Redeemed(\n uint256 amount,\n address[] tokens,\n uint256[] amounts,\n address[] forfeitTokens,\n address indexed from,\n address indexed to\n );\n event NormalizerUpdated(uint256 newNormalizerValue);\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n EXTERNAL ACTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @inheritdoc IRedeemer\n /// @dev The `minAmountOuts` list must reflect the amount of `tokens` returned\n /// @dev In normal conditions, the amount of tokens outputted by this function should be the amount\n /// of collateral assets supported by the system, following their order in the `collateralList`.\n /// @dev If one collateral has its liquidity managed through strategies, then it's possible that this asset\n /// has sub-collaterals with it. In this situation, these sub-collaterals may be sent during the redemption\n /// process and the `minAmountOuts` will be bigger than the `collateralList` length. If there are 3 collateral\n /// assets and the 2nd collateral asset in the list (at index 1) consists of 3 sub-collaterals, then the ordering\n /// of the token list will be as follows:\n /// `[collat 1, sub-collat 1 of collat 2, sub-collat 2 of collat 2, sub-collat 3 of collat 2, collat 3]`\n /// @dev The list of tokens outputted (and hence the minimum length of the `minAmountOuts` list) can be obtained\n /// by calling the `quoteRedemptionCurve` function\n /// @dev Tokens requiring a whitelist must be forfeited if the redemption is to an address that is not in the\n /// whitelist, otherwise this function reverts\n /// @dev No approval is needed before calling this function\n function redeem(\n uint256 amount,\n address receiver,\n uint256 deadline,\n uint256[] memory minAmountOuts\n )\n external\n returns (address[] memory tokens, uint256[] memory amounts)\n {\n return _redeem(amount, receiver, deadline, minAmountOuts, new address[](0));\n }\n\n /// @inheritdoc IRedeemer\n /// @dev Beware that if a token is given in the `forfeitTokens` list, the redemption will not try to send token\n /// even if it has enough immediately available to send the amount\n function redeemWithForfeit(\n uint256 amount,\n address receiver,\n uint256 deadline,\n uint256[] memory minAmountOuts,\n address[] memory forfeitTokens\n )\n external\n returns (address[] memory tokens, uint256[] memory amounts)\n {\n return _redeem(amount, receiver, deadline, minAmountOuts, forfeitTokens);\n }\n\n /// @inheritdoc IRedeemer\n /// @dev This function may be called by trusted addresses: these could be for instance savings contract\n /// minting stablecoins when they notice a profit\n function updateNormalizer(uint256 amount, bool increase) external returns (uint256) {\n if (!LibDiamond.checkCanCall(msg.sender, msg.data) && s.transmuterStorage().isTrusted[msg.sender] == 0) {\n revert NotTrusted();\n }\n return _updateNormalizer(amount, increase);\n }\n\n /// @inheritdoc IRedeemer\n function quoteRedemptionCurve(uint256 amount)\n external\n view\n returns (address[] memory tokens, uint256[] memory amounts)\n {\n (tokens, amounts,) = _quoteRedemptionCurve(amount);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n INTERNAL HELPERS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Internal function of the `redeem` function in the `Redeemer` contract\n function _redeem(\n uint256 amount,\n address to,\n uint256 deadline,\n uint256[] memory minAmountOuts,\n address[] memory forfeitTokens\n )\n internal\n nonReentrant\n returns (address[] memory tokens, uint256[] memory amounts)\n {\n ParallelizerStorage storage ts = s.transmuterStorage();\n\n if (ts.isRedemptionLive == 0) revert Paused();\n if (block.timestamp > deadline) revert TooLate();\n\n uint256[] memory subCollateralsTracker;\n (tokens, amounts, subCollateralsTracker) = _quoteRedemptionCurve(amount);\n // Check that the provided slippage tokens length is identical to the redeem one\n uint256 amountsLength = amounts.length;\n // If a collateral is added and another one is removed after a redeem transaction is sent, the tokens\n // corresponding to the `minAmountOuts` given may not correspond to the actual collateral `tokens` of\n // the protocol\n if (amountsLength != minAmountOuts.length) revert InvalidLengths();\n // Updating the normalizer enables to simultaneously and proportionally reduce the amount\n // of stablecoins issued from each collateral without having to loop through each of them\n _updateNormalizer(amount, false);\n\n ITokenP(ts.tokenP).burnSelf(amount, msg.sender);\n\n address[] memory collateralListMem = ts.collateralList;\n uint256 indexCollateral;\n for (uint256 i; i < amountsLength; ++i) {\n if (amounts[i] < minAmountOuts[i]) revert TooSmallAmountOut();\n // If a token is in the `forfeitTokens` list, then it is not sent as part of the redemption process\n if (amounts[i] > 0 && LibHelpers.checkList(tokens[i], forfeitTokens) < 0) {\n Collateral storage collatInfo = ts.collaterals[collateralListMem[indexCollateral]];\n if (collatInfo.onlyWhitelisted > 0 && !LibWhitelist.checkWhitelist(collatInfo.whitelistData, to)) {\n revert NotWhitelisted();\n }\n if (collatInfo.isManaged > 0) {\n LibManager.release(tokens[i], to, amounts[i], collatInfo.managerData.config);\n } else {\n IERC20(tokens[i]).safeTransfer(to, amounts[i]);\n }\n }\n if (subCollateralsTracker[indexCollateral] - 1 <= i) ++indexCollateral;\n }\n emit Redeemed(amount, tokens, amounts, forfeitTokens, msg.sender, to);\n }\n\n /// @dev This function reverts if `stablecoinsIssued==0`, which is expected behavior as there is nothing to redeem\n /// anyway in this case, or if the `amountBurnt` is greater than `stablecoinsIssued`\n function _quoteRedemptionCurve(uint256 amountBurnt)\n internal\n view\n returns (address[] memory tokens, uint256[] memory balances, uint256[] memory subCollateralsTracker)\n {\n ParallelizerStorage storage ts = s.transmuterStorage();\n uint64 collatRatio;\n uint256 stablecoinsIssued;\n (collatRatio, stablecoinsIssued, tokens, balances, subCollateralsTracker) = LibGetters.getCollateralRatio();\n if (amountBurnt > stablecoinsIssued) revert TooBigAmountIn();\n int64[] memory yRedemptionCurveMem = ts.yRedemptionCurve;\n uint64 penaltyFactor;\n // If the protocol is under-collateralized, a penalty factor is applied to the returned amount of each asset\n if (collatRatio < BASE_9) {\n uint64[] memory xRedemptionCurveMem = ts.xRedemptionCurve;\n penaltyFactor = uint64(LibHelpers.piecewiseLinear(collatRatio, xRedemptionCurveMem, yRedemptionCurveMem));\n }\n\n for (uint256 i; i < balances.length; ++i) {\n // The amount given for each token in reserves does not depend on the price of the tokens in reserve:\n // it is a proportion of the balance for each token computed as the ratio between the stablecoins\n // burnt relative to the amount of stablecoins issued.\n // If the protocol is over-collateralized, the amount of each token given is inversely proportional\n // to the collateral ratio.\n balances[i] = collatRatio >= BASE_9\n ? (amountBurnt * balances[i] * (uint64(yRedemptionCurveMem[yRedemptionCurveMem.length - 1])))\n / (stablecoinsIssued * collatRatio)\n : (amountBurnt * balances[i] * penaltyFactor) / (stablecoinsIssued * BASE_9);\n }\n }\n\n /// @notice Updates the `normalizer` variable used to track stablecoins issued from each asset and globally\n function _updateNormalizer(uint256 amount, bool increase) internal returns (uint256 newNormalizerValue) {\n ParallelizerStorage storage ts = s.transmuterStorage();\n uint256 _normalizer = ts.normalizer;\n uint256 _normalizedStables = ts.normalizedStables;\n // In case of an increase, the update formula used is the simplified version of the formula below:\n /*\n _normalizer * (BASE_27 + BASE_27 * amount / stablecoinsIssued) / BASE_27\n = _normalizer + (_normalizer * BASE_27 * amount * (BASE_27 / (_normalizedStables * normalizer))) / BASE_27\n = _normalizer + BASE_27 * amount / _normalizedStables\n */\n if (increase) {\n newNormalizerValue = _normalizer + (amount * BASE_27) / _normalizedStables;\n } else {\n newNormalizerValue = _normalizer - (amount * BASE_27) / _normalizedStables;\n }\n // If the `normalizer` gets too small or too big, it must be renormalized to later avoid the propagation of\n // rounding errors, as well as overflows. In this case, the function has to iterate through all the\n // supported collateral assets\n if (newNormalizerValue <= BASE_18 || newNormalizerValue >= BASE_36) {\n address[] memory collateralListMem = ts.collateralList;\n uint256 collateralListLength = collateralListMem.length;\n // For each asset, we store the actual amount of stablecoins issued based on the `newNormalizerValue`\n // (and not a normalized value)\n // We ensure to preserve the invariant `sum(collateralNewNormalizedStables) = normalizedStables`\n uint128 newNormalizedStables;\n for (uint256 i; i < collateralListLength; ++i) {\n uint128 newCollateralNormalizedStable = (\n (uint256(ts.collaterals[collateralListMem[i]].normalizedStables) * newNormalizerValue) / BASE_27\n ).toUint128();\n newNormalizedStables += newCollateralNormalizedStable;\n ts.collaterals[collateralListMem[i]].normalizedStables = uint216(newCollateralNormalizedStable);\n }\n ts.normalizedStables = newNormalizedStables;\n newNormalizerValue = BASE_27;\n }\n ts.normalizer = newNormalizerValue.toUint128();\n emit NormalizerUpdated(newNormalizerValue);\n }\n}\n" + }, + "contracts/parallelizer/facets/RewardHandler.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport { IRewardHandler } from \"contracts/interfaces/IRewardHandler.sol\";\n\nimport { AccessManagedModifiers } from \"./AccessManagedModifiers.sol\";\n\nimport { LibDiamond } from \"../libraries/LibDiamond.sol\";\nimport { LibStorage as s } from \"../libraries/LibStorage.sol\";\nimport { LibManager } from \"../libraries/LibManager.sol\";\n\nimport \"../../utils/Constants.sol\";\nimport \"../../utils/Errors.sol\";\nimport \"../Storage.sol\";\n\n/// @title RewardHandler\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This contract is an authorized fork of Angle's `RewardHandler` contract\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/RewardHandler.sol\ncontract RewardHandler is IRewardHandler, AccessManagedModifiers {\n using SafeERC20 for IERC20;\n\n event RewardsSoldFor(address indexed tokenObtained, uint256 balanceUpdate);\n\n /// @notice IRewardHandler\n /// @dev It is impossible to sell a token that is a collateral through this function\n /// @dev Trusted sellers and governance only may call this function\n /// @dev Only governance can set which tokens can be swapped through this function by passing a prior approval\n /// transaction to Odos router for the token to be swapped\n function sellRewards(uint256 minAmountOut, bytes memory payload) external nonReentrant returns (uint256 amountOut) {\n ParallelizerStorage storage ts = s.transmuterStorage();\n if (!LibDiamond.checkCanCall(msg.sender, msg.data) && ts.isSellerTrusted[msg.sender] == 0) revert NotTrusted();\n address[] memory list = ts.collateralList;\n uint256 listLength = list.length;\n uint256[] memory balances = new uint256[](listLength);\n // Getting the balances of all collateral assets of the protocol to see if those do not decrease during\n // the swap: this is the only way to check that collateral assets have not been sold\n // Not checking the `subCollaterals` here as swaps should try to increase the balance of one collateral\n for (uint256 i; i < listLength; ++i) {\n balances[i] = IERC20(list[i]).balanceOf(address(this));\n }\n //solhint-disable-next-line\n (bool success, bytes memory result) = ODOS_ROUTER.call(payload);\n if (!success) _revertBytes(result);\n amountOut = abi.decode(result, (uint256));\n if (amountOut < minAmountOut) revert TooSmallAmountOut();\n bool hasIncreased;\n address collateral;\n for (uint256 i; i < listLength; ++i) {\n uint256 newBalance = IERC20(list[i]).balanceOf(address(this));\n if (newBalance < balances[i]) {\n revert InvalidSwap();\n } else if (newBalance > balances[i]) {\n hasIncreased = true;\n collateral = list[i];\n emit RewardsSoldFor(list[i], newBalance - balances[i]);\n }\n }\n if (!hasIncreased) revert InvalidSwap();\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n if (collatInfo.isManaged > 0) {\n IERC20(collateral).safeTransfer(LibManager.transferRecipient(collatInfo.managerData.config), amountOut);\n LibManager.invest(amountOut, collatInfo.managerData.config);\n }\n }\n\n /// @notice Processes odos revert messages\n function _revertBytes(bytes memory errMsg) private pure {\n if (errMsg.length > 0) {\n //solhint-disable-next-line\n assembly (\"memory-safe\") {\n revert(add(32, errMsg), mload(errMsg))\n }\n }\n revert OdosSwapFailed();\n }\n}\n" + }, + "contracts/parallelizer/facets/SettersGovernor.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { IERC20 } from \"@openzeppelin/contracts/interfaces/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport { ISettersGovernor } from \"contracts/interfaces/ISetters.sol\";\n\nimport { LibManager } from \"../libraries/LibManager.sol\";\nimport { LibOracle } from \"../libraries/LibOracle.sol\";\nimport { LibSetters } from \"../libraries/LibSetters.sol\";\nimport { LibStorage as s } from \"../libraries/LibStorage.sol\";\nimport { AccessManagedModifiers } from \"./AccessManagedModifiers.sol\";\n\nimport \"../../utils/Constants.sol\";\nimport \"../../utils/Errors.sol\";\nimport \"../Storage.sol\";\n\n/// @title SettersGovernor\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This contract is an authorized fork of Angle's `SettersGovernor` contract\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/SettersGovernor.sol\ncontract SettersGovernor is AccessManagedModifiers, ISettersGovernor {\n using SafeERC20 for IERC20;\n\n event Recovered(address indexed token, address indexed to, uint256 amount);\n\n /// @inheritdoc ISettersGovernor\n /// @dev No check is made on the collateral that is redeemed: this function could typically be used by a\n /// governance during a manual rebalance of the reserves of the system\n /// @dev `collateral` is different from `token` only in the case of a managed collateral\n function recoverERC20(address collateral, IERC20 token, address to, uint256 amount) external restricted {\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n if (collatInfo.isManaged > 0) LibManager.release(address(token), to, amount, collatInfo.managerData.config);\n else token.safeTransfer(to, amount);\n emit Recovered(address(token), to, amount);\n }\n\n /// @inheritdoc ISettersGovernor\n function setAccessManager(address _newAccessManager) external restricted {\n LibSetters.setAccessManager(IAccessManager(_newAccessManager));\n }\n\n /// @inheritdoc ISettersGovernor\n /// @dev Funds need to have been withdrawn from the eventual previous manager prior to this call\n function setCollateralManager(\n address collateral,\n bool checkExternalManagerBalance,\n ManagerStorage memory managerData\n )\n external\n restricted\n {\n LibSetters.setCollateralManager(collateral, checkExternalManagerBalance, managerData);\n }\n\n /// @inheritdoc ISettersGovernor\n /// @dev This function can typically be used to grant allowance to a newly added manager for it to pull the\n /// funds associated to the collateral it corresponds to\n function changeAllowance(IERC20 token, address spender, uint256 amount) external restricted {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance < amount) {\n token.safeIncreaseAllowance(spender, amount - currentAllowance);\n } else if (currentAllowance > amount) {\n token.safeDecreaseAllowance(spender, currentAllowance - amount);\n }\n }\n\n /// @inheritdoc ISettersGovernor\n function toggleTrusted(address sender, TrustedType t) external restricted {\n LibSetters.toggleTrusted(sender, t);\n }\n\n /// @inheritdoc ISettersGovernor\n /// @dev Collateral assets with a fee on transfer are not supported by the system\n function addCollateral(address collateral) external restricted {\n LibSetters.addCollateral(collateral);\n }\n\n /// @inheritdoc ISettersGovernor\n /// @dev The amount passed here must be an absolute amount\n function adjustStablecoins(address collateral, uint128 amount, bool increase) external restricted {\n LibSetters.adjustStablecoins(collateral, amount, increase);\n }\n\n /// @inheritdoc ISettersGovernor\n /// @dev Require `collatInfo.normalizedStables == 0`, that is to say that the collateral\n /// is not used to back stables\n /// @dev The system may still have a non null balance of the collateral that is revoked: this should later\n /// be handled through a recoverERC20 call\n /// @dev Funds needs to have been withdrew from the manager prior to this call if `checkExternalManagerBalance` is\n /// true\n function revokeCollateral(address collateral, bool checkExternalManagerBalance) external restricted {\n LibSetters.revokeCollateral(collateral, checkExternalManagerBalance);\n }\n\n /// @inheritdoc ISettersGovernor\n function setOracle(address collateral, bytes memory oracleConfig) external restricted {\n LibSetters.setOracle(collateral, oracleConfig);\n }\n\n function updateOracle(address collateral) external {\n if (s.transmuterStorage().isSellerTrusted[msg.sender] == 0) revert NotTrusted();\n LibOracle.updateOracle(collateral);\n }\n\n /// @inheritdoc ISettersGovernor\n function setWhitelistStatus(\n address collateral,\n uint8 whitelistStatus,\n bytes memory whitelistData\n )\n external\n restricted\n {\n LibSetters.setWhitelistStatus(collateral, whitelistStatus, whitelistData);\n }\n}\n" + }, + "contracts/parallelizer/facets/SettersGuardian.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { ISettersGuardian } from \"contracts/interfaces/ISetters.sol\";\n\nimport { LibSetters } from \"../libraries/LibSetters.sol\";\nimport { AccessManagedModifiers } from \"./AccessManagedModifiers.sol\";\n\nimport \"../Storage.sol\";\n\n/// @title SettersGuardian\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This contract is an authorized fork of Angle's `SettersGuardian` contract\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/facets/SettersGuardian.sol\ncontract SettersGuardian is AccessManagedModifiers, ISettersGuardian {\n /// @inheritdoc ISettersGuardian\n function togglePause(address collateral, ActionType pausedType) external restricted {\n LibSetters.togglePause(collateral, pausedType);\n }\n\n /// @inheritdoc ISettersGuardian\n function setFees(address collateral, uint64[] memory xFee, int64[] memory yFee, bool mint) external restricted {\n LibSetters.setFees(collateral, xFee, yFee, mint);\n }\n\n /// @inheritdoc ISettersGuardian\n function setRedemptionCurveParams(uint64[] memory xFee, int64[] memory yFee) external restricted {\n LibSetters.setRedemptionCurveParams(xFee, yFee);\n }\n\n /// @inheritdoc ISettersGuardian\n function toggleWhitelist(WhitelistType whitelistType, address who) external restricted {\n LibSetters.toggleWhitelist(whitelistType, who);\n }\n\n /// @inheritdoc ISettersGuardian\n function setStablecoinCap(address collateral, uint256 stablecoinCap) external restricted {\n LibSetters.setStablecoinCap(collateral, stablecoinCap);\n }\n}\n" + }, + "contracts/parallelizer/facets/Swapper.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { Math } from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\n\nimport { ITokenP } from \"contracts/interfaces/ITokenP.sol\";\nimport { ISwapper } from \"contracts/interfaces/ISwapper.sol\";\nimport { IPermit2, PermitTransferFrom } from \"contracts/interfaces/external/permit2/IPermit2.sol\";\nimport { SignatureTransferDetails, TokenPermissions } from \"contracts/interfaces/external/permit2/IPermit2.sol\";\n\nimport { AccessManagedModifiers } from \"./AccessManagedModifiers.sol\";\nimport { LibHelpers } from \"../libraries/LibHelpers.sol\";\nimport { LibManager } from \"../libraries/LibManager.sol\";\nimport { LibOracle } from \"../libraries/LibOracle.sol\";\nimport { LibStorage as s } from \"../libraries/LibStorage.sol\";\nimport { LibWhitelist } from \"../libraries/LibWhitelist.sol\";\n\nimport \"../../utils/Constants.sol\";\nimport \"../../utils/Errors.sol\";\nimport \"../Storage.sol\";\n\n// Struct to help storing local variables to avoid stack too deep issues\nstruct LocalVariables {\n bool isMint;\n bool isExact;\n uint256 lowerExposure;\n uint256 upperExposure;\n int256 lowerFees;\n int256 upperFees;\n uint256 amountToNextBreakPoint;\n uint256 stablecoinsIssued;\n uint256 otherStablecoinSupply;\n}\n\n/// @title Swapper\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev In all the functions of this contract, one of `tokenIn` or `tokenOut` must be the stablecoin, and\n/// one of `tokenOut` or `tokenIn` must be an accepted collateral. Depending on the `tokenIn` or `tokenOut` given,\n/// the functions will either handle a mint or a burn operation\n/// @dev In case of a burn, they will also revert if the system does not have enough of `amountOut` for `tokenOut`.\n/// This balance must be available either directly on the contract or, when applicable, through the underlying\n/// strategies that manage the collateral\n/// @dev Functions here may be paused for some collateral assets (for either mint or burn), in which case they'll\n/// revert\n/// @dev In case of a burn again, the swap functions will revert if the call concerns a collateral that requires a\n/// whitelist but the `to` address does not have it. The quote functions will not revert in this case.\n/// @dev Calling one of the swap functions in a burn case does not require any prior token approval\n/// @dev This contract is an authorized fork of Angle's `Swapper` contract\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/transmuter/facets/Swapper.sol\ncontract Swapper is ISwapper, AccessManagedModifiers {\n using SafeERC20 for IERC20;\n using SafeCast for uint256;\n using Address for address;\n using Math for uint256;\n\n // The `to` address is not indexed as there cannot be 4 indexed addresses in an event.\n event Swap(\n address indexed tokenIn,\n address indexed tokenOut,\n uint256 amountIn,\n uint256 amountOut,\n address indexed from,\n address to\n );\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n EXTERNAL ACTION FUNCTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n // For the four functions below, a value of `0` for the `deadline` parameters means that there will be no timestamp\n // check for when the swap is actually executed.\n\n /// @inheritdoc ISwapper\n /// @dev `msg.sender` must have approved this contract for at least `amountIn` for `tokenIn` for mint transactions\n function swapExactInput(\n uint256 amountIn,\n uint256 amountOutMin,\n address tokenIn,\n address tokenOut,\n address to,\n uint256 deadline\n )\n external\n returns (uint256 amountOut)\n {\n (bool mint, Collateral storage collatInfo) = _getMintBurn(tokenIn, tokenOut, deadline);\n amountOut =\n mint ? _quoteMintExactInput(collatInfo, amountIn) : _quoteBurnExactInput(tokenOut, collatInfo, amountIn);\n if (amountOut < amountOutMin) revert TooSmallAmountOut();\n _swap(amountIn, amountOut, tokenIn, tokenOut, to, mint, collatInfo, \"\");\n }\n\n /// @inheritdoc ISwapper\n function swapExactInputWithPermit(\n uint256 amountIn,\n uint256 amountOutMin,\n address tokenIn,\n address to,\n uint256 deadline,\n bytes memory permitData\n )\n external\n returns (uint256 amountOut)\n {\n (address tokenOut, Collateral storage collatInfo) = _getMint(tokenIn, deadline);\n amountOut = _quoteMintExactInput(collatInfo, amountIn);\n if (amountOut < amountOutMin) revert TooSmallAmountOut();\n permitData = _buildPermitTransferPayload(amountIn, amountIn, tokenIn, deadline, permitData, collatInfo);\n _swap(amountIn, amountOut, tokenIn, tokenOut, to, true, collatInfo, permitData);\n }\n\n /// @inheritdoc ISwapper\n /// @dev `msg.sender` must have approved this contract for an amount bigger than what `amountIn` will\n /// be before calling this function for a mint. Approving the contract for `tokenIn` with `amountInMax`\n /// will always be enough in this case\n function swapExactOutput(\n uint256 amountOut,\n uint256 amountInMax,\n address tokenIn,\n address tokenOut,\n address to,\n uint256 deadline\n )\n external\n returns (uint256 amountIn)\n {\n (bool mint, Collateral storage collatInfo) = _getMintBurn(tokenIn, tokenOut, deadline);\n amountIn =\n mint ? _quoteMintExactOutput(collatInfo, amountOut) : _quoteBurnExactOutput(tokenOut, collatInfo, amountOut);\n if (amountIn > amountInMax) revert TooBigAmountIn();\n _swap(amountIn, amountOut, tokenIn, tokenOut, to, mint, collatInfo, \"\");\n }\n\n /// @inheritdoc ISwapper\n function swapExactOutputWithPermit(\n uint256 amountOut,\n uint256 amountInMax,\n address tokenIn,\n address to,\n uint256 deadline,\n bytes memory permitData\n )\n public\n returns (uint256 amountIn)\n {\n (address tokenOut, Collateral storage collatInfo) = _getMint(tokenIn, deadline);\n amountIn = _quoteMintExactOutput(collatInfo, amountOut);\n if (amountIn > amountInMax) revert TooBigAmountIn();\n permitData = _buildPermitTransferPayload(amountIn, amountInMax, tokenIn, deadline, permitData, collatInfo);\n _swap(amountIn, amountOut, tokenIn, tokenOut, to, true, collatInfo, permitData);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n VIEW HELPERS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n // If these functions return a 0 `amountOut` or `amountIn` value, then calling one of the swap functions above\n // will not do anything.\n\n /// @inheritdoc ISwapper\n function quoteIn(uint256 amountIn, address tokenIn, address tokenOut) external view returns (uint256 amountOut) {\n ParallelizerStorage storage ts = s.transmuterStorage();\n (bool mint, Collateral storage collatInfo) = _getMintBurn(tokenIn, tokenOut, block.timestamp);\n if (mint) {\n amountOut = _quoteMintExactInput(collatInfo, amountIn);\n _checkHardCaps(collatInfo, amountOut, ts.normalizer);\n } else {\n amountOut = _quoteBurnExactInput(tokenOut, collatInfo, amountIn);\n _checkAmounts(tokenOut, collatInfo, amountOut);\n }\n }\n\n /// @inheritdoc ISwapper\n function quoteOut(uint256 amountOut, address tokenIn, address tokenOut) external view returns (uint256 amountIn) {\n ParallelizerStorage storage ts = s.transmuterStorage();\n (bool mint, Collateral storage collatInfo) = _getMintBurn(tokenIn, tokenOut, block.timestamp);\n if (mint) {\n _checkHardCaps(collatInfo, amountOut, ts.normalizer);\n return _quoteMintExactOutput(collatInfo, amountOut);\n } else {\n _checkAmounts(tokenOut, collatInfo, amountOut);\n return _quoteBurnExactOutput(tokenOut, collatInfo, amountOut);\n }\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n INTERNAL ACTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Processes the internal metric updates and the transfers following mint or burn operations\n function _swap(\n uint256 amountIn,\n uint256 amountOut,\n address tokenIn,\n address tokenOut,\n address to,\n bool mint,\n Collateral storage collatInfo,\n bytes memory permitData\n )\n internal\n nonReentrant\n {\n if (amountIn > 0 && amountOut > 0) {\n ParallelizerStorage storage ts = s.transmuterStorage();\n if (mint) {\n uint128 changeAmount = (amountOut.mulDiv(BASE_27, ts.normalizer, Math.Rounding.Ceil)).toUint128();\n // The amount of stablecoins issued from a collateral are not stored as absolute variables, but\n // as variables normalized by a `normalizer`\n collatInfo.normalizedStables = collatInfo.normalizedStables + uint216(changeAmount);\n _checkHardCaps(collatInfo, 0, ts.normalizer);\n ts.normalizedStables = ts.normalizedStables + changeAmount;\n if (permitData.length > 0) {\n PERMIT_2.functionCall(permitData);\n } else if (collatInfo.isManaged > 0) {\n IERC20(tokenIn).safeTransferFrom(\n msg.sender, LibManager.transferRecipient(collatInfo.managerData.config), amountIn\n );\n } else {\n IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), amountIn);\n }\n if (collatInfo.isManaged > 0) {\n LibManager.invest(amountIn, collatInfo.managerData.config);\n }\n ITokenP(tokenOut).mint(to, amountOut);\n } else {\n if (collatInfo.onlyWhitelisted > 0 && !LibWhitelist.checkWhitelist(collatInfo.whitelistData, to)) {\n revert NotWhitelisted();\n }\n uint128 changeAmount = ((amountIn * BASE_27) / ts.normalizer).toUint128();\n // This will underflow when the system is trying to burn more stablecoins than what has been issued\n // from this collateral\n collatInfo.normalizedStables = collatInfo.normalizedStables - uint216(changeAmount);\n ts.normalizedStables = ts.normalizedStables - changeAmount;\n ITokenP(tokenIn).burnSelf(amountIn, msg.sender);\n if (collatInfo.isManaged > 0) {\n LibManager.release(tokenOut, to, amountOut, collatInfo.managerData.config);\n } else {\n IERC20(tokenOut).safeTransfer(to, amountOut);\n }\n }\n emit Swap(tokenIn, tokenOut, amountIn, amountOut, msg.sender, to);\n }\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n INTERNAL VIEW \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Computes the `amountOut` of stablecoins to mint from `tokenIn` of a collateral with data `collatInfo`\n function _quoteMintExactInput(\n Collateral storage collatInfo,\n uint256 amountIn\n )\n internal\n view\n returns (uint256 amountOut)\n {\n uint256 oracleValue = LibOracle.readMint(collatInfo.oracleConfig);\n amountOut = LibHelpers.convertDecimalTo(oracleValue * amountIn, 18 + collatInfo.decimals, 18);\n amountOut = _quoteFees(collatInfo, QuoteType.MintExactInput, amountOut);\n }\n\n /// @notice Computes the `amountIn` of collateral to get during a mint of `amountOut` of stablecoins\n function _quoteMintExactOutput(\n Collateral storage collatInfo,\n uint256 amountOut\n )\n internal\n view\n returns (uint256 amountIn)\n {\n uint256 oracleValue = LibOracle.readMint(collatInfo.oracleConfig);\n amountIn = _quoteFees(collatInfo, QuoteType.MintExactOutput, amountOut);\n amountIn = LibHelpers.convertDecimalTo((amountIn * BASE_18) / oracleValue, 18, collatInfo.decimals);\n }\n\n /// @notice Computes the `amountIn` of stablecoins to burn to release `amountOut` of `collateral`\n function _quoteBurnExactOutput(\n address collateral,\n Collateral storage collatInfo,\n uint256 amountOut\n )\n internal\n view\n returns (uint256 amountIn)\n {\n (uint256 ratio, uint256 oracleValue) = LibOracle.getBurnOracle(collateral, collatInfo.oracleConfig);\n amountIn = Math.mulDiv(LibHelpers.convertDecimalTo(amountOut, collatInfo.decimals, 18), oracleValue, ratio);\n amountIn = _quoteFees(collatInfo, QuoteType.BurnExactOutput, amountIn);\n }\n\n /// @notice Computes the `amountOut` of `collateral` to give during a burn operation of `amountIn` of stablecoins\n function _quoteBurnExactInput(\n address collateral,\n Collateral storage collatInfo,\n uint256 amountIn\n )\n internal\n view\n returns (uint256 amountOut)\n {\n (uint256 ratio, uint256 oracleValue) = LibOracle.getBurnOracle(collateral, collatInfo.oracleConfig);\n amountOut = _quoteFees(collatInfo, QuoteType.BurnExactInput, amountIn);\n amountOut = LibHelpers.convertDecimalTo((amountOut * ratio) / oracleValue, 18, collatInfo.decimals);\n }\n\n /// @notice Computes the fees to apply during a mint or burn operation\n /// @dev This function leverages the mathematical computations of the appendix of the Parallelizer whitepaper\n /// @dev Cost of the function is linear in the length of the `xFeeMint` or `xFeeBurn` array\n function _quoteFees(\n Collateral storage collatInfo,\n QuoteType quoteType,\n uint256 amountStable\n )\n internal\n view\n returns (uint256)\n {\n LocalVariables memory v;\n v.isMint = _isMint(quoteType);\n v.isExact = _isExact(quoteType);\n uint256 n = v.isMint ? collatInfo.xFeeMint.length : collatInfo.xFeeBurn.length;\n\n uint256 currentExposure;\n {\n ParallelizerStorage storage ts = s.transmuterStorage();\n uint256 normalizedStablesMem = ts.normalizedStables;\n // Handling the initialisation and constant fees\n if (normalizedStablesMem == 0 || n == 1) {\n return _computeFee(quoteType, amountStable, v.isMint ? collatInfo.yFeeMint[0] : collatInfo.yFeeBurn[0]);\n }\n // Increasing precision for `currentExposure` because otherwise if there is a factor 1e9 between total\n // stablecoin supply and one specific collateral, exposure can be null\n currentExposure = uint64((collatInfo.normalizedStables * BASE_18) / normalizedStablesMem);\n\n uint256 normalizerMem = ts.normalizer;\n // Store the current amount of stablecoins issued from this collateral\n v.stablecoinsIssued = (uint256(collatInfo.normalizedStables) * normalizerMem) / BASE_27;\n v.otherStablecoinSupply = (normalizerMem * normalizedStablesMem) / BASE_27 - v.stablecoinsIssued;\n }\n\n uint256 amount;\n // Finding in which segment the current exposure to the collateral is\n uint256 i = LibHelpers.findLowerBound(\n v.isMint, v.isMint ? collatInfo.xFeeMint : collatInfo.xFeeBurn, uint64(BASE_9), uint64(currentExposure)\n );\n\n while (i < n - 1) {\n // We compute a linear by part function on the amount swapped\n // The `amountToNextBreakPoint` variable is the `b_{i+1}` value from the whitepaper\n if (v.isMint) {\n v.lowerExposure = collatInfo.xFeeMint[i];\n v.upperExposure = collatInfo.xFeeMint[i + 1];\n v.lowerFees = collatInfo.yFeeMint[i];\n v.upperFees = collatInfo.yFeeMint[i + 1];\n v.amountToNextBreakPoint =\n (v.otherStablecoinSupply * v.upperExposure) / (BASE_9 - v.upperExposure) - v.stablecoinsIssued;\n } else {\n // The exposures in the burn case are decreasing\n v.lowerExposure = collatInfo.xFeeBurn[i];\n v.upperExposure = collatInfo.xFeeBurn[i + 1];\n v.lowerFees = collatInfo.yFeeBurn[i];\n v.upperFees = collatInfo.yFeeBurn[i + 1];\n // The `b_{i+1}` value in the burn case is the opposite value of the mint case\n v.amountToNextBreakPoint =\n v.stablecoinsIssued - (v.otherStablecoinSupply * v.upperExposure) / (BASE_9 - v.upperExposure);\n }\n // Computing the `g_i(0)` value from the whitepaper\n int256 currentFees;\n // We can only enter the else in the first iteration of the loop as otherwise we will\n // always be at the beginning of the new segment\n if (v.lowerExposure * BASE_9 == currentExposure) {\n currentFees = v.lowerFees;\n } else if (v.lowerFees == v.upperFees) {\n currentFees = v.lowerFees;\n } else {\n // This is the opposite of the `b_i` value from the whitepaper.\n uint256 amountFromPrevBreakPoint = v.isMint\n ? v.stablecoinsIssued - (v.otherStablecoinSupply * v.lowerExposure) / (BASE_9 - v.lowerExposure)\n : (v.otherStablecoinSupply * v.lowerExposure) / (BASE_9 - v.lowerExposure) - v.stablecoinsIssued;\n\n // slope = (upperFees - lowerFees) / (amountToNextBreakPoint + amountFromPrevBreakPoint)\n // `currentFees` is the `g(0)` value from the whitepaper\n currentFees = v.lowerFees\n + int256(\n (uint256(v.upperFees - v.lowerFees) * amountFromPrevBreakPoint)\n / (v.amountToNextBreakPoint + amountFromPrevBreakPoint)\n );\n }\n {\n // In the mint case, when `!v.isExact`: = `b_{i+1} * (1+(g_i(0)+f_{i+1})/2)`\n uint256 amountToNextBreakPointNormalizer = v.isExact\n ? v.amountToNextBreakPoint\n : v.isMint\n ? _invertFeeMint(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2)\n : _applyFeeBurn(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2);\n\n if (amountToNextBreakPointNormalizer >= amountStable) {\n int64 midFee;\n if (v.isExact) {\n // `(g_i(0) + g_i(M)) / 2 = g(0) + (f_{i+1} - g(0)) * M / (2 * b_{i+1})`\n midFee = int64(\n currentFees\n + int256(\n amountStable.mulDiv(\n uint256((v.upperFees - currentFees)), 2 * amountToNextBreakPointNormalizer, Math.Rounding.Ceil\n )\n )\n );\n } else {\n // Here instead of computing the closed form expression for `m_t` derived in the whitepaper,\n // we are computing: `(g(0)+g_i(m_t))/2 = g(0)+(f_{i+1}-f_i)/(b_{i+1}-b_i)m_t/2\n\n // ac4 is the value of `2M(f_{i+1}-f_i)/(b_{i+1}-b_i) = 2M(f_{i+1}-g(0))/b_{i+1}` used\n // in the computation of `m_t` in both the mint and burn case\n uint256 ac4 = BASE_9.mulDiv(\n 2 * amountStable * uint256(v.upperFees - currentFees), v.amountToNextBreakPoint, Math.Rounding.Ceil\n );\n\n if (v.isMint) {\n // In the mint case:\n // `m_t = (-1-g(0)+sqrt[(1+g(0))**2+2M(f_{i+1}-g(0))/b_{i+1}])/((f_{i+1}-g(0))/b_{i+1})`\n // And so: g(0)+(f_{i+1}-f_i)/(b_{i+1}-b_i)m_t/2\n // = (g(0)-1+sqrt[(1+g(0))**2+2M(f_{i+1}-g(0))/b_{i+1}]) / 2\n midFee = int64(\n (\n int256(Math.sqrt((uint256(int256(BASE_9) + currentFees)) ** 2 + ac4, Math.Rounding.Ceil))\n + currentFees - int256(BASE_9)\n ) / 2\n );\n } else {\n // In the burn case:\n // `m_t = (1-g(0)+sqrt[(1-g(0))**2-2M(f_{i+1}-g(0))/b_{i+1}])/((f_{i+1}-g(0))/b_{i+1})`\n // And so: g(0)+(f_{i+1}-f_i)/(b_{i+1}-b_i)m_t/2\n // = (g(0)+1-sqrt[(1-g(0))**2-2M(f_{i+1}-g(0))/b_{i+1}]) / 2\n\n uint256 baseMinusCurrentSquared = (uint256(int256(BASE_9) - currentFees)) ** 2;\n // Mathematically, this condition is always verified, but rounding errors may make this\n // mathematical invariant break, in which case we consider that the square root is null\n if (baseMinusCurrentSquared < ac4) {\n midFee = int64((currentFees + int256(BASE_9)) / 2);\n } else {\n midFee = int64(\n int256(\n Math.mulDiv(\n uint256(\n currentFees + int256(BASE_9)\n - int256(Math.sqrt(baseMinusCurrentSquared - ac4, Math.Rounding.Floor))\n ),\n 1,\n 2,\n Math.Rounding.Ceil\n )\n )\n );\n }\n }\n }\n return amount + _computeFee(quoteType, amountStable, midFee);\n } else {\n amountStable -= amountToNextBreakPointNormalizer;\n amount += !v.isExact\n ? v.amountToNextBreakPoint\n : v.isMint\n ? _invertFeeMint(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2)\n : _applyFeeBurn(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2);\n currentExposure = v.upperExposure * BASE_9;\n ++i;\n // Update for the rest of the swaps the stablecoins issued from the asset\n v.stablecoinsIssued =\n v.isMint ? v.stablecoinsIssued + v.amountToNextBreakPoint : v.stablecoinsIssued - v.amountToNextBreakPoint;\n }\n }\n }\n // If `i == n-1`, we are in an area where fees are constant\n return\n amount + _computeFee(quoteType, amountStable, v.isMint ? collatInfo.yFeeMint[n - 1] : collatInfo.yFeeBurn[n - 1]);\n }\n\n /// @notice Checks whether there is still enough of the collateral to process the transfer\n function _checkAmounts(address collateral, Collateral storage collatInfo, uint256 amountOut) internal view {\n if (\n (collatInfo.isManaged > 0 && LibManager.maxAvailable(collatInfo.managerData.config) < amountOut)\n || (collatInfo.isManaged == 0 && IERC20(collateral).balanceOf(address(this)) < amountOut)\n ) revert InvalidSwap();\n }\n\n /// @notice Checks whether there is enough space left to mint from this collateral\n function _checkHardCaps(Collateral storage collatInfo, uint256 amount, uint256 normalizer) internal view {\n if (amount + (collatInfo.normalizedStables * normalizer) / BASE_27 > collatInfo.stablecoinCap) {\n revert InvalidSwap();\n }\n }\n\n /// @notice Checks whether a swap from `tokenIn` to `tokenOut` is a mint or a burn, whether the\n /// collateral provided is paused or not and in case of whether the swap is not occuring too late\n /// @dev The function reverts if the `tokenIn` and `tokenOut` given do not correspond to the stablecoin\n /// and to an accepted collateral asset of the system\n function _getMintBurn(\n address tokenIn,\n address tokenOut,\n uint256 deadline\n )\n internal\n view\n returns (bool mint, Collateral storage collatInfo)\n {\n if (block.timestamp > deadline) revert TooLate();\n ParallelizerStorage storage ts = s.transmuterStorage();\n address _tokenP = address(ts.tokenP);\n if (tokenIn == _tokenP) {\n collatInfo = ts.collaterals[tokenOut];\n if (collatInfo.isBurnLive == 0) revert Paused();\n mint = false;\n } else if (tokenOut == _tokenP) {\n collatInfo = ts.collaterals[tokenIn];\n if (collatInfo.isMintLive == 0) revert Paused();\n mint = true;\n } else {\n revert InvalidTokens();\n }\n }\n\n /// @notice Checks whether `tokenIn` is a valid unpaused collateral and the deadline\n function _getMint(\n address tokenIn,\n uint256 deadline\n )\n internal\n view\n returns (address tokenOut, Collateral storage collatInfo)\n {\n if (block.timestamp > deadline) revert TooLate();\n ParallelizerStorage storage ts = s.transmuterStorage();\n collatInfo = ts.collaterals[tokenIn];\n if (collatInfo.isMintLive == 0) revert Paused();\n tokenOut = address(ts.tokenP);\n }\n\n /// @notice Builds a permit2 `permitTransferFrom` payload for a `tokenIn` transfer\n /// @dev The transfer should be from `msg.sender` to this contract or a manager\n function _buildPermitTransferPayload(\n uint256 amountIn,\n uint256 approvedAmount,\n address tokenIn,\n uint256 deadline,\n bytes memory permitData,\n Collateral storage collatInfo\n )\n internal\n view\n returns (bytes memory payload)\n {\n Permit2Details memory details;\n if (collatInfo.isManaged > 0) details.to = LibManager.transferRecipient(collatInfo.managerData.config);\n else details.to = address(this);\n (details.nonce, details.signature) = abi.decode(permitData, (uint256, bytes));\n payload = abi.encodeWithSelector(\n IPermit2.permitTransferFrom.selector,\n PermitTransferFrom({\n permitted: TokenPermissions({ token: tokenIn, amount: approvedAmount }),\n nonce: details.nonce,\n deadline: deadline\n }),\n SignatureTransferDetails({ to: details.to, requestedAmount: amountIn }),\n msg.sender,\n details.signature\n );\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n INTERNAL PURE \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Applies or inverts `fees` to an `amount` based on the type of operation\n function _computeFee(QuoteType quoteType, uint256 amount, int64 fees) internal pure returns (uint256) {\n return quoteType == QuoteType.MintExactInput\n ? _applyFeeMint(amount, fees)\n : quoteType == QuoteType.MintExactOutput\n ? _invertFeeMint(amount, fees)\n : quoteType == QuoteType.BurnExactInput ? _applyFeeBurn(amount, fees) : _invertFeeBurn(amount, fees);\n }\n\n /// @notice Checks whether an operation is a mint operation or not\n function _isMint(QuoteType quoteType) internal pure returns (bool) {\n return quoteType == QuoteType.MintExactInput || quoteType == QuoteType.MintExactOutput;\n }\n\n /// @notice Checks whether a swap involves an amount of stablecoins that is known in exact in advance or not\n function _isExact(QuoteType quoteType) internal pure returns (bool) {\n return quoteType == QuoteType.MintExactOutput || quoteType == QuoteType.BurnExactInput;\n }\n\n /// @notice Applies `fees` to an `amountIn` of assets to get an `amountOut` of stablecoins\n function _applyFeeMint(uint256 amountIn, int64 fees) internal pure returns (uint256 amountOut) {\n if (fees >= 0) {\n uint256 castedFees = uint256(int256(fees));\n // Consider that if fees are above `BASE_12` this is equivalent to infinite fees\n if (castedFees >= BASE_12) revert InvalidSwap();\n amountOut = (amountIn * BASE_9) / (BASE_9 + castedFees);\n } else {\n amountOut = (amountIn * BASE_9) / (BASE_9 - uint256(int256(-fees)));\n }\n }\n\n /// @notice Gets from an `amountOut` of stablecoins and with `fees`, the `amountIn` of assets\n /// that need to be brought during a mint\n function _invertFeeMint(uint256 amountOut, int64 fees) internal pure returns (uint256 amountIn) {\n if (fees >= 0) {\n uint256 castedFees = uint256(int256(fees));\n // Consider that if fees are above `BASE_12` this is equivalent to infinite fees\n if (castedFees >= BASE_12) revert InvalidSwap();\n amountIn = amountOut.mulDiv(BASE_9 + castedFees, BASE_9, Math.Rounding.Ceil);\n } else {\n amountIn = amountOut.mulDiv(BASE_9 - uint256(int256(-fees)), BASE_9, Math.Rounding.Ceil);\n }\n }\n\n /// @notice Applies `fees` to an `amountIn` of stablecoins to get an `amountOut` of assets\n function _applyFeeBurn(uint256 amountIn, int64 fees) internal pure returns (uint256 amountOut) {\n if (fees >= 0) {\n uint256 castedFees = uint256(int256(fees));\n if (castedFees >= MAX_BURN_FEE) revert InvalidSwap();\n amountOut = ((BASE_9 - castedFees) * amountIn) / BASE_9;\n } else {\n amountOut = ((BASE_9 + uint256(int256(-fees))) * amountIn) / BASE_9;\n }\n }\n\n /// @notice Gets from an `amountOut` of assets and with `fees` the `amountIn` of stablecoins that need\n /// to be brought during a burn\n function _invertFeeBurn(uint256 amountOut, int64 fees) internal pure returns (uint256 amountIn) {\n if (fees >= 0) {\n uint256 castedFees = uint256(int256(fees));\n if (castedFees >= MAX_BURN_FEE) revert InvalidSwap();\n amountIn = amountOut.mulDiv(BASE_9, BASE_9 - castedFees, Math.Rounding.Ceil);\n } else {\n amountIn = amountOut.mulDiv(BASE_9, BASE_9 + uint256(int256(-fees)), Math.Rounding.Ceil);\n }\n }\n}\n" + }, + "contracts/parallelizer/Layout.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport \"../utils/Constants.sol\";\nimport { DiamondStorage, ParallelizerStorage, Collateral, FacetInfo, WhitelistType } from \"./Storage.sol\";\n\n/// @notice Contract mimicking the overall storage layout of the parallelizer system.\n/// @dev Not meant to be deployed or used. The goals are:\n/// - To ensure the storage layout is well understood by everyone\n/// - To force test failures if the layout is changed\n/// @dev\n/// - uint256(TRANSMUTER_STORAGE_POSITION)\n/// = 34004428136983271448470628240738343798407004761490164663157697638250996796533\n/// - uint256(DIAMOND_STORAGE_POSITION)\n/// = 90909012999857140622417080374671856515688564136957639390032885430481714942747\n/// - uint256(IMPLEMENTATION_STORAGE_POSITION)\n/// = 24440054405305269366569402256811496959409073762505157381672968839269610695612\ncontract Layout {\n // uint256(IMPLEMENTATION_STORAGE_POSITION)\n uint256[24_440_054_405_305_269_366_569_402_256_811_496_959_409_073_762_505_157_381_672_968_839_269_610_695_612]\n private __gap1;\n address public implementation;\n // uint256(TRANSMUTER_STORAGE_POSITION) - 1 - uint256(IMPLEMENTATION_STORAGE_POSITION)\n uint256[9_564_373_731_678_002_081_901_225_983_926_846_838_997_930_998_985_007_281_484_728_798_981_386_100_920]\n private __gap2;\n address public tokenP; // slot 1\n uint8 public isRedemptionLive; // slot 1\n uint8 public nonReentrant; // slot 1\n bool public consumingSchedule; // slot 1\n uint128 public normalizedStables; // slot 2\n uint128 public normalizer; // slot 2\n address[] public collateralList; // slot 3\n uint64[] public xRedemptionCurve; // slot 4\n int64[] public yRedemptionCurve; // slot 5\n mapping(address => Collateral) public collaterals; // slot 6\n mapping(address => uint256) public isTrusted; // slot 7\n mapping(address => uint256) public isSellerTrusted; // slot 8\n mapping(WhitelistType => mapping(address => uint256)) public isWhitelistedForType; // slot 9\n // uint256(DIAMOND_STORAGE_POSITION) - ParallelizerStorage offset (9) - uint256(TRANSMUTER_STORAGE_POSITION)\n uint256[56_904_584_862_873_869_173_946_452_133_933_512_717_281_559_375_467_474_726_875_187_792_230_718_146_205]\n private __gap3;\n bytes4[] public selectors; // slot 1\n mapping(bytes4 => FacetInfo) public selectorInfo; // slot 2\n address public accessManager; // slot 3\n}\n" + }, + "contracts/parallelizer/libraries/LibDiamond.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport { LibStorage as s } from \"./LibStorage.sol\";\nimport { IAccessManager } from \"@openzeppelin/contracts/access/manager/IAccessManager.sol\";\nimport { AuthorityUtils } from \"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\";\n\nimport \"../../utils/Errors.sol\";\nimport \"../../utils/Constants.sol\";\nimport \"../Storage.sol\";\n\n/// @title LibDiamond\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @notice Helper library to deal with diamond proxies.\n/// @dev Reference: EIP-2535 Diamonds\n/// @dev Forked from https://github.com/mudgen/diamond-3/blob/master/contracts/libraries/LibDiamond.sol by mudgen\nlibrary LibDiamond {\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n INTERNAL FUNCTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n function isGovernor(address caller) internal view returns (bool) {\n (bool isMember,) = s.diamondStorage().accessManager.hasRole(GOVERNOR_ROLE, caller);\n return isMember;\n }\n\n /// @notice Checks whether `caller` can call `data` on `this`\n function checkCanCall(address caller, bytes calldata data) internal returns (bool) {\n IAccessManager accessManager = s.diamondStorage().accessManager;\n (bool immediate, uint32 delay) =\n AuthorityUtils.canCallWithDelay(address(accessManager), caller, address(this), bytes4(data[0:4]));\n if (!immediate) {\n if (delay > 0) {\n ParallelizerStorage storage ts = s.transmuterStorage();\n ts.consumingSchedule = true;\n accessManager.consumeScheduledOp(caller, data);\n ts.consumingSchedule = false;\n } else {\n return false;\n }\n }\n return true;\n }\n\n /// @notice Internal function version of `diamondCut`\n function diamondCut(FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {\n uint256 diamondCutLength = _diamondCut.length;\n for (uint256 facetIndex; facetIndex < diamondCutLength; facetIndex++) {\n bytes4[] memory functionSelectors = _diamondCut[facetIndex].functionSelectors;\n address facetAddress = _diamondCut[facetIndex].facetAddress;\n\n if (functionSelectors.length == 0) {\n revert NoSelectorsProvidedForFacetForCut(facetAddress);\n }\n\n FacetCutAction action = _diamondCut[facetIndex].action;\n if (action == FacetCutAction.Add) {\n _addFunctions(facetAddress, functionSelectors);\n } else if (action == FacetCutAction.Replace) {\n _replaceFunctions(facetAddress, functionSelectors);\n } else if (action == FacetCutAction.Remove) {\n _removeFunctions(facetAddress, functionSelectors);\n }\n }\n\n emit DiamondCut(_diamondCut, _init, _calldata);\n _initializeDiamondCut(_init, _calldata);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n PRIVATE FUNCTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Does a delegate call on `_init` with `_calldata`\n function _initializeDiamondCut(address _init, bytes memory _calldata) private {\n if (_init == address(0)) {\n return;\n }\n _enforceHasContractCode(_init);\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\n if (!success) {\n if (error.length > 0) {\n assembly (\"memory-safe\") {\n let returndata_size := mload(error)\n revert(add(32, error), returndata_size)\n }\n } else {\n revert InitializationFunctionReverted(_init, _calldata);\n }\n }\n }\n\n /// @notice Adds a new function to the diamond proxy\n /// @dev Reverts if selectors are already existing\n function _addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\n if (_facetAddress == address(0)) {\n revert CannotAddSelectorsToZeroAddress(_functionSelectors);\n }\n DiamondStorage storage ds = s.diamondStorage();\n uint16 selectorCount = uint16(ds.selectors.length);\n _enforceHasContractCode(_facetAddress);\n uint256 functionSelectorsLength = _functionSelectors.length;\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\n bytes4 selector = _functionSelectors[selectorIndex];\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\n if (oldFacetAddress != address(0)) {\n revert CannotAddFunctionToDiamondThatAlreadyExists(selector);\n }\n ds.selectorInfo[selector] = FacetInfo(_facetAddress, selectorCount);\n ds.selectors.push(selector);\n selectorCount++;\n }\n }\n\n /// @notice Upgrades a function in the diamond proxy\n /// @dev Reverts if selectors do not already exist\n function _replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\n DiamondStorage storage ds = s.diamondStorage();\n if (_facetAddress == address(0)) {\n revert CannotReplaceFunctionsFromFacetWithZeroAddress(_functionSelectors);\n }\n _enforceHasContractCode(_facetAddress);\n uint256 functionSelectorsLength = _functionSelectors.length;\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\n bytes4 selector = _functionSelectors[selectorIndex];\n address oldFacetAddress = ds.selectorInfo[selector].facetAddress;\n // Can't replace immutable functions -- functions defined directly in the diamond in this case\n if (oldFacetAddress == address(this)) {\n revert CannotReplaceImmutableFunction(selector);\n }\n if (oldFacetAddress == _facetAddress) {\n revert CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(selector);\n }\n if (oldFacetAddress == address(0)) {\n revert CannotReplaceFunctionThatDoesNotExists(selector);\n }\n // Replace old facet address\n ds.selectorInfo[selector].facetAddress = _facetAddress;\n }\n }\n\n /// @notice Removes a function in the diamond proxy\n /// @dev Reverts if selectors do not already exist\n function _removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) private {\n DiamondStorage storage ds = s.diamondStorage();\n uint256 selectorCount = ds.selectors.length;\n if (_facetAddress != address(0)) {\n revert RemoveFacetAddressMustBeZeroAddress(_facetAddress);\n }\n uint256 functionSelectorsLength = _functionSelectors.length;\n for (uint256 selectorIndex; selectorIndex < functionSelectorsLength; selectorIndex++) {\n bytes4 selector = _functionSelectors[selectorIndex];\n FacetInfo memory oldFacetAddressAndSelectorPosition = ds.selectorInfo[selector];\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(0)) {\n revert CannotRemoveFunctionThatDoesNotExist(selector);\n }\n\n // Can't remove immutable functions -- functions defined directly in the diamond\n if (oldFacetAddressAndSelectorPosition.facetAddress == address(this)) {\n revert CannotRemoveImmutableFunction(selector);\n }\n // Replace selector with last selector\n selectorCount--;\n if (oldFacetAddressAndSelectorPosition.selectorPosition != selectorCount) {\n bytes4 lastSelector = ds.selectors[selectorCount];\n ds.selectors[oldFacetAddressAndSelectorPosition.selectorPosition] = lastSelector;\n ds.selectorInfo[lastSelector].selectorPosition = oldFacetAddressAndSelectorPosition.selectorPosition;\n }\n // Delete last selector\n ds.selectors.pop();\n delete ds.selectorInfo[selector];\n }\n }\n\n /// @notice Checks that an address has a non void bytecode\n function _enforceHasContractCode(address _contract) private view {\n uint256 contractSize;\n assembly (\"memory-safe\") {\n contractSize := extcodesize(_contract)\n }\n if (contractSize == 0) {\n revert ContractHasNoCode();\n }\n }\n}\n" + }, + "contracts/parallelizer/libraries/LibDiamondEtherscan.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport { LibStorage as s } from \"./LibStorage.sol\";\n\n/// @title LibDiamondEtherscan\n/// @notice Allow to verify a diamond proxy on Etherscan\n/// @dev Forked from https://github.com/zdenham/diamond-etherscan/blob/main/contracts/libraries/LibDiamondEtherscan.sol\nlibrary LibDiamondEtherscan {\n event Upgraded(address indexed implementation);\n\n /// @notice Internal version of `setDummyImplementation`\n function setDummyImplementation(address implementationAddress) internal {\n s.implementationStorage().implementation = implementationAddress;\n emit Upgraded(implementationAddress);\n }\n\n /// @notice Internal version of `implementation`\n function dummyImplementation() internal view returns (address) {\n return s.implementationStorage().implementation;\n }\n}\n" + }, + "contracts/parallelizer/libraries/LibGetters.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { Math } from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\n\nimport { LibHelpers } from \"./LibHelpers.sol\";\nimport { LibManager } from \"./LibManager.sol\";\nimport { LibOracle } from \"./LibOracle.sol\";\nimport { LibStorage as s } from \"./LibStorage.sol\";\n\nimport \"../../utils/Constants.sol\";\nimport \"../Storage.sol\";\n\n/// @title LibGetters\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This library is an authorized fork of Angle's `LibGetters` library\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibGetters.sol\nlibrary LibGetters {\n using Math for uint256;\n using SafeCast for uint256;\n\n /// @notice Internal version of the `getCollateralRatio` function with additional return values like `tokens` that\n /// is the list of tokens supported by the system, or `balances` which is the amount of each token in `tokens`\n /// controlled by the protocol\n /// @dev In case some collaterals support external strategies (`isManaged>0`), this list may be bigger\n /// than the `collateralList`\n /// @dev `subCollateralsTracker` is an array which gives for each collateral asset in the collateral list an\n /// accumulator helping to recompute the amount of sub-collateral for each collateral. If the array is:\n /// [1,4,5], this means that the collateral with index 1 in the `collateralsList` has 4-1=3 sub-collaterals.\n function getCollateralRatio()\n internal\n view\n returns (\n uint64 collatRatio,\n uint256 stablecoinsIssued,\n address[] memory tokens,\n uint256[] memory balances,\n uint256[] memory subCollateralsTracker\n )\n {\n ParallelizerStorage storage ts = s.transmuterStorage();\n uint256 totalCollateralization;\n address[] memory collateralList = ts.collateralList;\n uint256 collateralListLength = collateralList.length;\n uint256 subCollateralsAmount;\n // Building the `subCollateralsTracker` array which is useful when later sending the tokens as part of the\n // redemption\n subCollateralsTracker = new uint256[](collateralListLength);\n for (uint256 i; i < collateralListLength; ++i) {\n if (ts.collaterals[collateralList[i]].isManaged == 0) ++subCollateralsAmount;\n else subCollateralsAmount += ts.collaterals[collateralList[i]].managerData.subCollaterals.length;\n subCollateralsTracker[i] = subCollateralsAmount;\n }\n balances = new uint256[](subCollateralsAmount);\n tokens = new address[](subCollateralsAmount);\n\n {\n uint256 countCollat;\n for (uint256 i; i < collateralListLength; ++i) {\n Collateral storage collateral = ts.collaterals[collateralList[i]];\n uint256 collateralBalance; // Will be either the balance or the value of assets managed\n if (collateral.isManaged > 0) {\n // If a collateral is managed, the balances of the sub-collaterals cannot be directly obtained by\n // calling `balanceOf` of the sub-collaterals\n uint256[] memory subCollateralsBalances;\n (subCollateralsBalances, collateralBalance) = LibManager.totalAssets(collateral.managerData.config);\n uint256 numSubCollats = subCollateralsBalances.length;\n for (uint256 k; k < numSubCollats; ++k) {\n tokens[countCollat + k] = address(collateral.managerData.subCollaterals[k]);\n balances[countCollat + k] = subCollateralsBalances[k];\n }\n countCollat += numSubCollats;\n } else {\n collateralBalance = IERC20(collateralList[i]).balanceOf(address(this));\n tokens[countCollat] = collateralList[i];\n balances[countCollat++] = collateralBalance;\n }\n uint256 oracleValue = LibOracle.readRedemption(collateral.oracleConfig);\n totalCollateralization +=\n (oracleValue * LibHelpers.convertDecimalTo(collateralBalance, collateral.decimals, 18)) / BASE_18;\n }\n }\n // The `stablecoinsIssued` value need to be rounded up because it is then used as a divizer when computing\n // the `collatRatio`\n stablecoinsIssued = uint256(ts.normalizedStables).mulDiv(ts.normalizer, BASE_27, Math.Rounding.Ceil);\n if (stablecoinsIssued > 0) {\n collatRatio = (totalCollateralization.mulDiv(BASE_9, stablecoinsIssued, Math.Rounding.Ceil)).toUint64();\n } else {\n collatRatio = type(uint64).max;\n }\n }\n}\n" + }, + "contracts/parallelizer/libraries/LibHelpers.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.28;\n\nimport { Math } from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\nimport \"../Storage.sol\";\n\n/// @title LibHelpers\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This library is an authorized fork of Angle's `LibHelpers` library\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibHelpers.sol\nlibrary LibHelpers {\n /// @notice Rebases the units of `amount` from `fromDecimals` to `toDecimals`\n function convertDecimalTo(uint256 amount, uint8 fromDecimals, uint8 toDecimals) internal pure returns (uint256) {\n if (fromDecimals > toDecimals) return amount / 10 ** (fromDecimals - toDecimals);\n else if (fromDecimals < toDecimals) return amount * 10 ** (toDecimals - fromDecimals);\n else return amount;\n }\n\n /// @notice Checks whether a `token` is in a list `tokens` and returns the index of the token in the list\n /// or -1 in the other case\n function checkList(address token, address[] memory tokens) internal pure returns (int256) {\n uint256 tokensLength = tokens.length;\n for (uint256 i; i < tokensLength; ++i) {\n if (token == tokens[i]) return int256(i);\n }\n return -1;\n }\n\n /// @notice Searches a sorted `array` and returns the first index that contains a value strictly greater\n /// (or lower if increasingArray is false) to `element` minus 1\n /// @dev If no such index exists (i.e. all values in the array are strictly lesser/greater than `element`),\n /// either array length minus 1, or 0 are returned\n /// @dev The time complexity of the search is O(log n).\n /// @dev Inspired from OpenZeppelin Contracts v4.4.1:\n /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Arrays.sol\n /// @dev Modified by Angle Labs to support `uint64`, monotonous arrays and exclusive upper bounds\n function findLowerBound(\n bool increasingArray,\n uint64[] memory array,\n uint64 normalizerArray,\n uint64 element\n )\n internal\n pure\n returns (uint256)\n {\n if (array.length == 0) {\n return 0;\n }\n uint256 low = 1;\n uint256 high = array.length;\n\n if (\n (increasingArray && array[high - 1] * normalizerArray <= element)\n || (!increasingArray && array[high - 1] * normalizerArray >= element)\n ) return high - 1;\n\n while (low < high) {\n uint256 mid = Math.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds down (it does integer division with truncation).\n if (increasingArray ? array[mid] * normalizerArray > element : array[mid] * normalizerArray < element) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n // At this point `low` is the exclusive upper bound.\n // `low - 1` is the inclusive lower bound.\n return low - 1;\n }\n\n /// @notice Evaluates for `x` a piecewise linear function defined with the breaking points in the arrays\n /// `xArray` and `yArray`\n /// @dev The values in the `xArray` must be increasing\n function piecewiseLinear(uint64 x, uint64[] memory xArray, int64[] memory yArray) internal pure returns (int64) {\n uint256 indexLowerBound = findLowerBound(true, xArray, 1, x);\n if (indexLowerBound == 0 && x < xArray[0]) return yArray[0];\n else if (indexLowerBound == xArray.length - 1) return yArray[xArray.length - 1];\n return yArray[indexLowerBound]\n + ((yArray[indexLowerBound + 1] - yArray[indexLowerBound]) * int64(x - xArray[indexLowerBound]))\n / int64(xArray[indexLowerBound + 1] - xArray[indexLowerBound]);\n }\n}\n" + }, + "contracts/parallelizer/libraries/LibManager.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { IManager } from \"contracts/interfaces/IManager.sol\";\n\nimport \"../Storage.sol\";\n\n/// @title LibManager\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev Managed collateral assets may be handled through external smart contracts or directly through this library\n/// @dev There is no implementation at this point for a managed collateral handled through this library, and\n/// a new specific `ManagerType` would need to be added in this case\n/// @dev This library is an authorized fork of Angle's `LibManager` library\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibManager.sol\nlibrary LibManager {\n /// @notice Checks to which address managed funds must be transferred\n function transferRecipient(bytes memory config) internal view returns (address recipient) {\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\n recipient = address(this);\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (address));\n }\n\n /// @notice Performs a transfer of `token` for a collateral that is managed to a `to` address\n /// @dev `token` may not be the actual collateral itself, as some collaterals have subcollaterals associated\n /// with it\n /// @dev Eventually pulls funds from strategies\n function release(address token, address to, uint256 amount, bytes memory config) internal {\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).release(token, to, amount);\n }\n\n /// @notice Gets the balances of all the tokens controlled through `managerData`\n /// @return balances An array of size `subCollaterals` with current balances of all subCollaterals\n /// including the one corresponding to the `managerData` given\n /// @return totalValue The value of all the `subCollaterals` in `collateral`\n /// @dev `subCollaterals` must always have as first token (index 0) the collateral itself\n function totalAssets(bytes memory config) internal view returns (uint256[] memory balances, uint256 totalValue) {\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).totalAssets();\n }\n\n /// @notice Calls a hook if needed after new funds have been transfered to a manager\n function invest(uint256 amount, bytes memory config) internal {\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\n if (managerType == ManagerType.EXTERNAL) abi.decode(data, (IManager)).invest(amount);\n }\n\n /// @notice Returns available underlying tokens, for instance if liquidity is fully used and\n /// not withdrawable the function will return 0\n function maxAvailable(bytes memory config) internal view returns (uint256 available) {\n (ManagerType managerType, bytes memory data) = parseManagerConfig(config);\n if (managerType == ManagerType.EXTERNAL) return abi.decode(data, (IManager)).maxAvailable();\n }\n\n /// @notice Decodes the `managerData` associated to a collateral\n function parseManagerConfig(bytes memory config) internal pure returns (ManagerType managerType, bytes memory data) {\n (managerType, data) = abi.decode(config, (ManagerType, bytes));\n }\n}\n" + }, + "contracts/parallelizer/libraries/LibOracle.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { IParallelizerOracle } from \"contracts/interfaces/IParallelizerOracle.sol\";\nimport { AggregatorV3Interface } from \"contracts/interfaces/external/chainlink/AggregatorV3Interface.sol\";\nimport { IMorphoOracle } from \"contracts/interfaces/external/morpho/IMorphoOracle.sol\";\n\nimport { LibStorage as s } from \"./LibStorage.sol\";\n\nimport \"../../utils/Constants.sol\";\nimport \"../../utils/Errors.sol\";\nimport \"../Storage.sol\";\n\n/// @title LibOracle\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This library is an authorized fork of Angle's `LibOracle` library\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibOracle.sol\nlibrary LibOracle {\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n ACTIONS SPECIFIC ORACLES \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Reads the oracle value used during a redemption to compute collateral ratio for `oracleConfig`\n /// @dev This value is only sensitive to compute the collateral ratio and deduce a penalty factor\n function readRedemption(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\n (OracleReadType oracleType, OracleReadType targetType, bytes memory oracleData, bytes memory targetData,) =\n _parseOracleConfig(oracleConfig);\n if (oracleType == OracleReadType.EXTERNAL) {\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\n return externalOracle.readRedemption();\n } else {\n (oracleValue,) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, 0);\n return oracleValue;\n }\n }\n\n /// @notice Reads the oracle value used during mint operations for an asset with `oracleConfig`\n /// @dev For assets which do not rely on external oracles, this value is the minimum between the processed oracle\n /// value for the asset and its target price\n function readMint(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {\n (\n OracleReadType oracleType,\n OracleReadType targetType,\n bytes memory oracleData,\n bytes memory targetData,\n bytes memory hyperparameters\n ) = _parseOracleConfig(oracleConfig);\n if (oracleType == OracleReadType.EXTERNAL) {\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\n return externalOracle.readMint();\n }\n\n (uint128 userDeviation,) = abi.decode(hyperparameters, (uint128, uint128));\n uint256 targetPrice;\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\n if (targetPrice < oracleValue) oracleValue = targetPrice;\n }\n\n /// @notice Reads the oracle value used for a burn operation for an asset with `oracleConfig`\n /// @return oracleValue The actual oracle value obtained\n /// @return ratio If `oracle value < target price`, the ratio between the oracle value and the target\n /// price, otherwise `BASE_18`\n function readBurn(bytes memory oracleConfig) internal view returns (uint256 oracleValue, uint256 ratio) {\n (\n OracleReadType oracleType,\n OracleReadType targetType,\n bytes memory oracleData,\n bytes memory targetData,\n bytes memory hyperparameters\n ) = _parseOracleConfig(oracleConfig);\n if (oracleType == OracleReadType.EXTERNAL) {\n IParallelizerOracle externalOracle = abi.decode(oracleData, (IParallelizerOracle));\n return externalOracle.readBurn();\n }\n (uint128 userDeviation, uint128 burnRatioDeviation) = abi.decode(hyperparameters, (uint128, uint128));\n uint256 targetPrice;\n (oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData, userDeviation);\n // Firewall in case the oracle value reported is low compared to the target\n // If the oracle value is slightly below its target, then no deviation is reported for the oracle and\n // the price of burning the stablecoin for other assets is not impacted. Also, the oracle value of this asset\n // is set to the target price, to not be open to direct arbitrage\n ratio = BASE_18;\n if (oracleValue * BASE_18 < targetPrice * (BASE_18 - burnRatioDeviation)) {\n ratio = (oracleValue * BASE_18) / targetPrice;\n } else if (oracleValue < targetPrice) {\n oracleValue = targetPrice;\n }\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n VIEW FUNCTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Internal version of the `getOracle` function\n function getOracle(address collateral)\n internal\n view\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\n {\n return _parseOracleConfig(s.transmuterStorage().collaterals[collateral].oracleConfig);\n }\n\n /// @notice Gets the oracle value and the ratio with respect to the target price when it comes to\n /// burning for `collateral`\n function getBurnOracle(\n address collateral,\n bytes memory oracleConfig\n )\n internal\n view\n returns (uint256 minRatio, uint256 oracleValue)\n {\n ParallelizerStorage storage ts = s.transmuterStorage();\n minRatio = BASE_18;\n address[] memory collateralList = ts.collateralList;\n uint256 length = collateralList.length;\n for (uint256 i; i < length; ++i) {\n uint256 ratioObserved = BASE_18;\n if (collateralList[i] != collateral) {\n (, ratioObserved) = readBurn(ts.collaterals[collateralList[i]].oracleConfig);\n } else {\n (oracleValue, ratioObserved) = readBurn(oracleConfig);\n }\n if (ratioObserved < minRatio) minRatio = ratioObserved;\n }\n }\n\n /// @notice Computes the `quoteAmount` (for Chainlink oracles) depending on a `quoteType` and a base value\n /// (e.g the target price of the asset)\n /// @dev For cases where the Chainlink feed directly looks into the value of the asset, `quoteAmount` is `BASE_18`.\n /// For others, like wstETH for which Chainlink only has an oracle for stETH, `quoteAmount` is the target price\n function quoteAmount(OracleQuoteType quoteType, uint256 baseValue) internal pure returns (uint256) {\n if (quoteType == OracleQuoteType.UNIT) return BASE_18;\n else return baseValue;\n }\n\n function readSpotAndTarget(\n OracleReadType oracleType,\n OracleReadType targetType,\n bytes memory oracleData,\n bytes memory targetData,\n uint256 deviation\n )\n internal\n view\n returns (uint256 oracleValue, uint256 targetPrice)\n {\n targetPrice = read(targetType, BASE_18, targetData);\n oracleValue = read(oracleType, targetPrice, oracleData);\n // System may tolerate small deviations from target\n // If the oracle value reported is reasonably close to the target\n // --> disregard the oracle value and return the target price\n if (\n targetPrice * (BASE_18 - deviation) < oracleValue * BASE_18\n && oracleValue * BASE_18 < targetPrice * (BASE_18 + deviation)\n ) oracleValue = targetPrice;\n }\n\n /// @notice Reads an oracle value (or a target oracle value) for an asset based on its data parsed `oracleConfig`\n function read(OracleReadType readType, uint256 baseValue, bytes memory data) internal view returns (uint256) {\n if (readType == OracleReadType.CHAINLINK_FEEDS) {\n (\n AggregatorV3Interface[] memory circuitChainlink,\n uint32[] memory stalePeriods,\n uint8[] memory circuitChainIsMultiplied,\n uint8[] memory chainlinkDecimals,\n OracleQuoteType quoteType\n ) = abi.decode(data, (AggregatorV3Interface[], uint32[], uint8[], uint8[], OracleQuoteType));\n uint256 quotePrice = quoteAmount(quoteType, baseValue);\n uint256 listLength = circuitChainlink.length;\n for (uint256 i; i < listLength; ++i) {\n quotePrice = readChainlinkFeed(\n quotePrice, circuitChainlink[i], circuitChainIsMultiplied[i], chainlinkDecimals[i], stalePeriods[i]\n );\n }\n return quotePrice;\n } else if (readType == OracleReadType.STABLE) {\n return BASE_18;\n } else if (readType == OracleReadType.NO_ORACLE) {\n return baseValue;\n } else if (readType == OracleReadType.WSTETH) {\n return STETH.getPooledEthByShares(1 ether);\n } else if (readType == OracleReadType.CBETH) {\n return CBETH.exchangeRate();\n } else if (readType == OracleReadType.RETH) {\n return RETH.getExchangeRate();\n } else if (readType == OracleReadType.SFRXETH) {\n return SFRXETH.pricePerShare();\n } else if (readType == OracleReadType.MAX) {\n uint256 maxValue = abi.decode(data, (uint256));\n return maxValue;\n } else if (readType == OracleReadType.MORPHO_ORACLE) {\n (address contractAddress, uint256 normalizationFactor) = abi.decode(data, (address, uint256));\n return IMorphoOracle(contractAddress).price() / normalizationFactor;\n }\n // If the `OracleReadType` is `EXTERNAL`, it means that this function is called to compute a\n // `targetPrice` in which case the `baseValue` is returned here\n else {\n return baseValue;\n }\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n SPECIFIC HELPERS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Reads a Chainlink feed using a quote amount and converts the quote amount to the out-currency\n /// @param _quoteAmount The amount for which to compute the price expressed in `BASE_18`\n /// @param feed Chainlink feed to query\n /// @param multiplied Whether the ratio outputted by Chainlink should be multiplied or divided to the `quoteAmount`\n /// @param decimals Number of decimals of the corresponding Chainlink pair\n /// @return The `quoteAmount` converted in out-currency\n function readChainlinkFeed(\n uint256 _quoteAmount,\n AggregatorV3Interface feed,\n uint8 multiplied,\n uint256 decimals,\n uint32 stalePeriod\n )\n internal\n view\n returns (uint256)\n {\n (, int256 ratio,, uint256 updatedAt,) = feed.latestRoundData();\n if (ratio <= 0 || block.timestamp - updatedAt > stalePeriod) revert InvalidChainlinkRate();\n // Checking whether we should multiply or divide by the ratio computed\n if (multiplied == 1) return (_quoteAmount * uint256(ratio)) / (10 ** decimals);\n else return (_quoteAmount * (10 ** decimals)) / uint256(ratio);\n }\n\n /// @notice Parses an `oracleConfig` into several sub fields\n function _parseOracleConfig(bytes memory oracleConfig)\n private\n pure\n returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory)\n {\n return abi.decode(oracleConfig, (OracleReadType, OracleReadType, bytes, bytes, bytes));\n }\n\n function updateOracle(address collateral) internal {\n ParallelizerStorage storage ts = s.transmuterStorage();\n if (ts.collaterals[collateral].decimals == 0) revert NotCollateral();\n\n (\n OracleReadType oracleType,\n OracleReadType targetType,\n bytes memory oracleData,\n bytes memory targetData,\n bytes memory hyperparameters\n ) = _parseOracleConfig(ts.collaterals[collateral].oracleConfig);\n\n if (targetType != OracleReadType.MAX) revert OracleUpdateFailed();\n uint256 oracleValue = read(oracleType, BASE_18, oracleData);\n\n uint256 maxValue = abi.decode(targetData, (uint256));\n if (oracleValue > maxValue) {\n ts.collaterals[collateral].oracleConfig = abi.encode(\n oracleType,\n targetType,\n oracleData,\n // There are no checks whether the value increased or not\n abi.encode(oracleValue),\n hyperparameters\n );\n } else {\n revert OracleUpdateFailed();\n }\n }\n}\n" + }, + "contracts/parallelizer/libraries/LibSetters.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport { IERC20Metadata } from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\n\nimport { LibManager } from \"./LibManager.sol\";\nimport { LibOracle } from \"./LibOracle.sol\";\nimport { LibStorage as s } from \"./LibStorage.sol\";\nimport { LibDiamond } from \"./LibDiamond.sol\";\nimport { LibWhitelist } from \"./LibWhitelist.sol\";\n\nimport \"../../utils/Constants.sol\";\nimport \"../../utils/Errors.sol\";\nimport \"../Storage.sol\";\n\n/// @title LibSetters\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This library is an authorized fork of Angle's `LibSetters` library\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibSetters.sol\nlibrary LibSetters {\n using SafeCast for uint256;\n\n event CollateralAdded(address indexed collateral);\n event CollateralManagerSet(address indexed collateral, ManagerStorage managerData);\n event CollateralRevoked(address indexed collateral);\n event CollateralWhitelistStatusUpdated(address indexed collateral, bytes whitelistData, uint8 whitelistStatus);\n event FeesSet(address indexed collateral, uint64[] xFee, int64[] yFee, bool mint);\n event OracleSet(address indexed collateral, bytes oracleConfig);\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n event PauseToggled(address indexed collateral, uint256 pausedType, bool isPaused);\n event RedemptionCurveParamsSet(uint64[] xFee, int64[] yFee);\n event ReservesAdjusted(address indexed collateral, uint256 amount, bool increase);\n event StablecoinCapSet(address indexed collateral, uint256 stablecoinCap);\n event TrustedToggled(address indexed sender, bool isTrusted, TrustedType trustedType);\n event WhitelistStatusToggled(WhitelistType whitelistType, address indexed who, uint256 whitelistStatus);\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n ONLY GOVERNOR ACTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Internal version of `setAccessManager`\n function setAccessManager(IAccessManager _newAccessManager) internal {\n if (address(_newAccessManager).code.length == 0) revert InvalidAccessManager();\n DiamondStorage storage ds = s.diamondStorage();\n address previousAccessManager = address(ds.accessManager);\n ds.accessManager = _newAccessManager;\n emit OwnershipTransferred(previousAccessManager, address(_newAccessManager));\n }\n\n /// @notice Internal version of `setCollateralManager`\n function setCollateralManager(\n address collateral,\n bool checkExternalManagerBalance,\n ManagerStorage memory managerData\n )\n internal\n {\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n if (collatInfo.decimals == 0) revert NotCollateral();\n uint8 isManaged = collatInfo.isManaged;\n if (isManaged > 0 && checkExternalManagerBalance) {\n (, uint256 totalValue) = LibManager.totalAssets(collatInfo.managerData.config);\n if (totalValue > 0) revert ManagerHasAssets();\n }\n if (managerData.config.length != 0) {\n // The first subCollateral given should be the actual collateral asset\n if (address(managerData.subCollaterals[0]) != collateral) revert InvalidParams();\n // Sanity check on the manager data that is passed\n LibManager.parseManagerConfig(managerData.config);\n collatInfo.isManaged = 1;\n } else {\n collatInfo.isManaged = 0;\n }\n collatInfo.managerData = managerData;\n emit CollateralManagerSet(collateral, managerData);\n }\n\n /// @notice Internal version of `toggleTrusted`\n function toggleTrusted(address sender, TrustedType t) internal {\n ParallelizerStorage storage ts = s.transmuterStorage();\n uint256 trustedStatus;\n if (t == TrustedType.Updater) {\n trustedStatus = 1 - ts.isTrusted[sender];\n ts.isTrusted[sender] = trustedStatus;\n } else {\n trustedStatus = 1 - ts.isSellerTrusted[sender];\n ts.isSellerTrusted[sender] = trustedStatus;\n }\n emit TrustedToggled(sender, trustedStatus == 1, t);\n }\n\n /// @notice Internal version of `addCollateral`\n function addCollateral(address collateral) internal {\n ParallelizerStorage storage ts = s.transmuterStorage();\n Collateral storage collatInfo = ts.collaterals[collateral];\n if (collatInfo.decimals != 0) revert AlreadyAdded();\n collatInfo.decimals = uint8(IERC20Metadata(collateral).decimals());\n ts.collateralList.push(collateral);\n emit CollateralAdded(collateral);\n }\n\n /// @notice Internal version of `adjustStablecoins`\n function adjustStablecoins(address collateral, uint128 amount, bool increase) internal {\n ParallelizerStorage storage ts = s.transmuterStorage();\n Collateral storage collatInfo = ts.collaterals[collateral];\n if (collatInfo.decimals == 0) revert NotCollateral();\n uint128 normalizedAmount = ((amount * BASE_27) / ts.normalizer).toUint128();\n if (increase) {\n collatInfo.normalizedStables = collatInfo.normalizedStables + uint216(normalizedAmount);\n ts.normalizedStables = ts.normalizedStables + normalizedAmount;\n } else {\n collatInfo.normalizedStables = collatInfo.normalizedStables - uint216(normalizedAmount);\n ts.normalizedStables = ts.normalizedStables - normalizedAmount;\n }\n emit ReservesAdjusted(collateral, amount, increase);\n }\n\n /// @notice Internal version of `revokeCollateral`\n function revokeCollateral(address collateral, bool checkExternalManagerBalance) internal {\n ParallelizerStorage storage ts = s.transmuterStorage();\n Collateral storage collatInfo = ts.collaterals[collateral];\n if (collatInfo.decimals == 0) revert NotCollateral();\n if (collatInfo.normalizedStables > 0) revert CollateralBacked();\n uint8 isManaged = collatInfo.isManaged;\n if (isManaged > 0 && checkExternalManagerBalance) {\n (, uint256 totalValue) = LibManager.totalAssets(collatInfo.managerData.config);\n if (totalValue > 0) revert ManagerHasAssets();\n }\n delete ts.collaterals[collateral];\n address[] memory collateralListMem = ts.collateralList;\n uint256 length = collateralListMem.length;\n for (uint256 i; i < length - 1; ++i) {\n if (collateralListMem[i] == collateral) {\n ts.collateralList[i] = collateralListMem[length - 1];\n break;\n }\n }\n ts.collateralList.pop();\n emit CollateralRevoked(collateral);\n }\n\n /// @notice Internal version of `setOracle`\n function setOracle(address collateral, bytes memory oracleConfig) internal {\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n if (collatInfo.decimals == 0) revert NotCollateral();\n // Checks oracle validity\n LibOracle.readMint(oracleConfig);\n collatInfo.oracleConfig = oracleConfig;\n emit OracleSet(collateral, oracleConfig);\n }\n\n /// @notice Internal version of `setWhitelistStatus`\n function setWhitelistStatus(address collateral, uint8 whitelistStatus, bytes memory whitelistData) internal {\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n if (collatInfo.decimals == 0) revert NotCollateral();\n if (whitelistStatus == 1) {\n // Sanity check\n LibWhitelist.checkWhitelist(whitelistData, address(this));\n collatInfo.whitelistData = whitelistData;\n } else {\n // If whitelist is revoked, clear the whitelist data\n collatInfo.whitelistData = \"\";\n }\n collatInfo.onlyWhitelisted = whitelistStatus;\n emit CollateralWhitelistStatusUpdated(collateral, collatInfo.whitelistData, whitelistStatus);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n ONLY GUARDIAN ACTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Internal version of `togglePause`\n function togglePause(address collateral, ActionType action) internal {\n uint8 isLive;\n if (action == ActionType.Mint || action == ActionType.Burn) {\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n if (collatInfo.decimals == 0) revert NotCollateral();\n if (action == ActionType.Mint) {\n isLive = 1 - collatInfo.isMintLive;\n collatInfo.isMintLive = isLive;\n } else {\n isLive = 1 - collatInfo.isBurnLive;\n collatInfo.isBurnLive = isLive;\n }\n } else {\n ParallelizerStorage storage ts = s.transmuterStorage();\n isLive = 1 - ts.isRedemptionLive;\n ts.isRedemptionLive = isLive;\n }\n emit PauseToggled(collateral, uint256(action), isLive == 0);\n }\n\n /// @notice Internal version of `setFees`\n function setFees(address collateral, uint64[] memory xFee, int64[] memory yFee, bool mint) internal {\n ParallelizerStorage storage ts = s.transmuterStorage();\n Collateral storage collatInfo = ts.collaterals[collateral];\n if (collatInfo.decimals == 0) revert NotCollateral();\n checkFees(xFee, yFee, mint ? ActionType.Mint : ActionType.Burn);\n if (mint) {\n collatInfo.xFeeMint = xFee;\n collatInfo.yFeeMint = yFee;\n } else {\n collatInfo.xFeeBurn = xFee;\n collatInfo.yFeeBurn = yFee;\n }\n emit FeesSet(collateral, xFee, yFee, mint);\n }\n\n /// @notice Internal version of `setRedemptionCurveParams`\n function setRedemptionCurveParams(uint64[] memory xFee, int64[] memory yFee) internal {\n ParallelizerStorage storage ts = s.transmuterStorage();\n LibSetters.checkFees(xFee, yFee, ActionType.Redeem);\n ts.xRedemptionCurve = xFee;\n ts.yRedemptionCurve = yFee;\n emit RedemptionCurveParamsSet(xFee, yFee);\n }\n\n /// @notice Internal version of `toggleWhitelist`\n function toggleWhitelist(WhitelistType whitelistType, address who) internal {\n ParallelizerStorage storage ts = s.transmuterStorage();\n uint256 whitelistStatus = 1 - ts.isWhitelistedForType[whitelistType][who];\n ts.isWhitelistedForType[whitelistType][who] = whitelistStatus;\n emit WhitelistStatusToggled(whitelistType, who, whitelistStatus);\n }\n\n /// @notice Sets the stablecoin cap that can be issued from a collateral\n function setStablecoinCap(address collateral, uint256 stablecoinCap) internal {\n Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];\n if (collatInfo.decimals == 0) revert NotCollateral();\n collatInfo.stablecoinCap = stablecoinCap;\n emit StablecoinCapSet(collateral, stablecoinCap);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n HELPERS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Checks the fee values given for the `mint`, `burn`, and `redeem` functions\n function checkFees(uint64[] memory xFee, int64[] memory yFee, ActionType action) internal view {\n uint256 n = xFee.length;\n if (n != yFee.length || n == 0) revert InvalidParams();\n if (\n // Mint inflexion points should be in [0,BASE_9[\n // We have: amountPostFee * (BASE_9 + yFeeMint) = amountPreFee * BASE_9\n // Hence we consider BASE_12 as the max value (100% fees) for yFeeMint\n // Burn inflexion points should be in [0,BASE_9] but fees should be constant in\n // the first segment [BASE_9, x_{n-1}[\n // Redemption inflexion points should be in [0,BASE_9]\n (action == ActionType.Mint && (xFee[n - 1] >= BASE_9 || xFee[0] != 0 || yFee[n - 1] > int256(BASE_12)))\n || (\n action == ActionType.Burn\n && (xFee[0] != BASE_9 || yFee[n - 1] > int256(BASE_9) || (n > 1 && (yFee[0] != yFee[1])))\n ) || (action == ActionType.Redeem && (xFee[n - 1] > BASE_9 || yFee[n - 1] < 0 || yFee[n - 1] > int256(BASE_9)))\n ) {\n revert InvalidParams();\n }\n\n for (uint256 i; i < n - 1; ++i) {\n if (\n // xFee strictly increasing and yFee increasing for mints\n // xFee strictly decreasing and yFee increasing for burns\n // xFee strictly increasing and yFee should be in [0,BASE_9] for redemptions\n (action == ActionType.Mint && (xFee[i] >= xFee[i + 1] || (yFee[i + 1] < yFee[i])))\n || (action == ActionType.Burn && (xFee[i] <= xFee[i + 1] || (yFee[i + 1] < yFee[i])))\n || (action == ActionType.Redeem && (xFee[i] >= xFee[i + 1] || yFee[i] < 0 || yFee[i] > int256(BASE_9)))\n ) revert InvalidParams();\n }\n\n // If a mint or burn fee is negative, we need to check that accounts atomically minting\n // (from any collateral) and then burning cannot get more than their initial value\n if (yFee[0] < 0) {\n if (!LibDiamond.isGovernor(msg.sender)) revert NotGovernor(); // Only governor can set negative fees\n ParallelizerStorage storage ts = s.transmuterStorage();\n address[] memory collateralListMem = ts.collateralList;\n uint256 length = collateralListMem.length;\n if (action == ActionType.Mint) {\n // This can be mathematically expressed by `(1-min_c(burnFee_c))<=(1+mintFee[0])`\n for (uint256 i; i < length; ++i) {\n int64[] memory burnFees = ts.collaterals[collateralListMem[i]].yFeeBurn;\n if (burnFees[0] + yFee[0] < 0) revert InvalidNegativeFees();\n }\n }\n if (action == ActionType.Burn) {\n // This can be mathematically expressed by `(1-burnFee[0])<=(1+min_c(mintFee_c))`\n for (uint256 i; i < length; ++i) {\n int64[] memory mintFees = ts.collaterals[collateralListMem[i]].yFeeMint;\n if (yFee[0] + mintFees[0] < 0) revert InvalidNegativeFees();\n }\n }\n }\n }\n}\n" + }, + "contracts/parallelizer/libraries/LibStorage.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport \"../../utils/Constants.sol\";\nimport { DiamondStorage, ImplementationStorage, ParallelizerStorage } from \"../Storage.sol\";\n\n/// @title LibStorage\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This library is an authorized fork of Angle's `LibStorage` library\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibStorage.sol\nlibrary LibStorage {\n /// @notice Returns the storage struct stored at the `DIAMOND_STORAGE_POSITION` slot\n /// @dev This struct handles the logic of the different facets used in the diamond proxy\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\n bytes32 position = DIAMOND_STORAGE_POSITION;\n assembly (\"memory-safe\") {\n ds.slot := position\n }\n }\n\n /// @notice Returns the storage struct stored at the `TRANSMUTER_STORAGE_POSITION` slot\n /// @dev This struct handles the particular logic of the Parallelizer system\n function transmuterStorage() internal pure returns (ParallelizerStorage storage ts) {\n bytes32 position = TRANSMUTER_STORAGE_POSITION;\n assembly (\"memory-safe\") {\n ts.slot := position\n }\n }\n\n /// @notice Returns the storage struct stored at the `IMPLEMENTATION_STORAGE_POSITION` slot\n /// @dev This struct handles the logic for making the contract easily usable on Etherscan\n function implementationStorage() internal pure returns (ImplementationStorage storage ims) {\n bytes32 position = IMPLEMENTATION_STORAGE_POSITION;\n assembly (\"memory-safe\") {\n ims.slot := position\n }\n }\n}\n" + }, + "contracts/parallelizer/libraries/LibWhitelist.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { IKeyringGuard } from \"contracts/interfaces/external/keyring/IKeyringGuard.sol\";\n\nimport { LibStorage as s } from \"./LibStorage.sol\";\n\nimport \"../../utils/Errors.sol\";\nimport \"../Storage.sol\";\n\n/// @title LibWhitelist\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This library is an authorized fork of Angle's `LibWhitelist` library\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/parallelizer/libraries/LibWhitelist.sol\nlibrary LibWhitelist {\n /// @notice Checks whether `sender` is whitelisted for a collateral with `whitelistData`\n function checkWhitelist(bytes memory whitelistData, address sender) internal returns (bool) {\n (WhitelistType whitelistType, bytes memory data) = abi.decode(whitelistData, (WhitelistType, bytes));\n if (s.transmuterStorage().isWhitelistedForType[whitelistType][sender] > 0) return true;\n if (data.length != 0) {\n if (whitelistType == WhitelistType.BACKED) {\n address keyringGuard = abi.decode(data, (address));\n if (keyringGuard != address(0)) return IKeyringGuard(keyringGuard).isAuthorized(address(this), sender);\n }\n }\n return false;\n }\n}\n" + }, + "contracts/parallelizer/Storage.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { IAccessManager } from \"@openzeppelin/contracts/access/manager/IAccessManager.sol\";\nimport { ITokenP } from \"contracts/interfaces/ITokenP.sol\";\n\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n ENUMS \n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\nenum FacetCutAction {\n Add,\n Replace,\n Remove\n}\n\nenum ManagerType {\n EXTERNAL\n}\n\nenum ActionType {\n Mint,\n Burn,\n Redeem\n}\n\nenum TrustedType {\n Updater,\n Seller\n}\n\nenum QuoteType {\n MintExactInput,\n MintExactOutput,\n BurnExactInput,\n BurnExactOutput\n}\n\nenum OracleReadType {\n CHAINLINK_FEEDS,\n EXTERNAL,\n NO_ORACLE,\n STABLE,\n WSTETH,\n CBETH,\n RETH,\n SFRXETH,\n MAX,\n MORPHO_ORACLE\n}\n\nenum OracleQuoteType {\n UNIT,\n TARGET\n}\n\nenum WhitelistType {\n BACKED\n}\n\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n STRUCTS \n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\nstruct Permit2Details {\n address to; // Address that will receive the funds\n uint256 nonce; // Nonce of the transaction\n bytes signature; // Permit signature of the user\n}\n\nstruct FacetCut {\n address facetAddress; // Facet contract address\n FacetCutAction action; // Can be add, remove or replace\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\"transfer(address,uint256)\"))\n}\n\nstruct Facet {\n address facetAddress; // Facet contract address\n bytes4[] functionSelectors; // Ex. bytes4(keccak256(\"transfer(address,uint256)\"))\n}\n\nstruct FacetInfo {\n address facetAddress; // Facet contract address\n uint16 selectorPosition; // Position in the list of all selectors\n}\n\nstruct DiamondStorage {\n bytes4[] selectors; // List of all available selectors\n mapping(bytes4 => FacetInfo) selectorInfo; // Selector to (address, position in list)\n IAccessManager accessManager; // Contract handling access management\n}\n\nstruct ImplementationStorage {\n address implementation; // Dummy implementation address for Etherscan usability\n}\n\nstruct ManagerStorage {\n IERC20[] subCollaterals; // Subtokens handled by the manager or strategies\n bytes config; // Additional configuration data\n}\n\nstruct Collateral {\n uint8 isManaged; // If the collateral is managed through external strategies\n uint8 isMintLive; // If minting from this asset is unpaused\n uint8 isBurnLive; // If burning to this asset is unpaused\n uint8 decimals; // IERC20Metadata(collateral).decimals()\n uint8 onlyWhitelisted; // If only whitelisted addresses can burn or redeem for this token\n uint216 normalizedStables; // Normalized amount of stablecoins issued from this collateral\n uint64[] xFeeMint; // Increasing exposures in [0,BASE_9[\n int64[] yFeeMint; // Mint fees at the exposures specified in `xFeeMint`\n uint64[] xFeeBurn; // Decreasing exposures in ]0,BASE_9]\n int64[] yFeeBurn; // Burn fees at the exposures specified in `xFeeBurn`\n bytes oracleConfig; // Data about the oracle used for the collateral\n bytes whitelistData; // For whitelisted collateral, data used to verify whitelists\n ManagerStorage managerData; // For managed collateral, data used to handle the strategies\n uint256 stablecoinCap; // Cap on the amount of stablecoins that can be issued from this collateral\n}\n\nstruct ParallelizerStorage {\n ITokenP tokenP; // tokenP handled by the system\n uint8 isRedemptionLive; // If redemption is unpaused\n uint8 statusReentrant; // If call is reentrant or not\n bool consumingSchedule; // If the contract is consuming a scheduled operation\n uint128 normalizedStables; // Normalized amount of stablecoins issued by the system\n uint128 normalizer; // To reconcile `normalizedStables` values with the actual amount\n address[] collateralList; // List of collateral assets supported by the system\n uint64[] xRedemptionCurve; // Increasing collateral ratios > 0\n int64[] yRedemptionCurve; // Value of the redemption fees at `xRedemptionCurve`\n mapping(address => Collateral) collaterals; // Maps a collateral asset to its parameters\n mapping(address => uint256) isTrusted; // If an address is trusted to update the normalizer value\n mapping(address => uint256) isSellerTrusted; // If an address is trusted to sell accruing reward tokens or to run\n // keeper jobs on oracles\n mapping(WhitelistType => mapping(address => uint256)) isWhitelistedForType;\n}\n// Whether an address is whitelisted for a specific whitelist type\n" + }, + "contracts/savings/BaseSavings.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { ERC4626Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol\";\nimport { ERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport { UUPSUpgradeable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport { IERC20Metadata } from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { Math } from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\nimport { ITokenP } from \"contracts/interfaces/ITokenP.sol\";\nimport { AccessManagedUpgradeable, IAccessManager } from \"../utils/AccessManagedUpgradeable.sol\";\n\nimport \"../utils/Constants.sol\";\nimport \"../utils/Errors.sol\";\n\n/// @title BaseSavings\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @notice Parallel Savings contracts are contracts where users can deposit an `asset` and earn a yield on this asset\n/// when it is distributed\n/// @dev These contracts are functional within the Parallelizer system if they have mint right on `asset` and\n/// if they are trusted by the Parallelizer contract\n/// @dev Implementations assume that `asset` is safe to interact with, on which there cannot be reentrancy attacks\n/// @dev The ERC4626 interface does not allow users to specify a slippage protection parameter for the main entry\n/// points\n/// (like `deposit`, `mint`, `redeem` or `withdraw`). Even though there should be no specific sandwiching\n/// issue with current implementations, it is still recommended to interact with Parallel Savings contracts\n/// through a router that can implement such a protection.\n/// @dev This contract is an authorized fork of Angle's Savings contract:\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/savings/BaseSavings.sol\nabstract contract BaseSavings is Initializable, AccessManagedUpgradeable, ERC4626Upgradeable, UUPSUpgradeable {\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Upgrade the implementation of the contract\n /// @dev This function can only be called by the governor only\n /// @param newImplementation The address of the new implementation\n function _authorizeUpgrade(address newImplementation) internal override restricted { }\n}\n" + }, + "contracts/savings/nameable/SavingsNameable.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport \"../Savings.sol\";\n\n/// @title SavingsNameable\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev This contract is an authorized fork of Angle's SavingsNameable contract:\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/savings/nameable/SavingsNameable.sol\ncontract SavingsNameable is Savings {\n string internal __name;\n\n string internal __symbol;\n\n uint256[48] private __gapNameable;\n\n /// @inheritdoc ERC20Upgradeable\n function name() public view override(ERC20Upgradeable, IERC20Metadata) returns (string memory) {\n return __name;\n }\n\n /// @inheritdoc ERC20Upgradeable\n function symbol() public view override(ERC20Upgradeable, IERC20Metadata) returns (string memory) {\n return __symbol;\n }\n\n /// @notice Updates the name and symbol of the token\n function setNameAndSymbol(string memory newName, string memory newSymbol) external restricted {\n _setNameAndSymbol(newName, newSymbol);\n }\n\n function _setNameAndSymbol(string memory newName, string memory newSymbol) internal override {\n __name = newName;\n __symbol = newSymbol;\n }\n}\n" + }, + "contracts/savings/Savings.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport \"./BaseSavings.sol\";\n\n/// @title Savings\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @notice In this implementation, assets in the contract increase in value following a `rate` chosen by governance\n/// @dev This contract is an authorized fork of Angle's Savings contract:\n/// https://github.com/AngleProtocol/angle-transmuter/blob/main/contracts/savings/Savings.sol\ncontract Savings is BaseSavings {\n using SafeERC20 for IERC20Metadata;\n using Math for uint256;\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n PARAMETERS / REFERENCES \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Inflation rate (per second) in BASE_27\n uint208 public rate;\n\n /// @notice Last time rewards were accrued\n uint40 public lastUpdate;\n\n /// @notice Whether the contract is paused or not\n uint8 public paused;\n\n /// @notice Maximum inflation rate\n /// @dev Note that `rate` can still be greater than `maxRate` if this `maxRate` is reduced by governance\n /// to a level inferior to the current rate\n uint256 public maxRate;\n\n /// @notice Checks whether the address is trusted to set the rate\n mapping(address => uint256) public isTrustedUpdater;\n\n uint256[48] private __gap;\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n EVENTS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n event Accrued(uint256 interest);\n event MaxRateUpdated(uint256 newMaxRate);\n event ToggledPause(uint128 pauseStatus);\n event ToggledTrusted(address indexed trustedAddress, uint256 trustedStatus);\n event RateUpdated(uint256 newRate);\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n INITIALIZATION \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Initializes the contract\n /// @param _authority Reference to the `AccessManagerContract` contract\n /// @param name_ Name of the savings contract\n /// @param symbol_ Symbol of the savings contract\n /// @param divizer Quantifies the first initial deposit (should be typically 1 for tokens like agEUR)\n /// @dev A first deposit is done at initialization to protect for the classical issue of ERC4626 contracts\n /// where the the first user of the contract tries to steal everyone else's tokens\n function initialize(\n address _authority,\n IERC20Metadata asset_,\n string memory name_,\n string memory symbol_,\n uint256 divizer\n )\n public\n initializer\n {\n if (address(_authority) == address(0)) revert ZeroAddress();\n __ERC4626_init(asset_);\n __ERC20_init(name_, symbol_);\n __UUPSUpgradeable_init();\n __AccessManaged_init(_authority);\n _setNameAndSymbol(name_, symbol_);\n _deposit(msg.sender, address(this), 10 ** (asset_.decimals()) / divizer, BASE_18 / divizer);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n MODIFIERS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Checks whether the whole contract is paused or not\n modifier whenNotPaused() {\n if (paused > 0) revert Paused();\n _;\n }\n\n /// @notice Checks whether the sender is allowed to update the rate\n modifier onlyTrustedOrRestricted() {\n if (isTrustedUpdater[msg.sender] == 0 && !_checkCanCall(_msgSender(), _msgData())) {\n revert NotTrusted();\n }\n _;\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n CONTRACT LOGIC \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Accrues interest to this contract by minting tokenPs\n function _accrue() internal returns (uint256 newTotalAssets) {\n uint256 currentBalance = super.totalAssets();\n newTotalAssets = _computeUpdatedAssets(currentBalance, block.timestamp - lastUpdate);\n lastUpdate = uint40(block.timestamp);\n uint256 earned = newTotalAssets - currentBalance;\n if (earned > 0) {\n ITokenP(asset()).mint(address(this), earned);\n emit Accrued(earned);\n }\n }\n\n /// @notice Computes how much `currentBalance` held in the contract would be after `exp` time following\n /// the `rate` of increase\n function _computeUpdatedAssets(uint256 currentBalance, uint256 exp) internal view returns (uint256) {\n uint256 ratePerSecond = rate;\n if (exp == 0 || ratePerSecond == 0) return currentBalance;\n uint256 expMinusOne = exp - 1;\n uint256 expMinusTwo = exp > 2 ? exp - 2 : 0;\n uint256 basePowerTwo = (ratePerSecond * ratePerSecond + HALF_BASE_27) / BASE_27;\n uint256 basePowerThree = (basePowerTwo * ratePerSecond + HALF_BASE_27) / BASE_27;\n uint256 secondTerm = (exp * expMinusOne * basePowerTwo) / 2;\n uint256 thirdTerm = (exp * expMinusOne * expMinusTwo * basePowerThree) / 6;\n return (currentBalance * (BASE_27 + ratePerSecond * exp + secondTerm + thirdTerm)) / BASE_27;\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n ERC4626 VIEW FUNCTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @inheritdoc ERC4626Upgradeable\n function totalAssets() public view override returns (uint256) {\n return _computeUpdatedAssets(super.totalAssets(), block.timestamp - lastUpdate);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n ERC4626 INTERACTION FUNCTIONS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @inheritdoc ERC4626Upgradeable\n function deposit(uint256 assets, address receiver) public override whenNotPaused returns (uint256 shares) {\n uint256 newTotalAssets = _accrue();\n shares = _convertToShares(assets, newTotalAssets, Math.Rounding.Floor);\n _deposit(_msgSender(), receiver, assets, shares);\n }\n\n /// @inheritdoc ERC4626Upgradeable\n function mint(uint256 shares, address receiver) public override whenNotPaused returns (uint256 assets) {\n uint256 newTotalAssets = _accrue();\n assets = _convertToAssets(shares, newTotalAssets, Math.Rounding.Ceil);\n _deposit(_msgSender(), receiver, assets, shares);\n }\n\n /// @inheritdoc ERC4626Upgradeable\n function withdraw(\n uint256 assets,\n address receiver,\n address owner\n )\n public\n override\n whenNotPaused\n returns (uint256 shares)\n {\n uint256 newTotalAssets = _accrue();\n shares = _convertToShares(assets, newTotalAssets, Math.Rounding.Ceil);\n _withdraw(_msgSender(), receiver, owner, assets, shares);\n }\n\n /// @inheritdoc ERC4626Upgradeable\n function redeem(\n uint256 shares,\n address receiver,\n address owner\n )\n public\n override\n whenNotPaused\n returns (uint256 assets)\n {\n uint256 newTotalAssets = _accrue();\n assets = _convertToAssets(shares, newTotalAssets, Math.Rounding.Floor);\n _withdraw(_msgSender(), receiver, owner, assets, shares);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n INTERNAL HELPERS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @inheritdoc ERC4626Upgradeable\n function _convertToShares(uint256 assets, Math.Rounding rounding) internal view override returns (uint256 shares) {\n return _convertToShares(assets, totalAssets(), rounding);\n }\n\n /// @notice Same as the function above except that the `totalAssets` value does not have to be recomputed here\n function _convertToShares(\n uint256 assets,\n uint256 newTotalAssets,\n Math.Rounding rounding\n )\n internal\n view\n returns (uint256 shares)\n {\n uint256 supply = totalSupply();\n return (assets == 0 || supply == 0)\n ? assets.mulDiv(BASE_18, 10 ** (IERC20Metadata(asset()).decimals()), rounding)\n : assets.mulDiv(supply, newTotalAssets, rounding);\n }\n\n /// @inheritdoc ERC4626Upgradeable\n function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view override returns (uint256 assets) {\n return _convertToAssets(shares, totalAssets(), rounding);\n }\n\n /// @notice Same as the function above except that the `totalAssets` value does not have to be recomputed here\n function _convertToAssets(\n uint256 shares,\n uint256 newTotalAssets,\n Math.Rounding rounding\n )\n internal\n view\n returns (uint256 assets)\n {\n uint256 supply = totalSupply();\n return (supply == 0)\n ? shares.mulDiv(10 ** (IERC20Metadata(asset()).decimals()), BASE_18, rounding)\n : shares.mulDiv(newTotalAssets, supply, rounding);\n }\n\n function _setNameAndSymbol(string memory newName, string memory newSymbol) internal virtual { }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n HELPERS \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Provides an estimated Annual Percentage Rate for base depositors on this contract\n function estimatedAPR() external view returns (uint256 apr) {\n // 365 days = 31536000 seconds\n return _computeUpdatedAssets(BASE_18, 31_536_000) - BASE_18;\n }\n\n /// @notice Wrapper on top of the `computeUpdatedAssets` function\n function computeUpdatedAssets(uint256 _totalAssets, uint256 exp) external view returns (uint256) {\n return _computeUpdatedAssets(_totalAssets, exp);\n }\n\n /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n GOVERNANCE \n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n /// @notice Pauses the contract\n function togglePause() external restricted {\n uint8 pauseStatus = 1 - paused;\n paused = pauseStatus;\n emit ToggledPause(pauseStatus);\n }\n\n /// @notice Toggles an address\n function toggleTrusted(address trustedAddress) external restricted {\n uint256 trustedStatus = 1 - isTrustedUpdater[trustedAddress];\n isTrustedUpdater[trustedAddress] = trustedStatus;\n emit ToggledTrusted(trustedAddress, trustedStatus);\n }\n\n /// @notice Updates the inflation rate for depositing `asset` in this contract\n /// @dev Any `rate` can be set by the guardian or by a trusted address provided that it is inferior to\n ///the `maxRate` settable by a governor address\n function setRate(uint208 newRate) external onlyTrustedOrRestricted {\n if (newRate > maxRate) revert InvalidRate();\n _accrue();\n rate = newRate;\n emit RateUpdated(newRate);\n }\n\n /// @notice Updates the maximum rate settable\n function setMaxRate(uint256 newMaxRate) external restricted {\n maxRate = newMaxRate;\n emit MaxRateUpdated(newMaxRate);\n }\n}\n" + }, + "contracts/utils/AccessManaged.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { AuthorityUtils } from \"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\";\nimport { IAccessManager } from \"@openzeppelin/contracts/access/manager/IAccessManager.sol\";\nimport { IAccessManaged } from \"@openzeppelin/contracts/access/manager/IAccessManaged.sol\";\nimport { Context } from \"@openzeppelin/contracts/utils/Context.sol\";\n\nimport \"../utils/Errors.sol\";\n\n/// @title AccessControl\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev Fork of OpenZeppelin's `AccessManaged` contract\n/// updated to make _checkCanCall to return bool\n/// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/manager/AccessManaged.sol\ncontract AccessManaged is Context, IAccessManaged {\n address private _authority;\n\n bool private _consumingSchedule;\n\n /**\n * @dev Initializes the contract connected to an initial authority.\n */\n constructor(address initialAuthority) {\n _setAuthority(initialAuthority);\n }\n\n /**\n * @dev Restricts access to a function as defined by the connected Authority for this contract and the\n * caller and selector of the function that entered the contract.\n *\n * [IMPORTANT]\n * ====\n * In general, this modifier should only be used on `external` functions. It is okay to use it on `public`\n * functions that are used as external entry points and are not called internally. Unless you know what you're\n * doing, it should never be used on `internal` functions. Failure to follow these rules can have critical security\n * implications! This is because the permissions are determined by the function that entered the contract, i.e. the\n * function at the bottom of the call stack, and not the function where the modifier is visible in the source code.\n * ====\n *\n * [WARNING]\n * ====\n * Avoid adding this modifier to the\n * https://docs.soliditylang.org/en/v0.8.20/contracts.html#receive-ether-function[`receive()`]\n * function or the https://docs.soliditylang.org/en/v0.8.20/contracts.html#fallback-function[`fallback()`]. These\n * functions are the only execution paths where a function selector cannot be unambiguously determined from the\n * calldata\n * since the selector defaults to `0x00000000` in the `receive()` function and similarly in the `fallback()`\n * function\n * if no calldata is provided. (See {_checkCanCall}).\n *\n * The `receive()` function will always panic whereas the `fallback()` may panic depending on the calldata length.\n * ====\n */\n modifier restricted() {\n address caller = _msgSender();\n require(_checkCanCall(caller, _msgData()), AccessManagedUnauthorized(caller));\n _;\n }\n\n /// @inheritdoc IAccessManaged\n function authority() public view virtual returns (address) {\n return _authority;\n }\n\n /// @inheritdoc IAccessManaged\n function setAuthority(address newAuthority) public virtual {\n address caller = _msgSender();\n if (caller != authority()) {\n revert AccessManagedUnauthorized(caller);\n }\n if (newAuthority.code.length == 0) {\n revert AccessManagedInvalidAuthority(newAuthority);\n }\n _setAuthority(newAuthority);\n }\n\n /// @inheritdoc IAccessManaged\n function isConsumingScheduledOp() public view returns (bytes4) {\n return _consumingSchedule ? this.isConsumingScheduledOp.selector : bytes4(0);\n }\n\n /**\n * @dev Transfers control to a new authority. Internal function with no access restriction. Allows bypassing the\n * permissions set by the current authority.\n */\n function _setAuthority(address newAuthority) internal virtual {\n _authority = newAuthority;\n emit AuthorityUpdated(newAuthority);\n }\n\n function _checkCanCall(address caller, bytes calldata data) internal virtual returns (bool) {\n (bool immediate, uint32 delay) =\n AuthorityUtils.canCallWithDelay(authority(), caller, address(this), bytes4(data[0:4]));\n if (!immediate) {\n if (delay > 0) {\n _consumingSchedule = true;\n IAccessManager(authority()).consumeScheduledOp(caller, data);\n _consumingSchedule = false;\n } else {\n return false;\n }\n }\n return true;\n }\n}\n" + }, + "contracts/utils/AccessManagedUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (access/manager/AccessManaged.sol)\npragma solidity 0.8.28;\n\nimport { AuthorityUtils } from \"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\";\nimport { IAccessManager } from \"@openzeppelin/contracts/access/manager/IAccessManager.sol\";\nimport { IAccessManaged } from \"@openzeppelin/contracts/access/manager/IAccessManaged.sol\";\nimport { ContextUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/// @title AccessControl\n/// @author Cooper Labs\n/// @custom:contact security@cooperlabs.xyz\n/// @dev Fork of OpenZeppelin's `AccessManagedUpgradeable` contract\n/// updated to make _checkCanCall to return bool\n/* solhint-disable max-line-length */\n/// https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/access/manager/AccessManagedUpgradeable.sol\n/* solhint-enable max-line-length */\nabstract contract AccessManagedUpgradeable is Initializable, ContextUpgradeable, IAccessManaged {\n /// @custom:storage-location erc7201:openzeppelin.storage.AccessManaged\n struct AccessManagedStorage {\n address _authority;\n bool _consumingSchedule;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.AccessManaged\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant AccessManagedStorageLocation =\n 0xf3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a00;\n\n function _getAccessManagedStorage() private pure returns (AccessManagedStorage storage $) {\n assembly (\"memory-safe\") {\n $.slot := AccessManagedStorageLocation\n }\n }\n\n /**\n * @dev Initializes the contract connected to an initial authority.\n */\n function __AccessManaged_init(address initialAuthority) internal onlyInitializing {\n __AccessManaged_init_unchained(initialAuthority);\n }\n\n function __AccessManaged_init_unchained(address initialAuthority) internal onlyInitializing {\n _setAuthority(initialAuthority);\n }\n\n /**\n * @dev Restricts access to a function as defined by the connected Authority for this contract and the\n * caller and selector of the function that entered the contract.\n *\n * [IMPORTANT]\n * ====\n * In general, this modifier should only be used on `external` functions. It is okay to use it on `public`\n * functions that are used as external entry points and are not called internally. Unless you know what you're\n * doing, it should never be used on `internal` functions. Failure to follow these rules can have critical security\n * implications! This is because the permissions are determined by the function that entered the contract, i.e. the\n * function at the bottom of the call stack, and not the function where the modifier is visible in the source code.\n * ====\n *\n * [WARNING]\n * ====\n * Avoid adding this modifier to the\n * https://docs.soliditylang.org/en/v0.8.20/contracts.html#receive-ether-function[`receive()`]\n * function or the https://docs.soliditylang.org/en/v0.8.20/contracts.html#fallback-function[`fallback()`]. These\n * functions are the only execution paths where a function selector cannot be unambiguously determined from the\n * calldata\n * since the selector defaults to `0x00000000` in the `receive()` function and similarly in the `fallback()`\n * function\n * if no calldata is provided. (See {_checkCanCall}).\n *\n * The `receive()` function will always panic whereas the `fallback()` may panic depending on the calldata length.\n * ====\n */\n modifier restricted() {\n address caller = _msgSender();\n require(_checkCanCall(caller, _msgData()), AccessManagedUnauthorized(caller));\n _;\n }\n\n /// @inheritdoc IAccessManaged\n function authority() public view virtual returns (address) {\n AccessManagedStorage storage $ = _getAccessManagedStorage();\n return $._authority;\n }\n\n /// @inheritdoc IAccessManaged\n function setAuthority(address newAuthority) public virtual {\n address caller = _msgSender();\n if (caller != authority()) {\n revert AccessManagedUnauthorized(caller);\n }\n if (newAuthority.code.length == 0) {\n revert AccessManagedInvalidAuthority(newAuthority);\n }\n _setAuthority(newAuthority);\n }\n\n /// @inheritdoc IAccessManaged\n function isConsumingScheduledOp() public view returns (bytes4) {\n AccessManagedStorage storage $ = _getAccessManagedStorage();\n return $._consumingSchedule ? this.isConsumingScheduledOp.selector : bytes4(0);\n }\n\n /**\n * @dev Transfers control to a new authority. Internal function with no access restriction. Allows bypassing the\n * permissions set by the current authority.\n */\n function _setAuthority(address newAuthority) internal virtual {\n AccessManagedStorage storage $ = _getAccessManagedStorage();\n $._authority = newAuthority;\n emit AuthorityUpdated(newAuthority);\n }\n\n /**\n * @dev Reverts if the caller is not allowed to call the function identified by a selector. Panics if the calldata\n * is less than 4 bytes long.\n */\n function _checkCanCall(address caller, bytes calldata data) internal virtual returns (bool) {\n AccessManagedStorage storage $ = _getAccessManagedStorage();\n (bool immediate, uint32 delay) =\n AuthorityUtils.canCallWithDelay(authority(), caller, address(this), bytes4(data[0:4]));\n if (!immediate) {\n if (delay > 0) {\n $._consumingSchedule = true;\n IAccessManager(authority()).consumeScheduledOp(caller, data);\n $._consumingSchedule = false;\n } else {\n return false;\n }\n }\n return true;\n }\n}\n" + }, + "contracts/utils/Constants.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport { ICbETH } from \"contracts/interfaces/external/coinbase/ICbETH.sol\";\nimport { ISfrxETH } from \"contracts/interfaces/external/frax/ISfrxETH.sol\";\nimport { IStETH } from \"contracts/interfaces/external/lido/IStETH.sol\";\nimport { IRETH } from \"contracts/interfaces/external/rocketPool/IRETH.sol\";\n\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n STORAGE SLOTS \n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n/// @dev Storage position of `DiamondStorage` structure\n/// @dev Equals `keccak256(\"diamond.standard.diamond.storage\") - 1`\nbytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b;\n\n/// @dev Storage position of `ParallelizerStorage` structure\n/// @dev Equals `keccak256(\"diamond.standard.parallelizer.storage\") - 1`\nbytes32 constant TRANSMUTER_STORAGE_POSITION = 0x4b2dd303f68b99d244b702089c802b6e9ea1b5d4ef61fd436d6c41abb1178c75;\n\n/// @dev Storage position of `ImplementationStorage` structure\n/// @dev Equals `keccak256(\"eip1967.proxy.implementation\") - 1`\nbytes32 constant IMPLEMENTATION_STORAGE_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n MATHS \n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\nuint256 constant BASE_6 = 1e6;\nuint256 constant BASE_8 = 1e8;\nuint256 constant BASE_9 = 1e9;\nuint256 constant BASE_12 = 1e12;\nuint256 constant BPS = 1e14;\nuint256 constant BASE_18 = 1e18;\nuint256 constant HALF_BASE_27 = 1e27 / 2;\nuint256 constant BASE_27 = 1e27;\nuint256 constant BASE_36 = 1e36;\nuint256 constant MAX_BURN_FEE = 999_000_000;\nuint256 constant MAX_MINT_FEE = BASE_12 - 1;\n\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n REENTRANT \n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n// The values being non-zero value makes deployment a bit more expensive,\n// but in exchange the refund on every call to nonReentrant will be lower in\n// amount. Since refunds are capped to a percentage of the total\n// transaction's gas, it is best to keep them low in cases like this one, to\n// increase the likelihood of the full refund coming into effect.\nuint8 constant NOT_ENTERED = 1;\nuint8 constant ENTERED = 2;\n\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n REENTRANT \n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\n// Role IDs for the AccessManager\nuint64 constant GOVERNOR_ROLE = 10;\nuint64 constant GUARDIAN_ROLE = 20;\n\n/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n COMMON ADDRESSES \n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/\n\naddress constant PERMIT_2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\naddress constant ODOS_ROUTER = 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559;\naddress constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;\nICbETH constant CBETH = ICbETH(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704);\nIRETH constant RETH = IRETH(0xae78736Cd615f374D3085123A210448E74Fc6393);\nIStETH constant STETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);\nISfrxETH constant SFRXETH = ISfrxETH(0xac3E018457B222d93114458476f3E3416Abbe38F);\naddress constant XEVT = 0x3Ee320c9F73a84D1717557af00695A34b26d1F1d;\naddress constant USDM = 0x59D9356E565Ab3A36dD77763Fc0d87fEaf85508C;\naddress constant STEAK_USDC = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB;\naddress constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\naddress constant EURC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;\n" + }, + "contracts/utils/Errors.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nerror AccessManagedUnauthorized(address caller);\nerror AlreadyAdded();\nerror CannotAddFunctionToDiamondThatAlreadyExists(bytes4 _selector);\nerror CannotAddSelectorsToZeroAddress(bytes4[] _selectors);\nerror CannotRemoveFunctionThatDoesNotExist(bytes4 _selector);\nerror CannotRemoveImmutableFunction(bytes4 _selector);\nerror CannotReplaceFunctionsFromFacetWithZeroAddress(bytes4[] _selectors);\nerror CannotReplaceFunctionThatDoesNotExists(bytes4 _selector);\nerror CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet(bytes4 _selector);\nerror CannotReplaceImmutableFunction(bytes4 _selector);\nerror ContractHasNoCode();\nerror CollateralBacked();\nerror FunctionNotFound(bytes4 _functionSelector);\nerror IncorrectFacetCutAction(uint8 _action);\nerror InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata);\nerror InvalidChainlinkRate();\nerror InvalidLengths();\nerror InvalidNegativeFees();\nerror InvalidOracleType();\nerror InvalidParam();\nerror InvalidParams();\nerror InvalidRate();\nerror InvalidSwap();\nerror InvalidTokens();\nerror InvalidAccessManager();\nerror ManagerHasAssets();\nerror NoSelectorsProvidedForFacetForCut(address _facetAddress);\nerror NotAllowed();\nerror NotCollateral();\nerror NotGovernor();\nerror NotGuardian();\nerror NotTrusted();\nerror NotTrustedOrGuardian();\nerror NotWhitelisted();\nerror OdosSwapFailed();\nerror OracleUpdateFailed();\nerror Paused();\nerror ReentrantCall();\nerror RemoveFacetAddressMustBeZeroAddress(address _facetAddress);\nerror TooBigAmountIn();\nerror TooLate();\nerror TooSmallAmountOut();\nerror ZeroAddress();\nerror ZeroAmount();\nerror SwapError();\nerror SlippageTooHigh();\nerror InsufficientFunds();\n" + } + }, + "settings": { + "evmVersion": "cancun", + "optimizer": { + "enabled": true, + "runs": 1000 + }, + "viaIR": true, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index c85a29f..7c1b5cc 100644 --- a/foundry.toml +++ b/foundry.toml @@ -51,7 +51,6 @@ mainnet = { key = "${MAINNET_ETHERSCAN_API_KEY}" } optimism = { key = "${OPTIMISM_ETHERSCAN_API_KEY}" } polygon = { key = "${POLYGON_ETHERSCAN_API_KEY}" } base = { key = "${BASE_ETHERSCAN_API_KEY}", url = "https://api.basescan.org/api" } -bsc = { key = "${BSC_ETHERSCAN_API_KEY}"} [profile.dev] via_ir = false diff --git a/scripts/Base.s.sol b/scripts/Base.s.sol new file mode 100644 index 0000000..8f2689e --- /dev/null +++ b/scripts/Base.s.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.28; + +import { Script, console2 } from "@forge-std/Script.sol"; + +import { IAccessManager } from "@openzeppelin/contracts/access/manager/IAccessManager.sol"; + +contract BaseScript is Script { + /// @dev The address of the transaction broadcaster. + address internal broadcaster; + + IAccessManager accessManager = IAccessManager(0xfD28f108e95f4D41daAE9dbfFf707D677985998E); + + modifier broadcast() { + uint256 privateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(privateKey); + broadcaster = vm.addr(privateKey); + _; + vm.stopBroadcast(); + } +} + +library Roles { + uint64 constant GOVERNOR_ROLE = 10; + uint64 constant GOVERNOR_ROLE_TIMELOCK = 11; + uint64 constant GUARDIAN_ROLE = 20; + uint64 constant GUARDIAN_ROLE_TIMELOCK = 21; + uint64 constant KEEPER_ROLE = 30; + uint64 constant KEEPER_ROLE_TIMELOCK = 31; + uint64 constant EURp_MINTER_ROLE = 100; + uint64 constant EURp_MINTER_ROLE_TIMELOCK = 105; + uint64 constant USDp_MINTER_ROLE = 110; + uint64 constant USDp_MINTER_ROLE_TIMELOCK = 115; + uint64 constant ETHp_MINTER_ROLE = 120; + uint64 constant ETHp_MINTER_ROLE_TIMELOCK = 125; + uint64 constant BTCp_MINTER_ROLE = 130; + uint64 constant BTCp_MINTER_ROLE_TIMELOCK = 135; +} diff --git a/scripts/SetParallelizerRoles.s.sol b/scripts/SetParallelizerRoles.s.sol new file mode 100644 index 0000000..4431df0 --- /dev/null +++ b/scripts/SetParallelizerRoles.s.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.28; + +import "./Base.s.sol"; + +import { ISettersGuardian, ISettersGovernor } from "contracts/interfaces/ISetters.sol"; +import { IDiamondEtherscan } from "contracts/interfaces/IDiamondEtherscan.sol"; + +contract SetParallelizerRoles is BaseScript { + address parallelizer = 0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862; + + function run() public broadcast { + bytes4[] memory guardianSelectors = new bytes4[](6); + guardianSelectors[0] = ISettersGuardian.togglePause.selector; + guardianSelectors[1] = ISettersGuardian.setFees.selector; + guardianSelectors[2] = ISettersGuardian.setRedemptionCurveParams.selector; + guardianSelectors[3] = ISettersGuardian.toggleWhitelist.selector; + guardianSelectors[4] = ISettersGuardian.setStablecoinCap.selector; + guardianSelectors[5] = IDiamondEtherscan.setDummyImplementation.selector; + accessManager.setTargetFunctionRole(parallelizer, guardianSelectors, Roles.GUARDIAN_ROLE); + + bytes4[] memory governorSelectors = new bytes4[](11); + governorSelectors[0] = ISettersGovernor.recoverERC20.selector; + governorSelectors[1] = ISettersGovernor.setAccessManager.selector; + governorSelectors[2] = ISettersGovernor.setCollateralManager.selector; + governorSelectors[3] = ISettersGovernor.changeAllowance.selector; + governorSelectors[4] = ISettersGovernor.toggleTrusted.selector; + governorSelectors[5] = ISettersGovernor.addCollateral.selector; + governorSelectors[6] = ISettersGovernor.adjustStablecoins.selector; + governorSelectors[7] = ISettersGovernor.revokeCollateral.selector; + governorSelectors[8] = ISettersGovernor.setOracle.selector; + governorSelectors[9] = ISettersGovernor.updateOracle.selector; + governorSelectors[10] = ISettersGovernor.setWhitelistStatus.selector; + accessManager.setTargetFunctionRole(parallelizer, governorSelectors, Roles.GOVERNOR_ROLE); + + accessManager.grantRole(Roles.USDp_MINTER_ROLE, address(parallelizer), 0); + } +} diff --git a/scripts/SetSavingRoles.s.sol b/scripts/SetSavingRoles.s.sol new file mode 100644 index 0000000..eebfb49 --- /dev/null +++ b/scripts/SetSavingRoles.s.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.28; + +import { UUPSUpgradeable } from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; +import { SavingsNameable } from "contracts/savings/nameable/SavingsNameable.sol"; +import { Savings } from "contracts/savings/Savings.sol"; + +import "./Base.s.sol"; + +contract SetSavingRoles is BaseScript { + address saving = 0x23D491aa7C0972087F8a607F6f4c7106a02BA95d; + + function run() public broadcast { + bytes4[] memory guardianSelectors = new bytes4[](3); + guardianSelectors[0] = Savings.togglePause.selector; + guardianSelectors[1] = Savings.toggleTrusted.selector; + guardianSelectors[2] = Savings.setRate.selector; + accessManager.setTargetFunctionRole(saving, guardianSelectors, Roles.GUARDIAN_ROLE); + + bytes4[] memory governorSelectors = new bytes4[](5); + governorSelectors[0] = SavingsNameable.setNameAndSymbol.selector; + governorSelectors[1] = Savings.setMaxRate.selector; + governorSelectors[2] = UUPSUpgradeable.upgradeToAndCall.selector; + accessManager.setTargetFunctionRole(saving, governorSelectors, Roles.GOVERNOR_ROLE); + + accessManager.grantRole(Roles.USDp_MINTER_ROLE, address(saving), 0); + } +} From 72eed15302939823f55f9b5667b4f881df3bc282 Mon Sep 17 00:00:00 2001 From: FabienCoutant Date: Tue, 27 May 2025 10:59:40 +0300 Subject: [PATCH 9/9] fix: lint/prettier error --- deployments/sepolia/DiamondCut.json | 2 +- deployments/sepolia/DiamondInitializer.json | 2 +- deployments/sepolia/DiamondLoupe.json | 2 +- deployments/sepolia/Getters.json | 2 +- deployments/sepolia/Parallelizer_USDp.json | 49 ++++--------------- deployments/sepolia/Redeemer.json | 2 +- deployments/sepolia/RewardHandler.json | 2 +- deployments/sepolia/SavingsNameable.json | 6 +-- deployments/sepolia/Savings_USDp.json | 10 ++-- deployments/sepolia/Savings_USDp_Proxy.json | 10 ++-- deployments/sepolia/SettersGovernor.json | 2 +- deployments/sepolia/SettersGuardian.json | 2 +- deployments/sepolia/Swapper.json | 2 +- .../0e89febeebc7444140de8e67c9067d2c.json | 6 +-- .../9d44d918681c9ad36f866ebee034a3d1.json | 6 +-- 15 files changed, 30 insertions(+), 75 deletions(-) diff --git a/deployments/sepolia/DiamondCut.json b/deployments/sepolia/DiamondCut.json index e479ff2..1c13463 100644 --- a/deployments/sepolia/DiamondCut.json +++ b/deployments/sepolia/DiamondCut.json @@ -278,4 +278,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/DiamondInitializer.json b/deployments/sepolia/DiamondInitializer.json index 730062a..6e5a60d 100644 --- a/deployments/sepolia/DiamondInitializer.json +++ b/deployments/sepolia/DiamondInitializer.json @@ -272,4 +272,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/DiamondLoupe.json b/deployments/sepolia/DiamondLoupe.json index aa66027..fce121c 100644 --- a/deployments/sepolia/DiamondLoupe.json +++ b/deployments/sepolia/DiamondLoupe.json @@ -159,4 +159,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/Getters.json b/deployments/sepolia/Getters.json index 5609a32..f72bfd4 100644 --- a/deployments/sepolia/Getters.json +++ b/deployments/sepolia/Getters.json @@ -769,4 +769,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/Parallelizer_USDp.json b/deployments/sepolia/Parallelizer_USDp.json index c1d82b5..1cf1b98 100644 --- a/deployments/sepolia/Parallelizer_USDp.json +++ b/deployments/sepolia/Parallelizer_USDp.json @@ -244,9 +244,7 @@ "blockNumber": 8411101, "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", - "topics": [ - "0x8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673" - ], + "topics": ["0x8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673"], "data": "0x0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a19c5d1013a8682ac76206a085ec24ac89f7c0250000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000009200000000000000000000000000000000000000000000000000000000000000a600000000000000000000000000000000000000000000000000000000000000b600000000000000000000000009b3a8f7cec208e247d97dee13313690977e244590000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000011f931c1c00000000000000000000000000000000000000000000000000000000000000000000000000000000c9b6279baa19dbb8bcc3250c89caa093aaba0bfc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004cdffacc60000000000000000000000000000000000000000000000000000000052ef6b2c00000000000000000000000000000000000000000000000000000000adfca15e000000000000000000000000000000000000000000000000000000007a0ed62700000000000000000000000000000000000000000000000000000000000000000000000000000000a360e5ad9f17caff53715346888aa0d13541c2f500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000bf0d2d5a800000000000000000000000000000000000000000000000000000000c1cdee7e0000000000000000000000000000000000000000000000000000000087c8ab7a000000000000000000000000000000000000000000000000000000005c3eebda000000000000000000000000000000000000000000000000000000004591f14800000000000000000000000000000000000000000000000000000000c9580804000000000000000000000000000000000000000000000000000000004d2b3e1400000000000000000000000000000000000000000000000000000000b13b0847000000000000000000000000000000000000000000000000000000001b0c7182000000000000000000000000000000000000000000000000000000007c0343a1000000000000000000000000000000000000000000000000000000001cb44dfc00000000000000000000000000000000000000000000000000000000000000000000000000000000a9c21cf291ad935e0c9b05a55a42254fb159181d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000005629feb62000000000000000000000000000000000000000000000000000000004eec47b900000000000000000000000000000000000000000000000000000000603b432700000000000000000000000000000000000000000000000000000000a9e6a1a400000000000000000000000000000000000000000000000000000000b607d0990000000000000000000000000000000000000000000000000000000000000000000000000000000078bb4882b77d74ad9b04ab71fe8e61f72595823c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000018fdcb606800000000000000000000000000000000000000000000000000000000847da7be00000000000000000000000000000000000000000000000000000000eb7aac5f000000000000000000000000000000000000000000000000000000003335221000000000000000000000000000000000000000000000000000000000b718136100000000000000000000000000000000000000000000000000000000b85780bc00000000000000000000000000000000000000000000000000000000cd377c5300000000000000000000000000000000000000000000000000000000782513bd0000000000000000000000000000000000000000000000000000000094e35d9e000000000000000000000000000000000000000000000000000000004ea3e3430000000000000000000000000000000000000000000000000000000010d3d22e0000000000000000000000000000000000000000000000000000000038c269eb00000000000000000000000000000000000000000000000000000000adc9d1f70000000000000000000000000000000000000000000000000000000031da6b13000000000000000000000000000000000000000000000000000000008db9653f000000000000000000000000000000000000000000000000000000008fb36037000000000000000000000000000000000000000000000000000000000d1266270000000000000000000000000000000000000000000000000000000096d6487900000000000000000000000000000000000000000000000000000000fe7d0c540000000000000000000000000000000000000000000000000000000077dc342900000000000000000000000000000000000000000000000000000000f9839d8900000000000000000000000000000000000000000000000000000000a52aefd40000000000000000000000000000000000000000000000000000000099eeca49000000000000000000000000000000000000000000000000000000001978a5ed000000000000000000000000000000000000000000000000000000000000000000000000000000001bb46fc55e3fd91ca0f162dcc0b3ef574c8ff97e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000064583aea6000000000000000000000000000000000000000000000000000000009525f3ab000000000000000000000000000000000000000000000000000000003b6a1fe000000000000000000000000000000000000000000000000000000000d92c6cb200000000000000000000000000000000000000000000000000000000b92567fa00000000000000000000000000000000000000000000000000000000c10a62870000000000000000000000000000000000000000000000000000000000000000000000000000000057770c1721eb35509f38210a935c8b1911db7e0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004d703a0cd00000000000000000000000000000000000000000000000000000000815822c1000000000000000000000000000000000000000000000000000000002e7639bc00000000000000000000000000000000000000000000000000000000fd7daaf800000000000000000000000000000000000000000000000000000000000000000000000000000000ad58fc13a682a121e5fe2f8e45d4d988a7e51b0d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000105b4193400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080477dabb7b000000000000000000000000fd28f108e95f4d41daae9dbfff707d677985998e000000000000000000000000e8a3da6f5ed1cf04c58ac7f6a7383641e877517b000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000006800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000094a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000004c0000000000000000000000000000000000000000000000000000000000000054000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a2f78ab2355fe2f984d808b5cee7fd0a93d5270e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011c37937e0800000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003807430000000000000000000000000000000000000000000000000000000000389fd9800000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000e8d4a50fff0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000000000000127a39800000000000000000000000000000000000000000000000000000000011e1a3000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000003b8b87c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000002cb417800000000000000000000000000000000000000000000000000000000032a9f88000000000000000000000000000000000000000000000000000000000389fd9800000000000000000000000000000000000000000000000000000000039d106800000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000003b4e7ec000000000000000000000000000000000000000000000000000000000389fd98000000000000000000000000000000000000000000000000000000000389fd980000000000000000000000000000000000000000000000000000000003b4e7ec000000000000000000000000000000000000000000000000000000000", "logIndex": 354, "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" @@ -361,9 +359,7 @@ "blockNumber": 8411101, "transactionHash": "0x5471e8fa2791ca82287326568311eefd6c6a003efec4d23b13bbb69c9241e610", "address": "0xd8cc2A51556Da84b5DB309e86f30Ff98B5309862", - "topics": [ - "0xdd1690e851f57f138700d42b0a081b3b1b9a97dd2cb2aabc25c9265873629064" - ], + "topics": ["0xdd1690e851f57f138700d42b0a081b3b1b9a97dd2cb2aabc25c9265873629064"], "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000002cb417800000000000000000000000000000000000000000000000000000000032a9f88000000000000000000000000000000000000000000000000000000000389fd9800000000000000000000000000000000000000000000000000000000039d106800000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000003b4e7ec000000000000000000000000000000000000000000000000000000000389fd98000000000000000000000000000000000000000000000000000000000389fd980000000000000000000000000000000000000000000000000000000003b4e7ec0", "logIndex": 363, "blockHash": "0x350fb1a3368a4070309ab67aa2a5d3c00304b78ac03c17bec1c34ef33592a2d1" @@ -379,19 +375,12 @@ { "facetAddress": "0x9B3a8f7CEC208e247d97dEE13313690977e24459", "action": 0, - "functionSelectors": [ - "0x1f931c1c" - ] + "functionSelectors": ["0x1f931c1c"] }, { "facetAddress": "0xC9B6279baa19dBB8bCc3250c89cAa093AaBA0bfc", "action": 0, - "functionSelectors": [ - "0xcdffacc6", - "0x52ef6b2c", - "0xadfca15e", - "0x7a0ed627" - ] + "functionSelectors": ["0xcdffacc6", "0x52ef6b2c", "0xadfca15e", "0x7a0ed627"] }, { "facetAddress": "0xA360E5aD9F17caff53715346888aA0d13541c2F5", @@ -413,13 +402,7 @@ { "facetAddress": "0xa9C21Cf291ad935e0C9B05a55A42254fB159181d", "action": 0, - "functionSelectors": [ - "0x629feb62", - "0x4eec47b9", - "0x603b4327", - "0xa9e6a1a4", - "0xb607d099" - ] + "functionSelectors": ["0x629feb62", "0x4eec47b9", "0x603b4327", "0xa9e6a1a4", "0xb607d099"] }, { "facetAddress": "0x78BB4882b77D74aD9B04Ab71fE8e61f72595823C", @@ -454,31 +437,17 @@ { "facetAddress": "0x1bB46FC55E3fd91Ca0F162DCC0B3ef574C8ff97E", "action": 0, - "functionSelectors": [ - "0x4583aea6", - "0x9525f3ab", - "0x3b6a1fe0", - "0xd92c6cb2", - "0xb92567fa", - "0xc10a6287" - ] + "functionSelectors": ["0x4583aea6", "0x9525f3ab", "0x3b6a1fe0", "0xd92c6cb2", "0xb92567fa", "0xc10a6287"] }, { "facetAddress": "0x57770C1721Eb35509f38210A935c8b1911db7E0e", "action": 0, - "functionSelectors": [ - "0xd703a0cd", - "0x815822c1", - "0x2e7639bc", - "0xfd7daaf8" - ] + "functionSelectors": ["0xd703a0cd", "0x815822c1", "0x2e7639bc", "0xfd7daaf8"] }, { "facetAddress": "0xad58Fc13a682a121e5fe2f8E45D4D988A7e51B0D", "action": 0, - "functionSelectors": [ - "0x05b41934" - ] + "functionSelectors": ["0x05b41934"] } ], "0xA19c5D1013A8682aC76206a085Ec24aC89F7c025", @@ -508,4 +477,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/Redeemer.json b/deployments/sepolia/Redeemer.json index 69fd765..1e7ea4f 100644 --- a/deployments/sepolia/Redeemer.json +++ b/deployments/sepolia/Redeemer.json @@ -351,4 +351,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/RewardHandler.json b/deployments/sepolia/RewardHandler.json index 98f04ef..92cc005 100644 --- a/deployments/sepolia/RewardHandler.json +++ b/deployments/sepolia/RewardHandler.json @@ -136,4 +136,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/SavingsNameable.json b/deployments/sepolia/SavingsNameable.json index 3c8d96b..d868047 100644 --- a/deployments/sepolia/SavingsNameable.json +++ b/deployments/sepolia/SavingsNameable.json @@ -1325,9 +1325,7 @@ "blockNumber": 8411132, "transactionHash": "0xb68ac1d2f34d6e8f2b743e8949b955ec0e739b40fa2a4fef746d1481657bb7c0", "address": "0xeB197439D1425F3129F01F7763EC511DF2489095", - "topics": [ - "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" - ], + "topics": ["0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"], "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", "logIndex": 411, "blockHash": "0x5428f51d7d430e2aec1d3459d43c2dc4e96f8c78ac4e90516e17af9272dfc928" @@ -1759,4 +1757,4 @@ } } } -} \ No newline at end of file +} diff --git a/deployments/sepolia/Savings_USDp.json b/deployments/sepolia/Savings_USDp.json index 28b2848..8a248b8 100644 --- a/deployments/sepolia/Savings_USDp.json +++ b/deployments/sepolia/Savings_USDp.json @@ -1394,9 +1394,7 @@ "blockNumber": 8411143, "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", - "topics": [ - "0x2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad" - ], + "topics": ["0x2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad"], "data": "0x000000000000000000000000fd28f108e95f4d41daae9dbfff707d677985998e", "logIndex": 384, "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" @@ -1448,9 +1446,7 @@ "blockNumber": 8411143, "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", - "topics": [ - "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" - ], + "topics": ["0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 388, "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" @@ -1500,4 +1496,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/Savings_USDp_Proxy.json b/deployments/sepolia/Savings_USDp_Proxy.json index 91df770..ead4409 100644 --- a/deployments/sepolia/Savings_USDp_Proxy.json +++ b/deployments/sepolia/Savings_USDp_Proxy.json @@ -100,9 +100,7 @@ "blockNumber": 8411143, "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", - "topics": [ - "0x2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad" - ], + "topics": ["0x2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad"], "data": "0x000000000000000000000000fd28f108e95f4d41daae9dbfff707d677985998e", "logIndex": 384, "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" @@ -154,9 +152,7 @@ "blockNumber": 8411143, "transactionHash": "0xfdafdff762954aa5eacde74d6d72764c9043cc2d2043b703f0aae14fab30e7e5", "address": "0x23D491aa7C0972087F8a607F6f4c7106a02BA95d", - "topics": [ - "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" - ], + "topics": ["0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 388, "blockHash": "0x54e1a4846cfb7c834dd59b91e1ec157013a14f7af6a629d1548e05194a8a1f52" @@ -195,4 +191,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/SettersGovernor.json b/deployments/sepolia/SettersGovernor.json index ff60619..985d571 100644 --- a/deployments/sepolia/SettersGovernor.json +++ b/deployments/sepolia/SettersGovernor.json @@ -636,4 +636,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/SettersGuardian.json b/deployments/sepolia/SettersGuardian.json index a3a1155..bf257c8 100644 --- a/deployments/sepolia/SettersGuardian.json +++ b/deployments/sepolia/SettersGuardian.json @@ -308,4 +308,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/Swapper.json b/deployments/sepolia/Swapper.json index f299f0f..fb2a90e 100644 --- a/deployments/sepolia/Swapper.json +++ b/deployments/sepolia/Swapper.json @@ -504,4 +504,4 @@ "storage": [], "types": null } -} \ No newline at end of file +} diff --git a/deployments/sepolia/solcInputs/0e89febeebc7444140de8e67c9067d2c.json b/deployments/sepolia/solcInputs/0e89febeebc7444140de8e67c9067d2c.json index 6eb5ed9..557e5cb 100644 --- a/deployments/sepolia/solcInputs/0e89febeebc7444140de8e67c9067d2c.json +++ b/deployments/sepolia/solcInputs/0e89febeebc7444140de8e67c9067d2c.json @@ -68,13 +68,11 @@ "storageLayout", "evm.gasEstimates" ], - "": [ - "ast" - ] + "": ["ast"] } }, "metadata": { "useLiteralContent": true } } -} \ No newline at end of file +} diff --git a/deployments/sepolia/solcInputs/9d44d918681c9ad36f866ebee034a3d1.json b/deployments/sepolia/solcInputs/9d44d918681c9ad36f866ebee034a3d1.json index 5a22e0c..680bd39 100644 --- a/deployments/sepolia/solcInputs/9d44d918681c9ad36f866ebee034a3d1.json +++ b/deployments/sepolia/solcInputs/9d44d918681c9ad36f866ebee034a3d1.json @@ -295,13 +295,11 @@ "storageLayout", "evm.gasEstimates" ], - "": [ - "ast" - ] + "": ["ast"] } }, "metadata": { "useLiteralContent": true } } -} \ No newline at end of file +}