diff --git a/404.html b/404.html index ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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-BwP8mGg_.js b/assets/index-mQp8j2HZ.js similarity index 97% rename from assets/index-BwP8mGg_.js rename to assets/index-mQp8j2HZ.js index 32c8a05e8..e5c129dfa 100644 --- a/assets/index-BwP8mGg_.js +++ b/assets/index-mQp8j2HZ.js @@ -6,7 +6,7 @@ function Ag(s,a){for(var n=0;n>>1,$=V[T];if(0>>1;Tp(Sp,v))ka<$&&0>p(hl,Sp)?(V[T]=hl,V[ka]=v,T=ka):(V[T]=Sp,V[wa]=v,T=wa);else if(ka<$&&0>p(hl,v))V[T]=hl,V[ka]=v,T=ka;else break s}}return X}function p(V,X){var v=V.sortIndex-X.sortIndex;return v!==0?v:V.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var e=performance;s.unstable_now=function(){return e.now()}}else{var c=Date,t=c.now();s.unstable_now=function(){return c.now()-t}}var o=[],r=[],I=1,d=null,j=3,u=!1,m=!1,b=!1,G=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(V){for(var X=n(r);X!==null;){if(X.callback===null)l(r);else if(X.startTime<=V)l(r),X.sortIndex=X.expirationTime,a(o,X);else break;X=n(r)}}function y(V){if(b=!1,C(V),!m)if(n(o)!==null)m=!0,Kp(Z);else{var X=n(r);X!==null&&Mp(y,X.startTime-V)}}function Z(V,X){m=!1,b&&(b=!1,h(Y),Y=-1),u=!0;var v=j;try{for(C(X),d=n(o);d!==null&&(!(d.expirationTime>X)||V&&!Xs());){var T=d.callback;if(typeof T=="function"){d.callback=null,j=d.priorityLevel;var $=T(d.expirationTime<=X);X=s.unstable_now(),typeof $=="function"?d.callback=$:d===n(o)&&l(o),C(X)}else l(o);d=n(o)}if(d!==null)var gl=!0;else{var wa=n(r);wa!==null&&Mp(y,wa.startTime-X),gl=!1}return gl}finally{d=null,j=v,u=!1}}var k=!1,B=null,Y=-1,x=5,N=-1;function Xs(){return!(s.unstable_now()-NV||125T?(V.sortIndex=v,a(r,V),n(o)===null&&V===n(r)&&(b?(h(Y),Y=-1):b=!0,Mp(y,v-T))):(V.sortIndex=$,a(o,V),m||u||(m=!0,Kp(Z))),V},s.unstable_shouldYield=Xs,s.unstable_wrapCallback=function(V){var X=j;return function(){var v=j;j=X;try{return V.apply(this,arguments)}finally{j=v}}}})($o);Po.exports=$o;var xg=Po.exports;/** + */(function(s){function a(V,X){var v=V.length;V.push(X);s:for(;0>>1,$=V[T];if(0>>1;Tp(Sp,v))ka<$&&0>p(hl,Sp)?(V[T]=hl,V[ka]=v,T=ka):(V[T]=Sp,V[wa]=v,T=wa);else if(ka<$&&0>p(hl,v))V[T]=hl,V[ka]=v,T=ka;else break s}}return X}function p(V,X){var v=V.sortIndex-X.sortIndex;return v!==0?v:V.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var e=performance;s.unstable_now=function(){return e.now()}}else{var c=Date,t=c.now();s.unstable_now=function(){return c.now()-t}}var o=[],r=[],I=1,d=null,j=3,u=!1,m=!1,b=!1,B=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(V){for(var X=n(r);X!==null;){if(X.callback===null)l(r);else if(X.startTime<=V)l(r),X.sortIndex=X.expirationTime,a(o,X);else break;X=n(r)}}function y(V){if(b=!1,C(V),!m)if(n(o)!==null)m=!0,Kp(Z);else{var X=n(r);X!==null&&Mp(y,X.startTime-V)}}function Z(V,X){m=!1,b&&(b=!1,h(Y),Y=-1),u=!0;var v=j;try{for(C(X),d=n(o);d!==null&&(!(d.expirationTime>X)||V&&!Xs());){var T=d.callback;if(typeof T=="function"){d.callback=null,j=d.priorityLevel;var $=T(d.expirationTime<=X);X=s.unstable_now(),typeof $=="function"?d.callback=$:d===n(o)&&l(o),C(X)}else l(o);d=n(o)}if(d!==null)var gl=!0;else{var wa=n(r);wa!==null&&Mp(y,wa.startTime-X),gl=!1}return gl}finally{d=null,j=v,u=!1}}var k=!1,G=null,Y=-1,x=5,N=-1;function Xs(){return!(s.unstable_now()-NV||125T?(V.sortIndex=v,a(r,V),n(o)===null&&V===n(r)&&(b?(h(Y),Y=-1):b=!0,Mp(y,v-T))):(V.sortIndex=$,a(o,V),m||u||(m=!0,Kp(Z))),V},s.unstable_shouldYield=Xs,s.unstable_wrapCallback=function(V){var X=j;return function(){var v=j;j=X;try{return V.apply(this,arguments)}finally{j=v}}}})($o);Po.exports=$o;var xg=Po.exports;/** * @license React * react-dom.production.min.js * @@ -34,10 +34,10 @@ 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 _g(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=_g(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 vn={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},Lg=["Webkit","ms","Moz","O"];Object.keys(vn).forEach(function(s){Lg.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),vn[a]=vn[s]})});function rr(s,a,n){return a==null||typeof a=="boolean"||a===""?"":n||typeof a!="number"||a===0||vn.hasOwnProperty(s)&&vn[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 Ll(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-Fs(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 vr(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 Rr(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 Rr(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&&vr(s,a)?(s=Yr(),Fl=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 Kr(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?Kr(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 vc(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&&Kr(n.ownerDocument.documentElement,n)){if(l!==null&&vc(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=Ft(n,e);var c=Ft(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,Fn=null,He=!1;function Kt(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&&vc(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}),Fn&&_n(Fn,l)||(Fn=l,l=$l(Ne,"onSelect"),0Ua||(s.current=Je[Ua],Je[Ua]=null,Ua--)}function K(s,a){Ua++,Je[Ua]=s.current,s.current=a}var ua={},os=ma(ua),Cs=ma(!1),va=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));K(os,a),K(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,va=os.current,K(os,s),K(Cs,Cs.current),!0}function Qt(s,a,n){var l=s.stateNode;if(!l)throw Error(w(169));n?(s=Ur(s,a,va),l.__reactInternalMemoizedMergedChildContext=s,S(Cs),S(os),K(os,s)):S(Cs),K(Cs,n)}var Qs=null,kp=!1,le=!1;function _r(s){Qs===null?Qs=[s]:Qs.push(s)}function iI(s){kp=!0,_r(s)}function ba(){if(!le&&Qs!==null){le=!0;var s=0,a=F;try{var n=Qs;for(F=1;s>=c,p-=c,Ts=1<<32-Fs(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&&_t(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,Fc=null;function Kc(){Fc=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,Fc=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(Fc!==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,Ps(s,l)}function Ps(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,Ps(s,n)}return p=l.interleaved,p===null?(a.next=a,Sc(l)):(a.next=p.next,p.next=a),l.interleaved=a,Ps(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 Lt(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,r=o.next;o.next=null,c===null?e=r:c.next=r,c=o;var I=s.alternate;I!==null&&(I=I.updateQueue,t=I.lastBaseUpdate,t!==c&&(t===null?I.firstBaseUpdate=r:t.next=r,I.lastBaseUpdate=o))}if(e!==null){var d=p.baseState;c=0,I=r=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?(r=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=r,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{F=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();Ks(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(),Ks(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){Kn=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:_c,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=Ts;n=(l&~(1<<32-Fs(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 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 _g(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=_g(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 vn={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},Lg=["Webkit","ms","Moz","O"];Object.keys(vn).forEach(function(s){Lg.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),vn[a]=vn[s]})});function rr(s,a,n){return a==null||typeof a=="boolean"||a===""?"":n||typeof a!="number"||a===0||vn.hasOwnProperty(s)&&vn[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 Be(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 Ge=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 Ll(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-Fs(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 vr(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 Rr(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 Rr(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&&vr(s,a)?(s=Yr(),Fl=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 Kr(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?Kr(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 vc(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&&Kr(n.ownerDocument.documentElement,n)){if(l!==null&&vc(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=Ft(n,e);var c=Ft(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,Fn=null,He=!1;function Kt(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&&vc(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}),Fn&&_n(Fn,l)||(Fn=l,l=$l(Ne,"onSelect"),0Ua||(s.current=Je[Ua],Je[Ua]=null,Ua--)}function K(s,a){Ua++,Je[Ua]=s.current,s.current=a}var ua={},os=ma(ua),Cs=ma(!1),va=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));K(os,a),K(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,va=os.current,K(os,s),K(Cs,Cs.current),!0}function Qt(s,a,n){var l=s.stateNode;if(!l)throw Error(w(169));n?(s=Ur(s,a,va),l.__reactInternalMemoizedMergedChildContext=s,S(Cs),S(os),K(os,s)):S(Cs),K(Cs,n)}var Qs=null,kp=!1,le=!1;function _r(s){Qs===null?Qs=[s]:Qs.push(s)}function iI(s){kp=!0,_r(s)}function ba(){if(!le&&Qs!==null){le=!0;var s=0,a=F;try{var n=Qs;for(F=1;s>=c,p-=c,Ts=1<<32-Fs(a)+p|n<Y?(x=G,G=null):x=G.sibling;var N=j(h,G,C[Y],y);if(N===null){G===null&&(G=x);break}s&&G&&N.alternate===null&&a(h,G),g=e(N,g,Y),k===null?Z=N:k.sibling=N,k=N,G=x}if(Y===C.length)return n(h,G),J&&Za(h,Y),Z;if(G===null){for(;YY?(x=G,G=null):x=G.sibling;var Xs=j(h,G,N.value,y);if(Xs===null){G===null&&(G=x);break}s&&G&&Xs.alternate===null&&a(h,G),g=e(Xs,g,Y),k===null?Z=Xs:k.sibling=Xs,k=Xs,G=x}if(N.done)return n(h,G),J&&Za(h,Y),Z;if(G===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(G=l(h,G);!N.done;Y++,N=C.next())N=u(G,h,Y,N.value,y),N!==null&&(s&&N.alternate!==null&&G.delete(N.key===null?Y:N.key),g=e(N,g,Y),k===null?Z=N:k.sibling=N,k=N);return s&&G.forEach(function(un){return a(h,un)}),J&&Za(h,Y),Z}function B(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&&_t(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,B(h,g,k(C._payload),y)}if(Vn(C))return m(h,g,C,y);if(mn(C))return b(h,g,C,y);Bl(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 B}var on=$r(!0),qr=$r(!1),pp=ma(null),ep=null,Oa=null,Fc=null;function Kc(){Fc=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,Fc=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(Fc!==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 Ga=null;function Sc(s){Ga===null?Ga=[s]:Ga.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,Ps(s,l)}function Ps(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,Ps(s,n)}return p=l.interleaved,p===null?(a.next=a,Sc(l)):(a.next=p.next,p.next=a),l.interleaved=a,Ps(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 Lt(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,r=o.next;o.next=null,c===null?e=r:c.next=r,c=o;var I=s.alternate;I!==null&&(I=I.updateQueue,t=I.lastBaseUpdate,t!==c&&(t===null?I.firstBaseUpdate=r:t.next=r,I.lastBaseUpdate=o))}if(e!==null){var d=p.baseState;c=0,I=r=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?(r=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=r,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{F=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();Ks(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(),Ks(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){Kn=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:_c,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=Ts;n=(l&~(1<<32-Fs(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,K(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(Fe=Ol,s=Mr(),vc(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,r=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&&++r===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(Ke={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:Rs(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 sa(s,a,n){for(n=n.child;n!==null;)Fi(s,a,n),n=n.sibling}function Fi(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,sa(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,sa(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)}sa(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)}sa(s,a,n);break;case 21:sa(s,a,n);break;case 22:n.mode&1?(ts=(l=ts)||n.memoizedState!==null,sa(s,a,n),ts=l):sa(s,a,n);break;default:sa(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 vs(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=Ps(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&&Lr(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=Le(null,a,l,!0,e,n)):(a.tag=0,J&&e&&Rc(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=KI(l),s=Rs(l,s),p){case 0:a=_e(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,Rs(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:Rs(l,p),_e(s,a,l,p,n);case 1:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:Rs(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=$s(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:Rs(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,K(pp,l._currentValue),l._currentValue=c,e!==null)if(Ms(e.value,c)){if(e.children===p.children&&!Cs.current){a=$s(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 r=e.updateQueue;if(r!==null){r=r.shared;var I=r.pending;I===null?o.next=o:(o.next=I.next,I.next=o),r.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=Rs(l,a.pendingProps),p=Rs(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:Rs(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),Le(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 FI(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 FI(s,a,n,l)}function nt(s){return s=s.prototype,!(!s||!s.isReactComponent)}function KI(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 r=t.width>=500;{const I=localStorage.getItem("sideNav");I&&(r=I=="true")}l(o),n(I=>({...I,theme:o,sideNav:r}))}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 i.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 Ue(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),Ue(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(){Ue(s,a)}}var e=s.stateNode;return e!==null&&typeof e.componentDidCatch=="function"&&(n.callback=function(){Ue(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=RI.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=qs.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,$s(s,a,p)):(J&&n&&Rc(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:_n,n(c,l)&&s.ref===a.ref)return $s(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(_n(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,$s(s,a,p)}return _e(s,a,n,l,p)}function Bi(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},K($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,K($a,ys),ys|=s,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=e!==null?e.baseLanes:n,K($a,ys),ys|=l}else e!==null?(l=e.baseLanes|n,a.memoizedState=null):l=n,K($a,ys),ys|=l;return rs(s,a,p,n),a.child}function Gi(s,a){var n=a.ref;(s===null&&n!==null||s!==null&&s.ref!==n)&&(a.flags|=512,a.flags|=2097152)}function _e(s,a,n,l,p){var e=js(n)?va: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,$s(s,a,p)):(J&&l&&Rc(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,r=n.contextType;typeof r=="object"&&r!==null?r=Vs(r):(r=js(n)?va:os.current,r=cn(a,r));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!==r)&&so(a,c,l,r),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,r))?(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=r,l=t):(typeof c.componentDidMount=="function"&&(a.flags|=4194308),l=!1)}else{c=a.stateNode,ai(s,a),t=a.memoizedProps,r=a.type===a.elementType?t:Rs(a.type,t),c.props=r,d=a.pendingProps,j=c.context,o=n.contextType,typeof o=="object"&&o!==null?o=Vs(o):(o=js(n)?va: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),(r=la||qt(a,n,r,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=r):(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 Le(s,a,n,l,e,p)}function Le(s,a,n,l,p,e){Gi(s,a);var c=(a.flags&128)!==0;if(!l&&!c)return p&&Qt(a,n,!1),$s(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),K(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):Lc(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 Lc(s,a){return a=fp({mode:"visible",children:a},s.mode,0,null),a.return=s,s.child=a}function Gl(s,a,n,l){return l!==null&&Hc(l),on(a,s.child,null,n),s=Lc(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))),Gl(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 Gl(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),Gl(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,Ps(s,p),Ks(l,s,p,-1))}return at(),l=oe(Error(w(421))),Gl(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[Bs++]=Ts,Ws[Bs++]=Us,Ws[Bs++]=Ra,Ts=s.id,Us=s.overflow,Ra=a),a=Lc(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(K(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 $s(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;K(pp,l._currentValue),l._currentValue=p;break;case 13:if(l=a.memoizedState,l!==null)return l.dehydrated!==null?(K(z,z.current&1),a.flags|=128,null):n&a.child.childLanes?Vi(s,a,n):(K(z,z.current&1),s=$s(s,a,n),s!==null?s.sibling:null);K(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),K(z,z.current),l)break;return null;case 22:case 23:return a.lanes=0,Bi(s,a,n)}return $s(s,a,n)}var Xi,$e,vi,Ri;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(){};vi=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(r in p)if(!l.hasOwnProperty(r)&&p.hasOwnProperty(r)&&p[r]!=null)if(r==="style"){var t=p[r];for(c in t)t.hasOwnProperty(c)&&(n||(n={}),n[c]="")}else r!=="dangerouslySetInnerHTML"&&r!=="children"&&r!=="suppressContentEditableWarning"&&r!=="suppressHydrationWarning"&&r!=="autoFocus"&&(Jn.hasOwnProperty(r)?e||(e=[]):(e=e||[]).push(r,null));for(r in l){var o=l[r];if(t=p!=null?p[r]:void 0,l.hasOwnProperty(r)&&o!==t&&(o!=null||t!=null))if(r==="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(r,n)),n=o;else r==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,t=t?t.__html:void 0,o!=null&&t!==o&&(e=e||[]).push(r,o)):r==="children"?typeof o!="string"&&typeof o!="number"||(e=e||[]).push(r,""+o):r!=="suppressContentEditableWarning"&&r!=="suppressHydrationWarning"&&(Jn.hasOwnProperty(r)?(o!=null&&r==="onScroll"&&M("scroll",s),e||t===o||(e=[])):(e=e||[]).push(r,o))}n&&(e=e||[]).push("style",n);var r=e;(a.updateQueue=r)&&(a.flags|=4)}};Ri=function(s,a,n,l){n!==l&&(a.flags|=4)};function Bn(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)vi(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=Be(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,Bn(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),Bn(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,Bn(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,K(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 BI(s,a){if(Fe=Ol,s=Mr(),vc(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,r=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&&++r===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(Ke={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,B=m.memoizedState,h=a.stateNode,g=h.getSnapshotBeforeUpdate(a.elementType===a.type?b:Rs(a.type,b),B);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 Bp(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 sa(s,a,n){for(n=n.child;n!==null;)Fi(s,a,n),n=n.sibling}function Fi(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,sa(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,sa(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)}sa(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)}sa(s,a,n);break;case 21:sa(s,a,n);break;case 22:n.mode&1?(ts=(l=ts)||n.memoizedState!==null,sa(s,a,n),ts=l):sa(s,a,n);break;default:sa(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 vs(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=Ps(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&&Lr(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=Le(null,a,l,!0,e,n)):(a.tag=0,J&&e&&Rc(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=KI(l),s=Rs(l,s),p){case 0:a=_e(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,Rs(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:Rs(l,p),_e(s,a,l,p,n);case 1:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:Rs(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=$s(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),Gi(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:Rs(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,K(pp,l._currentValue),l._currentValue=c,e!==null)if(Ms(e.value,c)){if(e.children===p.children&&!Cs.current){a=$s(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 r=e.updateQueue;if(r!==null){r=r.shared;var I=r.pending;I===null?o.next=o:(o.next=I.next,I.next=o),r.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=Rs(l,a.pendingProps),p=Rs(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:Rs(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),Le(null,a,l,!0,s,n);case 19:return Yi(s,a,n);case 22:return Bi(s,a,n)}throw Error(w(156,a.tag))};function Ti(s,a){return yr(s,a)}function FI(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 Gs(s,a,n,l){return new FI(s,a,n,l)}function nt(s){return s=s.prototype,!(!s||!s.isReactComponent)}function KI(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=Gs(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=Gs(12,n,a,p|2),s.elementType=je,s.lanes=e,s;case Ae:return s=Gs(13,n,a,p),s.elementType=Ae,s.lanes=e,s;case ue:return s=Gs(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=Gs(c,n,a,p),a.elementType=s,a.type=l,a.lanes=e,a}function Ya(s,a,n,l){return s=Gs(7,s,l,a),s.lanes=n,s}function fp(s,a,n,l){return s=Gs(22,s,l,a),s.elementType=nr,s.lanes=n,s.stateNode={isHidden:!1},s}function ie(s,a,n){return s=Gs(6,s,null,a),s.lanes=n,s}function ge(s,a,n){return a=Gs(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=Gs(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 r=t.width>=500;{const I=localStorage.getItem("sideNav");I&&(r=I=="true")}l(o),n(I=>({...I,theme:o,sideNav:r}))}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 i.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,r=I();r==null&&(r=0,c.replaceState(pl({},c.state,{idx:r}),""));function I(){return(c.state||{idx:null}).idx}function d(){t=oa.Pop;let G=I(),h=G==null?null:G-r;r=G,o&&o({action:t,location:b.location,delta:h})}function j(G,h){t=oa.Push;let g=tc(b.location,G,h);r=I()+1;let C=Zo(g,r),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);r=I();let C=Zo(g,r),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 _I(s,a,n){return n===void 0&&(n="/"),LI(s,a,n,!1)}function LI(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 r=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 "'+r+'".')),lg(e.children,a,I,r)),!(e.path==null&&!e.index)&&a.push({path:r,score:ld(r,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?r[j]=void 0:r[j]=(m||"").replace(/%2F/g,"/"),r},{}),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),r=c&&c!=="/"&&c.endsWith("/"),I=(e||c===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(r||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 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,r=I();r==null&&(r=0,c.replaceState(pl({},c.state,{idx:r}),""));function I(){return(c.state||{idx:null}).idx}function d(){t=oa.Pop;let B=I(),h=B==null?null:B-r;r=B,o&&o({action:t,location:b.location,delta:h})}function j(B,h){t=oa.Push;let g=tc(b.location,B,h);r=I()+1;let C=Zo(g,r),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(B,h){t=oa.Replace;let g=tc(b.location,B,h);r=I();let C=Zo(g,r),y=b.createHref(g);c.replaceState(C,"",y),e&&o&&o({action:t,location:b.location,delta:0})}function m(B){let h=p.location.origin!=="null"?p.location.origin:p.location.href,g=typeof B=="string"?B:ng(B);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(B){if(o)throw new Error("A history only accepts one active listener");return p.addEventListener(ko,d),o=B,()=>{p.removeEventListener(ko,d),o=null}},createHref(B){return a(p,B)},createURL:m,encodeLocation(B){let h=m(B);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:j,replace:u,go(B){return c.go(B)}};return b}var Wo;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Wo||(Wo={}));function _I(s,a,n){return n===void 0&&(n="/"),LI(s,a,n,!1)}function LI(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 r=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 "'+r+'".')),lg(e.children,a,I,r)),!(e.path==null&&!e.index)&&a.push({path:r,score:ld(r,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,Bo=s=>s==="*";function ld(s,a){let n=s.split("/"),l=n.length;return n.some(Bo)&&(l+=nd),a&&(l+=qI),n.filter(p=>!Bo(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?r[j]=void 0:r[j]=(m||"").replace(/%2F/g,"/"),r},{}),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),r=c&&c!=="/"&&c.endsWith("/"),I=(e||c===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(r||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(r,I){if(I===void 0&&(I={}),!t.current)return;if(typeof r=="number"){l.go(r);return}let d=hd(r,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(Rp),{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 r=Fp(),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=r;let j=I.pathname||"/",u=j;if(o!=="/"){let G=o.replace(/^\//,"").split("/");u="/"+j.replace(/^\//,"").split("/").slice(G.length).join("/")}let m=_I(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,r=-1;if(n&&l&&l.v7_partialHydration)for(let I=0;I=0?c=c.slice(0,r+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&&(r<0&&j===0?(m=!0,G=null):r===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 vd(){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 Rd(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(/^\/*/,"/"),r=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(Rp.Provider,{value:r},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(r,I){if(I===void 0&&(I={}),!t.current)return;if(typeof r=="number"){l.go(r);return}let d=hd(r,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(Rp),{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 r=Fp(),I;if(a){var d;let B=typeof a=="string"?jn(a):a;o==="/"||(d=B.pathname)!=null&&d.startsWith(o)||P(!1),I=B}else I=r;let j=I.pathname||"/",u=j;if(o!=="/"){let B=o.replace(/^\//,"").split("/");u="/"+j.replace(/^\//,"").split("/").slice(B.length).join("/")}let m=_I(s,{pathname:u}),b=Gd(m&&m.map(B=>Object.assign({},B,{params:Object.assign({},t,B.params),pathname:Xa([o,p.encodeLocation?p.encodeLocation(B.pathname).pathname:B.pathname]),pathnameBase:B.pathnameBase==="/"?o:Xa([o,p.encodeLocation?p.encodeLocation(B.pathnameBase).pathname:B.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 Bd(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 Gd(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,r=-1;if(n&&l&&l.v7_partialHydration)for(let I=0;I=0?c=c.slice(0,r+1):c=[c[0]];break}}}return c.reduceRight((I,d,j)=>{let u,m=!1,b=null,B=null;n&&(u=t&&d.route.id?t[d.route.id]:void 0,b=d.route.errorElement||Zd,o&&(r<0&&j===0?(m=!0,B=null):r===j&&(m=!0,B=d.route.hydrateFallbackElement||null)));let h=a.concat(c.slice(0,j+1)),g=()=>{let C;return u?C=b:m?C=B:d.route.Component?C=W.createElement(d.route.Component,null):d.route.element?C=d.route.element:C=I,W.createElement(Bd,{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 vd(){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 Rd(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(/^\/*/,"/"),r=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 B=eg(I,o);return B==null?null:{location:{pathname:B,search:d,hash:j,state:u,key:m},navigationType:p}},[o,I,d,j,u,m,p]);return b==null?null:W.createElement(Rp.Provider,{value:r},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 Fd="6";try{window.__reactRouterVersion=Fd}catch{}const Kd="startTransition",Bo=Rg[Kd];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:r}=l||{},I=W.useCallback(d=>{r&&Bo?Bo(()=>o(d)):o(d)},[o,r]);return W.useLayoutEffect(()=>c.listen(I),[c,I]),W.createElement(Rd,{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=Fp(),p=W.useMemo(()=>Hd(l.search,n.current?null:a.current),[l.search]),e=yd(),c=W.useCallback((t,o)=>{const r=ic(typeof t=="function"?t(p):t);n.current=!0,e("?"+r,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",_d="_link_1ltry_26",xa={list:Ed,title:Qd,listItem:Td,listItemActive:Ud,link:_d},Ld=[{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:"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:"DeFi",routes:aC.map(s=>({...s,path:`/defi/${s.path}`}))}],jp=rt.map(({routes:s})=>s).flat(),nC=jp.reduce((s,a,n)=>(s[a.path]=n,s),{});function lC(s){const a=nC[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 pC=({onClick:s})=>{const a=Fp();function n(l,p){l.preventDefault(),s(p)}return i.jsxs(i.Fragment,{children:[i.jsx("h3",{className:xa.category,children:"Basic"}),rt.map(({routes:l,title:p},e)=>i.jsxs("div",{children:[p&&i.jsx("h3",{className:xa.title,children:p}),i.jsx("ul",{className:xa.list,children:l.map(({path:c,title:t})=>{const o=!!oc(c,a.pathname);return i.jsx("li",{className:o?xa.listItemActive:xa.listItem,children:i.jsx("a",{className:xa.link,href:c,onClick:r=>n(r,c),children:t})},c)})})]},e))]})},eC=({size:s,className:a="",onClick:n})=>i.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:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})}),cC="_component_15x91_1",tC="_a_15x91_13",oC="_center_15x91_16",rC="_logo_15x91_21",iC="_header_15x91_24",gC="_mode_15x91_28",hC="_hamburger_15x91_33",aa={component:cC,a:tC,center:oC,logo:rC,header:iC,mode:gC,hamburger:hC},IC=({size:s,className:a=""})=>i.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:i.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"})}),dC=({size:s,className:a=""})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 302.4 302.4",width:s,height:s,className:a,children:[i.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}),i.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})]}),CC=({size:s,className:a="",fill:n})=>i.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:[i.jsx("path",{opacity:.45,d:"M773.772 253.308 643.068 485.61H381.842l130.614-232.302h261.316"}),i.jsx("path",{opacity:.6,d:"M643.068 485.61h261.318L773.772 253.308H512.456L643.068 485.61z"}),i.jsx("path",{opacity:.8,d:"M512.456 717.822 643.068 485.61 512.456 253.308 381.842 485.61l130.614 232.212z"}),i.jsx("path",{opacity:.45,d:"m513.721 1066.275 130.704-232.303h261.318l-130.705 232.303H513.721"}),i.jsx("path",{opacity:.6,d:"M644.424 833.973H383.107l130.613 232.303h261.317L644.424 833.973z"}),i.jsx("path",{opacity:.8,d:"M775.038 601.761 644.424 833.973l130.614 232.303 130.704-232.303-130.704-232.212z"})]});function jC(){const{state:s,setTheme:a,toggleSideNav:n}=tt();function l(){a(s.theme=="light"?"dark":"light")}return i.jsxs("div",{className:aa.component,children:[i.jsx(eC,{size:20,className:aa.hamburger,onClick:n}),i.jsxs("div",{className:aa.center,children:[i.jsx("a",{href:"/",className:aa.a,children:i.jsx(CC,{className:aa.logo,size:30,fill:s.theme=="dark"?"rgb(0, 255, 0)":"currentColor"})}),i.jsx("h3",{className:aa.header,children:i.jsx("a",{href:"/",className:aa.a,children:"Solidity by Example"})})]}),i.jsx("button",{className:aa.mode,onClick:l,children:s.theme=="dark"?i.jsx(IC,{size:20}):i.jsx(dC,{size:20})})]})}const AC="_component_o1tj5_1",uC="_row_o1tj5_8",yC="_bar_o1tj5_13",mC="_to_o1tj5_21",bC="_social_o1tj5_24",wC="_updraft_o1tj5_29",kC="_telegram_o1tj5_34",ZC="_discord_o1tj5_38",WC="_youTube_o1tj5_42",us={component:AC,row:uC,bar:yC,to:mC,social:bC,updraft:wC,telegram:kC,discord:ZC,youTube:WC},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",GC="/assets/telegram-DMavHjFx.png",BC="/assets/discord-BqSoMD3G.png";function fC(){return i.jsxs("div",{className:us.component,children:[i.jsxs("div",{className:us.row,children:[i.jsx("img",{src:hg,alt:"cyfrin",className:us.updraft}),i.jsx("a",{href:"https://updraft.cyfrin.io",target:"__blank",children:"Cyfrin Updraft"})]}),i.jsxs("div",{className:us.social,children:[i.jsxs("div",{className:us.row,children:[i.jsx("img",{src:BC,alt:"discord",className:us.discord}),i.jsx("a",{href:"https://discord.gg/bt8FK2wkcW",target:"__blank",children:"Discord"})]}),i.jsxs("div",{className:us.row,children:[i.jsx("img",{src:GC,alt:"telegram",className:us.telegram}),i.jsx("a",{href:"https://t.me/smartcontractprogrammer",target:"__blank",children:"Telegram"})]}),i.jsxs("div",{className:us.row,children:[i.jsx("img",{src:Ig,alt:"youtube",className:us.youTube}),i.jsx("a",{href:"https://www.youtube.com/channel/UCJWh7F3AFyQ_x01VKzr9eyA",target:"__blank",children:"YouTube"})]})]}),i.jsx("div",{className:us.row,children:i.jsx("a",{href:"mailto:contact@solidity-by-example.org",children:"contact@solidity-by-example.org"})}),i.jsxs("div",{className:us.row,children:[i.jsx("a",{href:"https://github.com/Cyfrin/solidity-by-example.github.io",target:"__blank",children:"source"}),i.jsx("div",{className:us.bar,children:"|"}),i.jsx("a",{href:"https://github.com/Cyfrin/solidity-by-example.github.io/blob/gh-pages/LICENSE",target:"__blank",children:"license"})]})]})}const VC=({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 i.jsxs("div",{className:Xl.component,children:[i.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?i.jsx(pC,{onClick:l}):null}),i.jsxs("div",{className:Xl.main,children:[i.jsx(jC,{}),i.jsxs("div",{className:Xl.children,children:[s,i.jsx(fC,{})]})]})]})},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=' ',YC='';function XC(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 r;if(((r=p.parentElement)==null?void 0:r.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=YC}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(XC([]),i.jsx("div",{className:`code ${s}`,dangerouslySetInnerHTML:{__html:a}})),RC="_component_17lfp_1",NC="_content_17lfp_5",HC="_cyfrinLink_17lfp_8",FC="_prevNext_17lfp_11",vl={component:RC,content:NC,cyfrinLink:HC,prevNext:FC},A=({title:s,version:a,description:n,cyfrinLink:l,html:p,prev:e,next:c,codes:t})=>i.jsxs("div",{className:vl.component,children:[i.jsx(dg,{title:`${s} | Solidity by Example | ${a}`,description:n,cyfrinLink:l}),i.jsxs("div",{className:vl.content,children:[i.jsx("h2",{children:s}),l?i.jsxs("div",{className:vl.cyfrinLink,children:["For the most up to date version of this content, please see"," ",i.jsxs("a",{href:l,target:"__blank",children:[s," (Code Example)"]})," ","on Cyfrin.io"]}):null,i.jsx(vC,{html:p}),i.jsxs("div",{className:vl.prevNext,children:[e&&i.jsxs("a",{href:e.path,children:["< ",e.title]}),c&&i.jsxs("a",{href:c.path,children:[c.title," >"]})]}),i.jsx("h3",{children:"Try on Remix"}),i.jsx("ul",{children:t.map(({fileName:o,code:r},I)=>i.jsx("li",{children:i.jsx("a",{href:`https://remix.ethereum.org/?#code=${r}`,target:"_blank",rel:"noreferrer",children:o})},I))})]})]}),KC="0.8.26",MC="ABI Decode",SC="ABI decode bytes",xC="https://www.cyfrin.io/glossary/abi-decode-code-example",JC=[{fileName:"AbiDecode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFiaURlY29kZSB7CiAgICBzdHJ1Y3QgTXlTdHJ1Y3QgewogICAgICAgIHN0cmluZyBuYW1lOwogICAgICAgIHVpbnQyNTZbMl0gbnVtczsKICAgIH0KCiAgICBmdW5jdGlvbiBlbmNvZGUoCiAgICAgICAgdWludDI1NiB4LAogICAgICAgIGFkZHJlc3MgYWRkciwKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgYXJyLAogICAgICAgIE15U3RydWN0IGNhbGxkYXRhIG15U3RydWN0CiAgICApIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGFiaS5lbmNvZGUoeCwgYWRkciwgYXJyLCBteVN0cnVjdCk7CiAgICB9CgogICAgZnVuY3Rpb24gZGVjb2RlKGJ5dGVzIGNhbGxkYXRhIGRhdGEpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoCiAgICAgICAgICAgIHVpbnQyNTYgeCwKICAgICAgICAgICAgYWRkcmVzcyBhZGRyLAogICAgICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFyciwKICAgICAgICAgICAgTXlTdHJ1Y3QgbWVtb3J5IG15U3RydWN0CiAgICAgICAgKQogICAgewogICAgICAgIC8vICh1aW50IHgsIGFkZHJlc3MgYWRkciwgdWludFtdIG1lbW9yeSBhcnIsIE15U3RydWN0IG15U3RydWN0KSA9IC4uLgogICAgICAgICh4LCBhZGRyLCBhcnIsIG15U3RydWN0KSA9CiAgICAgICAgICAgIGFiaS5kZWNvZGUoZGF0YSwgKHVpbnQyNTYsIGFkZHJlc3MsIHVpbnQyNTZbXSwgTXlTdHJ1Y3QpKTsKICAgIH0KfQo="}],zC=`

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 Fd="6";try{window.__reactRouterVersion=Fd}catch{}const Kd="startTransition",Go=Rg[Kd];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:r}=l||{},I=W.useCallback(d=>{r&&Go?Go(()=>o(d)):o(d)},[o,r]);return W.useLayoutEffect(()=>c.listen(I),[c,I]),W.createElement(Rd,{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=Fp(),p=W.useMemo(()=>Hd(l.search,n.current?null:a.current),[l.search]),e=yd(),c=W.useCallback((t,o)=>{const r=ic(typeof t=="function"?t(p):t);n.current=!0,e("?"+r,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",_d="_link_1ltry_26",xa={list:Ed,title:Qd,listItem:Td,listItemActive:Ud,link:_d},Ld=[{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:"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:"DeFi",routes:aC.map(s=>({...s,path:`/defi/${s.path}`}))}],jp=rt.map(({routes:s})=>s).flat(),nC=jp.reduce((s,a,n)=>(s[a.path]=n,s),{});function lC(s){const a=nC[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 pC=({onClick:s})=>{const a=Fp();function n(l,p){l.preventDefault(),s(p)}return i.jsxs(i.Fragment,{children:[i.jsx("h3",{className:xa.category,children:"Basic"}),rt.map(({routes:l,title:p},e)=>i.jsxs("div",{children:[p&&i.jsx("h3",{className:xa.title,children:p}),i.jsx("ul",{className:xa.list,children:l.map(({path:c,title:t})=>{const o=!!oc(c,a.pathname);return i.jsx("li",{className:o?xa.listItemActive:xa.listItem,children:i.jsx("a",{className:xa.link,href:c,onClick:r=>n(r,c),children:t})},c)})})]},e))]})},eC=({size:s,className:a="",onClick:n})=>i.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:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})}),cC="_component_15x91_1",tC="_a_15x91_13",oC="_center_15x91_16",rC="_logo_15x91_21",iC="_header_15x91_24",gC="_mode_15x91_28",hC="_hamburger_15x91_33",aa={component:cC,a:tC,center:oC,logo:rC,header:iC,mode:gC,hamburger:hC},IC=({size:s,className:a=""})=>i.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:i.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"})}),dC=({size:s,className:a=""})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 302.4 302.4",width:s,height:s,className:a,children:[i.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}),i.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})]}),CC=({size:s,className:a="",fill:n})=>i.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:[i.jsx("path",{opacity:.45,d:"M773.772 253.308 643.068 485.61H381.842l130.614-232.302h261.316"}),i.jsx("path",{opacity:.6,d:"M643.068 485.61h261.318L773.772 253.308H512.456L643.068 485.61z"}),i.jsx("path",{opacity:.8,d:"M512.456 717.822 643.068 485.61 512.456 253.308 381.842 485.61l130.614 232.212z"}),i.jsx("path",{opacity:.45,d:"m513.721 1066.275 130.704-232.303h261.318l-130.705 232.303H513.721"}),i.jsx("path",{opacity:.6,d:"M644.424 833.973H383.107l130.613 232.303h261.317L644.424 833.973z"}),i.jsx("path",{opacity:.8,d:"M775.038 601.761 644.424 833.973l130.614 232.303 130.704-232.303-130.704-232.212z"})]});function jC(){const{state:s,setTheme:a,toggleSideNav:n}=tt();function l(){a(s.theme=="light"?"dark":"light")}return i.jsxs("div",{className:aa.component,children:[i.jsx(eC,{size:20,className:aa.hamburger,onClick:n}),i.jsxs("div",{className:aa.center,children:[i.jsx("a",{href:"/",className:aa.a,children:i.jsx(CC,{className:aa.logo,size:30,fill:s.theme=="dark"?"rgb(0, 255, 0)":"currentColor"})}),i.jsx("h3",{className:aa.header,children:i.jsx("a",{href:"/",className:aa.a,children:"Solidity by Example"})})]}),i.jsx("button",{className:aa.mode,onClick:l,children:s.theme=="dark"?i.jsx(IC,{size:20}):i.jsx(dC,{size:20})})]})}const AC="_component_o1tj5_1",uC="_row_o1tj5_8",yC="_bar_o1tj5_13",mC="_to_o1tj5_21",bC="_social_o1tj5_24",wC="_updraft_o1tj5_29",kC="_telegram_o1tj5_34",ZC="_discord_o1tj5_38",WC="_youTube_o1tj5_42",us={component:AC,row:uC,bar:yC,to:mC,social:bC,updraft:wC,telegram:kC,discord:ZC,youTube:WC},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",BC="/assets/telegram-DMavHjFx.png",GC="/assets/discord-BqSoMD3G.png";function fC(){return i.jsxs("div",{className:us.component,children:[i.jsxs("div",{className:us.row,children:[i.jsx("img",{src:hg,alt:"cyfrin",className:us.updraft}),i.jsx("a",{href:"https://updraft.cyfrin.io",target:"__blank",children:"Cyfrin Updraft"})]}),i.jsxs("div",{className:us.social,children:[i.jsxs("div",{className:us.row,children:[i.jsx("img",{src:GC,alt:"discord",className:us.discord}),i.jsx("a",{href:"https://discord.gg/bt8FK2wkcW",target:"__blank",children:"Discord"})]}),i.jsxs("div",{className:us.row,children:[i.jsx("img",{src:BC,alt:"telegram",className:us.telegram}),i.jsx("a",{href:"https://t.me/smartcontractprogrammer",target:"__blank",children:"Telegram"})]}),i.jsxs("div",{className:us.row,children:[i.jsx("img",{src:Ig,alt:"youtube",className:us.youTube}),i.jsx("a",{href:"https://www.youtube.com/channel/UCJWh7F3AFyQ_x01VKzr9eyA",target:"__blank",children:"YouTube"})]})]}),i.jsx("div",{className:us.row,children:i.jsx("a",{href:"mailto:contact@solidity-by-example.org",children:"contact@solidity-by-example.org"})}),i.jsxs("div",{className:us.row,children:[i.jsx("a",{href:"https://github.com/Cyfrin/solidity-by-example.github.io",target:"__blank",children:"source"}),i.jsx("div",{className:us.bar,children:"|"}),i.jsx("a",{href:"https://github.com/Cyfrin/solidity-by-example.github.io/blob/gh-pages/LICENSE",target:"__blank",children:"license"})]})]})}const VC=({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 i.jsxs("div",{className:Xl.component,children:[i.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?i.jsx(pC,{onClick:l}):null}),i.jsxs("div",{className:Xl.main,children:[i.jsx(jC,{}),i.jsxs("div",{className:Xl.children,children:[s,i.jsx(fC,{})]})]})]})},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=' ',YC='';function XC(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 r;if(((r=p.parentElement)==null?void 0:r.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=YC}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(XC([]),i.jsx("div",{className:`code ${s}`,dangerouslySetInnerHTML:{__html:a}})),RC="_component_17lfp_1",NC="_content_17lfp_5",HC="_cyfrinLink_17lfp_8",FC="_prevNext_17lfp_11",vl={component:RC,content:NC,cyfrinLink:HC,prevNext:FC},A=({title:s,version:a,description:n,cyfrinLink:l,html:p,prev:e,next:c,codes:t})=>i.jsxs("div",{className:vl.component,children:[i.jsx(dg,{title:`${s} | Solidity by Example | ${a}`,description:n,cyfrinLink:l}),i.jsxs("div",{className:vl.content,children:[i.jsx("h2",{children:s}),l?i.jsxs("div",{className:vl.cyfrinLink,children:["For the most up to date version of this content, please see"," ",i.jsxs("a",{href:l,target:"__blank",children:[s," (Code Example)"]})," ","on Cyfrin.io"]}):null,i.jsx(vC,{html:p}),i.jsxs("div",{className:vl.prevNext,children:[e&&i.jsxs("a",{href:e.path,children:["< ",e.title]}),c&&i.jsxs("a",{href:c.path,children:[c.title," >"]})]}),i.jsx("h3",{children:"Try on Remix"}),i.jsx("ul",{children:t.map(({fileName:o,code:r},I)=>i.jsx("li",{children:i.jsx("a",{href:`https://remix.ethereum.org/?#code=${r}`,target:"_blank",rel:"noreferrer",children:o})},I))})]})]}),KC="0.8.26",MC="ABI Decode",SC="ABI decode bytes",xC="https://www.cyfrin.io/glossary/abi-decode-code-example",JC=[{fileName:"AbiDecode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFiaURlY29kZSB7CiAgICBzdHJ1Y3QgTXlTdHJ1Y3QgewogICAgICAgIHN0cmluZyBuYW1lOwogICAgICAgIHVpbnQyNTZbMl0gbnVtczsKICAgIH0KCiAgICBmdW5jdGlvbiBlbmNvZGUoCiAgICAgICAgdWludDI1NiB4LAogICAgICAgIGFkZHJlc3MgYWRkciwKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgYXJyLAogICAgICAgIE15U3RydWN0IGNhbGxkYXRhIG15U3RydWN0CiAgICApIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGFiaS5lbmNvZGUoeCwgYWRkciwgYXJyLCBteVN0cnVjdCk7CiAgICB9CgogICAgZnVuY3Rpb24gZGVjb2RlKGJ5dGVzIGNhbGxkYXRhIGRhdGEpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoCiAgICAgICAgICAgIHVpbnQyNTYgeCwKICAgICAgICAgICAgYWRkcmVzcyBhZGRyLAogICAgICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFyciwKICAgICAgICAgICAgTXlTdHJ1Y3QgbWVtb3J5IG15U3RydWN0CiAgICAgICAgKQogICAgewogICAgICAgIC8vICh1aW50IHgsIGFkZHJlc3MgYWRkciwgdWludFtdIG1lbW9yeSBhcnIsIE15U3RydWN0IG15U3RydWN0KSA9IC4uLgogICAgICAgICh4LCBhZGRyLCBhcnIsIG15U3RydWN0KSA9CiAgICAgICAgICAgIGFiaS5kZWNvZGUoZGF0YSwgKHVpbnQyNTYsIGFkZHJlc3MsIHVpbnQyNTZbXSwgTXlTdHJ1Y3QpKTsKICAgIH0KfQo="}],zC=`

abi.encode encodes data into bytes.

abi.decode decodes bytes back into data.

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.26;
@@ -949,7 +949,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
         return address(this).balance;
     }
 }
-
`,Zj=({prev:s,next:a})=>i.jsx(A,{version:uj,title:yj,description:mj,cyfrinLink:bj,html:kj,prev:s,next:a,codes:wj}),Wj="0.8.26",Gj="Crowd Fund",Bj="An example of crowd funding contract",fj="",Vj=[{fileName:"CrowdFund.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcywgYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7Cn0KCmNvbnRyYWN0IENyb3dkRnVuZCB7CiAgICBldmVudCBMYXVuY2goCiAgICAgICAgdWludDI1NiBpZCwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgY3JlYXRvciwKICAgICAgICB1aW50MjU2IGdvYWwsCiAgICAgICAgdWludDMyIHN0YXJ0QXQsCiAgICAgICAgdWludDMyIGVuZEF0CiAgICApOwogICAgZXZlbnQgQ2FuY2VsKHVpbnQyNTYgaWQpOwogICAgZXZlbnQgUGxlZGdlKHVpbnQyNTYgaW5kZXhlZCBpZCwgYWRkcmVzcyBpbmRleGVkIGNhbGxlciwgdWludDI1NiBhbW91bnQpOwogICAgZXZlbnQgVW5wbGVkZ2UodWludDI1NiBpbmRleGVkIGlkLCBhZGRyZXNzIGluZGV4ZWQgY2FsbGVyLCB1aW50MjU2IGFtb3VudCk7CiAgICBldmVudCBDbGFpbSh1aW50MjU2IGlk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lnbi5nb2FsLCAicGxlZGdlZCA+PSBnb2FsIik7CgogICAgICAgIHVpbnQyNTYgYmFsID0gcGxlZGdlZEFtb3VudFtfaWRdW21zZy5zZW5kZXJdOwogICAgICAgIHBsZWRnZWRBbW91bnRbX2lkXVttc2cuc2VuZGVyXSA9IDA7CiAgICAgICAgdG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgYmFsKTsKCiAgICAgICAgZW1pdCBSZWZ1bmQoX2lkLCBtc2cuc2VuZGVyLCBiYWwpOwogICAgfQp9Cg=="}],Yj=`

Crowd fund ERC20 token

+`,Zj=({prev:s,next:a})=>i.jsx(A,{version:uj,title:yj,description:mj,cyfrinLink:bj,html:kj,prev:s,next:a,codes:wj}),Wj="0.8.26",Bj="Crowd Fund",Gj="An example of crowd funding contract",fj="",Vj=[{fileName:"CrowdFund.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcywgYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7Cn0KCmNvbnRyYWN0IENyb3dkRnVuZCB7CiAgICBldmVudCBMYXVuY2goCiAgICAgICAgdWludDI1NiBpZCwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgY3JlYXRvciwKICAgICAgICB1aW50MjU2IGdvYWwsCiAgICAgICAgdWludDMyIHN0YXJ0QXQsCiAgICAgICAgdWludDMyIGVuZEF0CiAgICApOwogICAgZXZlbnQgQ2FuY2VsKHVpbnQyNTYgaWQpOwogICAgZXZlbnQgUGxlZGdlKHVpbnQyNTYgaW5kZXhlZCBpZCwgYWRkcmVzcyBpbmRleGVkIGNhb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YWlnbiA9IGNhbXBhaWduc1tfaWRdOwogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wID4gY2FtcGFpZ24uZW5kQXQsICJub3QgZW5kZWQiKTsKICAgICAgICByZXF1aXJlKGNhbXBhaWduLnBsZWRnZWQgPCBjYW1wYWlnbi5nb2FsLCAicGxlZGdlZCA+PSBnb2FsIik7CgogICAgICAgIHVpbnQyNTYgYmFsID0gcGxlZGdlZEFtb3VudFtfaWRdW21zZy5zZW5kZXJdOwogICAgICAgIHBsZWRnZWRBbW91bnRbX2lkXVttc2cuc2VuZGVyXSA9IDA7CiAgICAgICAgdG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgYmFsKTsKCiAgICAgICAgZW1pdCBSZWZ1bmQoX2lkLCBtc2cuc2VuZGVyLCBiYWwpOwogICAgfQp9Cg=="}],Yj=`

Crowd fund ERC20 token

  1. User creates a campaign.
  2. Users can pledge, transferring their token to a campaign.
  3. @@ -1081,7 +1081,7 @@ Closing a channel when Alice and Bob do not agree on the final balances emit Refund(_id, msg.sender, bal); } } -`,Xj=({prev:s,next:a})=>i.jsx(A,{version:Wj,title:Gj,description:Bj,cyfrinLink:fj,html:Yj,prev:s,next:a,codes:Vj}),vj="0.8.26",Rj="Deploy Any Contract",Nj="Deploy Any Contract",Hj="",Fj=[{fileName:"Proxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFByb3h5IHsKICAgIGV2ZW50IERlcGxveShhZGRyZXNzKTsKCiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIGZ1bmN0aW9uIGRlcGxveShieXRlcyBtZW1vcnkgX2NvZGUpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcyBhZGRyKQogICAgewogICAgICAgIGFzc2VtYmx5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ID0gbXNnLnZhbHVlOwogICAgdWludDI1NiBwdWJsaWMgeDsKICAgIHVpbnQyNTYgcHVibGljIHk7CgogICAgY29uc3RydWN0b3IodWludDI1NiBfeCwgdWludDI1NiBfeSkgcGF5YWJsZSB7CiAgICAgICAgeCA9IF94OwogICAgICAgIHkgPSBfeTsKICAgIH0KfQoKY29udHJhY3QgSGVscGVyIHsKICAgIGZ1bmN0aW9uIGdldEJ5dGVjb2RlMSgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgYnl0ZXMgbWVtb3J5IGJ5dGVjb2RlID0gdHlwZShUZXN0Q29udHJhY3QxKS5jcmVhdGlvbkNvZGU7CiAgICAgICAgcmV0dXJuIGJ5dGVjb2RlOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEJ5dGVjb2RlMih1aW50MjU2IF94LCB1aW50MjU2IF95KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkKICAgIHsKICAgICAgICBieXRlcyBtZW1vcnkgYnl0ZWNvZGUgPSB0eXBlKFRlc3RDb250cmFjdDIpLmNyZWF0aW9uQ29kZTsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVBhY2tlZChieXRlY29kZSwgYWJpLmVuY29kZShfeCwgX3kpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRDYWxsZGF0YShhZGRyZXNzIF9vd25lcikgZXh0ZXJuYWwgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoInNldE93bmVyKGFkZHJlc3MpIiwgX293bmVyKTsKICAgIH0KfQo="}],Kj=`

    Deploy any contract by calling Proxy.deploy(bytes memory _code)

    +`,Xj=({prev:s,next:a})=>i.jsx(A,{version:Wj,title:Bj,description:Gj,cyfrinLink:fj,html:Yj,prev:s,next:a,codes:Vj}),vj="0.8.26",Rj="Deploy Any Contract",Nj="Deploy Any Contract",Hj="",Fj=[{fileName:"Proxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFByb3h5IHsKICAgIGV2ZW50IERlcGxveShhZGRyZXNzKTsKCiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIGZ1bmN0aW9uIGRlcGxveShieXRlcyBtZW1vcnkgX2NvZGUpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcyBhZGRyKQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gY3JlYXRlKHYsIHAsIG4pCiAgICAgICAgICAgIC8vIHYgPSBhbW91bnQgb2YgRVRIIHRvIHNlbmQKICAgICAgICAgICAgLy8gcCA9IHBvaW50ZXIgaW4gbWVtb3J5IHRvIHN0YXJ0IG9mIGNvZGUKICAgICAgICAgICAgLy8gbiA9IHNpemUgb2YgY29kZQogICAgICAgICAgICBhZGRyIDo9IGNyZWF0ZShjYWxsdmFsdWUoKSwgYWRkKF9jb2RlLCAweDIwKSwgbWxvYWQoX2NvZGUpKQogICAgICAgIH0KICAgICAgICAvLyByZXR1cm4gYWRkcmVzcyAwIG9uIGVycm9yCiAgICAgICAgcmVxdWlyZShhZGRyICE9IGFkZHJlc3MoMCksICJkZXBsb3kgZmFpbGVkIik7CgogICAgICAgIGVtaXQgRGVwbG95KGFkZHIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4ZWN1dGUoYWRkcmVzcyBfdGFyZ2V0LCBieXRlcyBtZW1vcnkgX2RhdGEpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIChib29sIHN1Y2Nlc3MsKSA9IF90YXJnZXQuY2FsbHt2YWx1ZTogbXNnLnZhbHVlfShfZGF0YSk7CiAg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sKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVBhY2tlZChieXRlY29kZSwgYWJpLmVuY29kZShfeCwgX3kpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRDYWxsZGF0YShhZGRyZXNzIF9vd25lcikgZXh0ZXJuYWwgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoInNldE93bmVyKGFkZHJlc3MpIiwgX293bmVyKTsKICAgIH0KfQo="}],Kj=`

    Deploy any contract by calling Proxy.deploy(bytes memory _code)

    For this example, you can get the contract bytecodes by calling Helper.getBytecode1 and Helper.getBytecode2

    // SPDX-License-Identifier: MIT
     pragma solidity ^0.8.26;
    @@ -1997,7 +1997,7 @@ How to swap tokens
             return address(this).balance;
         }
     }
    -
    `,GA=({prev:s,next:a})=>i.jsx(A,{version:mA,title:bA,description:wA,cyfrinLink:kA,html:WA,prev:s,next:a,codes:ZA}),BA="0.8.26",fA="Gasless Token Transfer",VA="Gasless ERC20 token transfer with Meta transaction",YA="",XA=[{fileName:"ERC20Permit.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEFHUEwtMy4wLW9ubHkKcHJhZ21hIHNvbGlkaXR5ID49MC44LjA7CgovLy8gQG5vdGljZSBNb2Rlcm4gYW5kIGdhcyBlZmZpY2llbnQgRVJDMjAgKyBFSVAtMjYxMiBpbXBsZW1lbnRhdGlvbi4KLy8vIEBhdXRob3IgU29sbWF0ZSAoaHR0cHM6Ly9naXRodWIuY29tL3RyYW5zbWlzc2lvbnMxMS9zb2xtYXRlL2Jsb2IvbWFpbi9zcmMvdG9rZW5zL0VSQzIwLnNvbCkKLy8vIEBhdXRob3IgTW9kaWZpZWQgZnJvbSBVbmlzd2FwIChodHRwczovL2dpdGh1Yi5jb20vVW5pc3dhcC91bmlzd2FwLXYyLWNvcmUvYmxvYi9tYXN0ZXIvY29udHJhY3RzL1VuaXN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ID0gX25hbWU7CiAgICAgICAgc3ltYm9sID0gX3N5bWJvbDsKICAgICAgICBkZWNpbWFscyA9IF9kZWNpbWFsczsKICAgICAgICBJTklUSUFMX0NIQUlOX0lEID0gYmxvY2suY2hhaW5pZDsKICAgICAgICBJTklUSUFMX0RPTUFJTl9TRVBBUkFUT1IgPSBjb21wdXRlRG9tYWluU2VwYXJhdG9yKCk7CiAgICB9CgogICAgZnVuY3Rpb24gYXBwcm92ZShhZGRyZXNzIHNwZW5kZXIsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIGFsbG93YW5jZVttc2cuc2VuZGVyXVtzcGVuZGVyXSA9IGFtb3VudDsKICAgICAgICBlbWl0IEFwcHJvdmFsKG1zZy5zZW5kZXIsIHNwZW5kZXIsIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlydHVhbAogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYmFsYW5jZU9mW21zZy5zZW5kZXJdIC09IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKG1zZy5zZW5kZXIsIHRvLCBhbW91bnQpOwogICAgICAgIHJldHVybiB0cnVlOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIGZyb20sIGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIHVpbnQyNTYgYWxsb3dlZCA9IGFsbG93YW5jZVtmcm9tXVttc2cuc2VuZGVyXTsgLy8gU2F2ZXMgZ2FzIGZvciBsaW1pdGVkIGFwcHJvdmFscy4KICAgICAgICBpZiAoYWxsb3dlZCAhPSB0eXBlKHVpbnQyNTYpLm1heCkgewogICAgICAgICAgICBhbGxvd2FuY2VbZnJvbV1bbXNnLnNlbmRlcl0gPSBhbGxvd2VkIC0gYW1vdW50OwogICAgICAgIH0KICAgICAgICBiYWxhbmNlT2ZbZnJvbV0gLT0gYW1vdW50OwoKICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICBiYWxhbmNlT2ZbdG9dICs9IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gcGVybWl0KAogICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgYWRkcmVzcyBzcGVuZGVyLAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgdWludDI1NiBkZWFkbGluZSwKICAgICAgICB1aW50OCB2LAogICAgICAgIGJ5dGVzMzIgciwKICAgICAgICBieXRlczMyIHMKICAgICkgcHVibGljIHZpcnR1YWwgewogICAgICAgIHJlcXVpcmUoZGVhZGxpbmUgPj0gYmxvY2sudGltZXN0YW1wLCAiUEVSTUlUX0RFQURMSU5FX0VYUElSRUQiKTsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYWRkcmVzcyByZWNvdmVyZWRBZGRyZXNzID0gZWNyZWNvdmVyKAogICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgIGFiaS5lbmNvZGVQYWNrZWQoCiAgICAgICAgICAgICAgICAgICAgICAgICJceDE5XHgwMSIsCiAgICAgICAgICAgICAgICAgICAgICAgIERPTUFJTl9TRVBBUkFUT1IoKSwKICAgICAgICAgICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQZXJtaXQoYWRkcmVzcyBvd25lcixhZGRyZXNzIHNwZW5kZXIsdWludDI1NiB2YWx1ZSx1aW50MjU2IG5vbmNlLHVpbnQyNTYgZGVhZGxpbmUpIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3duZXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BlbmRlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub25jZXNbb3duZXJdKyssCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVhZGxpbmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICB2LAogICAgICAgICAgICAgICAgciwKICAgICAgICAgICAgICAgIHMKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgICAgICByZWNvdmVyZWRBZGRyZXNzICE9IGFkZHJlc3MoMCkgJiYgcmVjb3ZlcmVkQWRkcmVzcyA9PSBvd25lciwKICAgICAgICAgICAgICAgICJJTlZBTElEX1NJR05FUiIKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIGFsbG93YW5jZVtyZWNvdmVyZWRBZGRyZXNzXVtzcGVuZGVyXSA9IHZhbHVlOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBBcHByb3ZhbChvd25lciwgc3BlbmRlciwgdmFsdWUpOwogICAgfQoKICAgIGZ1bmN0aW9uIERPTUFJTl9TRVBBUkFUT1IoKSBwdWJsaWMgdmlldyB2aXJ0dWFsIHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4gYmxvY2suY2hhaW5pZCA9PSBJTklUSUFMX0NIQUlOX0lECiAgICAgICAgICAgID8gSU5JVElBTF9ET01BSU5fU0VQQVJBVE9SCiAgICAgICAgICAgIDogY29tcHV0ZURvbWFpblNlcGFyYXRvcigpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbXB1dGVEb21haW5TZXBhcmF0b3IoKSBpbnRlcm5hbCB2aWV3IHZpcnR1YWwgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBrZWNjYWsyNTYoCiAgICAgICAgICAgIGFiaS5lbmNvZGUoCiAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgIkVJUDcxMkRvbWFpbihzdHJpbmcgbmFtZSxzdHJpbmcgdmVyc2lvbix1aW50MjU2IGNoYWluSWQsYWRkcmVzcyB2ZXJpZnlpbmdDb250cmFjdCkiCiAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAga2VjY2FrMjU2KGJ5dGVzKG5hbWUpKSwKICAgICAgICAgICAgICAgIGtlY2NhazI1NigiMSIpLAogICAgICAgICAgICAgICAgYmxvY2suY2hhaW5pZCwKICAgICAgICAgICAgICAgIGFkZHJlc3ModGhpcykKICAgICAgICAgICAgKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbnQoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKGFkZHJlc3MoMCksIHRvLCBhbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF9idXJuKGFkZHJlc3MgZnJvbSwgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIGJhbGFuY2VPZltmcm9tXSAtPSBhbW91bnQ7CgogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHRvdGFsU3VwcGx5IC09IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgYWRkcmVzcygwKSwgYW1vdW50KTsKICAgIH0KfQoKY29udHJhY3QgRVJDMjBQZXJtaXQgaXMgRVJDMjAgewogICAgY29uc3RydWN0b3Ioc3RyaW5nIG1lbW9yeSBfbmFtZSwgc3RyaW5nIG1lbW9yeSBfc3ltYm9sLCB1aW50OCBfZGVjaW1hbHMpCiAgICAgICAgRVJDMjAoX25hbWUsIF9zeW1ib2wsIF9kZWNpbWFscykKICAgIHt9CgogICAgZnVuY3Rpb24gbWludChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkgcHVibGljIHsKICAgICAgICBfbWludCh0bywgYW1vdW50KTsKICAgIH0KfQo="},{fileName:"GaslessTokenTransfer.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjBQZXJtaXQgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZ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GlzKSwgYW1vdW50ICsgZmVlLCBkZWFkbGluZSwgdiwgciwgcwogICAgICAgICk7CiAgICAgICAgLy8gU2VuZCBhbW91bnQgdG8gcmVjZWl2ZXIKICAgICAgICBJRVJDMjBQZXJtaXQodG9rZW4pLnRyYW5zZmVyRnJvbShzZW5kZXIsIHJlY2VpdmVyLCBhbW91bnQpOwogICAgICAgIC8vIFRha2UgZmVlIC0gc2VuZCBmZWUgdG8gbXNnLnNlbmRlcgogICAgICAgIElFUkMyMFBlcm1pdCh0b2tlbikudHJhbnNmZXJGcm9tKHNlbmRlciwgbXNnLnNlbmRlciwgZmVlKTsKICAgIH0KfQo="}],vA=`

    Gasless ERC20 token transfer with Meta transaction

    +`,BA=({prev:s,next:a})=>i.jsx(A,{version:mA,title:bA,description:wA,cyfrinLink:kA,html:WA,prev:s,next:a,codes:ZA}),GA="0.8.26",fA="Gasless Token Transfer",VA="Gasless ERC20 token transfer with Meta transaction",YA="",XA=[{fileName:"ERC20Permit.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEFHUEwtMy4wLW9ubHkKcHJhZ21hIHNvbGlkaXR5ID49MC44LjA7CgovLy8gQG5vdGljZSBNb2Rlcm4gYW5kIGdhcyBlZmZpY2llbnQgRVJDMjAgKyBFSVAtMjYxMiBpbXBsZW1lbnRhdGlvbi4KLy8vIEBhdXRob3IgU29sbWF0ZSAoaHR0cHM6Ly9naXRodWIuY29tL3RyYW5zbWlzc2lvbnMxMS9zb2xtYXRlL2Jsb2IvbWFpbi9zcmMvdG9rZW5zL0VSQzIwLnNvbCkKLy8vIEBhdXRob3IgTW9kaWZpZWQgZnJvbSBVbmlzd2FwIChodHRwczovL2dpdGh1Yi5jb20vVW5pc3dhcC91bmlzd2FwLXYyLWNvcmUvYmxvYi9tYXN0ZXIvY29udHJhY3RzL1VuaXN3YXBWMkVSQzIwLnNvbCkKLy8vIEBkZXYgRG8gbm90IG1hbnVhbGx5IHNldCBiYWxhbmNlcyB3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bWFsczsKICAgICAgICBJTklUSUFMX0NIQUlOX0lEID0gYmxvY2suY2hhaW5pZDsKICAgICAgICBJTklUSUFMX0RPTUFJTl9TRVBBUkFUT1IgPSBjb21wdXRlRG9tYWluU2VwYXJhdG9yKCk7CiAgICB9CgogICAgZnVuY3Rpb24gYXBwcm92ZShhZGRyZXNzIHNwZW5kZXIsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIGFsbG93YW5jZVttc2cuc2VuZGVyXVtzcGVuZGVyXSA9IGFtb3VudDsKICAgICAgICBlbWl0IEFwcHJvdmFsKG1zZy5zZW5kZXIsIHNwZW5kZXIsIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlydHVhbAogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYmFsYW5jZU9mW21zZy5zZW5kZXJdIC09IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKG1zZy5zZW5kZXIsIHRvLCBhbW91bnQpOwogICAgICAgIHJldHVybiB0cnVlOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIGZyb20sIGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIHVpbnQyNTYgYWxsb3dlZCA9IGFsbG93YW5jZVtmcm9tXVttc2cuc2VuZGVyXTsgLy8gU2F2ZXMgZ2FzIGZvciBsaW1pdGVkIGFwcHJvdmFscy4KICAgICAgICBpZiAoYWxsb3dlZCAhPSB0eXBlKHVpbnQyNTYpLm1heCkgewogICAgICAgICAgICBhbGxvd2FuY2VbZnJvbV1bbXNnLnNlbmRlcl0gPSBhbGxvd2VkIC0gYW1vdW50OwogICAgICAgIH0KICAgICAgICBiYWxhbmNlT2ZbZnJvbV0gLT0gYW1vdW50OwoKICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICBiYWxhbmNlT2ZbdG9dICs9IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gcGVybWl0KAogICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgYWRkcmVzcyBzcGVuZGVyLAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgdWludDI1NiBkZWFkbGluZSwKICAgICAgICB1aW50OCB2LAogICAgICAgIGJ5dGVzMzIgciwKICAgICAgICBieXRlczMyIHMKICAgICkgcHVibGljIHZpcnR1YWwgewogICAgICAgIHJlcXVpcmUoZGVhZGxpbmUgPj0gYmxvY2sudGltZXN0YW1wLCAiUEVSTUlUX0RFQURMSU5FX0VYUElSRUQiKTsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYWRkcmVzcyByZWNvdmVyZWRBZGRyZXNzID0gZWNyZWNvdmVyKAogICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgIGFiaS5lbmNvZGVQYWNrZWQoCiAgICAgICAgICAgICAgICAgICAgICAgICJceDE5XHgwMSIsCiAgICAgICAgICAgICAgICAgICAgICAgIERPTUFJTl9TRVBBUkFUT1IoKSwKICAgICAgICAgICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQZXJtaXQoYWRkcmVzcyBvd25lcixhZGRyZXNzIHNwZW5kZXIsdWludDI1NiB2YWx1ZSx1aW50MjU2IG5vbmNlLHVpbnQyNTYgZGVhZGxpbmUpIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3duZXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BlbmRlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub25jZXNbb3duZXJdKyssCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVhZGxpbmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICB2LAogICAgICAgICAgICAgICAgciwKICAgICAgICAgICAgICAgIHMKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgICAgICByZWNvdmVyZWRBZGRyZXNzICE9IGFkZHJlc3MoMCkgJiYgcmVjb3ZlcmVkQWRkcmVzcyA9PSBvd25lciwKICAgICAgICAgICAgICAgICJJTlZBTElEX1NJR05FUiIKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIGFsbG93YW5jZVtyZWNvdmVyZWRBZGRyZXNzXVtzcGVuZGVyXSA9IHZhbHVlOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBBcHByb3ZhbChvd25lciwgc3BlbmRlciwgdmFsdWUpOwogICAgfQoKICAgIGZ1bmN0aW9uIERPTUFJTl9TRVBBUkFUT1IoKSBwdWJsaWMgdmlldyB2aXJ0dWFsIHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4gYmxvY2suY2hhaW5pZCA9PSBJTklUSUFMX0NIQUlOX0lECiAgICAgICAgICAgID8gSU5JVElBTF9ET01BSU5fU0VQQVJBVE9SCiAgICAgICAgICAgIDogY29tcHV0ZURvbWFpblNlcGFyYXRvcigpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbXB1dGVEb21haW5TZXBhcmF0b3IoKSBpbnRlcm5hbCB2aWV3IHZpcnR1YWwgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBrZWNjYWsyNTYoCiAgICAgICAgICAgIGFiaS5lbmNvZGUoCiAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgIkVJUDcxMkRvbWFpbihzdHJpbmcgbmFtZSxzdHJpbmcgdmVyc2lvbix1aW50MjU2IGNoYWluSWQsYWRkcmVzcyB2ZXJpZnlpbmdDb250cmFjdCkiCiAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAga2VjY2FrMjU2KGJ5dGVzKG5hbWUpKSwKICAgICAgICAgICAgICAgIGtlY2NhazI1NigiMSIpLAogICAgICAgICAgICAgICAgYmxvY2suY2hhaW5pZCwKICAgICAgICAgICAgICAgIGFkZHJlc3ModGhpcykKICAgICAgICAgICAgKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbnQoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKGFkZHJlc3MoMCksIHRvLCBhbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF9idXJuKGFkZHJlc3MgZnJvbSwgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIGJhbGFuY2VPZltmcm9tXSAtPSBhbW91bnQ7CgogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHRvdGFsU3VwcGx5IC09IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgYWRkcmVzcygwKSwgYW1vdW50KTsKICAgIH0KfQoKY29udHJhY3QgRVJDMjBQZXJtaXQgaXMgRVJDMjAgewogICAgY29uc3RydWN0b3Ioc3RyaW5nIG1lbW9yeSBfbmFtZSwgc3RyaW5nIG1lbW9yeSBfc3ltYm9sLCB1aW50OCBfZGVjaW1hbHMpCiAgICAgICAgRVJDMjAoX25hbWUsIF9zeW1ib2wsIF9kZWNpbWFscykKICAgIHt9CgogICAgZnVuY3Rpb24gbWludChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkgcHVibGljIHsKICAgICAgICBfbWludCh0bywgYW1vdW50KTsKICAgIH0KfQo="},{fileName:"GaslessTokenTransfer.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjBQZXJtaXQgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR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2VuZCBhbW91bnQgdG8gcmVjZWl2ZXIKICAgICAgICBJRVJDMjBQZXJtaXQodG9rZW4pLnRyYW5zZmVyRnJvbShzZW5kZXIsIHJlY2VpdmVyLCBhbW91bnQpOwogICAgICAgIC8vIFRha2UgZmVlIC0gc2VuZCBmZWUgdG8gbXNnLnNlbmRlcgogICAgICAgIElFUkMyMFBlcm1pdCh0b2tlbikudHJhbnNmZXJGcm9tKHNlbmRlciwgbXNnLnNlbmRlciwgZmVlKTsKICAgIH0KfQo="}],vA=`

    Gasless ERC20 token transfer with Meta transaction

    // SPDX-License-Identifier: MIT
     pragma solidity ^0.8.26;
     
    @@ -2222,7 +2222,7 @@ How to swap tokens
             _mint(to, amount);
         }
     }
    -
    `,RA=({prev:s,next:a})=>i.jsx(A,{version:BA,title:fA,description:VA,cyfrinLink:YA,html:vA,prev:s,next:a,codes:XA}),NA="0.8.26",HA="Iterable Mapping",FA="Iterable Mapping in Solidity",KA="",MA=[{fileName:"IterableMapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmxpYnJhcnkgSXRlcmFibGVNYXBwaW5nIHsKICAgIC8vIEl0ZXJhYmxlIG1hcHBpbmcgZnJvbSBhZGRyZXNzIHRvIHVpbnQ7CiAgICBzdHJ1Y3QgTWFwIHsKICAgICAgICBhZGRyZXNzW10ga2V5czsKICAgICAgICBtYXBwaW5nKGFkZHJlc3MgPT4gdWludDI1NikgdmFsdWVzOwogICAgICAgIG1hcHBpbmcoYWRkcmVzcyA9PiB1aW50MjU2KSBpbmRleE9mOwogICAgICAgIG1hcHBpbmcoYWRkcmVzcyA9PiBib29sKSBpbnNlcnRlZDsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXQoTWFwIHN0b3JhZ2UgbWFwLCBhZGRyZXNzIGtleSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBtYXAudmFsdWVzW2tleV07CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0S2V5QXRJbmRleChNYXAgc3RvcmFnZSBtYXAsIHVpbnQyNTYgaW5kZXgpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgcmV0dXJuIG1hcC5rZXlzW2luZGV4XTsKICAgIH0KCiAgICBmdW5jdGlvbiBzaXplKE1hcCBzdG9yYWdlIG1hcCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBtYXAua2V5cy5sZW5ndGg7CiAgICB9CgogICAgZnVuY3Rpb24gc2V0KE1hcCBzdG9yYWdlIG1hcCwgYWRkcmVzcyBrZXksIHVpbnQyNTYgdmFsKSBwdWJsaWMgewogICAgICAgIGlmIChtYXAuaW5zZXJ0ZWRba2V5XSkgewogICAgICAgICAgICBtYXAudmFsdWVzW2tleV0gPSB2YWw7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbWFwLmluc2VydGVkW2tleV0gPSB0cnVlOwogICAgICAgICAgICBtYXAudmFsdWVzW2tleV0gPSB2YWw7CiAgICAgICAgICAgIG1hcC5pbmRleE9mW2tleV0gPSBtYXAua2V5cy5sZW5ndGg7CiAgICAgICAgICAgIG1hcC5rZXlzLnB1c2goa2V5KTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gcmVtb3ZlKE1hcCBzdG9yYWdlIG1hcCwgYWRkcmVzcyBrZXkpIHB1YmxpYyB7CiAgICAgICAgaWYgKCFtYXAuaW5zZXJ0ZWRba2V5XSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQoKICAgICAgICBkZWxldGUgbWFwLmluc2VydGVkW2tleV07CiAgICAgICAgZGVsZXRlIG1hcC52YWx1ZXNba2V5XTsKCiAgICAgICAgdWludDI1NiBpbmRleCA9IG1hcC5pbmRleE9mW2tleV07CiAgICAgICAgYWRkcmVzcyBsYX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yZXNzKDApKTsKICAgICAgICBhc3NlcnQobWFwLmdldEtleUF0SW5kZXgoMSkgPT0gYWRkcmVzcygzKSk7CiAgICAgICAgYXNzZXJ0KG1hcC5nZXRLZXlBdEluZGV4KDIpID09IGFkZHJlc3MoMikpOwogICAgfQp9Cg=="}],SA=`

    You cannot iterate through a mapping. So here is an example of how to create an iterable mapping.

    +`,RA=({prev:s,next:a})=>i.jsx(A,{version:GA,title:fA,description:VA,cyfrinLink:YA,html:vA,prev:s,next:a,codes:XA}),NA="0.8.26",HA="Iterable Mapping",FA="Iterable Mapping in Solidity",KA="",MA=[{fileName:"IterableMapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmxpYnJhcnkgSXRlcmFibGVNYXBwaW5nIHsKICAgIC8vIEl0ZXJhYmxlIG1hcHBpbmcgZnJvbSBhZGRyZXNzIHRvIHVpbnQ7CiAgICBzdHJ1Y3QgTWFwIHsKICAgICAgICBhZGRyZXNzW10ga2V5czsKICAgICAgICBtYXBwaW5nKGFkZHJlc3MgPT4gdWludDI1NikgdmFsdWVzOwogICAgICAgIG1hcHBpbmcoYWRkcmVzcyA9PiB1aW50MjU2KSBpbmRleE9mOwogICAgICAgIG1hcHBpbmcoYWRkcmVzcyA9PiBib29sKSBpbnNlcnRlZDsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXQoTWFwIHN0b3JhZ2UgbWFwLCBhZGRyZXNzIGtleSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBtYXAudmFsdWVzW2tleV07CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0S2V5QXRJbmRleChNYXAgc3RvcmFnZSBtYXAsIHVpbnQyNTYgaW5kZXgpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgcmV0dXJuIG1hcC5rZXlzW2luZGV4XTsKICAgIH0KCiAgICBmdW5jdGlvbiBzaXplKE1hcCBzdG9yYWdlIG1hcCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBtYXAua2V5cy5sZW5ndGg7CiAgICB9CgogICAgZnVuY3Rpb24gc2V0KE1hcCBzdG9yYWdlIG1hcCwgYWRkcmVzcyBrZXksIHVpbnQyNTYgdmFsKSBwdWJsaWMgewogICAgICAgIGlmIChtYXAuaW5zZXJ0ZWRba2V5XSkgewogICAgICAgICAgICBtYXAudmFsdWVzW2tleV0gPSB2YWw7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbWFwLmluc2VydGVkW2tleV0gPSB0cnVlOwogICAgICAgICAgICBtYXAudmFsdWVzW2tleV0gPSB2YWw7CiAgICAgICAgICAgIG1hcC5pbmRleE9mW2tleV0gPSBtYXAua2V5cy5sZW5ndGg7CiAgICAgICAgICAgIG1hcC5rZXlzLnB1c2goa2V5KTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gcmVtb3ZlKE1hcCBzdG9yYWdlIG1hcCwgYWRkcmVzcyBrZXkpIHB1YmxpYyB7CiAgICAgICAgaWYgKCFtYXAuaW5zZXJ0ZWRba2V5XSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQoKICAgICAgICBkZWxldGUgbWFwLmluc2VydGVkW2tleV07CiAgICAgICAgZGVsZXRlIG1hcC52YWx1ZXNba2V5XTsKCiAgICAgICAgdWludDI1NiBpbmRleCA9IG1hcC5pbmRleE9mW2tleV07CiAgICAgICAgYWRkcmVzcyBsYXN0S2V5ID0gbWFwLmtleXNbbWFwLmtleXMubGVuZ3RoIC0gMV07CgogICAgICAgIG1hcC5pbmRleE9mW2xhc3RLZXldID0gaW5kZXg7CiAgICAgICAgZGVsZXRlIG1hcC5pbmRleE9mW2tleV07CgogICAgICAgIG1hcC5rZXlzW2luZGV4XSA9IGxhc3RLZXk7CiAgICAgICAgbWFwLmtleXMucG9wKCk7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RJdGVyYWJsZU1hcCB7CiAgICB1c2luZyBJdGVyYWJsZU1hcHBpbmcgZm9yIEl0ZXJhYmxlTWFwcGluZy5NYXA7CgogICAgSXRlcmFibGVNYXBwaW5nLk1hcCBwcml2YXRlIG1hcDsKCiAgICBmdW5jdGlvbiB0ZXN0SXRlcmFibGVNYXAoKSBwdWJsaWMgewogICAgICAgIG1hcC5zZXQoYWRkcmVzcygwKSwgMCk7CiAgICAgICAgbWFwLnNldChhZGRyZXNzKDEpLCAxMDApOwogICAgICAgIG1hcC5zZXQoYWRkcmVzcygyKSwgMjAwKTsgLy8gaW5zZXJ0CiAgICAgICAgbWFwLnNldChhZGRyZXNzKDIpLCAyMDApOyAvLyB1cGRhdGUKICAgICAgICBtYXAuc2V0KGFkZHJlc3MoMyksIDMwMCk7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IG1hcC5zaXplKCk7IGkrKykgewogICAgICAgICAgICBhZGRyZXNzIGtleSA9IG1hcC5nZXRLZXlBdEluZGV4KGkpOwogICAgICAgICAgICBhc3NlcnQobWFwLmdldChrZXkpID09IGkgKiAxMDApOwogICAgICAgIH0KCiAgICAgICAgbWFwLnJlbW92ZShhZGRyZXNzKDEpKTsKCiAgICAgICAgLy8ga2V5cyA9IFthZGRyZXNzKDApLCBhZGRyZXNzKDMpLCBhZGRyZXNzKDIpXQogICAgICAgIGFzc2VydChtYXAuc2l6ZSgpID09IDMpOwogICAgICAgIGFzc2VydChtYXAuZ2V0S2V5QXRJbmRleCgwKSA9PSBhZGRyZXNzKDApKTsKICAgICAgICBhc3NlcnQobWFwLmdldEtleUF0SW5kZXgoMSkgPT0gYWRkcmVzcygzKSk7CiAgICAgICAgYXNzZXJ0KG1hcC5nZXRLZXlBdEluZGV4KDIpID09IGFkZHJlc3MoMikpOwogICAgfQp9Cg=="}],SA=`

    You cannot iterate through a mapping. So here is an example of how to create an iterable mapping.

    // SPDX-License-Identifier: MIT
     pragma solidity ^0.8.26;
     
    @@ -2762,7 +2762,7 @@ How to swap tokens
             return abi.encodeWithSignature("callMe(uint256)", 123);
         }
     }
    -
    `,bu=({prev:s,next:a})=>i.jsx(A,{version:Cu,title:ju,description:Au,cyfrinLink:uu,html:mu,prev:s,next:a,codes:yu}),wu="0.8.26",ku="Simple Bytecode Contract",Zu="Simple example of contract written in bytecode",Wu="",Gu=[{fileName:"Factory.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgZXZlbnQgTG9nKGFkZHJlc3MgYWRkcik7CgogICAgLy8gRGVwbG95cyBhIGNvbnRyYWN0IHRoYXQgYWx3YXlzIHJldHVybnMgMjU1CiAgICBmdW5jdGlvbiBkZXBsb3koKSBleHRlcm5hbCB7CiAgICAgICAgYnl0ZXMgbWVtb3J5IGJ5dGVjb2RlID0gaGV4IjY5NjBmZjYwMDA1MjYwMjA2MDAwZjM2MDAwNTI2MDBhNjAxNmYzIjsKICAgICAgICBhZGRyZXNzIGFkZHI7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBjcmVhdGUodmFsdWUsIG9mZnNldCwgc2l6ZSkKICAgICAgICAgICAgYWRkciA6PSBjcmVhdGUoMCwgYWRkKGJ5dGVjb2RlLCAweDIwKSwgMHgxMykKICAgICAgICB9CiAgICAgICAgcmVxdWlyZShhZGRyICE9IGFkZHJlc3MoMCkpOwoKICAgICAgICBlbWl0IExvZyhhZGRyKTsKICAgIH0KfQoKaW50ZXJmYWNlIElDb250cmFjdCB7CiAgICBmdW5jdGlvbiBnZXRWYWx1ZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7Cn0KCi8vIGh0dHBzOi8vd3d3LmV2bS5jb2Rlcy9wbGF5Z3JvdW5kCi8qClJ1biB0aW1lIGNvZGUgLSByZXR1cm4gMjU1CjYwZmY2MDAwNTI2MDIwNjAwMGYzCgovLyBTdG9yZSAyNTUgdG8gbWVtb3J5Cm1zdG9yZShwLCB2KSAtIHN0b3JlIHYgYXQgbWVtb3J5IHAgdG8gcCArIDMyCgpQVVNIMSAweGZmClBVU0gxIDAKTVNUT1JFCgovLyBSZXR1cm4gMzIgYnl0ZXMgZnJvbSBtZW1vcnkKcmV0dXJuKHAsIHMpIC0gZW5kIGV4ZWN1dGlvbiBhbmQgcmV0dXJuIGRhdGEgZnJvbSBtZW1vcnkgcCB0byBwICsgcwoKUFVTSDEgMHgyMApQVVNIMSAwClJFVFVSTgoKQ3JlYXRpb24gY29kZSAtIHJldHVybiBydW50aW1lIGNvZGUKNjk2MGZmNjAwMDUyNjAyMDYwMDBmMzYwMDA1MjYwMGE2MDE2ZjMKCi8vIFN0b3JlIHJ1biB0aW1lIGNvZGUgdG8gbWVtb3J5ClBVU0gxMCAwWDYwZmY2MDAwNTI2MDIwNjAwMGYzClBVU0gxIDAKTVNUT1JFCgovLyBSZXR1cm4gMTAgYnl0ZXMgZnJvbSBtZW1vcnkgc3RhcnRpbmcgYXQgb2Zmc2V0IDIyClBVU0gxIDB4MGEKUFVTSDEgMHgxNgpSRVRVUk4KKi8K"}],Bu=`

    Simple example of contract written in bytecode

    +`,bu=({prev:s,next:a})=>i.jsx(A,{version:Cu,title:ju,description:Au,cyfrinLink:uu,html:mu,prev:s,next:a,codes:yu}),wu="0.8.26",ku="Simple Bytecode Contract",Zu="Simple example of contract written in bytecode",Wu="",Bu=[{fileName:"Factory.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgZXZlbnQgTG9nKGFkZHJlc3MgYWRkcik7CgogICAgLy8gRGVwbG95cyBhIGNvbnRyYWN0IHRoYXQgYWx3YXlzIHJldHVybnMgMjU1CiAgICB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J1biB0aW1lIGNvZGUgdG8gbWVtb3J5ClBVU0gxMCAwWDYwZmY2MDAwNTI2MDIwNjAwMGYzClBVU0gxIDAKTVNUT1JFCgovLyBSZXR1cm4gMTAgYnl0ZXMgZnJvbSBtZW1vcnkgc3RhcnRpbmcgYXQgb2Zmc2V0IDIyClBVU0gxIDB4MGEKUFVTSDEgMHgxNgpSRVRVUk4KKi8K"}],Gu=`

    Simple example of contract written in bytecode

    // SPDX-License-Identifier: MIT
     pragma solidity ^0.8.26;
     
    @@ -2819,7 +2819,7 @@ PUSH1 0x0a
     PUSH1 0x16
     RETURN
     */
    -
    `,fu=({prev:s,next:a})=>i.jsx(A,{version:wu,title:ku,description:Zu,cyfrinLink:Wu,html:Bu,prev:s,next:a,codes:Gu}),Vu="0.8.26",Yu="Time Lock",Xu="Time Lock",vu="",Ru=[{fileName:"TimeLock.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRpbWVMb2NrIHsKICAgIGVycm9yIE5vdE93bmVyRXJyb3IoKTsKICAgIGVycm9yIEFscmVhZHlRdWV1ZWRFcnJvcihieXRlczMyIHR4SWQpOwogICAgZXJyb3IgVGltZXN0YW1wTm90SW5SYW5nZUVycm9yKHVpbnQyNTYgYmxvY2tUaW1lc3RhbXAsIHVpbnQyNTYgdGltZXN0YW1wKTsKICAgIGVycm9yIE5vdFF1ZXVlZEVycm9yKGJ5dGVzMzIgdHhJZCk7CiAgICBlcnJvciBUaW1lc3RhbXBOb3RQYXNzZWRFcnJvcih1aW50MjU2IGJsb2NrVGltZXN0bWFwLCB1aW50MjU2IHRpbWVzdGFtcCk7CiAgICBlcnJvciBUaW1lc3RhbXBFeHBpcmVkRXJyb3IodWludDI1NiBibG9ja1RpbWVzdGFtcCwgdWludDI1NiBleHBpcmVzQXQpOwogICAgZXJyb3IgVHhGYWlsZWRFcnJvcigpOwoKICAgIGV2ZW50IFF1ZXVlKAogICAgICAgIGJ5dGVzMzIgaW5kZXhlZCB0eElkLAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCB0YXJnZXQsCiAgICAgICAgdWludDI1NiB2YWx1ZSwKICAgICAgICBzdHJpbmcgZnVuYywKICAgICAgICBieXRlcyBkYXRhLAogICAgICAgIHVpbnQyNTYgdGltZXN0YW1wCiAgICApOwogICAgZXZlbnQgRXhlY3V0ZSgKICAgICAgICBieXRlczMyIGluZGV4ZWQgdHhJZCwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgdGFyZ2V0LAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgc3RyaW5nIGZ1bmMsCiAgICAgICAgYnl0ZXMgZGF0YSwKICAgICAgICB1aW50MjU2IHRpbWVzdGFtcAogICAgKTsKICAgIGV2ZW50IENhbmNlbChieXRlczMyIGluZGV4ZWQgdHhJZCk7CgogICAgdWludDI1NiBwdWJsaWMgY29uc3RhbnQgTUlOX0RFTEFZID0gMTA7IC8vIHNlY29uZHMKICAgIHVpbnQyNTYgcHVibGljIGNvbnN0YW50IE1BWF9ERUxBWSA9IDEwMDA7IC8vIHNlY29uZHMKICAgIHVpbnQyNTYgcHVibGljIGNvbnN0YW50IEdSQUNFX1BFUklPRCA9IDEwMDA7IC8vIHNlY29uZHMKCiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIC8vIHR4IGlkID0+IHF1ZXVlZAogICAgbWFwcGluZyhieXRlczMyID0+IGJvb2wpIHB1YmxpYyBxdWV1ZWQ7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIG1vZGlmaWVyIG9ubHlPd25lcigpIHsKICAgICAgICBpZiAobXNnLnNlbmRlciAhPSBvd25lcikgewogICAgICAgICAgICByZXZlcnQgTm90T3duZXJFcnJvcigpOwogICAgICAgIH0KICAgICAgICBfOwogICAgfQoKICAgIHJlY2VpdmUoK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F0YSA9IF9kYXRhOwogICAgICAgIH0KCiAgICAgICAgLy8gY2FsbCB0YXJnZXQKICAgICAgICAoYm9vbCBvaywgYnl0ZXMgbWVtb3J5IHJlcykgPSBfdGFyZ2V0LmNhbGx7dmFsdWU6IF92YWx1ZX0oZGF0YSk7CiAgICAgICAgaWYgKCFvaykgewogICAgICAgICAgICByZXZlcnQgVHhGYWlsZWRFcnJvcigpOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBFeGVjdXRlKHR4SWQsIF90YXJnZXQsIF92YWx1ZSwgX2Z1bmMsIF9kYXRhLCBfdGltZXN0YW1wKTsKCiAgICAgICAgcmV0dXJuIHJlczsKICAgIH0KCiAgICBmdW5jdGlvbiBjYW5jZWwoYnl0ZXMzMiBfdHhJZCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICAgICAgICBpZiAoIXF1ZXVlZFtfdHhJZF0pIHsKICAgICAgICAgICAgcmV2ZXJ0IE5vdFF1ZXVlZEVycm9yKF90eElkKTsKICAgICAgICB9CgogICAgICAgIHF1ZXVlZFtfdHhJZF0gPSBmYWxzZTsKCiAgICAgICAgZW1pdCBDYW5jZWwoX3R4SWQpOwogICAgfQp9Cg=="}],Nu=`

    TimeLock is a contract that publishes a transaction to be executed in the future. +`,fu=({prev:s,next:a})=>i.jsx(A,{version:wu,title:ku,description:Zu,cyfrinLink:Wu,html:Gu,prev:s,next:a,codes:Bu}),Vu="0.8.26",Yu="Time Lock",Xu="Time Lock",vu="",Ru=[{fileName:"TimeLock.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRpbWVMb2NrIHsKICAgIGVycm9yIE5vdE93bmVyRXJyb3IoKTsKICAgIGVycm9yIEFscmVhZHlRdWV1ZWRFcnJvcihieXRlczMyIHR4SWQpOwogICAgZXJyb3IgVGltZXN0YW1wTm90SW5SYW5nZUVycm9yKHVpbnQyNTYgYm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tcCBUaW1lc3RhbXAgYWZ0ZXIgd2hpY2ggdGhlIHRyYW5zYWN0aW9uIGNhbiBiZSBleGVjdXRlZC4KICAgICAqLwogICAgZnVuY3Rpb24gcXVldWUoCiAgICAgICAgYWRkcmVzcyBfdGFyZ2V0LAogICAgICAgIHVpbnQyNTYgX3ZhbHVlLAogICAgICAgIHN0cmluZyBjYWxsZGF0YSBfZnVuYywKICAgICAgICBieXRlcyBjYWxsZGF0YSBfZGF0YSwKICAgICAgICB1aW50MjU2IF90aW1lc3RhbXAKICAgICkgZXh0ZXJuYWwgb25seU93bmVyIHJldHVybnMgKGJ5dGVzMzIgdHhJZCkgewogICAgICAgIHR4SWQgPSBnZXRUeElkKF90YXJnZXQsIF92YWx1ZSwgX2Z1bmMsIF9kYXRhLCBfdGltZXN0YW1wKTsKICAgICAgICBpZiAocXVldWVkW3R4SWRdKSB7CiAgICAgICAgICAgIHJldmVydCBBbHJlYWR5UXVldWVkRXJyb3IodHhJZCk7CiAgICAgICAgfQogICAgICAgIC8vIC0tLXwtLS0tLS0tLS0tLS18LS0tLS0tLS0tLS0tLS0tfC0tLS0tLS0KICAgICAgICAvLyAgYmxvY2sgICAgYmxvY2sgKyBtaW4gICAgIGJsb2NrICsgbWF4CiAgICAgICAgaWYgKAogICAgICAgICAgICBfdGltZXN0YW1wIDwgYmxvY2sudGltZXN0YW1wICsgTUlOX0RFTEFZCiAgICAgICAgICAgICAgICB8fCBfdGltZXN0YW1wID4gYmxvY2sudGltZXN0YW1wICsgTUFYX0RFTEFZCiAgICAgICAgKSB7CiAgICAgICAgICAgIHJldmVydCBUaW1lc3RhbXBOb3RJblJhbmdlRXJyb3IoYmxvY2sudGltZXN0YW1wLCBfdGltZXN0YW1wKTsKICAgICAgICB9CgogICAgICAgIHF1ZXVlZFt0eElkXSA9IHRydWU7CgogICAgICAgIGVtaXQgUXVldWUodHhJZCwgX3RhcmdldCwgX3ZhbHVlLCBfZnVuYywgX2RhdGEsIF90aW1lc3RhbXApOw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cmVwYXJlIGRhdGEKICAgICAgICBieXRlcyBtZW1vcnkgZGF0YTsKICAgICAgICBpZiAoYnl0ZXMoX2Z1bmMpLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgLy8gZGF0YSA9IGZ1bmMgc2VsZWN0b3IgKyBfZGF0YQogICAgICAgICAgICBkYXRhID0gYWJpLmVuY29kZVBhY2tlZChieXRlczQoa2VjY2FrMjU2KGJ5dGVzKF9mdW5jKSkpLCBfZGF0YSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgLy8gY2FsbCBmYWxsYmFjayB3aXRoIGRhdGEKICAgICAgICAgICAgZGF0YSA9IF9kYXRhOwogICAgICAgIH0KCiAgICAgICAgLy8gY2FsbCB0YXJnZXQKICAgICAgICAoYm9vbCBvaywgYnl0ZXMgbWVtb3J5IHJlcykgPSBfdGFyZ2V0LmNhbGx7dmFsdWU6IF92YWx1ZX0oZGF0YSk7CiAgICAgICAgaWYgKCFvaykgewogICAgICAgICAgICByZXZlcnQgVHhGYWlsZWRFcnJvcigpOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBFeGVjdXRlKHR4SWQsIF90YXJnZXQsIF92YWx1ZSwgX2Z1bmMsIF9kYXRhLCBfdGltZXN0YW1wKTsKCiAgICAgICAgcmV0dXJuIHJlczsKICAgIH0KCiAgICBmdW5jdGlvbiBjYW5jZWwoYnl0ZXMzMiBfdHhJZCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICAgICAgICBpZiAoIXF1ZXVlZFtfdHhJZF0pIHsKICAgICAgICAgICAgcmV2ZXJ0IE5vdFF1ZXVlZEVycm9yKF90eElkKTsKICAgICAgICB9CgogICAgICAgIHF1ZXVlZFtfdHhJZF0gPSBmYWxzZTsKCiAgICAgICAgZW1pdCBDYW5jZWwoX3R4SWQpOwogICAgfQp9Cg=="}],Nu=`

    TimeLock is a contract that publishes a transaction to be executed in the future. After a minimum waiting period, the transaction can be executed.

    TimeLocks are commonly used in DAOs.

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

    emit Cancel(_txId); } } -
    `,Hu=({prev:s,next:a})=>i.jsx(A,{version:Vu,title:Yu,description:Xu,cyfrinLink:vu,html:Nu,prev:s,next:a,codes:Ru}),Fu="0.8.26",Ku="Uni-Directional Payment Channel",Mu="An example of uni-directional payment channels in Solidity",Su="",xu=[{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIk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ICAgICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgICAgIHIgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHgyMCkpCiAgICAgICAgICAgICAgICBzIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4NDApKQogICAgICAgICAgICAgICAgdiA6PSBieXRlKDAsIG1sb2FkKGFkZChzaWduYXR1cmUsIDB4NjApKSkKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gdHJ5UmVjb3ZlcihoYXNoLCB2LCByLCBzKTsKICAgICAgICB9IGVsc2UgaWYgKHNpZ25hdHVyZS5sZW5ndGggPT0gNjQpIHsKICAgICAgICAgICAgYnl0ZXMzMiByOwogICAgICAgICAgICBieXRlczMyIHZzOwogICAgICAgICAgICAvLyBlY3JlY292ZXIgdGFrZXMgdGhlIHNpZ25hdHVyZSBwYXJhbWV0ZXJzLCBhbmQgdGhlIG9ubHkgd2F5IHRvIGdldCB0aGVtCiAgICAgICAgICAgIC8vIGN1cnJlbnRseSBpcyB0byB1c2UgYXNzZW1ibHkuCiAgICAgICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgICAgIHIgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHgyMCkpCiAgICAgICAgICAgICAgICB2cyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gdHJ5UmVjb3ZlcihoYXNoLCByLCB2cyk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIChhZGRyZXNzKDApLCBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCk7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHJlY292ZXIoYnl0ZXMzMiBoYXNoLCBieXRlcyBtZW1vcnkgc2lnbmF0dXJlKSBpbnRlcm5hbCBwdXJlIHJldHVybnMgKGFkZHJlc3MpIHsKICAgICAgICAoYW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TsKICAgICAgICBzZWxmZGVzdHJ1Y3Qoc2VuZGVyKTsKICAgIH0KfQo="}],Ju=`

    Payment channels allow participants to repeatedly transfer Ether off chain.

    +`,Hu=({prev:s,next:a})=>i.jsx(A,{version:Vu,title:Yu,description:Xu,cyfrinLink:vu,html:Nu,prev:s,next:a,codes:Ru}),Fu="0.8.26",Ku="Uni-Directional Payment Channel",Mu="An example of uni-directional payment channels in Solidity",Su="",xu=[{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDgoKHVpbnQyNTYodnMpID4+IDI1NSkgKyAyNyk7CiAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzMzIgciwgYnl0ZXMzMiB2cykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIF90aHJvd0Vycm9yKGVycm9yKTsKICAgICAgICByZXR1cm4gcmVjb3ZlcmVkOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyeVJlY292ZXIoYnl0ZXMzMiBoYXN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4IHYsIGJ5dGVzMzIgciwgYnl0ZXMzMiBzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgKGFkZHJlc3MgcmVjb3ZlcmVkLCBSZWNvdmVyRXJyb3IgZXJyb3IpID0gdHJ5UmVjb3ZlcihoYXNoLCB2LCByLCBzKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKGJ5dGVzMzIgaGFzaCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyKQogICAgewogICAgICAgIC8vIDMyIGlzIHRoZSBsZW5ndGggaW4gYnl0ZXMgb2YgaGFzaCwKICAgICAgICAvLyBlbmZvcmNlZCBieSB0aGUgdHlwZSBzaWduYXR1cmUgYWJvdmUKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KAogICAgICAgICAgICBhYmkuZW5jb2RlUGFja2VkKCJceDE5RXRoZXJldW0gU2lnbmVkIE1lc3NhZ2U6XG4zMiIsIGhhc2gpCiAgICAgICAgKTsKICAgIH0KfQo="},{fileName:"UniDirectionalPaymentChannel.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9FQ0RTQS5zb2wiOwoKY29udHJhY3QgUmVlbnRyYW5jeUd1YXJkIHsKICAgIGJvb2wgcHJpdmF0ZSBsb2NrZWQ7CgogICAgbW9kaWZpZXIgZ3VhcmQoKSB7CiAgICAgICAgcmVxdWlyZSghbG9ja2VkKTsKICAgICAgICBsb2NrZWQgPSB0cnVlOwogICAgICAgIF87CiAgICAgICAgbG9ja2VkID0gZmFsc2U7CiAgICB9Cn0KCmNvbnRyY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ZXR1cm4gX2dldEhhc2goX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gX2dldEV0aFNpZ25lZEhhc2godWludDI1NiBfYW1vdW50KQogICAgICAgIHByaXZhdGUKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4gX2dldEhhc2goX2Ftb3VudCkudG9FdGhTaWduZWRNZXNzYWdlSGFzaCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEV0aFNpZ25lZEhhc2godWludDI1NiBfYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJ5dGVzMzIpCiAgICB7CiAgICAgICAgcmV0dXJuIF9nZXRFdGhTaWduZWRIYXNoKF9hbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF92ZXJpZnkodWludDI1NiBfYW1vdW50LCBieXRlcyBtZW1vcnkgX3NpZykKICAgICAgICBwcml2YXRlCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIF9nZXRFdGhTaWduZWRIYXNoKF9hbW91bnQpLnJlY292ZXIoX3NpZykgPT0gc2VuZGVyOwogICAgfQoKICAgIGZ1bmN0aW9uIHZlcmlmeSh1aW50MjU2IF9hbW91bnQsIGJ5dGVzIG1lbW9yeSBfc2lnKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIF92ZXJpZnkoX2Ftb3VudCwgX3NpZyk7CiAgICB9CgogICAgZnVuY3Rpb24gY2xvc2UodWludDI1NiBfYW1vdW50LCBieXRlcyBtZW1vcnkgX3NpZykgZXh0ZXJuYWwgZ3VhcmQgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSByZWNlaXZlciwgIiFyZWNlaXZlciIpOwogICAgICAgIHJlcXVpcmUoX3ZlcmlmeShfYW1vdW50LCBfc2lnKSwgImludmFsaWQgc2lnIik7CgogICAgICAgIChib29sIHNlbnQsKSA9IHJlY2VpdmVyLmNhbGx7dmFsdWU6IF9hbW91bnR9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgICAgIHNlbGZkZXN0cnVjdChzZW5kZXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNhbmNlbCgpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gc2VuZGVyLCAiIXNlbmRlciIpOwogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wID49IGV4cGlyZXNBdCwgIiFleHBpcmVkIik7CiAgICAgICAgc2VsZmRlc3RydWN0KHNlbmRlcik7CiAgICB9Cn0K"}],Ju=`

    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.
    • @@ -3021,19 +3021,35 @@ After a minimum waiting period, the transaction can be executed.

      return _getHash(_amount); } - function _getEthSignedHash(uint256 _amount) private view returns (bytes32) { + function _getEthSignedHash(uint256 _amount) + private + view + returns (bytes32) + { return _getHash(_amount).toEthSignedMessageHash(); } - function getEthSignedHash(uint256 _amount) external view returns (bytes32) { + function getEthSignedHash(uint256 _amount) + external + view + returns (bytes32) + { return _getEthSignedHash(_amount); } - function _verify(uint256 _amount, bytes memory _sig) private view returns (bool) { + function _verify(uint256 _amount, bytes memory _sig) + private + view + returns (bool) + { return _getEthSignedHash(_amount).recover(_sig) == sender; } - function verify(uint256 _amount, bytes memory _sig) external view returns (bool) { + function verify(uint256 _amount, bytes memory _sig) + external + view + returns (bool) + { return _verify(_amount, _sig); } @@ -3080,7 +3096,11 @@ After a minimum waiting period, the transaction can be executed.

      } } - function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { + function tryRecover(bytes32 hash, bytes memory signature) + internal + pure + returns (address, RecoverError) + { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ @@ -3111,25 +3131,44 @@ After a minimum waiting period, the transaction can be executed.

      } } - function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { + function recover(bytes32 hash, bytes memory signature) + internal + pure + returns (address) + { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } - function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { - bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); + function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) + internal + pure + returns (address, RecoverError) + { + bytes32 s = vs + & bytes32( + 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + ); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } - function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { + function recover(bytes32 hash, bytes32 r, bytes32 vs) + internal + pure + returns (address) + { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } - function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { + function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) + internal + pure + returns (address, RecoverError) + { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most @@ -3139,7 +3178,10 @@ After a minimum waiting period, the transaction can be executed.

      // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. - if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { + if ( + uint256(s) + > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0 + ) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { @@ -3155,16 +3197,26 @@ After a minimum waiting period, the transaction can be executed.

      return (signer, RecoverError.NoError); } - function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { + function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) + internal + pure + returns (address) + { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } - function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { + function toEthSignedMessageHash(bytes32 hash) + internal + pure + returns (bytes32) + { // 32 is the length in bytes of hash, // enforced by the type signature above - return keccak256(abi.encodePacked("\\x19Ethereum Signed Message:\\n32", hash)); + return keccak256( + abi.encodePacked("\\x19Ethereum Signed Message:\\n32", hash) + ); } } `,zu=({prev:s,next:a})=>i.jsx(A,{version:Fu,title:Ku,description:Mu,cyfrinLink:Su,html:Ju,prev:s,next:a,codes:xu}),Du="0.8.26",Eu="Upgradeable Proxy",Qu="Example of upgradeable proxy",Tu="",Uu=[{fileName:"UpgradeableProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIFRyYW5zcGFyZW50IHVwZ3JhZGVhYmxlIHByb3h5IHBhdHRlcm4KCmNvbnRyYWN0IENvdW50ZXJWMSB7CiAgICB1aW50MjU2IHB1YmxpYyBjb3VudDsKCiAgICBmdW5jdGlvbiBpbmMoKSBleHRlcm5hbCB7CiAgICAgICAgY291bnQgKz0gMTsKICAgIH0KfQoKY29udHJhY3QgQ291bnRlclYyIHsKICAgIHVpbnQyNTYgcHVibGljIGNvdW50OwoKICAgIGZ1bmN0aW9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IGJ5dGVzCiAgICAgICAgICAgIGNhbGxkYXRhY29weSgwLCAwLCBjYWxsZGF0YXNpemUoKSkKCiAgICAgICAgICAgIC8vIENhbGwgdGhlIGltcGxlbWVudGF0aW9uLgogICAgICAgICAgICAvLyBvdXQgYW5kIG91dHNpemUgYXJlIDAgYmVjYXVzZSB3ZSBkb24ndCBrbm93IHRoZSBzaXplIHlldC4KCiAgICAgICAgICAgIC8vIGRlbGVnYXRlY2FsbChnLCBhLCBpbiwgaW5zaXplLCBvdXQsIG91dHNpemUpIC0KICAgICAgICAgICAgLy8gLSBjYWxsIGNvbnRyYWN0IGF0IGFkZHJlc3MgYQogICAgICAgICAgICAvLyAtIHdpdGggaW5wdXQgbWVtW2lu4oCmKGluK2luc2l6ZSkpCiAgICAgICAgICAgIC8vIC0gcHJvdmlkaW5nIGcgZ2FzCiAgICAgICAgICAgIC8vIC0gYW5kIG91dHB1dCBhcmVhIG1lbVtvdXTigKYob3V0K291dHNpemUpKQogICAgICAgICAgICAvLyAtIHJldHVybmluZyAwIG9uIGVycm9yIChlZy4gb3V0IG9mIGdhcykgYW5kIDEgb24gc3VjY2VzcwogICAgICAgICAgICBsZXQgcmVzdWx0IDo9CiAgICAgICAgICAgICAgICBkZWxlZ2F0ZWNhbGwoZ2FzKCksIF9pbXBsZW1lbnRhdGlvbiwgMCwgY2FsbGRhdGFzaXplKCksIDAsIDApCgogICAgICAgICAgICAvLyBDb3B5IHRoZSByZXR1cm5lZCBkYXRhLgogICAgICAgICAgICAvLyByZXR1cm5kYXRhY29weSh0LCBmLCBzKSAtIGNvcHkgcyBieXRlcyBmcm9tIHJldHVybmRhdGEgYXQgcG9zaXRpb24gZiB0byBtZW0gYXQgcG9zaXRpb24gdAogICAgICAgICAgICAvLyByZXR1cm5kYXRhc2l6ZSgpIC0gc2l6ZSBvZiB0aGUgbGFzdCByZXR1cm5kYXRhCiAgICAgICAgICAgIHJldHVybmRhdGFjb3B5KDAsIDAsIHJldHVybmRhdGFzaXplKCkpCgogICAgICAgICAgICBzd2l0Y2ggcmVzdWx0CiAgICAgICAgICAgIC8vIGRlbGVnYXRlY2FsbCByZXR1cm5zIDAgb24gZXJyb3IuCiAgICAgICAgICAgIGNhc2UgMCB7CiAgICAgICAgICAgICAgICAvLyByZXZlcnQocCwgcykgLSBlbmQgZXhlY3V0aW9uLCByZXZlcnQgc3RhdGUgY2hhbmdlcywgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldmVydCgwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgICAgIGRlZmF1bHQgewogICAgICAgICAgICAgICAgLy8gcmV0dXJuKHAsIHMpIC0gZW5kIGV4ZWN1dGlvbiwgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldHVybigwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIF9mYWxsYmFjaygpIHByaXZhdGUgewogICAgICAgIF9kZWxlZ2F0ZShfZ2V0SW1wbGVtZW50YXRpb24oKSk7CiAgICB9CgogICAgZmFsbGJhY2soKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBfZmFsbGJhY2soKTsKICAgIH0KCiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgX2ZhbGxiYWNrKCk7CiAgICB9Cn0KCmNvbnRyYWN0IFByb3h5QWRtaW4gewogICAgYWRkcmVzcyBwdWJsaWMgb3duZXI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIG1vZGlmaWVyIG9ubHlPd25lcigpIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gb3duZXIsICJub3Qgb3duZXIiKTsKICAgICAgICBfOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldFByb3h5QWRtaW4oYWRkcmVzcyBwcm94eSkgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChhZGRyZXNzKSB7CiAgICAgICAgKGJvb2wgb2ssIGJ5dGVzIG1lbW9yeSByZXMpID0KICAgICAgICAgICAgcHJveHkuc3RhdGljY2FsbChhYmkuZW5jb2RlQ2FsbChQcm94eS5hZG1pbiwgKCkpKTsKICAgICAgICByZXF1aXJlKG9rLCAiY2FsbCBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gYWJpLmRlY29kZShyZXMsIChhZGRyZXNzKSk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UHJveHlJbXBsZW1lbnRhdGlvbihhZGRyZXNzIHByb3h5KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgKGJvb2wgb2ssIGJ5dGVzIG1lbW9yeSByZXMpID0KICAgICAgICAgICAgcHJveHkuc3RhdGljY2FsbChhYmkuZW5jb2RlQ2FsbChQcm94eS5pbXBsZW1lbnRhdGlvbiwgKCkpKTsKICAgICAgICByZXF1aXJlKG9rLCAiY2FsbCBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gYWJpLmRlY29kZShyZXMsIChhZGRyZXNzKSk7CiAgICB9CgogICAgZnVuY3Rpb24gY2hhbmdlUHJveHlBZG1pbihhZGRyZXNzIHBheWFibGUgcHJveHksIGFkZHJlc3MgYWRtaW4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBvbmx5T3duZXIKICAgIHsKICAgICAgICBQcm94eShwcm94eSkuY2hhbmdlQWRtaW4oYWRtaW4pOwogICAgfQoKICAgIGZ1bmN0aW9uIHVwZ3JhZGUoYWRkcmVzcyBwYXlhYmxlIHByb3h5LCBhZGRyZXNzIGltcGxlbWVudGF0aW9uKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgb25seU93bmVyCiAgICB7CiAgICAgICAgUHJveHkocHJveHkpLnVwZ3JhZGVUbyhpbXBsZW1lbnRhdGlvbik7CiAgICB9Cn0KCmxpYnJhcnkgU3RvcmFnZVNsb3QgewogICAgc3RydWN0IEFkZHJlc3NTbG90IHsKICAgICAgICBhZGRyZXNzIHZhbHVlOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEFkZHJlc3NTbG90KGJ5dGVzMzIgc2xvdCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChBZGRyZXNzU2xvdCBzdG9yYWdlIHIpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICByLnNsb3QgOj0gc2xvdAogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgVGVzdFNsb3QgewogICAgYnl0ZXMzMiBwdWJsaWMgY29uc3RhbnQgc2xvdCA9IGtlY2NhazI1NigiVEVTVF9TTE9UIik7CgogICAgZnVuY3Rpb24gZ2V0U2xvdCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYWRkcmVzcykgewogICAgICAgIHJldHVybiBTdG9yYWdlU2xvdC5nZXRBZGRyZXNzU2xvdChzbG90KS52YWx1ZTsKICAgIH0KCiAgICBmdW5jdGlvbiB3cml0ZVNsb3QoYWRkcmVzcyBfYWRkcikgZXh0ZXJuYWwgewogICAgICAgIFN0b3JhZ2VTbG90LmdldEFkZHJlc3NTbG90KHNsb3QpLnZhbHVlID0gX2FkZHI7CiAgICB9Cn0K"}],_u=`

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

      @@ -3624,7 +3676,7 @@ Each slot in the array can store 32 bytes.

      } } } -`,ky=({prev:s,next:a})=>i.jsx(A,{version:Ay,title:uy,description:yy,cyfrinLink:my,html:wy,prev:s,next:a,codes:by}),Zy="0.8.26",Wy="Assembly Loop",Gy="Example of loop in assembly",By="https://www.cyfrin.io/glossary/assembly-loop-code-example",fy=[{fileName:"AssemblyLoop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5TG9vcCB7CiAgICBmdW5jdGlvbiB5dWxfZm9yX2xvb3AoKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGZvciB7IGxldCBpIDo9IDAgfSBsdChpLCAxMCkgeyBpIDo9IGFkZChpLCAxKSB9IHsgeiA6PSBhZGQoeiwgMSkgfQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB5dWxfd2hpbGVfbG9vcCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTYgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGkgOj0gMAogICAgICAgICAgICBmb3Ige30gbHQoaSwgNSkge30gewogICAgICAgICAgICAgICAgaSA6PSBhZGQoaSwgMSkKICAgICAgICAgICAgICAgIHogOj0gYWRkKHosIDEpCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0K"}],Vy=`

      Example of loop in assembly

      +`,ky=({prev:s,next:a})=>i.jsx(A,{version:Ay,title:uy,description:yy,cyfrinLink:my,html:wy,prev:s,next:a,codes:by}),Zy="0.8.26",Wy="Assembly Loop",By="Example of loop in assembly",Gy="https://www.cyfrin.io/glossary/assembly-loop-code-example",fy=[{fileName:"AssemblyLoop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5TG9vcCB7CiAgICBmdW5jdGlvbiB5dWxfZm9yX2xvb3AoKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGZvciB7IGxldCBpIDo9IDAgfSBsdChpLCAxMCkgeyBpIDo9IGFkZChpLCAxKSB9IHsgeiA6PSBhZGQoeiwgMSkgfQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB5dWxfd2hpbGVfbG9vcCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTYgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGkgOj0gMAogICAgICAgICAgICBmb3Ige30gbHQoaSwgNSkge30gewogICAgICAgICAgICAgICAgaSA6PSBhZGQoaSwgMSkKICAgICAgICAgICAgICAgIHogOj0gYWRkKHosIDEpCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0K"}],Vy=`

      Example of loop in assembly

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

      } } } -
      `,Yy=({prev:s,next:a})=>i.jsx(A,{version:Zy,title:Wy,description:Gy,cyfrinLink:By,html:Vy,prev:s,next:a,codes:fy}),Xy="0.8.26",vy="Assembly Math",Ry="Example of math in assembly",Ny="https://www.cyfrin.io/glossary/assembly-math-code-example",Hy=[{fileName:"AssemblyMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5TWF0aCB7CiAgICBmdW5jdGlvbiB5dWxfYWRkKHVpbnQyNTYgeCwgdWludDI1NiB5KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHogOj0gYWRkKHgsIHkpCiAgICAgICAgICAgIGlmIGx0KHosIHgpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24geXVsX211bCh1aW50MjU2IHgsIHVpbnQyNTYgeSkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICBjYXNlIDAgeyB6IDo9IDAgfQogICAgICAgICAgICBkZWZhdWx0IHsKICAgICAgICAgICAgICAgIHogOj0gbXVsKHgsIHkpCiAgICAgICAgICAgICAgICBpZiBpc3plcm8oZXEoZGl2KHosIHgpLCB5KSkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIC8vIFJvdW5kIHRvIG5lYXJlc3QgbXVsdGlwbGUgb2YgYgogICAgZnVuY3Rpb24geXVsX2ZpeGVkX3BvaW50X3JvdW5kKHVpbnQyNTYgeCwgdWludDI1NiBiKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBiID0gMTAwCiAgICAgICAgICAgIC8vIHggPSA5MAogICAgICAgICAgICAvLyB6ID0gOTAgLyAxMDAgKiAxMDAgPSAwLCB3YW50IHogPSAxMDAKICAgICAgICAgICAgLy8geiA6PSBtdWwoZGl2KHgsIGIpLCBiKQoKICAgICAgICAgICAgbGV0IGhhbGYgOj0gZGl2KGIsIDIpCiAgICAgICAgICAgIHogOj0gYWRkKHgsIGhhbGYpCiAgICAgICAgICAgIHogOj0gbXVsKGRpdih6LCBiKSwgYikKICAgICAgICAgICAgLy8geCA9IDkwCiAgICAgICAgICAgIC8vIGhhbGYgPSA1MAogICAgICAgICAgICAvLyB6ID0gOTAgKyA1MCA9IDE0MAogICAgICAgICAgICAvLyB6ID0gMTQwIC8gMTAwICogMTAwID0gMTAwCiAgICAgICAgfQogICAgfQp9Cg=="}],Fy=`

      Example of math in assembly

      +`,Yy=({prev:s,next:a})=>i.jsx(A,{version:Zy,title:Wy,description:By,cyfrinLink:Gy,html:Vy,prev:s,next:a,codes:fy}),Xy="0.8.26",vy="Assembly Math",Ry="Example of math in assembly",Ny="https://www.cyfrin.io/glossary/assembly-math-code-example",Hy=[{fileName:"AssemblyMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5TWF0aCB7CiAgICBmdW5jdGlvbiB5dWxfYWRkKHVpbnQyNTYgeCwgdWludDI1NiB5KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHogOj0gYWRkKHgsIHkpCiAgICAgICAgICAgIGlmIGx0KHosIHgpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24geXVsX211bCh1aW50MjU2IHgsIHVpbnQyNTYgeSkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICBjYXNlIDAgeyB6IDo9IDAgfQogICAgICAgICAgICBkZWZhdWx0IHsKICAgICAgICAgICAgICAgIHogOj0gbXVsKHgsIHkpCiAgICAgICAgICAgICAgICBpZiBpc3plcm8oZXEoZGl2KHosIHgpLCB5KSkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIC8vIFJvdW5kIHRvIG5lYXJlc3QgbXVsdGlwbGUgb2YgYgogICAgZnVuY3Rpb24geXVsX2ZpeGVkX3BvaW50X3JvdW5kKHVpbnQyNTYgeCwgdWludDI1NiBiKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBiID0gMTAwCiAgICAgICAgICAgIC8vIHggPSA5MAogICAgICAgICAgICAvLyB6ID0gOTAgLyAxMDAgKiAxMDAgPSAwLCB3YW50IHogPSAxMDAKICAgICAgICAgICAgLy8geiA6PSBtdWwoZGl2KHgsIGIpLCBiKQoKICAgICAgICAgICAgbGV0IGhhbGYgOj0gZGl2KGIsIDIpCiAgICAgICAgICAgIHogOj0gYWRkKHgsIGhhbGYpCiAgICAgICAgICAgIHogOj0gbXVsKGRpdih6LCBiKSwgYikKICAgICAgICAgICAgLy8geCA9IDkwCiAgICAgICAgICAgIC8vIGhhbGYgPSA1MAogICAgICAgICAgICAvLyB6ID0gOTAgKyA1MCA9IDE0MAogICAgICAgICAgICAvLyB6ID0gMTQwIC8gMTAwICogMTAwID0gMTAwCiAgICAgICAgfQogICAgfQp9Cg=="}],Fy=`

      Example of math in assembly

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

      contract E is X, Y { constructor() Y("Y was called") X("X was called") {} } -
      `,Wm=({prev:s,next:a})=>i.jsx(A,{version:ym,title:mm,description:bm,cyfrinLink:wm,html:Zm,prev:s,next:a,codes:km}),Gm="0.8.26",Bm="Data Locations - Storage, Memory and Calldata",fm="Data locations - storage, memory and calldata",Vm="https://www.cyfrin.io/glossary/data-locations-storage-memory-and-calldata-code-example",Ym=[{fileName:"DataLocations.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IERhdGFMb2NhdGlvbnMgewogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CiAgICBtYXBwaW5nKHVpbnQyNTYgPT4gYWRkcmVzcykgbWFwOwoKICAgIHN0cnVjdCBNeVN0cnVjdCB7CiAgICAgICAgdWludDI1NiBmb287CiAgICB9CgogICAgbWFwcGluZyh1aW50MjU2ID0+IE15U3RydWN0KSBteVN0cnVjdHM7CgogICAgZnVuY3Rpb24gZigpIHB1YmxpYyB7CiAgICAgICAgLy8gY2FsbCBfZiB3aXRoIHN0YXRlIHZhcmlhYmxlcwogICAgICAgIF9mKGFyciwgbWFwLCBteVN0cnVjdHNbMV0pOwoKICAgICAgICAvLyBnZXQgYSBzdHJ1Y3QgZnJvbSBhIG1hcHBpbmcKICAgICAgICBNeVN0cnVjdCBzdG9yYWdlIG15U3RydWN0ID0gbXlTdHJ1Y3RzWzFdOwogICAgICAgIC8vIGNyZWF0ZSBhIHN0cnVjdCBpbiBtZW1vcnkKICAgICAgICBNeVN0cnVjdCBtZW1vcnkgbXlNZW1TdHJ1Y3QgPSBNeVN0cnVjdCgwKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfZigKICAgICAgICB1aW50MjU2W10gc3RvcmFnZSBfYXJyLAogICAgICAgIG1hcHBpbmcodWludDI1NiA9PiBhZGRyZXNzKSBzdG9yYWdlIF9tYXAsCiAgICAgICAgTXlTdHJ1Y3Qgc3RvcmFnZSBfbXlTdHJ1Y3QKICAgICkgaW50ZXJuYWwgewogICAgICAgIC8vIGRvIHNvbWV0aGluZyB3aXRoIHN0b3JhZ2UgdmFyaWFibGVzCiAgICB9CgogICAgLy8gWW91IGNhbiByZXR1cm4gbWVtb3J5IHZhcmlhYmxlcwogICAgZnVuY3Rpb24gZyh1aW50MjU2W10gbWVtb3J5IF9hcnIpIHB1YmxpYyByZXR1cm5zICh1aW50MjU2W10gbWVtb3J5KSB7CiAgICAgICAgLy8gZG8gc29tZXRoaW5nIHdpdGggbWVtb3J5IGFycmF5CiAgICB9CgogICAgZnVuY3Rpb24gaCh1aW50MjU2W10gY2FsbGRhdGEgX2FycikgZXh0ZXJuYWwgewogICAgICAgIC8vIGRvIHNvbWV0aGluZyB3aXRoIGNhbGxkYXRhIGFycmF5CiAgICB9Cn0K"}],Xm=`

      Variables are declared as either storage, memory or calldata to explicitly +`,Wm=({prev:s,next:a})=>i.jsx(A,{version:ym,title:mm,description:bm,cyfrinLink:wm,html:Zm,prev:s,next:a,codes:km}),Bm="0.8.26",Gm="Data Locations - Storage, Memory and Calldata",fm="Data locations - storage, memory and calldata",Vm="https://www.cyfrin.io/glossary/data-locations-storage-memory-and-calldata-code-example",Ym=[{fileName:"DataLocations.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IERhdGFMb2NhdGlvbnMgewogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CiAgICBtYXBwaW5nKHVpbnQyNTYgPT4gYWRkcmVzcykgbWFwOwoKICAgIHN0cnVjdCBNeVN0cnVjdCB7CiAgICAgICAgdWludDI1NiBmb287CiAgICB9CgogICAgbWFwcGluZyh1aW50MjU2ID0+IE15U3RydWN0KSBteVN0cnVjdHM7CgogICAgZnVuY3Rpb24gZigpIHB1YmxpYyB7CiAgICAgICAgLy8gY2FsbCBfZiB3aXRoIHN0YXRlIHZhcmlhYmxlcwogICAgICAgIF9mKGFyciwgbWFwLCBteVN0cnVjdHNbMV0pOwoKICAgICAgICAvLyBnZXQgYSBzdHJ1Y3QgZnJvbSBhIG1hcHBpbmcKICAgICAgICBNeVN0cnVjdCBzdG9yYWdlIG15U3RydWN0ID0gbXlTdHJ1Y3RzWzFdOwogICAgICAgIC8vIGNyZWF0ZSBhIHN0cnVjdCBpbiBtZW1vcnkKICAgICAgICBNeVN0cnVjdCBtZW1vcnkgbXlNZW1TdHJ1Y3QgPSBNeVN0cnVjdCgwKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfZigKICAgICAgICB1aW50MjU2W10gc3RvcmFnZSBfYXJyLAogICAgICAgIG1hcHBpbmcodWludDI1NiA9PiBhZGRyZXNzKSBzdG9yYWdlIF9tYXAsCiAgICAgICAgTXlTdHJ1Y3Qgc3RvcmFnZSBfbXlTdHJ1Y3QKICAgICkgaW50ZXJuYWwgewogICAgICAgIC8vIGRvIHNvbWV0aGluZyB3aXRoIHN0b3JhZ2UgdmFyaWFibGVzCiAgICB9CgogICAgLy8gWW91IGNhbiByZXR1cm4gbWVtb3J5IHZhcmlhYmxlcwogICAgZnVuY3Rpb24gZyh1aW50MjU2W10gbWVtb3J5IF9hcnIpIHB1YmxpYyByZXR1cm5zICh1aW50MjU2W10gbWVtb3J5KSB7CiAgICAgICAgLy8gZG8gc29tZXRoaW5nIHdpdGggbWVtb3J5IGFycmF5CiAgICB9CgogICAgZnVuY3Rpb24gaCh1aW50MjU2W10gY2FsbGRhdGEgX2FycikgZXh0ZXJuYWwgewogICAgICAgIC8vIGRvIHNvbWV0aGluZyB3aXRoIGNhbGxkYXRhIGFycmF5CiAgICB9Cn0K"}],Xm=`

      Variables are declared as either storage, memory or calldata to explicitly specify the location of the data.

      • storage - variable is a state variable (store on blockchain)
      • @@ -4121,7 +4173,7 @@ specify the location of the data.

        // do something with calldata array } } -`,vm=({prev:s,next:a})=>i.jsx(A,{version:Gm,title:Bm,description:fm,cyfrinLink:Vm,html:Xm,prev:s,next:a,codes:Ym}),Rm="0.8.26",Nm="Chainlink Price Oracle",Hm="Chainlink Price Oracle",Fm="",Km=[{fileName:"Chainlink.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENoYWlubGlua1ByaWNlT3JhY2xlIHsKICAgIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSBpbnRlcm5hbCBwcmljZUZlZWQ7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgLy8gRVRIIC8gVVNECiAgICAgICAgcHJpY2VGZWVkID0KICAgICAgICAgICAgQWdncmVnYXRvclYzSW50ZXJmYWNlKDB4NWY0ZUMzRGY5Y2JkNDM3MTRGRTI3NDBmNUUzNjE2MTU1YzViODQxOSk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0TGF0ZXN0UHJpY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zIChpbnQyNTYpIHsKICAgICAgICAoCiAgICAgICAgICAgIHVpbnQ4MCByb3VuZElELAogICAgICAgICAgICBpbnQyNTYgcHJpY2UsCiAgICAgICAgICAgIHVpbnQyNTYgc3RhcnRlZEF0LAogICAgICAgICAgICB1aW50MjU2IHRpbWVTdGFtcCwKICAgICAgICAgICAgdWludDgwIGFuc3dlcmVkSW5Sb3VuZAogICAgICAgICkgPSBwcmljZUZlZWQubGF0ZXN0Um91bmREYXRhKCk7CiAgICAgICAgLy8gZm9yIEVUSCAvIFVTRCBwcmljZSBpcyBzY2FsZWQgdXAgYnkgMTAgKiogOAogICAgICAgIHJldHVybiBwcmljZSAvIDFlODsKICAgIH0KfQoKaW50ZXJmYWNlIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSB7CiAgICBmdW5jdGlvbiBsYXRlc3RSb3VuZERhdGEoKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKAogICAgICAgICAgICB1aW50ODAgcm91bmRJZCwKICAgICAgICAgICAgaW50MjU2IGFuc3dlciwKICAgICAgICAgICAgdWludDI1NiBzdGFydGVkQXQsCiAgICAgICAgICAgIHVpbnQyNTYgdXBkYXRlZEF0LAogICAgICAgICAgICB1aW50ODAgYW5zd2VyZWRJblJvdW5kCiAgICAgICAgKTsKfQo="}],Mm=`

        ETH / USD Price Oracle

        +`,vm=({prev:s,next:a})=>i.jsx(A,{version:Bm,title:Gm,description:fm,cyfrinLink:Vm,html:Xm,prev:s,next:a,codes:Ym}),Rm="0.8.26",Nm="Chainlink Price Oracle",Hm="Chainlink Price Oracle",Fm="",Km=[{fileName:"Chainlink.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENoYWlubGlua1ByaWNlT3JhY2xlIHsKICAgIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSBpbnRlcm5hbCBwcmljZUZlZWQ7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgLy8gRVRIIC8gVVNECiAgICAgICAgcHJpY2VGZWVkID0KICAgICAgICAgICAgQWdncmVnYXRvclYzSW50ZXJmYWNlKDB4NWY0ZUMzRGY5Y2JkNDM3MTRGRTI3NDBmNUUzNjE2MTU1YzViODQxOSk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0TGF0ZXN0UHJpY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zIChpbnQyNTYpIHsKICAgICAgICAoCiAgICAgICAgICAgIHVpbnQ4MCByb3VuZElELAogICAgICAgICAgICBpbnQyNTYgcHJpY2UsCiAgICAgICAgICAgIHVpbnQyNTYgc3RhcnRlZEF0LAogICAgICAgICAgICB1aW50MjU2IHRpbWVTdGFtcCwKICAgICAgICAgICAgdWludDgwIGFuc3dlcmVkSW5Sb3VuZAogICAgICAgICkgPSBwcmljZUZlZWQubGF0ZXN0Um91bmREYXRhKCk7CiAgICAgICAgLy8gZm9yIEVUSCAvIFVTRCBwcmljZSBpcyBzY2FsZWQgdXAgYnkgMTAgKiogOAogICAgICAgIHJldHVybiBwcmljZSAvIDFlODsKICAgIH0KfQoKaW50ZXJmYWNlIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSB7CiAgICBmdW5jdGlvbiBsYXRlc3RSb3VuZERhdGEoKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKAogICAgICAgICAgICB1aW50ODAgcm91bmRJZCwKICAgICAgICAgICAgaW50MjU2IGFuc3dlciwKICAgICAgICAgICAgdWludDI1NiBzdGFydGVkQXQsCiAgICAgICAgICAgIHVpbnQyNTYgdXBkYXRlZEF0LAogICAgICAgICAgICB1aW50ODAgYW5zd2VyZWRJblJvdW5kCiAgICAgICAgKTsKfQo="}],Mm=`

        ETH / USD Price Oracle

        // SPDX-License-Identifier: MIT
         pragma solidity ^0.8.26;
         
        @@ -5348,7 +5400,7 @@ Topics
                 external
                 returns (bool);
         }
        -
        `,mb=({prev:s,next:a})=>i.jsx(A,{version:db,title:Cb,description:jb,cyfrinLink:Ab,html:yb,prev:s,next:a,codes:ub}),bb="0.8.26",wb="Staking Rewards",kb="Staking rewards contract based on Synthetix StakingRewards.sol",Zb="",Wb=[{fileName:"StakingRewards.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFN0YWtpbmdSZXdhcmRzIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHN0YWtpbmdUb2tlbjsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHJld2FyZHNUb2tlbjsKCiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICAvLyBEdXJhdGlvbiBvZiByZXdhcmRzIHRvIGJlIHBhaWQgb3V0IChpbiBzZWNvbmRzKQogICAgdWludDI1NiBwdWJsaWMgZHVyYXRpb247CiAgICAvLyBUaW1lc3RhbXAgb2Ygd2hlbiB0aGUgcmV3YXJkcyBmaW5pc2gKICAgIHVpbnQyNTYgcHVibGljIGZpbmlzaEF0OwogICAgLy8gTWluaW11bSBvZiBsYXN0IHVwZGF0ZWQgdGltZSBhbmQgcmV3YXJkIGZpbmlzaCB0aW1lCiAgICB1aW50MjU2IHB1YmxpYyB1cGRhdGVkQXQ7CiAgICAvLyBSZXdhcmQgdG8gYmUgcGFpZCBvdXQgcGVyIHNlY29uZAogICAgdWludDI1NiBwdWJsaWMgcmV3YXJkUmF0ZTsKICAgIC8vIFN1bSBvZiAocmV3YXJkIHJhdGUgKiBkdCAqIDFlMTggLyB0b3RhbCBzdXBwbHkpCiAgICB1aW50MjU2IHB1YmxpYyByZXdhcmRQZXJUb2tlblN0b3JlZDsKICAgIC8vIFVzZXIgYWRkcmVzcyA9PiByZXdhcmRQZXJUb2tlblN0b3JlZAogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyB1c2VyUmV3YXJkUGVyVG9rZW5QYWlkOwogICAgLy8gVXNlciBhZGRyZXNzID0+IHJld2FyZHMgdG8gYmUgY2xhaW1lZAogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyByZXdhcmRzOwoKICAgIC8vIFRvdGFsIHN0YWtlZAogICAgdWludDI1NiBwdWJsaWMgdG90YWxTdXBwbHk7CiAgICAvLyBVc2VyIGFkZHJlc3MgPT4gc3Rha2VkIGFtb3VudAogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfc3Rha2luZ1Rva2VuLCBhZGRyZXNzIF9yZXdhcmRUb2tlbikgewogICAgICAgIG93bmVyID0gbXNnLnNlbmRlcjsKICAgICAgICBzdGFraW5nVG9rZW4gPSBJRVJDMjAoX3N0YWtpbmdUb2tlbik7CiAgICAgICAgcmV3YXJkc1Rva2VuID0gSUVSQzIwKF9yZXdhcmRUb2tlbik7CiAgICB9CgogICAgbW9kaWZpZXIgb25seU93bmVyKCkgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBvd25lciwgIm5vdCBhdXRob3JpemVkIik7CiAgICAgICAgXzsKICAgIH0KCiAgICBtb2RpZmllciB1cGRhdGVSZXdhcmQoYWRkcmVzcyBfYWNjb3VudCkgewogICAgICAgIHJld2FyZFBlclRva2VuU3RvcmVkID0gcmV3YXJkUGVyVG9rZW4oKTsKICAgICAgICB1cGRhdGVkQXQgPSBsYXN0VGltZVJld2FyZEFwcGxpY2FibGUoKTsKCiAgICAgICAgaWYgKF9hY2NvdW50ICE9IGFkZHJlc3MoMCkpIHsKICAgICAgICAgICAgcmV3YXJkc1tfYWNjb3VudF0gPSBlYXJuZWQoX2FjY291bnQpOwogICAgICAgICAgICB1c2VyUmV3YXJkUGVyVG9rZW5QYWlkW19hY2NvdW50XSA9IHJld2FyZFBlclRva2VuU3RvcmVkOwogICAgICAgIH0KCiAgICAgICAgXzsKICAgIH0KCiAgICBmdW5jdGlvbiBsYXN0VGltZVJld2FyZEFwcGxpY2Fib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C09IF9hbW91bnQ7CiAgICAgICAgc3Rha2luZ1Rva2VuLnRyYW5zZmVyKG1zZy5zZW5kZXIsIF9hbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIGVhcm5lZChhZGRyZXNzIF9hY2NvdW50KSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuICgKICAgICAgICAgICAgKAogICAgICAgICAgICAgICAgYmFsYW5jZU9mW19hY2NvdW50XQogICAgICAgICAgICAgICAgICAgICogKHJld2FyZFBlclRva2VuKCkgLSB1c2VyUmV3YXJkUGVyVG9rZW5QYWlkW19hY2NvdW50XSkKICAgICAgICAgICAgKSAvIDFlMTgKICAgICAgICApICsgcmV3YXJkc1tfYWNjb3VudF07CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UmV3YXJkKCkgZXh0ZXJuYWwgdXBkYXRlUmV3YXJkKG1zZy5zZW5kZXIpIHsKICAgICAgICB1aW50MjU2IHJld2FyZCA9IHJld2FyZHNbbXNnLnNlbmRlcl07CiAgICAgICAgaWYgKHJld2FyZCA+IDApIHsKICAgICAgICAgICAgcmV3YXJkc1ttc2cuc2VuZGVyXSA9IDA7CiAgICAgICAgICAgIHJld2FyZHNUb2tlbi50cmFuc2Zlcihtc2cuc2VuZGVyLCByZXdhcmQpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBzZXRSZXdhcmRzRHVyYXRpb24odWludDI1NiBfZHVyYXRpb24pIGV4dGVybmFsIG9ubHlPd25lciB7CiAgICAgICAgcmVxdWlyZShmaW5pc2hBdCA8IGJsb2NrLnRpbWVzdGFtcCwgInJld2FyZCBkdXJhdGlvbiBub3QgZmluaXNoZWQiKTsKICAgICAgICBkdXJhdGlvbiA9IF9kdXJhdGlvbjsKICAgIH0KCiAgICBmdW5jdGlvbiBub3RpZnlSZXdhcmRBbW91bnQodWludDI1NiBfYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgb25seU93bmV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zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcyBzZW5kZXIsIGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwp9Cg=="}],Gb=`

        This is a minimal example of a contract that rewards users for staking their token.

        +`,mb=({prev:s,next:a})=>i.jsx(A,{version:db,title:Cb,description:jb,cyfrinLink:Ab,html:yb,prev:s,next:a,codes:ub}),bb="0.8.26",wb="Staking Rewards",kb="Staking rewards contract based on Synthetix StakingRewards.sol",Zb="",Wb=[{fileName:"StakingRewards.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFN0YWtpbmdSZXdhcmRzIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHN0YWtpbmdUb2tlbjsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHJld2FyZHNUb2tlbjsKCiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICAvLyBEdXJhdGlvbiBvZiByZXdhcmRzIHRvIGJlIHBhaWQgb3V0IChpbiBzZWNvbmR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MjAoX3N0YWtpbmdUb2tlbik7CiAgICAgICAgcmV3YXJkc1Rva2VuID0gSUVSQzIwKF9yZXdhcmRUb2tlbik7CiAgICB9CgogICAgbW9kaWZpZXIgb25seU93bmVyKCkgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBvd25lciwgIm5vdCBhdXRob3JpemVkIik7CiAgICAgICAgXzsKICAgIH0KCiAgICBtb2RpZmllciB1cGRhdGVSZXdhcmQoYWRkcmVzcyBfYWNjb3VudCkgewogICAgICAgIHJld2FyZFBlclRva2VuU3RvcmVkID0gcmV3YXJkUGVyVG9rZW4oKTsKICAgICAgICB1cGRhdGVkQXQgPSBsYXN0VGltZVJld2FyZEFwcGxpY2FibGUoKTsKCiAgICAgICAgaWYgKF9hY2NvdW50ICE9IGFkZHJlc3MoMCkpIHsKICAgICAgICAgICAgcmV3YXJkc1tfYWNjb3VudF0gPSBlYXJuZWQoX2FjY291bnQpOwogICAgICAgICAgICB1c2VyUmV3YXJkUGVyVG9rZW5QYWlkW19hY2NvdW50XSA9IHJld2FyZFBlclRva2VuU3RvcmVkOwogICAgICAgIH0KCiAgICAgICAgXzsKICAgIH0KCiAgICBmdW5jdGlvbiBsYXN0VGltZVJld2FyZEFwcGxpY2FibGUoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIF9taW4oZmluaXNoQXQsIGJsb2NrLnRpbWVzdGFtcCk7CiAgICB9CgogICAgZnVuY3Rpb24gcmV3YXJkUGVyVG9rZW4oKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgaWYgKHRvdGFsU3VwcGx5ID09IDApIHsKICAgICAgICAgICAgcmV0dXJuIHJld2FyZFBlclRva2VuU3RvcmVkOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIHJld2FyZFBlclRva2VuU3RvcmVkCiAgICAgICAgICAgICsgKHJld2FyZFJhdGUgKiAobGFzdFRpbWVSZXdhc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jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcyBzZW5kZXIsIGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwp9Cg=="}],Bb=`

        This is a minimal example of a contract that rewards users for staking their token.

        Code is a stripped down version of Synthetix StakingRewards.sol

        Staking Rewards

        // SPDX-License-Identifier: MIT
        @@ -5495,7 +5547,7 @@ Topics
                 external
                 returns (bool);
         }
        -
        `,Bb=({prev:s,next:a})=>i.jsx(A,{version:bb,title:wb,description:kb,cyfrinLink:Zb,html:Gb,prev:s,next:a,codes:Wb}),fb="0.8.26",Vb="Uniswap V2 Swap",Yb="Uniswap V2 swap",Xb="",vb=[{fileName:"UniswapV2SwapExamples.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFVuaXN3YXBWMlN3YXBFeGFtcGxlcyB7CiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgVU5JU1dBUF9WMl9ST1VURVIgPQogICAgICAgIDB4N2EyNTBkNTYzMEI0Y0Y1Mzk3MzlkRjJDNWRBY2I0YzY1OUYyNDg4RDsKCiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgV0VUSCA9IDB4QzAyYWFBMzliMjIzRkU4RDBBMGU1QzRGMjdlQUQ5MDgzQzc1NkNjMjsKICAgIGFkZHJlc3MgcHJpdmF0ZSBjb25zdGFudCBEQUkgPSAweDZCMTc1NDc0RTg5MDk0QzQ0RGE5OGI5NTRFZWRlQUM0OTUyNzFkMEY7CiAgICBhZGRyZXNzIGNvbnN0YW50IFVTREMgPSAweEEwYjg2OTkxYzYyMThiMzZjMWQxOUQ0YTJlOUViMGNFMzYwNmVCNDg7CgogICAgSVVuaXN3YXBWMlJvdXRlciBwcml2YXRlIHJvdXRlciA9IElVbmlzd2F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bW91bnRPdXRNaW4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zICh1aW50MjU2IGFtb3VudE91dCkKICAgIHsKICAgICAgICBkYWkudHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudEluKTsKICAgICAgICBkYWkuYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluKTsKCiAgICAgICAgYWRkcmVzc1tdIG1lbW9yeSBwYXRoOwogICAgICAgIHBhdGggPSBuZXcgYWRkcmVzc1tdKDMpOwogICAgICAgIHBhdGhbMF0gPSBEQUk7CiAgICAgICAgcGF0aFsxXSA9IFdFVEg7CiAgICAgICAgcGF0aFsyXSA9IFVTREM7CgogICAgICAgIHVpbnQyNTZbXSBtZW1vcnkgYW1vdW50cyA9IHJvdXRlci5zd2FwRXhhY3RUb2tlbnNGb3JUb2tlbnMoCiAgICAgICAgICAgIGFtb3VudEluLCBhbW91bnRPdXRNaW4sIHBhdGgsIG1zZy5zZW5kZXIsIGJsb2NrLnRpbWVzdGFtcAogICAgICAgICk7CgogICAgICAgIC8vIGFtb3VudHNbMF0gPSBEQUkgYW1vdW50CiAgICAgICAgLy8gYW1vdW50c1sxXSA9IFdFVEggYW1vdW50CiAgICAgICAgLy8gYW1vdW50c1syXSA9IFVTREMgYW1vdW50CiAgICAgICAgcmV0dXJuIGFtb3VudHNbMl07CiAgICB9CgogICAgLy8gU3dhcCBXRVRIIHRvIERBSQogICAgZnVuY3Rpb24gc3dhcFNpbmdsZUhvcEV4YWN0QW1vdW50T3V0KAogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0RGVzaXJlZCwKICAgICAgICB1aW50MjU2IGFtb3VudEluTWF4CiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KSB7CiAgICAgICAgd2V0aC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW5NYX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ICAgICAgICBwYXRoID0gbmV3IGFkZHJlc3NbXSgzKTsKICAgICAgICBwYXRoWzBdID0gREFJOwogICAgICAgIHBhdGhbMV0gPSBXRVRIOwogICAgICAgIHBhdGhbMl0gPSBVU0RDOwoKICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFtb3VudHMgPSByb3V0ZXIuc3dhcFRva2Vuc0ZvckV4YWN0VG9rZW5zKAogICAgICAgICAgICBhbW91bnRPdXREZXNpcmVkLCBhbW91bnRJbk1heCwgcGF0aCwgbXNnLnNlbmRlciwgYmxvY2sudGltZXN0YW1wCiAgICAgICAgKTsKCiAgICAgICAgLy8gUmVmdW5kIERBSSB0byBtc2cuc2VuZGVyCiAgICAgICAgaWYgKGFtb3VudHNbMF0gPCBhbW91bnRJbk1heCkgewogICAgICAgICAgICBkYWkudHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50SW5NYXggLSBhbW91bnRzWzBdKTsKICAgICAgICB9CgogICAgICAgIHJldHVybiBhbW91bnRzWzJdOwogICAgfQp9CgppbnRlcmZhY2UgSVVuaXN3YXBWMlJvdXRlciB7CiAgICBmdW5jdGlvbiBzd2FwRXhhY3RUb2tlbnNGb3JUb2tlbnMoCiAgICAgICAgdWludDI1NiBhbW91bnRJbiwKICAgICAgICB1aW50MjU2IGFtb3VudE91dE1pbiwKICAgICAgICBhZGRyZXNzW10gY2FsbGRhdGEgcGF0aCwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTYgZGVhZGxpbmUKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludDI1NltdIG1lbW9yeSBhbW91bnRzKTsKCiAgICBmdW5jdGlvbiBzd2FwVG9rZW5zRm9yRXhhY3RUb2tlbnMoCiAgICAgICAgdWludDI1NiBhbW91bnRPdXQsCiAgICAgICAgdWludDI1NiBhbW91bnRJbk1heCwKICAgICAgICBhZGRyZXNzW10gY2FsbGRhdGEgcGF0aCwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAg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MWUxODsKICAgICAgICB3ZXRoLmRlcG9zaXR7dmFsdWU6IHdldGhBbW91bnR9KCk7CiAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3ModW5pKSwgd2V0aEFtb3VudCk7CgogICAgICAgIC8vIEJ1eSAxMDAgREFJCiAgICAgICAgdWludDI1NiBkYWlBbW91bnRPdXQgPSAxMDAgKiAxZTE4OwogICAgICAgIHVuaS5zd2FwU2luZ2xlSG9wRXhhY3RBbW91bnRPdXQoZGFpQW1vdW50T3V0LCB3ZXRoQW1vdW50KTsKCiAgICAgICAgLy8gU3dhcCBEQUkgLT4gV0VUSCAtPiBVU0RDCiAgICAgICAgZGFpLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCBkYWlBbW91bnRPdXQpOwoKICAgICAgICB1aW50MjU2IGFtb3VudE91dERlc2lyZWQgPSAxZTY7CiAgICAgICAgdWludDI1NiBhbW91bnRPdXQgPQogICAgICAgICAgICB1bmkuc3dhcE11bHRpSG9wRXhhY3RBbW91bnRPdXQoYW1vdW50T3V0RGVzaXJlZCwgZGFpQW1vdW50T3V0KTsKCiAgICAgICAgY29uc29sZTIubG9nKCJVU0RDIiwgYW1vdW50T3V0KTsKICAgICAgICBhc3NlcnRFcSgKICAgICAgICAgICAgYW1vdW50T3V0LCBhbW91bnRPdXREZXNpcmVkLCAiYW1vdW50IG91dCAhPSBhbW91bnQgb3V0IGRlc2lyZWQiCiAgICAgICAgKTsKICAgIH0KfQo="}],Rb=`

        swapExactTokensForTokens sells all tokens for another.

        +`,Gb=({prev:s,next:a})=>i.jsx(A,{version:bb,title:wb,description:kb,cyfrinLink:Zb,html:Bb,prev:s,next:a,codes:Wb}),fb="0.8.26",Vb="Uniswap V2 Swap",Yb="Uniswap V2 swap",Xb="",vb=[{fileName:"UniswapV2SwapExamples.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IF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NaW4sIHBhdGgsIG1zZy5zZW5kZXIsIGJsb2NrLnRpbWVzdGFtcAogICAgICAgICk7CgogICAgICAgIC8vIGFtb3VudHNbMF0gPSBEQUkgYW1vdW50CiAgICAgICAgLy8gYW1vdW50c1sxXSA9IFdFVEggYW1vdW50CiAgICAgICAgLy8gYW1vdW50c1syXSA9IFVTREMgYW1vdW50CiAgICAgICAgcmV0dXJuIGFtb3VudHNbMl07CiAgICB9CgogICAgLy8gU3dhcCBXRVRIIHRvIERBSQogICAgZnVuY3Rpb24gc3dhcFNpbmdsZUhvcEV4YWN0QW1vdW50T3V0KAogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0RGVzaXJlZCwKICAgICAgICB1aW50MjU2IGFtb3VudEluTWF4CiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KSB7CiAgICAgICAgd2V0aC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW5NYXgpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluTWF4KTsKCiAgICAgICAgYWRkcmVzc1tdIG1lbW9yeSBwYXRoOwogICAgICAgIHBhdGggPSBuZXcgYWRkcmVzc1tdKDIpOwogICAgICAgIHBhdGhbMF0gPSBXRVRIOwogICAgICAgIHBhdGhbMV0gPSBEQUk7CgogICAgICAgIHVpbnQyNTZbXSBtZW1vcnkgYW1vdW50cyA9IHJvdXRlci5zd2FwVG9rZW5zRm9yRXhhY3RUb2tlbnMoCiAgICAgICAgICAgIGFtb3VudE91dERlc2lyZWQsIGFtb3VudEluTWF4LCBwYXRoLCBtc2cuc2VuZGVyLCBibG9jay50aW1lc3RhbXAKICAgICAgICApOwoKICAgICAgICAvLyBSZWZ1bmQgV0VUSCB0byBtc2cuc2VuZGVyCiAgICAgICAgaWYgKGFtb3VudHNbMF0gPCBhbW91bnRJbk1heCkgewogICAgICAgICAgICB3ZXRoLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudEluTWF4IC0gYW1vdW50c1swXSk7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gYW1vdW50c1sxXTsKICAgIH0KCiAgICAvLyBTd2FwIERBSSAtPiBXRVRIIC0+IFVTREMKICAgIGZ1bmN0aW9uIHN3YXBNdWx0aUhvcEV4YWN0QW1vdW50T3V0KAogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0RGVzaXJlZCwKICAgICAgICB1aW50MjU2IGFtb3VudEluTWF4CiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KSB7CiAgICAgICAgZGFpLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBhbW91bnRJbk1heCk7CiAgICAgICAgZGFpLmFwcHJvdmUoYWRkcmVzcyhyb3V0ZXIpLCBhbW91bnRJbk1heCk7CgogICAgICAgIGFkZHJlc3NbXSBtZW1vcnkgcGF0aDsKICAgICAgICBwYXRoID0gbmV3IGFkZHJlc3NbXSgzKTsKICAgICAgICBwYXRoWzBdID0gREFJOwogICAgICAgIHBhdGhbMV0gPSBXRVRIOwogICAgICAgIHBhdGhbMl0gPSBVU0RDOwoKICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFtb3VudHMgPSByb3V0ZXIuc3dhcFRva2Vuc0ZvckV4YWN0VG9rZW5zKAogICAgICAgICAgICBhbW91bnRPdXREZXNpcmVkLCBhbW91bnRJbk1heCwgcGF0aCwgbXNnLnNlbmRlciwgYmxvY2sudGltZXN0YW1wCiAgICAgICAgKTsKCiAgICAgICAgLy8gUmVmdW5kIERBSSB0byBtc2cuc2VuZGVyCiAgICAgICAgaWYgKGFtb3VudHNbMF0gPCBhbW91bnRJbk1heCkgewogICAgICAgICAgICBkYWkudHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50SW5NYXggLSBhbW91bnRzWzBdKTsKICAgICAgICB9CgogICAgICAgIHJldHVybiB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aUFtb3VudERlc2lyZWQgPSAxZTE4OwogICAgICAgIHVpbnQyNTYgZGFpQW1vdW50T3V0ID0KICAgICAgICAgICAgdW5pLnN3YXBTaW5nbGVIb3BFeGFjdEFtb3VudE91dChkYWlBbW91bnREZXNpcmVkLCB3ZXRoQW1vdW50KTsKCiAgICAgICAgY29uc29sZTIubG9nKCJEQUkiLCBkYWlBbW91bnRPdXQpOwogICAgICAgIGFzc2VydEVxKAogICAgICAgICAgICBkYWlBbW91bnRPdXQsIGRhaUFtb3VudERlc2lyZWQsICJhbW91bnQgb3V0ICE9IGFtb3VudCBvdXQgZGVzaXJlZCIKICAgICAgICApOwogICAgfQoKICAgIC8vIFN3YXAgREFJIC0+IFdFVEggLT4gVVNEQwogICAgZnVuY3Rpb24gdGVzdFN3YXBNdWx0aUhvcEV4YWN0QW1vdW50T3V0KCkgcHVibGljIHsKICAgICAgICAvLyBTd2FwIFdFVEggLT4gREFJCiAgICAgICAgdWludDI1NiB3ZXRoQW1vdW50ID0gMWUxODsKICAgICAgICB3ZXRoLmRlcG9zaXR7dmFsdWU6IHdldGhBbW91bnR9KCk7CiAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3ModW5pKSwgd2V0aEFtb3VudCk7CgogICAgICAgIC8vIEJ1eSAxMDAgREFJCiAgICAgICAgdWludDI1NiBkYWlBbW91bnRPdXQgPSAxMDAgKiAxZTE4OwogICAgICAgIHVuaS5zd2FwU2luZ2xlSG9wRXhhY3RBbW91bnRPdXQoZGFpQW1vdW50T3V0LCB3ZXRoQW1vdW50KTsKCiAgICAgICAgLy8gU3dhcCBEQUkgLT4gV0VUSCAtPiBVU0RDCiAgICAgICAgZGFpLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCBkYWlBbW91bnRPdXQpOwoKICAgICAgICB1aW50MjU2IGFtb3VudE91dERlc2lyZWQgPSAxZTY7CiAgICAgICAgdWludDI1NiBhbW91bnRPdXQgPQogICAgICAgICAgICB1bmkuc3dhcE11bHRpSG9wRXhhY3RBbW91bnRPdXQoYW1vdW50T3V0RGVzaXJlZCwgZGFpQW1vdW50T3V0KTsKCiAgICAgICAgY29uc29sZTIubG9nKCJVU0RDIiwgYW1vdW50T3V0KTsKICAgICAgICBhc3NlcnRFcSgKICAgICAgICAgICAgYW1vdW50T3V0LCBhbW91bnRPdXREZXNpcmVkLCAiYW1vdW50IG91dCAhPSBhbW91bnQgb3V0IGRlc2lyZWQiCiAgICAgICAgKTsKICAgIH0KfQo="}],Rb=`

        swapExactTokensForTokens sells all tokens for another.

        swapTokensForExactTokens buys specific amount of tokens set by the caller.

        // SPDX-License-Identifier: MIT
         pragma solidity ^0.8.26;
        @@ -6908,7 +6960,7 @@ IERC20 constant PAIR Uniswap V3

        Foundry

        Uniswap V3 Foundry example

        -`,ww=({prev:s,next:a})=>i.jsx(A,{version:jw,title:Aw,description:uw,cyfrinLink:yw,html:bw,prev:s,next:a,codes:mw}),kw="0.8.26",Zw="Uniswap V3 Swap Examples",Ww="Uniswap V3 swap examples",Gw="",Bw=[{fileName:"UniswapV3MultiHopSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmFkZHJlc3MgY29uc3RhbnQgU1dBUF9ST1VURVJfMDIgPSAweDY4YjM0NjU4MzNmYjcyQTcwZWNERjQ4NUUwZTRDN2JEODY2NUZjNDU7CmFkZHJlc3MgY29uc3RhbnQgV0VUSCA9IDB4QzAyYWFBMzliMjIzRkU4RDBBMGU1QzRGMjdlQUQ5MDgzQzc1NkNjMjsKYWRkcmVzcyBjb25zdGFudCBVU0RDID0gMHhBMGI4Njk5MWM2MjE4YjM2YzFkMTlENGEyZTlFYjBjRTM2MDZlQjQ4OwphZGRyZXNzIGNvbnN0YW50IERBSSA9IDB4NkIxNzU0NzRFODkwOTRDNDREYTk4Yjk1NEVlZGVBQzQ5NTI3MWQwRjsKCmNvbnRyYWN0IFVuaXN3YXBWM011bHRpSG9wU3dhcCB7CiAgICBJU3dhcFJvdXRlcjAyIHByaXZhdGUgY29uc3RhbnQgcm91dGVyID0gSVN3YXBSb3V0ZXIwMihTV0FQX1JPVVRFUl8wMik7CiAgICBJRVJDMjAgcHJpdmF0ZSBjb25zdGFudCB3ZXRoID0gSUVSQzIwKFdFVEgpOwogICAgSUVSQzIwIHByaXZhdGUgY29uc3RhbnQgZGFpID0gSUVSQzIwKERBSSk7CgogICAgZnVuY3Rpb24gc3dhcEV4YWN0SW5wdXRNdWx0aUhvcCh1aW50MjU2IGFtb3VudEluLCB1aW50MjU2IGFtb3VudE91dE1pbikKICAgICAgICBleHRlcm5hbAogICAgewogICAgICAgIHdldGgudHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudEluKTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhyb3V0ZXIpLCBhbW91bnRJbik7CgogICAgICAgIGJ5dGVzIG1lbW9yeSBwYXRoID0KICAgICAgICAgICAgYWJpLmVuY29kZVBhY2tlZChXRVRILCB1aW50MjQoMzAwMCksIFVTREMsIHVpbnQyNCgxMDApLCBEQUkpOwoKICAgICAgICBJU3dhcFJvdXRlcjAyLkV4YWN0SW5wdXRQYXJhbXMgbWVtb3J5IHBhcmFtcyA9IElTd2FwUm91dGVyMDIKICAgICAgICAgICAgLkV4YWN0SW5wdXRQYXJhbXMoewogICAgICAgICAgICBwYXRoOiBwYXRoLAogICAgICAgICAgICByZWNpcGllbnQ6IG1zZy5zZW5kZXIsCiAgICAgICAgICAgIGFtb3VudEluOiBhbW91bnRJbiwKICAgICAgICAgICAgYW1vdW50T3V0TWluaW11bTogYW1vdW50T3V0TWluCiAgICAgICAgfSk7CgogICAgICAgIHJvdXRlci5leGFjdElucHV0KHBhcmFtcyk7CiAgICB9CgogICAgZnVuY3Rpb24gc3dhcEV4YWN0T3V0cHV0TXVsdGlIb3AodWludDI1NiBhbW91bnRPdXQsIHVpbnQy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Ftb3VudEluKTsKICAgICAgICB9CiAgICB9Cn0KCmludGVyZmFjZSBJU3dhcFJvdXRlcjAyIHsKICAgIHN0cnVjdCBFeGFjdElucHV0U2luZ2xlUGFyYW1zIHsKICAgICAgICBhZGRyZXNzIHRva2VuSW47CiAgICAgICAgYWRkcmVzcyB0b2tlbk91dDsKICAgICAgICB1aW50MjQgZmVlOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQyNTYgYW1vdW50SW47CiAgICAgICAgdWludDI1NiBhbW91bnRPdXRNaW5pbXVtOwogICAgICAgIHVpbnQxNjAgc3FydFByaWNlTGltaXRYOTY7CiAgICB9CgogICAgZnVuY3Rpb24gZXhhY3RJbnB1dFNpbmdsZShFeGFjdElucHV0U2luZ2xlUGFyYW1zIGNhbGxkYXRhIHBhcmFtcykKICAgICAgICBleHRlcm5hbAogICAgICAgIHBheWFibGUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGFtb3VudE91dCk7CgogICAgc3RydWN0IEV4YWN0T3V0cHV0U2luZ2xlUGFyYW1zIHsKICAgICAgICBhZGRyZXNzIHRva2VuSW47CiAgICAgICAgYWRkcmVzcyB0b2tlbk91dDsKICAgICAgICB1aW50MjQgZmVlOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0OwogICAgICAgIHVpbnQyNTYgYW1vdW50SW5NYXhpbXVtOwogICAgICAgIHVpbnQxNjAgc3FydFByaWNlTGltaXRYOTY7CiAgICB9CgogICAgZnVuY3Rpb24gZXhhY3RPdXRwdXRTaW5nbGUoRXhhY3RPdXRwdXRTaW5nbGVQYXJhbXMgY2FsbGRhdGEgcGFyYW1zKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYW1vdW50SW4pOwp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3Vwc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sCiAgICAgICAgICAgIGRlYWRsaW5lOiBibG9jay50aW1lc3RhbXAsCiAgICAgICAgICAgIGFtb3VudEluOiBhbW91bnRJbiwKICAgICAgICAgICAgYW1vdW50T3V0TWluaW11bTogMCwKICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IDAKICAgICAgICB9KTsKCiAgICAgICAgYW1vdW50T3V0ID0gcm91dGVyLmV4YWN0SW5wdXRTaW5nbGUocGFyYW1zKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzd2FwRXhhY3RJbnB1dE11bHRpSG9wKGJ5dGVzIGNhbGxkYXRhIHBhdGgsIGFkZHJlc3MgdG9rZW5JbiwgdWludDI1NiBhbW91bnRJbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KQogICAgewogICAgICAgIElFUkMyMCh0b2tlbkluKS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW4pOwogICAgICAgIElFUkMyMCh0b2tlbkluKS5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW4pOwoKICAgICAgICBJU3dhcFJvdXRlci5FeGFjdElucHV0UGFyYW1zIG1lbW9yeSBwYXJhbXMgPSBJU3dhcFJvdXRlci5FeGFjdElucHV0UGFyYW1zKHsKICAgICAgICAgICAgcGF0aDogcGF0aCwKICAgICAgICAgICAgcmVjaXBpZW50OiBtc2cuc2VuZGVyLAogICAgICAgICAgICBkZWFkbGluZTogYmxvY2sudGltZXN0YW1wLAogICAgICAgICAgICBhbW91bnRJbjogYW1vdW50SW4sCiAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IDAKICAgICAgICB9KTsKICAgICAgICBhbW91bnRPdXQgPSByb3V0ZXIuZXhhY3RJbnB1dChwYXJhbXMpOwogICAgfQp9CgppbnRlcmZhY2UgSVN3YXBSb3V0ZXIgewogICAgc3RydWN0IEV4YWN0SW5wdXRTaW5nbGV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aW9uIHRlc3RTaW5nbGVIb3AoKSBwdWJsaWMgewogICAgICAgIHdldGguZGVwb3NpdHt2YWx1ZTogMWUxOH0oKTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCAxZTE4KTsKCiAgICAgICAgdWludDI1NiBhbW91bnRPdXQgPSB1bmkuc3dhcEV4YWN0SW5wdXRTaW5nbGVIb3AoV0VUSCwgREFJLCAzMDAwLCAxZTE4KTsKCiAgICAgICAgY29uc29sZTIubG9nKCJEQUkiLCBhbW91bnRPdXQpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RNdWx0aUhvcCgpIHB1YmxpYyB7CiAgICAgICAgd2V0aC5kZXBvc2l0e3ZhbHVlOiAxZTE4fSgpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHVuaSksIDFlMTgpOwoKICAgICAgICBieXRlcyBtZW1vcnkgcGF0aCA9IGFiaS5lbmNvZGVQYWNrZWQoV0VUSCwgdWludDI0KDMwMDApLCBVU0RDLCB1aW50MjQoMTAwKSwgREFJKTsKCiAgICAgICAgdWludDI1NiBhbW91bnRPdXQgPSB1bmkuc3dhcEV4YWN0SW5wdXRNdWx0aUhvcChwYXRoLCBXRVRILCAxZTE4KTsKCiAgICAgICAgY29uc29sZTIubG9nKCJEQUkiLCBhbW91bnRPdXQpOwogICAgfQp9Cg=="}],fw=`

        Uniswap V3 Single Hop Swap

        +`,ww=({prev:s,next:a})=>i.jsx(A,{version:jw,title:Aw,description:uw,cyfrinLink:yw,html:bw,prev:s,next:a,codes:mw}),kw="0.8.26",Zw="Uniswap V3 Swap Examples",Ww="Uniswap V3 swap examples",Bw="",Gw=[{fileName:"UniswapV3MultiHopSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmFkZHJlc3MgY29uc3RhbnQgU1dBUF9ST1VURVJfMDIgPSAweDY4YjM0NjU4MzNm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yMDIKICAgICAgICAgICAgLkV4YWN0SW5wdXRQYXJhbXMoewogICAgICAgICAgICBwYXRoOiBwYXRoLAogICAgICAgICAgICByZWNpcGllbnQ6IG1zZy5zZW5kZXIsCiAgICAgICAgICAgIGFtb3VudEluOiBhbW91bnRJbiwKICAgICAgICAgICAgYW1vdW50T3V0TWluaW11bTogYW1vdW50T3V0TWluCiAgICAgICAgfSk7CgogICAgICAgIHJvdXRlci5leGFjdElucHV0KHBhcmFtcyk7CiAgICB9CgogICAgZnVuY3Rpb24gc3dhcEV4YWN0T3V0cHV0TXVsdGlIb3AodWludDI1NiBhbW91bnRPdXQsIHVpbnQyNTYgYW1vdW50SW5NYXgpCiAgICAgICAgZXh0ZXJuYWwKICAgIHsKICAgICAgICB3ZXRoLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBhbW91bnRJbk1heCk7CiAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW5NYXgpOwoKICAgICAgICBieXRlcyBtZW1vcnkgcGF0aCA9CiAgICAgICAgICAgIGFiaS5lbmNvZGVQYWNrZWQoREFJLCB1aW50MjQoMTAwKSwgVVNEQywgdWludDI0KDMwMDApLCBXRVRIKTsKCiAgICAgICAgSVN3YXBSb3V0ZXIwMi5FeGFjdE91dHB1dFBhcmFtcyBtZW1vcnkgcGFyYW1zID0gSVN3YXBSb3V0ZXIwMgogICAgICAgICAgICAuRXhhY3RPdXRwdXRQYXJhbXMoewogICAgICAgICAgICBwYXRoOiBwYXRoLAogICAgICAgICAgICByZWNpcGllbnQ6IG1zZy5zZW5kZXIsCiAgICAgICAgICAgIGFtb3VudE91dDogYW1vdW50T3V0LAogICAgICAgICAgICBhbW91bnRJbk1heGltdW06IGFtb3VudEluTWF4CiAgICAgICAgfSk7CgogICAgICAgIHVpbnQyNTYgYW1vdW50SW4gPSByb3V0ZXIuZXhhY3RPdXRwdXQocGFyYW1zKTsKCiAg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bmdsZVBhcmFtcyBtZW1vcnkgcGFyYW1zID0gSVN3YXBSb3V0ZXIwMgogICAgICAgICAgICAuRXhhY3RJbnB1dFNpbmdsZVBhcmFtcyh7CiAgICAgICAgICAgIHRva2VuSW46IFdFVEgsCiAgICAgICAgICAgIHRva2VuT3V0OiBEQUksCiAgICAgICAgICAgIGZlZTogMzAwMCwKICAgICAgICAgICAgcmVjaXBpZW50OiBtc2cuc2VuZGVyLAogICAgICAgICAgICBhbW91bnRJbjogYW1vdW50SW4sCiAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IGFtb3VudE91dE1pbiwKICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IDAKICAgICAgICB9KTsKCiAgICAgICAgcm91dGVyLmV4YWN0SW5wdXRTaW5nbGUocGFyYW1zKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzd2FwRXhhY3RPdXRwdXRTaW5nbGVIb3AodWludDI1NiBhbW91bnRPdXQsIHVpbnQyNTYgYW1vdW50SW5NYXgpCiAgICAgICAgZXh0ZXJuYWwKICAgIHsKICAgICAgICB3ZXRoLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBhbW91bnRJbk1heCk7CiAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW5NYXgpOwoKICAgICAgICBJU3dhcFJvdXRlcjAyLkV4YWN0T3V0cHV0U2luZ2xlUGFyYW1zIG1lbW9yeSBwYXJhbXMgPSBJU3dhcFJvdXRlcjAyCiAgICAgICAgICAgIC5FeGFjdE91dHB1dFNpbmdsZVBhcmFtcyh7CiAgICAgICAgICAgIHRva2VuSW46IFdFVEgsCiAgICAgICAgICAgIHRva2VuT3V0OiBEQUksCiAgICAgICAgICAgIGZlZTogMzAwMCwKICAgICAgICAgICAgcmVjaXBpZW50OiBtc2cuc2VuZGVyLAogICAgICAgICAgICBhbW91bnRPdXQ6IGFtb3VudE91dCwKICAgICAgICAgICAgYW1vdW50SW5NYXhpbXVtOiBhbW91bnRJbk1heCwKICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IDAKICAgICAgICB9KTsKCiAgICAgICAgdWludDI1NiBhbW91bnRJbiA9IHJvdXRlci5leGFjdE91dHB1dFNpbmdsZShwYXJhbXMpOwoKICAgICAgICBpZiAoYW1vdW50SW4gPCBhbW91bnRJbk1heCkgewogICAgICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhyb3V0ZXIpLCAwKTsKICAgICAgICAgICAgd2V0aC50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnRJbk1heCAtIGFtb3VudEluKTsKICAgICAgICB9CiAgICB9Cn0KCmludGVyZmFjZSBJU3dhcFJvdXRlcjAyIHsKICAgIHN0cnVjdCBFeGFjdElucHV0U2luZ2xlUGFyYW1zIHsKICAgICAgICBhZGRyZXNzIHRva2VuSW47CiAgICAgICAgYWRkcmVzcyB0b2tlbk91dDsKICAgICAgICB1aW50MjQgZmVlOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQyNTYgYW1vdW50SW47CiAgICAgICAgdWludDI1NiBhbW91bnRPdXRNaW5pbXVtOwogICAgICAgIHVpbnQxNjAgc3FydFByaWNlTGltaXRYOTY7CiAgICB9CgogICAgZnVuY3Rpb24gZXhhY3RJbnB1dFNpbmdsZShFeGFjdElucHV0U2luZ2xlUGFyYW1zIGNhbGxkYXRhIHBhcmFtcykKICAgICAgICBleHRlcm5hbAogICAgICAgIHBheWFibGUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGFtb3VudE91dCk7CgogICAgc3RydWN0IEV4YWN0T3V0cHV0U2luZ2xlUGFyYW1zIHsKICAgICAgICBhZGRyZXNzIHRva2VuSW47CiAgICAgICAgYWRkcmVzcyB0b2tlbk91dDsKICAgICAgICB1aW50MjQgZmVlOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQyNTYgY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gICBJRVJDMjAodG9rZW5JbikuYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluKTsKCiAgICAgICAgSVN3YXBSb3V0ZXIuRXhhY3RJbnB1dFNpbmdsZVBhcmFtcyBtZW1vcnkgcGFyYW1zID0gSVN3YXBSb3V0ZXIuRXhhY3RJbnB1dFNpbmdsZVBhcmFtcyh7CiAgICAgICAgICAgIHRva2VuSW46IHRva2VuSW4sCiAgICAgICAgICAgIHRva2VuT3V0OiB0b2tlbk91dCwKICAgICAgICAgICAgZmVlOiBwb29sRmVlLAogICAgICAgICAgICByZWNpcGllbnQ6IG1zZy5zZW5kZXIsCiAgICAgICAgICAgIGRlYWRsaW5lOiBibG9jay50aW1lc3RhbXAsCiAgICAgICAgICAgIGFtb3VudEluOiBhbW91bnRJbiwKICAgICAgICAgICAgYW1vdW50T3V0TWluaW11bTogMCwKICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IDAKICAgICAgICB9KTsKCiAgICAgICAgYW1vdW50T3V0ID0gcm91dGVyLmV4YWN0SW5wdXRTaW5nbGUocGFyYW1zKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzd2FwRXhhY3RJbnB1dE11bHRpSG9wKGJ5dGVzIGNhbGxkYXRhIHBhdGgsIGFkZHJlc3MgdG9rZW5JbiwgdWludDI1NiBhbW91bnRJbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KQogICAgewogICAgICAgIElFUkMyMCh0b2tlbkluKS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW4pOwogICAgICAgIElFUkMyMCh0b2tlbkluKS5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW4pOwoKICAgICAgICBJU3dhcFJvdXRlci5FeGFjdElucHV0UGFyYW1zIG1lbW9yeSBwYXJhbXMgPSBJU3dhcFJvdXRlci5FeGFjdElucHV0UGFyYW1zKHsKICAgICAgICAgICAgcGF0aDogcGF0aCwKICAgICAgICAgICAgcmVjaXBpZW50OiBtc2cuc2VuZGVyLAogICAgICAgICAgICBkZWFkbGluZTogYmxvY2sudGltZXN0YW1wLAogICAgICAgICAgICBhbW91bnRJbjogYW1vdW50SW4sCiAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IDAKICAgICAgICB9KTsKICAgICAgICBhbW91bnRPdXQgPSByb3V0ZXIuZXhhY3RJbnB1dChwYXJhbXMpOwogICAgfQp9CgppbnRlcmZhY2UgSVN3YXBSb3V0ZXIgewogICAgc3RydWN0IEV4YWN0SW5wdXRTaW5nbGVQYXJhbXMgewogICAgICAgIGFkZHJlc3MgdG9rZW5JbjsKICAgICAgICBhZGRyZXNzIHRva2VuT3V0OwogICAgICAgIHVpbnQyNCBmZWU7CiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQ7CiAgICAgICAgdWludDI1NiBkZWFkbGluZTsKICAgICAgICB1aW50MjU2IGFtb3VudEluOwogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0TWluaW11bTsKICAgICAgICB1aW50MTYwIHNxcnRQcmljZUxpbWl0WDk2OwogICAgfQoKICAgIC8vLyBAbm90aWNlIFN3YXBzIGFtb3VudEluIG9mIG9uZSB0b2tlbiBmb3IgYXMgbXVjaCBhcyBwb3NzaWJsZSBvZiBhbm90aGVyIHRva2VuCiAgICAvLy8gQHBhcmFtIHBhcmFtcyBUaGUgcGFyYW1ldGVycyBuZWNlc3NhcnkgZm9yIHRoZSBzd2FwLCBlbmNvZGVkIGFzIEV4YWN0SW5wdXRTaW5nbGVQYXJhbXMgaW4gY2FsbGRhdGEKICAgIC8vLyBAcmV0dXJuIGFtb3VudE91dCBUaGUgYW1vdW50IG9mIHRoZSByZWNlaXZlZCB0b2tlbgogICAgZnVuY3Rpb24gZXhhY3RJbnB1dFNpbmdsZShFeGFjdElucHV0U2luZ2xlUGFyYW1zIGNhbGxkYXRhIHBhcmFtcykgZXh0ZX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pOwogICAgfQp9Cg=="}],fw=`

        Uniswap V3 Single Hop Swap

        // SPDX-License-Identifier: MIT
         pragma solidity ^0.8.26;
         
        @@ -7224,7 +7276,7 @@ IERC20 constant PAIR address(swap)), 0, "DAI balance of swap != 0");
             }
         }
        -
        `,Vw=({prev:s,next:a})=>i.jsx(A,{version:kw,title:Zw,description:Ww,cyfrinLink:Gw,html:fw,prev:s,next:a,codes:Bw}),Yw="0.8.26",Xw="Vault",vw="Vault",Rw="",Nw=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFZhdWx0IHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4pIHsKICAgICAgICB0b2tlbiA9IElFUkMyMChfdG9rZW4pOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgX3RvLCB1aW50MjU2IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW190b10gKz0gX3NoYXJlczsKICAgIH0KCiAgICBmdW5jdGlvbiBfYnVybihhZGRyZXNzIF9mcm9tLCB1aW50MjU2IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5IC09IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW19mcm9tXSAtPSBfc2hhcmVzOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50CiAgICAgICAgQiA9IGJhbGFuY2Ugb2YgdG9rZW4gYmVmb3JlIGRlcG9zaXQKICAgICAgICBUID0gdG90YWwgc3VwcGx5CiAgICAgICAgcyA9IHNoYXJlcyB0byBtaW50CgogICAgICAgIChUICsgcykgLyBUID0gKGEgKyBCKSAvIEIgCgogICAgICAgIHMgPSBhVCAvIEIKICAgICAgICAqLwogICAgICAgIHVpbnQyNTYgc2hhcmVzOwogICAgICAgIGlmICh0b3RhbFN1cHBseSA9PSAwKSB7CiAgICAgICAgICAgIHNoYXJlcyA9IF9hbW91bnQ7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgc2hhcmVzID0gKF9hbW91bnQgKiB0b3RhbFN1cHBseSkgLyB0b2tlbi5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CiAgICAgICAgfQoKICAgICAgICBfbWludChtc2cuc2VuZGVyLCBzaGFyZXMpOwogICAgICAgIHRva2VuLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBfYW1vdW50KTsKICAgIH0KCiAgICBmdW5jdGlvbiB3aXRoZHJhdyh1aW50MjU2IF9zaGFyZXMpIGV4dGVybmFsIHsKICAgICAgICAvKgogICAgICAgIGEgPSBhbW91bnQKICAgICAgICBCID0gYmFsYW5jZSBvZiB0b2tlbiBiZWZvcmUgd2l0aGRyYXcKICAgICAgICBUID0gdG90YWwgc3VwcGx5CiAgICAgICAgcyA9IHNoYXJlcyB0byBidXJuCgogICAgICAgIChUIC0gcykgLyBUID0gKEIgLSBhKSAvIEIgCgogICAgICAgIGEgPSBzQiAvIFQKICAgICAgICAqLwogICAgICAgIHVpbnQyNTYgYW1vdW50ID0KICAgICAgICAgICAgKF9zaGFyZXMgKiB0b2tlbi5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSkpIC8gdG90YWxTdXBwbHk7CiAgICAgICAgX2J1cm4obXNnLnNlbmRlciwgX3NoYXJlcyk7CiAgICAgICAgdG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50KTsKICAgIH0KfQoKaW50ZXJmYWNlIElFUkMyMCB7CiAgICBmdW5jdGlvbiB0b3RhbFN1cHBseSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CgogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKCiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKCiAgICBmdW5jdGlvbiBhbGxvd2FuY2UoYWRkcmVzcyBvd25lciwgYWRkcmVzcyBzcGVuZGVyKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKHVpbnQyNTYpOwoKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3Mgc2VuZGVyLCBhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKCiAgICBldmVudCBUcmFuc2ZlcihhZGRyZXNzIGluZGV4ZWQgZnJvbSwgYWRkcmVzcyBpbmRleGVkIHRvLCB1aW50MjU2IGFtb3VudCk7CiAgICBldmVudCBBcHByb3ZhbCgKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3duZXIsIGFkZHJlc3MgaW5kZXhlZCBzcGVuZGVyLCB1aW50MjU2IGFtb3VudAogICAgKTsKfQo="}],Hw=`

        Simple example of vault contract, commonly used in DeFi protocols.

        +
        `,Vw=({prev:s,next:a})=>i.jsx(A,{version:kw,title:Zw,description:Ww,cyfrinLink:Bw,html:fw,prev:s,next:a,codes:Gw}),Yw="0.8.26",Xw="Vault",vw="Vault",Rw="",Nw=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFZhdWx0IHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4pIHsKICAgICAgICB0b2tlbiA9IElFUkMyMChfdG9rZW4pOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgX3RvLCB1aW50MjU2IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW190b10gKz0gX3NoYXJlczsKICAgIH0KCiAgICBmdW5jdGlvbiBfYnVybihhZGRyZXNzIF9mcm9tLCB1aW50MjU2IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5IC09IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW19mcm9tXSAtPSBfc2hhcmVzOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50CiAgICAgICAgQiA9IGJhbGFuY2Ugb2YgdG9rZW4gYmVmb3JlIGRlcG9zaXQKICAgICAgICBUID0gdG90YWwgc3VwcGx5CiAgICAgICAgcyA9IHNoYXJlcyB0byBtaW50CgogICAgICAgIChUICsgcykgLyBUID0gKGEgKyBCKSAvIEIgCgogICAgICAgIHMgPSBhVCAvIEIKICAgICAgICAqLwogICAgICAgIHVpbnQyNTYgc2hhcmVzOwogICAgICAgIGlmICh0b3RhbFN1cHBseSA9PSAwKSB7CiAgICAgICAgICAgIHNoYXJlcyA9IF9hbW91bnQ7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgc2hhcmVzID0gKF9hbW91bnQgKiB0b3RhbFN1cHBseSkgLyB0b2tlbi5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CiAgICAgICAgfQoKICAgICAgICBfbWludChtc2cuc2VuZGVyLCBzaGFyZXMpOwogICAgICAgIHRva2VuLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBfYW1vdW50KTsKICAgIH0KCiAgICBmdW5jdGlvbiB3aXRoZHJhdyh1aW50MjU2IF9zaGFyZXMpIGV4dGVybmFsIHsKICAgICAgICAvKgogICAgICAgIGEgPSBhbW91bnQKICAgICAgICBCID0gYmFsYW5jZSBvZiB0b2tlbiBiZWZvcmUgd2l0aGRyYXcKICAgICAgICBUID0gdG90YWwgc3VwcGx5CiAgICAgICAgcyA9IHNoYXJlcyB0byBidXJuCgogICAgICAgIChUIC0gcykgLyBUID0gKEIgLSBhKSAvIEIgCgogICAgICAgIGEgPSBzQiAvIFQKICAgICAgICAqLwogICAgICAgIHVpbnQyNTYgYW1vdW50ID0KICAgICAgICAgICAgKF9zaGFyZXMgKiB0b2tlbi5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSkpIC8gdG90YWxTdXBwbHk7CiAgICAgICAgX2J1cm4obXNnLnNlbmRlciwgX3NoYXJlcyk7CiAgICAgICAgdG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50KTsKICAgIH0KfQoKaW50ZXJmYWNlIElFUkMyMCB7CiAgICBmdW5jdGlvbiB0b3RhbFN1cHBseSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CgogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKCiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKCiAgICBmdW5jdGlvbiBhbGxvd2FuY2UoYWRkcmVzcyBvd25lciwgYWRkcmVzcyBzcGVuZGVyKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKHVpbnQyNTYpOwoKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3Mgc2VuZGVyLCBhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKCiAgICBldmVudCBUcmFuc2ZlcihhZGRyZXNzIGluZGV4ZWQgZnJvbSwgYWRkcmVzcyBpbmRleGVkIHRvLCB1aW50MjU2IGFtb3VudCk7CiAgICBldmVudCBBcHByb3ZhbCgKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3duZXIsIGFkZHJlc3MgaW5kZXhlZCBzcGVuZGVyLCB1aW50MjU2IGFtb3VudAogICAgKTsKfQo="}],Hw=`

        Simple example of vault contract, commonly used in DeFi protocols.

        Most vaults on the mainnet are more complex. Here we will focus on the math for calculating shares to mint on deposit and the amount of token to withdraw.

        How the contract works

          @@ -7632,7 +7684,7 @@ assertion probably means that there is a bug.
        1. Events cannot be used in view or pure functions, as they alter the state of the blockchain by storing logs.
        2. 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.
      -`,Zk=({prev:s,next:a})=>i.jsx(A,{version:uk,title:yk,description:mk,cyfrinLink:bk,html:kk,prev:s,next:a,codes:wk}),Wk="0.8.26",Gk="EVM Memory Layout in Solidity",Bk="Example of EVM memory in Solidity",fk="",Vk=[{fileName:"YulMem.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI2OwoKLy8gTWVtb3J5IGxheW91dAovLyBhcnJheSBvZiBsZW5ndGggMioqMjU2ICgzMiBieXRlcyksIGVhY2ggZWxlbWVudCBzdG9yZXMgMSBieXRlICgweDAwIHRvIDB4ZmYpCi8vIGluZGV4ICAgICAwICAgIDEgICAgMiAgIC4uLiAgIDB4ZmZmLi4uZmZmID0gMioqMjU2IC0gMQovLyBtZW1vcnkgfCAwMCB8IDAwIHwgMDAgfCAuLi4gfCAwMCB8CgovLyBSZXNlcnZlZCBzbG90cwovLyAweDAwIC0gMHgzZiAoNjQgYnl0ZXMpOiBzY3JhdGNoIHNwYWNlIGZvciBoYXNoaW5nIG1ldGhvZHMKLy8gMHg0MCAtIDB4NWYgKDMyIGJ5dGVzKTogZnJlZSBtZW1vcnkgcG9pbnRlciAtIHBvaW50ZXIgdG8gbmV4dCBhdmFpbGFibGUgbG9jYXRpb24gaW4gbWVtb3J5IHRvIHN0b3JlIGRhdGEKLy8gMHg2MCAtIDB4N2YgKDMyIGJ5dGVzKTogemVybyBzbG90IC0gdXNlZCBhcyBpbml0aWFsIHZhbHVlIGZvciBkeW5hbWljIG1lbW9yeSBhcnJheXMgYW5kIHNob3VsZCBuZXZlciBiZSB3cml0dGVuIHRvCgovLyBGcmVlIG1lbW9yeSBwb2ludGVyICgweDQwKQovLyAweDgwID0gRnJlZSBtZW1vcnkgcG9pbnRlciBpbml0aWFsbHkgcG9pbnRzIGhlcmUKY29udHJhY3QgTWVtQmFzaWMgewogICAgLy8gbXN0b3JlKHAsIHYpID0gc3RvcmUgMzIgYnl0ZXM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YXQgMHg4MAogICAgICAgIC8vIDB4ODAgPSBpbml0aWFsIGZyZWUgbWVtb3J5CiAgICAgICAgUG9pbnQgbWVtb3J5IHAgPSBQb2ludCgxLCAyLCAzKTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBsb2FkIDMyIGJ5dGVzIHN0YXJ0aW5nIGZyb20gMHg4MAogICAgICAgICAgICB4IDo9IG1sb2FkKDB4ODApCiAgICAgICAgICAgIC8vIGxvYWQgMzIgYnl0ZXMgc3RhcnRpbmcgZnJvbSAweGEwICgweDgwICsgMzIgPSAweGEwKQogICAgICAgICAgICB5IDo9IG1sb2FkKDB4YTApCiAgICAgICAgICAgIC8vIGxvYWQgMzIgYnl0ZXMgc3RhcnRpbmcgZnJvbSAweGMwICgweGEwICsgMzIgPSAweGMwKQogICAgICAgICAgICB6IDo9IG1sb2FkKDB4YzApCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfd3JpdGUoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyIGZyZWVfbWVtX3B0ciwgdWludDI1NiB4LCB1aW50MjU2IHksIHVpbnQyNTYgeikKICAgIHsKICAgICAgICAvLyBBbGxvY2F0ZXMgbWVtb3J5IDB4ODAgdG8gMHhkZiB0byBQb2ludAogICAgICAgIC8vIEZyZWUgbWVtb3J5IHBvaW50ZXIgPSAweGRmICsgMSA9IDB4ZTAKICAgICAgICBQb2ludCBtZW1vcnkgcDsKCiAgICAgICAgLy8gV3JpdGUKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIHN0b3JlIHRvIDB4ODAKICAgICAgICAgICAgbXN0b3JlKHAsIDExKQogICAgICAgICAgICAvLyBzdG9yZSB0byAweGEwCiAgICAgICAgICAgIG1zdG9yZShhZGQocCwgMHgyMCksIDIyKQogICAgICAgICAgICAvLyBzdG9yZSB0byAweGMwCiAgICAgICAgICAgIG1zdG9yZShhZGQocCwgMHg0MCksIDMzKQogICAgICAgICAgICAvLyAweGUwCiAgICAgICAgICAgIGZyZWVfbWVtX3B0ciA6PSBtbG9hZCgweDQwKQogICAgICAgIH0KCiAgICAgICAgeCA9IHAueDsKICAgICAgICB5ID0gcC55OwogICAgICAgIHogPSBwLno7CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUZpeGVkQXJyYXkgewogICAgZnVuY3Rpb24gdGVzdF9yZWFkKCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBhMCwgdWludDI1NiBhMSwgdWludDI1NiBhMikKICAgIHsKICAgICAgICAvLyBhcnIgaXMgbG9hZGVkIHRvIG1lbW9yeSBzdGFydGluZyBhdCAweDgwCiAgICAgICAgLy8gRWFjaCBhcnJheSBlbGVtZW50IGlzIHN0b3JlZCBhcyAzMiBieXRlcwogICAgICAgIHVpbnQzMlszXSBtZW1vcnkgYXJyID0gW3VpbnQzMigxKSwgdWludDMyKDIpLCB1aW50MzIoMyldOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGEwIDo9IG1sb2FkKDB4ODApCiAgICAgICAgICAgIGExIDo9IG1sb2FkKDB4YTApCiAgICAgICAgICAgIGEyIDo9IG1sb2FkKDB4YzApCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfd3JpdGUoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGEwLCB1aW50MjU2IGExLCB1aW50MjU2IGEyKQogICAgewogICAgICAgIHVpbnQzMlszXSBtZW1vcnkgYXJyOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIDB4ODAKICAgICAgICAgICAgbXN0b3JlKGFyciwgMTEpCiAgICAgICAgICAgIC8vIDB4YTAKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4MjApLCAyMikKICAgICAgICAgICAgLy8gMHhjMAogICAgICAgICAgICBtc3RvcmUoYWRkKGFyciwgMHg0MCksIDMzKQogICAgICAgIH0KCiAgICAgICAgYTAgPSBhcnJbMF07CiAgICAgICAgYTEgPSBhcnJbMV07CiAgICAgICAgYTIgPSBhcnJbMl07CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUR5bmFtaWNBcnJheSB7CiAgICBmdW5jdGlvbiB0ZXN0X3JlYWQoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyIHAsIHVpbnQyNTYgbGVuLCB1aW50MjU2IGEwLCB1aW50MjU2IGExLCB1aW50MjU2IGEyKQogICAgewogICAgICAgIHVpbnQyNTZbXSBtZW1vcnkgYXJyID0gbmV3IHVpbnQyNTZbXSg1KTsKICAgICAgICBhcnJbMF0gPSB1aW50MjU2KDExKTsKICAgICAgICBhcnJbMV0gPSB1aW50MjU2KDIyKTsKICAgICAgICBhcnJbMl0gPSB1aW50MjU2KDMzKTsKICAgICAgICBhcnJbM10gPSB1aW50MjU2KDQ0KTsKICAgICAgICBhcnJbNF0gPSB1aW50MjU2KDU1KTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBwIDo9IGFycgogICAgICAgICAgICAvLyAweDgwCiAgICAgICAgICAgIGxlbiA6PSBtbG9hZChhcnIpCiAgICAgICAgICAgIC8vIDB4YTAKICAgICAgICAgICAgYTAgOj0gbWxvYWQoYWRkKGFyciwgMHgyMCkpCiAgICAgICAgICAgIC8vIDB4YzAKICAgICAgICAgICAgYTEgOj0gbWxvYWQoYWRkKGFyciwgMHg0MCkpCiAgICAgICAgICAgIC8vIDB4ZTAKICAgICAgICAgICAgYTIgOj0gbWxvYWQoYWRkKGFyciwgMHg2MCkpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfd3JpdGUoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlczMyIHAsIHVpbnQyNTZbXSBtZW1vcnkpIHsKICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFyciA9IG5ldyB1aW50MjU2W10oMCk7CgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgcCA6PSBhcnIKICAgICAgICAgICAgLy8gU3RvcmUgbGVuZ3RoIG9mIGFycgogICAgICAgICAgICBtc3RvcmUoYXJyLCAzKQogICAgICAgICAgICAvLyBTdG9yZSAxLCAyLCAzCiAgICAgICAgICAgIG1zdG9yZShhZGQoYXJyLCAweDIwKSwgMTEpCiAgICAgICAgICAgIG1zdG9yZShhZGQoYXJyLCAweDQwKSwgMjIpCiAgICAgICAgICAgIG1zdG9yZShhZGQoYXJyLCAweDYwKSwgMzMpCiAgICAgICAgICAgIC8vIFVwZGF0ZSBmcmVlIG1lbW9yeSBwb2ludGVyCiAgICAgICAgICAgIG1zdG9yZSgweDQwLCBhZGQoYXJyLCAweDgwKSkKICAgICAgICB9CgogICAgICAgIC8vIERhdGEgd2lsbCBiZSBBQkkgZW5jb2RlZCB3aGVuIGFyciBpcyByZXR1cm5lZCB0byBjYWxsZXIKICAgICAgICByZXR1cm4gKHAsIGFycik7CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUludGVybmFsRnVuY1JldHVybiB7CiAgICBmdW5jdGlvbiBpbnRlcm5hbF9mdW5jX3JldHVybl92YWwoKSBwcml2YXRlIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB1aW50MjU2KDB4YWJhYmFiKTsKICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3ZhbCgpIHB1YmxpYyBwdXJlIHsKICAgICAgICAvLyAweGFiYWJhYiB3aWxsIGJlIHN0b3JlZCBpbiB0b3Agb2YgdGhlIHN0YWNrCiAgICAgICAgaW50ZXJuYWxfZnVuY19yZXR1cm5fdmFsKCk7CiAgICB9CgogICAgZnVuY3Rpb24gaW50ZXJuYWxfZnVuY19yZXR1cm5fbWVtKCkKICAgICAgICBwcml2YXRlCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzJbXSBtZW1vcnkpCiAgICB7CiAgICAgICAgYnl0ZXMzMltdIG1lbW9yeSBhcnIgPSBuZXcgYnl0ZXMzMltdKDMpOwogICAgICAgIGFyclswXSA9IGJ5dGVzMzIodWludDI1NigweGFhYSkpOwogICAgICAgIGFyclsxXSA9IGJ5dGVzMzIodWludDI1NigweGJiYikpOwogICAgICAgIGFyclsyXSA9IGJ5dGVzMzIodWludDI1NigweGNjYykpOwogICAgICAgIHJldHVybiBhcnI7CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9tZW0oKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGxlbiwgYnl0ZXMzMiBhMCwgYnl0ZXMzMiBhMSwgYnl0ZXMzMiBhMikKICAgIHsKICAgICAgICAvLyBTdG9yZXMgMHg4MCB0byB0b3Agb2YgdGhlIHN0YWNrCiAgICAgICAgLy8gMHg4MCA9IG1lbW9yeSBwb2ludGVyIHRvIGJlZ2lubmluZyBvZiBhcnIKICAgICAgICBpbnRlcm5hbF9mdW5jX3JldHVybl9tZW0oKTsKICAgICAgICAvLyBSZWFkIGRhdGEgZnJvbSBhcnIsIGluaXRpYWxpemVkIGluIGludGVybmFsX2Z1bmNfcmV0dXJuX21lbSwgdXNpbmcgYXNzZW1ibHkKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxlbiA6PSBtbG9hZCgweDgwKQogICAgICAgICAgICBhMCA6PSBtbG9hZCgweGEwKQogICAgICAgICAgICBhMSA6PSBtbG9hZCgweGMwKQogICAgICAgICAgICBhMiA6PSBtbG9hZCgweGUwKQogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgQUJJRW5jb2RlIHsKICAgIC8vIGpzIGNvZGUgdG8gc3BsaXQgc3RyaW5nIGludG8gY2h1bmtzIG9mIGxlbmd0aCA2NAogICAgLy8gc3RyLm1hdGNoKC8uezEsNjR9L2cpCgogICAgLy8gVmF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DgwLCAxMSkKICAgICAgICAgICAgbXN0b3JlKDB4YTAsIDIyKQogICAgICAgICAgICByZXR1cm4oMHg4MCwgMHg0MCkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9yZXR1cm5fZHluX2FycigpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTZbXSBtZW1vcnkpIHsKICAgICAgICAvLyBBQkkgZW5jb2RlIHVpbnQyNTZbXSBhcnJheSB3aXRoIDMgZWxlbWVudHMgMTEsIDIyIGFuZCAzMwogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gb2Zmc2V0CiAgICAgICAgICAgIG1zdG9yZSgweDgwLCAweDIwKQogICAgICAgICAgICAvLyBsZW5ndGgKICAgICAgICAgICAgbXN0b3JlKGFkZCgweDgwLCAweDIwKSwgMykKICAgICAgICAgICAgLy8gYXJyYXkgZWxlbWVudHMKICAgICAgICAgICAgbXN0b3JlKGFkZCgweDgwLCAweDQwKSwgMTEpCiAgICAgICAgICAgIG1zdG9yZShhZGQoMHg4MCwgMHg2MCksIDIyKQogICAgICAgICAgICBtc3RvcmUoYWRkKDB4ODAsIDB4ODApLCAzMykKICAgICAgICAgICAgLy8gTm8gbmVlZCB0byB1cGRhdGUgZnJlZSBtZW1vcnkgcG9pbnRlciAtIGZ1bmN0aW9uIGV4ZWN1dGlvbiBlbmRzIGhlcmUKICAgICAgICAgICAgcmV0dXJuKDB4ODAsIG11bCg1LCAweDIwKSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9yZXR1cm4oKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2LCB1aW50MjU2KSB7CiAgICAgICAgLy8gUmV0dXJucyAoMTEsIDIyKQogICAgICAgIHRlc3RfcmV0dXJuX3ZhbHMoKTsKICAgICAgICAvLyBUaGlzIGNvZGUgd2lsbCBuZXZlciBleGVjdXRlCiAgICAgICAgcmV0dXJuICgzMzMsIDQ0NCk7CiAgIC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c3QgYmUgbGVzcyB0aGFuIDMyIGJ5dGVzKQogICAgICAgICAgICBtc3RvcmUoYWRkKHAsIDB4NDQpLCAiRVJST1IiKQogICAgICAgICAgICAvLyBmdW5jdGlvbiBzZWxlY3RvciArIG9mZnNldCArIHN0cmluZyBsZW5ndGggKyBzdHJpbmcgbWVzc2FnZQogICAgICAgICAgICAvLyA9IDB4MDQgKyAweDIwICsgMHgyMCArIDB4MjAKICAgICAgICAgICAgLy8gPSAweDY0CiAgICAgICAgICAgIHJldmVydChwLCAweDY0KQogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgTWVtS2VjY2FrIHsKICAgIGZ1bmN0aW9uIHRlc3Rfa2VjY2FrKCkgcHVibGljIHB1cmUgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIC8vIGtlY2NhazI1NihzdGFydCwgbGVuKSAtIEtlY2NhazI1NiBmcm9tIGRhdGEgaW4gbWVtb3J5IGZyb20gc3RhcnQgdG8gc3RhcnQgKyBsZW4KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIG1zdG9yZSgweDgwLCAxKQogICAgICAgICAgICBtc3RvcmUoMHhhMCwgMikKCiAgICAgICAgICAgIGxldCBoIDo9IGtlY2NhazI1NigweDgwLCAweDQwKQogICAgICAgICAgICBtc3RvcmUoMHhjMCwgaCkKCiAgICAgICAgICAgIHJldHVybigweGMwLCAweDIwKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBrZWNjYWsoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlczMyKSB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKHVpbnQyNTYoMSksIHVpbnQyNTYoMikpKTsKICAgIH0KfQoKY29udHJhY3QgVGFyZ2V0IHsKICAgIGZ1bmN0aW9uIHJldHVybl91aW50MjU2KHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB4Owog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IGRhdGEgdG8gb3V0CiAgICAgICAgICAgIHJldHVybmRhdGFjb3B5KGFkZChvdXQsIDB4MjApLCAwLCByZXR1cm5fZGF0YV9zaXplKQogICAgICAgICAgICAvLyBVcGRhdGUgZnJlZSBtZW1vcnkgcG9pbnRlcgogICAgICAgICAgICBtc3RvcmUoMHg0MCwgYWRkKG91dCwgYWRkKDB4MjAsIHJldHVybl9kYXRhX3NpemUpKSkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gaW5jKCkgcHVibGljIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICBjb3VudCArPSAxOwogICAgICAgIHJldHVybiBjb3VudDsKICAgIH0KfQoKY29udHJhY3QgWXVsQ2FsbCB7CiAgICBmdW5jdGlvbiB0ZXN0X2NhbGwoYWRkcmVzcyBhLCBieXRlcyBtZW1vcnkgZGF0YSkKICAgICAgICBwdWJsaWMKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMgbWVtb3J5IG91dCkKICAgIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIDB4ODAKICAgICAgICAgICAgbGV0IGRhdGFfcHRyIDo9IGRhdGEKICAgICAgICAgICAgLy8gMHg2MAogICAgICAgICAgICBsZXQgb3V0X3B0ciA6PSBvdXQKCiAgICAgICAgICAgIGxldCBkYXRhX3NpemUgOj0gbWxvYWQoZGF0YSkKICAgICAgICAgICAgbGV0IGRhdGFfc3RhcnQgOj0gYWRkKGRhdGEsIDB4MjApCiAgICAgICAgICAgIGxldCBvayA6PSBjYWxsKGdhcygpLCBhLCBjYWxsdmFsdWUoKSwgZGF0YV9zdGFydCwgZGF0YV9zaXplLCAwLCAwKQoKICAgICAgICAgICAgaWYgaXN6ZXJvKG9rKSB7IHJldmVydCgwLCAwKSB9CgogICAgICAgICAgICBsZXQgcmV0dXJuX2RhdGF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MCB8IDUyOTkxOAovLyAgICAxNjAwMCB8IDU5NjQ4NAovLyAgICAxNzAwMCB8IDY2Njk1NwovLyAgICAxODAwMCB8IDc0MTMzNgovLyAgICAxOTAwMCB8IDgxOTYyMQovLyAgICAyMDAwMCB8IDkwMTgxMgo="}],Yk=`

      Examples of

      +`,Zk=({prev:s,next:a})=>i.jsx(A,{version:uk,title:yk,description:mk,cyfrinLink:bk,html:kk,prev:s,next:a,codes:wk}),Wk="0.8.26",Bk="EVM Memory Layout in Solidity",Gk="Example of EVM memory in Solidity",fk="",Vk=[{fileName:"YulMem.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI2OwoKLy8gTWVtb3J5IGxheW91dAovLyBhcnJheSBvZiBsZW5ndGggMioqMjU2ICgzMiBieXRlcyksIGVhY2ggZWxlbWVudCBzdG9yZXMgMSBieXRlICgweDAwIHRvIDB4ZmYpCi8vIGluZGV4ICAgICAwICAgIDEgICAgMiAgIC4uLiAgIDB4ZmZmLi4uZmZmID0gMioqMjU2IC0gMQovLyBtZW1vcnkgfCAwMCB8IDAwIHwgMDAgfCAuLi4gfCAwMCB8CgovLyBSZXNlcnZlZCBzbG90cwovLyAweDAwIC0gMHgzZiAoNjQgYnl0ZXMpOiBzY3JhdGNoIHNwYWNlIGZvciBoYXNoaW5nIG1ldGhvZHMKLy8gMHg0MCAtIDB4NWYgKDMyIGJ5dGVzKTogZnJlZSBtZW1vcnkgcG9pbnRlciAtIHBvaW50ZXIgdG8gbmV4dCBhdmFpbGFibGUgbG9jYXRpb24gaW4gbWVtb3J5IHRvIHN0b3JlIGRhdGEKLy8gMHg2MCAtIDB4N2YgKDMyIGJ5dGVzKTogemVybyBzbG90IC0gdXNlZCBhcyBpbml0aWFsIHZhbHVlIGZvciBkeW5hbWljIG1lbW9yeSBhcnJheXMgYW5kIHNob3VsZCBuZXZlciBiZSB3cml0dGVuIHRvCgovLyBGcmVlIG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JlYWQoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IHgsIHVpbnQyNTYgeSwgdWludDI1NiB6KQogICAgewogICAgICAgIC8vIFBvaW50IGlzIGxvYWRlZCB0byBtZW1vcnkgc3RhcnRpbmcgYXQgMHg4MAogICAgICAgIC8vIDB4ODAgPSBpbml0aWFsIGZyZWUgbWVtb3J5CiAgICAgICAgUG9pbnQgbWVtb3J5IHAgPSBQb2ludCgxLCAyLCAzKTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBsb2FkIDMyIGJ5dGVzIHN0YXJ0aW5nIGZyb20gMHg4MAogICAgICAgICAgICB4IDo9IG1sb2FkKDB4ODApCiAgICAgICAgICAgIC8vIGxvYWQgMzIgYnl0ZXMgc3RhcnRpbmcgZnJvbSAweGEwICgweDgwICsgMzIgPSAweGEwKQogICAgICAgICAgICB5IDo9IG1sb2FkKDB4YTApCiAgICAgICAgICAgIC8vIGxvYWQgMzIgYnl0ZXMgc3RhcnRpbmcgZnJvbSAweGMwICgweGEwICsgMzIgPSAweGMwKQogICAgICAgICAgICB6IDo9IG1sb2FkKDB4YzApCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfd3JpdGUoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyIGZyZWVfbWVtX3B0ciwgdWludDI1NiB4LCB1aW50MjU2IHksIHVpbnQyNTYgeikKICAgIHsKICAgICAgICAvLyBBbGxvY2F0ZXMgbWVtb3J5IDB4ODAgdG8gMHhkZiB0byBQb2ludAogICAgICAgIC8vIEZyZWUgbWVtb3J5IHBvaW50ZXIgPSAweGRmICsgMSA9IDB4ZTAKICAgICAgICBQb2ludCBtZW1vcnkgcDsKCiAgICAgICAgLy8gV3JpdGUKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIHN0b3JlIHRvIDB4ODAKICAgICAgICAgICAgbXN0b3JlKHAsIDExKQogICAgICAgICAgICAvLyBzdG9yZSB0byAweGEwCiAgICAgICAgICAgIG1zdG9yZShhZGQocCwgMHgyMCksIDIyKQogICAgICAgICAgICAvLyBzdG9yZSB0byAweGMwCiAgICAgICAgICAgIG1zdG9yZShhZGQocCwgMHg0MCksIDMzKQogICAgICAgICAgICAvLyAweGUwCiAgICAgICAgICAgIGZyZWVfbWVtX3B0ciA6PSBtbG9hZCgweDQwKQogICAgICAgIH0KCiAgICAgICAgeCA9IHAueDsKICAgICAgICB5ID0gcC55OwogICAgICAgIHogPSBwLno7CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUZpeGVkQXJyYXkgewogICAgZnVuY3Rpb24gdGVzdF9yZWFkKCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBhMCwgdWludDI1NiBhMSwgdWludDI1NiBhMikKICAgIHsKICAgICAgICAvLyBhcnIgaXMgbG9hZGVkIHRvIG1lbW9yeSBzdGFydGluZyBhdCAweDgwCiAgICAgICAgLy8gRWFjaCBhcnJheSBlbGVtZW50IGlzIHN0b3JlZCBhcyAzMiBieXRlcwogICAgICAgIHVpbnQzMlszXSBtZW1vcnkgYXJyID0gW3VpbnQzMigxKSwgdWludDMyKDIpLCB1aW50MzIoMyldOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGEwIDo9IG1sb2FkKDB4ODApCiAgICAgICAgICAgIGExIDo9IG1sb2FkKDB4YTApCiAgICAgICAgICAgIGEyIDo9IG1sb2FkKDB4YzApCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfd3JpdGUoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGEwLCB1aW50MjU2IGExLCB1aW50MjU2IGEyKQogICAgewogICAgICAgIHVpbnQzMlszXSBtZW1vcnkgYXJyOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIDB4ODAKICAgICAgICAgICAgbXN0b3JlKGFyciwgMTEpCiAgICAgICAgICAgIC8vIDB4YTAKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4MjApLCAyMikKICAgICAgICAgICAgLy8gMHhjMAogICAgICAgICAgICBtc3RvcmUoYWRkKGFyciwgMHg0MCksIDMzKQogICAgICAgIH0KCiAgICAgICAgYTAgPSBhcnJbMF07CiAgICAgICAgYTEgPSBhcnJbMV07CiAgICAgICAgYTIgPSBhcnJbMl07CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUR5bmFtaWNBcnJheSB7CiAgICBmdW5jdGlvbiB0ZXN0X3JlYWQoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyIHAsIHVpbnQyNTYgbGVuLCB1aW50MjU2IGEwLCB1aW50MjU2IGExLCB1aW50MjU2IGEyKQogICAgewogICAgICAgIHVpbnQyNTZbXSBtZW1vcnkgYXJyID0gbmV3IHVpbnQyNTZbXSg1KTsKICAgICAgICBhcnJbMF0gPSB1aW50MjU2KDExKTsKICAgICAgICBhcnJbMV0gPSB1aW50MjU2KDIyKTsKICAgICAgICBhcnJbMl0gPSB1aW50MjU2KDMzKTsKICAgICAgICBhcnJbM10gPSB1aW50MjU2KDQ0KTsKICAgICAgICBhcnJbNF0gPSB1aW50MjU2KDU1KTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBwIDo9IGFycgogICAgICAgICAgICAvLyAweDgwCiAgICAgICAgICAgIGxlbiA6PSBtbG9hZChhcnIpCiAgICAgICAgICAgIC8vIDB4YTAKICAgICAgICAgICAgYTAgOj0gbWxvYWQoYWRkKGFyciwgMHgyMCkpCiAgICAgICAgICAgIC8vIDB4YzAKICAgICAgICAgICAgYTEgOj0gbWxvYWQoYWRkKGFyciwgMHg0MCkpCiAgICAgICAgICAgIC8vIDB4ZTAKICAgICAgICAgICAgY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gdGhlIHN0YWNrCiAgICAgICAgaW50ZXJuYWxfZnVuY19yZXR1cm5fdmFsKCk7CiAgICB9CgogICAgZnVuY3Rpb24gaW50ZXJuYWxfZnVuY19yZXR1cm5fbWVtKCkKICAgICAgICBwcml2YXRlCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzJbXSBtZW1vcnkpCiAgICB7CiAgICAgICAgYnl0ZXMzMltdIG1lbW9yeSBhcnIgPSBuZXcgYnl0ZXMzMltdKDMpOwogICAgICAgIGFyclswXSA9IGJ5dGVzMzIodWludDI1NigweGFhYSkpOwogICAgICAgIGFyclsxXSA9IGJ5dGVzMzIodWludDI1NigweGJiYikpOwogICAgICAgIGFyclsyXSA9IGJ5dGVzMzIodWludDI1NigweGNjYykpOwogICAgICAgIHJldHVybiBhcnI7CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9tZW0oKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGxlbiwgYnl0ZXMzMiBhMCwgYnl0ZXMzMiBhMSwgYnl0ZXMzMiBhMikKICAgIHsKICAgICAgICAvLyBTdG9yZXMgMHg4MCB0byB0b3Agb2YgdGhlIHN0YWNrCiAgICAgICAgLy8gMHg4MCA9IG1lbW9yeSBwb2ludGVyIHRvIGJlZ2lubmluZyBvZiBhcnIKICAgICAgICBpbnRlcm5hbF9mdW5jX3JldHVybl9tZW0oKTsKICAgICAgICAvLyBSZWFkIGRhdGEgZnJvbSBhcnIsIGluaXRpYWxpemVkIGluIGludGVybmFsX2Z1bmNfcmV0dXJuX21lbSwgdXNpbmcgYXNzZW1ibHkKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxlbiA6PSBtbG9hZCgweDgwKQogICAgICAgICAgICBhMCA6PSBtbG9hZCgweGEwKQogICAgICAgICAgICBhMSA6PSBtbG9hZCgweGMwKQogICAgICAgICAgICBhMiA6PSBtbG9hZCgweGUwKQogICAgICAg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ihzdGFydCwgbGVuKSAtIEhhbHQgZXhlY3V0aW9uIGFuZCByZXR1cm4gZGF0YSBzdG9yZWQgaW4gbWVtb3J5IGZyb20gc3RhcnQgdG8gc3RhcnQgKyBsZW4KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIG1zdG9yZSgweDgwLCAxMSkKICAgICAgICAgICAgbXN0b3JlKDB4YTAsIDIyKQogICAgICAgICAgICByZXR1cm4oMHg4MCwgMHg0MCkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9yZXR1cm5fZHluX2FycigpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTZbXSBtZW1vcnkpIHsKICAgICAgICAvLyBBQkkgZW5jb2RlIHVpbnQyNTZbXSBhcnJheSB3aXRoIDMgZWxlbWVudHMgMTEsIDIyIGFuZCAzMwogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gb2Zmc2V0CiAgICAgICAgICAgIG1zdG9yZSgweDgwLCAweDIwKQogICAgICAgICAgICAvLyBsZW5ndGgKICAgICAgICAgICAgbXN0b3JlKGFkZCgweDgwLCAweDIwKSwgMykKICAgICAgICAgICAgLy8gYXJyYXkgZWxlbWVudHMKICAgICAgICAgICAgbXN0b3JlKGFkZCgweDgwLCAweDQwKSwgMTEpCiAgICAgICAgICAgIG1zdG9yZShhZGQoMHg4MCwgMHg2MCksIDIyKQogICAgICAgICAgICBtc3RvcmUoYWRkKDB4ODAsIDB4ODApLCAzMykKICAgICAgICAgICAgLy8gTm8gbmVlZCB0byB1cGRhdGUgZnJlZSBtZW1vcnkgcG9pbnRlciAtIGZ1bmN0aW9uIGV4ZWN1dGlvbiBlbmRzIGhlcmUKICAgICAgICAgICAgcmV0dXJuKDB4ODAsIG11bCg1LCAweDIwKSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9yZXR1cm4oKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2LCB1aW50MjU2K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ZnNldAogICAgICAgICAgICBtc3RvcmUoYWRkKHAsIDB4MDQpLCAweDIwKQogICAgICAgICAgICAvLyBTdHJpbmcgbGVuZ3RoCiAgICAgICAgICAgIG1zdG9yZShhZGQocCwgMHgyNCksIDUpCiAgICAgICAgICAgIC8vIE1lc3NhZ2UgKG11c3QgYmUgbGVzcyB0aGFuIDMyIGJ5dGVzKQogICAgICAgICAgICBtc3RvcmUoYWRkKHAsIDB4NDQpLCAiRVJST1IiKQogICAgICAgICAgICAvLyBmdW5jdGlvbiBzZWxlY3RvciArIG9mZnNldCArIHN0cmluZyBsZW5ndGggKyBzdHJpbmcgbWVzc2FnZQogICAgICAgICAgICAvLyA9IDB4MDQgKyAweDIwICsgMHgyMCArIDB4MjAKICAgICAgICAgICAgLy8gPSAweDY0CiAgICAgICAgICAgIHJldmVydChwLCAweDY0KQogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgTWVtS2VjY2FrIHsKICAgIGZ1bmN0aW9uIHRlc3Rfa2VjY2FrKCkgcHVibGljIHB1cmUgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIC8vIGtlY2NhazI1NihzdGFydCwgbGVuKSAtIEtlY2NhazI1NiBmcm9tIGRhdGEgaW4gbWVtb3J5IGZyb20gc3RhcnQgdG8gc3RhcnQgKyBsZW4KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIG1zdG9yZSgweDgwLCAxKQogICAgICAgICAgICBtc3RvcmUoMHhhMCwgMikKCiAgICAgICAgICAgIGxldCBoIDo9IGtlY2NhazI1NigweDgwLCAweDQwKQogICAgICAgICAgICBtc3RvcmUoMHhjMCwgaCkKCiAgICAgICAgICAgIHJldHVybigweGMwLCAweDIwKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBrZWNjYWsoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlczMyKSB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKHVpbnQyNT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XR1cm4gZGF0YSB0byBvdXQKICAgICAgICAgICAgLy8gcG9pbnRlciB0byBvdXQgPSAweDYwICh6ZXJvIHNsb3QpCiAgICAgICAgICAgIG1zdG9yZShvdXQsIHJldHVybl9kYXRhX3NpemUpCiAgICAgICAgICAgIC8vIENvcHkgcmV0dXJuIGRhdGEgdG8gb3V0CiAgICAgICAgICAgIHJldHVybmRhdGFjb3B5KGFkZChvdXQsIDB4MjApLCAwLCByZXR1cm5fZGF0YV9zaXplKQogICAgICAgICAgICAvLyBVcGRhdGUgZnJlZSBtZW1vcnkgcG9pbnRlcgogICAgICAgICAgICBtc3RvcmUoMHg0MCwgYWRkKG91dCwgYWRkKDB4MjAsIHJldHVybl9kYXRhX3NpemUpKSkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gaW5jKCkgcHVibGljIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICBjb3VudCArPSAxOwogICAgICAgIHJldHVybiBjb3VudDsKICAgIH0KfQoKY29udHJhY3QgWXVsQ2FsbCB7CiAgICBmdW5jdGlvbiB0ZXN0X2NhbGwoYWRkcmVzcyBhLCBieXRlcyBtZW1vcnkgZGF0YSkKICAgICAgICBwdWJsaWMKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMgbWVtb3J5IG91dCkKICAgIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIDB4ODAKICAgICAgICAgICAgbGV0IGRhdGFfcHRyIDo9IGRhdGEKICAgICAgICAgICAgLy8gMHg2MAogICAgICAgICAgICBsZXQgb3V0X3B0ciA6PSBvdXQKCiAgICAgICAgICAgIGxldCBkYXRhX3NpemUgOj0gbWxvYWQoZGF0YSkKICAgICAgICAgICAgbGV0IGRhdGFfc3RhcnQgOj0gYWRkKGRhdGEsIDB4MjApCiAgICAgICAgICAgIGxldCBvayA6PS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OTAwMCB8IDIxMjU1MAovLyAgICAxMDAwMCB8IDI1NTY3OQovLyAgICAxMTAwMCB8IDMwMjcxNQovLyAgICAxMjAwMCB8IDM1MzY1NgovLyAgICAxMzAwMCB8IDQwODUwNAovLyAgICAxNDAwMCB8IDQ2NzI1NwovLyAgICAxNTAwMCB8IDUyOTkxOAovLyAgICAxNjAwMCB8IDU5NjQ4NAovLyAgICAxNzAwMCB8IDY2Njk1NwovLyAgICAxODAwMCB8IDc0MTMzNgovLyAgICAxOTAwMCB8IDgxOTYyMQovLyAgICAyMDAwMCB8IDkwMTgxMgo="}],Yk=`

      Examples of

      • Reading and writing to memory with assembly
      • Memory layout in Solidity of different data types
      • @@ -8259,7 +8311,7 @@ assertion probably means that there is a bug.

        References

        Solidity document

        EVM Codes

        -`,Xk=({prev:s,next:a})=>i.jsx(A,{version:Wk,title:Gk,description:Bk,cyfrinLink:fk,html:Yk,prev:s,next:a,codes:Vk}),vk="0.8.26",Rk="EVM Storage",Nk="Example of EVM storage in Solidity",Hk="",Fk=[{fileName:"EVMStorage.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIFl1bCAtIGxhbmd1YWdlIHVzZWQgZm9yIFNvbGlkaXR5IGlubGluZSBhc3NlbWJseQpjb250cmFjdCBZdWxJbnRybyB7CiAgICAvLyBZdWwgYXNzaWdubWVudAogICAgZnVuY3Rpb24gdGVzdF95dWxfdmFyKCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHVpbnQyNTYgcyA9IDA7CgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gRGVjbGFyZSB2YXJpYWJsZQogICAgICAgICAgICBsZXQgeCA6PSAxCiAgICAgICAgICAgIC8vIFJlYXNzaWduCiAgICAgICAgICAgIHggOj0gMgogICAgICAgICAgICAvLyBBc3NpZ24gdG8gU29saWRpdHkgdmFyaWFib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dGlvbiB0ZXN0X3NzdG9yZSgpIHB1YmxpYyB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzc3RvcmUoMCwgMTExKQogICAgICAgICAgICBzc3RvcmUoMSwgMjIyKQogICAgICAgICAgICBzc3RvcmUoMiwgMHhhYmFiYWIpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfc3N0b3JlX2FnYWluKCkgcHVibGljIHsKICAgICAgICAvLyBBY2Nlc3Mgc2xvdCB1c2luZyAuc2xvdAogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgc3N0b3JlKHNfeC5zbG90LCAxMjMpCiAgICAgICAgICAgIHNzdG9yZShzX3kuc2xvdCwgNDU2KQogICAgICAgICAgICBzc3RvcmUoc196LnNsb3QsIDB4Y2RjZGNkKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3Nsb2FkKCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB4LCB1aW50MjU2IHksIGJ5dGVzMzIgeikKICAgIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHggOj0gc2xvYWQoMCkKICAgICAgICAgICAgeSA6PSBzbG9hZCgxKQogICAgICAgICAgICB6IDo9IHNsb2FkKDIpCiAgICAgICAgfQoKICAgICAgICByZXR1cm4gKHgsIHksIHopOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfc2xvYWRfYWdhaW4oKQogICAgICAgIHB1YmxpYwogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2IHgsIHVpbnQyNTYgeSwgYnl0ZXMzMiB6KQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgeCA6PSBzbG9hZChzX3guc2xvdCkKICAgICAgICAgICAgeSA6PSBzbG9hZChzX3kuc2xvdCkKICAgICAgICAgICAgeiA6PSBzbG9hZChzX3ouc2xvdCkKICAgICAgICB9CgogICAgICAgIHJldHVybiAoeCwgeSwgeik7CiAgICB9Cn0KCmNvbnRyYWN0IEVWTVN0b3JhdGVQYWNrZWRTbG90Qnl0ZXMgewogICAgLy8gc2xvdCAwIChwYWNrZWQgcmlnaHQgdG8gbGVmdCkKICAgIGJ5dGVzNCBwdWJsaWMgYjQgPSAweGFiYWJhYmFiOwogICAgYnl0ZXMyIHB1YmxpYyBiMiA9IDB4Y2RjZDsKCiAgICBmdW5jdGlvbiBnZXQoKSBwdWJsaWMgdmlldyByZXR1cm5zIChieXRlczMyIGIzMikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgYjMyIDo9IHNsb2FkKDApCiAgICAgICAgfQogICAgfQp9Cgpjb250cmFjdCBCaXRNYXNraW5nIHsKICAgIGZ1bmN0aW9uIHRlc3RfbWFzaygpIHB1YmxpYyBwdXJlIHJldHVybnMgKGJ5dGVzMzIgbWFzaykgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gfCAgICAgICAyNTYgYml0cyAgICAgICAgfAogICAgICAgICAgICAvLyAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExCiAgICAgICAgICAgIC8vICAgICAgICAgICAgIHwgMTYgYml0cwogICAgICAgICAgICAvLyAweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMGZmZmYKICAgICAgICAgICAgbWFzayA6PSBzdWIoc2hsKDE2LCAxKSwgMSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9zaGlmdF9tYXNrKCkgcHVibGljIHB1cmUgcmV0dXJucyAoYnl0ZXMzMiBtYXNrKSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyB8ICAgICAgICAgICAgICAgMjU2IGJpdHMgICAgICAgICAgICAgICAgfAogICAgICAgICAgICAvLyAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExIHwgMDAwIC4uLiAwMDAgfAogICAgICAgICAgICAvLyAgICAgICAgICAgICB8IDE2IGJpdHMgICAgIHwgMzIgYml0cwogICAgICAgICAgICAvLyAweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBmZmZmMDAwMDAwMDAKICAgICAgICAgICAgbWFzayA6PSBzaGwoMzIsIHN1YihzaGwoMTYsIDEpLCAxKSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9ub3RfbWFzaygpIHB1YmxpYyBwdXJlIHJldHVybnMgKGJ5dGVzMzIgbWFzaykgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gfCAgICAgICAgICAgICAgIDI1NiBiaXRzICAgICAgICAgICAgICAgIHwKICAgICAgICAgICAgLy8gMTExIC4uLiAxMTEgfCAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExIHwKICAgICAgICAgICAgLy8gICAgICAgICAgICAgfCAxNiBiaXRzICAgICB8IDMyIGJpdHMKICAgICAgICAgICAgLy8gMHhmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmMDAwMGZmZmZmZmZmCiAgICAgICAgICAgIG1hc2sgOj0gbm90KHNobCgzMiwgc3ViKHNobCgxNiwgMSksIDEpKSkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IEVWTVN0b3JhZ2VQYWNrZWRTbG90IHsKICAgIC8vIERhdGEgPCAzMiBieXRlcyBhcmUgcGFja2VkIGludG8gYSBzbG90CiAgICAvLyBCaXQgbWFza2luZyAoaG93IHRvIGNyZWF0ZSAxMTEuLi4xMTEpCiAgICAvLyBzbG90LCBvZmZzZXQKCiAgICAvLyBzbG90IDAKICAgIHVpbnQxMjggcHVibGljIHNfYTsKICAgIHVpbnQ2NCBwdWJsaWMgc19iOwogICAgdWludDMyIHB1YmxpYyBzX2M7CiAgICB1aW50MzIgcHVibGljIHNfZDsKICAgIC8vIHNsb3QgMQogICAgLy8gMjAgYnl0ZXMgPSAxNjAgYml0cwogICAgYWRkcmVzcyBwdWJsaWMgc19hZGRyOwogICAgLy8gOTYgYml0cwogICAgdWludDY0IHB1YmxpYyBzX3g7CiAgICB1aW50MzIgcHVibGljIHNfeTsKCiAgICBmdW5jdGlvbiB0ZXN0X3NzdG9yZSgpIHB1YmxpYyB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBMb2FkIDMyIGJ5dGVzIGZyb20gc2xvdDAKICAgICAgICAgICAgbGV0IHYgOj0gc2xvYWQoMCkKCiAgICAgICAgICAgIC8vIHNfZCB8IHNfYyB8IHNfYiB8IHNfYQogICAgICAgICAgICAvLyAzMiAgfCAzMiAgfCA2NCAgfCAxMjggYml0cwoKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDExCiAgICAgICAgICAgIC8vIG1hc2sgPSBhbGwgMXMgYXQgYW5kIHRvIHRoZSBsZWZ0IG9mIDEyOCBiaXQgY291bnRpbmcgZnJvbSByaWdodAogICAgICAgICAgICAvLyAgICAgICAgMTExIC4uLiAxMTEgfCAwMDAgLi4uIDAwMAogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19hIDo9IG5vdChzdWIoc2hsKDEyOCwgMSksIDEpKQogICAgICAgICAgICAvLyBTZXQgbGVmdCBtb3N0IDEyOCBiaXRzIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19hKQogICAgICAgICAgICAvLyBTZXQgc19hID0gMTEKICAgICAgICAgICAgdiA6PSBvcih2LCAxMSkKCiAgICAgICAgICAgIC8vIFNldCBzX2IgPSAyMgogICAgICAgICAgICAvLyBtYXNrID0gMTExLi4uMTExIHwgMDAwIC4uLiAwMDAgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19iIDo9IG5vdChzaGwoMTI4LCBzdWIoc2hsKDY0LCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2IgYnkgc2V0dGluZyBiaXRzICgxMjggdG8gMTkxIGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19iKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobCgxMjgsIDIyKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2MgPSAzMwogICAgICAgICAgICAvLyBtYXNrID0gMTExLi4uMTExIHwgMDAwLi4uMDAwIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19jIDo9IG5vdChzaGwoMTkyLCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2MgYnkgc2V0dGluZyBiaXRzICgxOTIgdG8gMjIzIGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19jKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobCgxOTIsIDMzKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2QgPSA0NAogICAgICAgICAgICAvLyBtYXNrID0gMDAwLi4uMDAwIHwgMTExLi4uMTExIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19kIDo9IG5vdChzaGwoMjI0LCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2QgYnkgc2V0dGluZyBiaXRzICgyMjQgdG8gMjU1IGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19kKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobCgyMjQsIDQ0KSkKCiAgICAgICAgICAgIC8vIFN0b3JlIG5ldyB2YWx1ZSB0byBzbG90MAogICAgICAgICAgICBzc3RvcmUoMCwgdikKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9zbG90XzBfb2Zmc2V0KCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoCiAgICAgICAgICAgIHVpbnQyNTYgYV9vZmZzZXQsCiAgICAgICAgICAgIHVpbnQyNTYgYl9vZmZzZXQsCiAgICAgICAgICAgIHVpbnQyNTYgY19vZmZzZXQsCiAgICAgICAgICAgIHVpbnQyNTYgZF9vZmZzZXQKICAgICAgICApCiAgICB7CiAgICAgICAgLy8gYV9vZmZzZXQgPSAgMCA9ICAwICogOCA9ICAgMCBiaXRzCiAgICAgICAgLy8gYl9vZmZzZXQgPSAxNiA9IDE2ICogOCA9IDEyOCBiaXRzCiAgICAgICAgLy8gY19vZmZzZXQgPSAyNCA9IDI0ICogOCA9IDE5MiBiaXRzCiAgICAgICAgLy8gZF9vZmZzZXQgPSAyOCA9IDI4ICogOCA9IDIyNCBiaXRzCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBhX29mZnNldCA6PSBzX2Eub2Zmc2V0CiAgICAgICAgICAgIGJfb2Zmc2V0IDo9IHNfYi5vZmZzZXQKICAgICAgICAgICAgY19vZmZzZXQgOj0gc19jLm9mZnNldAogICAgICAgICAgICBkX29mZnNldCA6PSBzX2Qub2Zmc2V0CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfc2xvdF8xX29mZnNldCgpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYWRkcl9vZmZzZXQsIHVpbnQyNTYgeF9vZmZzZXQsIHVpbnQyNTYgeV9vZmZzZXQpCiAgICB7CiAgICAgICAgLy8gYWRkcl9vZmZzZXQgPSAwCiAgICAgICAgLy8geF9vZmZzZXQgPSAyMAogICAgICAgIC8vIHlfb2Zmc2V0ID0gMjgKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGFkZHJfb2Zmc2V0IDo9IHNfYWRkci5vZmZzZXQKICAgICAgICAgICAgeF9vZmZzZXQgOj0gc194Lm9mZnNldAogICAgICAgICAgICB5X29mZnNldCA6PSBzX3kub2Zmc2V0CiAgICAgICAgfQogICAgfQoKICAgIC8vIHNsb3QgYW5kIG9mZnNldAogICAgZnVuY3Rpb24gdGVzdF9zc3RvcmVfdXNpbmdfb2Zmc2V0KCkgcHVibGljIHsKICAgICAgICAvLyBhX29mZnNldCA9ICAwID0gIDAgKiA4ID0gICAwIGJpdHMKICAgICAgICAvLyBiX29mZnNldCA9IDE2ID0gMTYgKiA4ID0gMTI4IGJpdHMKICAgICAgICAvLyBjX29mZnNldCA9IDI0ID0gMjQgKiA4ID0gMTkyIGJpdHMKICAgICAgICAvLyBkX29mZnNldCA9IDI4ID0gMjggKiA4ID0gMjI0IGJpdHMKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIExvYWQgMzIgYnl0ZXMgZnJvbSBzbG90MAogICAgICAgICAgICBsZXQgdiA6PSBzbG9hZChzX2Euc2xvdCkKCiAgICAgICAgICAgIC8vIHNfZCB8IHNfYyB8IHNfYiB8IHNfYQogICAgICAgICAgICAvLyAzMiAgfCAzMiAgfCA2NCAgfCAxMjggYml0cwoKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDExMQogICAgICAgICAgICAvLyBtYXNrID0gYWxsIDFzIGF0IGFuZCB0byB0aGUgbGVmdCBvZiAxMjggYml0IGNvdW50aW5nIGZyb20gcmlnaHQKICAgICAgICAgICAgLy8gICAgICAgIDExMSAuLi4gMTExIHwgMDAwIC4uLiAwMDAKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgIHwgICAgMTI4IGJpdHMKICAgICAgICAgICAgbGV0IG1hc2tfYSA6PSBub3Qoc3ViKHNobCgxMjgsIDEpLCAxKSkKICAgICAgICAgICAgLy8gU2V0IGxlZnQgbW9zdCAxMjggYml0cyB0byAwCiAgICAgICAgICAgIHYgOj0gYW5kKHYsIG1hc2tfYSkKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDEKICAgICAgICAgICAgdiA6PSBvcih2LCAxMTEpCgogICAgICAgICAgICAvLyBTZXQgc19iID0gMjIyCiAgICAgICAgICAgIC8vIG1hc2sgPSAxMTEuLi4xMTEgfCAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExCiAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgfCAgICAgNjQgYml0cyB8ICAgIDEyOCBiaXRzCiAgICAgICAgICAgIGxldCBtYXNrX2IgOj0gbm90KHNobChtdWwoc19iLm9mZnNldCwgOCksIHN1YihzaGwoNjQsIDEpLCAxKSkpCiAgICAgICAgICAgIC8vIENsZWFyIHByZXZpb3VzIHZhbHVlIG9mIHNfYiBieSBzZXR0aW5nIGJpdHMgKDEyOCB0byAxOTEgYml0cykgdG8gMAogICAgICAgICAgICB2IDo9IGFuZCh2LCBtYXNrX2IpCiAgICAgICAgICAgIHYgOj0gb3Iodiwgc2hsKG11bChzX2Iub2Zmc2V0LCA4KSwgMjIyKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2MgPSAzMzMKICAgICAgICAgICAgLy8gbWFzayA9IDExMS4uLjExMSB8IDAwMC4uLjAwMCB8IDExMSAuLi4gMTExIHwgMTExIC4uLiAxMTEKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICB8ICAgMzIgYml0cyB8ICAgICA2NCBiaXRzIHwgICAgMTI4IGJpdHMKICAgICAgICAgICAgbGV0IG1hc2tfYyA6PSBub3Qoc2hsKG11bChzX2Mub2Zmc2V0LCA4KSwgc3ViKHNobCgzMiwgMSksIDEpKSkKICAgICAgICAgICAgLy8gQ2xlYXIgcHJldmlvdXMgdmFsdWUgb2Ygc19jIGJ5IHNldHRpbmcgYml0cyAoMTkyIHRvIDIyMyBiaXRzKSB0byAwCiAgICAgICAgICAgIHYgOj0gYW5kKHYsIG1hc2tfYykKICAgICAgICAgICAgdiA6PSBvcih2LCBzaGwobXVsKHNfYy5vZmZzZXQsIDgpLCAzMzMpKQoKICAgICAgICAgICAgLy8gU2V0IHNfZCA9IDQ0NAogICAgICAgICAgICAvLyBtYXNrID0gMDAwLi4uMDAwIHwgMTExLi4uMTExIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19kIDo9IG5vdChzaGwobXVsKHNfZC5vZmZzZXQsIDgpLCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2QgYnkgc2V0dGluZyBiaXRzICgyMjQgdG8gMjU1IGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19kKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobChtdWwoc19kLm9mZnNldCwgOCksIDQ0NCkpCgogICAgICAgICAgICAvLyBTdG9yZSBuZXcgdmFsdWUgdG8gc2xvdDAKICAgICAgICAgICAgc3N0b3JlKHNfYS5zbG90LCB2KQogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgRVZNU3RvcmFnZVN0cnVjdCB7CiAgICBzdHJ1Y3QgU2luZ2xlU2xvdCB7CiAgICAgICAgdWludDEyOCB4OwogICAgICAgIHVpbnQ2NCB5OwogICAgICAgIHVpbnQ2NCB6OwogICAgfQoKICAgIHN0cnVjdCBNdWx0aXBsZVNsb3RzIHsKICAgICAgICB1aW50MjU2IGE7CiAgICAgICAgdWludDI1NiBiOwogICAgICAgIHVpbnQyNTYgYzsKICAgIH0KCiAgICAvLyBzbG90IDAKICAgIFNpbmdsZVNsb3QgcHVibGljIHNpbmdsZSA9IFNpbmdsZVNsb3Qoe3g6IDEsIHk6IDIsIHo6IDN9KTsKICAgIC8vIHNsb3QgMSwgMiwgMwogICAgTXVsdGlwbGVTbG90cyBwdWJsaWMgbXVsdGkgPSBNdWx0aXBsZVNsb3RzKHthOiAxMSwgYjogMjIsIGM6IDMzfSk7CgogICAgZnVuY3Rpb24gdGVzdF9nZXRfc2luZ2xlX3Nsb3Rfc3RydWN0KCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDEyOCB4LCB1aW50NjQgeSwgdWludDY0IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgcyA6PSBzbG9hZCgwKQogICAgICAgICAgICAvLyAgeiB8ICB5IHwgeAogICAgICAgICAgICAvLyA2NCB8IDY0IHwgMTI4IGJpdHMKICAgICAgICAgICAgLy8gQ2FzdGluZyBjdXRzIG9mZiBiaXRzIHRvIHRoZSBsZWZ0CiAgICAgICAgICAgIHggOj0gcwogICAgICAgICAgICB5IDo9IHNocigxMjgsIHMpCiAgICAgICAgICAgIHogOj0gc2hyKDE5MiwgcykKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9nZXRfbXVsdGlwbGVfc2xvdHNfc3RydWN0KCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiBhLCB1aW50MjU2IGIsIHVpbnQyNTYgYykKICAgIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGEgOj0gc2xvYWQoMSkKICAgICAgICAgICAgYiA6PSBzbG9hZCgyKQogICAgICAgICAgICBjIDo9IHNsb2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DEyOFs1XSBwcml2YXRlIGFycl8yID0gWzcsIDgsIDksIDEwLCAxMV07CgogICAgZnVuY3Rpb24gdGVzdF9hcnJfMCh1aW50MjU2IGkpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQyNTYgdikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gYXJyXzAgc3RhcnRzIGZyb20gc2xvdCAwCiAgICAgICAgICAgIHYgOj0gc2xvYWQoYWRkKDAsIGkpKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X2Fycl8xKHVpbnQyNTYgaSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NiB2KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBhcnJfMSBzdGFydHMgZnJvbSBzbG90IDMKICAgICAgICAgICAgdiA6PSBzbG9hZChhZGQoMywgaSkpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfYXJyXzIodWludDI1NiBpKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MTI4IHYpIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIGFycl8yIHN0YXJ0cyBmcm9tIHNsb3QgNgogICAgICAgICAgICBsZXQgYjMyIDo9IHNsb2FkKGFkZCg2LCBkaXYoaSwgMikpKQogICAgICAgICAgICAvLyBzbG90IDYgPSAxc3QgZWxlbWVudCB8IDB0aCBlbGVtZW50CiAgICAgICAgICAgIC8vIHNsb3QgNyA9IDNyZCBlbGVtZW50IHwgMm5kIGVsZW1lbnQKICAgICAgICAgICAgLy8gc2xvdCA4ID0gMDAwIC4uLiAwMDAgfCA0dGggZWxlbWVudAoKICAgICAgICAgICAgLy8gaSBpcyBldmVuID0+IGdldCByaWdodCAxMjggYml0cyA9PiBjYXN0IGJ5dGVzMzIgdG8gdWludDEyOCAoY3V0IG9mZiBsZWZ0IDEyOCBiaXRzKQogICAgICAgICAgICAvLyBpIGlzIG9k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wdWJsaWMgbWFwOwoKICAgIGFkZHJlc3MgcHVibGljIGNvbnN0YW50IEFERFJfMSA9IGFkZHJlc3MoMSk7CiAgICBhZGRyZXNzIHB1YmxpYyBjb25zdGFudCBBRERSXzIgPSBhZGRyZXNzKDIpOwoKICAgIGNvbnN0cnVjdG9yKCkgewogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMTEpOwogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMjIpOwogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMzMpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNDQpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNTUpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNjYpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfbWFwX2FycihhZGRyZXNzIGFkZHIsIHVpbnQyNTYgaSkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB2LCB1aW50MjU2IGxlbikKICAgIHsKICAgICAgICB1aW50MjU2IG1hcF9zbG90ID0gMDsKICAgICAgICBieXRlczMyIG1hcF9oYXNoID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoYWRkciwgbWFwX3Nsb3QpKTsKICAgICAgICBieXRlczMyIGFycl9oYXNoID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUobWFwX2hhc2gpKTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZW4gOj0gc2xvYWQobWFwX2hhc2gpCiAgICAgICAgICAgIHYgOj0gc2xvYWQoYWRkKGFycl9oYXNoLCBpKSkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IEVWTVN0b3JhZ2VEeW5hbWljQXJyYXlTdHJ1Y3QgewogICAgc3RydWN0IFBvaW50IHsKICAgICAgICB1aW50MjU2IHg7CiAgICAgICAgdWludDEyOCB5OwogICAgICAgIHVpbnQxMjggejsKICAgIH0KCiAgICAvLyBzbG90IG9mIGVsZW1lbnQgPSBrZWNjYWsyNTYoc2xvdCB3aGVyZSB0aGlzIGFycmF5IGlzIGRlY2xhcmVkKSArIGluZGV4IG9mIGVsZW1lbnQKICAgIC8vIGtlY2NhazI1NigwKSArIGluZGV4ICogc2l6ZSBvZiBzdHJ1Y3QKICAgIFBvaW50W10gcHJpdmF0ZSBhcnI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgYXJyLnB1c2goUG9pbnQoMTEsIDIyLCAzMykpOwogICAgICAgIGFyci5wdXNoKFBvaW50KDQ0LCA1NSwgNjYpKTsKICAgICAgICBhcnIucHVzaChQb2ludCg3NywgODgsIDk5KSk7CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9zdHJ1Y3RfYXJyKHVpbnQyNTYgaSkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB4LCB1aW50MTI4IHksIHVpbnQxMjggeiwgdWludDI1NiBsZW4pCiAgICB7CiAgICAgICAgdWludDI1NiBzbG90ID0gMDsKICAgICAgICBieXRlczMyIHN0YXJ0ID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoc2xvdCkpOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxlbiA6PSBzbG9hZChzbG90KQogICAgICAgICAgICAvLyBzMCA9IGtlY2NhazI1NigwKQogICAgICAgICAgICAvLyBpbmRleCB8IHNsb3QgICAgICAgIHwgdmFsdWVzCiAgICAgICAgICAgIC8vICAgICAwIHwgc2xvdCBzMCArIDAgfCBhcnJbMF0ueAogICAgICAgICAgICAvLyAgICAgMCB8IHNsb3QgczAgKyAxIHwgYXJyWzBdLnogfCBhcnJbMF0ueQogICAgICAgICAgICAvLyAgICAgMSB8IHNsb3QgczAgKyAyIHwgYXJyWzFdLngKICAgICAgICAgICAgLy8gICAgIDEgfCBzbG90IHMwICsgMyB8IGFyclsxXS56IHwgYXJyWzFdLnkKICAgICAgICAgICAgLy8gICAgIDIgfCBzbG90IHMwICsgNCB8IGFyclsyXS54CiAgICAgICAgICAgIC8vICAgICAyIHwgc2xvdCBzMCArIDUgfCBhcnJbMl0ueiB8IGFyclsyXS55CiAgICAgICAgICAgIHggOj0gc2xvYWQoYWRkKHN0YXJ0LCBtdWwoaSwgMikpKQogICAgICAgICAgICBsZXQgenkgOj0gc2xvYWQoYWRkKHN0YXJ0LCBhZGQobXVsKGksIDIpLCAxKSkpCiAgICAgICAgICAgIC8vIHVpbnQxMjggY3V0cyBvZmYgbGVmdCBtb3N0IDEyOCBiaXRzIGZyb20gMzIgYnl0ZXMKICAgICAgICAgICAgeSA6PSB6eQogICAgICAgICAgICB6IDo9IHNocigxMjgsIHp5KQogICAgICAgIH0KICAgIH0KfQo="}],Kk=`

        Examples of

        +`,Xk=({prev:s,next:a})=>i.jsx(A,{version:Wk,title:Bk,description:Gk,cyfrinLink:fk,html:Yk,prev:s,next:a,codes:Vk}),vk="0.8.26",Rk="EVM Storage",Nk="Example of EVM storage in Solidity",Hk="",Fk=[{fileName:"EVMStorage.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIFl1bCAtIGxhbmd1YWdlIHVzZWQgZm9yIFNvbGlkaXR5IGlubGluZSBhc3NlbWJseQpjb250cmFjdCBZdWxJbnRybyB7CiAgICAvLyBZdWwgYXNzaWdubWVudAogICAgZnVuY3Rpb24gdGVzdF95dWxfdmFyKCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHVpbnQyNTYgcyA9IDA7CgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gRGVjbGFyZSB2YXJpYWJsZQogICAgICAgICAgICBsZXQgeCA6PSAxCiAgICAgICAgICAgIC8vIFJlYXNzaWduCiAgICAgICAgICAgIHggOj0gMgogICAgICAgICAgICAvLyBBc3NpZ24gdG8gU29saWRpdHkgdmFyaWFibGUKICAg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B0ZXN0X3NzdG9yZSgpIHB1YmxpYyB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzc3RvcmUoMCwgMTExKQogICAgICAgICAgICBzc3RvcmUoMSwgMjIyKQogICAgICAgICAgICBzc3RvcmUoMiwgMHhhYmFiYWIpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfc3N0b3JlX2FnYWluKCkgcHVibGljIHsKICAgICAgICAvLyBBY2Nlc3Mgc2xvdCB1c2luZyAuc2xvdAogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgc3N0b3JlKHNfeC5zbG90LCAxMjMpCiAgICAgICAgICAgIHNzdG9yZShzX3kuc2xvdCwgNDU2KQogICAgICAgICAgICBzc3RvcmUoc196LnNsb3QsIDB4Y2RjZGNkKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3Nsb2FkKCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB4LCB1aW50MjU2IHksIGJ5dGVzMzIgeikKICAgIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHggOj0gc2xvYWQoMCkKICAgICAgICAgICAgeSA6PSBzbG9hZCgxKQogICAgICAgICAgICB6IDo9IHNsb2FkKDIpCiAgICAgICAgfQoKICAgICAgICByZXR1cm4gKHgsIHksIHopOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfc2xvYWRfYWdhaW4oKQogICAgICAgIHB1YmxpYwogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2IHgsIHVpbnQyNTYgeSwgYnl0ZXMzMiB6KQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgeCA6PSBzbG9hZChzX3guc2xvdCkKICAgICAgICAgICAgeSA6PSBzbG9hZChzX3kuc2xvdCkKICAgICAgICAgICAgeiA6PSBzbG9hZChzX3ouc2xvdCkKICAgICAgICB9CgogICAgICAgIHJldHVybiAoeCwgeSwgeik7CiAgICB9Cn0KCmNvbnRyYWN0IEVWTVN0b3JhdGVQYWNrZWRTbG90Qnl0ZXMgewogICAgLy8gc2xvdCAwIChwYWNrZWQgcmlnaHQgdG8gbGVmdCkKICAgIGJ5dGVzNCBwdWJsaWMgYjQgPSAweGFiYWJhYmFiOwogICAgYnl0ZXMyIHB1YmxpYyBiMiA9IDB4Y2RjZDsKCiAgICBmdW5jdGlvbiBnZXQoKSBwdWJsaWMgdmlldyByZXR1cm5zIChieXRlczMyIGIzMikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgYjMyIDo9IHNsb2FkKDApCiAgICAgICAgfQogICAgfQp9Cgpjb250cmFjdCBCaXRNYXNraW5nIHsKICAgIGZ1bmN0aW9uIHRlc3RfbWFzaygpIHB1YmxpYyBwdXJlIHJldHVybnMgKGJ5dGVzMzIgbWFzaykgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gfCAgICAgICAyNTYgYml0cyAgICAgICAgfAogICAgICAgICAgICAvLyAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExCiAgICAgICAgICAgIC8vICAgICAgICAgICAgIHwgMTYgYml0cwogICAgICAgICAgICAvLyAweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMGZmZmYKICAgICAgICAgICAgbWFzayA6PSBzdWIoc2hsKDE2LCAxKSwgMSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9zaGlmdF9tYXNrKCkgcHVibGljIHB1cmUgcmV0dXJucyAoYnl0ZXMzMiBtYXNrKSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyB8ICAgICAgICAgICAgICAgMjU2IGJpdHMgICAgICAgICAgICAgICAgfAogICAgICAgICAgICAvLyAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExIHwgMDAwIC4uLiAwMDAgfAogICAgICAgICAgICAvLyAgICAgICAgICAgICB8IDE2IGJpdHMgICAgIHwgMzIgYml0cwogICAgICAgICAgICAvLyAweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBmZmZmMDAwMDAwMDAKICAgICAgICAgICAgbWFzayA6PSBzaGwoMzIsIHN1YihzaGwoMTYsIDEpLCAxKSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9ub3RfbWFzaygpIHB1YmxpYyBwdXJlIHJldHVybnMgKGJ5dGVzMzIgbWFzaykgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gfCAgICAgICAgICAgICAgIDI1NiBiaXRzICAgICAgICAgICAgICAgIHwKICAgICAgICAgICAgLy8gMTExIC4uLiAxMTEgfCAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExIHwKICAgICAgICAgICAgLy8gICAgICAgICAgICAgfCAxNiBiaXRzICAgICB8IDMyIGJpdHMKICAgICAgICAgICAgLy8gMHhmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmMDAwMGZmZmZmZmZmCiAgICAgICAgICAgIG1hc2sgOj0gbm90KHNobCgzMiwgc3ViKHNobCgxNiwgMSksIDEpKSkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IEVWTVN0b3JhZ2VQYWNrZWRTbG90IHsKICAgIC8vIERhdGEgPCAzMiBieXRlcyBhcmUgcGFja2VkIGludG8gYSBzbG90CiAgICAvLyBCaXQgbWFza2luZyAoaG93IHRvIGNyZWF0ZSAxMTEuLi4xMTEpCiAgICAvLyBzbG90LCBvZmZzZXQKCiAgICAvLyBzbG90IDAKICAgIHVpbnQxMjggcHVibGljIHNfYTsKICAgIHVpbnQ2NCBwdWJsaWMgc19iOwogICAgdWludDMyIHB1YmxpYyBzX2M7CiAgICB1aW50MzIgcHVibGljIHNfZDsKICAgIC8vIHNsb3QgMQogICAgLy8gMjAgYnl0ZXMgPSAxNjAgYml0cwogICAgYWRkcmVzcyBwdWJsaWMgc19hZGRyOwogICAgLy8gOTYgYml0cwogICAgdWludDY0IHB1YmxpYyBzX3g7CiAgICB1aW50MzIgcHVibGljIHNfeTsKCiAgICBmdW5jdGlvbiB0ZXN0X3NzdG9yZSgpIHB1YmxpYyB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBMb2FkIDMyIGJ5dGVzIGZyb20gc2xvdDAKICAgICAgICAgICAgbGV0IHYgOj0gc2xvYWQoMCkKCiAgICAgICAgICAgIC8vIHNfZCB8IHNfYyB8IHNfYiB8IHNfYQogICAgICAgICAgICAvLyAzMiAgfCAzMiAgfCA2NCAgfCAxMjggYml0cwoKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDExCiAgICAgICAgICAgIC8vIG1hc2sgPSBhbGwgMXMgYXQgYW5kIHRvIHRoZSBsZWZ0IG9mIDEyOCBiaXQgY291bnRpbmcgZnJvbSByaWdodAogICAgICAgICAgICAvLyAgICAgICAgMTExIC4uLiAxMTEgfCAwMDAgLi4uIDAwMAogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19hIDo9IG5vdChzdWIoc2hsKDEyOCwgMSksIDEpKQogICAgICAgICAgICAvLyBTZXQgbGVmdCBtb3N0IDEyOCBiaXRzIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19hKQogICAgICAgICAgICAvLyBTZXQgc19hID0gMTEKICAgICAgICAgICAgdiA6PSBvcih2LCAxMSkKCiAgICAgICAgICAgIC8vIFNldCBzX2IgPSAyMgogICAgICAgICAgICAvLyBtYXNrID0gMTExLi4uMTExIHwgMDAwIC4uLiAwMDAgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19iIDo9IG5vdChzaGwoMTI4LCBzdWIoc2hsKDY0LCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2IgYnkgc2V0dGluZyBiaXRzICgxMjggdG8gMTkxIGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19iKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobCgxMjgsIDIyKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2MgPSAzMwogICAgICAgICAgICAvLyBtYXNrID0gMTExLi4uMTExIHwgMDAwLi4uMDAwIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19jIDo9IG5vdChzaGwoMTkyLCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2MgYnkgc2V0dGluZyBiaXRzICgxOTIgdG8gMjIzIGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19jKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobCgxOTIsIDMzKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2QgPSA0NAogICAgICAgICAgICAvLyBtYXNrID0gMDAwLi4uMDAwIHwgMTExLi4uMTExIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19kIDo9IG5vdChzaGwoMjI0LCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2QgYnkgc2V0dGluZyBiaXRzICgyMjQgdG8gMjU1IGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19kKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobCgyMjQsIDQ0KSkKCiAgICAgICAgICAgIC8vIFN0b3JlIG5ldyB2YWx1ZSB0byBzbG90MAogICAgICAgICAgICBzc3RvcmUoMCwgdikKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9zbG90XzBfb2Zmc2V0KCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoCiAgICAgICAgICAgIHVpbnQyNTYgYV9vZmZzZXQsCiAgICAgICAgICAgIHVpbnQyNTYgYl9vZmZzZXQsCiAgICAgICAgICAgIHVpbnQyNTYgY19vZmZzZXQsCiAgICAgICAgICAgIHVpbnQyNTYgZF9vZmZzZXQKICAgICAgICApCiAgICB7CiAgICAgICAgLy8gYV9vZmZzZXQgPSAgMCA9ICAwICogOCA9ICAgMCBiaXRzCiAgICAgICAgLy8gYl9vZmZzZXQgPSAxNiA9IDE2ICogOCA9IDEyOCBiaXRzCiAgICAgICAgLy8gY19vZmZzZXQgPSAyNCA9IDI0ICogOCA9IDE5MiBiaXRzCiAgICAgICAgLy8gZF9vZmZzZXQgPSAyOCA9IDI4ICogOCA9IDIyNCBiaXRzCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBhX29mZnNldCA6PSBzX2Eub2Zmc2V0CiAgICAgICAgICAgIGJfb2Zmc2V0IDo9IHNfYi5vZmZzZXQKICAgICAgICAgICAgY19vZmZzZXQgOj0gc19jLm9mZnNldAogICAgICAgICAgICBkX29mZnNldCA6PSBzX2Qub2Zmc2V0CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfc2xvdF8xX29mZnNldCgpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYWRkcl9vZmZzZXQsIHVpbnQyNTYgeF9vZmZzZXQsIHVpbnQyNTYgeV9vZmZzZXQpCiAgICB7CiAgICAgICAgLy8gYWRkcl9vZmZzZXQgPSAwCiAgICAgICAgLy8geF9vZmZzZXQgPSAyMAogICAgICAgIC8vIHlfb2Zmc2V0ID0gMjgKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGFkZHJfb2Zmc2V0IDo9IHNfYWRkci5vZmZzZXQKICAgICAgICAgICAgeF9vZmZzZXQgOj0gc194Lm9mZnNldAogICAgICAgICAgICB5X29mZnNldCA6PSBzX3kub2Zmc2V0CiAgICAgICAgfQogICAgfQoKICAgIC8vIHNsb3QgYW5kIG9mZnNldAogICAgZnVuY3Rpb24gdGVzdF9zc3RvcmVfdXNpbmdfb2Zmc2V0KCkgcHVibGljIHsKICAgICAgICAvLyBhX29mZnNldCA9ICAwID0gIDAgKiA4ID0gICAwIGJpdHMKICAgICAgICAvLyBiX29mZnNldCA9IDE2ID0gMTYgKiA4ID0gMTI4IGJpdHMKICAgICAgICAvLyBjX29mZnNldCA9IDI0ID0gMjQgKiA4ID0gMTkyIGJpdHMKICAgICAgICAvLyBkX29mZnNldCA9IDI4ID0gMjggKiA4ID0gMjI0IGJpdHMKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIExvYWQgMzIgYnl0ZXMgZnJvbSBzbG90MAogICAgICAgICAgICBsZXQgdiA6PSBzbG9hZChzX2Euc2xvdCkKCiAgICAgICAgICAgIC8vIHNfZCB8IHNfYyB8IHNfYiB8IHNfYQogICAgICAgICAgICAvLyAzMiAgfCAzMiAgfCA2NCAgfCAxMjggYml0cwoKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDExMQogICAgICAgICAgICAvLyBtYXNrID0gYWxsIDFzIGF0IGFuZCB0byB0aGUgbGVmdCBvZiAxMjggYml0IGNvdW50aW5nIGZyb20gcmlnaHQKICAgICAgICAgICAgLy8gICAgICAgIDExMSAuLi4gMTExIHwgMDAwIC4uLiAwMDAKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgIHwgICAgMTI4IGJpdHMKICAgICAgICAgICAgbGV0IG1hc2tfYSA6PSBub3Qoc3ViKHNobCgxMjgsIDEpLCAxKSkKICAgICAgICAgICAgLy8gU2V0IGxlZnQgbW9zdCAxMjggYml0cyB0byAwCiAgICAgICAgICAgIHYgOj0gYW5kKHYsIG1hc2tfYSkKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDEKICAgICAgICAgICAgdiA6PSBvcih2LCAxMTEpCgogICAgICAgICAgICAvLyBTZXQgc19iID0gMjIyCiAgICAgICAgICAgIC8vIG1hc2sgPSAxMTEuLi4xMTEgfCAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExCiAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgfCAgICAgNjQgYml0cyB8ICAgIDEyOCBiaXRzCiAgICAgICAgICAgIGxldCBtYXNrX2IgOj0gbm90KHNobChtdWwoc19iLm9mZnNldCwgOCksIHN1YihzaGwoNjQsIDEpLCAxKSkpCiAgICAgICAgICAgIC8vIENsZWFyIHByZXZpb3VzIHZhbHVlIG9mIHNfYiBieSBzZXR0aW5nIGJpdHMgKDEyOCB0byAxOTEgYml0cykgdG8gMAogICAgICAgICAgICB2IDo9IGFuZCh2LCBtYXNrX2IpCiAgICAgICAgICAgIHYgOj0gb3Iodiwgc2hsKG11bChzX2Iub2Zmc2V0LCA4KSwgMjIyKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2MgPSAzMzMKICAgICAgICAgICAgLy8gbWFzayA9IDExMS4uLjExMSB8IDAwMC4uLjAwMCB8IDExMSAuLi4gMTExIHwgMTExIC4uLiAxMTEKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICB8ICAgMzIgYml0cyB8ICAgICA2NCBiaXRzIHwgICAgMTI4IGJpdHMKICAgICAgICAgICAgbGV0IG1hc2tfYyA6PSBub3Qoc2hsKG11bChzX2Mub2Zmc2V0LCA4KSwgc3ViKHNobCgzMiwgMSksIDEpKSkKICAgICAgICAgICAgLy8gQ2xlYXIgcHJldmlvdXMgdmFsdWUgb2Ygc19jIGJ5IHNldHRpbmcgYml0cyAoMTkyIHRvIDIyMyBiaXRzKSB0byAwCiAgICAgICAgICAgIHYgOj0gYW5kKHYsIG1hc2tfYykKICAgICAgICAgICAgdiA6PSBvcih2LCBzaGwobXVsKHNfYy5vZmZzZXQsIDgpLCAzMzMpKQoKICAgICAgICAgICAgLy8gU2V0IHNfZCA9IDQ0NAogICAgICAgICAgICAvLyBtYXNrID0gMDAwLi4uMDAwIHwgMTExLi4uMTExIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19kIDo9IG5vdChzaGwobXVsKHNfZC5vZmZzZXQsIDgpLCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2QgYnkgc2V0dGluZyBiaXRzICgyMjQgdG8gMjU1IGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19kKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobChtdWwoc19kLm9mZnNldCwgOCksIDQ0NCkpCgogICAgICAgICAgICAvLyBTdG9yZSBuZXcgdmFsdWUgdG8gc2xvdDAKICAgICAgICAgICAgc3N0b3JlKHNfYS5zbG90LCB2KQogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgRVZNU3RvcmFnZVN0cnVjdCB7CiAgICBzdHJ1Y3QgU2luZ2xlU2xvdCB7CiAgICAgICAgdWludDEyOCB4OwogICAgICAgIHVpbnQ2NCB5OwogICAgICAgIHVpbnQ2NCB6OwogICAgfQoKICAgIHN0cnVjdCBNdWx0aXBsZVNsb3RzIHsKICAgICAgICB1aW50MjU2IGE7CiAgICAgICAgdWludDI1NiBiOwogICAgICAgIHVpbnQyNTYgYzsKICAgIH0KCiAgICAvLyBzbG90IDAKICAgIFNpbmdsZVNsb3QgcHVibGljIHNpbmdsZSA9IFNpbmdsZVNsb3Qoe3g6IDEsIHk6IDIsIHo6IDN9KTsKICAgIC8vIHNsb3QgMSwgMiwgMwogICAgTXVsdGlwbGVTbG90cyBwdWJsaWMgbXVsdGkgPSBNdWx0aXBsZVNsb3RzKHthOiAxMSwgYjogMjIsIGM6IDMzfSk7CgogICAgZnVuY3Rpb24gdGVzdF9nZXRfc2luZ2xlX3Nsb3Rfc3RydWN0KCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDEyOCB4LCB1aW50NjQgeSwgdWludDY0IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgcyA6PSBzbG9hZCgwKQogICAgICAgICAgICAvLyAgeiB8ICB5IHwgeAogICAgICAgICAgICAvLyA2NCB8IDY0IHwgMTI4IGJpdHMKICAgICAgICAgICAgLy8gQ2FzdGluZyBjdXRzIG9mZiBiaXRzIHRvIHRoZSBsZWZ0CiAgICAgICAgICAgIHggOj0gcwogICAgICAgICAgICB5IDo9IHNocigxMjgsIHMpCiAgICAgICAgICAgIHogOj0gc2hyKDE5MiwgcykKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9nZXRfbXVsdGlwbGVfc2xvdHNfc3RydWN0KCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiBhLCB1aW50MjU2IGIsIHVpbnQyNTYgYykKICAgIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGEgOj0gc2xvYWQoMSkKICAgICAgICAgICAgYiA6PSBzbG9hZCgyKQogICAgICAgICAgICBjIDo9IHNsb2FkKDMp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1XSBwcml2YXRlIGFycl8yID0gWzcsIDgsIDksIDEwLCAxMV07CgogICAgZnVuY3Rpb24gdGVzdF9hcnJfMCh1aW50MjU2IGkpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQyNTYgdikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gYXJyXzAgc3RhcnRzIGZyb20gc2xvdCAwCiAgICAgICAgICAgIHYgOj0gc2xvYWQoYWRkKDAsIGkpKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X2Fycl8xKHVpbnQyNTYgaSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NiB2KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBhcnJfMSBzdGFydHMgZnJvbSBzbG90IDMKICAgICAgICAgICAgdiA6PSBzbG9hZChhZGQoMywgaSkpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfYXJyXzIodWludDI1NiBpKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MTI4IHYpIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIGFycl8yIHN0YXJ0cyBmcm9tIHNsb3QgNgogICAgICAgICAgICBsZXQgYjMyIDo9IHNsb2FkKGFkZCg2LCBkaXYoaSwgMikpKQogICAgICAgICAgICAvLyBzbG90IDYgPSAxc3QgZWxlbWVudCB8IDB0aCBlbGVtZW50CiAgICAgICAgICAgIC8vIHNsb3QgNyA9IDNyZCBlbGVtZW50IHwgMm5kIGVsZW1lbnQKICAgICAgICAgICAgLy8gc2xvdCA4ID0gMDAwIC4uLiAwMDAgfCA0dGggZWxlbWVudAoKICAgICAgICAgICAgLy8gaSBpcyBldmVuID0+IGdldCByaWdodCAxMjggYml0cyA9PiBjYXN0IGJ5dGVzMzIgdG8gdWludDEyOCAoY3V0IG9mZiBsZWZ0IDEyOCBiaXRzKQogICAgICAgICAgICAvLyBpIGlzIG9kZCAgPT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WMgbWFwOwoKICAgIGFkZHJlc3MgcHVibGljIGNvbnN0YW50IEFERFJfMSA9IGFkZHJlc3MoMSk7CiAgICBhZGRyZXNzIHB1YmxpYyBjb25zdGFudCBBRERSXzIgPSBhZGRyZXNzKDIpOwoKICAgIGNvbnN0cnVjdG9yKCkgewogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMTEpOwogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMjIpOwogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMzMpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNDQpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNTUpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNjYpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfbWFwX2FycihhZGRyZXNzIGFkZHIsIHVpbnQyNTYgaSkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB2LCB1aW50MjU2IGxlbikKICAgIHsKICAgICAgICB1aW50MjU2IG1hcF9zbG90ID0gMDsKICAgICAgICBieXRlczMyIG1hcF9oYXNoID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoYWRkciwgbWFwX3Nsb3QpKTsKICAgICAgICBieXRlczMyIGFycl9oYXNoID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUobWFwX2hhc2gpKTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZW4gOj0gc2xvYWQobWFwX2hhc2gpCiAgICAgICAgICAgIHYgOj0gc2xvYWQoYWRkKGFycl9oYXNoLCBpKSkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IEVWTVN0b3JhZ2VEeW5hbWljQXJyYXlTdHJ1Y3QgewogICAgc3RydWN0IFBvaW50IHsKICAgICAgICB1aW50MjU2IHg7CiAgICAgICAgdWludDEyOCB5OwogICAgICAgIHVpbnQxMjggejsKICAgIH0KCiAgICAvLyBzbG90IG9mIGVsZW1lbnQgPSBrZWNjYWsyNTYoc2xvdCB3aGVyZSB0aGlzIGFycmF5IGlzIGRlY2xhcmVkKSArIGluZGV4IG9mIGVsZW1lbnQKICAgIC8vIGtlY2NhazI1NigwKSArIGluZGV4ICogc2l6ZSBvZiBzdHJ1Y3QKICAgIFBvaW50W10gcHJpdmF0ZSBhcnI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgYXJyLnB1c2goUG9pbnQoMTEsIDIyLCAzMykpOwogICAgICAgIGFyci5wdXNoKFBvaW50KDQ0LCA1NSwgNjYpKTsKICAgICAgICBhcnIucHVzaChQb2ludCg3NywgODgsIDk5KSk7CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9zdHJ1Y3RfYXJyKHVpbnQyNTYgaSkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB4LCB1aW50MTI4IHksIHVpbnQxMjggeiwgdWludDI1NiBsZW4pCiAgICB7CiAgICAgICAgdWludDI1NiBzbG90ID0gMDsKICAgICAgICBieXRlczMyIHN0YXJ0ID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoc2xvdCkpOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxlbiA6PSBzbG9hZChzbG90KQogICAgICAgICAgICAvLyBzMCA9IGtlY2NhazI1NigwKQogICAgICAgICAgICAvLyBpbmRleCB8IHNsb3QgICAgICAgIHwgdmFsdWVzCiAgICAgICAgICAgIC8vICAgICAwIHwgc2xvdCBzMCArIDAgfCBhcnJbMF0ueAogICAgICAgICAgICAvLyAgICAgMCB8IHNsb3QgczAgKyAxIHwgYXJyWzBdLnogfCBhcnJbMF0ueQogICAgICAgICAgICAvLyAgICAgMSB8IHNsb3QgczAgKyAyIHwgYXJyWzFdLngKICAgICAgICAgICAgLy8gICAgIDEgfCBzbG90IHMwICsgMyB8IGFyclsxXS56IHwgYXJyWzFdLnkKICAgICAgICAgICAgLy8gICAgIDIgfCBzbG90IHMwICsgNCB8IGFyclsyXS54CiAgICAgICAgICAgIC8vICAgICAyIHwgc2xvdCBzMCArIDUgfCBhcnJbMl0ueiB8IGFyclsyXS55CiAgICAgICAgICAgIHggOj0gc2xvYWQoYWRkKHN0YXJ0LCBtdWwoaSwgMikpKQogICAgICAgICAgICBsZXQgenkgOj0gc2xvYWQoYWRkKHN0YXJ0LCBhZGQobXVsKGksIDIpLCAxKSkpCiAgICAgICAgICAgIC8vIHVpbnQxMjggY3V0cyBvZmYgbGVmdCBtb3N0IDEyOCBiaXRzIGZyb20gMzIgYnl0ZXMKICAgICAgICAgICAgeSA6PSB6eQogICAgICAgICAgICB6IDo9IHNocigxMjgsIHp5KQogICAgICAgIH0KICAgIH0KfQo="}],Kk=`

        Examples of

        • Reading and writing to storage with assembly
        • Storage layout of different data types
        • @@ -9133,7 +9185,7 @@ assertion probably means that there is a bug. } } } -`,G0=({prev:s,next:a})=>i.jsx(A,{version:m0,title:b0,description:w0,cyfrinLink:k0,html:W0,prev:s,next:a,codes:Z0}),B0="0.8.26",f0="Gas Saving Techniques",V0="Some gas saving techniques",Y0="https://www.cyfrin.io/glossary/gas-saving-techniques-code-example",X0=[{fileName:"GasGolf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIGdhcyBnb2xmCmNvbnRyYWN0IEdhc0dvbGYgewogICAgLy8gc3RhcnQgLSA1MDkwOCBnYXMKICAgIC8vIHVzZSBjYWxsZGF0YSAtIDQ5MTYzIGdhcwogICAgLy8gbG9hZCBzdGF0ZSB2YXJpYWJsZXMgdG8gbWVtb3J5IC0gNDg5NTIgZ2FzCiAgICAvLyBzaG9ydCBjaXJjdWl0IC0gNDg2MzQgZ2FzCiAgICAvLyBsb29wIGluY3JlbWVudHMgLSA0ODI0NCBnYXMKICAgIC8vIGNhY2hlIGFycmF5IGxlbmd0aCAtIDQ4MjA5IGdhcwogICAgLy8gbG9hZCBhcnJheSBlbGVtZW50cyB0byBtZW1vcnkgLSA0ODA0NyBnYXMKICAgIC8vIHVuY2hlY2sgaSBvdmVyZmxvdy91bmRlcmZsb3cgLSA0NzMwOSBnYXMKCiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbDsKCiAgICAvLyBzdGFydCAtIG5vdCBnYXMgb3B0aW1pemVkCiAgICAvLyBmdW5jdGlvbiBzdW1JZkV2ZW5BbmRMZXNzVGhhbjk5KHVpbnRbXSBtZW1vcnkgbnVtcykgZXh0ZXJuYWwgewogICAgLy8gICAgIGZvciAodWludCBpID0gMDsgaSA8IG51bXMubGVuZ3RoOyBpICs9IDEpIHsKICAgIC8vICAgICAgICAgYm9vbCBpc0V2ZW4gPSBudW1zW2ldICUgMiA9PSAwOwogICAgLy8gICAgICAgICBib29sIGlzTGVzc1RoYW45OSA9IG51bXNbaV0gPCA5OTsKICAgIC8vICAgICAgICAgaWYgKGlzRXZlbiAmJiBpc0xlc3NUaGFuOTkpIHsKICAgIC8vICAgICAgICAgICAgIHRvdGFsICs9IG51bXNbaV07CiAgICAvLyAgICAgICAgIH0KICAgIC8vICAgICB9CiAgICAvLyB9CgogICAgLy8gZ2FzIG9wdGltaXplZAogICAgLy8gWzEsIDIsIDMsIDQsIDUsIDEwMF0KICAgIGZ1bmN0aW9uIHN1bUlmRXZlbkFuZExlc3NUaGFuOTkodWludDI1NltdIGNhbGxkYXRhIG51bXMpIGV4dGVybmFsIHsKICAgICAgICB1aW50MjU2IF90b3RhbCA9IHRvdGFsOwogICAgICAgIHVpbnQyNTYgbGVuID0gbnVtcy5sZW5ndGg7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IGxlbjspIHsKICAgICAgICAgICAgdWludDI1NiBudW0gPSBudW1zW2ldOwogICAgICAgICAgICBpZiAobnVtICUgMiA9PSAwICYmIG51bSA8IDk5KSB7CiAgICAgICAgICAgICAgICBfdG90YWwgKz0gbnVtOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgICAgICArK2k7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHRvdGFsID0gX3RvdGFsOwogICAgfQp9Cg=="}],v0=`

          Some gas saving techniques.

          +`,B0=({prev:s,next:a})=>i.jsx(A,{version:m0,title:b0,description:w0,cyfrinLink:k0,html:W0,prev:s,next:a,codes:Z0}),G0="0.8.26",f0="Gas Saving Techniques",V0="Some gas saving techniques",Y0="https://www.cyfrin.io/glossary/gas-saving-techniques-code-example",X0=[{fileName:"GasGolf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIGdhcyBnb2xmCmNvbnRyYWN0IEdhc0dvbGYgewogICAgLy8gc3RhcnQgLSA1MDkwOCBnYXMKICAgIC8vIHVzZSBjYWxsZGF0YSAtIDQ5MTYzIGdhcwogICAgLy8gbG9hZCBzdGF0ZSB2YXJpYWJsZXMgdG8gbWVtb3J5IC0gNDg5NTIgZ2FzCiAgICAvLyBzaG9ydCBjaXJjdWl0IC0gNDg2MzQgZ2FzCiAgICAvLyBsb29wIGluY3JlbWVudHMgLSA0ODI0NCBnYXMKICAgIC8vIGNhY2hlIGFycmF5IGxlbmd0aCAtIDQ4MjA5IGdhcwogICAgLy8gbG9hZCBhcnJheSBlbGVtZW50cyB0byBtZW1vcnkgLSA0ODA0NyBnYXMKICAgIC8vIHVuY2hlY2sgaSBvdmVyZmxvdy91bmRlcmZsb3cgLSA0NzMwOSBnYXMKCiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbDsKCiAgICAvLyBzdGFydCAtIG5vdCBnYXMgb3B0aW1pemVkCiAgICAvLyBmdW5jdGlvbiBzdW1JZkV2ZW5BbmRMZXNzVGhhbjk5KHVpbnRbXSBtZW1vcnkgbnVtcykgZXh0ZXJuYWwgewogICAgLy8gICAgIGZvciAodWludCBpID0gMDsgaSA8IG51bXMubGVuZ3RoOyBpICs9IDEpIHsKICAgIC8vICAgICAgICAgYm9vbCBpc0V2ZW4gPSBudW1zW2ldICUgMiA9PSAwOwogICAgLy8gICAgICAgICBib29sIGlzTGVzc1RoYW45OSA9IG51bXNbaV0gPCA5OTsKICAgIC8vICAgICAgICAgaWYgKGlzRXZlbiAmJiBpc0xlc3NUaGFuOTkpIHsKICAgIC8vICAgICAgICAgICAgIHRvdGFsICs9IG51bXNbaV07CiAgICAvLyAgICAgICAgIH0KICAgIC8vICAgICB9CiAgICAvLyB9CgogICAgLy8gZ2FzIG9wdGltaXplZAogICAgLy8gWzEsIDIsIDMsIDQsIDUsIDEwMF0KICAgIGZ1bmN0aW9uIHN1bUlmRXZlbkFuZExlc3NUaGFuOTkodWludDI1NltdIGNhbGxkYXRhIG51bXMpIGV4dGVybmFsIHsKICAgICAgICB1aW50MjU2IF90b3RhbCA9IHRvdGFsOwogICAgICAgIHVpbnQyNTYgbGVuID0gbnVtcy5sZW5ndGg7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IGxlbjspIHsKICAgICAgICAgICAgdWludDI1NiBudW0gPSBudW1zW2ldOwogICAgICAgICAgICBpZiAobnVtICUgMiA9PSAwICYmIG51bSA8IDk5KSB7CiAgICAgICAgICAgICAgICBfdG90YWwgKz0gbnVtOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgICAgICArK2k7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHRvdGFsID0gX3RvdGFsOwogICAgfQp9Cg=="}],v0=`

          Some gas saving techniques.

          • Replacing memory with calldata
          • Loading state variable to memory
          • @@ -9187,7 +9239,7 @@ assertion probably means that there is a bug. total = _total; } } -`,R0=({prev:s,next:a})=>i.jsx(A,{version:B0,title:f0,description:V0,cyfrinLink:Y0,html:v0,prev:s,next:a,codes:X0}),N0="0.8.26",H0="Accessing Private Data",F0="An example of accessing private data from a Solidity smart contract",K0="",M0=[{fileName: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accessing Private Data",F0="An example of accessing private data from a Solidity smart contract",K0="",M0=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCk5vdGU6IGNhbm5vdCB1c2Ugd2ViMyBvbiBKVk0sIHNvIHVzZSB0aGUgY29udHJhY3QgZGVwbG95ZWQgb24gR29lcmxpCk5vdGU6IGJyb3dzZXIgV2ViMyBpcyBvbGQgc28gdXNlIFdlYjMgZnJvbSB0cnVmZmxlIGNvbnNvbGUKCkNvbnRyYWN0IGRlcGxveWVkIG9uIEdvZXJsaQoweDUzNEU0Q2UwZmZGNzc5NTEzNzkzY2ZkNzAzMDhBRjE5NTgyN0JEMzEKKi8KCi8qCiMgU3RvcmFnZQotIDIgKiogMjU2IHNsb3RzCi0gMzIgYnl0ZXMgZm9yIGVhY2ggc2xvdAotIGRhdGEgaXMgc3RvcmVkIHNlcXVlbnRpYWxseSBpbiB0aGUgb3JkZXIgb2YgZGVjbGFyYXRpb24KLSBzdG9yYWdlIGlzIG9wdGltaXplZCB0byBzYXZlIHNwYWNlLiBJZiBuZWlnaGJvcmluZyB2YXJpYWJsZXMgZml0IGluIGEgc2luZ2xlCiAgMzIgYnl0ZXMsIHRoZW4gdGhleSBhcmUgcGFja2VkIGludG8gdGhlIHNhbWUgc2xvdCwgc3RhcnRpbmcgZnJvbSB0aGUgcmlnaHQKKi8KCmNvbnRyYWN0IFZhdWx0IHsKICAgIC8vIHNsb3QgMAogICAgdWludDI1NiBwdWJsaWMgY291bnQgPSAxMjM7CiAgICAvLyBzbG90IDEKICAgIGFkZHJlc3MgcHVibGljIG93bmVyID0gbXNnLnNlbmRlcjsKICAgIGJvb2wgcHVibGljIGlzVHJ1ZSA9IHRydWU7CiAgICB1aW50MTYgcHVibGljIHUxNiA9IDMxOwogICAgLy8gc2xvdCAyCiAgICBieXRlczMyIHByaXZhdGUgcGFzc3dvcmQ7CgogICAgL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9nKQp3ZWIzLmV0aC5nZXRTdG9yYWdlQXQoIjB4NTM0RTRDZTBmZkY3Nzk1MTM3OTNjZmQ3MDMwOEFGMTk1ODI3QkQzMSIsICIweGY2NTIyMjIzMTNlMjg0NTk1MjhkOTIwYjY1MTE1YzE2YzA0ZjNlZmM4MmFhZWRjOTdiZTU5ZjNmMzc3YzBkNDIiLCBjb25zb2xlLmxvZykKCnNsb3QgNyAtIGVtcHR5CmdldE1hcExvY2F0aW9uKDcsIDEpCndlYjMudXRpbHMubnVtYmVyVG9IZXgoIjgxMjIyMTkxOTg2MjI2ODA5MTAzMjc5MTE5OTk0NzA3ODY4MzIyODU1NzQxODE5OTA1OTA0NDE3OTUzMDkyNjY2Njk5MDk2OTYzMTEyIikKTm90ZTogV2UgY2FuIGFsc28gdXNlIHdlYjMgdG8gZ2V0IGRhdGEgbG9jYXRpb24Kd2ViMy51dGlscy5zb2xpZGl0eVNoYTMoeyB0eXBlOiAidWludCIsIHZhbHVlOiAxIH0sIHt0eXBlOiAidWludCIsIHZhbHVlOiA3fSkKdXNlciAxCndlYjMuZXRoLmdldFN0b3JhZ2VBdCgiMHg1MzRFNENlMGZmRjc3OTUxMzc5M2NmZDcwMzA4QUYxOTU4MjdCRDMxIiwgIjB4YjM5MjIxYWNlMDUzNDY1ZWMzNDUzY2UyYjM2NDMwYmQxMzhiOTk3ZWNlYTI1YzEwNDNkYTBjMzY2ODEyYjgyOCIsIGNvbnNvbGUubG9nKQp3ZWIzLmV0aC5nZXRTdG9yYWdlQXQoIjB4NTM0RTRDZTBmZkY3Nzk1MTM3OTNjZmQ3MDMwOEFGMTk1ODI3QkQzMSIsICIweGIzOTIyMWFjZTA1MzQ2NWVjMzQ1M2NlMmIzNjQzMGJkMTM4Yjk5N2VjZWEyNWMxMDQzZGEwYzM2NjgxMmI4MjkiLCBjb25zb2xlLmxvZykKKi8K"}],S0=`

            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
            @@ -9750,7 +9802,7 @@ DeployerDeployer -- create2 --> Deployer -- create --> Attack
                     selfdestruct(payable(address(0)));
                 }
             }
            -
            `,bZ=({prev:s,next:a})=>i.jsx(A,{version:CZ,title:jZ,description:AZ,cyfrinLink:uZ,html:mZ,prev:s,next:a,codes:yZ}),wZ="0.8.26",kZ="Front Running",ZZ="An example of a Solidity contract vulnerable to front running",WZ="",GZ=[{fileName:"FrontRunning.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCkFsaWNlIGNyZWF0ZXMgYSBndWVzc2luZyBnYW1lLgpZb3Ugd2luIDEwIGV0aGVyIGlmIHlvdSBjYW4gZmluZCB0aGUgY29ycmVjdCBzdHJpbmcgdGhhdCBoYXNoZXMgdG8gdGhlIHRhcmdldApoYXNoLiBMZXQncyBzZWUgaG93IHRoaXMgY29udHJhY3QgaXMgdnVsbmVyYWJsZSB0byBmcm9udCBydW5uaW5nLgoqLwoKLyoKMS4gQWxpY2UgZGVwbG95cyBGaW5kVGhpc0hhc2ggd2l0aCAxMCBFdGhlci4KMi4gQm9iIGZpbmRzIHRoZSBjb3JyZWN0IHN0cmluZyB0aGF0IHdpbGwgaGFzaCB0byB0aGUgdGFyZ2V0IGhhc2guICgiRXRoZXJldW0iKQozLiBCb2IgY2FsbHMgc29sdmUoIkV0aGVyZXVtIikgd2l0aCBnYXMgcHJpY2Ugc2V0IHRvIDE1IGd3ZWkuCjQuIEV2ZSBpcyB3YXRjaGluZyB0aGUgdHJhbnNhY3Rpb24gcG9vbCBmb3IgdGhlIGFuc3dlciB0byBiZSBzdWJtaXR0ZWQuCjUuIEV2ZSBzZWVzIEJvYidzIGFuc3dlciBhbmQgY2FsbHMgc29sdmUoIkV0aGVyZXVtIikgd2l0aCBhIGhpZ2hlciBnYXMgcHJpY2UKICAgdGhhbiBCb2IgKDEwMCBnd2VpKS4KNi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1pdHRlZCB5ZXQiKTsKICAgICAgICByZXF1aXJlKGNvbW1pdC5jb21taXRUaW1lIDwgYmxvY2sudGltZXN0YW1wLCAiQ2Fubm90IHJldmVhbCBpbiB0aGUgc2FtZSBibG9jayIpOwogICAgICAgIHJlcXVpcmUoIWNvbW1pdC5yZXZlYWxlZCwgIkFscmVhZHkgY29tbWl0ZWQgYW5kIHJldmVhbGVkIik7CgogICAgICAgIGJ5dGVzMzIgc29sdXRpb25IYXNoID0ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQobXNnLnNlbmRlciwgX3NvbHV0aW9uLCBfc2VjcmV0KSk7CiAgICAgICAgcmVxdWlyZShzb2x1dGlvbkhhc2ggPT0gY29tbWl0LnNvbHV0aW9uSGFzaCwgIkhhc2ggZG9lc24ndCBtYXRjaCIpOwoKICAgICAgICByZXF1aXJlKGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKF9zb2x1dGlvbikpID09IGhhc2gsICJJbmNvcnJlY3QgYW5zd2VyIik7CgogICAgICAgIHdpbm5lciA9IG1zZy5zZW5kZXI7CiAgICAgICAgZW5kZWQgPSB0cnVlOwoKICAgICAgICAoYm9vbCBzZW50LCkgPSBwYXlhYmxlKG1zZy5zZW5kZXIpLmNhbGx7dmFsdWU6IHJld2FyZH0oIiIpOwogICAgICAgIGlmICghc2VudCkgewogICAgICAgICAgICB3aW5uZXIgPSBhZGRyZXNzKDApOwogICAgICAgICAgICBlbmRlZCA9IGZhbHNlOwogICAgICAgICAgICByZXZlcnQoIkZhaWxlZCB0byBzZW5kIGV0aGVyLiIpOwogICAgICAgIH0KICAgIH0KfQo="}],BZ=`

            Vulnerability

            +`,bZ=({prev:s,next:a})=>i.jsx(A,{version:CZ,title:jZ,description:AZ,cyfrinLink:uZ,html:mZ,prev:s,next:a,codes:yZ}),wZ="0.8.26",kZ="Front Running",ZZ="An example of a Solidity contract vulnerable to front running",WZ="",BZ=[{fileName:"FrontRunning.sol",code:"Ly8gU1BEWC1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YW1lIGJsb2NrIgogICAgICAgICk7CiAgICAgICAgcmVxdWlyZSghY29tbWl0LnJldmVhbGVkLCAiQWxyZWFkeSBjb21taXRlZCBhbmQgcmV2ZWFsZWQiKTsKCiAgICAgICAgYnl0ZXMzMiBzb2x1dGlvbkhhc2ggPQogICAgICAgICAgICBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChtc2cuc2VuZGVyLCBfc29sdXRpb24sIF9zZWNyZXQpKTsKICAgICAgICByZXF1aXJlKHNvbHV0aW9uSGFzaCA9PSBjb21taXQuc29sdXRpb25IYXNoLCAiSGFzaCBkb2Vzbid0IG1hdGNoIik7CgogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKF9zb2x1dGlvbikpID09IGhhc2gsICJJbmNvcnJlY3QgYW5zd2VyIgogICAgICAgICk7CgogICAgICAgIHdpbm5lciA9IG1zZy5zZW5kZXI7CiAgICAgICAgZW5kZWQgPSB0cnVlOwoKICAgICAgICAoYm9vbCBzZW50LCkgPSBwYXlhYmxlKG1zZy5zZW5kZXIpLmNhbGx7dmFsdWU6IHJld2FyZH0oIiIpOwogICAgICAgIGlmICghc2VudCkgewogICAgICAgICAgICB3aW5uZXIgPSBhZGRyZXNzKDApOwogICAgICAgICAgICBlbmRlZCA9IGZhbHNlOwogICAgICAgICAgICByZXZlcnQoIkZhaWxlZCB0byBzZW5kIGV0aGVyLiIpOwogICAgICAgIH0KICAgIH0KfQo="}],GZ=`

            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.

            @@ -9783,12 +9835,15 @@ before the original. */ contract FindThisHash { - bytes32 public constant hash = 0x564ccaf7594d66b1eaaea24fe01f0585bf52ee70852af4eac0cc4b04711cd0e2; + bytes32 public constant hash = + 0x564ccaf7594d66b1eaaea24fe01f0585bf52ee70852af4eac0cc4b04711cd0e2; constructor() payable {} function solve(string memory solution) public { - require(hash == keccak256(abi.encodePacked(solution)), "Incorrect answer"); + require( + hash == keccak256(abi.encodePacked(solution)), "Incorrect answer" + ); (bool sent,) = msg.sender.call{value: 10 ether}(""); require(sent, "Failed to send Ether"); @@ -9841,7 +9896,8 @@ before the original. } // The hash that is needed to be solved - bytes32 public hash = 0x564ccaf7594d66b1eaaea24fe01f0585bf52ee70852af4eac0cc4b04711cd0e2; + bytes32 public hash = + 0x564ccaf7594d66b1eaaea24fe01f0585bf52ee70852af4eac0cc4b04711cd0e2; // Address of the winner address public winner; @@ -9881,7 +9937,12 @@ before the original. Function to get the commit details. It returns a tuple of (solutionHash, commitTime, revealStatus); Users can get solution only if the game is active and they have committed a solutionHash */ - function getMySolution() public view gameActive returns (bytes32, uint256, bool) { + function getMySolution() + public + view + gameActive + returns (bytes32, uint256, bool) + { Commit storage commit = commits[msg.sender]; require(commit.commitTime != 0, "Not committed yet"); return (commit.solutionHash, commit.commitTime, commit.revealed); @@ -9895,16 +9956,25 @@ before the original. the game is ended and the reward amount is sent to the winner. */ - function revealSolution(string memory _solution, string memory _secret) public gameActive { + function revealSolution(string memory _solution, string memory _secret) + public + gameActive + { Commit storage commit = commits[msg.sender]; require(commit.commitTime != 0, "Not committed yet"); - require(commit.commitTime < block.timestamp, "Cannot reveal in the same block"); + require( + commit.commitTime < block.timestamp, + "Cannot reveal in the same block" + ); require(!commit.revealed, "Already commited and revealed"); - bytes32 solutionHash = keccak256(abi.encodePacked(msg.sender, _solution, _secret)); + bytes32 solutionHash = + keccak256(abi.encodePacked(msg.sender, _solution, _secret)); require(solutionHash == commit.solutionHash, "Hash doesn't match"); - require(keccak256(abi.encodePacked(_solution)) == hash, "Incorrect answer"); + require( + keccak256(abi.encodePacked(_solution)) == hash, "Incorrect answer" + ); winner = msg.sender; ended = true; @@ -9917,7 +9987,7 @@ before the original. } } } -`,fZ=({prev:s,next:a})=>i.jsx(A,{version:wZ,title:kZ,description:ZZ,cyfrinLink:WZ,html:BZ,prev:s,next:a,codes:GZ}),VZ="0.8.26",YZ="Hiding Malicious Code with External Contract",XZ="An example of exploit where malicious code is hidden in an external contract in Solidity",vZ="",RZ=[{fileName:"ExternalContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCkxldCdzIHNheSBBbGljZSBjYW4gc2VlIHRoZSBjb2RlIG9mIEZvbyBhbmQgQmFyIGJ1dCBub3QgTWFsLgpJdCBpcyBvYnZpb3VzIHRvIEFsaWNlIHRoYXQgRm9vLmNhbGxCYXIoKSBleGVjdXRlcyB0aGUgY29kZSBpbnNpZGUgQmFyLmxvZygpLgpIb3dldmVyIEV2ZSBkZXBsb3lzIEZvbyB3aXRoIHRoZSBhZGRyZXNzIG9mIE1hbCwgc28gdGhhdCBjYWxsaW5nIEZvby5jYWxsQmFyKCkKd2lsbCBhY3R1YWxseSBleGVjdXRlIHRoZSBjb2RlIGF0IE1hbC4KKi8KCi8qCjEuIEV2ZSBkZXBsb3lzIE1hbAoyLiBFdmUgZGVwbG95cyBGb28gd2l0aCB0aGUgYWRkcmVzcyBvZiBNYWwKMy4gQWxpY2UgY2FsbHMgRm9vLmNhbGxCYXIoKSBhZnRlciByZWFkaW5nIHRoZSBjb2RlIGFuZCBqdWRnaW5nIHRoYXQgaXQgaXMKICAgc2FmZSB0byBjYWxsLgo0LiBBbHRob3VnaCBBbGljZSBleHBlY3RlZCBCYXIubG9nKCkgdG8gYmUgZXhlY3V0ZSwgTWFsLmxvZygpIHdhcyBleGVjdXRlZC4KKi8KCmNvbnRyYWN0IEZvbyB7CiAgICBCYXIgYmFyOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX2JhcikgewogICAgICAgIGJhciA9IEJhcihfYmFyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYWxsQmFyKCkgcHVibGljIHsKICAgICAgICBiYXIubG9nKCk7CiAgICB9Cn0KCmNvbnRyYWN0IEJhciB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwoKICAgIGZ1bmN0aW9uIGxvZygpIHB1YmxpYyB7CiAgICAgICAgZW1pdCBMb2coIkJhciB3YXMgY2FsbGVkIik7CiAgICB9Cn0KCi8vIFRoaXMgY29kZSBpcyBoaWRkZW4gaW4gYSBzZXBhcmF0ZSBmaWxlCmNvbnRyYWN0IE1hbCB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwoKICAgIC8vIGZ1bmN0aW9uICgpIGV4dGVybmFsIHsKICAgIC8vICAgICBlbWl0IExvZygiTWFsIHdhcyBjYWxsZWQiKTsKICAgIC8vIH0KCiAgICAvLyBBY3R1YWxseSB3ZSBjYW4gZXhlY3V0ZSB0aGUgc2FtZSBleHBsb2l0IGV2ZW4gaWYgdGhpcyBmdW5jdGlvbiBkb2VzCiAgICAvLyBub3QgZXhpc3QgYnkgdXNpbmcgdGhlIGZhbGxiYWNrCiAgICBmdW5jdGlvbiBsb2coKSBwdWJsaWMgewogICAgICAgIGVtaXQgTG9nKCJNYWwgd2FzIGNhbGxlZCIpOwogICAgfQp9Cg=="}],NZ=`

            Vulnerability

            +`,fZ=({prev:s,next:a})=>i.jsx(A,{version:wZ,title:kZ,description:ZZ,cyfrinLink:WZ,html:GZ,prev:s,next:a,codes:BZ}),VZ="0.8.26",YZ="Hiding Malicious Code with External Contract",XZ="An example of exploit where malicious code is hidden in an external contract in Solidity",vZ="",RZ=[{fileName:"ExternalContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCkxldCdzIHNheSBBbGljZSBjYW4gc2VlIHRoZSBjb2RlIG9mIEZvbyBhbmQgQmFyIGJ1dCBub3QgTWFsLgpJdCBpcyBvYnZpb3VzIHRvIEFsaWNlIHRoYXQgRm9vLmNhbGxCYXIoKSBleGVjdXRlcyB0aGUgY29kZ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TsKICAgIC8vIH0KCiAgICAvLyBBY3R1YWxseSB3ZSBjYW4gZXhlY3V0ZSB0aGUgc2FtZSBleHBsb2l0IGV2ZW4gaWYgdGhpcyBmdW5jdGlvbiBkb2VzCiAgICAvLyBub3QgZXhpc3QgYnkgdXNpbmcgdGhlIGZhbGxiYWNrCiAgICBmdW5jdGlvbiBsb2coKSBwdWJsaWMgewogICAgICAgIGVtaXQgTG9nKCJNYWwgd2FzIGNhbGxlZCIpOwogICAgfQp9Cg=="}],NZ=`

            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.

            @@ -10400,7 +10470,7 @@ Here is how the functions were called locked = false; } } -`,jW=({prev:s,next:a})=>i.jsx(A,{version:iW,title:gW,description:hW,cyfrinLink:IW,html:CW,prev:s,next:a,codes:dW}),AW="0.8.26",uW="Self Destruct",yW="An example of how to delete your smart contract by calling seldestruct in Solidity",mW="",bW=[{fileName:"ForceEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIFRoZSBnb2FsIG9mIHRoaXMgZ2FtZSBpcyB0byBiZSB0aGUgN3RoIHBsYXllciB0byBkZXBvc2l0IDEgRXRoZXIuCi8vIFBsYXllcnMgY2FuIGRlcG9zaXQgb25seSAxIEV0aGVyIGF0IGEgdGltZS4KLy8gV2lubmVyIHdpbGwgYmUgYWJsZSB0byB3aXRoZHJhdyBhbGwgRXRoZXIuCgovKgoxLiBEZXBsb3kgRXRoZXJHYW1lCjIuIFBsYXllcnMgKHNheSBBbGljZSBhbmQgQm9iKSBkZWNpZGVzIHRvIHBsYXksIGRlcG9zaXRzIDEgRXRoZXIgZWFjaC4KMi4gRGVwbG95IEF0dGFjayB3aXRoIGFkZHJlc3Mgb2YgRXRoZXJHYW1lCjMuIENhbGwgQXR0YWNrLmF0dGFjayBzZW5kaW5nIDUgZXRoZXIuIFR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ICAgICAgIHdpbm5lciA9IG1zZy5zZW5kZXI7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIGNsYWltUmV3YXJkKCkgcHVibGljIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gd2lubmVyLCAiTm90IHdpbm5lciIpOwoKICAgICAgICAoYm9vbCBzZW50LCkgPSBtc2cuc2VuZGVyLmNhbGx7dmFsdWU6IGJhbGFuY2V9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],wW=`

            Contracts can be deleted from the blockchain by calling selfdestruct.

            +`,jW=({prev:s,next:a})=>i.jsx(A,{version:iW,title:gW,description:hW,cyfrinLink:IW,html:CW,prev:s,next:a,codes:dW}),AW="0.8.26",uW="Self Destruct",yW="An example of how to delete your smart contract by calling seldestruct in Solidity",mW="",bW=[{fileName:"ForceEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIFRoZSBnb2FsIG9mIHRoaXMgZ2FtZSBpcyB0byBiZSB0aGUgN3RoIHBsYXllciB0byBkZXBvc2l0IDEgRXRoZXIuCi8vIFBsYXllcnMgY2FuIGRlcG9zaXQgb25seSAxIEV0aGVyIGF0IGEgdGltZS4KLy8gV2lubmVyIHdpbGwgYmUgYWJsZSB0byB3aXRoZHJhdyBhbGwgRXRoZXIuCgovKgoxLiBEZXBsb3kgRXRoZXJHYW1lCjIuIFBsYXllcnMgKHNheSBBbGljZSBhbmQgQm9iKSBkZWNpZGVzIHRvIHBsYXksIGRlcG9zaXRzIDEgRXRoZXIgZWFjaC4KMi4gRGVwbG95IEF0dGFjayB3aXRoIGFkZHJlc3Mgb2YgRXRoZXJHYW1lCjMuIENhbGwgQXR0YWNrLmF0dGFjayBzZW5kaW5nIDUgZXRoZXIuIFRoaXMgd2lsbCBicmVhayB0aGU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KSB7CiAgICAgICAgICAgIHdpbm5lciA9IG1zZy5zZW5kZXI7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIGNsYWltUmV3YXJkKCkgcHVibGljIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gd2lubmVyLCAiTm90IHdpbm5lciIpOwogICAgICAgIGJhbGFuY2UgPSAwOwogICAgICAgIChib29sIHNlbnQsKSA9IG1zZy5zZW5kZXIuY2FsbHt2YWx1ZTogYmFsYW5jZX0oIiIpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICB9Cn0K"}],wW=`

            Contracts can be deleted from the blockchain by calling selfdestruct.

            selfdestruct sends all remaining Ether stored in the contract to a designated address.

            Vulnerability

            @@ -10426,16 +10496,16 @@ Now no one can deposit and the winner cannot be set. */ contract EtherGame { - uint256 public targetAmount = 7 ether; + uint256 public constant TARGET_AMOUNT = 7 ether; address public winner; function deposit() public payable { require(msg.value == 1 ether, "You can only send 1 Ether"); uint256 balance = address(this).balance; - require(balance <= targetAmount, "Game is over"); + require(balance <= TARGET_AMOUNT, "Game is over"); - if (balance == targetAmount) { + if (balance == TARGET_AMOUNT) { winner = msg.sender; } } @@ -10470,7 +10540,7 @@ Now no one can deposit and the winner cannot be set. pragma solidity ^0.8.26; contract EtherGame { - uint256 public targetAmount = 3 ether; + uint256 public constant TARGET_AMOUNT = 7 ether; uint256 public balance; address public winner; @@ -10478,21 +10548,21 @@ Now no one can deposit and the winner cannot be set. require(msg.value == 1 ether, "You can only send 1 Ether"); balance += msg.value; - require(balance <= targetAmount, "Game is over"); + require(balance <= TARGET_AMOUNT, "Game is over"); - if (balance == targetAmount) { + if (balance == TARGET_AMOUNT) { winner = msg.sender; } } function claimReward() public { require(msg.sender == winner, "Not winner"); - + balance = 0; (bool sent,) = msg.sender.call{value: balance}(""); require(sent, "Failed to send Ether"); } } -`,kW=({prev:s,next:a})=>i.jsx(A,{version:AW,title:uW,description:yW,cyfrinLink:mW,html:wW,prev:s,next:a,codes:bW}),ZW="0.8.26",WW="Signature Replay",GW="An example of a contract vulnerable to signature replay attack",BW="",fW=[{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDgoKHVpbnQyNTYodnMpID4+IDI1NSkgKyAyNyk7CiAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzMzIgciwgYnl0ZXMzMiB2cykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIF90aHJvd0Vycm9yKGVycm9yKTsKICAgICAgICByZXR1cm4gcmVjb3ZlcmVkOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyeVJlY292ZXIoYnl0ZXMzMiBoYXNoLCB1aW50OCB2LCBieXRlczMyIHIsIGJ5dGVzMzIgcykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzLCBSZWNvdmVyRXJyb3IpCiAgICB7CiA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ZWFkIDI3LzI4LCBhZGQgMjcgdG8gdiB0byBhY2NlcHQKICAgICAgICAvLyB0aGVzZSBtYWxsZWFibGUgc2lnbmF0dXJlcyBhcyB3ZWxsLgogICAgICAgIGlmICgKICAgICAgICAgICAgdWludDI1NihzKQogICAgICAgICAgICAgICAgPiAweDdGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGNUQ1NzZFNzM1N0E0NTAxRERGRTkyRjQ2NjgxQjIwQTAKICAgICAgICApIHsKICAgICAgICAgICAgcmV0dXJuIChhZGRyZXNzKDApLCBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZVMpOwogICAgICAgIH0KICAgICAgICBpZiAodiAhPSAyNyAmJiB2ICE9IDI4KSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVWKTsKICAgICAgICB9CgogICAgICAgIC8vIElmIHRoZSBzaWduYXR1cmUgaXMgdmFsaWQgKGFuZCBub3QgbWFsbGVhYmxlKSwgcmV0dXJuIHRoZSBzaWduZXIgYWRkcmVzcwogICAgICAgIGFkZHJlc3Mgc2lnbmVyID0gZWNyZWNvdmVyKGhhc2gsIHYsIHIsIHMpOwogICAgICAgIGlmIChzaWduZXIgPT0gYWRkcmVzcygwKSkgewogICAgICAgICAgICByZXR1cm4gKGFkZHJlc3MoMCksIFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKTsKICAgICAgICB9CgogICAgICAgIHJldHVybiAoc2lnbmVyLCBSZWNvdmVyRXJyb3IuTm9FcnJvcik7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIHVpbnQ4IHYsIGJ5dGVzMzIgciwgYnl0ZXMzMiBzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgKGFkZHJlc3MgcmVjb3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qLwo="},{fileName:"SigReplay.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9FQ0RTQS5zb2wiOwoKY29udHJhY3QgTXVsdGlTaWdXYWxsZXQgewogICAgdXNpbmcgRUNEU0EgZm9yIGJ5dGVzMzI7CgogICAgYWRkcmVzc1syXSBwdWJsaWMgb3duZXJzOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3NbMl0gbWVtb3J5IF9vd25lcnMpIHBheWFibGUgewogICAgICAgIG93bmVycyA9IF9vd25lcnM7CiAgICB9CgogICAgZnVuY3Rpb24gZGVwb3NpdCgpIGV4dGVybmFsIHBheWFibGUge30KCiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIF90bywgdWludDI1NiBfYW1vdW50LCBieXRlc1syXSBtZW1vcnkgX3NpZ3MpCiAgICAgICAgZXh0ZXJuYWwKICAgIHsKICAgICAgICBieXRlczMyIHR4SGFzaCA9IGdldFR4SGFzaChfdG8sIF9hbW91bnQpOwogICAgICAgIHJlcXVpcmUoX2NoZWNrU2lncyhfc2lncywgdHhIYXNoKSwgImludmFsaWQgc2lnIik7CgogICAgICAgIChib29sIHNlbnQsKSA9IF90by5jYWxse3ZhbHVlOiBfYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRUeEhhc2goYWRkcmVzcyBfdG8sIHVpbnQyNTYgX2Ftb3VudCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQoX3RvLCBfYW1vdW50KSk7CiAgICB9CgogICAgZnVuY3Rpb24gX2NoZWNrU2lncyhieXRlc1syXSBtZW1vcnkgX3NpZ3MsIGJ5dGVzMzIgX3R4SGFzaCkKICAgICAgICBwcml2YXRlCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYnl0ZXMzMiBldGhTaWduZWRIYXNoID0gX3R4SGFzaC50b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKCk7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IF9zaWdzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGFkZHJlc3Mgc2lnbmVyID0gZXRoU2lnbmVkSGFzaC5yZWNvdmVyKF9zaWdzW2ldKTsKICAgICAgICAgICAgYm9vbCB2YWxpZCA9IHNpZ25lciA9PSBvd25lcnNbaV07CgogICAgICAgICAgICBpZiAoIXZhbGlkKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHJldHVybiB0cnVlOwogICAgfQp9Cg=="}],VW=`

            Signing messages off-chain and having a contract that requires that signature before executing +`,kW=({prev:s,next:a})=>i.jsx(A,{version:AW,title:uW,description:yW,cyfrinLink:mW,html:wW,prev:s,next:a,codes:bW}),ZW="0.8.26",WW="Signature Replay",BW="An example of a contract vulnerable to signature replay attack",GW="",fW=[{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDg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BfYW1vdW50LCBieXRlc1syXSBtZW1vcnkgX3NpZ3MpCiAgICAgICAgZXh0ZXJuYWwKICAgIHsKICAgICAgICBieXRlczMyIHR4SGFzaCA9IGdldFR4SGFzaChfdG8sIF9hbW91bnQpOwogICAgICAgIHJlcXVpcmUoX2NoZWNrU2lncyhfc2lncywgdHhIYXNoKSwgImludmFsaWQgc2lnIik7CgogICAgICAgIChib29sIHNlbnQsKSA9IF90by5jYWxse3ZhbHVlOiBfYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRUeEhhc2goYWRkcmVzcyBfdG8sIHVpbnQyNTYgX2Ftb3VudCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQoX3RvLCBfYW1vdW50KSk7CiAgICB9CgogICAgZnVuY3Rpb24gX2NoZWNrU2lncyhieXRlc1syXSBtZW1vcnkgX3NpZ3MsIGJ5dGVzMzIgX3R4SGFzaCkKICAgICAgICBwcml2YXRlCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYnl0ZXMzMiBldGhTaWduZWRIYXNoID0gX3R4SGFzaC50b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKCk7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IF9zaWdzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGFkZHJlc3Mgc2lnbmVyID0gZXRoU2lnbmVkSGFzaC5yZWNvdmVyKF9zaWdzW2ldKTsKICAgICAgICAgICAgYm9vbCB2YWxpZCA9IHNpZ25lciA9PSBvd25lcnNbaV07CgogICAgICAgICAgICBpZiAoIXZhbGlkKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHJldHVybiB0cnVlOwogICAgfQp9Cg=="}],VW=`

            Signing messages off-chain and having a contract that requires that signature before executing a function is a useful technique.

            For example this technique is used to:

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

              ); } } -`,YW=({prev:s,next:a})=>i.jsx(A,{version:ZW,title:WW,description:GW,cyfrinLink:BW,html:VW,prev:s,next:a,codes:fW}),XW="0.8.26",vW="Vault Inflation",RW="An example of vault inflation",NW="",HW=[{fileName:"VaultInflation.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI2OwoKaW1wb3J0IHtUZXN0LCBjb25zb2xlMn0gZnJvbSAiZm9yZ2Utc3RkL1Rlc3Quc29sIjsKaW1wb3J0IHsKICAgIElFUkMyMCwKICAgIFZhdWx0LAogICAgVG9rZW4KfSBmcm9tICIuLi8uLi8uLi9zcmMvaGFja3MvdmF1bHQtaW5mbGF0aW9uL1ZhdWx0SW5mbGF0aW9uLnNvbCI7Cgp1aW50OCBjb25zdGFudCBERUNJTUFMUyA9IDE4OwoKY29udHJhY3QgVmF1bHRUZXN0IGlzIFRlc3QgewogICAgVmF1bHQgcHJpdmF0ZSB2YXVsdDsKICAgIFRva2VuIHByaXZhdGUgdG9rZW47CgogICAgYWRkcmVzc1tdIHByaXZhdGUgdXNlcnMgPSBbYWRkcmVzcygxMSksIGFkZHJlc3MoMTIpXTsKCiAgICBmdW5jdGlvbiBzZXRVcCgpIHB1YmxpYyB7CiAgICAgICAgdG9rZW4gPSBuZXcgVG9rZW4oKTsKICAgICAgICB2YXVsdCA9IG5ldyBWYXVsdChhZGRyZXNzKHRva2VuKSk7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IHVzZXJzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIHRva2VuLm1pbnQodXNlcnNbaV0sI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ICAgIHByaW50KCk7CgogICAgICAgIC8vIHVzZXJzWzBdIGRvbmF0ZSAxMDAKICAgICAgICBjb25zb2xlMi5sb2coIi0tLSB1c2Vyc1swXSBkb25hdGUgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMF0pOwogICAgICAgIHRva2VuLnRyYW5zZmVyKGFkZHJlc3ModmF1bHQpLCAxMDAgKiAoMTAgKiogREVDSU1BTFMpKTsKICAgICAgICBwcmludCgpOwoKICAgICAgICAvLyB1c2Vyc1sxXSBkZXBvc2l0IDEwMAogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIHVzZXJzWzFdIGRlcG9zaXQgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMV0pOwogICAgICAgIHZhdWx0LmRlcG9zaXQoMTAwICogKDEwICoqIERFQ0lNQUxTKSk7CiAgICAgICAgcHJpbnQoKTsKICAgIH0KfQo="}],FW=`

              Vulnerability

              +`,YW=({prev:s,next:a})=>i.jsx(A,{version:ZW,title:WW,description:BW,cyfrinLink:GW,html:VW,prev:s,next:a,codes:fW}),XW="0.8.26",vW="Vault Inflation",RW="An example of vault inflation",NW="",HW=[{fileName:"VaultInflation.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI2OwoKaW1wb3J0IHtUZXN0LCBjb25zb2xlMn0gZnJvbSAiZm9yZ2Utc3RkL1Rlc3Quc29sIjsKaW1wb3J0IHsKICAgIElFUkMyMCwKICAgIFZhdWx0LAogICAgVG9rZW4KfSBmcm9tICIuLi8uLi8uLi9zcmMvaGFja3MvdmF1bHQtaW5mbGF0aW9uL1ZhdWx0SW5mbGF0aW9uLnNvbCI7Cgp1aW50OCBjb25zdGFudCBERUNJTUFMUyA9IDE4OwoKY29udHJhY3QgVmF1bHRUZXN0IGlzIFRlc3QgewogICAgVmF1bHQgcHJpdmF0ZSB2YXVsdDsKICAgIFRva2VuIHByaXZhdGUg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YXJlczApKTsKICAgICAgICBjb25zb2xlMi5sb2coInVzZXJzWzFdIHJlZGVlbWFibGUiLCB2YXVsdC5wcmV2aWV3UmVkZWVtKHNoYXJlczEpKTsKICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0KCkgcHVibGljIHsKICAgICAgICAvLyB1c2Vyc1swXSBkZXBvc2l0IDEKICAgICAgICBjb25zb2xlMi5sb2coIi0tLSB1c2Vyc1swXSBkZXBvc2l0IC0tLSIpOwogICAgICAgIHZtLnByYW5rKHVzZXJzWzBdKTsKICAgICAgICB2YXVsdC5kZXBvc2l0KDEpOwogICAgICAgIHByaW50KCk7CgogICAgICAgIC8vIHVzZXJzWzBdIGRvbmF0ZSAxMDAKICAgICAgICBjb25zb2xlMi5sb2coIi0tLSB1c2Vyc1swXSBkb25hdGUgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMF0pOwogICAgICAgIHRva2VuLnRyYW5zZmVyKGFkZHJlc3ModmF1bHQpLCAxMDAgKiAoMTAgKiogREVDSU1BTFMpKTsKICAgICAgICBwcmludCgpOwoKICAgICAgICAvLyB1c2Vyc1sxXSBkZXBvc2l0IDEwMAogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIHVzZXJzWzFdIGRlcG9zaXQgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMV0pOwogICAgICAgIHZhdWx0LmRlcG9zaXQoMTAwICogKDEwICoqIERFQ0lNQUxTKSk7CiAgICAgICAgcHJpbnQoKTsKICAgIH0KfQo="}],FW=`

              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

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

              // Example import ECDSA.sol from openzeppelin-contract repo, release-v4.5 branch // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.5/contracts/utils/cryptography/ECDSA.sol import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.5/contracts/utils/cryptography/ECDSA.sol"; -`,W2=({prev:s,next:a})=>i.jsx(A,{version:y2,title:m2,description:b2,cyfrinLink:w2,html:Z2,prev:s,next:a,codes:k2}),G2="0.8.26",B2="Inheritance",f2="Example of inheritance in Solidity",V2="https://www.cyfrin.io/glossary/inheritance-code-example",Y2=[{fileName:"Inheritance.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIEdyYXBoIG9mIGluaGVyaXRhbmNlCiAgICBBCiAgIC8gXAogIEIgICBDCiAvIFwgLwpGICBELEUKCiovCgpjb250cmFjdCBBIHsKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQSI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBpbmhlcml0IG90aGVyIGNvbnRyYWN0cyBieSB1c2luZyB0aGUga2V5d29yZCAnaXMnLgpjb250cmFjdCBCIGlzIEEgewogICAgLy8gT3ZlcnJpZGUgQS5mb28oKQogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIHB1cmUgdmlydHVhbCBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuICJCIjsKICAgIH0KfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIE92ZXJyaWRlIEEuZm9vKCkKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgb3ZlcnJpZGUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQyI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBjYW4gaW5oZXJpdCBmcm9tIG11bHRpcGxlIHBhcmVudCBjb250cmFjdHMuCi8vIFdoZW4gYSBmdW5jdGlvbiBpcyBjYWxsZWQgdGhhdCBpcyBkZ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gICAgcmV0dXJuIHN1cGVyLmZvbygpOwogICAgfQp9Cg=="}],X2=`

              Solidity supports multiple inheritance. Contracts can inherit other contract by using the is keyword.

              +`,W2=({prev:s,next:a})=>i.jsx(A,{version:y2,title:m2,description:b2,cyfrinLink:w2,html:Z2,prev:s,next:a,codes:k2}),B2="0.8.26",G2="Inheritance",f2="Example of inheritance in Solidity",V2="https://www.cyfrin.io/glossary/inheritance-code-example",Y2=[{fileName:"Inheritance.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIEdyYXBoIG9mIGluaGVyaXRhbmNlCiAgICBBCiAgIC8gXAogIEIgICBDCiAvIFwgLwpGICBELEUKCiovCgpjb250cmFjdCBBIHsKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQSI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBpbmhlcml0IG90aGVyIGNvbnRyYWN0cyBieSB1c2luZyB0aGUga2V5d29yZCAnaXMnLgpjb250cmFjdCBCIGlzIEEgewogICAgLy8gT3ZlcnJpZGUgQS5mb28oKQogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIHB1cmUgdmlydHVhbCBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuICJCIjsKICAgIH0KfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIE92ZXJyaWRlIEEuZm9vKCkKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgb3ZlcnJpZGUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQyI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBjYW4gaW5oZXJpdCBmcm9tIG11bHRpcGxlIHBhcmV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saWMgcHVyZSBvdmVycmlkZShBLCBCKSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIHN1cGVyLmZvbygpOwogICAgfQp9Cg=="}],X2=`

              Solidity supports multiple inheritance. Contracts can inherit other contract by using the is keyword.

              Function that is going to be overridden by a child contract must be declared as virtual.

              Function that is going to override a parent function must use the keyword override.

              Order of inheritance is important.

              @@ -11304,7 +11374,7 @@ F D,E return super.foo(); } } -`,v2=({prev:s,next:a})=>i.jsx(A,{version:G2,title:B2,description:f2,cyfrinLink:V2,html:X2,prev:s,next:a,codes:Y2}),R2="0.8.26",N2="Interface",H2="An example of interface in Solidity",F2="https://www.cyfrin.io/glossary/interface-code-example",K2=[{fileName:"Interface.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWwgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9Cn0KCmludGVyZmFjZSBJQ291bnRlciB7CiAgICBmdW5jdGlvbiBjb3VudCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IE15Q29udHJhY3QgewogICAgZnVuY3Rpb24gaW5jcmVtZW50Q291bnRlcihhZGRyZXNzIF9jb3VudGVyKSBleHRlcm5hbCB7CiAgICAgICAgSUNvdW50ZXIoX2NvdW50ZXIpLmluY3JlbWVudCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldENvdW50KGFkZHJlc3MgX2NvdW50ZXIpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBJQ291bnRlcihfY291bnRlcikuY291bn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gcmV0dXJuIChyZXNlcnZlMCwgcmVzZXJ2ZTEpOwogICAgfQp9Cg=="}],M2=`

              You can interact with other contracts by declaring an Interface.

              +`,v2=({prev:s,next:a})=>i.jsx(A,{version:B2,title:G2,description:f2,cyfrinLink:V2,html:X2,prev:s,next:a,codes:Y2}),R2="0.8.26",N2="Interface",H2="An example of interface in Solidity",F2="https://www.cyfrin.io/glossary/interface-code-example",K2=[{fileName:"Interface.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWwgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9Cn0KCmludGVyZmFjZSBJQ291bnRlciB7CiAgICBmdW5jdGlvbiBjb3VudCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IE15Q29udHJhY3QgewogICAgZnVuY3Rpb24gaW5jcmVtZW50Q291bnRlcihhZGRyZXNzIF9jb3VudGVyKSBleHRlcm5hbCB7CiAgICAgICAgSUNvdW50ZXIoX2NvdW50ZXIpLmluY3JlbWVudCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldENvdW50KGFkZHJlc3MgX2NvdW50ZXIpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBJQ291bnRlcihfY291bnRlcikuY291bnQoKTsKICAgIH0KfQoKLy8gVW5pc3dhcCBleGFtcGxlCmludGVyZmFjZSBVbmlzd2FwVjJGYWN0b3J5IHsKICAgIGZ1bmN0aW9uIGdldFBhaXIoYWRkcmVzcyB0b2tlbkEsIGFkZHJlc3MgdG9rZW5CKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGFkZHJlc3MgcGFpcik7Cn0KCmludGVyZmFjZSBVbmlzd2FwVjJQYWlyIHsKICAgIGZ1bmN0aW9uIGdldFJlc2VydmVzKCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MTEyIHJlc2VydmUwLCB1aW50MTEyIHJlc2VydmUxLCB1aW50MzIgYmxvY2tUaW1lc3RhbXBMYXN0KTsKfQoKY29udHJhY3QgVW5pc3dhcEV4YW1wbGUgewogICAgYWRkcmVzcyBwcml2YXRlIGZhY3RvcnkgPSAweDVDNjliRWU3MDFlZjgxNGEyQjZhM0VERDRCMTY1MkNCOWNjNWFBNmY7CiAgICBhZGRyZXNzIHByaXZhdGUgZGFpID0gMHg2QjE3NTQ3NEU4OTA5NEM0NERhOThiOTU0RWVkZUFDNDk1MjcxZDBGOwogICAgYWRkcmVzcyBwcml2YXRlIHdldGggPSAweEMwMmFhQTM5YjIyM0ZFOEQwQTBlNUM0RjI3ZUFEOTA4M0M3NTZDYzI7CgogICAgZnVuY3Rpb24gZ2V0VG9rZW5SZXNlcnZlcygpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NiwgdWludDI1NikgewogICAgICAgIGFkZHJlc3MgcGFpciA9IFVuaXN3YXBWMkZhY3RvcnkoZmFjdG9yeSkuZ2V0UGFpcihkYWksIHdldGgpOwogICAgICAgICh1aW50MjU2IHJlc2VydmUwLCB1aW50MjU2IHJlc2VydmUxLCkgPQogICAgICAgICAgICBVbmlzd2FwVjJQYWlyKHBhaXIpLmdldFJlc2VydmVzKCk7CiAgICAgICAgcmV0dXJuIChyZXNlcnZlMCwgcmVzZXJ2ZTEpOwogICAgfQp9Cg=="}],M2=`

              You can interact with other contracts by declaring an Interface.

              Interface

              • cannot have any functions implemented
              • @@ -11451,7 +11521,7 @@ you can't send ether.

                } } } -`,q2=({prev:s,next:a})=>i.jsx(A,{version:U2,title:_2,description:L2,cyfrinLink:O2,html:$2,prev:s,next:a,codes:P2}),sG="0.8.26",aG="Mapping",nG="Example of using mapping in Solidity",lG="https://www.cyfrin.io/glossary/mapping-code-example",pG=[{fileName:"Mapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1hcHBpbmcgewogICAgLy8gTWFwcGluZyBmcm9tIGFkZHJlc3MgdG8gdWludAogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBteU1hcDsKCiAgICBmdW5jdGlvbiBnZXQoYWRkcmVzcyBfYWRkcikgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIC8vIE1hcHBpbmcgYWx3YXlzIHJldHVybnMgYSB2YWx1ZS4KICAgICAgICAvLyBJZiB0aGUgdmFsdWUgd2FzIG5ldmVyIHNldCwgaXQgd2lsbCByZXR1cm4gdGhlIGRlZmF1bHQgdmFsdWUuCiAgICAgICAgcmV0dXJuIG15TWFwW19hZGRyXTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoYWRkcmVzcyBfYWRkciwgdWludDI1NiBfaSkgcHVibGljIHsKICAgICAgICAvLyBVcGRhdGUgdGhlIHZhbHVlIGF0IHRoaXMgYWRkcmVzcwogICAgICAgIG15TWFwW19hZGRyXSA9IF9pOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyKSBwdWJsaWMgewogICAgICAgIC8vIFJlc2V0IHRoZSB2YWx1ZSB0byB0aGUgZGVmYXVsdCB2YWx1ZS4KICAgICAgICBkZWxldGUgbXlNYXBbX2FkZHJdOwogICAgfQp9Cgpjb250cmFjdCBOZXN0ZWRNYXBwaW5nIHsKICAgIC8vIE5lc3RlZCBtYXBwaW5nIChtYXBwaW5nIGZyb20gYWRkcmVzcyB0byBhbm90aGVyIG1hcHBpbmcpCiAgICBtYXBwaW5nKGFkZHJlc3MgPT4gbWFwcGluZyh1aW50MjU2ID0+IGJvb2wpKSBwdWJsaWMgbmVzdGVkOwoKICAgIGZ1bmN0aW9uIGdldChhZGRyZXNzIF9hZGRyMSwgdWludDI1NiBfaSkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIC8vIFlvdSBjYW4gZ2V0IHZhbHVlcyBmcm9tIGEgbmVzdGVkIG1hcHBpbmcKICAgICAgICAvLyBldmVuIHdoZW4gaXQgaXMgbm90IGluaXRpYWxpemVkCiAgICAgICAgcmV0dXJuIG5lc3RlZFtfYWRkcjFdW19pXTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoYWRkcmVzcyBfYWRkcjEsIHVpbnQyNTYgX2ksIGJvb2wgX2JvbykgcHVibGljIHsKICAgICAgICBuZXN0ZWRbX2FkZHIxXVtfaV0gPSBfYm9vOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyMSwgdWludDI1NiBfaSkgcHVibGljIHsKICAgICAgICBkZWxldGUgbmVzdGVkW19hZGRyMV1bX2ldOwogICAgfQp9Cg=="}],eG=`

                Maps are created with the syntax mapping(keyType => valueType).

                +`,q2=({prev:s,next:a})=>i.jsx(A,{version:U2,title:_2,description:L2,cyfrinLink:O2,html:$2,prev:s,next:a,codes:P2}),sB="0.8.26",aB="Mapping",nB="Example of using mapping in Solidity",lB="https://www.cyfrin.io/glossary/mapping-code-example",pB=[{fileName:"Mapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1hcHBpbmcgewogICAgLy8gTWFwcGluZyBmcm9tIGFkZHJlc3MgdG8gdWludAogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBteU1hcDsKCiAgICBmdW5jdGlvbiBnZXQoYWRkcmVzcyBf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vbiBzZXQoYWRkcmVzcyBfYWRkcjEsIHVpbnQyNTYgX2ksIGJvb2wgX2JvbykgcHVibGljIHsKICAgICAgICBuZXN0ZWRbX2FkZHIxXVtfaV0gPSBfYm9vOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyMSwgdWludDI1NiBfaSkgcHVibGljIHsKICAgICAgICBkZWxldGUgbmVzdGVkW19hZGRyMV1bX2ldOwogICAgfQp9Cg=="}],eB=`

                Maps are created with the syntax mapping(keyType => valueType).

                The keyType can be any built-in value type, bytes, string, or any contract.

                valueType can be any type including another mapping or an array.

                Mappings are not iterable.

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

                delete nested[_addr1][_i]; } } -`,cG=({prev:s,next:a})=>i.jsx(A,{version:sG,title:aG,description:nG,cyfrinLink:lG,html:eG,prev:s,next:a,codes:pG}),tG="0.8.26",oG="Contract that Creates other Contracts",rG="Learn how to create new contracts from inside of a contract with Solidity",iG="https://www.cyfrin.io/glossary/contract-that-creates-other-contracts-code-example",gG=[{fileName:"NewContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENhciB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIHN0cmluZyBwdWJsaWMgbW9kZWw7CiAgICBhZGRyZXNzIHB1YmxpYyBjYXJBZGRyOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX293bmVyLCBzdHJpbmcgbWVtb3J5IF9tb2RlbCkgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICAgICAgbW9kZWwgPSBfbW9kZWw7CiAgICAgICAgY2FyQWRkciA9IGFkZHJlc3ModGhpcyk7CiAgICB9Cn0KCmNvbnRyYWN0IENhckZhY3RvcnkgewogICAgQ2FyW10gcHVibGljIGNhcnM7CgogICAgZnVuY3Rpb24gY3JlYXR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AgICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgICAgIHN0cmluZyBtZW1vcnkgbW9kZWwsCiAgICAgICAgICAgIGFkZHJlc3MgY2FyQWRkciwKICAgICAgICAgICAgdWludDI1NiBiYWxhbmNlCiAgICAgICAgKQogICAgewogICAgICAgIENhciBjYXIgPSBjYXJzW19pbmRleF07CgogICAgICAgIHJldHVybiAoY2FyLm93bmVyKCksIGNhci5tb2RlbCgpLCBjYXIuY2FyQWRkcigpLCBhZGRyZXNzKGNhcikuYmFsYW5jZSk7CiAgICB9Cn0K"}],hG=`

                Contracts can be created by other contracts using the new keyword. Since 0.8.0, new keyword supports create2 feature by specifying salt options.

                +`,cB=({prev:s,next:a})=>i.jsx(A,{version:sB,title:aB,description:nB,cyfrinLink:lB,html:eB,prev:s,next:a,codes:pB}),tB="0.8.26",oB="Contract that Creates other Contracts",rB="Learn how to create new contracts from inside of a contract with Solidity",iB="https://www.cyfrin.io/glossary/contract-that-creates-other-contracts-code-example",gB=[{fileName:"NewContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENhciB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIHN0cmluZyBwdWJsaWMgbW9kZWw7CiAgICBhZGRyZXNzIHB1YmxpYyBjYXJBZGRyOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX293bmVyLCBzdHJpbmcgbWVtb3J5IF9tb2RlbCkgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICAgICAgbW9kZWwgPSBfbW9kZWw7CiAgICAgICAgY2FyQWRkciA9IGFkZHJlc3ModGhpcyk7CiAgICB9Cn0KCmNvbnRyYWN0IENhckZhY3RvcnkgewogICAgQ2FyW10gcHVibGljIGNhcnM7CgogICAgZnVuY3Rpb24gY3JlYXRlKGFkZHJlc3MgX293bmVyLCBzdH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XIsCiAgICAgICAgICAgIHN0cmluZyBtZW1vcnkgbW9kZWwsCiAgICAgICAgICAgIGFkZHJlc3MgY2FyQWRkciwKICAgICAgICAgICAgdWludDI1NiBiYWxhbmNlCiAgICAgICAgKQogICAgewogICAgICAgIENhciBjYXIgPSBjYXJzW19pbmRleF07CgogICAgICAgIHJldHVybiAoY2FyLm93bmVyKCksIGNhci5tb2RlbCgpLCBjYXIuY2FyQWRkcigpLCBhZGRyZXNzKGNhcikuYmFsYW5jZSk7CiAgICB9Cn0K"}],hB=`

                Contracts can be created by other contracts using the new keyword. Since 0.8.0, new keyword supports create2 feature by specifying salt options.

                // SPDX-License-Identifier: MIT
                 pragma solidity ^0.8.26;
                 
                @@ -11560,7 +11630,7 @@ you can't send ether.

                return (car.owner(), car.model(), car.carAddr(), address(car).balance); } } -
                `,IG=({prev:s,next:a})=>i.jsx(A,{version:tG,title:oG,description:rG,cyfrinLink:iG,html:hG,prev:s,next:a,codes:gG}),dG="0.8.26",CG="Payable",jG="An example of how to use the keyword payable in Solidity",AG="https://www.cyfrin.io/glossary/payable-code-example",uG=[{fileName:"Payable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFBheWFibGUgewogICAgLy8gUGF5YWJsZSBhZGRyZXNzIGNhbiBzZW5kIEV0aGVyIHZpYSB0cmFuc2ZlciBvciBzZW5kCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIG93bmVyOwoKICAgIC8vIFBheWFibGUgY29uc3RydWN0b3IgY2FuIHJlY2VpdmUgRXRoZXIKICAgIGNvbnN0cnVjdG9yKCkgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGRlcG9zaXQgRXRoZXIgaW50byB0aGlzIGNvbnRyYWN0LgogICAgLy8gQ2FsbCB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B0aGF0ICJ0byIgaXMgZGVjbGFyZWQgYXMgcGF5YWJsZQogICAgICAgIChib29sIHN1Y2Nlc3MsKSA9IF90by5jYWxse3ZhbHVlOiBfYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzdWNjZXNzLCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KfQo="}],yG=`

                Functions and addresses declared payable can receive ether into the contract.

                +`,IB=({prev:s,next:a})=>i.jsx(A,{version:tB,title:oB,description:rB,cyfrinLink:iB,html:hB,prev:s,next:a,codes:gB}),dB="0.8.26",CB="Payable",jB="An example of how to use the keyword payable in Solidity",AB="https://www.cyfrin.io/glossary/payable-code-example",uB=[{fileName:"Payable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFBheWFibGUgewogICAgLy8gUGF5YWJsZSBhZGRyZXNzIGNhbiBzZW5kIEV0aGVyIHZpYSB0cmFuc2ZlciBvciBzZW5kCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIG93bmVyOwoKICAgIC8vIFBheWFibGUgY29uc3RydWN0b3IgY2FuIHJlY2VpdmUgRXRoZXIKICAgIGNvbnN0cnVjdG9yKCkgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGRlcG9zaXQgRXRoZXIgaW50byB0aGlzIGNvbnRyYWN0LgogICAgLy8gQ2FsbCB0aGlzIGZ1bmN0aW9uIGFsb25nIHdpdGggc29tZSBFdGhlci4KICAgIC8vIFRoZSBiYWxhbmNlIG9mIHRoaXMgY29udHJhY3Qgd2lsbCBiZSBhdXRvbWF0aWNhbGx5IHVwZGF0ZWQuCiAgICBmdW5jdGlvbiBkZXBvc2l0KCkgcHVibGljIHBheWFibGUge30KCiAgICAvLyBDYWxsIHRoaXMgZnVuY3Rpb24gYWxvbmcgd2l0aCBzb21lIEV0aGVyLgogICAgLy8gVGhlIGZ1bmN0aW9uIHdpbGwgdGhyb3cgYW4gZXJyb3Igc2luY2UgdGhpcyBmdW5jdGlvbiBpcyBub3QgcGF5YWJsZS4KICAgIGZ1bmN0aW9uIG5vdFBheWFibGUoKSBwdWJsaWMge30KCiAgICAvLyBGdW5jdGlvbiB0byB3aXRoZHJhdyBhbGwgRXRoZXIgZnJvbSB0aGlzIGNvbnRyYWN0LgogICAgZnVuY3Rpb24gd2l0aGRyYXcoKSBwdWJsaWMgewogICAgICAgIC8vIGdldCB0aGUgYW1vdW50IG9mIEV0aGVyIHN0b3JlZCBpbiB0aGlzIGNvbnRyYWN0CiAgICAgICAgdWludDI1NiBhbW91bnQgPSBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CgogICAgICAgIC8vIHNlbmQgYWxsIEV0aGVyIHRvIG93bmVyCiAgICAgICAgKGJvb2wgc3VjY2VzcywpID0gb3duZXIuY2FsbHt2YWx1ZTogYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzdWNjZXNzLCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KCiAgICAvLyBGdW5jdGlvbiB0byB0cmFuc2ZlciBFdGhlciBmcm9tIHRoaXMgY29udHJhY3QgdG8gYWRkcmVzcyBmcm9tIGlucHV0CiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIHBheWFibGUgX3RvLCB1aW50MjU2IF9hbW91bnQpIHB1YmxpYyB7CiAgICAgICAgLy8gTm90ZSB0aGF0ICJ0byIgaXMgZGVjbGFyZWQgYXMgcGF5YWJsZQogICAgICAgIChib29sIHN1Y2Nlc3MsKSA9IF90by5jYWxse3ZhbHVlOiBfYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzdWNjZXNzLCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KfQo="}],yB=`

                Functions and addresses declared payable can receive ether into the contract.

                // SPDX-License-Identifier: MIT
                 pragma solidity ^0.8.26;
                 
                @@ -11599,7 +11669,7 @@ you can't send ether.

                require(success, "Failed to send Ether"); } } -
                `,mG=({prev:s,next:a})=>i.jsx(A,{version:dG,title:CG,description:jG,cyfrinLink:AG,html:yG,prev:s,next:a,codes:uG}),bG="0.8.26",wG="Primitive Data Types",kG="Primitive data types",ZG="https://www.cyfrin.io/glossary/primitive-data-types-code-example",WG=[{fileName:"Primitives.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFByaW1pdGl2ZXMgewogICAgYm9vbCBwdWJsaWMgYm9vID0gdHJ1ZTsKCiAgICAvKgogICAgdWludCBzdGFuZHMgZm9yIHVuc2lnbmVkIGludGVnZXIsIG1lYW5pbmcgbm9uIG5lZ2F0aXZlIGludGVnZXJzCiAgICBkaWZmZXJlbnQgc2l6ZXMgYXJlIGF2YWlsYWJsZQogICAgICAgIHVpbnQ4ICAgcmFuZ2VzIGZyb20gMCB0byAyICoqIDggLSAxCiAgICAgICAgdWludDE2ICByYW5nZXMgZnJvbSAwIHRvIDIgKiogMTYgLSAxCiAgICAgICAgLi4uCiAgICAgICAgdWludDI1NiByYW5nZXMgZnJvbSAwIHRvIDIgKiogMjU2IC0gMQogICAgKi8KICAgIHVpbnQ4IHB1YmxpYyB1OCA9IDE7CiAgICB1aW50MjU2IHB1YmxpYyB1MjU2ID0gNDU2OwogICAgdWludDI1NiBwdWJsaWMgdSA9IDEyMzsgLy8gdWludCBpcyBhbiBhbGlhcyBmb3IgdWludDI1NgoKICAgIC8qCiAgICBOZWdhdGl2ZSBudW1iZXJzIGFyZSBhbGxvd2VkIGZvciBpbnQgdHlwZXMuCiAgICBMaWtlIHVpbnQsIGRpZmZlcmVudCByYW5nZXMgYXJlIGF2YWlsYWJsZSBmcm9tIGludDggdG8gaW50MjU2CiAgICAKICAgIGludDI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pYWJsZXMgaGF2ZSBhIGRlZmF1bHQgdmFsdWUKICAgIGJvb2wgcHVibGljIGRlZmF1bHRCb287IC8vIGZhbHNlCiAgICB1aW50MjU2IHB1YmxpYyBkZWZhdWx0VWludDsgLy8gMAogICAgaW50MjU2IHB1YmxpYyBkZWZhdWx0SW50OyAvLyAwCiAgICBhZGRyZXNzIHB1YmxpYyBkZWZhdWx0QWRkcjsgLy8gMHgwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCn0K"}],GG=`

                Here we introduce you to some primitive data types available in Solidity.

                +`,mB=({prev:s,next:a})=>i.jsx(A,{version:dB,title:CB,description:jB,cyfrinLink:AB,html:yB,prev:s,next:a,codes:uB}),bB="0.8.26",wB="Primitive Data Types",kB="Primitive data types",ZB="https://www.cyfrin.io/glossary/primitive-data-types-code-example",WB=[{fileName:"Primitives.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFByaW1pdGl2ZXMgewogICAgYm9vbCBwdWJsaWMgYm9vID0gdHJ1ZTsKCiAgICAvKgogICAgdWludCBzdGFuZHMgZm9yIHVuc2lnbmVkIGludGVnZXIsIG1lYW5pbmcgbm9uIG5lZ2F0aXZlIGludGVnZXJzCiAgICBkaWZmZXJlbnQgc2l6ZXMgYXJlIGF2YWlsYWJsZQogICAgICAgIHVpbnQ4ICAgcmFuZ2VzIGZyb20gMCB0byAyICoqIDggLSAxCiAgICAgICAgdWludDE2ICByYW5nZXMgZnJvbSAwIHRvIDIgKiogMTYgLSAxCiAgICAgICAgLi4uCiAgICAgICAgdWludDI1NiByYW5nZXMgZnJvbSAwIHRvIDIgKiogMjU2IC0gMQogICAgKi8KICAgIHVpbnQ4IHB1YmxpYyB1OCA9IDE7CiAgICB1aW50MjU2IHB1YmxpYyB1MjU2ID0gNDU2OwogICAgdWludDI1NiBwdWJsaWMgdS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heSBvZiBieXRlcy4gCiAgICAgSXTigJlzIGEgc2hvcnRoYW5kIGZvciBieXRlW10gLgogICAgKi8KICAgIGJ5dGVzMSBhID0gMHhiNTsgLy8gIFsxMDExMDEwMV0KICAgIGJ5dGVzMSBiID0gMHg1NjsgLy8gIFswMTAxMDExMF0KCiAgICAvLyBEZWZhdWx0IHZhbHVlcwogICAgLy8gVW5hc3NpZ25lZCB2YXJpYWJsZXMgaGF2ZSBhIGRlZmF1bHQgdmFsdWUKICAgIGJvb2wgcHVibGljIGRlZmF1bHRCb287IC8vIGZhbHNlCiAgICB1aW50MjU2IHB1YmxpYyBkZWZhdWx0VWludDsgLy8gMAogICAgaW50MjU2IHB1YmxpYyBkZWZhdWx0SW50OyAvLyAwCiAgICBhZGRyZXNzIHB1YmxpYyBkZWZhdWx0QWRkcjsgLy8gMHgwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCn0K"}],BB=`

                Here we introduce you to some primitive data types available in Solidity.

                • boolean
                • uint256
                • @@ -11661,7 +11731,7 @@ you can't send ether.

                  int256 public defaultInt; // 0 address public defaultAddr; // 0x0000000000000000000000000000000000000000 } -`,BG=({prev:s,next:a})=>i.jsx(A,{version:bG,title:wG,description:kG,cyfrinLink:ZG,html:GG,prev:s,next:a,codes:WG}),fG="0.8.26",VG="Sending Ether (transfer, send, call)",YG="An example of sending Ether in Solidity",XG="https://www.cyfrin.io/glossary/sending-ether-transfer-send-call-code-example",vG=[{fileName:"SendingEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFJlY2VpdmVFdGhlciB7CiAgICAvKgogICAgV2hpY2ggZnVuY3Rpb24gaXMgY2FsbGVkLCBmYWxsYmFjaygpIG9yIHJlY2VpdmUoKT8KCiAgICAgICAgICAgc2VuZCBFdGhlcgogICAgICAgICAgICAgICB8CiAgICAgICAgI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S4KICAgICAgICAvLyBUaGlzIGZ1bmN0aW9uIGlzIG5vdCByZWNvbW1lbmRlZCBmb3Igc2VuZGluZyBFdGhlci4KICAgICAgICBib29sIHNlbnQgPSBfdG8uc2VuZChtc2cudmFsdWUpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICB9CgogICAgZnVuY3Rpb24gc2VuZFZpYUNhbGwoYWRkcmVzcyBwYXlhYmxlIF90bykgcHVibGljIHBheWFibGUgewogICAgICAgIC8vIENhbGwgcmV0dXJucyBhIGJvb2xlYW4gdmFsdWUgaW5kaWNhdGluZyBzdWNjZXNzIG9yIGZhaWx1cmUuCiAgICAgICAgLy8gVGhpcyBpcyB0aGUgY3VycmVudCByZWNvbW1lbmRlZCBtZXRob2QgdG8gdXNlLgogICAgICAgIChib29sIHNlbnQsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF90by5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],RG=`

                  How to send Ether?

                  +`,GB=({prev:s,next:a})=>i.jsx(A,{version:bB,title:wB,description:kB,cyfrinLink:ZB,html:BB,prev:s,next:a,codes:WB}),fB="0.8.26",VB="Sending Ether (transfer, send, call)",YB="An example of sending Ether in Solidity",XB="https://www.cyfrin.io/glossary/sending-ether-transfer-send-call-code-example",vB=[{fileName:"SendingEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFJlY2VpdmVFdGhlciB7CiAgICAvKgogICAgV2hpY2ggZnVuY3Rpb24gaXMgY2FsbGVkLCBmYWxsYmFjaygpIG9yIHJlY2VpdmUoKT8KCiAgICAgICAgICAgc2VuZCBFdGhlcgogICAgICAgICAgICAgICB8CiAgICAgICAgI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S4KICAgICAgICAvLyBUaGlzIGZ1bmN0aW9uIGlzIG5vdCByZWNvbW1lbmRlZCBmb3Igc2VuZGluZyBFdGhlci4KICAgICAgICBib29sIHNlbnQgPSBfdG8uc2VuZChtc2cudmFsdWUpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICB9CgogICAgZnVuY3Rpb24gc2VuZFZpYUNhbGwoYWRkcmVzcyBwYXlhYmxlIF90bykgcHVibGljIHBheWFibGUgewogICAgICAgIC8vIENhbGwgcmV0dXJucyBhIGJvb2xlYW4gdmFsdWUgaW5kaWNhdGluZyBzdWNjZXNzIG9yIGZhaWx1cmUuCiAgICAgICAgLy8gVGhpcyBpcyB0aGUgY3VycmVudCByZWNvbW1lbmRlZCBtZXRob2QgdG8gdXNlLgogICAgICAgIChib29sIHNlbnQsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF90by5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],RB=`

                  How to send Ether?

                  You can send Ether to other contracts by

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

                    require(sent, "Failed to send Ether"); } } -`,NG=({prev:s,next:a})=>i.jsx(A,{version:fG,title:VG,description:YG,cyfrinLink:XG,html:RG,prev:s,next:a,codes:vG}),HG="0.8.26",FG="Shadowing Inherited State Variables",KG="An example of shadowing state variables by inheritance",MG="https://www.cyfrin.io/glossary/shadowing-inherited-state-variables-code-example",SG=[{fileName:"Shadow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEEgewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkNvbnRyYWN0IEEiOwoKICAgIGZ1bmN0aW9uIGdldE5hbWUoKSBwdWJsaWMgdmlldyByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIG5hbWU7CiAgICB9Cn0KCi8vIFNoYWRvd2luZyBpcyBkaXNhbGxvd2VkIGluIFNvbGlkaXR5IDAuNgovLyBUaGlzIHdpbGwgbm90IGNvbXBpbGUKLy8gY29udHJhY3QgQiBpcyBBIHsKLy8gICAgIHN0cmluZyBwdWJsaWMgbmFtZSA9ICJDb250cmFjdCBCIjsKLy8gfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIFRoaXMgaXMgdGhlIGNvcnJlY3Qgd2F5IHRvIG92ZXJyaWRlIGluaGVyaXRlZCBzdGF0ZSB2YXJpYWJsZXMuCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBuYW1lID0gIkNvbnRyYWN0IEMiOwogICAgfQoKICAgIC8vIEMuZ2V0TmFtZSByZXR1cm5zICJDb250cmFjdCBDIgp9Cg=="}],xG=`

                    Unlike functions, state variables cannot be overridden by re-declaring it +`,NB=({prev:s,next:a})=>i.jsx(A,{version:fB,title:VB,description:YB,cyfrinLink:XB,html:RB,prev:s,next:a,codes:vB}),HB="0.8.26",FB="Shadowing Inherited State Variables",KB="An example of shadowing state variables by inheritance",MB="https://www.cyfrin.io/glossary/shadowing-inherited-state-variables-code-example",SB=[{fileName:"Shadow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEEgewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkNvbnRyYWN0IEEiOwoKICAgIGZ1bmN0aW9uIGdldE5hbWUoKSBwdWJsaWMgdmlldyByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIG5hbWU7CiAgICB9Cn0KCi8vIFNoYWRvd2luZyBpcyBkaXNhbGxvd2VkIGluIFNvbGlkaXR5IDAuNgovLyBUaGlzIHdpbGwgbm90IGNvbXBpbGUKLy8gY29udHJhY3QgQiBpcyBBIHsKLy8gICAgIHN0cmluZyBwdWJsaWMgbmFtZSA9ICJDb250cmFjdCBCIjsKLy8gfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIFRoaXMgaXMgdGhlIGNvcnJlY3Qgd2F5IHRvIG92ZXJyaWRlIGluaGVyaXRlZCBzdGF0ZSB2YXJpYWJsZXMuCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBuYW1lID0gIkNvbnRyYWN0IEMiOwogICAgfQoKICAgIC8vIEMuZ2V0TmFtZSByZXR1cm5zICJDb250cmFjdCBDIgp9Cg=="}],xB=`

                    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
                    @@ -11761,7 +11831,7 @@ in the child contract.

                    // C.getName returns "Contract C" } -
                    `,JG=({prev:s,next:a})=>i.jsx(A,{version:HG,title:FG,description:KG,cyfrinLink:MG,html:xG,prev:s,next:a,codes:SG}),zG="0.8.26",DG="Verifying Signature",EG="An example of how to verify signatures in Solidity",QG="https://www.cyfrin.io/glossary/verifying-signature-code-example",TG=[{fileName:"Signature.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIFNpZ25hdHVyZSBWZXJpZmljYXRpb24KCkhvdyB0byBTaWduIGFuZCBWZXJpZnkKIyBTaWduaW5nCjEuIENyZWF0ZSBtZXNzYWdlIHRvIHNpZ24KMi4gSGFzaCB0aGUgbWVzc2FnZQozLiBTaWduIHRoZSBoYXNoIChvZmYgY2hhaW4sIGtlZXAgeW91ciBwcml2YXRlIGtleSBzZWNyZXQpCgojIFZlcmlmeQoxLiBSZWNyZWF0ZSBoYXNoIGZyb20gdGhlIG9yaWdpbmFsIG1lc3NhZ2UKMi4gUmVjb3ZlciBzaWduZXIgZn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ICAgICAvLyBmaW5hbCBieXRlIChmaXJzdCBieXRlIG9mIHRoZSBuZXh0IDMyIGJ5dGVzKQogICAgICAgICAgICB2IDo9IGJ5dGUoMCwgbWxvYWQoYWRkKHNpZywgOTYpKSkKICAgICAgICB9CgogICAgICAgIC8vIGltcGxpY2l0bHkgcmV0dXJuIChyLCBzLCB2KQogICAgfQp9Cg=="}],UG=`

                    Messages can be signed off chain and then verified on chain using a smart contract.

                    +`,JB=({prev:s,next:a})=>i.jsx(A,{version:HB,title:FB,description:KB,cyfrinLink:MB,html:xB,prev:s,next:a,codes:SB}),zB="0.8.26",DB="Verifying Signature",EB="An example of how to verify signatures in Solidity",QB="https://www.cyfrin.io/glossary/verifying-signature-code-example",TB=[{fileName:"Signature.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIFNpZ25hdHVyZSBWZXJpZmljYXRpb24KCkhvdyB0byBTaWduIGFuZCBWZXJpZnkKIyBTaWduaW5nCjEuIENyZWF0ZSBtZXNzYWdlIHRvIHNpZ24KMi4gSGFzaCB0aGUgbWVzc2FnZQozLiBTaWduIHRoZSBoYXNoIChvZmYgY2hhaW4sIGtlZXAgeW91ciBwcml2YXRlIGtleSBzZWNyZXQpCgojIFZlcmlmeQoxLiBSZWNyZWF0ZSBoYXNoIGZyb20gdGhlIG9yaWdpbmFsIG1lc3NhZ2UKMi4gUmVjb3ZlciBzaWduZXIgZnJvbSBzaWduYXR1cmUgYW5kIGhhc2gKMy4gQ29tcGFyZSByZWNvdmVyZWQgc2lnbmVyIHRvIGNsYWltZWQgc2lnbmVyCiovCgpjb250cmFjdCBWZXJpZnlTaWduYXR1cmUgewogICAgLyogMS4gVW5sb2NrIE1ldGFNYXNrIGFjY291bnQKICAgIGV0aGVyZXVtLmVuYWJsZSgpCiAgICAqLwoKICAgIC8qIDIuIEdldCBtZXNzYWdlIGhhc2ggdG8gc2lnbgogICAgZ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HVyZShieXRlcyBtZW1vcnkgc2lnKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyIHIsIGJ5dGVzMzIgcywgdWludDggdikKICAgIHsKICAgICAgICByZXF1aXJlKHNpZy5sZW5ndGggPT0gNjUsICJpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvKgogICAgICAgICAgICBGaXJzdCAzMiBieXRlcyBzdG9yZXMgdGhlIGxlbmd0aCBvZiB0aGUgc2lnbmF0dXJlCgogICAgICAgICAgICBhZGQoc2lnLCAzMikgPSBwb2ludGVyIG9mIHNpZyArIDMyCiAgICAgICAgICAgIGVmZmVjdGl2ZWx5LCBza2lwcyBmaXJzdCAzMiBieXRlcyBvZiBzaWduYXR1cmUKCiAgICAgICAgICAgIG1sb2FkKHApIGxvYWRzIG5leHQgMzIgYnl0ZXMgc3RhcnRpbmcgYXQgdGhlIG1lbW9yeSBhZGRyZXNzIHAgaW50byBtZW1vcnkKICAgICAgICAgICAgKi8KCiAgICAgICAgICAgIC8vIGZpcnN0IDMyIGJ5dGVzLCBhZnRlciB0aGUgbGVuZ3RoIHByZWZpeAogICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWcsIDMyKSkKICAgICAgICAgICAgLy8gc2Vjb25kIDMyIGJ5dGVzCiAgICAgICAgICAgIHMgOj0gbWxvYWQoYWRkKHNpZywgNjQpKQogICAgICAgICAgICAvLyBmaW5hbCBieXRlIChmaXJzdCBieXRlIG9mIHRoZSBuZXh0IDMyIGJ5dGVzKQogICAgICAgICAgICB2IDo9IGJ5dGUoMCwgbWxvYWQoYWRkKHNpZywgOTYpKSkKICAgICAgICB9CgogICAgICAgIC8vIGltcGxpY2l0bHkgcmV0dXJuIChyLCBzLCB2KQogICAgfQp9Cg=="}],UB=`

                    Messages can be signed off chain and then verified on chain using a smart contract.

                    Example using ethers.js

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.26;
                    @@ -11889,7 +11959,7 @@ How to Sign and Verify
                             // implicitly return (r, s, v)
                         }
                     }
                    -
                    `,_G=({prev:s,next:a})=>i.jsx(A,{version:zG,title:DG,description:EG,cyfrinLink:QG,html:UG,prev:s,next:a,codes:TG}),LG="0.8.26",OG="Reading and Writing to a State Variable",PG="Reading and Writing to a State Variable",$G="https://www.cyfrin.io/glossary/reading-and-writing-to-a-state-variable-code-example",qG=[{fileName:"SimpleStorage.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFNpbXBsZVN0b3JhZ2UgewogICAgLy8gU3RhdGUgdmFyaWFibGUgdG8gc3RvcmUgYSBudW1iZXIKICAgIHVpbnQyNTYgcHVibGljIG51bTsKCiAgICAvLyBZb3UgbmVlZCB0byBzZW5kIGEgdHJhbnNhY3Rpb24gdG8gd3JpdGUgdG8gYSBzdGF0ZSB2YXJpYWJsZS4KICAgIGZ1bmN0aW9uIHNldCh1aW50MjU2IF9udW0pIHB1YmxpYyB7CiAgICAgICAgbnVtID0gX251bTsKICAgIH0KCiAgICAvLyBZb3UgY2FuIHJlYWQgZnJvbSBhIHN0YXRlIHZhcmlhYmxlIHdpdGhvdXQgc2VuZGluZyBhIHRyYW5zYWN0aW9uLgogICAgZnVuY3Rpb24gZ2V0KCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBudW07CiAgICB9Cn0K"}],sB=`

                    To write or update a state variable you need to send a transaction.

                    +`,_B=({prev:s,next:a})=>i.jsx(A,{version:zB,title:DB,description:EB,cyfrinLink:QB,html:UB,prev:s,next:a,codes:TB}),LB="0.8.26",OB="Reading and Writing to a State Variable",PB="Reading and Writing to a State Variable",$B="https://www.cyfrin.io/glossary/reading-and-writing-to-a-state-variable-code-example",qB=[{fileName:"SimpleStorage.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFNpbXBsZVN0b3JhZ2UgewogICAgLy8gU3RhdGUgdmFyaWFibGUgdG8gc3RvcmUgYSBudW1iZXIKICAgIHVpbnQyNTYgcHVibGljIG51bTsKCiAgICAvLyBZb3UgbmVlZCB0byBzZW5kIGEgdHJhbnNhY3Rpb24gdG8gd3JpdGUgdG8gYSBzdGF0ZSB2YXJpYWJsZS4KICAgIGZ1bmN0aW9uIHNldCh1aW50MjU2IF9udW0pIHB1YmxpYyB7CiAgICAgICAgbnVtID0gX251bTsKICAgIH0KCiAgICAvLyBZb3UgY2FuIHJlYWQgZnJvbSBhIHN0YXRlIHZhcmlhYmxlIHdpdGhvdXQgc2VuZGluZyBhIHRyYW5zYWN0aW9uLgogICAgZnVuY3Rpb24gZ2V0KCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBudW07CiAgICB9Cn0K"}],sG=`

                    To write or update a state variable you need to send a transaction.

                    On the other hand, you can read state variables, for free, without any transaction fee.

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.26;
                    @@ -11908,7 +11978,7 @@ How to Sign and Verify
                             return num;
                         }
                     }
                    -
                    `,aB=({prev:s,next:a})=>i.jsx(A,{version:LG,title:OG,description:PG,cyfrinLink:$G,html:sB,prev:s,next:a,codes:qG}),nB="0.8.26",lB="Structs",pB="An example of how to use structs in Solidity",eB="https://www.cyfrin.io/glossary/structs-code-example",cB=[{fileName:"StructDeclaration.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKLy8gVGhpcyBpcyBzYXZlZCAnU3RydWN0RGVjbGFyYXRpb24uc29sJwoKc3RydWN0IFRvZG8gewogICAgc3RyaW5nIHRleHQ7CiAgICBib29sIGNvbXBsZXRlZDsKfQo="},{file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bHNlCgogICAgICAgIHRvZG9zLnB1c2godG9kbyk7CiAgICB9CgogICAgLy8gU29saWRpdHkgYXV0b21hdGljYWxseSBjcmVhdGVkIGEgZ2V0dGVyIGZvciAndG9kb3MnIHNvCiAgICAvLyB5b3UgZG9uJ3QgYWN0dWFsbHkgbmVlZCB0aGlzIGZ1bmN0aW9uLgogICAgZnVuY3Rpb24gZ2V0KHVpbnQyNTYgX2luZGV4KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChzdHJpbmcgbWVtb3J5IHRleHQsIGJvb2wgY29tcGxldGVkKQogICAgewogICAgICAgIFRvZG8gc3RvcmFnZSB0b2RvID0gdG9kb3NbX2luZGV4XTsKICAgICAgICByZXR1cm4gKHRvZG8udGV4dCwgdG9kby5jb21wbGV0ZWQpOwogICAgfQoKICAgIC8vIHVwZGF0ZSB0ZXh0CiAgICBmdW5jdGlvbiB1cGRhdGVUZXh0KHVpbnQyNTYgX2luZGV4LCBzdHJpbmcgY2FsbGRhdGEgX3RleHQpIHB1YmxpYyB7CiAgICAgICAgVG9kbyBzdG9yYWdlIHRvZG8gPSB0b2Rvc1tfaW5kZXhdOwogICAgICAgIHRvZG8udGV4dCA9IF90ZXh0OwogICAgfQoKICAgIC8vIHVwZGF0ZSBjb21wbGV0ZWQKICAgIGZ1bmN0aW9uIHRvZ2dsZUNvbXBsZXRlZCh1aW50MjU2IF9pbmRleCkgcHVibGljIHsKICAgICAgICBUb2RvIHN0b3JhZ2UgdG9kbyA9IHRvZG9zW19pbmRleF07CiAgICAgICAgdG9kby5jb21wbGV0ZWQgPSAhdG9kby5jb21wbGV0ZWQ7CiAgICB9Cn0K"}],tB=`

                    You can define your own type by creating a struct.

                    +`,aG=({prev:s,next:a})=>i.jsx(A,{version:LB,title:OB,description:PB,cyfrinLink:$B,html:sG,prev:s,next:a,codes:qB}),nG="0.8.26",lG="Structs",pG="An example of how to use structs in Solidity",eG="https://www.cyfrin.io/glossary/structs-code-example",cG=[{fileName:"StructDeclaration.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKLy8gVGhpcyBpcyBzYXZlZCAnU3RydWN0RGVjbGFyYXRpb24uc29sJwoKc3RydWN0IFRvZG8gewogICAgc3RyaW5nIHRleHQ7CiAgICBib29sIGNvbXBsZXRlZDsKfQo="},{fileName:"StructImport.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9TdHJ1Y3REZWNsYXJhdGlvbi5zb2wiOwoKY29udHJhY3QgVG9kb3MgewogICAgLy8gQW4gYXJyYXkgb2YgJ1RvZG8nIHN0cnVjdHMKICAgIFRvZG9bXSBwdWJsaWMgdG9kb3M7Cn0K"},{fileName:"Structs.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRvZG9zIHsKICAgIHN0cnVjdCBUb2RvIHsKICAgICAgICBzdHJpbmcgdGV4dDsKICAgICAgICBib29sIGNvbXBsZXRlZDsKICAgIH0KCiAgICAvLyBBbiBhcnJheSBvZiAnVG9kbycgc3RydWN0cwogICAgVG9kb1tdIHB1YmxpYyB0b2RvczsKCiAgICBmdW5jdGlvbiBjcmVhdGUoc3RyaW5nIGNhbGxkYXRhIF90ZXh0KSBwdWJsaWMgewogICAgICAgIC8vIDMgd2F5cyB0byBpbml0aWFsaXplIGEgc3RydWN0CiAgICAgICAgLy8gLSBjYWxsaW5nIGl0IGxpa2UgYSBmdW5jdGlvbgogICAgICAgIHRvZG9zLnB1c2goVG9kbyhfdGV4dCwgZmFsc2UpKTsKCiAgICAgICAgLy8ga2V5IHZhbHVlIG1hcHBpbmcKICAgICAgICB0b2Rvcy5wdXNoKFRvZG8oe3RleHQ6IF90Z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iAgICAgICAgdG9kby5jb21wbGV0ZWQgPSAhdG9kby5jb21wbGV0ZWQ7CiAgICB9Cn0K"}],tG=`

                    You can define your own type by creating a struct.

                    They are useful for grouping together related data.

                    Structs can be declared outside of a contract and imported in another contract.

                    // SPDX-License-Identifier: MIT
                    @@ -11982,7 +12052,7 @@ How to Sign and Verify
                         // An array of 'Todo' structs
                         Todo[] public todos;
                     }
                    -
                    `,oB=({prev:s,next:a})=>i.jsx(A,{version:nB,title:lB,description:pB,cyfrinLink:eB,html:tB,prev:s,next:a,codes:cB}),rB="0.8.26",iB="Calling Parent Contracts",gB="An example of calling parent contracts in Solidity",hB="https://www.cyfrin.io/glossary/calling-parent-contracts-code-example",IB=[{fileName:"Super.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIEluaGVyaXRhbmNlIHRyZWUKICAgQQogLyAgXApCICAgQwogXCAvCiAgRAoqLwoKY29udHJhY3QgQSB7CiAgICAvLyBUaGlzIGlzIGNhbGxlZCBhbiBldmVudC4gWW91IGNhbiBlbWl0IGV2ZW50cyBmcm9tIHlvdXIgZnVuY3Rpb24KICAgIC8vIGFuZCB0aGV5IGFyZSBsb2dnZWQgaW50byB0aGUgdHJhbnNhY3Rpb24gbG9nLgogICAgLy8gSW4gb3VyIGNhc2UsIHRoaXMgd2lsbCBiZSB1c2VmdWwgZm9yIHRyYWNpbmcgZnVuY3Rpb24gY2FsbHMuCiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwoKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyB2aXJ0dWFsIHsKICAgICAgICBlbWl0IExvZygiQS5mb28gY2FsbGVkIik7CiAgICB9CgogICAgZnVuY3Rpb24gYmFyKCkgcHVibGljIHZpcnR1YWwgewogICAgICAgIGVtaXQgTG9nKCJBLmJhciBjYWxsZWQiKTsKICAgIH0KfQoKY29udHJhY3QgQiBpcyB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BzdXBlci5mb28oKTsKICAgIH0KCiAgICBmdW5jdGlvbiBiYXIoKSBwdWJsaWMgb3ZlcnJpZGUoQiwgQykgewogICAgICAgIHN1cGVyLmJhcigpOwogICAgfQp9Cg=="}],dB=`

                    Parent contracts can be called directly, or by using the keyword super.

                    +`,oG=({prev:s,next:a})=>i.jsx(A,{version:nG,title:lG,description:pG,cyfrinLink:eG,html:tG,prev:s,next:a,codes:cG}),rG="0.8.26",iG="Calling Parent Contracts",gG="An example of calling parent contracts in Solidity",hG="https://www.cyfrin.io/glossary/calling-parent-contracts-code-example",IG=[{fileName:"Super.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIEluaGVyaXRhbmNlIHRyZWUKICAgQQogLyAgXApCICAgQwogXCAvCiAgRAoqLwoKY29udHJhY3QgQSB7CiAgICAvLyBUaGlzIGlzIGNhbGxlZCBhbiBldmVudC4gWW91IGNhbiBlbWl0IGV2ZW50cyBmcm9tIHlvdXIgZnVuY3Rpb24KICAgIC8vIGFuZCB0aGV5IGFyZSBsb2dnZWQgaW50byB0aGUgdHJhbnNhY3Rpb24gbG9nLgogICAgLy8gSW4gb3VyIGNhc2UsIHRoaXMgd2lsbCBiZSB1c2VmdWwgZm9yIHRyYWNpbmcgZnVuY3Rpb24gY2FsbHMuCiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwoKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyB2aXJ0dWFsIHsKICAgICAgICBlbWl0IExvZygiQS5mb28gY2FsbGVkIik7CiAgICB9CgogICAgZnVuY3Rpb24gYmFyKCkgcHVibGljIHZpcnR1YWwgewogICAgICAgIGVtaXQgTG9nKCJBLmJhciBjYWxsZWQiKTsKICAgIH0KfQoKY29udHJhY3QgQiBpcyBBIHsKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyB2aXJ0dWFsIG92ZXJyaWRlIH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cnJpZGUoQiwgQykgewogICAgICAgIHN1cGVyLmJhcigpOwogICAgfQp9Cg=="}],dG=`

                    Parent contracts can be called directly, or by using the keyword super.

                    By using the keyword super, all of the immediate parent contracts will be called.

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.26;
                    @@ -12050,7 +12120,7 @@ B   C
                             super.bar();
                         }
                     }
                    -
                    `,CB=({prev:s,next:a})=>i.jsx(A,{version:rB,title:iB,description:gB,cyfrinLink:hB,html:dB,prev:s,next:a,codes:IB}),jB="0.8.26",AB="Echidna",uB="An example of testing contracts with Echidna",yB="",mB=[{fileName:"EchidnaTestTimeAndCaller.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCmRvY2tlciBydW4gLWl0IC0tcm0gLXYgJFBXRDovY29kZSB0cmFpbG9mYml0cy9ldGgtc2VjdXJpdHktdG9vbGJveAplY2hpZG5hIEVjaGlkbmFUZXN0VGltZUFuZENhbGxlci5zb2wgLS1jb250cmFjdCBFY2hpZG5hVGVzdFRpbWVBbmRDYWxsZXIKKi8KY29udHJhY3QgRWNoaWRuYVRlc3RUaW1lQW5kQ2FsbGVyIHsKICAgIGJvb2wgcHJpdmF0ZSBwYXNzID0gdHJ1ZTsKICAgIHVpbnQyNTYgcHJpdmF0ZSBjcmVhdGVkQXQgPSBibG9jay50aW1lc3RhbXA7CgogICAgLyoKICAgIHRlc3Qgd2lsbCBmYWlsIGlmIEVjaGlkbmEgY2FuIGNhbGwgc2V0RmFpbCgpCiAgICB0ZXN0IHdpbGwgcGFzcyBvdGhlcndpc2UKICAgICovCiAgICBmdW5jdGlvbiBlY2hpZG5hX3Rlc3RfcGFzcygpIHB1YmxpYyB2aWV3IHJldHVybnMgKGJvb2wpIHsKICAgICAgICByZXR1cm4gcGFzczsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRGYWlsKCkgZXh0ZXJuYWwgewogICAgICAgIC8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ybnMgKGJvb2wpIHsKICAgICAgICAvLyBIZXJlIHdlIGFyZSB0ZXN0aW5nIHRoYXQgQ291bnRlci5jb3VudCBzaG91bGQgYWx3YXlzIGJlIDw9IDUuCiAgICAgICAgLy8gVGVzdCB3aWxsIGZhaWwuIEVjaGlkbmEgaXMgc21hcnQgZW5vdWdoIHRvIGNhbGwgQ291bnRlci5pbmMoKSBtb3JlCiAgICAgICAgLy8gdGhhbiA1IHRpbWVzLgogICAgICAgIHJldHVybiBjb3VudCA8PSA1OwogICAgfQp9CgovKgplY2hpZG5hIFRlc3RFY2hpZG5hLnNvbCAtLWNvbnRyYWN0IFRlc3RBc3NlcnQgLS10ZXN0LW1vZGUgYXNzZXJ0aW9uCiovCmNvbnRyYWN0IFRlc3RBc3NlcnQgewogICAgZnVuY3Rpb24gdGVzdF9hc3NlcnQodWludDI1NiBfaSkgZXh0ZXJuYWwgewogICAgICAgIGFzc2VydChfaSA8IDEwKTsKICAgIH0KCiAgICAvLyBNb3JlIGNvbXBsZXggZXhhbXBsZQogICAgZnVuY3Rpb24gYWJzKHVpbnQyNTYgeCwgdWludDI1NiB5KSBwcml2YXRlIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIGlmICh4ID49IHkpIHsKICAgICAgICAgICAgcmV0dXJuIHggLSB5OwogICAgICAgIH0KICAgICAgICByZXR1cm4geSAtIHg7CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9hYnModWludDI1NiB4LCB1aW50MjU2IHkpIGV4dGVybmFsIHsKICAgICAgICB1aW50MjU2IHogPSBhYnMoeCwgeSk7CiAgICAgICAgaWYgKHggPj0geSkgewogICAgICAgICAgICBhc3NlcnQoeiA8PSB4KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBhc3NlcnQoeiA8PSB5KTsKICAgICAgICB9CiAgICB9Cn0K"}],bB=`

                    Examples of fuzzing with Echidna.

                    +`,CG=({prev:s,next:a})=>i.jsx(A,{version:rG,title:iG,description:gG,cyfrinLink:hG,html:dG,prev:s,next:a,codes:IG}),jG="0.8.26",AG="Echidna",uG="An example of testing contracts with Echidna",yG="",mG=[{fileName:"EchidnaTestTimeAndCaller.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qCmRvY2tlciBydW4gLWl0IC0tcm0gLXYgJFBXRDovY29kZSB0cmFpbG9mYml0cy9ldGgtc2VjdXJpdHktdG9vbGJveAplY2hpZG5hIEVjaGlkbmFUZXN0VGltZUFuZENhbGxlci5zb2wgLS1jb250cmFjdCBFY2hpZG5hVGVzdFRpbWVBbmRDYWxsZXIKKi8KY29udHJhY3QgRWNoaWRuYVRlc3RUaW1lQW5kQ2FsbGVyIHsKICAgIGJvb2wgcHJpdmF0ZSBwYXNzID0gdHJ1ZTsKICAgIHVpbnQyNTYgcHJpdmF0ZSBjcmVhdGVkQXQgPSBibG9jay50aW1lc3RhbXA7CgogICAgLyoKICAgIHRlc3Qgd2lsbCBmYWlsIGlmIEVjaGlkbmEgY2FuIGNhbGwgc2V0RmFpbCgpCiAgICB0ZXN0IHdpbGwgcGFzcyBvdGhlcndpc2UKICAgICovCiAgICBmdW5jdGlvbiBlY2hpZG5hX3Rlc3RfcGFzcygpIHB1YmxpYyB2aWV3IHJldHVybnMgKGJvb2wpIHsKICAgICAgICByZXR1cm4gcGFzczsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRGYWlsKCkgZXh0ZXJuYWwgewogICAgICAgIC8qCiAgICAgICAgRWNoaWRuYSBjYW4gY2FsbCB0aGlzIGZ1bmN0aW9uIGlmIGRlbGF5IDw9IG1heCBibG9jayBkZWxheQogICAgICAgIE90aGVyd2lzZSBFY2hpZG5hIHdpbGwgbm90IGJlIGFibGUgdG8gY2FsbCB0aGlzIGZ1bmN0aW9uLgogICAgICAgIE1heCBibG9jayBkZWxheSBjYW4gYmUgZXh0ZW5kZWQgYnkgc3BlY2lmeWluZyBpdCBpb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ICAgIHJldHVybiBjb3VudCA8PSA1OwogICAgfQp9CgovKgplY2hpZG5hIFRlc3RFY2hpZG5hLnNvbCAtLWNvbnRyYWN0IFRlc3RBc3NlcnQgLS10ZXN0LW1vZGUgYXNzZXJ0aW9uCiovCmNvbnRyYWN0IFRlc3RBc3NlcnQgewogICAgZnVuY3Rpb24gdGVzdF9hc3NlcnQodWludDI1NiBfaSkgZXh0ZXJuYWwgewogICAgICAgIGFzc2VydChfaSA8IDEwKTsKICAgIH0KCiAgICAvLyBNb3JlIGNvbXBsZXggZXhhbXBsZQogICAgZnVuY3Rpb24gYWJzKHVpbnQyNTYgeCwgdWludDI1NiB5KSBwcml2YXRlIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIGlmICh4ID49IHkpIHsKICAgICAgICAgICAgcmV0dXJuIHggLSB5OwogICAgICAgIH0KICAgICAgICByZXR1cm4geSAtIHg7CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9hYnModWludDI1NiB4LCB1aW50MjU2IHkpIGV4dGVybmFsIHsKICAgICAgICB1aW50MjU2IHogPSBhYnMoeCwgeSk7CiAgICAgICAgaWYgKHggPj0geSkgewogICAgICAgICAgICBhc3NlcnQoeiA8PSB4KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBhc3NlcnQoeiA8PSB5KTsKICAgICAgICB9CiAgICB9Cn0K"}],bG=`

                    Examples of fuzzing with Echidna.

                    1. Save the solidity contract as TestEchidna.sol
                    2. In the folder where your contract is stored execute the following command.
                    3. @@ -12182,7 +12252,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller return false; } } -`,wB=({prev:s,next:a})=>i.jsx(A,{version:jB,title:AB,description:uB,cyfrinLink:yB,html:bB,prev:s,next:a,codes:mB}),kB="0.8.26",ZB="Transient Storage",WB="transient storage",GB="https://www.cyfrin.io/glossary/transient-storage-code-example",BB=[{fileName:"TransientStorage.sol",code:"cHJhZ21hIHNvbGlkaXR5IF4wLjguM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ICB0c3RvcmUoU0xPVCwgMzIxKQogICAgICAgIH0KICAgICAgICBieXRlcyBtZW1vcnkgYiA9ICIiOwogICAgICAgIG1zZy5zZW5kZXIuY2FsbChiKTsKICAgIH0KCiAgICBmdW5jdGlvbiB2YWwoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2IHYpIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHYgOj0gdGxvYWQoU0xPVCkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IFJlZW50cmFuY3lHdWFyZCB7CiAgICBib29sIHByaXZhdGUgbG9ja2VkOwoKICAgIG1vZGlmaWVyIGxvY2soKSB7CiAgICAgICAgcmVxdWlyZSghbG9ja2VkKTsKICAgICAgICBsb2NrZWQgPSB0cnVlOwogICAgICAgIF87CiAgICAgICAgbG9ja2VkID0gZmFsc2U7CiAgICB9CgogICAgLy8gMzUzMTMgZ2FzCiAgICBmdW5jdGlvbiB0ZXN0KCkgcHVibGljIGxvY2sgewogICAgICAgIC8vIElnbm9yZSBjYWxsIGVycm9yCiAgICAgICAgYnl0ZXMgbWVtb3J5IGIgPSAiIjsKICAgICAgICBtc2cuc2VuZGVyLmNhbGwoYik7CiAgICB9Cn0KCmNvbnRyYWN0IFJlZW50cmFuY3lHdWFyZFRyYW5zaWVudCB7CiAgICBieXRlczMyIGNvbnN0YW50IFNMT1QgPSAwOwoKICAgIG1vZGlmaWVyIGxvY2soKSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBpZiB0bG9hZChTTE9UKSB7IHJldmVydCgwLCAwKSB9CiAgICAgICAgICAgIHRzdG9yZShTTE9ULCAxKQogICAgICAgIH0KICAgICAgICBfOwogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgdHN0b3JlKFNMT1QsIDApCiAgICAgICAgfQogICAgfQoKICAgIC8vIDIxODg3IGdhcwogICAgZnVuY3Rpb24gdGVzdCgpIGV4dGVybmFsIGxvY2sgewogICAgICAgIC8vIElnbm9yZSBjYWxsIGVycm9yCiAgICAgICAgYnl0ZXMgbWVtb3J5IGIgPSAiIjsKICAgICAgICBtc2cuc2VuZGVyLmNhbGwoYik7CiAgICB9Cn0K"}],fB=`

                      Data stored in transient storage is cleared out after transaction.

                      +`,wG=({prev:s,next:a})=>i.jsx(A,{version:jG,title:AG,description:uG,cyfrinLink:yG,html:bG,prev:s,next:a,codes:mG}),kG="0.8.26",ZG="Transient Storage",WG="transient storage",BG="https://www.cyfrin.io/glossary/transient-storage-code-example",GG=[{fileName:"TransientStorage.sol",code:"cHJhZ21hIHNvbGlkaXR5IF4wLjguMjY7CgovLyBNYWtlIHN1cmUgRVZNIHZlcnNpb24gYW5kIFZNIHNldCB0byBDYW5jdW4KCi8vIFN0b3JhZ2UgLSBkYXRhIGlzIHN0b3JlZCBvbiB0aGUgYmxvY2tjaGFpbgovLyBNZW1vcnkgLSBkYXRhIGlzIGNsZWFyZWQgb3V0IGFmdGVyIGEgZnVuY3Rpb24gY2FsbAovLyBUcmFuc2llbnQgc3RvcmFnZSAtIGRhdGEgaXMgY2xlYXJlZCBvdXQgYWZ0ZXIgYSB0cmFuc2FjdGlvbgoKaW50ZXJmYWNlIElUZXN0IHsKICAgIGZ1bmN0aW9uIHZhbCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiB0ZXN0KCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IENhbGxiYWNrIHsKICAgIHVpbnQyNTYgcHVibGljIHZhbDsKCiAgICBmYWxsYmFjaygpIGV4dGVybmFsIHsKICAgICAgICB2YWwgPSBJVGVzdChtc2cuc2VuZGVyKS52YWwoKTsKICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0KGFkZHJlc3MgdGFyZ2V0KSBleHRlcm5hbCB7CiAgICAgICAgSVRlc3QodGFyZ2V0KS50ZXN0KCk7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RTdG9yYWdlIHsKICA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N0YW50IFNMT1QgPSAwOwoKICAgIG1vZGlmaWVyIGxvY2soKSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBpZiB0bG9hZChTTE9UKSB7IHJldmVydCgwLCAwKSB9CiAgICAgICAgICAgIHRzdG9yZShTTE9ULCAxKQogICAgICAgIH0KICAgICAgICBfOwogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgdHN0b3JlKFNMT1QsIDApCiAgICAgICAgfQogICAgfQoKICAgIC8vIDIxODg3IGdhcwogICAgZnVuY3Rpb24gdGVzdCgpIGV4dGVybmFsIGxvY2sgewogICAgICAgIC8vIElnbm9yZSBjYWxsIGVycm9yCiAgICAgICAgYnl0ZXMgbWVtb3J5IGIgPSAiIjsKICAgICAgICBtc2cuc2VuZGVyLmNhbGwoYik7CiAgICB9Cn0K"}],fG=`

                      Data stored in transient storage is cleared out after transaction.

                      pragma solidity ^0.8.26;
                       
                       // Make sure EVM version and VM set to Cancun
                      @@ -12275,7 +12345,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                               msg.sender.call(b);
                           }
                       }
                      -
                      `,VB=({prev:s,next:a})=>i.jsx(A,{version:kB,title:ZB,description:WB,cyfrinLink:GB,html:fB,prev:s,next:a,codes:BB}),YB="0.8.26",XB="Try Catch",vB="An example of try / catch in Solidity",RB="https://www.cyfrin.io/glossary/try-catch-code-example",NB=[{fileName:"TryCatch.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIEV4dGVybmFsIGNvbnRyYWN0IHVzZWQgZm9yIHRyeSAvIGNhdGNoIGV4YW1wbGVzCmNvbnRyYWN0IEZvbyB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICBjb25zdHJ1Y3RvcihhZGRyZXNzIF9vd25lcikgewogICAgICAgIHJlcXVpcmUoX293bmVyICE9IGFkZHJlc3MoMC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kKICAgICAgICAgICAgZW1pdCBMb2dCeXRlcyhyZWFzb24pOwogICAgICAgIH0KICAgIH0KfQo="}],HB=`

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

                      +`,VG=({prev:s,next:a})=>i.jsx(A,{version:kG,title:ZG,description:WG,cyfrinLink:BG,html:fG,prev:s,next:a,codes:GG}),YG="0.8.26",XG="Try Catch",vG="An example of try / catch in Solidity",RG="https://www.cyfrin.io/glossary/try-catch-code-example",NG=[{fileName:"TryCatch.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIEV4dGVybmFsIGNvbnRyYWN0IHVzZWQgZm9yIHRyeSAvIGNhdGNoIGV4YW1wbGVzCmNvbnRyYWN0IEZvbyB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICBjb25zdHJ1Y3RvcihhZGRyZXNzIF9vd25lcikgewogICAgICAgIHJlcXVpcmUoX293bmVyICE9IGFkZHJlc3MoMCksICJpbnZhbGlkIGFkZHJlc3MiKTsKICAgICAgICBhc3NlcnQoX293bmVyICE9IDB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMSk7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICB9CgogICAgZnVuY3Rpb24gbXlGdW5jKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJlcXVpcmUoeCAhPSAwLCAicmVxdWlyZSBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gIm15IGZ1bmMgd2FzIGNhbGxlZCI7CiAgICB9Cn0KCmNvbnRyYWN0IEJhciB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwogICAgZXZlbnQgTG9nQnl0ZXMoYnl0ZXMgZGF0YSk7CgogICAgRm9vIHB1YmxpYyBmb287CgogICAgY29uc3RydWN0b3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MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDIpID0+IExvZygiRm9vIGNyZWF0ZWQiKQogICAgZnVuY3Rpb24gdHJ5Q2F0Y2hOZXdDb250cmFjdChhZGRyZXNzIF9vd25lcikgcHVibGljIHsKICAgICAgICB0cnkgbmV3IEZvbyhfb3duZXIpIHJldHVybnMgKEZvbyBmb28pIHsKICAgICAgICAgICAgLy8geW91IGNhbiB1c2UgdmFyaWFibGUgZm9vIGhlcmUKICAgICAgICAgICAgZW1pdCBMb2coIkZvbyBjcmVhdGVkIik7CiAgICAgICAgfSBjYXRjaCBFcnJvcihzdHJpbmcgbWVtb3J5IHJlYXNvbikgewogICAgICAgICAgICAvLyBjYXRjaCBmYWlsaW5nIHJldmVydCgpIGFuZCByZXF1aXJlKCkKICAgICAgICAgICAgZW1pdCBMb2cocmVhc29uKTsKICAgICAgICB9IGNhdGNoIChieXRlcyBtZW1vcnkgcmVhc29uKSB7CiAgICAgICAgICAgIC8vIGNhdGNoIGZhaWxpbmcgYXNzZXJ0KCkKICAgICAgICAgICAgZW1pdCBMb2dCeXRlcyhyZWFzb24pOwogICAgICAgIH0KICAgIH0KfQo="}],HG=`

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

                      // SPDX-License-Identifier: MIT
                       pragma solidity ^0.8.26;
                       
                      @@ -12334,7 +12404,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                               }
                           }
                       }
                      -
                      `,FB=({prev:s,next:a})=>i.jsx(A,{version:YB,title:XB,description:vB,cyfrinLink:RB,html:HB,prev:s,next:a,codes:NB}),KB="0.8.26",MB="Unchecked Math",SB="An example of unchecked math in Solidity",xB="https://www.cyfrin.io/glossary/unchecked-math-code-example",JB=[{fileName:"UncheckedMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFVuY2hlY2tlZE1hdGggewogICAgZnVuY3Rpb24gYWRkKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjI5MSBnYXMKICAgICAgICAvLyByZXR1cm4geCArIHk7CgogICAgICAgIC8vIDIyMTAzIGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4ICsgeTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3ViKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjMyOSBnYXMKICAgICAgICAvLyByZXR1cm4geCAtIHk7CgogICAgICAgIC8vIDIyMTQ3IGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4IC0geTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3VtT2ZDdWJlcyh1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgLy8gV3JhcCBjb21wbGV4IG1hdGggbG9naWMgaW5zaWRlIHVuY2hlY2tlZAogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHVpbnQyNTYgeDMgPSB4ICogeCAqIHg7CiAgICAgICAgICAgIHVpbnQyNTYgeTMgPSB5ICogeSAqIHk7CgogICAgICAgICAgICByZXR1cm4geDMgKyB5MzsKICAgICAgICB9CiAgICB9Cn0K"}],zB=`

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

                      +`,FG=({prev:s,next:a})=>i.jsx(A,{version:YG,title:XG,description:vG,cyfrinLink:RG,html:HG,prev:s,next:a,codes:NG}),KG="0.8.26",MG="Unchecked Math",SG="An example of unchecked math in Solidity",xG="https://www.cyfrin.io/glossary/unchecked-math-code-example",JG=[{fileName:"UncheckedMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFVuY2hlY2tlZE1hdGggewogICAgZnVuY3Rpb24gYWRkKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjI5MSBnYXMKICAgICAgICAvLyByZXR1cm4geCArIHk7CgogICAgICAgIC8vIDIyMTAzIGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4ICsgeTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3ViKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjMyOSBnYXMKICAgICAgICAvLyByZXR1cm4geCAtIHk7CgogICAgICAgIC8vIDIyMTQ3IGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4IC0geTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3VtT2ZDdWJlcyh1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgLy8gV3JhcCBjb21wbGV4IG1hdGggbG9naWMgaW5zaWRlIHVuY2hlY2tlZAogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHVpbnQyNTYgeDMgPSB4ICogeCAqIHg7CiAgICAgICAgICAgIHVpbnQyNTYgeTMgPSB5ICogeSAqIHk7CgogICAgICAgICAgICByZXR1cm4geDMgKyB5MzsKICAgICAgICB9CiAgICB9Cn0K"}],zG=`

                      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;
                      @@ -12370,7 +12440,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                               }
                           }
                       }
                      -
                      `,DB=({prev:s,next:a})=>i.jsx(A,{version:KB,title:MB,description:SB,cyfrinLink:xB,html:zB,prev:s,next:a,codes:JB}),EB="0.8.26",QB="User Defined Value Types",TB="User defined value types",UB="https://www.cyfrin.io/glossary/user-defined-value-types-code-example",_B=[{fileName:"UserDefinedValueTypes.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIENvZGUgY29waWVkIGZyb20gb3B0aW1pc20KLy8gaHR0cHM6Ly9naXRodWIuY29tL2V0aGVyZXVtLW9wdGltaXNtL29wdGltaXNtL2Jsb2IvZGV2ZWxvcC9wYWNrYWdlcy9jb250cmFjdHMtYmVkcm9jay9zcmMvZGlzcHV0ZS9saWIvTGliVURULnNvbAoKdHlwZSBEdXJhdGlvbiBpcyB1aW50NjQ7Cgp0eXBlIFRpbWVzdGFtcCBpcyB1aW50NjQ7Cgp0eXBlIENsb2NrIGlzIHVpbnQxMjg7CgpsaWJyYXJ5IExpYkNsb2NrIHsKICAgIGZ1bmN0aW9uIHdyYXAoRHVyYXRpb24gX2R1cmF0aW9uLCBUaW1lc3RhbXAgX3RpbWVzdGFtcCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChDbG9jayBjbG9ja18pCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBkYXRhIHwgRHVyYXRpb24gfCBUaW1lc3RhbXAKICAgICAgICAgICAgLy8gYml0ICB8IDAgLi4uIDYzIHwgNjQgLi4uIDEyNwogICAgICAgICAgICBjbG9ja18gOj0gb3Ioc2hsKDB4NDAsIF9kdXJhdGlvbiksIF90aW1lc3RhbXApCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIGR1cmF0aW9uKENsb2NrIF9jbG9jaykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChEdXJhdGlvbiBkdXJhdGlvbl8pCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBkdXJhdGlvbl8gOj0gc2hyKDB4NDAsIF9jbG9jaykKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGltZXN0YW1wKENsb2NrIF9jbG9jaykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChUaW1lc3RhbXAgdGltZXN0YW1wXykKICAgIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHRpbWVzdGFtcF8gOj0gc2hyKDB4QzAsIHNobCgweEMwLCBfY2xvY2spKQogICAgICAgIH0KICAgIH0KfQoKLy8gQ2xvY2sgbGlicmFyeSB3aXRob3V0IHVzZXIgZGVmaW5lZCB2YWx1ZSB0eXBlCmxpYnJhcnkgTGliQ2xvY2tCYXNpYyB7CiAgICBmdW5jdGlvbiB3cmFwKHVpbnQ2NCBfZHVyYXRpb24sIHVpbnQ2NCBfdGltZXN0YW1wKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQxMjggY2xvY2spCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBjbG9jayA6PSBvcihzaGwoMHg0MCwgX2R1cmF0aW9uKSwgX3RpbWVzdGFtcCkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IEV4YW1wbGVzIHsKICAgIGZ1bmN0aW9uIGV4YW1wbGVfbm9fdXZkdCgpIGV4dGVybmFsIHZpZXcgewogICAgICAgIC8vIFdpdGhvdXQgVURWVAogICAgICAgIHVpbnQxMjggY2xvY2s7CiAgICAgICAgdWludDY0IGQgPSAxOwogICAgICAgIHVpbnQ2NCB0ID0gdWludDY0KGJsb2NrLnRpbWVzdGFtcCk7CiAgICAgICAgY2xvY2sgPSBMaWJDbG9ja0Jhc2ljLndyYXAoZCwgdCk7CiAgICAgICAgLy8gT29wcyEgd3Jvbmcgb3JkZXIgb2YgaW5wdXRzIGJ1dCBzdGlsbCBjb21waWxlcwogICAgICAgIGNsb2NrID0gTGliQ2xvY2tCYXNpYy53cmFwKHQsIGQpOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4YW1wbGVfdXZkdCgpIGV4dGVybmFsIHZpZXcgewogICAgICAgIC8vIFR1cm4gdmFsdWUgdHlwZSBpbnRvIHVzZXIgZGVmaW5lZCB2YWx1ZSB0eXBlCiAgICAgICAgRHVyYXRpb24gZCA9IER1cmF0aW9uLndyYXAoMSk7CiAgICAgICAgVGltZXN0YW1wIHQgPSBUaW1lc3RhbXAud3JhcCh1aW50NjQoYmxvY2sudGltZXN0YW1wKSk7CiAgICAgICAgLy8gVHVybiB1c2VyIGRlZmluZWQgdmFsdWUgdHlwZSBiYWNrIGludG8gcHJpbWl0aXZlIHZhbHVlIHR5cGUKICAgICAgICB1aW50NjQgZF91NjQgPSBEdXJhdGlvbi51bndyYXAoZCk7CiAgICAgICAgdWludDY0IHRfdTU0ID0gVGltZXN0YW1wLnVud3JhcCh0KTsKCiAgICAgICAgLy8gTGliQ2xvY2sgZXhhbXBsZQogICAgICAgIENsb2NrIGNsb2NrID0gQ2xvY2sud3JhcCgwKTsKICAgICAgICBjbG9jayA9IExpYkNsb2NrLndyYXAoZCwgdCk7CiAgICAgICAgLy8gT29wcyEgd3Jvbmcgb3JkZXIgb2YgaW5wdXRzCiAgICAgICAgLy8gVGhpcyB3aWxsIG5vdCBjb21waWxlCiAgICAgICAgLy8gY2xvY2sgPSBMaWJDbG9jay53cmFwKHQsIGQpOwogICAgfQp9Cg=="}],LB=`
                      // SPDX-License-Identifier: MIT
                      +
                      `,DG=({prev:s,next:a})=>i.jsx(A,{version:KG,title:MG,description:SG,cyfrinLink:xG,html:zG,prev:s,next:a,codes:JG}),EG="0.8.26",QG="User Defined Value Types",TG="User defined value types",UG="https://www.cyfrin.io/glossary/user-defined-value-types-code-example",_G=[{fileName:"UserDefinedValueTypes.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIENvZGUgY29waWVkIGZyb20gb3B0aW1pc20KLy8gaHR0cHM6Ly9naXRodWIuY29tL2V0aGVyZXVtLW9wdGltaXNtL29wdGltaXNtL2Jsb2IvZGV2ZWxvcC9wYWNrYWdlcy9jb250cmFjdHMtYmVkcm9jay9zcmMvZGlzcHV0ZS9saWIvTGliVURULnNvbAoKdHlwZSBEdXJhdGlvbiBpcyB1aW50NjQ7Cgp0eXBlIFRpbWVzdGFtcCBpcyB1aW50NjQ7Cgp0eXBlIENsb2NrIGlzIHVpbnQxMjg7CgpsaWJyYXJ5IExpYkNsb2NrIHsKICAgIGZ1bmN0aW9uIHdyYXAoRHVyYXRpb24gX2R1cmF0aW9uLCBUaW1lc3RhbXAgX3RpbWVzdGFtcCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChDbG9jayBjbG9ja18pCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBkYXRhIHwgRHVyYXRpb24gfCBUaW1lc3RhbXAKICAgICAgICAgICAgLy8gYml0ICB8IDAgLi4uIDYzIHwgNjQgLi4uIDEyNwogICAgICAgICAgICBjbG9ja18gOj0gb3Ioc2hsKDB4NDAsIF9kdXJhdGlvbiksIF90aW1lc3RhbXApCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIGR1cmF0aW9uKENsb2NrIF9jbG9jaykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChEdXJhdGlvbiBkdXJhdGlvbl8pCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBkdXJhdGlvbl8gOj0gc2hyKDB4ND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QsIGQpOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4YW1wbGVfdXZkdCgpIGV4dGVybmFsIHZpZXcgewogICAgICAgIC8vIFR1cm4gdmFsdWUgdHlwZSBpbnRvIHVzZXIgZGVmaW5lZCB2YWx1ZSB0eXBlCiAgICAgICAgRHVyYXRpb24gZCA9IER1cmF0aW9uLndyYXAoMSk7CiAgICAgICAgVGltZXN0YW1wIHQgPSBUaW1lc3RhbXAud3JhcCh1aW50NjQoYmxvY2sudGltZXN0YW1wKSk7CiAgICAgICAgLy8gVHVybiB1c2VyIGRlZmluZWQgdmFsdWUgdHlwZSBiYWNrIGludG8gcHJpbWl0aXZlIHZhbHVlIHR5cGUKICAgICAgICB1aW50NjQgZF91NjQgPSBEdXJhdGlvbi51bndyYXAoZCk7CiAgICAgICAgdWludDY0IHRfdTU0ID0gVGltZXN0YW1wLnVud3JhcCh0KTsKCiAgICAgICAgLy8gTGliQ2xvY2sgZXhhbXBsZQogICAgICAgIENsb2NrIGNsb2NrID0gQ2xvY2sud3JhcCgwKTsKICAgICAgICBjbG9jayA9IExpYkNsb2NrLndyYXAoZCwgdCk7CiAgICAgICAgLy8gT29wcyEgd3Jvbmcgb3JkZXIgb2YgaW5wdXRzCiAgICAgICAgLy8gVGhpcyB3aWxsIG5vdCBjb21waWxlCiAgICAgICAgLy8gY2xvY2sgPSBMaWJDbG9jay53cmFwKHQsIGQpOwogICAgfQp9Cg=="}],LG=`
                      // SPDX-License-Identifier: MIT
                       pragma solidity ^0.8.26;
                       
                       // Code copied from optimism
                      @@ -12456,7 +12526,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                               // clock = LibClock.wrap(t, d);
                           }
                       }
                      -
                      `,OB=({prev:s,next:a})=>i.jsx(A,{version:EB,title:QB,description:TB,cyfrinLink:UB,html:LB,prev:s,next:a,codes:_B}),PB="0.8.26",$B="Variables",qB="Local, state and global variables",sf="https://www.cyfrin.io/glossary/variables-code-example",af=[{fileName:"Variables.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFZhcmlhYmxlcyB7CiAgICAvLyBTdGF0ZSB2YXJpYWJsZXMgYXJlIHN0b3JlZCBvbiB0aGUgYmxvY2tjaGFpbi4KICAgIHN0cmluZyBwdWJsaWMgdGV4dCA9ICJIZWxsbyI7CiAgICB1aW50MjU2IHB1YmxpYyBudW0gPSAxMjM7CgogICAgZnVuY3Rpb24gZG9Tb21ldGhpbmcoKSBwdWJsaWMgewogICAgICAgIC8vIExvY2FsIHZhcmlhYmxlcyBhcmUgbm90IHNhdmVkIHRvIHRoZSBibG9ja2NoYWluLgogICAgICAgIHVpbnQyNTYgaSA9IDQ1NjsKCiAgICAgICAgLy8gSGVyZSBhcmUgc29tZSBnbG9iYWwgdmFyaWFibGVzCiAgICAgICAgdWludDI1NiB0aW1lc3RhbXAgPSBibG9jay50aW1lc3RhbXA7IC8vIEN1cnJlbnQgYmxvY2sgdGltZXN0YW1wCiAgICAgICAgYWRkcmVzcyBzZW5kZXIgPSBtc2cuc2VuZGVyOyAvLyBhZGRyZXNzIG9mIHRoZSBjYWxsZXIKICAgIH0KfQo="}],nf=`

                      There are 3 types of variables in Solidity

                      +`,OG=({prev:s,next:a})=>i.jsx(A,{version:EG,title:QG,description:TG,cyfrinLink:UG,html:LG,prev:s,next:a,codes:_G}),PG="0.8.26",$G="Variables",qG="Local, state and global variables",sf="https://www.cyfrin.io/glossary/variables-code-example",af=[{fileName:"Variables.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFZhcmlhYmxlcyB7CiAgICAvLyBTdGF0ZSB2YXJpYWJsZXMgYXJlIHN0b3JlZCBvbiB0aGUgYmxvY2tjaGFpbi4KICAgIHN0cmluZyBwdWJsaWMgdGV4dCA9ICJIZWxsbyI7CiAgICB1aW50MjU2IHB1YmxpYyBudW0gPSAxMjM7CgogICAgZnVuY3Rpb24gZG9Tb21ldGhpbmcoKSBwdWJsaWMgewogICAgICAgIC8vIExvY2FsIHZhcmlhYmxlcyBhcmUgbm90IHNhdmVkIHRvIHRoZSBibG9ja2NoYWluLgogICAgICAgIHVpbnQyNTYgaSA9IDQ1NjsKCiAgICAgICAgLy8gSGVyZSBhcmUgc29tZSBnbG9iYWwgdmFyaWFibGVzCiAgICAgICAgdWludDI1NiB0aW1lc3RhbXAgPSBibG9jay50aW1lc3RhbXA7IC8vIEN1cnJlbnQgYmxvY2sgdGltZXN0YW1wCiAgICAgICAgYWRkcmVzcyBzZW5kZXIgPSBtc2cuc2VuZGVyOyAvLyBhZGRyZXNzIG9mIHRoZSBjYWxsZXIKICAgIH0KfQo="}],nf=`

                      There are 3 types of variables in Solidity

                      • local
                        • declared inside a function
                        • @@ -12487,7 +12557,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller address sender = msg.sender; // address of the caller } } -`,lf=({prev:s,next:a})=>i.jsx(A,{version:PB,title:$B,description:qB,cyfrinLink:sf,html:nf,prev:s,next:a,codes:af}),pf="0.8.26",ef="View and Pure Functions",cf="An example of view and pure functions in Solidity",tf="https://www.cyfrin.io/glossary/view-and-pure-functions-code-example",of=[{fileName:"ViewAndPureFunctions.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFZpZXdBbmRQdXJlIHsKICAgIHVpbnQyNTYgcHVibGljIHggPSAxOwoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSB0aGUgc3RhdGUuCiAgICBmdW5jdGlvbiBhZGRUb1godWludDI1NiB5KSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHggKyB5OwogICAgfQoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSBvciByZWFkIGZyb20gdGhlIHN0YXRlLgogICAgZnVuY3Rpb24gYWRkKHVpbnQyNTYgaSwgdWludDI1NiBqKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGkgKyBqOwogICAgfQp9Cg=="}],rf=`

                          Getter functions can be declared view or pure.

                          +`,lf=({prev:s,next:a})=>i.jsx(A,{version:PG,title:$G,description:qG,cyfrinLink:sf,html:nf,prev:s,next:a,codes:af}),pf="0.8.26",ef="View and Pure Functions",cf="An example of view and pure functions in Solidity",tf="https://www.cyfrin.io/glossary/view-and-pure-functions-code-example",of=[{fileName:"ViewAndPureFunctions.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFZpZXdBbmRQdXJlIHsKICAgIHVpbnQyNTYgcHVibGljIHggPSAxOwoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSB0aGUgc3RhdGUuCiAgICBmdW5jdGlvbiBhZGRUb1godWludDI1NiB5KSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHggKyB5OwogICAgfQoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSBvciByZWFkIGZyb20gdGhlIHN0YXRlLgogICAgZnVuY3Rpb24gYWRkKHVpbnQyNTYgaSwgdWludDI1NiBqKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGkgKyBqOwogICAgfQp9Cg=="}],rf=`

                          Getter functions can be declared view or pure.

                          View function declares that no state will be changed.

                          Pure function declares that no state variable will be changed or read.

                          // SPDX-License-Identifier: MIT
                          @@ -12581,4 +12651,4 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                   return internalFunc();
                               }
                           }
                          -
                          `,uf=({prev:s,next:a})=>i.jsx(A,{version:hf,title:If,description:df,cyfrinLink:Cf,html:Af,prev:s,next:a,codes:jf}),yf=({size:s,className:a=""})=>i.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:i.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"})}),mf="_component_efeb7_1",bf="_icon_efeb7_8",wf="_input_efeb7_12",Ie={component:mf,icon:bf,input:wf},kf=({value:s,onChange:a})=>{function n(l){a(l.target.value)}return i.jsxs("div",{className:Ie.component,children:[i.jsx(yf,{size:18,className:Ie.icon}),i.jsx("input",{className:Ie.input,placeholder:"Search",value:s,onChange:n})]})};var Zf="Expected a function",Xo=NaN,Wf="[object Symbol]",Gf=/^\s+|\s+$/g,Bf=/^[-+]0x[0-9a-f]+$/i,ff=/^0b[01]+$/i,Vf=/^0o[0-7]+$/i,Yf=parseInt,Xf=typeof Il=="object"&&Il&&Il.Object===Object&&Il,vf=typeof self=="object"&&self&&self.Object===Object&&self,Rf=Xf||vf||Function("return this")(),Nf=Object.prototype,Hf=Nf.toString,Ff=Math.max,Kf=Math.min,de=function(){return Rf.Date.now()};function Mf(s,a,n){var l,p,e,c,t,o,r=0,I=!1,d=!1,j=!0;if(typeof s!="function")throw new TypeError(Zf);a=vo(a)||0,gc(n)&&(I=!!n.leading,d="maxWait"in n,e=d?Ff(vo(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,r=k,c=s.apply(Y,B),c}function m(k){return r=k,t=setTimeout(h,a),I?u(k):c}function b(k){var B=k-o,Y=k-r,x=a-B;return d?Kf(x,e-Y):x}function G(k){var B=k-o,Y=k-r;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),r=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 Sf(s){return!!s&&typeof s=="object"}function xf(s){return typeof s=="symbol"||Sf(s)&&Hf.call(s)==Wf}function vo(s){if(typeof s=="number")return s;if(xf(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(Gf,"");var n=ff.test(s);return n||Vf.test(s)?Yf(s.slice(2),n?2:8):Bf.test(s)?Xo:+s}var Jf=Mf;const zf=Ko(Jf),Df={leading:!1,trailing:!0};function Ef(s,a,n){return W.useCallback(zf(s,a,Df),n)}function Qf(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 r=0;ra+p)}const _f=["/visibility"],Lf=["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],Of=["/visibility"],Pf=["/visibility","/hacks/hiding-malicious-code-with-external-contract"],$f=["/view-and-pure-functions"],qf=["/view-and-pure-functions"],sV=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/evm/storage","/ether-units","/enum","/constants","/assembly-variable","/array"],aV=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/ether-units","/enum","/constants","/array"],nV=["/variables"],lV=["/variables"],pV=["/variables","/state-variables","/shadowing-inherited-state-variables","/evm/storage"],eV=["/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"],cV=["/user-defined-value-types"],tV=["/user-defined-value-types"],oV=["/user-defined-value-types"],rV=["/user-defined-value-types","/structs","/primitives"],iV=["/user-defined-value-types"],gV=["/unchecked-math","/gas-golf","/gas"],hV=["/unchecked-math"],IV=["/unchecked-math","/assembly-math","/app/assembly-bin-exp"],dV=["/unchecked-math","/hacks/overflow"],CV=["/unchecked-math","/hacks/overflow"],jV=["/try-catch","/error","/assembly-error"],AV=["/try-catch","/error"],uV=["/transient-storage"],yV=["/transient-storage","/hacks/accessing-private-data","/evm/storage","/data-locations","/app/write-to-any-slot"],mV=["/tests/echidna"],bV=["/tests/echidna"],wV=["/super","/calling-contract"],kV=["/super"],ZV=["/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"],WV=["/super","/new-contract","/interface","/inheritance","/first-app","/delegatecall","/calling-contract","/call"],GV=["/super","/shadowing-inherited-state-variables","/inheritance","/constructor"],BV=["/structs"],fV=["/structs"],VV=["/structs","/primitives"],YV=["/state-variables"],XV=["/state-variables"],vV=["/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"],RV=["/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"],NV=["/signature","/hashing","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/merkle-tree","/app/bi-directional-payment-channel"],HV=["/signature"],FV=["/signature"],KV=["/signature","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/multi-sig-wallet","/app/bi-directional-payment-channel"],MV=["/signature"],SV=["/signature"],xV=["/shadowing-inherited-state-variables"],JV=["/shadowing-inherited-state-variables"],zV=["/sending-ether"],DV=["/sending-ether","/sending-ether","/payable","/fallback"],EV=["/sending-ether","/payable","/fallback","/ether-units","/app/ether-wallet"],QV=["/sending-ether","/payable","/fallback","/app/ether-wallet"],TV=["/sending-ether","/fallback","/app/gasless-token-transfer"],UV=["/sending-ether","/delegatecall","/calling-contract","/call","/app/multi-call"],_V=["/sending-ether","/fallback"],LV=["/sending-ether","/fallback"],OV=["/sending-ether","/payable","/fallback"],PV=["/primitives"],$V=["/primitives"],qV=["/primitives"],s1=["/primitives"],a1=["/primitives"],n1=["/primitives","/hacks/deploy-different-contracts-same-address","/app/create2"],l1=["/primitives"],p1=["/primitives"],e1=["/new-contract","/hacks/deploy-different-contracts-same-address"],c1=["/new-contract"],t1=["/new-contract","/hacks/deploy-different-contracts-same-address","/app/create2"],o1=["/new-contract","/hacks/deploy-different-contracts-same-address"],r1=["/mapping","/app/iterable-mapping"],i1=["/loop","/assembly-loop"],g1=["/loop"],h1=["/library"],I1=["/interface"],d1=["/inheritance"],C1=["/inheritance"],j1=["/inheritance"],A1=["/immutable","/defi/constant-sum-amm","/defi/constant-product-amm","/constants"],u1=["/immutable","/constants"],y1=["/immutable"],m1=["/immutable"],b1=["/if-else"],w1=["/if-else"],k1=["/if-else"],Z1=["/hello-world"],W1=["/hello-world"],G1=["/hashing"],B1=["/hashing"],f1=["/hashing"],V1=["/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"],Y1=["/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"],X1=["/hacks/weth-permit"],v1=["/hacks/weth-permit","/app/gasless-token-transfer"],R1=["/hacks/vault-inflation"],N1=["/hacks/vault-inflation"],H1=["/hacks/vault-inflation","/defi/vault"],F1=["/hacks/signature-replay"],K1=["/hacks/self-destruct"],M1=["/hacks/randomness"],S1=["/hacks/randomness"],x1=["/hacks/randomness"],J1=["/hacks/randomness"],z1=["/hacks/randomness","/hacks/block-timestamp-manipulation"],D1=["/hacks/randomness","/hacks/block-timestamp-manipulation"],E1=["/hacks/phishing-with-tx-origin"],Q1=["/hacks/overflow"],T1=["/hacks/honeypot"],U1=["/hacks/hiding-malicious-code-with-external-contract"],_1=["/hacks/hiding-malicious-code-with-external-contract"],L1=["/hacks/hiding-malicious-code-with-external-contract"],O1=["/hacks/hiding-malicious-code-with-external-contract"],P1=["/hacks/front-running"],$1=["/hacks/front-running"],q1=["/hacks/deploy-different-contracts-same-address","/app/deploy-any-contract"],sY=["/hacks/deploy-different-contracts-same-address"],aY=["/hacks/deploy-different-contracts-same-address"],nY=["/hacks/denial-of-service"],lY=["/hacks/denial-of-service"],pY=["/hacks/delegatecall","/delegatecall","/app/upgradeable-proxy","/app/multi-delegatecall"],eY=["/hacks/contract-size"],cY=["/hacks/contract-size"],tY=["/hacks/contract-size"],oY=["/hacks/contract-size"],rY=["/hacks/block-timestamp-manipulation"],iY=["/hacks/accessing-private-data"],gY=["/hacks/accessing-private-data"],hY=["/gas-golf"],IY=["/function-selector"],dY=["/function-selector"],CY=["/function-modifier"],jY=["/function-modifier"],AY=["/function-modifier"],uY=["/first-app"],yY=["/first-app"],mY=["/evm/storage","/evm/memory"],bY=["/evm/storage","/evm/memory","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],wY=["/evm/storage","/evm/memory","/bitwise","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],kY=["/evm/memory","/data-locations"],ZY=["/events-advanced","/events"],WY=["/events-advanced"],GY=["/events-advanced"],BY=["/events-advanced"],fY=["/events"],VY=["/ether-units"],YY=["/ether-units"],XY=["/error"],vY=["/error","/assembly-error"],RY=["/error"],NY=["/enum"],HY=["/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"],FY=["/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"],KY=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash"],MY=["/defi/uniswap-v3-swap","/defi/uniswap-v3-flash-swap","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2","/defi/stable-swap-amm"],SY=["/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"],xY=["/defi/uniswap-v3-liquidity","/defi/uniswap-v2-add-remove-liquidity"],JY=["/defi/uniswap-v3-flash-swap"],zY=["/defi/uniswap-v3-flash","/defi/uniswap-v2-flash-swap"],DY=["/defi/uniswap-v3-flash"],EY=["/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2"],QY=["/defi/uniswap-v2-optimal-one-sided-supply"],TY=["/defi/uniswap-v2-optimal-one-sided-supply"],UY=["/defi/uniswap-v2-optimal-one-sided-supply"],_Y=["/defi/uniswap-v2-optimal-one-sided-supply"],LY=["/defi/uniswap-v2-add-remove-liquidity","/assembly-math"],OY=["/defi/uniswap-v2-add-remove-liquidity"],PY=["/defi/staking-rewards","/defi/discrete-staking-rewards"],$Y=["/defi/staking-rewards","/defi/discrete-staking-rewards"],qY=["/defi/staking-rewards","/defi/discrete-staking-rewards"],sX=["/defi/stable-swap-amm"],aX=["/defi/stable-swap-amm"],nX=["/defi/discrete-staking-rewards"],lX=["/defi/dai-proxy"],pX=["/defi/dai-proxy","/app/upgradeable-proxy","/app/minimal-proxy"],eX=["/defi/constant-sum-amm"],cX=["/defi/constant-product-amm"],tX=["/defi/chainlink-price-oracle"],oX=["/defi/chainlink-price-oracle"],rX=["/defi/chainlink-price-oracle"],iX=["/defi/chainlink-price-oracle"],gX=["/data-locations"],hX=["/data-locations"],IX=["/data-locations"],dX=["/constructor"],CX=["/constructor"],jX=["/calling-contract"],AX=["/bitwise"],uX=["/bitwise"],yX=["/bitwise"],mX=["/bitwise"],bX=["/assembly-math"],wX=["/array"],kX=["/array"],ZX=["/app/write-to-any-slot"],WX=["/app/write-to-any-slot","/app/deploy-any-contract"],GX=["/app/write-to-any-slot"],BX=["/app/upgradeable-proxy"],fX=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],VX=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],YX=["/app/time-lock"],XX=["/app/time-lock"],vX=["/app/simple-bytecode-contract"],RX=["/app/simple-bytecode-contract"],NX=["/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call"],HX=["/app/multi-sig-wallet"],FX=["/app/multi-sig-wallet","/app/ether-wallet"],KX=["/app/multi-call"],MX=["/app/minimal-proxy"],SX=["/app/merkle-tree","/app/airdrop"],xX=["/app/merkle-tree"],JX=["/app/iterable-mapping"],zX=["/app/gasless-token-transfer"],DX=["/app/gasless-token-transfer","/app/erc20"],EX=["/app/gasless-token-transfer"],QX=["/app/erc721"],TX=["/app/erc721"],UX=["/app/erc721","/app/erc1155"],_X=["/app/erc20"],LX=["/app/erc20"],OX=["/app/erc1155"],PX=["/app/erc1155"],$X=["/app/english-auction"],qX=["/app/english-auction","/app/dutch-auction"],sv=["/app/english-auction","/app/dutch-auction"],av=["/app/dutch-auction"],nv=["/app/crowd-fund"],lv=["/app/crowd-fund"],pv=["/app/crowd-fund"],ev=["/app/create2"],cv=["/app/assembly-bin-exp"],tv=["/app/assembly-bin-exp"],ov=["/app/airdrop"],rv=["/abi-encode","/abi-decode"],iv=["/abi-encode"],gv=["/abi-encode","/abi-decode"],hv=["/abi-encode"],Iv=["/abi-encode"],dv=["/abi-encode"],Cv=["/abi-decode"],Ro={visibility:_f,function:["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],functions:Lf,internal:Of,private:["/visibility","/hacks/accessing-private-data"],public:["/visibility"],external:Pf,view:$f,pure:qf,variable:sV,variables:aV,local:nV,global:lV,state:pV,data:eV,user:cV,defined:tV,value:oV,types:rV,udvt:iV,gas:gV,unchecked:hV,math:IV,overflow:dV,underflow:CV,try:["/try-catch"],catch:["/try-catch"],error:jV,errors:AV,transient:uV,storage:yV,test:mV,echidna:bV,calling:wV,parent:kV,contract:ZV,contracts:WV,inheritance:GV,super:["/super","/inheritance"],struct:BV,structs:fV,type:VV,reading:YV,writing:XV,app:vV,application:RV,cryptography:NV,verify:HV,verifying:FV,signature:KV,signatures:MV,ecrecover:SV,shadow:xV,shadowing:JV,sending:zV,send:DV,ether:EV,eth:QV,transfer:TV,call:UV,fallback:_V,receive:LV,payable:OV,primitive:PV,primitives:$V,boolean:qV,uint256:s1,int256:a1,address:n1,uint:l1,int:p1,new:["/new-contract","/new-contract"],create:e1,creates:c1,create2:t1,salt:o1,mapping:r1,for:["/loop","/assembly-loop"],loop:i1,loops:g1,while:["/loop","/assembly-loop"],do:["/loop"],library:h1,interface:["/interface"],interfaces:I1,override:d1,virtual:C1,is:j1,import:["/import","/enum"],constant:A1,constants:u1,immutable:y1,immutables:m1,if:["/if-else","/assembly-if"],else:["/if-else"],conditional:b1,statement:w1,statements:k1,hello:Z1,world:W1,hash:G1,hashing:B1,keccak256:f1,hack:V1,security:Y1,weth:X1,permit:v1,inflation:R1,erc4626:N1,vault:H1,replay:F1,selfdestruct:K1,"re-entrancy":["/hacks/re-entrancy"],source:M1,random:S1,randomness:x1,blockhash:J1,block:z1,timestamp:D1,phishing:E1,"tx.origin":["/hacks/phishing-with-tx-origin"],arithmetic:Q1,honeypot:T1,hide:U1,hiding:_1,malicious:L1,code:O1,front:P1,running:$1,deploy:q1,different:sY,same:aY,denial:nY,service:lY,delegatecall:pY,bypass:eY,size:cY,check:tY,extcodesize:oY,manipulation:rY,access:iY,accessing:gY,golf:hY,selector:IY,selectors:dY,modifier:CY,modifiers:jY,_:AY,first:uY,counter:yY,evm:mY,yul:bY,assembly:wY,memory:kY,events:ZY,advanced:WY,"event-driven":["/events-advanced"],monitoring:GY,filtering:BY,event:fY,wei:VY,units:YY,require:XY,revert:vY,assert:RY,enum:["/enum"],imports:NY,defi:HY,uniswap:FY,v3:KY,swap:MY,amm:SY,liquidity:xY,arbitrage:JY,flash:zY,loan:DY,v2:EY,optimal:QY,one:TY,sided:UY,supply:_Y,add:LY,remove:OY,staking:PY,reward:$Y,rewards:qY,curve:sX,stable:aX,discrete:nX,dai:lX,proxy:pX,sum:eX,product:cX,chainlink:tX,price:oX,oracle:rX,oracles:iX,location:gX,locations:hX,calldata:IX,constructor:dX,constructors:CX,other:jX,bitwise:AX,most:uX,significant:yX,bit:mX,mul:bX,switch:["/assembly-if"],array:wX,arrays:kX,write:ZX,any:WX,slot:GX,upgradeable:BX,"uni-directional":["/app/uni-directional-payment-channel"],payment:fX,channel:VX,time:YX,lock:XX,simple:vX,bytecode:RX,multi:NX,sig:HX,wallet:FX,staticcall:KX,minimal:MX,merkle:SX,tree:xX,iterable:JX,gasless:zX,token:DX,ERC20:EX,erc721:QX,ierc721:TX,nft:UX,erc20:_X,ierc20:LX,erc1155:OX,ierc1155:PX,english:$X,auction:qX,auctions:sv,dutch:av,crowd:nv,fund:lv,funding:pv,precompute:ev,"bi-directional":["/app/bi-directional-payment-channel"],binary:cv,exponentiation:tv,airdrop:ov,abi:rv,encode:iv,bytes:gv,encodeWithSelector:hv,encodeWithSignature:Iv,encodeCall:dv,decode:Cv},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"],"/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=jv(j.split(" ")),m={};for(const b of u){const G=Av(b);for(const h of G)m[h]=!0}e(m),d&&l({q:j})}const t=Ef(I=>c(I,!0),500,[]);function o(I){a(I),t(I)}function r(){return p?Object.keys(p).length==0?i.jsx("div",{children:"No results"}):i.jsx("ul",{className:as.list,children:jp.filter(({path:I})=>p[I]).map(({path:I,title:d})=>i.jsx("li",{className:as.listItem,children:i.jsx("a",{href:I,children:d})},I))}):i.jsxs(i.Fragment,{children:[rt.map(({routes:I,title:d},j)=>i.jsxs("div",{children:[d&&i.jsx("h3",{className:as.category,children:d}),i.jsx("ul",{className:as.list,children:I.map(({path:u,title:m})=>i.jsx("li",{className:as.listItem,children:i.jsx("a",{href:u,children:m})},u))})]},j)),i.jsxs("div",{children:[i.jsx("h3",{className:as.category,children:"Translations"}),Ld.map(({lang:I,url:d})=>i.jsx("li",{className:as.listItem,children:i.jsx("a",{href:d,target:"__blank",children:I})},d))]})]})}return i.jsxs("div",{className:as.component,children:[i.jsx(dg,{title:"Solidity by Example | 0.8.26",description:"Learn smart contract programming using Solidity"}),i.jsx("h1",{className:as.header,children:i.jsx("a",{href:"/",children:"Solidity by Example"})}),i.jsx("div",{className:as.subHeader,children:"v 0.8.26"}),i.jsxs("div",{className:as.main,children:[i.jsxs("p",{children:["Introduction to ",i.jsx("a",{href:"https://solidity.readthedocs.io",children:"Solidity"})," with simple examples"]}),i.jsxs("div",{className:as.youTube,children:[i.jsx("img",{src:Ig,alt:"logo",className:as.youTubeLogo}),i.jsx("a",{href:"https://www.youtube.com/@smartcontractprogrammer",target:"__blank",children:"Most code are explained here"})]}),i.jsxs("div",{className:as.updraft,children:[i.jsx("img",{src:hg,alt:"logo",className:as.updraftLogo}),i.jsx("a",{href:"https://updraft.cyfrin.io/",target:"__blank",children:"Learn Solidity at Cyfrin Updraft"})]}),i.jsx("div",{className:as.updates,children:Vv.map((I,d)=>i.jsx("div",{children:I},d))}),i.jsx("div",{className:as.search,children:i.jsx(kf,{value:s,onChange:o})}),r()]})]})}const Xv=[{path:"/abi-decode",component:DC},{path:"/abi-encode",component:OC},{path:"/app/airdrop",component:lj},{path:"/app/assembly-bin-exp",component:ij},{path:"/app/bi-directional-payment-channel",component:Aj},{path:"/app/create2",component:Zj},{path:"/app/crowd-fund",component:Xj},{path:"/app/deploy-any-contract",component:Mj},{path:"/app/dutch-auction",component:Qj},{path:"/app/english-auction",component:$j},{path:"/app/erc1155",component:eA},{path:"/app/erc20",component:hA},{path:"/app/erc721",component:yA},{path:"/app/ether-wallet",component:GA},{path:"/app/gasless-token-transfer",component:RA},{path:"/app/iterable-mapping",component:xA},{path:"/app/merkle-tree",component:UA},{path:"/app/minimal-proxy",component:su},{path:"/app/multi-call",component:tu},{path:"/app/multi-delegatecall",component:du},{path:"/app/multi-sig-wallet",component:bu},{path:"/app/simple-bytecode-contract",component:fu},{path:"/app/time-lock",component:Hu},{path:"/app/uni-directional-payment-channel",component:zu},{path:"/app/upgradeable-proxy",component:Lu},{path:"/app/write-to-any-slot",component:ny},{path:"/array",component:ry},{path:"/assembly-error",component:jy},{path:"/assembly-if",component:ky},{path:"/assembly-loop",component:Yy},{path:"/assembly-math",component:Ky},{path:"/assembly-variable",component:Ey},{path:"/bitwise",component:Py},{path:"/call",component:pm},{path:"/calling-contract",component:gm},{path:"/constants",component:um},{path:"/constructor",component:Wm},{path:"/data-locations",component:vm},{path:"/defi/chainlink-price-oracle",component:Sm},{path:"/defi/constant-product-amm",component:Tm},{path:"/defi/constant-sum-amm",component:qm},{path:"/defi/dai-proxy",component:cb},{path:"/defi/discrete-staking-rewards",component:Ib},{path:"/defi/stable-swap-amm",component:mb},{path:"/defi/staking-rewards",component:Bb},{path:"/defi/uniswap-v2",component:Nb},{path:"/defi/uniswap-v2-add-remove-liquidity",component:Jb},{path:"/defi/uniswap-v2-flash-swap",component:_b},{path:"/defi/uniswap-v2-optimal-one-sided-supply",component:aw},{path:"/defi/uniswap-v3-flash",component:ow},{path:"/defi/uniswap-v3-flash-swap",component:Cw},{path:"/defi/uniswap-v3-liquidity",component:ww},{path:"/defi/uniswap-v3-swap",component:Vw},{path:"/defi/vault",component:Fw},{path:"/delegatecall",component:Dw},{path:"/enum",component:Ow},{path:"/error",component:lk},{path:"/ether-units",component:ik},{path:"/events",component:Ak},{path:"/events-advanced",component:Zk},{path:"/evm/memory",component:Xk},{path:"/evm/storage",component:Mk},{path:"/fallback",component:Qk},{path:"/first-app",component:$k},{path:"/function",component:e0},{path:"/function-modifier",component:h0},{path:"/function-selector",component:y0},{path:"/gas",component:G0},{path:"/gas-golf",component:R0},{path:"/hacks/accessing-private-data",component:x0},{path:"/hacks/block-timestamp-manipulation",component:U0},{path:"/hacks/contract-size",component:sZ},{path:"/hacks/delegatecall",component:tZ},{path:"/hacks/denial-of-service",component:dZ},{path:"/hacks/deploy-different-contracts-same-address",component:bZ},{path:"/hacks/front-running",component:fZ},{path:"/hacks/hiding-malicious-code-with-external-contract",component:HZ},{path:"/hacks/honeypot",component:zZ},{path:"/hacks/overflow",component:LZ},{path:"/hacks/phishing-with-tx-origin",component:nW},{path:"/hacks/randomness",component:rW},{path:"/hacks/re-entrancy",component:jW},{path:"/hacks/self-destruct",component:kW},{path:"/hacks/signature-replay",component:YW},{path:"/hacks/vault-inflation",component:KW},{path:"/hacks/weth-permit",component:EW},{path:"/hashing",component:PW},{path:"/hello-world",component:p2},{path:"/if-else",component:g2},{path:"/immutable",component:u2},{path:"/import",component:W2},{path:"/inheritance",component:v2},{path:"/interface",component:S2},{path:"/library",component:T2},{path:"/loop",component:q2},{path:"/mapping",component:cG},{path:"/new-contract",component:IG},{path:"/payable",component:mG},{path:"/primitives",component:BG},{path:"/sending-ether",component:NG},{path:"/shadowing-inherited-state-variables",component:JG},{path:"/signature",component:_G},{path:"/state-variables",component:aB},{path:"/structs",component:oB},{path:"/super",component:CB},{path:"/tests/echidna",component:wB},{path:"/transient-storage",component:VB},{path:"/try-catch",component:FB},{path:"/unchecked-math",component:DB},{path:"/user-defined-value-types",component:OB},{path:"/variables",component:lf},{path:"/view-and-pure-functions",component:gf},{path:"/visibility",component:uf},{path:"",component:Yv}];function Ho(){const{state:s,init:a}=tt();return W.useLayoutEffect(()=>{a({width:window.document.body.clientWidth})},[]),s.initialized?i.jsx(Md,{basename:"",children:i.jsx(VC,{children:i.jsx(Nd,{children:Xv.map(n=>{const{prev:l,next:p}=lC(n.path);return i.jsx(gg,{path:n.path,element:_o.createElement(n.component,{prev:l,next:p})},n.path)})})})}):null}const vv=document.getElementById("root"),Rv=$i(vv),Fo=document.getElementById("root");Fo.hasChildNodes()?Pi(Fo,i.jsx(wo,{children:i.jsx(Ho,{})})):Rv.render(i.jsx(wo,{children:i.jsx(Ho,{})})); +`,uf=({prev:s,next:a})=>i.jsx(A,{version:hf,title:If,description:df,cyfrinLink:Cf,html:Af,prev:s,next:a,codes:jf}),yf=({size:s,className:a=""})=>i.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:i.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"})}),mf="_component_efeb7_1",bf="_icon_efeb7_8",wf="_input_efeb7_12",Ie={component:mf,icon:bf,input:wf},kf=({value:s,onChange:a})=>{function n(l){a(l.target.value)}return i.jsxs("div",{className:Ie.component,children:[i.jsx(yf,{size:18,className:Ie.icon}),i.jsx("input",{className:Ie.input,placeholder:"Search",value:s,onChange:n})]})};var Zf="Expected a function",Xo=NaN,Wf="[object Symbol]",Bf=/^\s+|\s+$/g,Gf=/^[-+]0x[0-9a-f]+$/i,ff=/^0b[01]+$/i,Vf=/^0o[0-7]+$/i,Yf=parseInt,Xf=typeof Il=="object"&&Il&&Il.Object===Object&&Il,vf=typeof self=="object"&&self&&self.Object===Object&&self,Rf=Xf||vf||Function("return this")(),Nf=Object.prototype,Hf=Nf.toString,Ff=Math.max,Kf=Math.min,de=function(){return Rf.Date.now()};function Mf(s,a,n){var l,p,e,c,t,o,r=0,I=!1,d=!1,j=!0;if(typeof s!="function")throw new TypeError(Zf);a=vo(a)||0,gc(n)&&(I=!!n.leading,d="maxWait"in n,e=d?Ff(vo(n.maxWait)||0,a):e,j="trailing"in n?!!n.trailing:j);function u(k){var G=l,Y=p;return l=p=void 0,r=k,c=s.apply(Y,G),c}function m(k){return r=k,t=setTimeout(h,a),I?u(k):c}function b(k){var G=k-o,Y=k-r,x=a-G;return d?Kf(x,e-Y):x}function B(k){var G=k-o,Y=k-r;return o===void 0||G>=a||G<0||d&&Y>=e}function h(){var k=de();if(B(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),r=0,l=o=p=t=void 0}function y(){return t===void 0?c:g(de())}function Z(){var k=de(),G=B(k);if(l=arguments,p=this,o=k,G){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 Sf(s){return!!s&&typeof s=="object"}function xf(s){return typeof s=="symbol"||Sf(s)&&Hf.call(s)==Wf}function vo(s){if(typeof s=="number")return s;if(xf(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(Bf,"");var n=ff.test(s);return n||Vf.test(s)?Yf(s.slice(2),n?2:8):Gf.test(s)?Xo:+s}var Jf=Mf;const zf=Ko(Jf),Df={leading:!1,trailing:!0};function Ef(s,a,n){return W.useCallback(zf(s,a,Df),n)}function Qf(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 r=0;ra+p)}const _f=["/visibility"],Lf=["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],Of=["/visibility"],Pf=["/visibility","/hacks/hiding-malicious-code-with-external-contract"],$f=["/view-and-pure-functions"],qf=["/view-and-pure-functions"],sV=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/evm/storage","/ether-units","/enum","/constants","/assembly-variable","/array"],aV=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/ether-units","/enum","/constants","/array"],nV=["/variables"],lV=["/variables"],pV=["/variables","/state-variables","/shadowing-inherited-state-variables","/evm/storage"],eV=["/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"],cV=["/user-defined-value-types"],tV=["/user-defined-value-types"],oV=["/user-defined-value-types"],rV=["/user-defined-value-types","/structs","/primitives"],iV=["/user-defined-value-types"],gV=["/unchecked-math","/gas-golf","/gas"],hV=["/unchecked-math"],IV=["/unchecked-math","/assembly-math","/app/assembly-bin-exp"],dV=["/unchecked-math","/hacks/overflow"],CV=["/unchecked-math","/hacks/overflow"],jV=["/try-catch","/error","/assembly-error"],AV=["/try-catch","/error"],uV=["/transient-storage"],yV=["/transient-storage","/hacks/accessing-private-data","/evm/storage","/data-locations","/app/write-to-any-slot"],mV=["/tests/echidna"],bV=["/tests/echidna"],wV=["/super","/calling-contract"],kV=["/super"],ZV=["/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"],WV=["/super","/new-contract","/interface","/inheritance","/first-app","/delegatecall","/calling-contract","/call"],BV=["/super","/shadowing-inherited-state-variables","/inheritance","/constructor"],GV=["/structs"],fV=["/structs"],VV=["/structs","/primitives"],YV=["/state-variables"],XV=["/state-variables"],vV=["/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"],RV=["/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"],NV=["/signature","/hashing","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/merkle-tree","/app/bi-directional-payment-channel"],HV=["/signature"],FV=["/signature"],KV=["/signature","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/multi-sig-wallet","/app/bi-directional-payment-channel"],MV=["/signature"],SV=["/signature"],xV=["/shadowing-inherited-state-variables"],JV=["/shadowing-inherited-state-variables"],zV=["/sending-ether"],DV=["/sending-ether","/sending-ether","/payable","/fallback"],EV=["/sending-ether","/payable","/fallback","/ether-units","/app/ether-wallet"],QV=["/sending-ether","/payable","/fallback","/app/ether-wallet"],TV=["/sending-ether","/fallback","/app/gasless-token-transfer"],UV=["/sending-ether","/delegatecall","/calling-contract","/call","/app/multi-call"],_V=["/sending-ether","/fallback"],LV=["/sending-ether","/fallback"],OV=["/sending-ether","/payable","/fallback"],PV=["/primitives"],$V=["/primitives"],qV=["/primitives"],s1=["/primitives"],a1=["/primitives"],n1=["/primitives","/hacks/deploy-different-contracts-same-address","/app/create2"],l1=["/primitives"],p1=["/primitives"],e1=["/new-contract","/hacks/deploy-different-contracts-same-address"],c1=["/new-contract"],t1=["/new-contract","/hacks/deploy-different-contracts-same-address","/app/create2"],o1=["/new-contract","/hacks/deploy-different-contracts-same-address"],r1=["/mapping","/app/iterable-mapping"],i1=["/loop","/assembly-loop"],g1=["/loop"],h1=["/library"],I1=["/interface"],d1=["/inheritance"],C1=["/inheritance"],j1=["/inheritance"],A1=["/immutable","/defi/constant-sum-amm","/defi/constant-product-amm","/constants"],u1=["/immutable","/constants"],y1=["/immutable"],m1=["/immutable"],b1=["/if-else"],w1=["/if-else"],k1=["/if-else"],Z1=["/hello-world"],W1=["/hello-world"],B1=["/hashing"],G1=["/hashing"],f1=["/hashing"],V1=["/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"],Y1=["/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"],X1=["/hacks/weth-permit"],v1=["/hacks/weth-permit","/app/gasless-token-transfer"],R1=["/hacks/vault-inflation"],N1=["/hacks/vault-inflation"],H1=["/hacks/vault-inflation","/defi/vault"],F1=["/hacks/signature-replay"],K1=["/hacks/self-destruct"],M1=["/hacks/randomness"],S1=["/hacks/randomness"],x1=["/hacks/randomness"],J1=["/hacks/randomness"],z1=["/hacks/randomness","/hacks/block-timestamp-manipulation"],D1=["/hacks/randomness","/hacks/block-timestamp-manipulation"],E1=["/hacks/phishing-with-tx-origin"],Q1=["/hacks/overflow"],T1=["/hacks/honeypot"],U1=["/hacks/hiding-malicious-code-with-external-contract"],_1=["/hacks/hiding-malicious-code-with-external-contract"],L1=["/hacks/hiding-malicious-code-with-external-contract"],O1=["/hacks/hiding-malicious-code-with-external-contract"],P1=["/hacks/front-running"],$1=["/hacks/front-running"],q1=["/hacks/deploy-different-contracts-same-address","/app/deploy-any-contract"],sY=["/hacks/deploy-different-contracts-same-address"],aY=["/hacks/deploy-different-contracts-same-address"],nY=["/hacks/denial-of-service"],lY=["/hacks/denial-of-service"],pY=["/hacks/delegatecall","/delegatecall","/app/upgradeable-proxy","/app/multi-delegatecall"],eY=["/hacks/contract-size"],cY=["/hacks/contract-size"],tY=["/hacks/contract-size"],oY=["/hacks/contract-size"],rY=["/hacks/block-timestamp-manipulation"],iY=["/hacks/accessing-private-data"],gY=["/hacks/accessing-private-data"],hY=["/gas-golf"],IY=["/function-selector"],dY=["/function-selector"],CY=["/function-modifier"],jY=["/function-modifier"],AY=["/function-modifier"],uY=["/first-app"],yY=["/first-app"],mY=["/evm/storage","/evm/memory"],bY=["/evm/storage","/evm/memory","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],wY=["/evm/storage","/evm/memory","/bitwise","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],kY=["/evm/memory","/data-locations"],ZY=["/events-advanced","/events"],WY=["/events-advanced"],BY=["/events-advanced"],GY=["/events-advanced"],fY=["/events"],VY=["/ether-units"],YY=["/ether-units"],XY=["/error"],vY=["/error","/assembly-error"],RY=["/error"],NY=["/enum"],HY=["/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"],FY=["/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"],KY=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash"],MY=["/defi/uniswap-v3-swap","/defi/uniswap-v3-flash-swap","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2","/defi/stable-swap-amm"],SY=["/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"],xY=["/defi/uniswap-v3-liquidity","/defi/uniswap-v2-add-remove-liquidity"],JY=["/defi/uniswap-v3-flash-swap"],zY=["/defi/uniswap-v3-flash","/defi/uniswap-v2-flash-swap"],DY=["/defi/uniswap-v3-flash"],EY=["/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2"],QY=["/defi/uniswap-v2-optimal-one-sided-supply"],TY=["/defi/uniswap-v2-optimal-one-sided-supply"],UY=["/defi/uniswap-v2-optimal-one-sided-supply"],_Y=["/defi/uniswap-v2-optimal-one-sided-supply"],LY=["/defi/uniswap-v2-add-remove-liquidity","/assembly-math"],OY=["/defi/uniswap-v2-add-remove-liquidity"],PY=["/defi/staking-rewards","/defi/discrete-staking-rewards"],$Y=["/defi/staking-rewards","/defi/discrete-staking-rewards"],qY=["/defi/staking-rewards","/defi/discrete-staking-rewards"],sX=["/defi/stable-swap-amm"],aX=["/defi/stable-swap-amm"],nX=["/defi/discrete-staking-rewards"],lX=["/defi/dai-proxy"],pX=["/defi/dai-proxy","/app/upgradeable-proxy","/app/minimal-proxy"],eX=["/defi/constant-sum-amm"],cX=["/defi/constant-product-amm"],tX=["/defi/chainlink-price-oracle"],oX=["/defi/chainlink-price-oracle"],rX=["/defi/chainlink-price-oracle"],iX=["/defi/chainlink-price-oracle"],gX=["/data-locations"],hX=["/data-locations"],IX=["/data-locations"],dX=["/constructor"],CX=["/constructor"],jX=["/calling-contract"],AX=["/bitwise"],uX=["/bitwise"],yX=["/bitwise"],mX=["/bitwise"],bX=["/assembly-math"],wX=["/array"],kX=["/array"],ZX=["/app/write-to-any-slot"],WX=["/app/write-to-any-slot","/app/deploy-any-contract"],BX=["/app/write-to-any-slot"],GX=["/app/upgradeable-proxy"],fX=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],VX=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],YX=["/app/time-lock"],XX=["/app/time-lock"],vX=["/app/simple-bytecode-contract"],RX=["/app/simple-bytecode-contract"],NX=["/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call"],HX=["/app/multi-sig-wallet"],FX=["/app/multi-sig-wallet","/app/ether-wallet"],KX=["/app/multi-call"],MX=["/app/minimal-proxy"],SX=["/app/merkle-tree","/app/airdrop"],xX=["/app/merkle-tree"],JX=["/app/iterable-mapping"],zX=["/app/gasless-token-transfer"],DX=["/app/gasless-token-transfer","/app/erc20"],EX=["/app/gasless-token-transfer"],QX=["/app/erc721"],TX=["/app/erc721"],UX=["/app/erc721","/app/erc1155"],_X=["/app/erc20"],LX=["/app/erc20"],OX=["/app/erc1155"],PX=["/app/erc1155"],$X=["/app/english-auction"],qX=["/app/english-auction","/app/dutch-auction"],sv=["/app/english-auction","/app/dutch-auction"],av=["/app/dutch-auction"],nv=["/app/crowd-fund"],lv=["/app/crowd-fund"],pv=["/app/crowd-fund"],ev=["/app/create2"],cv=["/app/assembly-bin-exp"],tv=["/app/assembly-bin-exp"],ov=["/app/airdrop"],rv=["/abi-encode","/abi-decode"],iv=["/abi-encode"],gv=["/abi-encode","/abi-decode"],hv=["/abi-encode"],Iv=["/abi-encode"],dv=["/abi-encode"],Cv=["/abi-decode"],Ro={visibility:_f,function:["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],functions:Lf,internal:Of,private:["/visibility","/hacks/accessing-private-data"],public:["/visibility"],external:Pf,view:$f,pure:qf,variable:sV,variables:aV,local:nV,global:lV,state:pV,data:eV,user:cV,defined:tV,value:oV,types:rV,udvt:iV,gas:gV,unchecked:hV,math:IV,overflow:dV,underflow:CV,try:["/try-catch"],catch:["/try-catch"],error:jV,errors:AV,transient:uV,storage:yV,test:mV,echidna:bV,calling:wV,parent:kV,contract:ZV,contracts:WV,inheritance:BV,super:["/super","/inheritance"],struct:GV,structs:fV,type:VV,reading:YV,writing:XV,app:vV,application:RV,cryptography:NV,verify:HV,verifying:FV,signature:KV,signatures:MV,ecrecover:SV,shadow:xV,shadowing:JV,sending:zV,send:DV,ether:EV,eth:QV,transfer:TV,call:UV,fallback:_V,receive:LV,payable:OV,primitive:PV,primitives:$V,boolean:qV,uint256:s1,int256:a1,address:n1,uint:l1,int:p1,new:["/new-contract","/new-contract"],create:e1,creates:c1,create2:t1,salt:o1,mapping:r1,for:["/loop","/assembly-loop"],loop:i1,loops:g1,while:["/loop","/assembly-loop"],do:["/loop"],library:h1,interface:["/interface"],interfaces:I1,override:d1,virtual:C1,is:j1,import:["/import","/enum"],constant:A1,constants:u1,immutable:y1,immutables:m1,if:["/if-else","/assembly-if"],else:["/if-else"],conditional:b1,statement:w1,statements:k1,hello:Z1,world:W1,hash:B1,hashing:G1,keccak256:f1,hack:V1,security:Y1,weth:X1,permit:v1,inflation:R1,erc4626:N1,vault:H1,replay:F1,selfdestruct:K1,"re-entrancy":["/hacks/re-entrancy"],source:M1,random:S1,randomness:x1,blockhash:J1,block:z1,timestamp:D1,phishing:E1,"tx.origin":["/hacks/phishing-with-tx-origin"],arithmetic:Q1,honeypot:T1,hide:U1,hiding:_1,malicious:L1,code:O1,front:P1,running:$1,deploy:q1,different:sY,same:aY,denial:nY,service:lY,delegatecall:pY,bypass:eY,size:cY,check:tY,extcodesize:oY,manipulation:rY,access:iY,accessing:gY,golf:hY,selector:IY,selectors:dY,modifier:CY,modifiers:jY,_:AY,first:uY,counter:yY,evm:mY,yul:bY,assembly:wY,memory:kY,events:ZY,advanced:WY,"event-driven":["/events-advanced"],monitoring:BY,filtering:GY,event:fY,wei:VY,units:YY,require:XY,revert:vY,assert:RY,enum:["/enum"],imports:NY,defi:HY,uniswap:FY,v3:KY,swap:MY,amm:SY,liquidity:xY,arbitrage:JY,flash:zY,loan:DY,v2:EY,optimal:QY,one:TY,sided:UY,supply:_Y,add:LY,remove:OY,staking:PY,reward:$Y,rewards:qY,curve:sX,stable:aX,discrete:nX,dai:lX,proxy:pX,sum:eX,product:cX,chainlink:tX,price:oX,oracle:rX,oracles:iX,location:gX,locations:hX,calldata:IX,constructor:dX,constructors:CX,other:jX,bitwise:AX,most:uX,significant:yX,bit:mX,mul:bX,switch:["/assembly-if"],array:wX,arrays:kX,write:ZX,any:WX,slot:BX,upgradeable:GX,"uni-directional":["/app/uni-directional-payment-channel"],payment:fX,channel:VX,time:YX,lock:XX,simple:vX,bytecode:RX,multi:NX,sig:HX,wallet:FX,staticcall:KX,minimal:MX,merkle:SX,tree:xX,iterable:JX,gasless:zX,token:DX,ERC20:EX,erc721:QX,ierc721:TX,nft:UX,erc20:_X,ierc20:LX,erc1155:OX,ierc1155:PX,english:$X,auction:qX,auctions:sv,dutch:av,crowd:nv,fund:lv,funding:pv,precompute:ev,"bi-directional":["/app/bi-directional-payment-channel"],binary:cv,exponentiation:tv,airdrop:ov,abi:rv,encode:iv,bytes:gv,encodeWithSelector:hv,encodeWithSignature:Iv,encodeCall:dv,decode:Cv},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"],"/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=jv(j.split(" ")),m={};for(const b of u){const B=Av(b);for(const h of B)m[h]=!0}e(m),d&&l({q:j})}const t=Ef(I=>c(I,!0),500,[]);function o(I){a(I),t(I)}function r(){return p?Object.keys(p).length==0?i.jsx("div",{children:"No results"}):i.jsx("ul",{className:as.list,children:jp.filter(({path:I})=>p[I]).map(({path:I,title:d})=>i.jsx("li",{className:as.listItem,children:i.jsx("a",{href:I,children:d})},I))}):i.jsxs(i.Fragment,{children:[rt.map(({routes:I,title:d},j)=>i.jsxs("div",{children:[d&&i.jsx("h3",{className:as.category,children:d}),i.jsx("ul",{className:as.list,children:I.map(({path:u,title:m})=>i.jsx("li",{className:as.listItem,children:i.jsx("a",{href:u,children:m})},u))})]},j)),i.jsxs("div",{children:[i.jsx("h3",{className:as.category,children:"Translations"}),Ld.map(({lang:I,url:d})=>i.jsx("li",{className:as.listItem,children:i.jsx("a",{href:d,target:"__blank",children:I})},d))]})]})}return i.jsxs("div",{className:as.component,children:[i.jsx(dg,{title:"Solidity by Example | 0.8.26",description:"Learn smart contract programming using Solidity"}),i.jsx("h1",{className:as.header,children:i.jsx("a",{href:"/",children:"Solidity by Example"})}),i.jsx("div",{className:as.subHeader,children:"v 0.8.26"}),i.jsxs("div",{className:as.main,children:[i.jsxs("p",{children:["Introduction to ",i.jsx("a",{href:"https://solidity.readthedocs.io",children:"Solidity"})," with simple examples"]}),i.jsxs("div",{className:as.youTube,children:[i.jsx("img",{src:Ig,alt:"logo",className:as.youTubeLogo}),i.jsx("a",{href:"https://www.youtube.com/@smartcontractprogrammer",target:"__blank",children:"Most code are explained here"})]}),i.jsxs("div",{className:as.updraft,children:[i.jsx("img",{src:hg,alt:"logo",className:as.updraftLogo}),i.jsx("a",{href:"https://updraft.cyfrin.io/",target:"__blank",children:"Learn Solidity at Cyfrin Updraft"})]}),i.jsx("div",{className:as.updates,children:Vv.map((I,d)=>i.jsx("div",{children:I},d))}),i.jsx("div",{className:as.search,children:i.jsx(kf,{value:s,onChange:o})}),r()]})]})}const Xv=[{path:"/abi-decode",component:DC},{path:"/abi-encode",component:OC},{path:"/app/airdrop",component:lj},{path:"/app/assembly-bin-exp",component:ij},{path:"/app/bi-directional-payment-channel",component:Aj},{path:"/app/create2",component:Zj},{path:"/app/crowd-fund",component:Xj},{path:"/app/deploy-any-contract",component:Mj},{path:"/app/dutch-auction",component:Qj},{path:"/app/english-auction",component:$j},{path:"/app/erc1155",component:eA},{path:"/app/erc20",component:hA},{path:"/app/erc721",component:yA},{path:"/app/ether-wallet",component:BA},{path:"/app/gasless-token-transfer",component:RA},{path:"/app/iterable-mapping",component:xA},{path:"/app/merkle-tree",component:UA},{path:"/app/minimal-proxy",component:su},{path:"/app/multi-call",component:tu},{path:"/app/multi-delegatecall",component:du},{path:"/app/multi-sig-wallet",component:bu},{path:"/app/simple-bytecode-contract",component:fu},{path:"/app/time-lock",component:Hu},{path:"/app/uni-directional-payment-channel",component:zu},{path:"/app/upgradeable-proxy",component:Lu},{path:"/app/write-to-any-slot",component:ny},{path:"/array",component:ry},{path:"/assembly-error",component:jy},{path:"/assembly-if",component:ky},{path:"/assembly-loop",component:Yy},{path:"/assembly-math",component:Ky},{path:"/assembly-variable",component:Ey},{path:"/bitwise",component:Py},{path:"/call",component:pm},{path:"/calling-contract",component:gm},{path:"/constants",component:um},{path:"/constructor",component:Wm},{path:"/data-locations",component:vm},{path:"/defi/chainlink-price-oracle",component:Sm},{path:"/defi/constant-product-amm",component:Tm},{path:"/defi/constant-sum-amm",component:qm},{path:"/defi/dai-proxy",component:cb},{path:"/defi/discrete-staking-rewards",component:Ib},{path:"/defi/stable-swap-amm",component:mb},{path:"/defi/staking-rewards",component:Gb},{path:"/defi/uniswap-v2",component:Nb},{path:"/defi/uniswap-v2-add-remove-liquidity",component:Jb},{path:"/defi/uniswap-v2-flash-swap",component:_b},{path:"/defi/uniswap-v2-optimal-one-sided-supply",component:aw},{path:"/defi/uniswap-v3-flash",component:ow},{path:"/defi/uniswap-v3-flash-swap",component:Cw},{path:"/defi/uniswap-v3-liquidity",component:ww},{path:"/defi/uniswap-v3-swap",component:Vw},{path:"/defi/vault",component:Fw},{path:"/delegatecall",component:Dw},{path:"/enum",component:Ow},{path:"/error",component:lk},{path:"/ether-units",component:ik},{path:"/events",component:Ak},{path:"/events-advanced",component:Zk},{path:"/evm/memory",component:Xk},{path:"/evm/storage",component:Mk},{path:"/fallback",component:Qk},{path:"/first-app",component:$k},{path:"/function",component:e0},{path:"/function-modifier",component:h0},{path:"/function-selector",component:y0},{path:"/gas",component:B0},{path:"/gas-golf",component:R0},{path:"/hacks/accessing-private-data",component:x0},{path:"/hacks/block-timestamp-manipulation",component:U0},{path:"/hacks/contract-size",component:sZ},{path:"/hacks/delegatecall",component:tZ},{path:"/hacks/denial-of-service",component:dZ},{path:"/hacks/deploy-different-contracts-same-address",component:bZ},{path:"/hacks/front-running",component:fZ},{path:"/hacks/hiding-malicious-code-with-external-contract",component:HZ},{path:"/hacks/honeypot",component:zZ},{path:"/hacks/overflow",component:LZ},{path:"/hacks/phishing-with-tx-origin",component:nW},{path:"/hacks/randomness",component:rW},{path:"/hacks/re-entrancy",component:jW},{path:"/hacks/self-destruct",component:kW},{path:"/hacks/signature-replay",component:YW},{path:"/hacks/vault-inflation",component:KW},{path:"/hacks/weth-permit",component:EW},{path:"/hashing",component:PW},{path:"/hello-world",component:p2},{path:"/if-else",component:g2},{path:"/immutable",component:u2},{path:"/import",component:W2},{path:"/inheritance",component:v2},{path:"/interface",component:S2},{path:"/library",component:T2},{path:"/loop",component:q2},{path:"/mapping",component:cB},{path:"/new-contract",component:IB},{path:"/payable",component:mB},{path:"/primitives",component:GB},{path:"/sending-ether",component:NB},{path:"/shadowing-inherited-state-variables",component:JB},{path:"/signature",component:_B},{path:"/state-variables",component:aG},{path:"/structs",component:oG},{path:"/super",component:CG},{path:"/tests/echidna",component:wG},{path:"/transient-storage",component:VG},{path:"/try-catch",component:FG},{path:"/unchecked-math",component:DG},{path:"/user-defined-value-types",component:OG},{path:"/variables",component:lf},{path:"/view-and-pure-functions",component:gf},{path:"/visibility",component:uf},{path:"",component:Yv}];function Ho(){const{state:s,init:a}=tt();return W.useLayoutEffect(()=>{a({width:window.document.body.clientWidth})},[]),s.initialized?i.jsx(Md,{basename:"",children:i.jsx(VC,{children:i.jsx(Nd,{children:Xv.map(n=>{const{prev:l,next:p}=lC(n.path);return i.jsx(gg,{path:n.path,element:_o.createElement(n.component,{prev:l,next:p})},n.path)})})})}):null}const vv=document.getElementById("root"),Rv=$i(vv),Fo=document.getElementById("root");Fo.hasChildNodes()?Pi(Fo,i.jsx(wo,{children:i.jsx(Ho,{})})):Rv.render(i.jsx(wo,{children:i.jsx(Ho,{})})); diff --git a/bitwise/index.html b/bitwise/index.html index ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 100644 --- a/first-app/index.html +++ b/first-app/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - + diff --git a/function-modifier/index.html b/function-modifier/index.html index ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 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 ae7e3138c..685c680af 100644 --- a/visibility/index.html +++ b/visibility/index.html @@ -28,7 +28,7 @@ gtag("config", "UA-133759045-1") - +