package Ġorg . ke thereum . abi Ċ Ċ val Ġtest MetaData JSON Ġ= Ġ""" Ċ {" compiler ":{" version ":" 0 . 5 . 1 1 + commit . c 0 8 2 d 0 b 4 "}," language ":" Solid ity "," output ":{" abi ":[{" constant ": true ," inputs ":[ ]," name ":" name "," outputs ":[{" internal Type ":" string "," name ":""," type ":" string "}], " pay able ": false ," state Mut ability ":" view "," type ":" function "},{" constant ": false ," inputs ":[{" internal Type ":" address "," name ":" sp ender "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" value "," type ":" uint 2 5 6 "}], " name ":" approve "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " pay able ": false ," state Mut ability ":" non pay able "," type ":" function "},{" constant ": true ," inputs ":[ ]," name ":" total Supply "," outputs ":[{" internal Type ":" uint 2 5 6 "," name ":""," type ":" uint 2 5 6 "}], " pay able ": false ," state Mut ability ":" view "," type ":" function "},{" constant ": false ," inputs ":[{" internal Type ":" address "," name ":" sender "," type ":" address "},{" internal Type ":" address "," name ":" recipient "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" amount "," type ":" uint 2 5 6 "}], " name ":" transfer From "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " pay able ": false ," state Mut ability ":" non pay able "," type ":" function "},{" constant ": true ," inputs ":[ ]," name ":" decimals "," outputs ":[{" internal Type ":" uint 8 "," name ":""," type ":" uint 8 "}], " pay able ": false ," state Mut ability ":" view "," type ":" function "},{" constant ": false ," inputs ":[{" internal Type ":" address "," name ":" sp ender "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" added Value "," type ":" uint 2 5 6 "}], " name ":" increase Allow ance "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " pay able ": false ," state Mut ability ":" non pay able "," type ":" function "},{" constant ": true ," inputs ":[{" internal Type ":" address "," name ":" account "," type ":" address "}], " name ":" balanceOf "," outputs ":[{" internal Type ":" uint 2 5 6 "," name ":""," type ":" uint 2 5 6 "}], " pay able ": false ," state Mut ability ":" view "," type ":" function "},{" constant ": true ," inputs ":[ ]," name ":" symbol "," outputs ":[{" internal Type ":" string "," name ":""," type ":" string "}], " pay able ": false ," state Mut ability ":" view "," type ":" function "},{" constant ": false ," inputs ":[{" internal Type ":" address "," name ":" sp ender "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" subtract ed Value "," type ":" uint 2 5 6 "}], " name ":" decrease Allow ance "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " pay able ": false ," state Mut ability ":" non pay able "," type ":" function "},{" constant ": false ," inputs ":[{" internal Type ":" address "," name ":" recipient "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" amount "," type ":" uint 2 5 6 "}], " name ":" transfer "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " pay able ": false ," state Mut ability ":" non pay able "," type ":" function "},{" constant ": true ," inputs ":[{" internal Type ":" address "," name ":" owner "," type ":" address "},{" internal Type ":" address "," name ":" sp ender "," type ":" address "}], " name ":" allow ance "," outputs ":[{" internal Type ":" uint 2 5 6 "," name ":""," type ":" uint 2 5 6 "}], " pay able ": false ," state Mut ability ":" view "," type ":" function "},{" inputs ":[{" internal Type ":" string "," name ":" name "," type ":" string "},{" internal Type ":" string "," name ":" symbol "," type ":" string "},{" internal Type ":" uint 8 "," name ":" decimals "," type ":" uint 8 "}], " pay able ": false ," state Mut ability ":" non pay able "," type ":" constructor "},{" anonymous ": false ," inputs ":[{" indexed ": true ," internal Type ":" address "," name ":" from "," type ":" address "},{" indexed ": true ," internal Type ":" address "," name ":" to "," type ":" address "},{" indexed ": false ," internal Type ":" uint 2 5 6 "," name ":" value "," type ":" uint 2 5 6 "}], " name ":" Transfer "," type ":" event "},{" anonymous ": false ," inputs ":[{" indexed ": true ," internal Type ":" address "," name ":" owner "," type ":" address "},{" indexed ": true ," internal Type ":" address "," name ":" sp ender "," type ":" address "},{" indexed ": false ," internal Type ":" uint 2 5 6 "," name ":" value "," type ":" uint 2 5 6 "}], " name ":" Approval "," type ":" event "}], " dev doc ":{" details ":" Implementation Ġof Ġthe Ġ` I ERC 2 0 ` Ġinterface . Ġ* ĠThis Ġimplementation Ġis Ġag nost ic Ġto Ġthe Ġway Ġtokens Ġare Ġcreated . ĠThis Ġmeans Ġthat Ġa Ġsupply Ġmechanism Ġhas Ġto Ġbe Ġadded Ġin Ġa Ġderived Ġcontract Ġusing Ġ`_ mint `. ĠFor Ġa Ġgeneric Ġmechanism Ġsee Ġ` ERC 2 0 Mint able `. Ġ* Ġ* For Ġa Ġdetailed Ġwrite up Ġsee Ġour Ġguide Ġ[ How Ġto Ġimplement Ġsupply Ġmechanisms ]( https :// forum . ze ppelin . solutions / t / how - to - implement - erc 2 0 - supply - me chan isms / 2 2 6 ). * Ġ* ĠWe Ġhave Ġfollowed Ġgeneral ĠOpen Ze ppelin Ġguidelines : Ġfunctions Ġrevert Ġinstead Ġof Ġreturning Ġ` false ` Ġon Ġfailure . ĠThis Ġbehavior Ġis Ġnon et he less Ġconvention al Ġand Ġdoes Ġnot Ġconflict Ġwith Ġthe Ġexpectations Ġof ĠERC 2 0 Ġapplications . Ġ* ĠAdditionally , Ġan Ġ` Approval ` Ġevent Ġis Ġemitted Ġon Ġcalls Ġto Ġ` transfer From `. ĠThis Ġallows Ġapplications Ġto Ġreconstruct Ġthe Ġallow ance Ġfor Ġall Ġaccounts Ġjust Ġby Ġlistening Ġto Ġsaid Ġevents . ĠOther Ġimplementations Ġof Ġthe ĠE IP Ġmay Ġnot Ġemit Ġthese Ġevents , Ġas Ġit Ġisn 't Ġrequired Ġby Ġthe Ġspecification . Ġ* ĠFinally , Ġthe Ġnon - standard Ġ` decrease Allow ance ` Ġand Ġ` increase Allow ance ` Ġfunctions Ġhave Ġbeen Ġadded Ġto Ġmit igate Ġthe Ġwell - known Ġissues Ġaround Ġsetting Ġallow ances . ĠSee Ġ` I ERC 2 0 . approve `. "," methods ":{" allow ance ( address , address ) ":{" details ":" See Ġ` I ERC 2 0 . allow ance `. "}," approve ( address , uint 2 5 6 ) ":{" details ":" See Ġ` I ERC 2 0 . approve `. ĠĠĠĠ Ġ* ĠRequirements : ĠĠĠĠ Ġ* Ġ- Ġ` sp ender ` Ġcannot Ġbe Ġthe Ġzero Ġaddress ." }," balanceOf ( address ) ":{" details ":" See Ġ` I ERC 2 0 . balanceOf `. "}," decimals () ":{" details ":" Returns Ġthe Ġnumber Ġof Ġdecimals Ġused Ġto Ġget Ġits Ġuser Ġrepresentation . ĠFor Ġexample , Ġif Ġ` decimals ` Ġequals Ġ` 2 `, Ġa Ġbalance Ġof Ġ` 5 0 5 ` Ġtokens Ġshould Ġbe Ġdisplayed Ġto Ġa Ġuser Ġas Ġ` 5 , 0 5 ` Ġ(` 5 0 5 Ġ/ Ġ 1 0 Ġ** Ġ 2 `). ĠĠĠĠ Ġ* ĠTokens Ġusually Ġopt Ġfor Ġa Ġvalue Ġof Ġ 1 8 , Ġim it ating Ġthe Ġrelationship Ġbetween ĠE ther Ġand ĠWe i . ĠĠĠĠ Ġ* Ġ> ĠNote Ġthat Ġthis Ġinformation Ġis Ġonly Ġused Ġfor Ġ_ display _ Ġpurposes : Ġit Ġin Ġno Ġway Ġaffects Ġany Ġof Ġthe Ġarithmetic Ġof Ġthe Ġcontract , Ġincluding Ġ` I ERC 2 0 . balanceOf ` Ġand Ġ` I ERC 2 0 . transfer `. "}," decrease Allow ance ( address , uint 2 5 6 ) ":{" details ":" Atom ically Ġde creases Ġthe Ġallow ance Ġgranted Ġto Ġ` sp ender ` Ġby Ġthe Ġcaller . ĠĠĠĠ Ġ* ĠThis Ġis Ġan Ġalternative Ġto Ġ` approve ` Ġthat Ġcan Ġbe Ġused Ġas Ġa Ġmit igation Ġfor Ġproblems Ġdescribed Ġin Ġ` I ERC 2 0 . approve `. ĠĠĠĠ Ġ* ĠEmit s Ġan Ġ` Approval ` Ġevent Ġindicating Ġthe Ġupdated Ġallow ance . ĠĠĠĠ Ġ* ĠRequirements : ĠĠĠĠ Ġ* Ġ- Ġ` sp ender ` Ġcannot Ġbe Ġthe Ġzero Ġaddress . Ġ- Ġ` sp ender ` Ġmust Ġhave Ġallow ance Ġfor Ġthe Ġcaller Ġof Ġat Ġleast Ġ` subtract ed Value `. "}," increase Allow ance ( address , uint 2 5 6 ) ":{" details ":" Atom ically Ġincreases Ġthe Ġallow ance Ġgranted Ġto Ġ` sp ender ` Ġby Ġthe Ġcaller . ĠĠĠĠ Ġ* ĠThis Ġis Ġan Ġalternative Ġto Ġ` approve ` Ġthat Ġcan Ġbe Ġused Ġas Ġa Ġmit igation Ġfor Ġproblems Ġdescribed Ġin Ġ` I ERC 2 0 . approve `. ĠĠĠĠ Ġ* ĠEmit s Ġan Ġ` Approval ` Ġevent Ġindicating Ġthe Ġupdated Ġallow ance . ĠĠĠĠ Ġ* ĠRequirements : ĠĠĠĠ Ġ* Ġ- Ġ` sp ender ` Ġcannot Ġbe Ġthe Ġzero Ġaddress ." }," name () ":{" details ":" Returns Ġthe Ġname Ġof Ġthe Ġtoken ." }," symbol () ":{" details ":" Returns Ġthe Ġsymbol Ġof Ġthe Ġtoken , Ġusually Ġa Ġshorter Ġversion Ġof Ġthe Ġname ." }," total Supply () ":{" details ":" See Ġ` I ERC 2 0 . total Supply `. "}," transfer ( address , uint 2 5 6 ) ":{" details ":" See Ġ` I ERC 2 0 . transfer `. ĠĠĠĠ Ġ* ĠRequirements : ĠĠĠĠ Ġ* Ġ- Ġ` recipient ` Ġcannot Ġbe Ġthe Ġzero Ġaddress . Ġ- Ġthe Ġcaller Ġmust Ġhave Ġa Ġbalance Ġof Ġat Ġleast Ġ` amount `. "}," transfer From ( address , address , uint 2 5 6 ) ":{" details ":" See Ġ` I ERC 2 0 . transfer From `. ĠĠĠĠ Ġ* ĠEmit s Ġan Ġ` Approval ` Ġevent Ġindicating Ġthe Ġupdated Ġallow ance . ĠThis Ġis Ġnot Ġrequired Ġby Ġthe ĠE IP . ĠSee Ġthe Ġnote Ġat Ġthe Ġbeginning Ġof Ġ` ERC 2 0 `; ĠĠĠĠ Ġ* ĠRequirements : Ġ- Ġ` sender ` Ġand Ġ` recipient ` Ġcannot Ġbe Ġthe Ġzero Ġaddress . Ġ- Ġ` sender ` Ġmust Ġhave Ġa Ġbalance Ġof Ġat Ġleast Ġ` value `. Ġ- Ġthe Ġcaller Ġmust Ġhave Ġallow ance Ġfor Ġ` sender `' s Ġtokens Ġof Ġat Ġleast Ġ` amount `. "}} }," user doc ":{" methods ":{ }}}, " settings ":{" compilation Target ":{" browser / BC Y . sol ":" Bit Cr yst als "}," e vm Version ":" pe ter sb urg "," libraries ": {}, " optimizer ":{" enabled ": false ," runs ": 2 0 0 }," rem appings ": [] }," sources ":{" browser / BC Y . sol ":{" ke cc ak 2 5 6 ":" 0 x 8 7 fcd 6 5 2 f 3 1 7 a 5 8 0 5 0 8 1 7 2 7 1 5 7 4 e 6 e 9 b 3 4 4 1 b 4 a 3 6 eb 6 1 fdd cca 7 5 c 8 cce 2 2 5 7 ef "," urls ":[" b zz - raw :// e 5 4 0 2 b 8 1 d 8 dff 6 7 a 4 3 4 6 0 6 b 6 dff b 8 2 a 2 5 7 1 d 9 2 dc 3 b 6 9 8 9 f 8 6 4 1 4 2 0 c 5 f 7 9 da 6 cc "," d web :/ ipfs / Q me 5 n na 1 HK erk 5 V 7 PH N Co 8 m 9 m ES V QX 9 e KS v HD y YK 9 U 8 z 1 s "] }}, " version ": 1 } Ċ """ Ċ Ċ val Ġtest MetaData JSON With Constructor Ġ=" {\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" Ġ Ġ\" compiler \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ\" version \": Ġ\" 0 . 5 . 1 1 + commit . c 0 8 2 d 0 b 4 \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" Ġ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" Ġ Ġ\" language \": Ġ\" Solid ity \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" Ġ Ġ\" output \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ\" abi \": Ġ[\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" constant \": Ġfalse ,\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" inputs \": Ġ[\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" internal Type \": Ġ\" address \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" name \": Ġ\" to \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" type \": Ġ\" address \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ}\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ], \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" name \": Ġ\" delegate \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" outputs \": Ġ[], \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" pay able \": Ġfalse ,\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" state Mut ability \": Ġ\" non pay able \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" type \": Ġ\" function \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" constant \": Ġtrue ,\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" inputs \": Ġ[], \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" name \": Ġ\" win ning Proposal \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" outputs \": Ġ[\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" internal Type \": Ġ\" uint 8 \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" name \": Ġ\" _ win ning Proposal \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" type \": Ġ\" uint 8 \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ}\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ], \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" pay able \": Ġfalse ,\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" state Mut ability \": Ġ\" view \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" type \": Ġ\" function \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" constant \": Ġfalse ,\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" inputs \": Ġ[\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" internal Type \": Ġ\" address \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" name \": Ġ\" to V oter \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" type \": Ġ\" address \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ}\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ], \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" name \": Ġ\" give Right To Vote \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" outputs \": Ġ[], \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" pay able \": Ġfalse ,\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" state Mut ability \": Ġ\" non pay able \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" type \": Ġ\" function \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" constant \": Ġfalse ,\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" inputs \": Ġ[\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" internal Type \": Ġ\" uint 8 \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" name \": Ġ\" to Proposal \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" type \": Ġ\" uint 8 \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ}\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ], \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" name \": Ġ\" vote \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" outputs \": Ġ[], \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" pay able \": Ġfalse ,\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" state Mut ability \": Ġ\" non pay able \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" type \": Ġ\" function \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" inputs \": Ġ[\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" internal Type \": Ġ\" uint 8 \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" name \": Ġ\" _ num Pro posals \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" type \": Ġ\" uint 8 \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ}\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ], \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" pay able \": Ġfalse ,\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" state Mut ability \": Ġ\" non pay able \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" type \": Ġ\" constructor \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ}\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ], \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ\" dev doc \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ\" methods \": Ġ{}\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ\" user doc \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ\" methods \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" constructor \": Ġ\" Create Ġa Ġnew Ġbal lot Ġwith Ġ\$ (_ num Pro posals ) Ġdifferent Ġproposals .\ ",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" delegate ( address ) \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ\" notice \": Ġ\" Delegate Ġyour Ġvote Ġto Ġthe Ġvot er Ġ\ $( to ). \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" give Right To Vote ( address ) \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ\" notice \": Ġ\" Give Ġ\ $( to V oter ) Ġthe Ġright Ġto Ġvote Ġon Ġthis Ġbal lot . ĠMay Ġonly Ġbe Ġcalled Ġby Ġ\ $( ch air person ). \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" vote ( uint 8 ) \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠĠĠ Ġ\" notice \": Ġ\" Give Ġa Ġsingle Ġvote Ġto Ġproposal Ġ\ $( to Proposal ). \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ}\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ}\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ}\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" Ġ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" Ġ Ġ\" settings \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ\" compilation Target \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ\" browser / bal lot . sol \": Ġ\" Bal lot \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ\" e vm Version \": Ġ\" pe ter sb urg \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ\" libraries \": Ġ{}, \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ\" optimizer \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ\" enabled \": Ġfalse ,\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ\" runs \": Ġ 2 0 0 \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ\" rem appings \": Ġ[] \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" Ġ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" Ġ Ġ\" sources \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ\" browser / bal lot . sol \": Ġ{\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ\" ke cc ak 2 5 6 \": Ġ\" 0 x 9 e 1 ba 6 d 6 e 1 b 6 2 2 6 9 0 8 3 d 8 5 6 5 8 7 2 6 5 1 ef 2 b 5 3 c 5 9 ce ca ffb 7 e 4 8 3 7 5 0 e 7 2 dc 6 5 9 fb \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ\" urls \": Ġ[\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" b zz - raw :// 5 7 6 6 4 0 0 e 5 d 6 d 8 2 2 f 2 0 2 9 b 8 2 7 3 3 1 b 3 5 4 c 4 1 e 0 b 6 1 f 7 3 4 4 0 8 5 1 dd 0 d 0 6 f 6 0 3 dd 9 1 e 5 \",\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠĠĠ Ġ\" d web :/ ipfs / Q md yq 9 Zm Wc ary d 1 mg GZ 4 P tt RN ct LG US AM pP qu f sk 6 u RM Kh \"\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠĠĠ Ġ] \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" ĠĠĠ Ġ}\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" Ġ Ġ},\ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" Ġ Ġ\" version \": Ġ 1 \ n " Ġ+ ĊĠĠĠĠĠĠĠ Ġ" }\ n " ĊĊ Ċ val ĠtestData Dev Doc No Details Ġ= Ġ""" ĊĠĠĠ Ġ{" compiler ":{" version ":" 0 . 6 . 1 2 + commit . 2 7 d 5 1 7 6 5 "}," language ":" Solid ity "," output ":{" abi ":[{" inputs ":[ ]," state Mut ability ":" non pay able "," type ":" constructor "},{" anonymous ": false ," inputs ":[{" indexed ": true ," internal Type ":" address "," name ":" previous Owner "," type ":" address "},{" indexed ": true ," internal Type ":" address "," name ":" new Owner "," type ":" address "}], " name ":" Ownership Transfer red "," type ":" event "},{" inputs ":[{" internal Type ":" address "," name ":" _ token "," type ":" address "},{" internal Type ":" address "," name ":" _ sp ender "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" _ amount "," type ":" uint 2 5 6 "}], " name ":" approve "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" sender "," type ":" address "},{" components ":[{" internal Type ":" address "," name ":" owner "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" number "," type ":" uint 2 5 6 "}], " internal Type ":" struct ĠAccount . Info "," name ":" account "," type ":" tuple "},{" internal Type ":" bytes "," name ":" data "," type ":" bytes "}], " name ":" call Function "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ solo "," type ":" address "},{" internal Type ":" address "," name ":" _ token "," type ":" address "},{" internal Type ":" address "," name ":" _ unit roller "," type ":" address "},{" internal Type ":" address "," name ":" _ supply Deleg ator "," type ":" address "},{" internal Type ":" address "," name ":" _ borrow Deleg ator "," type ":" address "}], " name ":" close Position "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ solo "," type ":" address "},{" internal Type ":" address "," name ":" _ token "," type ":" address "},{" internal Type ":" address "," name ":" _ unit roller "," type ":" address "},{" internal Type ":" address "," name ":" _ supply Deleg ator "," type ":" address "},{" internal Type ":" address "," name ":" _ borrow Deleg ator "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" _ amount "," type ":" uint 2 5 6 "},{" internal Type ":" uint 2 5 6 "," name ":" _ lt v "," type ":" uint 2 5 6 "}], " name ":" open Position "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" owner "," outputs ":[{" internal Type ":" address "," name ":""," type ":" address "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[{" internal Type ":" uint 2 5 6 "," name ":" _ amount "," type ":" uint 2 5 6 "},{" internal Type ":" bool "," name ":" _ re deem Type "," type ":" bool "},{" internal Type ":" address "," name ":" _ deleg ator "," type ":" address "}], " name ":" re deem "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" re no unce Ownership "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ deleg ator "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" _ amount "," type ":" uint 2 5 6 "}], " name ":" rep ay Borrow "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ deleg ator "," type ":" address "},{" internal Type ":" address "," name ":" _ token "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" _ amount "," type ":" uint 2 5 6 "}], " name ":" supply "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" new Owner "," type ":" address "}], " name ":" transfer Ownership "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "}], " dev doc ":{" kind ":" dev "," methods ":{" owner () ":{" details ":" Returns Ġthe Ġaddress Ġof Ġthe Ġcurrent Ġowner ." }," re no unce Ownership () ":{" details ":" Le aves Ġthe Ġcontract Ġwithout Ġowner . ĠIt Ġwill Ġnot Ġbe Ġpossible Ġto Ġcall Ġ` only Owner ` Ġfunctions Ġanymore . ĠCan Ġonly Ġbe Ġcalled Ġby Ġthe Ġcurrent Ġowner . ĠNOTE : ĠR eno unc ing Ġownership Ġwill Ġleave Ġthe Ġcontract Ġwithout Ġan Ġowner , Ġthere by Ġremoving Ġany Ġfunctionality Ġthat Ġis Ġonly Ġavailable Ġto Ġthe Ġowner ." }," transfer Ownership ( address ) ":{" details ":" Trans fers Ġownership Ġof Ġthe Ġcontract Ġto Ġa Ġnew Ġaccount Ġ(` new Owner `). ĠCan Ġonly Ġbe Ġcalled Ġby Ġthe Ġcurrent Ġowner ." }}, " version ": 1 }," user doc ":{" kind ":" user "," methods ": {}, " version ": 1 }}, " settings ":{" compilation Target ":{" browser / Dy dx Flash loan er . sol ":" Dy dx Flash loan er "}," e vm Version ":" istan bul "," libraries ": {}, " metadata ":{" byte code Hash ":" ipfs "}," optimizer ":{" enabled ": false ," runs ": 2 0 0 }," rem appings ": [] }," sources ":{" Context . sol ":{" ke cc ak 2 5 6 ":" 0 xac 3 6 4 0 fab 0 6 aaa 5 fc 0 af 5 b 6 5 4 8 a 8 6 3 6 bc 1 4 b 7 8 2 2 9 7 7 9 b 6 9 2 bae 1 9 5 c 6 9 9 2 2 1 7 9 7 "," license ":" MIT "," urls ":[" b zz - raw :// 4 8 fcd 0 2 7 6 3 3 a 7 4 2 c 8 1 fc fa 8 1 dfa 2 a 0 a 2 2 cee 1 7 7 9 7 1 fb 3 2 e 6 f 8 cb 5 1 9 7 fdf 9 5 1 d 1 "," d web :/ ipfs / Q me G ie E zc GU KH pp b DZ 3 Py SE 4 yi 8 g T zc RQ 7 ay ob Mob bm w J 3 "] }," Dy dx Flash loan Base . sol ":{" ke cc ak 2 5 6 ":" 0 xf 6 d 2 4 3 0 ca 1 bb 7 4 7 1 2 ba 9 0 0 2 fda 3 7 b 2 c 9 0 8 5 de 9 3 7 d 3 4 1 5 1 9 d 6 a 6 2 abe 2 3 df 3 4 a 0 5 "," urls ":[" b zz - raw :// a 3 ac 7 0 ba 4 9 9 7 e 5 9 7 9 2 0 d 7 5 4 8 5 2 0 b 1 c 1 3 a 5 e 3 ee 1 9 1 e 6 7 8 a 2 2 5 b 6 0 bb 1 1 d 1 1 1 af 8 0 "," d web :/ ipfs / Qm XN 9 edu 4 k N 3 PX g QS s N qx h Uv H uk J 6 p 1 L 1 8 UM V 7 s CP Do Nb N "] }," IC alle e . sol ":{" ke cc ak 2 5 6 ":" 0 x 0 6 0 9 f adb 0 9 f 1 8 4 2 a 0 7 4 1 3 8 b beb 1 9 7 8 ec 6 a 9 de 2 5 e 5 1 5 df 5 8 e 0 2 5 6 e 4 e 0 1 8 e 4 2 c 3 4 "," urls ":[" b zz - raw :// 1 d 5 2 9 8 f 3 5 3 7 b 5 a 4 9 be 1 5 2 e 8 8 3 5 4 7 cd 8 8 9 1 f 1 f 9 be 5 5 f 9 4 b 2 4 c 1 6 e 4 8 9 bd 0 6 7 8 c 6 e "," d web :/ ipfs / Qm U 6 Y 7 VF 9 2 UY fj S 8 NN i Um 8 N 6 U xx u R hw WM Nj Wh PU cN w pu co "] }," I ERC 2 0 . sol ":{" ke cc ak 2 5 6 ":" 0 x 9 5 bc 3 6 3 9 0 7 d 2 7 9 3 dbc 5 ab 5 4 8 e 1 da 7 7 a 5 d 1 3 4 0 e 5 0 6 2 a 6 bcd 6 4 0 f 7 0 6 3 4 8 e 0 e 2 f 1 7 "," license ":" MIT "," urls ":[" b zz - raw :// fa fea 5 c 7 a 8 c 0 c 4 2 5 9 8 5 7 1 c 8 7 b 0 1 e 3 c 3 9 d 8 7 eeb 6 a 9 3 a 4 8 da 3 fcd 1 afc 4 a 5 7 2 4 bd 6 "," d web :/ ipfs / Qm Xx 8 sr P SP WK wY KF My S qs B mt Rz 5 h 6 io 8 T J rc 9 d Tr u Jj HE p "] }," IS olo Margin . sol ":{" ke cc ak 2 5 6 ":" 0 x 1 f 0 5 c 0 dc 3 8 0 b 7 a 6 6 2 3 e 1 2 c 7 e 7 0 8 1 b 0 7 1 5 1 5 8 9 1 a 9 5 f 7 5 db 0 e 4 ed 4 4 1 b 4 6 0 d 5 2 b 1 b "," urls ":[" b zz - raw :// 8 cf 2 5 7 eae 8 6 7 6 4 0 5 0 be 9 5 ef 5 7 a 2 1 4 3 c 1 4 a 9 f 4 2 4 8 8 1 1 4 c 2 9 4 e 1 0 e 9 bb 7 9 7 4 d 4 a 7 8 "," d web :/ ipfs / Qm be Fs S 9 nj 4 1 8 az c ZU W FB z P 8 UL Wm co 5 P 4 Y Cs Z Ca q may Pa Q "] }," Own able . sol ":{" ke cc ak 2 5 6 ":" 0 xa 7 8 2 b 2 ac 8 3 7 ab 0 9 fee 4 1 6 8 d 5 eba 6 e 1 1 f 1 0 7 e 7 e 3 df 5 ca 9 bf 4 4 0 ebe 5 7 4 9 6 2 5 3 2 a 3 "," license ":" MIT "," urls ":[" b zz - raw :// 7 ab cc 2 4 c 5 5 7 5 0 6 7 9 3 daf 2 1 ba 0 d 1 e 8 5 4 7 e 5 1 9 2 6 1 6 9 db 9 e 9 6 1 e 6 dc 1 d 8 8 8 1 1 f 4 bfd "," d web :/ ipfs / Qm Uf Gx Y 4 k UY 2 az 6 GW 1 DJ DQ 5 9 x 9 8 Wp Bz 7 p 4 4 cv 2 r Ho Q ZL 7 A "] }," Safe Math . sol ":{" ke cc ak 2 5 6 ":" 0 xaa 5 9 7 4 a 1 7 de 3 ff 0 a 3 b 5 1 3 2 f 2 d 6 5 f 9 5 7 c 6 0 4 5 0 c 3 9 8 b 0 e 6 bf 2 5 2 cd 8 c 8 0 c 4 3 a 4 7 2 4 "," license ":" MIT "," urls ":[" b zz - raw :// 6 f 8 f 9 8 3 6 ee 7 5 0 4 a 2 0 1 0 1 3 6 5 8 7 fdf b 3 7 3 9 3 7 cb 5 ae 8 2 2 f 4 4 f 7 c 5 1 1 0 be 9 8 4 c 5 5 2 c 8 "," d web :/ ipfs / Qm Ps V WW UE i P Z 9 gm FR a R 4 9 1 L 1 p YW u Gr G KR a Bt 8 6 j 8 Y c D dg Q "] }," browser / Dy dx Flash loan er . sol ":{" ke cc ak 2 5 6 ":" 0 xd 6 bca 2 4 bc 7 5 6 2 bba 5 1 ea 5 9 7 3 1 af 5 6 fe 7 f 9 8 4 9 e 0 2 fe 3 1 ff 1 b 3 cb 2 af 9 2 f 7 2 be 8 9 e "," urls ":[" b zz - raw :// 3 9 9 bb 6 1 cf 0 b 0 7 9 a 9 ffe 1 d 4 df 4 2 3 bd 7 f 8 c 9 9 5 d 7 dc 3 8 3 6 5 6 6 4 a 9 7 0 cde 3 f 5 c 0 0 f 2 a "," d web :/ ipfs / Qm Y UN c C 8 GG g xC V NA KH 5 e JP 8 m 4 qz VQ pe Kt C 2 RV BC ti L dh B 8 "] }}, " version ": 1 } Ċ """. trim Indent () Ċ Ċ val ĠtestData Optimizer Settings No Enabled Field =" "" ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ{" compiler ":{" version ":" 0 . 8 . 5 + commit . a 4 f 2 e 5 9 1 "}," language ":" Solid ity "," output ":{" abi ":[{" inputs ":[{" internal Type ":" contract ĠI Strategy "," name ":" _ strategy "," type ":" address "},{" internal Type ":" string "," name ":" _ name "," type ":" string "},{" internal Type ":" string "," name ":" _ symbol "," type ":" string "},{" internal Type ":" uint 2 5 6 "," name ":" _ approval Delay "," type ":" uint 2 5 6 "}], " state Mut ability ":" non pay able "," type ":" constructor "},{" anonymous ": false ," inputs ":[{" indexed ": true ," internal Type ":" address "," name ":" owner "," type ":" address "},{" indexed ": true ," internal Type ":" address "," name ":" sp ender "," type ":" address "},{" indexed ": false ," internal Type ":" uint 2 5 6 "," name ":" value "," type ":" uint 2 5 6 "}], " name ":" Approval "," type ":" event "},{" anonymous ": false ," inputs ":[{" indexed ": false ," internal Type ":" address "," name ":" implementation "," type ":" address "}], " name ":" New Str at Candidate "," type ":" event "},{" anonymous ": false ," inputs ":[{" indexed ": true ," internal Type ":" address "," name ":" previous Owner "," type ":" address "},{" indexed ": true ," internal Type ":" address "," name ":" new Owner "," type ":" address "}], " name ":" Ownership Transfer red "," type ":" event "},{" anonymous ": false ," inputs ":[{" indexed ": true ," internal Type ":" address "," name ":" from "," type ":" address "},{" indexed ": true ," internal Type ":" address "," name ":" to "," type ":" address "},{" indexed ": false ," internal Type ":" uint 2 5 6 "," name ":" value "," type ":" uint 2 5 6 "}], " name ":" Transfer "," type ":" event "},{" anonymous ": false ," inputs ":[{" indexed ": false ," internal Type ":" address "," name ":" implementation "," type ":" address "}], " name ":" Upgrade Str at "," type ":" event "},{" inputs ":[{" internal Type ":" address "," name ":" owner "," type ":" address "},{" internal Type ":" address "," name ":" sp ender "," type ":" address "}], " name ":" allow ance "," outputs ":[{" internal Type ":" uint 2 5 6 "," name ":""," type ":" uint 2 5 6 "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[ ]," name ":" approval Delay "," outputs ":[{" internal Type ":" uint 2 5 6 "," name ":""," type ":" uint 2 5 6 "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" sp ender "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" amount "," type ":" uint 2 5 6 "}], " name ":" approve "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" available "," outputs ":[{" internal Type ":" uint 2 5 6 "," name ":""," type ":" uint 2 5 6 "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[ ]," name ":" balance "," outputs ":[{" internal Type ":" uint 2 5 6 "," name ":""," type ":" uint 2 5 6 "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" account "," type ":" address "}], " name ":" balanceOf "," outputs ":[{" internal Type ":" uint 2 5 6 "," name ":""," type ":" uint 2 5 6 "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[ ]," name ":" decimals "," outputs ":[{" internal Type ":" uint 8 "," name ":""," type ":" uint 8 "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" sp ender "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" subtract ed Value "," type ":" uint 2 5 6 "}], " name ":" decrease Allow ance "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" uint 2 5 6 "," name ":" _ amount "," type ":" uint 2 5 6 "}], " name ":" deposit "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" deposit All "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" ear n "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" get Price Per Full Share "," outputs ":[{" internal Type ":" uint 2 5 6 "," name ":""," type ":" uint 2 5 6 "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ token "," type ":" address "}], " name ":" in Case Tokens Get St uck "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" sp ender "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" added Value "," type ":" uint 2 5 6 "}], " name ":" increase Allow ance "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" name "," outputs ":[{" internal Type ":" string "," name ":""," type ":" string "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[ ]," name ":" owner "," outputs ":[{" internal Type ":" address "," name ":""," type ":" address "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ implementation "," type ":" address "}], " name ":" pro pose Str at "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" re no unce Ownership "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" strat Candidate "," outputs ":[{" internal Type ":" address "," name ":" implementation "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" pro posed Time "," type ":" uint 2 5 6 "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[ ]," name ":" strategy "," outputs ":[{" internal Type ":" contract ĠI Strategy "," name ":""," type ":" address "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[ ]," name ":" symbol "," outputs ":[{" internal Type ":" string "," name ":""," type ":" string "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[ ]," name ":" total Supply "," outputs ":[{" internal Type ":" uint 2 5 6 "," name ":""," type ":" uint 2 5 6 "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" recipient "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" amount "," type ":" uint 2 5 6 "}], " name ":" transfer "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" sender "," type ":" address "},{" internal Type ":" address "," name ":" recipient "," type ":" address "},{" internal Type ":" uint 2 5 6 "," name ":" amount "," type ":" uint 2 5 6 "}], " name ":" transfer From "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" new Owner "," type ":" address "}], " name ":" transfer Ownership "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" upgrade Str at "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" want "," outputs ":[{" internal Type ":" contract ĠI ERC 2 0 "," name ":""," type ":" address "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[{" internal Type ":" uint 2 5 6 "," name ":" _ shares "," type ":" uint 2 5 6 "}], " name ":" withdraw "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" withdraw All "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "}], " dev doc ":{" details ":" Implementation Ġof Ġa Ġvault Ġto Ġdeposit Ġfunds Ġfor Ġyield Ġoptim izing . ĠThis Ġis Ġthe Ġcontract Ġthat Ġreceives Ġfunds Ġand Ġthat Ġusers Ġinterface Ġwith . ĠThe Ġyield Ġoptim izing Ġstrategy Ġitself Ġis Ġimplemented Ġin Ġa Ġseparate Ġ' Strategy . sol ' Ġcontract ."," kind ":" dev "," methods ":{" allow ance ( address , address ) ":{" details ":" See Ġ{ I ERC 2 0 - allow ance } ." }," approve ( address , uint 2 5 6 ) ":{" details ":" See Ġ{ I ERC 2 0 - approve }. ĠRequirements : Ġ- Ġ` sp ender ` Ġcannot Ġbe Ġthe Ġzero Ġaddress ." }," available () ":{" details ":" Custom Ġlogic Ġin Ġhere Ġfor Ġhow Ġmuch Ġthe Ġvault Ġallows Ġto Ġbe Ġborrow ed . ĠWe Ġreturn Ġ 1 0 0 % Ġof Ġtokens Ġfor Ġnow . ĠUnder Ġcertain Ġconditions Ġwe Ġmight Ġwant Ġto Ġkeep Ġsome Ġof Ġthe Ġsystem Ġfunds Ġat Ġhand Ġin Ġthe Ġvault , Ġinstead Ġof Ġputting Ġthem Ġto Ġwork ." }," balance () ":{" details ":" It Ġcalculates Ġthe Ġtotal Ġunderlying Ġvalue Ġof Ġ{ token } Ġheld Ġby Ġthe Ġsystem . ĠIt Ġtakes Ġinto Ġaccount Ġthe Ġvault Ġcontract Ġbalance , Ġthe Ġstrategy Ġcontract Ġbalance Ġ Ġand Ġthe Ġbalance Ġdeployed Ġin Ġother Ġcontracts Ġas Ġpart Ġof Ġthe Ġstrategy ." }," balanceOf ( address ) ":{" details ":" See Ġ{ I ERC 2 0 - balanceOf } ." }," constructor ":{" details ":" Sets Ġthe Ġvalue Ġof Ġ{ token } Ġto Ġthe Ġtoken Ġthat Ġthe Ġvault Ġwill Ġhold Ġas Ġunderlying Ġvalue . ĠIt Ġinitializes Ġthe Ġvault 's Ġown Ġ' m oo ' Ġtoken . ĠThis Ġtoken Ġis Ġmint ed Ġwhen Ġsomeone Ġdoes Ġa Ġdeposit . ĠIt Ġis Ġburn ed Ġin Ġorder Ġto Ġwithdraw Ġthe Ġcorresponding Ġportion Ġof Ġthe Ġunderlying Ġassets ."," params ":{" _ approval Delay ":" the Ġdelay Ġbefore Ġa Ġnew Ġstrat Ġcan Ġbe Ġapproved ."," _ name ":" the Ġname Ġof Ġthe Ġvault Ġtoken ."," _ strategy ":" the Ġaddress Ġof Ġthe Ġstrategy ."," _ symbol ":" the Ġsymbol Ġof Ġthe Ġvault Ġtoken ." }}, " decimals () ":{" details ":" Returns Ġthe Ġnumber Ġof Ġdecimals Ġused Ġto Ġget Ġits Ġuser Ġrepresentation . ĠFor Ġexample , Ġif Ġ` decimals ` Ġequals Ġ` 2 `, Ġa Ġbalance Ġof Ġ` 5 0 5 ` Ġtokens Ġshould Ġbe Ġdisplayed Ġto Ġa Ġuser Ġas Ġ` 5 , 0 5 ` Ġ(` 5 0 5 Ġ/ Ġ 1 0 Ġ** Ġ 2 `). ĠTokens Ġusually Ġopt Ġfor Ġa Ġvalue Ġof Ġ 1 8 , Ġim it ating Ġthe Ġrelationship Ġbetween ĠE ther Ġand ĠWe i . ĠThis Ġis Ġthe Ġvalue Ġ{ ERC 2 0 } Ġuses , Ġunless Ġthis Ġfunction Ġis Ġoverridden ; ĠNOTE : ĠThis Ġinformation Ġis Ġonly Ġused Ġfor Ġ_ display _ Ġpurposes : Ġit Ġin Ġno Ġway Ġaffects Ġany Ġof Ġthe Ġarithmetic Ġof Ġthe Ġcontract , Ġincluding Ġ{ I ERC 2 0 - balanceOf } Ġand Ġ{ I ERC 2 0 - transfer } ." }," decrease Allow ance ( address , uint 2 5 6 ) ":{" details ":" Atom ically Ġde creases Ġthe Ġallow ance Ġgranted Ġto Ġ` sp ender ` Ġby Ġthe Ġcaller . ĠThis Ġis Ġan Ġalternative Ġto Ġ{ approve } Ġthat Ġcan Ġbe Ġused Ġas Ġa Ġmit igation Ġfor Ġproblems Ġdescribed Ġin Ġ{ I ERC 2 0 - approve }. ĠEmit s Ġan Ġ{ Approval } Ġevent Ġindicating Ġthe Ġupdated Ġallow ance . ĠRequirements : Ġ- Ġ` sp ender ` Ġcannot Ġbe Ġthe Ġzero Ġaddress . Ġ- Ġ` sp ender ` Ġmust Ġhave Ġallow ance Ġfor Ġthe Ġcaller Ġof Ġat Ġleast Ġ` subtract ed Value `. "}," deposit ( uint 2 5 6 ) ":{" details ":" The Ġentry point Ġof Ġfunds Ġinto Ġthe Ġsystem . ĠPeople Ġdeposit Ġwith Ġthis Ġfunction Ġinto Ġthe Ġvault . ĠThe Ġvault Ġis Ġthen Ġin Ġcharge Ġof Ġsending Ġfunds Ġinto Ġthe Ġstrategy ." }," deposit All () ":{" details ":" A Ġhelper Ġfunction Ġto Ġcall Ġdeposit () Ġwith Ġall Ġthe Ġsender 's Ġfunds ." }," ear n () ":{" details ":" Function Ġto Ġsend Ġfunds Ġinto Ġthe Ġstrategy Ġand Ġput Ġthem Ġto Ġwork . ĠIt 's Ġprimarily Ġcalled Ġby Ġthe Ġvault 's Ġdeposit () Ġfunction ." }," get Price Per Full Share () ":{" details ":" Function Ġfor Ġvarious ĠU Is Ġto Ġdisplay Ġthe Ġcurrent Ġvalue Ġof Ġone Ġof Ġour Ġyield Ġtokens . ĠReturns Ġan Ġuint 2 5 6 Ġwith Ġ 1 8 Ġdecimals Ġof Ġhow Ġmuch Ġunderlying Ġasset Ġone Ġvault Ġshare Ġrepresents ." }," in Case Tokens Get St uck ( address ) ":{" details ":" Res c ues Ġrandom Ġfunds Ġstuck Ġthat Ġthe Ġstrat Ġcan 't Ġhandle ."," params ":{" _ token ":" address Ġof Ġthe Ġtoken Ġto Ġrescue ." }}, " increase Allow ance ( address , uint 2 5 6 ) ":{" details ":" Atom ically Ġincreases Ġthe Ġallow ance Ġgranted Ġto Ġ` sp ender ` Ġby Ġthe Ġcaller . ĠThis Ġis Ġan Ġalternative Ġto Ġ{ approve } Ġthat Ġcan Ġbe Ġused Ġas Ġa Ġmit igation Ġfor Ġproblems Ġdescribed Ġin Ġ{ I ERC 2 0 - approve }. ĠEmit s Ġan Ġ{ Approval } Ġevent Ġindicating Ġthe Ġupdated Ġallow ance . ĠRequirements : Ġ- Ġ` sp ender ` Ġcannot Ġbe Ġthe Ġzero Ġaddress ." }," name () ":{" details ":" Returns Ġthe Ġname Ġof Ġthe Ġtoken ." }," owner () ":{" details ":" Returns Ġthe Ġaddress Ġof Ġthe Ġcurrent Ġowner ." }," pro pose Str at ( address ) ":{" details ":" Sets Ġthe Ġcandidate Ġfor Ġthe Ġnew Ġstrat Ġto Ġuse Ġwith Ġthis Ġvault ."," params ":{" _ implementation ":" The Ġaddress Ġof Ġthe Ġcandidate Ġstrategy ." }}, " re no unce Ownership () ":{" details ":" Le aves Ġthe Ġcontract Ġwithout Ġowner . ĠIt Ġwill Ġnot Ġbe Ġpossible Ġto Ġcall Ġ` only Owner ` Ġfunctions Ġanymore . ĠCan Ġonly Ġbe Ġcalled Ġby Ġthe Ġcurrent Ġowner . ĠNOTE : ĠR eno unc ing Ġownership Ġwill Ġleave Ġthe Ġcontract Ġwithout Ġan Ġowner , Ġthere by Ġremoving Ġany Ġfunctionality Ġthat Ġis Ġonly Ġavailable Ġto Ġthe Ġowner ." }," symbol () ":{" details ":" Returns Ġthe Ġsymbol Ġof Ġthe Ġtoken , Ġusually Ġa Ġshorter Ġversion Ġof Ġthe Ġname ." }," total Supply () ":{" details ":" See Ġ{ I ERC 2 0 - total Supply } ." }," transfer ( address , uint 2 5 6 ) ":{" details ":" See Ġ{ I ERC 2 0 - transfer }. ĠRequirements : Ġ- Ġ` recipient ` Ġcannot Ġbe Ġthe Ġzero Ġaddress . Ġ- Ġthe Ġcaller Ġmust Ġhave Ġa Ġbalance Ġof Ġat Ġleast Ġ` amount `. "}," transfer From ( address , address , uint 2 5 6 ) ":{" details ":" See Ġ{ I ERC 2 0 - transfer From }. ĠEmit s Ġan Ġ{ Approval } Ġevent Ġindicating Ġthe Ġupdated Ġallow ance . ĠThis Ġis Ġnot Ġrequired Ġby Ġthe ĠE IP . ĠSee Ġthe Ġnote Ġat Ġthe Ġbeginning Ġof Ġ{ ERC 2 0 }. ĠRequirements : Ġ- Ġ` sender ` Ġand Ġ` recipient ` Ġcannot Ġbe Ġthe Ġzero Ġaddress . Ġ- Ġ` sender ` Ġmust Ġhave Ġa Ġbalance Ġof Ġat Ġleast Ġ` amount `. Ġ- Ġthe Ġcaller Ġmust Ġhave Ġallow ance Ġfor Ġ`` sender `` ' s Ġtokens Ġof Ġat Ġleast Ġ` amount `. "}," transfer Ownership ( address ) ":{" details ":" Trans fers Ġownership Ġof Ġthe Ġcontract Ġto Ġa Ġnew Ġaccount Ġ(` new Owner `). ĠCan Ġonly Ġbe Ġcalled Ġby Ġthe Ġcurrent Ġowner ." }," upgrade Str at () ":{" details ":" It Ġswitches Ġthe Ġactive Ġstrat Ġfor Ġthe Ġstrat Ġcandidate . ĠAfter Ġupgrading , Ġthe Ġcandidate Ġimplementation Ġis Ġset Ġto Ġthe Ġ 0 x 0 0 Ġaddress , Ġand Ġproposed Time Ġto Ġa Ġtime Ġhappening Ġin Ġ+ 1 0 0 Ġyears Ġfor Ġsafety ." }," withdraw ( uint 2 5 6 ) ":{" details ":" Function Ġto Ġexit Ġthe Ġsystem . ĠThe Ġvault Ġwill Ġwithdraw Ġthe Ġrequired Ġtokens Ġfrom Ġthe Ġstrategy Ġand Ġpay Ġup Ġthe Ġtoken Ġholder . ĠA Ġpro portional Ġnumber Ġof ĠIO U Ġtokens Ġare Ġburn ed Ġin Ġthe Ġprocess ." }," withdraw All () ":{" details ":" A Ġhelper Ġfunction Ġto Ġcall Ġwithdraw () Ġwith Ġall Ġthe Ġsender 's Ġfunds ." }}, " version ": 1 }," user doc ":{" kind ":" user "," methods ": {}, " version ": 1 }}, " settings ":{" compilation Target ":{" contracts / BI FI / vault s / B ee fy Vault V 6 . sol ":" B ee fy Vault V 6 "}," e vm Version ":" ber lin "," libraries ": {}, " metadata ":{" byte code Hash ":" ipfs "," use Literal Content ": true }," optimizer ":{" details ":{" constant Optimizer ": true ," c se ": true ," ded uplicate ": true ," in liner ": true ," jump dest Rem over ": true ," order L iterals ": true ," pe e ph ole ": true ," y ul ": true ," y ul Details ":{" optimizer Steps ":" dh fo D gv ul fn TU tn If [ x arr sc LM c CT Ut TO nt nf DI ul L cul V cul Ġjj T pe ul x ar ul r ul x arr c Lg vf CT Uc arr Ls T FO tf D nc arr I ul c ] j mul jul jul ĠV c TO cul Ġj mul "," stack Allocation ": true }}, " runs ": 2 0 0 }," rem appings ": [] }," sources ":{" @ open ze ppelin / contracts / access / Own able . sol ":{" content ":" // ĠSPDX - License - Identifier : ĠMIT \ n \ n pragma Ġsolidity Ġ^ 0 . 8 . 0 ;\ n \ n import Ġ\" ../ utils / Context . sol \"; \ 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 Ġde ploys Ġthe Ġcontract . ĠThis \ n Ġ* Ġcan Ġlater Ġbe Ġchanged Ġwith Ġ{ transfer Ownership }. \ n Ġ* \ n Ġ* ĠThis Ġmodule Ġis Ġused Ġthrough Ġinheritance . ĠIt Ġwill Ġmake Ġavailable Ġthe Ġmodifier \ n Ġ* Ġ` only Owner `, Ġwhich Ġcan Ġbe Ġapplied Ġto Ġyour Ġfunctions Ġto Ġrestrict Ġtheir Ġuse Ġto \ n Ġ* Ġthe Ġowner .\ n Ġ*/ \ n abstract Ġcontract ĠOwn able Ġis ĠContext Ġ{\ n ĠĠĠ Ġaddress Ġprivate Ġ_ owner ;\ n \ n ĠĠĠ Ġevent ĠOwn ership Transfer red ( address Ġindexed Ġprevious Owner , Ġaddress Ġindexed Ġnew Owner );\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠInitializes Ġthe Ġcontract Ġsetting Ġthe Ġdeploy er Ġas Ġthe Ġinitial Ġowner .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġconstructor Ġ() Ġ{\ n ĠĠĠĠĠĠĠ Ġaddress Ġmsg Sender Ġ= Ġ_ msg Sender (); \ n ĠĠĠĠĠĠĠ Ġ_ owner Ġ= Ġmsg Sender ;\ n ĠĠĠĠĠĠĠ Ġemit ĠOwn ership Transfer red ( address ( 0 ), Ġmsg Sender );\ 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 Ġonly Owner () Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( owner () Ġ== Ġ_ msg Sender (), Ġ\" Own able : Ġcaller Ġis Ġnot Ġthe Ġowner \ "); \ n ĠĠĠĠĠĠĠ Ġ_ ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠLe aves Ġthe Ġcontract Ġwithout Ġowner . ĠIt Ġwill Ġnot Ġbe Ġpossible Ġto Ġcall \ n ĠĠĠĠ Ġ* Ġ` only Owner ` Ġfunctions Ġanymore . ĠCan Ġonly Ġbe Ġcalled Ġby Ġthe Ġcurrent Ġowner .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠNOTE : ĠR eno unc ing Ġownership Ġwill Ġleave Ġthe Ġcontract Ġwithout Ġan Ġowner ,\ n ĠĠĠĠ Ġ* Ġthere by Ġremoving Ġany Ġfunctionality Ġthat Ġis Ġonly Ġavailable Ġto Ġthe Ġowner .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġre no unce Ownership () Ġpublic Ġvirtual Ġonly Owner Ġ{\ n ĠĠĠĠĠĠĠ Ġemit ĠOwn ership Transfer red (_ owner , Ġaddress ( 0 )); \ n ĠĠĠĠĠĠĠ Ġ_ owner Ġ= Ġaddress ( 0 );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠTrans fers Ġownership Ġof Ġthe Ġcontract Ġto Ġa Ġnew Ġaccount Ġ(` new Owner `). \ n ĠĠĠĠ Ġ* ĠCan Ġonly Ġbe Ġcalled Ġby Ġthe Ġcurrent Ġowner .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtransfer Ownership ( address Ġnew Owner ) Ġpublic Ġvirtual Ġonly Owner Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( new Owner Ġ!= Ġaddress ( 0 ), Ġ\" Own able : Ġnew Ġowner Ġis Ġthe Ġzero Ġaddress \ "); \ n ĠĠĠĠĠĠĠ Ġemit ĠOwn ership Transfer red (_ owner , Ġnew Owner );\ n ĠĠĠĠĠĠĠ Ġ_ owner Ġ= Ġnew Owner ;\ n ĠĠĠ Ġ}\ n }\ n "," ke cc ak 2 5 6 ":" 0 x 1 cae 4 f 8 5 f 1 1 4 ff 1 7 b 9 0 4 1 4 f 5 da 6 7 3 6 5 b 1 d 0 0 3 3 7 abb 5 bce 9 bf 9 4 4 eb 7 8 a 2 c 0 6 7 3 c "," license ":" MIT "}," @ open ze ppelin / contracts / security / Re entr ancy Guard . sol ":{" content ":" // ĠSPDX - License - Identifier : ĠMIT \ n \ n pragma Ġsolidity Ġ^ 0 . 8 . 0 ;\ n \ n /** \ n Ġ* Ġ@ dev ĠContract Ġmodule Ġthat Ġhelps Ġprevent Ġre entrant Ġcalls Ġto Ġa Ġfunction .\ n Ġ* \ n Ġ* ĠInherit ing Ġfrom Ġ` Re entr ancy Guard ` Ġwill Ġmake Ġthe Ġ{ non Re entrant } Ġmodifier \ n Ġ* Ġavailable , Ġwhich Ġcan Ġbe Ġapplied Ġto Ġfunctions Ġto Ġmake Ġsure Ġthere Ġare Ġno Ġnested \ n Ġ* Ġ( re entrant ) Ġcalls Ġto Ġthem .\ n Ġ* \ n Ġ* ĠNote Ġthat Ġbecause Ġthere Ġis Ġa Ġsingle Ġ` non Re entrant ` Ġguard , Ġfunctions Ġmarked Ġas \ n Ġ* Ġ` non Re entrant ` Ġmay Ġnot Ġcall Ġone Ġanother . ĠThis Ġcan Ġbe Ġworked Ġaround Ġby Ġmaking \ n Ġ* Ġthose Ġfunctions Ġ` private `, Ġand Ġthen Ġadding Ġ` external ` Ġ` non Re entrant ` Ġentry \ n Ġ* Ġpoints Ġto Ġthem .\ n Ġ* \ n Ġ* ĠT IP : ĠIf Ġyou Ġwould Ġlike Ġto Ġlearn Ġmore Ġabout Ġre entr ancy Ġand Ġalternative Ġways \ n Ġ* Ġto Ġprotect Ġagainst Ġit , Ġcheck Ġout Ġour Ġblog Ġpost \ n Ġ* Ġhttps :// blog . open ze ppelin . com / re entr ancy - after - istan bul /[ Re entr ancy ĠAfter ĠI stan bul ]. \ n Ġ*/ \ n abstract Ġcontract ĠRe entr ancy Guard Ġ{\ n ĠĠĠ Ġ// ĠB ooleans Ġare Ġmore Ġexpensive Ġthan Ġuint 2 5 6 Ġor Ġany Ġtype Ġthat Ġtakes Ġup Ġa Ġfull \ n ĠĠĠ Ġ// Ġword Ġbecause Ġeach Ġwrite Ġoperation Ġemits Ġan Ġextra ĠS LOAD Ġto Ġfirst Ġread Ġthe \ n ĠĠĠ Ġ// Ġslot 's Ġcontents , Ġreplace Ġthe Ġbits Ġtaken Ġup Ġby Ġthe Ġboolean , Ġand Ġthen Ġwrite \ n ĠĠĠ Ġ// Ġback . ĠThis Ġis Ġthe Ġcompiler 's Ġdef ense Ġagainst Ġcontract Ġupgrades Ġand \ n ĠĠĠ Ġ// Ġpointer Ġalias ing , Ġand Ġit Ġcannot Ġbe Ġdisabled .\ n \ n ĠĠĠ Ġ// ĠThe Ġvalues Ġbeing Ġnon - zero Ġvalue Ġmakes Ġdeployment Ġa Ġbit Ġmore Ġexpensive ,\ n ĠĠĠ Ġ// Ġbut Ġin Ġexchange Ġthe Ġrefund Ġon Ġevery Ġcall Ġto Ġnon Re entrant Ġwill Ġbe Ġlower Ġin \ n ĠĠĠ Ġ// Ġamount . ĠSince Ġrefund s Ġare Ġc apped Ġto Ġa Ġpercentage Ġof Ġthe Ġtotal \ n ĠĠĠ Ġ// Ġtransaction 's Ġgas , Ġit Ġis Ġbest Ġto Ġkeep Ġthem Ġlow Ġin Ġcases Ġlike Ġthis Ġone , Ġto \ n ĠĠĠ Ġ// Ġincrease Ġthe Ġlikelihood Ġof Ġthe Ġfull Ġrefund Ġcoming Ġinto Ġeffect .\ n ĠĠĠ Ġuint 2 5 6 Ġprivate Ġconstant Ġ_ NOT _ ENTER ED Ġ= Ġ 1 ;\ n ĠĠĠ Ġuint 2 5 6 Ġprivate Ġconstant Ġ_ ENTER ED Ġ= Ġ 2 ;\ n \ n ĠĠĠ Ġuint 2 5 6 Ġprivate Ġ_ status ;\ n \ n ĠĠĠ Ġconstructor Ġ() Ġ{\ n ĠĠĠĠĠĠĠ Ġ_ status Ġ= Ġ_ NOT _ ENTER ED ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠPre vents Ġa Ġcontract Ġfrom Ġcalling Ġitself , Ġdirectly Ġor Ġindirect ly .\ n ĠĠĠĠ Ġ* ĠCalling Ġa Ġ` non Re entrant ` Ġfunction Ġfrom Ġanother Ġ` non Re entrant `\ n ĠĠĠĠ Ġ* Ġfunction Ġis Ġnot Ġsupported . ĠIt Ġis Ġpossible Ġto Ġprevent Ġthis Ġfrom Ġhappening \ n ĠĠĠĠ Ġ* Ġby Ġmaking Ġthe Ġ` non Re entrant ` Ġfunction Ġexternal , Ġand Ġmake Ġit Ġcall Ġa \ n ĠĠĠĠ Ġ* Ġ` private ` Ġfunction Ġthat Ġdoes Ġthe Ġactual Ġwork .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġmodifier Ġnon Re entrant () Ġ{\ n ĠĠĠĠĠĠĠ Ġ// ĠOn Ġthe Ġfirst Ġcall Ġto Ġnon Re entrant , Ġ_ not Entered Ġwill Ġbe Ġtrue \ n ĠĠĠĠĠĠĠ Ġrequire (_ status Ġ!= Ġ_ ENTER ED , Ġ\" Re entr ancy Guard : Ġre entrant Ġcall \ "); \ n \ n ĠĠĠĠĠĠĠ Ġ// ĠAny Ġcalls Ġto Ġnon Re entrant Ġafter Ġthis Ġpoint Ġwill Ġfail \ n ĠĠĠĠĠĠĠ Ġ_ status Ġ= Ġ_ ENTER ED ;\ n \ n ĠĠĠĠĠĠĠ Ġ_ ;\ n \ n ĠĠĠĠĠĠĠ Ġ// ĠBy Ġstoring Ġthe Ġoriginal Ġvalue Ġonce Ġagain , Ġa Ġrefund Ġis Ġtriggered Ġ( see \ n ĠĠĠĠĠĠĠ Ġ// Ġhttps :// e ips . ethereum . org / E IPS / e ip - 2 2 0 0 )\ n ĠĠĠĠĠĠĠ Ġ_ status Ġ= Ġ_ NOT _ ENTER ED ;\ n ĠĠĠ Ġ}\ n }\ n "," ke cc ak 2 5 6 ":" 0 x 1 2 7 8 c 7 6 b 8 4 0 0 6 3 ff 5 e 1 4 a 2 d 7 c 5 7 0 7 8 1 2 c 1 e abc 2 3 4 2 ed 0 4 0 bf 8 6 2 c 2 d 7 5 5 2 1 0 2 fe "," license ":" MIT "}," @ open ze ppelin / contracts / token / ERC 2 0 / ERC 2 0 . sol ":{" content ":" // ĠSPDX - License - Identifier : ĠMIT \ n \ n pragma Ġsolidity Ġ^ 0 . 8 . 0 ;\ n \ n import Ġ\" ./ I ERC 2 0 . sol \"; \ n import Ġ\" ./ extensions / I ERC 2 0 Metadata . sol \"; \ n import Ġ\" ../../ utils / Context . sol \"; \ n \ n /** \ n Ġ* Ġ@ dev ĠImplementation Ġof Ġthe Ġ{ I ERC 2 0 } Ġinterface .\ n Ġ* \ n Ġ* ĠThis Ġimplementation Ġis Ġag nost ic Ġto Ġthe Ġway Ġtokens Ġare Ġcreated . ĠThis Ġmeans \ n Ġ* Ġthat Ġa Ġsupply Ġmechanism Ġhas Ġto Ġbe Ġadded Ġin Ġa Ġderived Ġcontract Ġusing Ġ{_ mint }. \ n Ġ* ĠFor Ġa Ġgeneric Ġmechanism Ġsee Ġ{ ERC 2 0 Preset M inter Pa user }. \ n Ġ* \ n Ġ* ĠT IP : ĠFor Ġa Ġdetailed Ġwrite up Ġsee Ġour Ġguide \ n Ġ* Ġhttps :// forum . ze ppelin . solutions / t / how - to - implement - erc 2 0 - supply - me chan isms / 2 2 6 [ How \ n Ġ* Ġto Ġimplement Ġsupply Ġmechanisms ]. \ n Ġ* \ n Ġ* ĠWe Ġhave Ġfollowed Ġgeneral ĠOpen Ze ppelin Ġguidelines : Ġfunctions Ġrevert Ġinstead \ n Ġ* Ġof Ġreturning Ġ` false ` Ġon Ġfailure . ĠThis Ġbehavior Ġis Ġnon et he less Ġconvention al \ n Ġ* Ġand Ġdoes Ġnot Ġconflict Ġwith Ġthe Ġexpectations Ġof ĠERC 2 0 Ġapplications .\ n Ġ* \ n Ġ* ĠAdditionally , Ġan Ġ{ Approval } Ġevent Ġis Ġemitted Ġon Ġcalls Ġto Ġ{ transfer From }. \ n Ġ* ĠThis Ġallows Ġapplications Ġto Ġreconstruct Ġthe Ġallow ance Ġfor Ġall Ġaccounts Ġjust \ n Ġ* Ġby Ġlistening Ġto Ġsaid Ġevents . ĠOther Ġimplementations Ġof Ġthe ĠE IP Ġmay Ġnot Ġemit \ n Ġ* Ġthese Ġevents , Ġas Ġit Ġisn 't Ġrequired Ġby Ġthe Ġspecification .\ n Ġ* \ n Ġ* ĠFinally , Ġthe Ġnon - standard Ġ{ decrease Allow ance } Ġand Ġ{ increase Allow ance }\ n Ġ* Ġfunctions Ġhave Ġbeen Ġadded Ġto Ġmit igate Ġthe Ġwell - known Ġissues Ġaround Ġsetting \ n Ġ* Ġallow ances . ĠSee Ġ{ I ERC 2 0 - approve }. \ n Ġ*/ \ n contract ĠERC 2 0 Ġis ĠContext , ĠI ERC 2 0 , ĠI ERC 2 0 Metadata Ġ{\ n ĠĠĠ Ġmapping Ġ( address Ġ=> Ġuint 2 5 6 ) Ġprivate Ġ_ balances ;\ n \ n ĠĠĠ Ġmapping Ġ( address Ġ=> Ġmapping Ġ( address Ġ=> Ġuint 2 5 6 )) Ġprivate Ġ_ allow ances ;\ n \ n ĠĠĠ Ġuint 2 5 6 Ġprivate Ġ_ total Supply ;\ n \ n ĠĠĠ Ġstring Ġprivate Ġ_ name ;\ n ĠĠĠ Ġstring Ġprivate Ġ_ symbol ;\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSets Ġthe Ġvalues Ġfor Ġ{ name } Ġand Ġ{ symbol }. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠThe Ġdef aut Ġvalue Ġof Ġ{ decimals } Ġis Ġ 1 8 . ĠTo Ġselect Ġa Ġdifferent Ġvalue Ġfor \ n ĠĠĠĠ Ġ* Ġ{ decimals } Ġyou Ġshould Ġoverload Ġit .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠAll Ġtwo Ġof Ġthese Ġvalues Ġare Ġimmutable : Ġthey Ġcan Ġonly Ġbe Ġset Ġonce Ġduring \ n ĠĠĠĠ Ġ* Ġconstruction .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġconstructor Ġ( string Ġmemory Ġname _, Ġstring Ġmemory Ġsymbol _) Ġ{\ n ĠĠĠĠĠĠĠ Ġ_ name Ġ= Ġname _; \ n ĠĠĠĠĠĠĠ Ġ_ symbol Ġ= Ġsymbol _; \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġname Ġof Ġthe Ġtoken .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġname () Ġpublic Ġview Ġvirtual Ġoverride Ġreturns Ġ( string Ġmemory ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġ_ name ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġsymbol Ġof Ġthe Ġtoken , Ġusually Ġa Ġshorter Ġversion Ġof Ġthe \ n ĠĠĠĠ Ġ* Ġname .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġsymbol () Ġpublic Ġview Ġvirtual Ġoverride Ġreturns Ġ( string Ġmemory ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġ_ symbol ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġnumber Ġof Ġdecimals Ġused Ġto Ġget Ġits Ġuser Ġrepresentation .\ n ĠĠĠĠ Ġ* ĠFor Ġexample , Ġif Ġ` decimals ` Ġequals Ġ` 2 `, Ġa Ġbalance Ġof Ġ` 5 0 5 ` Ġtokens Ġshould \ n ĠĠĠĠ Ġ* Ġbe Ġdisplayed Ġto Ġa Ġuser Ġas Ġ` 5 , 0 5 ` Ġ(` 5 0 5 Ġ/ Ġ 1 0 Ġ** Ġ 2 `). \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠTokens Ġusually Ġopt Ġfor Ġa Ġvalue Ġof Ġ 1 8 , Ġim it ating Ġthe Ġrelationship Ġbetween \ n ĠĠĠĠ Ġ* ĠE ther Ġand ĠWe i . ĠThis Ġis Ġthe Ġvalue Ġ{ ERC 2 0 } Ġuses , Ġunless Ġthis Ġfunction Ġis \ n ĠĠĠĠ Ġ* Ġoverridden ;\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠNOTE : ĠThis Ġinformation Ġis Ġonly Ġused Ġfor Ġ_ display _ Ġpurposes : Ġit Ġin \ n ĠĠĠĠ Ġ* Ġno Ġway Ġaffects Ġany Ġof Ġthe Ġarithmetic Ġof Ġthe Ġcontract , Ġincluding \ n ĠĠĠĠ Ġ* Ġ{ I ERC 2 0 - balanceOf } Ġand Ġ{ I ERC 2 0 - transfer }. \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġdecimals () Ġpublic Ġview Ġvirtual Ġoverride Ġreturns Ġ( uint 8 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġ 1 8 ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSee Ġ{ I ERC 2 0 - total Supply }. \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtotal Supply () Ġpublic Ġview Ġvirtual Ġoverride Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġ_ total Supply ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSee Ġ{ I ERC 2 0 - balanceOf }. \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġbalance Of ( address Ġaccount ) Ġpublic Ġview Ġvirtual Ġoverride Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġ_ balances [ account ]; \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSee Ġ{ I ERC 2 0 - transfer }. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- Ġ` recipient ` Ġcannot Ġbe Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ* Ġ- Ġthe Ġcaller Ġmust Ġhave Ġa Ġbalance Ġof Ġat Ġleast Ġ` amount `. \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtransfer ( address Ġrecipient , Ġuint 2 5 6 Ġamount ) Ġpublic Ġvirtual Ġoverride Ġreturns Ġ( bool ) Ġ{\ n ĠĠĠĠĠĠĠ Ġ_ transfer (_ msg Sender (), Ġrecipient , Ġamount );\ n ĠĠĠĠĠĠĠ Ġreturn Ġtrue ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSee Ġ{ I ERC 2 0 - allow ance }. \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġallow ance ( address Ġowner , Ġaddress Ġsp ender ) Ġpublic Ġview Ġvirtual Ġoverride Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġ_ allow ances [ owner ][ sp ender ]; \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSee Ġ{ I ERC 2 0 - approve }. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- Ġ` sp ender ` Ġcannot Ġbe Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġapprove ( address Ġsp ender , Ġuint 2 5 6 Ġamount ) Ġpublic Ġvirtual Ġoverride Ġreturns Ġ( bool ) Ġ{\ n ĠĠĠĠĠĠĠ Ġ_ approve (_ msg Sender (), Ġsp ender , Ġamount );\ n ĠĠĠĠĠĠĠ Ġreturn Ġtrue ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSee Ġ{ I ERC 2 0 - transfer From }. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠEmit s Ġan Ġ{ Approval } Ġevent Ġindicating Ġthe Ġupdated Ġallow ance . ĠThis Ġis Ġnot \ n ĠĠĠĠ Ġ* Ġrequired Ġby Ġthe ĠE IP . ĠSee Ġthe Ġnote Ġat Ġthe Ġbeginning Ġof Ġ{ ERC 2 0 }. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- Ġ` sender ` Ġand Ġ` recipient ` Ġcannot Ġbe Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ* Ġ- Ġ` sender ` Ġmust Ġhave Ġa Ġbalance Ġof Ġat Ġleast Ġ` amount `. \ n ĠĠĠĠ Ġ* Ġ- Ġthe Ġcaller Ġmust Ġhave Ġallow ance Ġfor Ġ`` sender `` ' s Ġtokens Ġof Ġat Ġleast \ n ĠĠĠĠ Ġ* Ġ` amount `. \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtransfer From ( address Ġsender , Ġaddress Ġrecipient , Ġuint 2 5 6 Ġamount ) Ġpublic Ġvirtual Ġoverride Ġreturns Ġ( bool ) Ġ{\ n ĠĠĠĠĠĠĠ Ġ_ transfer ( sender , Ġrecipient , Ġamount );\ n \ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġcurrent Allow ance Ġ= Ġ_ allow ances [ sender ][ _ msg Sender ()]; \ n ĠĠĠĠĠĠĠ Ġrequire ( current Allow ance Ġ>= Ġamount , Ġ\" ERC 2 0 : Ġtransfer Ġamount Ġexceeds Ġallow ance \ "); \ n ĠĠĠĠĠĠĠ Ġ_ approve ( sender , Ġ_ msg Sender (), Ġcurrent Allow ance Ġ- Ġamount );\ n \ n ĠĠĠĠĠĠĠ Ġreturn Ġtrue ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠAtom ically Ġincreases Ġthe Ġallow ance Ġgranted Ġto Ġ` sp ender ` Ġby Ġthe Ġcaller .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠThis Ġis Ġan Ġalternative Ġto Ġ{ approve } Ġthat Ġcan Ġbe Ġused Ġas Ġa Ġmit igation Ġfor \ n ĠĠĠĠ Ġ* Ġproblems Ġdescribed Ġin Ġ{ I ERC 2 0 - approve }. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠEmit s Ġan Ġ{ Approval } Ġevent Ġindicating Ġthe Ġupdated Ġallow ance .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- Ġ` sp ender ` Ġcannot Ġbe Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġincrease Allow ance ( address Ġsp ender , Ġuint 2 5 6 Ġadded Value ) Ġpublic Ġvirtual Ġreturns Ġ( bool ) Ġ{\ n ĠĠĠĠĠĠĠ Ġ_ approve (_ msg Sender (), Ġsp ender , Ġ_ allow ances [_ msg Sender () ][ sp ender ] Ġ+ Ġadded Value );\ n ĠĠĠĠĠĠĠ Ġreturn Ġtrue ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠAtom ically Ġde creases Ġthe Ġallow ance Ġgranted Ġto Ġ` sp ender ` Ġby Ġthe Ġcaller .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠThis Ġis Ġan Ġalternative Ġto Ġ{ approve } Ġthat Ġcan Ġbe Ġused Ġas Ġa Ġmit igation Ġfor \ n ĠĠĠĠ Ġ* Ġproblems Ġdescribed Ġin Ġ{ I ERC 2 0 - approve }. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠEmit s Ġan Ġ{ Approval } Ġevent Ġindicating Ġthe Ġupdated Ġallow ance .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- Ġ` sp ender ` Ġcannot Ġbe Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ* Ġ- Ġ` sp ender ` Ġmust Ġhave Ġallow ance Ġfor Ġthe Ġcaller Ġof Ġat Ġleast \ n ĠĠĠĠ Ġ* Ġ` subtract ed Value `. \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġdecrease Allow ance ( address Ġsp ender , Ġuint 2 5 6 Ġsubtract ed Value ) Ġpublic Ġvirtual Ġreturns Ġ( bool ) Ġ{\ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġcurrent Allow ance Ġ= Ġ_ allow ances [_ msg Sender () ][ sp ender ]; \ n ĠĠĠĠĠĠĠ Ġrequire ( current Allow ance Ġ>= Ġsubtract ed Value , Ġ\" ERC 2 0 : Ġdecrease d Ġallow ance Ġbelow Ġzero \ "); \ n ĠĠĠĠĠĠĠ Ġ_ approve (_ msg Sender (), Ġsp ender , Ġcurrent Allow ance Ġ- Ġsubtract ed Value );\ n \ n ĠĠĠĠĠĠĠ Ġreturn Ġtrue ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠMov es Ġtokens Ġ` amount ` Ġfrom Ġ` sender ` Ġto Ġ` recipient `. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠThis Ġis Ġinternal Ġfunction Ġis Ġequivalent Ġto Ġ{ transfer }, Ġand Ġcan Ġbe Ġused Ġto \ n ĠĠĠĠ Ġ* Ġe . g . Ġimplement Ġautomatic Ġtoken Ġfees , Ġsl ashing Ġmechanisms , Ġetc .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠEmit s Ġa Ġ{ Transfer } Ġevent .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- Ġ` sender ` Ġcannot Ġbe Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ* Ġ- Ġ` recipient ` Ġcannot Ġbe Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ* Ġ- Ġ` sender ` Ġmust Ġhave Ġa Ġbalance Ġof Ġat Ġleast Ġ` amount `. \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġ_ transfer ( address Ġsender , Ġaddress Ġrecipient , Ġuint 2 5 6 Ġamount ) Ġinternal Ġvirtual Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( sender Ġ!= Ġaddress ( 0 ), Ġ\" ERC 2 0 : Ġtransfer Ġfrom Ġthe Ġzero Ġaddress \ "); \ n ĠĠĠĠĠĠĠ Ġrequire ( recipient Ġ!= Ġaddress ( 0 ), Ġ\" ERC 2 0 : Ġtransfer Ġto Ġthe Ġzero Ġaddress \ "); \ n \ n ĠĠĠĠĠĠĠ Ġ_ before Token Transfer ( sender , Ġrecipient , Ġamount );\ n \ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġsender Balance Ġ= Ġ_ balances [ sender ]; \ n ĠĠĠĠĠĠĠ Ġrequire ( sender Balance Ġ>= Ġamount , Ġ\" ERC 2 0 : Ġtransfer Ġamount Ġexceeds Ġbalance \ "); \ n ĠĠĠĠĠĠĠ Ġ_ balances [ sender ] Ġ= Ġsender Balance Ġ- Ġamount ;\ n ĠĠĠĠĠĠĠ Ġ_ balances [ recipient ] Ġ+= Ġamount ;\ n \ n ĠĠĠĠĠĠĠ Ġemit ĠTransfer ( sender , Ġrecipient , Ġamount );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** Ġ@ dev ĠCreates Ġ` amount ` Ġtokens Ġand Ġassigns Ġthem Ġto Ġ` account `, Ġincreasing \ n ĠĠĠĠ Ġ* Ġthe Ġtotal Ġsupply .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠEmit s Ġa Ġ{ Transfer } Ġevent Ġwith Ġ` from ` Ġset Ġto Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- Ġ` to ` Ġcannot Ġbe Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġ_ mint ( address Ġaccount , Ġuint 2 5 6 Ġamount ) Ġinternal Ġvirtual Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( account Ġ!= Ġaddress ( 0 ), Ġ\" ERC 2 0 : Ġmint Ġto Ġthe Ġzero Ġaddress \ "); \ n \ n ĠĠĠĠĠĠĠ Ġ_ before Token Transfer ( address ( 0 ), Ġaccount , Ġamount );\ n \ n ĠĠĠĠĠĠĠ Ġ_ total Supply Ġ+= Ġamount ;\ n ĠĠĠĠĠĠĠ Ġ_ balances [ account ] Ġ+= Ġamount ;\ n ĠĠĠĠĠĠĠ Ġemit ĠTransfer ( address ( 0 ), Ġaccount , Ġamount );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠDest ro ys Ġ` amount ` Ġtokens Ġfrom Ġ` account `, Ġreducing Ġthe \ n ĠĠĠĠ Ġ* Ġtotal Ġsupply .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠEmit s Ġa Ġ{ Transfer } Ġevent Ġwith Ġ` to ` Ġset Ġto Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- Ġ` account ` Ġcannot Ġbe Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ* Ġ- Ġ` account ` Ġmust Ġhave Ġat Ġleast Ġ` amount ` Ġtokens .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġ_ burn ( address Ġaccount , Ġuint 2 5 6 Ġamount ) Ġinternal Ġvirtual Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( account Ġ!= Ġaddress ( 0 ), Ġ\" ERC 2 0 : Ġburn Ġfrom Ġthe Ġzero Ġaddress \ "); \ n \ n ĠĠĠĠĠĠĠ Ġ_ before Token Transfer ( account , Ġaddress ( 0 ), Ġamount );\ n \ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġaccount Balance Ġ= Ġ_ balances [ account ]; \ n ĠĠĠĠĠĠĠ Ġrequire ( account Balance Ġ>= Ġamount , Ġ\" ERC 2 0 : Ġburn Ġamount Ġexceeds Ġbalance \ "); \ n ĠĠĠĠĠĠĠ Ġ_ balances [ account ] Ġ= Ġaccount Balance Ġ- Ġamount ;\ n ĠĠĠĠĠĠĠ Ġ_ total Supply Ġ-= Ġamount ;\ n \ n ĠĠĠĠĠĠĠ Ġemit ĠTransfer ( account , Ġaddress ( 0 ), Ġamount );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSets Ġ` amount ` Ġas Ġthe Ġallow ance Ġof Ġ` sp ender ` Ġover Ġthe Ġ` owner ` Ġs Ġtokens .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠThis Ġinternal Ġfunction Ġis Ġequivalent Ġto Ġ` approve `, Ġand Ġcan Ġbe Ġused Ġto \ n ĠĠĠĠ Ġ* Ġe . g . Ġset Ġautomatic Ġallow ances Ġfor Ġcertain Ġsub systems , Ġetc .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠEmit s Ġan Ġ{ Approval } Ġevent .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- Ġ` owner ` Ġcannot Ġbe Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ* Ġ- Ġ` sp ender ` Ġcannot Ġbe Ġthe Ġzero Ġaddress .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġ_ approve ( address Ġowner , Ġaddress Ġsp ender , Ġuint 2 5 6 Ġamount ) Ġinternal Ġvirtual Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( owner Ġ!= Ġaddress ( 0 ), Ġ\" ERC 2 0 : Ġapprove Ġfrom Ġthe Ġzero Ġaddress \ "); \ n ĠĠĠĠĠĠĠ Ġrequire ( sp ender Ġ!= Ġaddress ( 0 ), Ġ\" ERC 2 0 : Ġapprove Ġto Ġthe Ġzero Ġaddress \ "); \ n \ n ĠĠĠĠĠĠĠ Ġ_ allow ances [ owner ][ sp ender ] Ġ= Ġamount ;\ n ĠĠĠĠĠĠĠ Ġemit ĠAppro val ( owner , Ġsp ender , Ġamount );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠHook Ġthat Ġis Ġcalled Ġbefore Ġany Ġtransfer Ġof Ġtokens . ĠThis Ġincludes \ n ĠĠĠĠ Ġ* Ġmint ing Ġand Ġburn ing .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCalling Ġconditions :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- Ġwhen Ġ` from ` Ġand Ġ` to ` Ġare Ġboth Ġnon - zero , Ġ` amount ` Ġof Ġ`` from `` ' s Ġtokens \ n ĠĠĠĠ Ġ* Ġwill Ġbe Ġto Ġtransferred Ġto Ġ` to `. \ n ĠĠĠĠ Ġ* Ġ- Ġwhen Ġ` from ` Ġis Ġzero , Ġ` amount ` Ġtokens Ġwill Ġbe Ġmint ed Ġfor Ġ` to `. \ n ĠĠĠĠ Ġ* Ġ- Ġwhen Ġ` to ` Ġis Ġzero , Ġ` amount ` Ġof Ġ`` from `` ' s Ġtokens Ġwill Ġbe Ġburn ed .\ n ĠĠĠĠ Ġ* Ġ- Ġ` from ` Ġand Ġ` to ` Ġare Ġnever Ġboth Ġzero .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠTo Ġlearn Ġmore Ġabout Ġhooks , Ġhead Ġto Ġx ref : ROOT : ext ending - contracts . adoc # using - hooks [ Using ĠHooks ]. \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġ_ before Token Transfer ( address Ġfrom , Ġaddress Ġto , Ġuint 2 5 6 Ġamount ) Ġinternal Ġvirtual Ġ{ Ġ}\ n }\ n "," ke cc ak 2 5 6 ":" 0 xf ec cd cbf 6 7 b 2 0 0 6 a 7 1 5 e 5 af 1 a 4 c 7 5 5 6 0 0 4 d 9 5 b 2 8 0 6 5 5 2 b 5 cc 5 4 e 4 6 e 8 eb 7 e 8 8 7 b "," license ":" MIT "}," @ open ze ppelin / contracts / token / ERC 2 0 / I ERC 2 0 . sol ":{" content ":" // ĠSPDX - License - Identifier : ĠMIT \ n \ n pragma Ġsolidity Ġ^ 0 . 8 . 0 ;\ n \ n /** \ n Ġ* Ġ@ dev ĠInterface Ġof Ġthe ĠERC 2 0 Ġstandard Ġas Ġdefined Ġin Ġthe ĠE IP .\ n Ġ*/ \ n interface ĠI ERC 2 0 Ġ{\ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġamount Ġof Ġtokens Ġin Ġexistence .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtotal Supply () Ġexternal Ġview Ġreturns Ġ( uint 2 5 6 );\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġamount Ġof Ġtokens Ġowned Ġby Ġ` account `. \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġbalance Of ( address Ġaccount ) Ġexternal Ġview Ġreturns Ġ( uint 2 5 6 );\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠMov es Ġ` amount ` Ġtokens Ġfrom Ġthe Ġcaller 's Ġaccount Ġto Ġ` recipient `. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠReturns Ġa Ġboolean Ġvalue Ġindicating Ġwhether Ġthe Ġoperation Ġsucceeded .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠEmit s Ġa Ġ{ Transfer } Ġevent .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtransfer ( address Ġrecipient , Ġuint 2 5 6 Ġamount ) Ġexternal Ġreturns Ġ( bool );\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġremaining Ġnumber Ġof Ġtokens Ġthat Ġ` sp ender ` Ġwill Ġbe \ n ĠĠĠĠ Ġ* Ġallowed Ġto Ġspend Ġon Ġbehalf Ġof Ġ` owner ` Ġthrough Ġ{ transfer From }. ĠThis Ġis \ n ĠĠĠĠ Ġ* Ġzero Ġby Ġdefault .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠThis Ġvalue Ġchanges Ġwhen Ġ{ approve } Ġor Ġ{ transfer From } Ġare Ġcalled .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġallow ance ( address Ġowner , Ġaddress Ġsp ender ) Ġexternal Ġview Ġreturns Ġ( uint 2 5 6 );\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSets Ġ` amount ` Ġas Ġthe Ġallow ance Ġof Ġ` sp ender ` Ġover Ġthe Ġcaller 's Ġtokens .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠReturns Ġa Ġboolean Ġvalue Ġindicating Ġwhether Ġthe Ġoperation Ġsucceeded .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠIMPORT ANT : ĠB ew are Ġthat Ġchanging Ġan Ġallow ance Ġwith Ġthis Ġmethod Ġbrings Ġthe Ġrisk \ n ĠĠĠĠ Ġ* Ġthat Ġsomeone Ġmay Ġuse Ġboth Ġthe Ġold Ġand Ġthe Ġnew Ġallow ance Ġby Ġun fortun ate \ n ĠĠĠĠ Ġ* Ġtransaction Ġordering . ĠOne Ġpossible Ġsolution Ġto Ġmit igate Ġthis Ġrace \ n ĠĠĠĠ Ġ* Ġcondition Ġis Ġto Ġfirst Ġreduce Ġthe Ġsp ender 's Ġallow ance Ġto Ġ 0 Ġand Ġset Ġthe \ n ĠĠĠĠ Ġ* Ġdesired Ġvalue Ġafterwards :\ n ĠĠĠĠ Ġ* Ġhttps :// github . com / ethereum / E IPs / issues / 2 0 # issuecomment - 2 6 3 5 2 4 7 2 9 \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠEmit s Ġan Ġ{ Approval } Ġevent .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġapprove ( address Ġsp ender , Ġuint 2 5 6 Ġamount ) Ġexternal Ġreturns Ġ( bool );\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠMov es Ġ` amount ` Ġtokens Ġfrom Ġ` sender ` Ġto Ġ` recipient ` Ġusing Ġthe \ n ĠĠĠĠ Ġ* Ġallow ance Ġmechanism . Ġ` amount ` Ġis Ġthen Ġde duct ed Ġfrom Ġthe Ġcaller 's \ n ĠĠĠĠ Ġ* Ġallow ance .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠReturns Ġa Ġboolean Ġvalue Ġindicating Ġwhether Ġthe Ġoperation Ġsucceeded .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠEmit s Ġa Ġ{ Transfer } Ġevent .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtransfer From ( address Ġsender , Ġaddress Ġrecipient , Ġuint 2 5 6 Ġamount ) Ġexternal Ġreturns Ġ( bool );\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠE mitted Ġ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 , Ġuint 2 5 6 Ġvalue );\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠE mitted Ġwhen Ġthe Ġallow ance Ġof Ġa Ġ` sp ender ` Ġfor Ġan Ġ` owner ` Ġis Ġset Ġby \ n ĠĠĠĠ Ġ* Ġa Ġcall Ġto Ġ{ approve }. Ġ` value ` Ġis Ġthe Ġnew Ġallow ance .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġevent ĠAppro val ( address Ġindexed Ġowner , Ġaddress Ġindexed Ġsp ender , Ġuint 2 5 6 Ġvalue );\ n }\ n "," ke cc ak 2 5 6 ":" 0 xf 8 e 8 d 1 1 8 a 7 a 8 b 2 e 1 3 4 1 8 1 f 7 da 6 5 5 f 6 2 6 6 aa 3 a 0 f 9 1 3 4 b 2 6 0 5 7 4 7 1 3 9 fcb 0 c 5 d 8 3 5 "," license ":" MIT "}," @ open ze ppelin / contracts / token / ERC 2 0 / extensions / I ERC 2 0 Metadata . sol ":{" content ":" // ĠSPDX - License - Identifier : ĠMIT \ n \ n pragma Ġsolidity Ġ^ 0 . 8 . 0 ;\ n \ n import Ġ\" ../ I ERC 2 0 . sol \"; \ n \ n /** \ n Ġ* Ġ@ dev ĠInterface Ġfor Ġthe Ġoptional Ġmetadata Ġfunctions Ġfrom Ġthe ĠERC 2 0 Ġstandard .\ n Ġ* \ n Ġ* Ġ_ Available Ġsince Ġv 4 . 1 ._ \ n Ġ*/ \ n interface ĠI ERC 2 0 Metadata Ġis ĠI ERC 2 0 Ġ{\ 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 Ġ( uint 8 );\ n }\ n "," ke cc ak 2 5 6 ":" 0 x 8 3 fe 2 4 f 5 c 0 4 a 5 6 0 9 1 e 5 0 f 4 a 3 4 5 ff 5 0 4 c 8 bff 6 5 8 a 7 6 d 4 c 4 3 b 1 6 8 7 8 c 8 f 9 4 0 c 5 3 b 2 "," license ":" MIT "}," @ open ze ppelin / contracts / token / ERC 2 0 / utils / Safe ERC 2 0 . sol ":{" content ":" // ĠSPDX - License - Identifier : ĠMIT \ n \ n pragma Ġsolidity Ġ^ 0 . 8 . 0 ;\ n \ n import Ġ\" ../ I ERC 2 0 . sol \"; \ n import Ġ\" ../../../ utils / Address . sol \"; \ n \ n /** \ n Ġ* Ġ@ title ĠSafe ERC 2 0 \ n Ġ* Ġ@ dev ĠWrapper s Ġaround ĠERC 2 0 Ġ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 - re verting Ġcalls Ġare Ġassumed Ġto Ġbe \ n Ġ* Ġsuccessful .\ n Ġ* ĠTo Ġuse Ġthis Ġlibrary Ġyou Ġcan Ġadd Ġa Ġ` using ĠSafe ERC 2 0 Ġfor ĠI ERC 2 0 ;` Ġstatement Ġto Ġyour Ġcontract ,\ n Ġ* Ġwhich Ġallows Ġyou Ġto Ġcall Ġthe Ġsafe Ġoperations Ġas Ġ` token . safe Transfer (...) `, Ġetc .\ n Ġ*/ \ n library ĠSafe ERC 2 0 Ġ{\ n ĠĠĠ Ġusing ĠAddress Ġfor Ġaddress ;\ n \ n ĠĠĠ Ġfunction Ġsafe Transfer ( I ERC 2 0 Ġtoken , Ġaddress Ġto , Ġuint 2 5 6 Ġvalue ) Ġinternal Ġ{\ n ĠĠĠĠĠĠĠ Ġ_ call Optional Return ( token , Ġabi . encode With Selector ( token . transfer . selector , Ġto , Ġvalue )); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġfunction Ġsafe Transfer From ( I ERC 2 0 Ġtoken , Ġaddress Ġfrom , Ġaddress Ġto , Ġuint 2 5 6 Ġvalue ) Ġinternal Ġ{\ n ĠĠĠĠĠĠĠ Ġ_ call Optional Return ( token , Ġabi . encode With Selector ( token . transfer From . selector , Ġfrom , Ġto , Ġvalue )); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠDeprecated . ĠThis Ġfunction Ġhas Ġissues Ġsimilar Ġto Ġthe Ġones Ġfound Ġin \ n ĠĠĠĠ Ġ* Ġ{ I ERC 2 0 - approve }, Ġand Ġits Ġusage Ġis Ġdis cour aged .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠWh enever Ġpossible , Ġuse Ġ{ safe Increase Allow ance } Ġand \ n ĠĠĠĠ Ġ* Ġ{ safe De crease Allow ance } Ġinstead .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġsafe Approve ( I ERC 2 0 Ġtoken , Ġaddress Ġsp ender , Ġuint 2 5 6 Ġvalue ) Ġinternal Ġ{\ n ĠĠĠĠĠĠĠ Ġ// Ġsafe Approve Ġshould Ġonly Ġbe Ġcalled Ġwhen Ġsetting Ġan Ġinitial Ġallow ance ,\ n ĠĠĠĠĠĠĠ Ġ// Ġor Ġwhen Ġreset ting Ġit Ġto Ġzero . ĠTo Ġincrease Ġand Ġdecrease Ġit , Ġuse \ n ĠĠĠĠĠĠĠ Ġ// Ġ' safe Increase Allow ance ' Ġand Ġ' safe De crease Allow ance '\ n ĠĠĠĠĠĠĠ Ġ// Ġsol hint - disable - next - line Ġmax - line - length \ n ĠĠĠĠĠĠĠ Ġrequire (( value Ġ== Ġ 0 ) Ġ|| Ġ( token . allow ance ( address ( this ), Ġsp ender ) Ġ== Ġ 0 ), \ n ĠĠĠĠĠĠĠĠĠĠĠ Ġ\" Safe ERC 2 0 : Ġapprove Ġfrom Ġnon - zero Ġto Ġnon - zero Ġallow ance \"\ n ĠĠĠĠĠĠĠ Ġ); \ n ĠĠĠĠĠĠĠ Ġ_ call Optional Return ( token , Ġabi . encode With Selector ( token . approve . selector , Ġsp ender , Ġvalue )); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġfunction Ġsafe Increase Allow ance ( I ERC 2 0 Ġtoken , Ġaddress Ġsp ender , Ġuint 2 5 6 Ġvalue ) Ġinternal Ġ{\ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġnew Allow ance Ġ= Ġtoken . allow ance ( address ( this ), Ġsp ender ) Ġ+ Ġvalue ;\ n ĠĠĠĠĠĠĠ Ġ_ call Optional Return ( token , Ġabi . encode With Selector ( token . approve . selector , Ġsp ender , Ġnew Allow ance )); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġfunction Ġsafe De crease Allow ance ( I ERC 2 0 Ġtoken , Ġaddress Ġsp ender , Ġuint 2 5 6 Ġvalue ) Ġinternal Ġ{\ n ĠĠĠĠĠĠĠ Ġunchecked Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġold Allow ance Ġ= Ġtoken . allow ance ( address ( this ), Ġsp ender );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġrequire ( old Allow ance Ġ>= Ġvalue , Ġ\" Safe ERC 2 0 : Ġdecrease d Ġallow ance Ġbelow Ġzero \ "); \ n ĠĠĠĠĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġnew Allow ance Ġ= Ġold Allow ance Ġ- Ġvalue ;\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġ_ call Optional Return ( token , Ġabi . encode With Selector ( token . approve . selector , Ġsp ender , Ġnew Allow ance )); \ n ĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠI mit ates Ġa ĠSolid ity Ġhigh - level Ġcall Ġ( i . e . Ġa Ġregular Ġfunction Ġcall Ġto Ġa Ġcontract ), Ġrelax ing Ġ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 ĠĠĠ Ġfunction Ġ_ call Optional Return ( I ERC 2 0 Ġtoken , Ġbytes Ġmemory Ġdata ) Ġprivate Ġ{\ n ĠĠĠĠĠĠĠ Ġ// ĠWe Ġneed Ġto Ġperform Ġa Ġlow Ġlevel Ġcall Ġhere , Ġto Ġbypass ĠSolid ity 's Ġreturn Ġdata Ġsize Ġchecking Ġmechanism , Ġsince \ n ĠĠĠĠĠĠĠ Ġ// Ġwe 're Ġimplementing Ġit Ġourselves . ĠWe Ġuse Ġ{ Address . function Call } Ġto Ġperform Ġthis Ġcall , Ġwhich Ġverifies Ġthat \ n ĠĠĠĠĠĠĠ Ġ// Ġthe Ġtarget Ġaddress Ġcontains Ġcontract Ġcode Ġand Ġalso Ġassert s Ġfor Ġsuccess Ġin Ġthe Ġlow - level Ġcall .\ n \ n ĠĠĠĠĠĠĠ Ġbytes Ġmemory Ġreturn data Ġ= Ġaddress ( token ). function Call ( data , Ġ\" Safe ERC 2 0 : Ġlow - level Ġcall Ġfailed \ "); \ n ĠĠĠĠĠĠĠ Ġif Ġ( return data . length Ġ> Ġ 0 ) Ġ{ Ġ// ĠReturn Ġdata Ġis Ġoptional \ n ĠĠĠĠĠĠĠĠĠĠĠ Ġ// Ġsol hint - disable - next - line Ġmax - line - length \ n ĠĠĠĠĠĠĠĠĠĠĠ Ġrequire ( abi . decode ( return data , Ġ( bool )), Ġ\" Safe ERC 2 0 : ĠERC 2 0 Ġoperation Ġdid Ġnot Ġsucceed \ "); \ n ĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠ Ġ}\ n }\ n "," ke cc ak 2 5 6 ":" 0 x 9 9 f 5 c 2 1 0 1 8 d 7 9 6 db 7 8 3 3 a 2 1 0 0 bb 0 e 7 4 1 1 9 9 9 e 2 4 8 a 3 c 9 5 0 fb 5 2 6 eee 5 d 2 bf 4 7 cb 7 "," license ":" MIT "}," @ open ze ppelin / contracts / utils / Address . sol ":{" content ":" // ĠSPDX - License - Identifier : ĠMIT \ n \ n pragma Ġsolidity Ġ^ 0 . 8 . 0 ;\ n \ n /** \ n Ġ* Ġ@ dev ĠCollection Ġof Ġfunctions Ġrelated Ġto Ġthe Ġaddress Ġtype \ n Ġ*/ \ n library Ġ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 Ġextern ally - owned Ġaccount Ġ( EOA ) Ġand Ġnot Ġa Ġcontract .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠA mong Ġothers , Ġ` is Contract ` Ġwill Ġreturn Ġfalse Ġfor Ġthe Ġfollowing \ n ĠĠĠĠ Ġ* Ġtypes Ġof Ġaddresses :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ Ġ- Ġan Ġextern ally - owned Ġaccount \ n ĠĠĠĠ Ġ* Ġ Ġ- Ġa Ġcontract Ġin Ġconstruction \ n ĠĠĠĠ Ġ* Ġ Ġ- Ġan Ġaddress Ġwhere Ġa Ġcontract Ġwill Ġbe Ġcreated \ n ĠĠĠĠ Ġ* Ġ Ġ- Ġan Ġaddress Ġwhere Ġa Ġcontract Ġli ved , Ġbut Ġwas Ġdestroyed \ n ĠĠĠĠ Ġ* Ġ=== =\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġis Contract ( address Ġaccount ) Ġinternal Ġview Ġreturns Ġ( bool ) Ġ{\ n ĠĠĠĠĠĠĠ Ġ// ĠThis Ġmethod Ġrelies Ġon Ġext code size , Ġwhich Ġreturns Ġ 0 Ġfor Ġcontracts Ġin \ n ĠĠĠĠĠĠĠ Ġ// Ġconstruction , Ġsince Ġthe Ġcode Ġis Ġonly Ġstored Ġat Ġthe Ġend Ġof Ġthe \ n ĠĠĠĠĠĠĠ Ġ// Ġconstructor Ġexecution .\ n \ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġsize ;\ n ĠĠĠĠĠĠĠ Ġ// Ġsol hint - disable - next - line Ġno - inline - assembly \ n ĠĠĠĠĠĠĠ Ġassembly Ġ{ Ġsize Ġ:= Ġext code size ( account ) Ġ}\ n ĠĠĠĠĠĠĠ Ġreturn Ġsize Ġ> Ġ 0 ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠRe placement Ġfor ĠSolid ity 's Ġ` transfer `: Ġsends Ġ` amount ` Ġwe i Ġto \ n ĠĠĠĠ Ġ* Ġ` recipient `, Ġforwarding Ġall Ġavailable Ġgas Ġand Ġre verting Ġon Ġerrors .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġhttps :// e ips . ethereum . org / E IPS / e ip - 1 8 8 4 [ E IP 1 8 8 4 ] Ġincreases Ġthe Ġgas Ġcost \ n ĠĠĠĠ Ġ* Ġof Ġcertain Ġop codes , Ġpossibly Ġmaking Ġcontracts Ġgo Ġover Ġthe Ġ 2 3 0 0 Ġgas Ġlimit \ n ĠĠĠĠ Ġ* Ġimp osed Ġby Ġ` transfer `, Ġmaking Ġthem Ġunable Ġto Ġreceive Ġfunds Ġvia \ n ĠĠĠĠ Ġ* Ġ` transfer `. Ġ{ send Value } Ġremoves Ġthis Ġlimitation .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġhttps :// dil ig ence . cons ens ys . net / posts / 2 0 1 9 / 0 9 / stop - using - solid ity s - transfer - now /[ Learn Ġmore ]. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠIMPORT ANT : Ġbecause Ġcontrol Ġis Ġtransferred Ġto Ġ` recipient `, Ġcare Ġmust Ġbe \ n ĠĠĠĠ Ġ* Ġtaken Ġto Ġnot Ġcreate Ġre entr ancy Ġvulner abilities . ĠConsider Ġusing \ n ĠĠĠĠ Ġ* Ġ{ Re entr ancy Guard } Ġor Ġthe \ n ĠĠĠĠ Ġ* Ġhttps :// solid ity . readthedocs . io / en / v 0 . 5 . 1 1 / security - consider ations . html # use - the - checks - effects - inter actions - pattern [ checks - effects - inter actions Ġpattern ]. \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġsend Value ( address Ġpay able Ġrecipient , Ġuint 2 5 6 Ġamount ) Ġinternal Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( address ( this ). balance Ġ>= Ġamount , Ġ\" Address : Ġins ufficient Ġbalance \ "); \ n \ n ĠĠĠĠĠĠĠ Ġ// Ġsol hint - disable - next - line Ġavoid - low - level - calls , Ġavoid - call - value \ n ĠĠĠĠĠĠĠ Ġ( bool Ġsuccess , Ġ) Ġ= Ġrecipient . call { Ġvalue : Ġamount Ġ} ( \"\ "); \ n ĠĠĠĠĠĠĠ Ġrequire ( success , Ġ\" Address : Ġunable Ġto Ġsend Ġvalue , Ġrecipient Ġmay Ġhave Ġre verted \ "); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠPerforms Ġa ĠSolid ity Ġ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 ` Ġre verts Ġwith Ġa Ġrevert Ġreason , Ġit Ġis Ġb ub b led Ġup Ġby Ġthis \ n ĠĠĠĠ Ġ* Ġfunction Ġ( like Ġregular ĠSolid ity Ġfunction Ġcalls ).\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠReturns Ġthe Ġraw Ġreturned Ġdata . ĠTo Ġconvert Ġto Ġthe Ġexpected Ġreturn Ġvalue ,\ n ĠĠĠĠ Ġ* Ġuse Ġhttps :// solid ity . readthedocs . io / en / latest / units - and - global - variables . html ? highlight = abi . decode # abi - encoding - and - de coding - 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 Ġv 3 . 1 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġfunction Call ( address Ġtarget , Ġbytes Ġmemory Ġdata ) Ġinternal Ġreturns Ġ( bytes Ġmemory ) Ġ{\ n ĠĠĠĠĠ Ġreturn Ġfunction Call ( target , Ġdata , Ġ\" Address : Ġlow - level Ġcall Ġfailed \ "); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSame Ġas Ġ{ xref - Address - function Call - address - bytes - }[ ` function Call `], Ġbut Ġwith \ n ĠĠĠĠ Ġ* Ġ` errorMessage ` Ġas Ġa Ġfallback Ġrevert Ġreason Ġwhen Ġ` target ` Ġre verts .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 1 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġfunction Call ( address Ġtarget , Ġbytes Ġmemory Ġdata , Ġstring Ġmemory ĠerrorMessage ) Ġinternal Ġreturns Ġ( bytes Ġmemory ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġfunction Call WithValue ( target , Ġdata , Ġ 0 , ĠerrorMessage );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSame Ġas Ġ{ xref - Address - function Call - address - bytes - }[ ` function Call `], \ n ĠĠĠĠ Ġ* Ġbut Ġalso Ġtrans f erring Ġ` value ` Ġwe i Ġto Ġ` target `. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- Ġthe Ġcalling Ġcontract Ġmust Ġhave Ġan ĠETH Ġbalance Ġof Ġat Ġleast Ġ` value `. \ n ĠĠĠĠ Ġ* Ġ- Ġthe Ġcalled ĠSolid ity Ġfunction Ġmust Ġbe Ġ` pay able `. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 1 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġfunction Call WithValue ( address Ġtarget , Ġbytes Ġmemory Ġdata , Ġuint 2 5 6 Ġvalue ) Ġinternal Ġreturns Ġ( bytes Ġmemory ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġfunction Call WithValue ( target , Ġdata , Ġvalue , Ġ\" Address : Ġlow - level Ġcall Ġwith Ġvalue Ġfailed \ "); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSame Ġas Ġ{ xref - Address - function Call WithValue - address - bytes - uint 2 5 6 - }[ ` function Call WithValue `], Ġbut \ n ĠĠĠĠ Ġ* Ġwith Ġ` errorMessage ` Ġas Ġa Ġfallback Ġrevert Ġreason Ġwhen Ġ` target ` Ġre verts .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 1 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġfunction Call WithValue ( address Ġtarget , Ġbytes Ġmemory Ġdata , Ġuint 2 5 6 Ġvalue , Ġstring Ġmemory ĠerrorMessage ) Ġinternal Ġreturns Ġ( bytes Ġmemory ) Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( address ( this ). balance Ġ>= Ġvalue , Ġ\" Address : Ġins ufficient Ġbalance Ġfor Ġcall \ "); \ n ĠĠĠĠĠĠĠ Ġrequire ( is Contract ( target ), Ġ\" Address : Ġcall Ġto Ġnon - contract \ "); \ n \ n ĠĠĠĠĠĠĠ Ġ// Ġsol hint - disable - next - line Ġavoid - low - level - calls \ n ĠĠĠĠĠĠĠ Ġ( bool Ġsuccess , Ġbytes Ġmemory Ġreturn data ) Ġ= Ġtarget . call { Ġvalue : Ġvalue Ġ} ( data );\ n ĠĠĠĠĠĠĠ Ġreturn Ġ_ verify Call Result ( success , Ġreturn data , ĠerrorMessage );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSame Ġas Ġ{ xref - Address - function Call - address - bytes - }[ ` function Call `], \ n ĠĠĠĠ Ġ* Ġbut Ġperforming Ġa Ġstatic Ġcall .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 3 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġfunction Static Call ( address Ġtarget , Ġbytes Ġmemory Ġdata ) Ġinternal Ġview Ġreturns Ġ( bytes Ġmemory ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġfunction Static Call ( target , Ġdata , Ġ\" Address : Ġlow - level Ġstatic Ġcall Ġfailed \ "); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSame Ġas Ġ{ xref - Address - function Call - address - bytes - string - }[ ` function Call `], \ n ĠĠĠĠ Ġ* Ġbut Ġperforming Ġa Ġstatic Ġcall .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 3 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġfunction Static Call ( address Ġtarget , Ġbytes Ġmemory Ġdata , Ġstring Ġmemory ĠerrorMessage ) Ġinternal Ġview Ġreturns Ġ( bytes Ġmemory ) Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( is Contract ( target ), Ġ\" Address : Ġstatic Ġcall Ġto Ġnon - contract \ "); \ n \ n ĠĠĠĠĠĠĠ Ġ// Ġsol hint - disable - next - line Ġavoid - low - level - calls \ n ĠĠĠĠĠĠĠ Ġ( bool Ġsuccess , Ġbytes Ġmemory Ġreturn data ) Ġ= Ġtarget . static call ( data );\ n ĠĠĠĠĠĠĠ Ġreturn Ġ_ verify Call Result ( success , Ġreturn data , ĠerrorMessage );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSame Ġas Ġ{ xref - Address - function Call - address - bytes - }[ ` function Call `], \ n ĠĠĠĠ Ġ* Ġbut Ġperforming Ġa Ġdelegate Ġcall .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 4 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġfunction Delegate Call ( address Ġtarget , Ġbytes Ġmemory Ġdata ) Ġinternal Ġreturns Ġ( bytes Ġmemory ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġfunction Delegate Call ( target , Ġdata , Ġ\" Address : Ġlow - level Ġdelegate Ġcall Ġfailed \ "); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSame Ġas Ġ{ xref - Address - function Call - address - bytes - string - }[ ` function Call `], \ n ĠĠĠĠ Ġ* Ġbut Ġperforming Ġa Ġdelegate Ġcall .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 4 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġfunction Delegate Call ( address Ġtarget , Ġbytes Ġmemory Ġdata , Ġstring Ġmemory ĠerrorMessage ) Ġinternal Ġreturns Ġ( bytes Ġmemory ) Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( is Contract ( target ), Ġ\" Address : Ġdelegate Ġcall Ġto Ġnon - contract \ "); \ n \ n ĠĠĠĠĠĠĠ Ġ// Ġsol hint - disable - next - line Ġavoid - low - level - calls \ n ĠĠĠĠĠĠĠ Ġ( bool Ġsuccess , Ġbytes Ġmemory Ġreturn data ) Ġ= Ġtarget . delegate call ( data );\ n ĠĠĠĠĠĠĠ Ġreturn Ġ_ verify Call Result ( success , Ġreturn data , ĠerrorMessage );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġfunction Ġ_ verify Call Result ( bool Ġsuccess , Ġbytes Ġmemory Ġreturn data , Ġstring Ġmemory ĠerrorMessage ) Ġprivate Ġpure Ġreturns ( bytes Ġmemory ) Ġ{\ n ĠĠĠĠĠĠĠ Ġif Ġ( success ) Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġreturn data ;\ n ĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠLook Ġfor Ġrevert Ġreason Ġand Ġbubble Ġit Ġup Ġif Ġpresent \ n ĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( return data . length Ġ> Ġ 0 ) Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠThe Ġeasiest Ġway Ġto Ġbubble Ġthe Ġrevert Ġreason Ġis Ġusing Ġmemory Ġvia Ġassembly \ n \ n ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ// Ġsol hint - disable - next - line Ġno - inline - assembly \ n ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġassembly Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġlet Ġreturn data _ size Ġ:= Ġm load ( return data )\ n ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġrevert ( add ( 3 2 , Ġreturn data ), Ġreturn data _ size )\ n ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġrevert ( errorMessage );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠ Ġ}\ n }\ n "," ke cc ak 2 5 6 ":" 0 x 0 6 9 b 2 6 3 1 bb 5 b 5 1 9 3 a 5 8 ccf 7 a 0 6 2 6 6 c 7 3 6 1 bd 2 c 2 0 0 9 5 6 6 7 af 4 4 0 2 8 1 7 6 0 5 6 2 7 f 4 5 "," license ":" MIT "}," @ open ze ppelin / contracts / utils / Context . sol ":{" content ":" // ĠSPDX - License - Identifier : ĠMIT \ n \ n pragma Ġ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 Ġ* Ġpay ing Ġ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 Ġ*/ \ n abstract Ġcontract ĠContext Ġ{\ n ĠĠĠ Ġfunction Ġ_ msg Sender () Ġinternal Ġview Ġvirtual Ġreturns Ġ( address ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġmsg . sender ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġfunction Ġ_ msg Data () Ġinternal Ġview Ġvirtual Ġreturns Ġ( bytes Ġcall data ) Ġ{\ n ĠĠĠĠĠĠĠ Ġthis ; Ġ// Ġsil ence Ġstate Ġmut ability Ġwarning Ġwithout Ġgenerating Ġbytecode Ġ- Ġsee Ġhttps :// github . com / ethereum / solid ity / issues / 2 6 9 1 \ n ĠĠĠĠĠĠĠ Ġreturn Ġmsg . data ;\ n ĠĠĠ Ġ}\ n }\ n "," ke cc ak 2 5 6 ":" 0 xf 9 3 0 d 2 df 4 2 6 bf cfc 1 f 7 4 1 5 be 7 2 4 f 0 4 0 8 1 c 9 6 f 4 fb 9 ec 8 d 0 e 3 a 5 2 1 c 0 7 6 9 2 d face 0 "," license ":" MIT "}," @ open ze ppelin / contracts / utils / math / Safe Math . sol ":{" content ":" // ĠSPDX - License - Identifier : ĠMIT \ n \ n pragma Ġsolidity Ġ^ 0 . 8 . 0 ;\ n \ n // ĠCA UTION \ n // ĠThis Ġversion Ġof ĠSafe Math Ġshould Ġonly Ġbe Ġused Ġwith ĠSolid ity Ġ 0 . 8 Ġor Ġlater ,\ n // Ġbecause Ġit Ġrelies Ġon Ġthe Ġcompiler 's Ġbuilt Ġin Ġoverflow Ġchecks .\ n \ n /** \ n Ġ* Ġ@ dev ĠWrapper s Ġover ĠSolid ity 's Ġarithmetic Ġoperations .\ n Ġ* \ n Ġ* ĠNOTE : Ġ` Safe Math ` Ġis Ġno Ġlonger Ġneeded Ġstarting Ġwith ĠSolid ity Ġ 0 . 8 . ĠThe Ġcompiler \ n Ġ* Ġnow Ġhas Ġbuilt Ġin Ġoverflow Ġchecking .\ n Ġ*/ \ n library ĠSafe Math Ġ{\ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġaddition Ġof Ġtwo Ġunsigned Ġintegers , Ġwith Ġan Ġoverflow Ġflag .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 4 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtry Add ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb ) Ġinternal Ġpure Ġreturns Ġ( bool , Ġuint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġunchecked Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġc Ġ= Ġa Ġ+ Ġb ;\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( c Ġ< Ġa ) Ġreturn Ġ( false , Ġ 0 );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġ( true , Ġc );\ n ĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġsubstr action Ġof Ġtwo Ġunsigned Ġintegers , Ġwith Ġan Ġoverflow Ġflag .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 4 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtry Sub ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb ) Ġinternal Ġpure Ġreturns Ġ( bool , Ġuint 2 5 6 ) Ġ{\ 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 Ġoverflow Ġflag .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 4 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtry Mul ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb ) Ġinternal Ġpure Ġreturns Ġ( bool , Ġuint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġunchecked Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠG as Ġoptimization : Ġthis Ġis Ġche aper Ġthan Ġrequiring Ġ' a ' Ġnot Ġbeing Ġzero , Ġbut Ġthe \ n ĠĠĠĠĠĠĠĠĠĠĠ Ġ// Ġbenefit Ġis Ġlost Ġif Ġ' b ' Ġis Ġalso Ġtested .\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠSee : Ġhttps :// github . com / Open Ze ppelin / open ze ppelin - contracts / pull / 5 2 2 \ n ĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( a Ġ== Ġ 0 ) Ġreturn Ġ( true , Ġ 0 );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġ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 Ġdivision Ġby Ġzero Ġflag .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 4 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtry Div ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb ) Ġinternal Ġpure Ġreturns Ġ( bool , Ġuint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġunchecked Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( b Ġ== Ġ 0 ) Ġreturn Ġ( false , Ġ 0 );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġ( true , Ġa Ġ/ Ġb );\ n ĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġremainder Ġof Ġdiv iding Ġtwo Ġunsigned Ġintegers , Ġwith Ġa Ġdivision Ġby Ġzero Ġflag .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ_ Available Ġsince Ġv 3 . 4 ._ \ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġtry Mod ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb ) Ġinternal Ġpure Ġreturns Ġ( bool , Ġuint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġunchecked Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( b Ġ== Ġ 0 ) Ġreturn Ġ( false , Ġ 0 );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġ( true , Ġa Ġ% Ġb );\ n ĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġaddition Ġof Ġtwo Ġunsigned Ġintegers , Ġre verting Ġon \ n ĠĠĠĠ Ġ* Ġoverflow .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCounter part Ġto ĠSolid ity 's Ġ` + ` Ġoperator .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- ĠAdd ition Ġcannot Ġoverflow .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġadd ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb ) Ġinternal Ġpure Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġa Ġ+ Ġb ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġsub traction Ġof Ġtwo Ġunsigned Ġintegers , Ġre verting Ġon \ n ĠĠĠĠ Ġ* Ġoverflow Ġ( when Ġthe Ġresult Ġis Ġnegative ).\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCounter part Ġto ĠSolid ity 's Ġ`- ` Ġoperator .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- ĠSub traction Ġcannot Ġoverflow .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġsub ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb ) Ġinternal Ġpure Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġa Ġ- Ġb ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġmultiplication Ġof Ġtwo Ġunsigned Ġintegers , Ġre verting Ġon \ n ĠĠĠĠ Ġ* Ġoverflow .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCounter part Ġto ĠSolid ity 's Ġ` *` Ġoperator .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- ĠMultip lication Ġcannot Ġoverflow .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġmul ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb ) Ġinternal Ġpure Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġa Ġ* Ġb ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġinteger Ġdivision Ġof Ġtwo Ġunsigned Ġintegers , Ġre verting Ġon \ n ĠĠĠĠ Ġ* Ġdivision Ġby Ġzero . ĠThe Ġresult Ġis Ġrounded Ġtowards Ġzero .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCounter part Ġto ĠSolid ity 's Ġ`/ ` Ġoperator .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- ĠThe Ġdivisor Ġcannot Ġbe Ġzero .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġdiv ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb ) Ġinternal Ġpure Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġa Ġ/ Ġb ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġremainder Ġof Ġdiv iding Ġtwo Ġunsigned Ġintegers . Ġ( unsigned Ġinteger Ġmodulo ), \ n ĠĠĠĠ Ġ* Ġre verting Ġwhen Ġdiv iding Ġby Ġzero .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCounter part Ġto ĠSolid ity 's Ġ`% ` Ġoperator . ĠThis Ġfunction Ġuses Ġa Ġ` revert `\ n ĠĠĠĠ Ġ* Ġopcode Ġ( which Ġleaves Ġremaining Ġgas Ġun touched ) Ġwhile ĠSolid ity Ġuses Ġan \ n ĠĠĠĠ Ġ* Ġinvalid Ġopcode Ġto Ġrevert Ġ( consum ing Ġall Ġremaining Ġgas ).\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- ĠThe Ġdivisor Ġcannot Ġbe Ġzero .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġmod ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb ) Ġinternal Ġpure Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġa Ġ% Ġb ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġsub traction Ġof Ġtwo Ġunsigned Ġintegers , Ġre verting Ġwith Ġcustom Ġmessage Ġon \ n ĠĠĠĠ Ġ* Ġoverflow Ġ( when Ġthe Ġresult Ġis Ġnegative ).\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCA UTION : ĠThis Ġfunction Ġis Ġdeprecated Ġbecause Ġit Ġrequires Ġalloc ating Ġmemory Ġfor Ġthe Ġerror \ n ĠĠĠĠ Ġ* Ġmessage Ġun ne cess arily . ĠFor Ġcustom Ġrevert Ġreasons Ġuse Ġ{ try Sub }. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCounter part Ġto ĠSolid ity 's Ġ`- ` Ġoperator .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- ĠSub traction Ġcannot Ġoverflow .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġsub ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb , Ġstring Ġmemory ĠerrorMessage ) Ġinternal Ġpure Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġunchecked Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġrequire ( b Ġ<= Ġa , ĠerrorMessage );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġa Ġ- Ġb ;\ n ĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġinteger Ġdivision Ġof Ġtwo Ġunsigned Ġintegers , Ġre verting Ġwith Ġcustom Ġmessage Ġon \ n ĠĠĠĠ Ġ* Ġdivision Ġby Ġzero . ĠThe Ġresult Ġis Ġrounded Ġtowards Ġzero .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCounter part Ġto ĠSolid ity 's Ġ`% ` Ġoperator . ĠThis Ġfunction Ġuses Ġa Ġ` revert `\ n ĠĠĠĠ Ġ* Ġopcode Ġ( which Ġleaves Ġremaining Ġgas Ġun touched ) Ġwhile ĠSolid ity Ġuses Ġan \ n ĠĠĠĠ Ġ* Ġinvalid Ġopcode Ġto Ġrevert Ġ( consum ing Ġall Ġremaining Ġgas ).\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCounter part Ġto ĠSolid ity 's Ġ`/ ` Ġoperator . ĠNote : Ġthis Ġfunction Ġuses Ġa \ n ĠĠĠĠ Ġ* Ġ` revert ` Ġopcode Ġ( which Ġleaves Ġremaining Ġgas Ġun touched ) Ġwhile ĠSolid ity \ n ĠĠĠĠ Ġ* Ġuses Ġan Ġinvalid Ġopcode Ġto Ġrevert Ġ( consum ing Ġall Ġremaining Ġgas ).\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- ĠThe Ġdivisor Ġcannot Ġbe Ġzero .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġdiv ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb , Ġstring Ġmemory ĠerrorMessage ) Ġinternal Ġpure Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġunchecked Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġrequire ( b Ġ> Ġ 0 , ĠerrorMessage );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġa Ġ/ Ġb ;\ n ĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠReturns Ġthe Ġremainder Ġof Ġdiv iding Ġtwo Ġunsigned Ġintegers . Ġ( unsigned Ġinteger Ġmodulo ), \ n ĠĠĠĠ Ġ* Ġre verting Ġwith Ġcustom Ġmessage Ġwhen Ġdiv iding Ġby Ġzero .\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCA UTION : ĠThis Ġfunction Ġis Ġdeprecated Ġbecause Ġit Ġrequires Ġalloc ating Ġmemory Ġfor Ġthe Ġerror \ n ĠĠĠĠ Ġ* Ġmessage Ġun ne cess arily . ĠFor Ġcustom Ġrevert Ġreasons Ġuse Ġ{ try Mod }. \ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠCounter part Ġto ĠSolid ity 's Ġ`% ` Ġoperator . ĠThis Ġfunction Ġuses Ġa Ġ` revert `\ n ĠĠĠĠ Ġ* Ġopcode Ġ( which Ġleaves Ġremaining Ġgas Ġun touched ) Ġwhile ĠSolid ity Ġuses Ġan \ n ĠĠĠĠ Ġ* Ġinvalid Ġopcode Ġto Ġrevert Ġ( consum ing Ġall Ġremaining Ġgas ).\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* ĠRequirements :\ n ĠĠĠĠ Ġ* \ n ĠĠĠĠ Ġ* Ġ- ĠThe Ġdivisor Ġcannot Ġbe Ġzero .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġmod ( uint 2 5 6 Ġa , Ġuint 2 5 6 Ġb , Ġstring Ġmemory ĠerrorMessage ) Ġinternal Ġpure Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġunchecked Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġrequire ( b Ġ> Ġ 0 , ĠerrorMessage );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġa Ġ% Ġb ;\ n ĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠ Ġ}\ n }\ n "," ke cc ak 2 5 6 ":" 0 x 2 5 2 6 b 7 c 6 a 3 6 6 fc 2 1 1 bbc 1 7 6 0 7 8 ab 0 2 b 8 3 8 3 3 e 7 6 8 2 ab cc 5 b 3 bed 9 d 7 0 0 b 3 4 e 2 a 3 e "," license ":" MIT "}," contracts / BI FI / interfaces / beef y / IS tr ategy . sol ":{" content ":" // ĠSPDX - License - Identifier : ĠMIT \ n \ n pragma Ġsolidity Ġ^ 0 . 8 . 0 ;\ n \ n import Ġ\" @ open ze ppelin / contracts / token / ERC 2 0 / I ERC 2 0 . sol \"; \ n \ n interface ĠI Strategy Ġ{\ n ĠĠĠ Ġfunction Ġvault () Ġexternal Ġview Ġreturns Ġ( address );\ n ĠĠĠ Ġfunction Ġwant () Ġexternal Ġview Ġreturns Ġ( I ERC 2 0 );\ n ĠĠĠ Ġfunction Ġbefore Deposit () Ġexternal ;\ n ĠĠĠ Ġfunction Ġdeposit () Ġexternal ;\ n ĠĠĠ Ġfunction Ġwithdraw ( uint 2 5 6 ) Ġexternal ;\ n ĠĠĠ Ġfunction Ġbalance Of () Ġexternal Ġview Ġreturns Ġ( uint 2 5 6 );\ n ĠĠĠ Ġfunction Ġbalance Of Want () Ġexternal Ġview Ġreturns Ġ( uint 2 5 6 );\ n ĠĠĠ Ġfunction Ġbalance Of Pool () Ġexternal Ġview Ġreturns Ġ( uint 2 5 6 );\ n ĠĠĠ Ġfunction Ġhar vest () Ġexternal ;\ n ĠĠĠ Ġfunction Ġret ire Str at () Ġexternal ;\ n ĠĠĠ Ġfunction Ġpanic () Ġexternal ;\ n ĠĠĠ Ġfunction Ġpause () Ġexternal ;\ n ĠĠĠ Ġfunction Ġun pause () Ġexternal ;\ n ĠĠĠ Ġfunction Ġpaused () Ġexternal Ġview Ġreturns Ġ( bool );\ n ĠĠĠ Ġfunction Ġuni router () Ġexternal Ġview Ġreturns Ġ( address );\ n }\ n "," ke cc ak 2 5 6 ":" 0 xa 1 6 f 0 5 c 6 6 9 3 5 f 5 b 2 6 ba 2 0 2 be bd ad 3 fbd abe 5 0 9 c 7 6 f 1 1 b 0 a 6 bc 3 0 ba 2 2 cf 2 2 3 b 3 8 "," license ":" MIT "}," contracts / BI FI / vault s / B ee fy Vault V 6 . sol ":{" content ":" // ĠSPDX - License - Identifier : ĠMIT \ n \ n pragma Ġsolidity Ġ^ 0 . 8 . 0 ;\ n \ n import Ġ\" @ open ze ppelin / contracts / token / ERC 2 0 / ERC 2 0 . sol \"; \ n import Ġ\" @ open ze ppelin / contracts / token / ERC 2 0 / utils / Safe ERC 2 0 . sol \"; \ n import Ġ\" @ open ze ppelin / contracts / utils / math / Safe Math . sol \"; \ n import Ġ\" @ open ze ppelin / contracts / access / Own able . sol \"; \ n import Ġ\" @ open ze ppelin / contracts / security / Re entr ancy Guard . sol \"; \ n \ n import Ġ\" ../ interfaces / beef y / IS tr ategy . sol \"; \ n \ n /** \ n Ġ* Ġ@ dev ĠImplementation Ġof Ġa Ġvault Ġto Ġdeposit Ġfunds Ġfor Ġyield Ġoptim izing .\ n Ġ* ĠThis Ġis Ġthe Ġcontract Ġthat Ġreceives Ġfunds Ġand Ġthat Ġusers Ġinterface Ġwith .\ n Ġ* ĠThe Ġyield Ġoptim izing Ġstrategy Ġitself Ġis Ġimplemented Ġin Ġa Ġseparate Ġ' Strategy . sol ' Ġcontract .\ n Ġ*/ \ n contract ĠB ee fy Vault V 6 Ġis ĠERC 2 0 , ĠOwn able , ĠRe entr ancy Guard Ġ{\ n ĠĠĠ Ġusing ĠSafe ERC 2 0 Ġfor ĠI ERC 2 0 ;\ n ĠĠĠ Ġusing ĠSafe Math Ġfor Ġuint 2 5 6 ;\ n \ n ĠĠĠ Ġstruct ĠStr at Candidate Ġ{\ n ĠĠĠĠĠĠĠ Ġaddress Ġimplementation ;\ n ĠĠĠĠĠĠĠ Ġuint Ġproposed Time ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ// ĠThe Ġlast Ġproposed Ġstrategy Ġto Ġswitch Ġto .\ n ĠĠĠ ĠStr at Candidate Ġpublic Ġstrat Candidate ;\ n ĠĠĠ Ġ// ĠThe Ġstrategy Ġcurrently Ġin Ġuse Ġby Ġthe Ġvault .\ n ĠĠĠ ĠI Strategy Ġpublic Ġstrategy ;\ n ĠĠĠ Ġ// ĠThe Ġminimum Ġtime Ġit Ġhas Ġto Ġpass Ġbefore Ġa Ġstrat Ġcandidate Ġcan Ġbe Ġapproved .\ n ĠĠĠ Ġuint 2 5 6 Ġpublic Ġimmutable Ġapproval Delay ;\ n \ n ĠĠĠ Ġevent ĠNew Str at Candidate ( address Ġimplementation );\ n ĠĠĠ Ġevent ĠUpgrade Str at ( address Ġimplementation );\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSets Ġthe Ġvalue Ġof Ġ{ token } Ġto Ġthe Ġtoken Ġthat Ġthe Ġvault Ġwill \ n ĠĠĠĠ Ġ* Ġhold Ġas Ġunderlying Ġvalue . ĠIt Ġinitializes Ġthe Ġvault 's Ġown Ġ' m oo ' Ġtoken .\ n ĠĠĠĠ Ġ* ĠThis Ġtoken Ġis Ġmint ed Ġwhen Ġsomeone Ġdoes Ġa Ġdeposit . ĠIt Ġis Ġburn ed Ġin Ġorder \ n ĠĠĠĠ Ġ* Ġto Ġwithdraw Ġthe Ġcorresponding Ġportion Ġof Ġthe Ġunderlying Ġassets .\ n ĠĠĠĠ Ġ* Ġ@ param Ġ_ strategy Ġthe Ġaddress Ġof Ġthe Ġstrategy .\ n ĠĠĠĠ Ġ* Ġ@ param Ġ_ name Ġthe Ġname Ġof Ġthe Ġvault Ġtoken .\ n ĠĠĠĠ Ġ* Ġ@ param Ġ_ symbol Ġthe Ġsymbol Ġof Ġthe Ġvault Ġtoken .\ n ĠĠĠĠ Ġ* Ġ@ param Ġ_ approval Delay Ġthe Ġdelay Ġbefore Ġa Ġnew Ġstrat Ġcan Ġbe Ġapproved .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġconstructor Ġ(\ n ĠĠĠĠĠĠĠ ĠI Strategy Ġ_ strategy ,\ n ĠĠĠĠĠĠĠ Ġstring Ġmemory Ġ_ name ,\ n ĠĠĠĠĠĠĠ Ġstring Ġmemory Ġ_ symbol ,\ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġ_ approval Delay \ n ĠĠĠ Ġ) ĠERC 2 0 (\ n ĠĠĠĠĠĠĠ Ġ_ name ,\ n ĠĠĠĠĠĠĠ Ġ_ symbol \ n ĠĠĠ Ġ) Ġ{\ n ĠĠĠĠĠĠĠ Ġstrategy Ġ= Ġ_ strategy ;\ n ĠĠĠĠĠĠĠ Ġapproval Delay Ġ= Ġ_ approval Delay ;\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġfunction Ġwant () Ġpublic Ġview Ġreturns Ġ( I ERC 2 0 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn ĠI ERC 2 0 ( strategy . want ()); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠIt Ġcalculates Ġthe Ġtotal Ġunderlying Ġvalue Ġof Ġ{ token } Ġheld Ġby Ġthe Ġsystem .\ n ĠĠĠĠ Ġ* ĠIt Ġtakes Ġinto Ġaccount Ġthe Ġvault Ġcontract Ġbalance , Ġthe Ġstrategy Ġcontract Ġbalance \ n ĠĠĠĠ Ġ* Ġ Ġand Ġthe Ġbalance Ġdeployed Ġin Ġother Ġcontracts Ġas Ġpart Ġof Ġthe Ġstrategy .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġbalance () Ġpublic Ġview Ġreturns Ġ( uint ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġwant (). balanceOf ( address ( this )). add ( IS tr ategy ( strategy ). balanceOf ()); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠCustom Ġlogic Ġin Ġhere Ġfor Ġhow Ġmuch Ġthe Ġvault Ġallows Ġto Ġbe Ġborrow ed .\ n ĠĠĠĠ Ġ* ĠWe Ġreturn Ġ 1 0 0 % Ġof Ġtokens Ġfor Ġnow . ĠUnder Ġcertain Ġconditions Ġwe Ġmight \ n ĠĠĠĠ Ġ* Ġwant Ġto Ġkeep Ġsome Ġof Ġthe Ġsystem Ġfunds Ġat Ġhand Ġin Ġthe Ġvault , Ġinstead \ n ĠĠĠĠ Ġ* Ġof Ġputting Ġthem Ġto Ġwork .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġavailable () Ġpublic Ġview Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġwant (). balanceOf ( address ( this )); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠFunction Ġfor Ġvarious ĠU Is Ġto Ġdisplay Ġthe Ġcurrent Ġvalue Ġof Ġone Ġof Ġour Ġyield Ġtokens .\ n ĠĠĠĠ Ġ* ĠReturns Ġan Ġuint 2 5 6 Ġwith Ġ 1 8 Ġdecimals Ġof Ġhow Ġmuch Ġunderlying Ġasset Ġone Ġvault Ġshare Ġrepresents .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġget Price Per Full Share () Ġpublic Ġview Ġreturns Ġ( uint 2 5 6 ) Ġ{\ n ĠĠĠĠĠĠĠ Ġreturn Ġtotal Supply () Ġ== Ġ 0 Ġ? Ġ 1 e 1 8 Ġ: Ġbalance (). mul ( 1 e 1 8 ). div ( total Supply ()); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠA Ġhelper Ġfunction Ġto Ġcall Ġdeposit () Ġwith Ġall Ġthe Ġsender 's Ġfunds .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġdeposit All () Ġexternal Ġ{\ n ĠĠĠĠĠĠĠ Ġdeposit ( want (). balanceOf ( msg . sender )); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠThe Ġentry point Ġof Ġfunds Ġinto Ġthe Ġsystem . ĠPeople Ġdeposit Ġwith Ġthis Ġfunction \ n ĠĠĠĠ Ġ* Ġinto Ġthe Ġvault . ĠThe Ġvault Ġis Ġthen Ġin Ġcharge Ġof Ġsending Ġfunds Ġinto Ġthe Ġstrategy .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġdeposit ( uint Ġ_ amount ) Ġpublic Ġnon Re entrant Ġ{\ n ĠĠĠĠĠĠĠ Ġstrategy . before Deposit (); \ n \ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġ_ pool Ġ= Ġbalance (); \ n ĠĠĠĠĠĠĠ Ġwant (). safe Transfer From ( msg . sender , Ġaddress ( this ), Ġ_ amount );\ n ĠĠĠĠĠĠĠ Ġe arn (); \ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġ_ after Ġ= Ġbalance (); \ n ĠĠĠĠĠĠĠ Ġ_ amount Ġ= Ġ_ after . sub (_ pool ); Ġ// ĠAdditional Ġcheck Ġfor Ġdef lation ary Ġtokens \ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġshares Ġ= Ġ 0 ;\ n ĠĠĠĠĠĠĠ Ġif Ġ( total Supply () Ġ== Ġ 0 ) Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġshares Ġ= Ġ_ amount ;\ n ĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġshares Ġ= Ġ(_ amount . mul ( total Supply ())). div (_ pool );\ n ĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠĠĠĠĠ Ġ_ mint ( msg . sender , Ġshares );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠFunction Ġto Ġsend Ġfunds Ġinto Ġthe Ġstrategy Ġand Ġput Ġthem Ġto Ġwork . ĠIt 's Ġprimarily Ġcalled \ n ĠĠĠĠ Ġ* Ġby Ġthe Ġvault 's Ġdeposit () Ġfunction .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġe arn () Ġpublic Ġ{\ n ĠĠĠĠĠĠĠ Ġuint Ġ_ bal Ġ= Ġavailable (); \ n ĠĠĠĠĠĠĠ Ġwant (). safe Transfer ( address ( strategy ), Ġ_ bal );\ n ĠĠĠĠĠĠĠ Ġstrategy . deposit (); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠA Ġhelper Ġfunction Ġto Ġcall Ġwithdraw () Ġwith Ġall Ġthe Ġsender 's Ġfunds .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġwithdraw All () Ġexternal Ġ{\ n ĠĠĠĠĠĠĠ Ġwithdraw ( balanceOf ( msg . sender )); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠFunction Ġto Ġexit Ġthe Ġsystem . ĠThe Ġvault Ġwill Ġwithdraw Ġthe Ġrequired Ġtokens \ n ĠĠĠĠ Ġ* Ġfrom Ġthe Ġstrategy Ġand Ġpay Ġup Ġthe Ġtoken Ġholder . ĠA Ġpro portional Ġnumber Ġof ĠIO U \ n ĠĠĠĠ Ġ* Ġtokens Ġare Ġburn ed Ġin Ġthe Ġprocess .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġwithdraw ( uint 2 5 6 Ġ_ shares ) Ġpublic Ġ{\ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġr Ġ= Ġ( balance (). mul (_ shares )). div ( total Supply ()); \ n ĠĠĠĠĠĠĠ Ġ_ burn ( msg . sender , Ġ_ shares );\ n \ n ĠĠĠĠĠĠĠ Ġuint Ġb Ġ= Ġwant (). balanceOf ( address ( this )); \ n ĠĠĠĠĠĠĠ Ġif Ġ( b Ġ< Ġr ) Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġuint Ġ_ withdraw Ġ= Ġr . sub ( b );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġstrategy . withdraw (_ withdraw );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġuint Ġ_ after Ġ= Ġwant (). balanceOf ( address ( this )); \ n ĠĠĠĠĠĠĠĠĠĠĠ Ġuint Ġ_ diff Ġ= Ġ_ after . sub ( b );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ(_ diff Ġ< Ġ_ withdraw ) Ġ{\ n ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġr Ġ= Ġb . add (_ diff );\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġ}\ n ĠĠĠĠĠĠĠ Ġ}\ n \ n ĠĠĠĠĠĠĠ Ġwant (). safe Transfer ( msg . sender , Ġr );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠSets Ġthe Ġcandidate Ġfor Ġthe Ġnew Ġstrat Ġto Ġuse Ġwith Ġthis Ġvault .\ n ĠĠĠĠ Ġ* Ġ@ param Ġ_ implementation ĠThe Ġaddress Ġof Ġthe Ġcandidate Ġstrategy .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġpropose Str at ( address Ġ_ implementation ) Ġpublic Ġonly Owner Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( address ( this ) Ġ== ĠI Strategy (_ implementation ). vault (), Ġ\" Proposal Ġnot Ġvalid Ġfor Ġthis ĠVault \ "); \ n ĠĠĠĠĠĠĠ Ġstrat Candidate Ġ= ĠStr at Candidate ({\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġimplementation : Ġ_ implementation ,\ n ĠĠĠĠĠĠĠĠĠĠĠ Ġproposed Time : Ġblock . timestamp \ n ĠĠĠĠĠĠĠĠ Ġ}); \ n \ n ĠĠĠĠĠĠĠ Ġemit ĠNew Str at Candidate (_ implementation );\ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠIt Ġswitches Ġthe Ġactive Ġstrat Ġfor Ġthe Ġstrat Ġcandidate . ĠAfter Ġupgrading , Ġthe \ n ĠĠĠĠ Ġ* Ġcandidate Ġimplementation Ġis Ġset Ġto Ġthe Ġ 0 x 0 0 Ġaddress , Ġand Ġproposed Time Ġto Ġa Ġtime \ n ĠĠĠĠ Ġ* Ġhappening Ġin Ġ+ 1 0 0 Ġyears Ġfor Ġsafety .\ n ĠĠĠĠ Ġ*/ \ n \ n ĠĠĠ Ġfunction Ġupgrade Str at () Ġpublic Ġonly Owner Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire ( strat Candidate . implementation Ġ!= Ġaddress ( 0 ), Ġ\" There Ġis Ġno Ġcandidate \ "); \ n ĠĠĠĠĠĠĠ Ġrequire ( strat Candidate . pro posed Time . add ( approval Delay ) Ġ< Ġblock . timestamp , Ġ\" Delay Ġhas Ġnot Ġpassed \ "); \ n \ n ĠĠĠĠĠĠĠ Ġemit ĠUpgrade Str at ( strat Candidate . implementation );\ n \ n ĠĠĠĠĠĠĠ Ġstrategy . ret ire Str at (); \ n ĠĠĠĠĠĠĠ Ġstrategy Ġ= ĠI Strategy ( strat Candidate . implementation );\ n ĠĠĠĠĠĠĠ Ġstrat Candidate . implementation Ġ= Ġaddress ( 0 );\ n ĠĠĠĠĠĠĠ Ġstrat Candidate . pro posed Time Ġ= Ġ 5 0 0 0 0 0 0 0 0 0 ;\ n \ n ĠĠĠĠĠĠĠ Ġe arn (); \ n ĠĠĠ Ġ}\ n \ n ĠĠĠ Ġ/** \ n ĠĠĠĠ Ġ* Ġ@ dev ĠRes c ues Ġrandom Ġfunds Ġstuck Ġthat Ġthe Ġstrat Ġcan 't Ġhandle .\ n ĠĠĠĠ Ġ* Ġ@ param Ġ_ token Ġaddress Ġof Ġthe Ġtoken Ġto Ġrescue .\ n ĠĠĠĠ Ġ*/ \ n ĠĠĠ Ġfunction Ġin Case Tokens Get St uck ( address Ġ_ token ) Ġexternal Ġonly Owner Ġ{\ n ĠĠĠĠĠĠĠ Ġrequire (_ token Ġ!= Ġaddress ( want ()), Ġ\" ! token \ "); \ n \ n ĠĠĠĠĠĠĠ Ġuint 2 5 6 Ġamount Ġ= ĠI ERC 2 0 (_ token ). balanceOf ( address ( this )); \ n ĠĠĠĠĠĠĠ ĠI ERC 2 0 (_ token ). safe Transfer ( msg . sender , Ġamount );\ n ĠĠĠ Ġ}\ n }\ n "," ke cc ak 2 5 6 ":" 0 x 8 9 1 a 5 5 8 3 2 d 8 d 3 9 ac 4 4 eea 8 a 7 7 d 8 2 9 5 4 c 3 7 1 dd 5 8 8 da 7 e 9 5 7 1 2 0 1 6 c 3 3 0 fd 8 b 4 0 0 6 "," license ":" MIT "} }," version ": 1 } Ċ """. trim Indent () Ċ Ċ val ĠtestData Large Optimizer Runs Value =" "" ĊĠĠĠĠĠĠĠ Ġ{" compiler ":{" version ":" 0 . 6 . 1 2 + commit . 2 7 d 5 1 7 6 5 "}," language ":" Solid ity "," output ":{" abi ":[{" inputs ":[ ]," state Mut ability ":" non pay able "," type ":" constructor "},{" inputs ":[{" internal Type ":" address "," name ":""," type ":" address "}], " name ":" allowed "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ member "," type ":" address "}], " name ":" approve Address "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address [] "," name ":" _ members "," type ":" address [] "}], " name ":" bulk Approve "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address [] "," name ":" _ members "," type ":" address [] "}], " name ":" bulk Remove "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ new Owner "," type ":" address "}], " name ":" change Owner "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ router "," type ":" address "},{" internal Type ":" address "," name ":" _ pair "," type ":" address "},{" internal Type ":" address [] "," name ":" _ path "," type ":" address [] "},{" internal Type ":" uint 2 5 6 "," name ":" _ amount "," type ":" uint 2 5 6 "},{" internal Type ":" uint 2 5 6 "," name ":" _ amount Min "," type ":" uint 2 5 6 "},{" internal Type ":" address "," name ":" _ to "," type ":" address "}], " name ":" direct Swap Buy And Sell "," outputs ":[{" internal Type ":" bool "," name ":" success "," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ router "," type ":" address "},{" internal Type ":" address "," name ":" _ pair "," type ":" address "},{" internal Type ":" address [] "," name ":" _ path "," type ":" address [] "},{" internal Type ":" uint 2 5 6 "," name ":" _ amount Min "," type ":" uint 2 5 6 "},{" internal Type ":" address "," name ":" _ to "," type ":" address "}], " name ":" direct Swap Buy Only "," outputs ":[{" internal Type ":" bool "," name ":" success "," type ":" bool "}], " state Mut ability ":" pay able "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ factory "," type ":" address "},{" internal Type ":" bytes 3 2 "," name ":" _ INIT _ CODE _ PAIR _ HASH "," type ":" bytes 3 2 "},{" internal Type ":" address "," name ":" _ token A "," type ":" address "},{" internal Type ":" address "," name ":" _ token B "," type ":" address "}], " name ":" get Pair "," outputs ":[{" internal Type ":" address "," name ":" pair add "," type ":" address "}], " state Mut ability ":" pure "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ member "," type ":" address "}], " name ":" is Allowed "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" view "," type ":" function "},{" inputs ":[{" internal Type ":" address "," name ":" _ member "," type ":" address "}], " name ":" remove Address "," outputs ":[{" internal Type ":" bool "," name ":""," type ":" bool "}], " state Mut ability ":" non pay able "," type ":" function "},{" inputs ":[ ]," name ":" withdraw "," outputs ":[ ]," state Mut ability ":" non pay able "," type ":" function "},{" state Mut ability ":" pay able "," type ":" receive "}], " dev doc ":{" kind ":" dev "," methods ": {}, " version ": 1 }," user doc ":{" kind ":" user "," methods ": {}, " version ": 1 }}, " settings ":{" compilation Target ":{" contracts / sn iper _ contract _ buy . sol ":" Contract Bot "}," e vm Version ":" istan bul "," libraries ": {}, " metadata ":{" byte code Hash ":" ipfs "}," optimizer ":{" enabled ": true ," runs ": 3 9 9 9 9 9 9 9 9 9 }," rem appings ": [] }," sources ":{" contracts / sn iper _ contract _ buy . sol ":{" ke cc ak 2 5 6 ":" 0 xa 0 ed 7 b 6 b 5 9 d 5 2 3 e 1 d 4 7 1 3 3 4 1 0 7 ce 8 9 1 e 1 8 bc 6 c 0 4 9 3 f 5 7 9 be 1 c 5 1 3 9 fe 6 4 c 4 4 e 7 6 "," license ":" MIT "," urls ":[" b zz - raw :// d 5 9 4 e 2 1 1 d 4 8 6 6 4 6 7 4 d 3 b 7 9 b 6 7 ccd 6 1 6 2 a 9 7 1 2 2 c 5 e 0 6 6 8 1 9 8 bb ddc 9 7 6 0 2 4 d 2 5 a 6 "," d web :/ ipfs / Q mf BG t 1 UX G or TV 9 Uo X Md 1 W Se Po V 6 gin rm Q NR 8 Px YE y Ad WA "] }}, " version ": 1 } ĊĠĠ Ġ""" Ċ