diff --git a/404.html b/404.html index 685c680af..ea85881bd 100644 --- a/404.html +++ b/404.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/abi-decode/index.html b/abi-decode/index.html index 685c680af..ea85881bd 100644 --- a/abi-decode/index.html +++ b/abi-decode/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/abi-encode/index.html b/abi-encode/index.html index 685c680af..ea85881bd 100644 --- a/abi-encode/index.html +++ b/abi-encode/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/airdrop/index.html b/app/airdrop/index.html index 685c680af..ea85881bd 100644 --- a/app/airdrop/index.html +++ b/app/airdrop/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/assembly-bin-exp/index.html b/app/assembly-bin-exp/index.html index 685c680af..ea85881bd 100644 --- a/app/assembly-bin-exp/index.html +++ b/app/assembly-bin-exp/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/bi-directional-payment-channel/index.html b/app/bi-directional-payment-channel/index.html index 685c680af..ea85881bd 100644 --- a/app/bi-directional-payment-channel/index.html +++ b/app/bi-directional-payment-channel/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/create2/index.html b/app/create2/index.html index 685c680af..ea85881bd 100644 --- a/app/create2/index.html +++ b/app/create2/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/crowd-fund/index.html b/app/crowd-fund/index.html index 685c680af..ea85881bd 100644 --- a/app/crowd-fund/index.html +++ b/app/crowd-fund/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/deploy-any-contract/index.html b/app/deploy-any-contract/index.html index 685c680af..ea85881bd 100644 --- a/app/deploy-any-contract/index.html +++ b/app/deploy-any-contract/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/dutch-auction/index.html b/app/dutch-auction/index.html index 685c680af..ea85881bd 100644 --- a/app/dutch-auction/index.html +++ b/app/dutch-auction/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/english-auction/index.html b/app/english-auction/index.html index 685c680af..ea85881bd 100644 --- a/app/english-auction/index.html +++ b/app/english-auction/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/erc1155/index.html b/app/erc1155/index.html index 685c680af..ea85881bd 100644 --- a/app/erc1155/index.html +++ b/app/erc1155/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/erc20/index.html b/app/erc20/index.html index 685c680af..ea85881bd 100644 --- a/app/erc20/index.html +++ b/app/erc20/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/erc721/index.html b/app/erc721/index.html index 685c680af..ea85881bd 100644 --- a/app/erc721/index.html +++ b/app/erc721/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/ether-wallet/index.html b/app/ether-wallet/index.html index 685c680af..ea85881bd 100644 --- a/app/ether-wallet/index.html +++ b/app/ether-wallet/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/gasless-token-transfer/index.html b/app/gasless-token-transfer/index.html index 685c680af..ea85881bd 100644 --- a/app/gasless-token-transfer/index.html +++ b/app/gasless-token-transfer/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/iterable-mapping/index.html b/app/iterable-mapping/index.html index 685c680af..ea85881bd 100644 --- a/app/iterable-mapping/index.html +++ b/app/iterable-mapping/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/merkle-tree/index.html b/app/merkle-tree/index.html index 685c680af..ea85881bd 100644 --- a/app/merkle-tree/index.html +++ b/app/merkle-tree/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/minimal-proxy/index.html b/app/minimal-proxy/index.html index 685c680af..ea85881bd 100644 --- a/app/minimal-proxy/index.html +++ b/app/minimal-proxy/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/multi-call/index.html b/app/multi-call/index.html index 685c680af..ea85881bd 100644 --- a/app/multi-call/index.html +++ b/app/multi-call/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/multi-delegatecall/index.html b/app/multi-delegatecall/index.html index 685c680af..ea85881bd 100644 --- a/app/multi-delegatecall/index.html +++ b/app/multi-delegatecall/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/multi-sig-wallet/index.html b/app/multi-sig-wallet/index.html index 685c680af..ea85881bd 100644 --- a/app/multi-sig-wallet/index.html +++ b/app/multi-sig-wallet/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/simple-bytecode-contract/index.html b/app/simple-bytecode-contract/index.html index 685c680af..ea85881bd 100644 --- a/app/simple-bytecode-contract/index.html +++ b/app/simple-bytecode-contract/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/time-lock/index.html b/app/time-lock/index.html index 685c680af..ea85881bd 100644 --- a/app/time-lock/index.html +++ b/app/time-lock/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/uni-directional-payment-channel/index.html b/app/uni-directional-payment-channel/index.html index 685c680af..ea85881bd 100644 --- a/app/uni-directional-payment-channel/index.html +++ b/app/uni-directional-payment-channel/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/upgradeable-proxy/index.html b/app/upgradeable-proxy/index.html index 685c680af..ea85881bd 100644 --- a/app/upgradeable-proxy/index.html +++ b/app/upgradeable-proxy/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/app/write-to-any-slot/index.html b/app/write-to-any-slot/index.html index 685c680af..ea85881bd 100644 --- a/app/write-to-any-slot/index.html +++ b/app/write-to-any-slot/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/array/index.html b/array/index.html index 685c680af..ea85881bd 100644 --- a/array/index.html +++ b/array/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/assembly-error/index.html b/assembly-error/index.html index 685c680af..ea85881bd 100644 --- a/assembly-error/index.html +++ b/assembly-error/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/assembly-if/index.html b/assembly-if/index.html index 685c680af..ea85881bd 100644 --- a/assembly-if/index.html +++ b/assembly-if/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/assembly-loop/index.html b/assembly-loop/index.html index 685c680af..ea85881bd 100644 --- a/assembly-loop/index.html +++ b/assembly-loop/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/assembly-math/index.html b/assembly-math/index.html index 685c680af..ea85881bd 100644 --- a/assembly-math/index.html +++ b/assembly-math/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/assembly-variable/index.html b/assembly-variable/index.html index 685c680af..ea85881bd 100644 --- a/assembly-variable/index.html +++ b/assembly-variable/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/assets/index-1Qng9Y_e.css b/assets/index-C-wTIGZT.css similarity index 100% rename from assets/index-1Qng9Y_e.css rename to assets/index-C-wTIGZT.css diff --git a/assets/index-mQp8j2HZ.js b/assets/index-CXkCmEIb.js similarity index 88% rename from assets/index-mQp8j2HZ.js rename to assets/index-CXkCmEIb.js index e5c129dfa..a36b33896 100644 --- a/assets/index-mQp8j2HZ.js +++ b/assets/index-CXkCmEIb.js @@ -38,7 +38,7 @@ function Ag(s,a){for(var n=0;nUa||(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=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 + * @remix-run/router v1.20.0 * * Copyright (c) Remix Software Inc. * @@ -47,7 +47,7 @@ Error generating stack: `+e.message+` * * @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 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 + * React Router v6.27.0 * * Copyright (c) Remix Software Inc. * @@ -56,7 +56,7 @@ Error generating stack: `+e.message+` * * @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 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 + * React Router DOM v6.27.0 * * 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",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.

+ */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-solidity-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;
@@ -99,7 +99,7 @@ Error generating stack: `+e.message+`
             abi.decode(data, (uint256, address, uint256[], MyStruct));
     }
 }
-
`,DC=({prev:s,next:a})=>i.jsx(A,{version:KC,title:MC,description:SC,cyfrinLink:xC,html:zC,prev:s,next:a,codes:JC}),EC="0.8.26",QC="ABI Encode",TC="ABI encode",UC="https://www.cyfrin.io/glossary/abi-encode-code-example",_C=[{fileName:"AbiEncode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IFRva2VuIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MsIHVpbnQyNTYpIGV4dGVybmFsIHt9Cn0KCmNvbnRyYWN0IEFiaUVuY29kZSB7CiAgICBmdW5jdGlvbiB0ZXN0KGFkZHJlc3MgX2NvbnRyYWN0LCBieXRlcyBjYWxsZGF0YSBkYXRhKSBleHRlcm5hbCB7CiAgICAgICAgKGJvb2wgb2ssKSA9IF9jb250cmFjdC5jYWxsKGRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGVuY29kZVdpdGhTaWduYXR1cmUoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KQogICAgewogICAgICAgIC8vIFR5cG8gaXMgbm90IGNoZWNrZWQgLSAidHJhbnNmZXIoYWRkcmVzcywgdWludCkiCiAgICAgICAgcmV0dXJuIGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJ0cmFuc2ZlcihhZGRyZXNzLHVpbnQyNTYpIiwgdG8sIGFtb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZW5jb2RlV2l0aFNlbGVjdG9yKGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkKICAgIHsKICAgICAgICAvLyBUeXBlIGlzIG5vdCBjaGVja2VkIC0gKElFUkMyMC50cmFuc2Zlci5zZWxlY3RvciwgdHJ1ZSwgYW1vdW50KQogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKElFUkMyMC50cmFuc2Zlci5zZWxlY3RvciwgdG8sIGFtb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZW5jb2RlQ2FsbChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlcyBtZW1vcnkpCiAgICB7CiAgICAgICAgLy8gVHlwbyBhbmQgdHlwZSBlcnJvcnMgd2lsbCBub3QgY29tcGlsZQogICAgICAgIHJldHVybiBhYmkuZW5jb2RlQ2FsbChJRVJDMjAudHJhbnNmZXIsICh0bywgYW1vdW50KSk7CiAgICB9Cn0K"}],LC=`
// SPDX-License-Identifier: MIT
+
`,DC=({prev:s,next:a})=>i.jsx(A,{version:KC,title:MC,description:SC,cyfrinLink:xC,html:zC,prev:s,next:a,codes:JC}),EC="0.8.26",QC="ABI Encode",TC="ABI encode",UC="https://www.cyfrin.io/glossary/abi-encode-solidity-code-example",_C=[{fileName:"AbiEncode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IFRva2VuIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MsIHVpbnQyNTYpIGV4dGVybmFsIHt9Cn0KCmNvbnRyYWN0IEFiaUVuY29kZSB7CiAgICBmdW5jdGlvbiB0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byBhbmQgdHlwZSBlcnJvcnMgd2lsbCBub3QgY29tcGlsZQogICAgICAgIHJldHVybiBhYmkuZW5jb2RlQ2FsbChJRVJDMjAudHJhbnNmZXIsICh0bywgYW1vdW50KSk7CiAgICB9Cn0K"}],LC=`
// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.26;
 
 interface IERC20 {
@@ -143,7 +143,7 @@ Error generating stack: `+e.message+`
         return abi.encodeCall(IERC20.transfer, (to, amount));
     }
 }
-
`,OC=({prev:s,next:a})=>i.jsx(A,{version:EC,title:QC,description:TC,cyfrinLink:UC,html:LC,prev:s,next:a,codes:_C}),PC="0.8.26",$C="Merkle Airdrop",qC="Airdrop contract using Merkle tree",sj="",aj=[{fileName:"Airdrop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCB7TWVya2xlUHJvb2Z9IGZyb20gIi4vTWVya2xlUHJvb2Yuc29sIjsKCmludGVyZmFjZSBJVG9rZW4gewogICAgZnVuY3Rpb24gbWludChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IEFpcmRyb3AgewogICAgZXZlbnQgQ2xhaW0oYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpOwoKICAgIElUb2tlbiBwdWJsaWMgaW1tdXRhYmxlIHRva2VuOwogICAgYnl0ZXMzMiBwdWJsaWMgaW1tdXRhYmxlIHJvb3Q7CiAgICBtYXBwaW5nKGJ5dGVzMzIgPT4gYm9vbCkgcHVibGljIGNsYWltZWQ7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4sIGJ5dGVzMzIgX3Jvb3QpIHsKICAgICAgICB0b2tlbiA9IElUb2tlbihfdG9rZW4pOwogICAgICAgIHJvb3QgPSBfcm9vdDsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRMZWFmSGFzaChhZGRyZXN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rZW59IGZyb20gIi4uLy4uLy4uL3NyYy9hcHAvYWlyZHJvcC9Ub2tlbi5zb2wiOwoKY29udHJhY3QgQWlyZHJvcFRlc3QgaXMgVGVzdCB7CiAgICBUb2tlbiBwcml2YXRlIHRva2VuOwogICAgQWlyZHJvcCBwcml2YXRlIGFpcmRyb3A7CgogICAgc3RydWN0IFJld2FyZCB7CiAgICAgICAgYWRkcmVzcyB0bzsKICAgICAgICB1aW50MjU2IGFtb3VudDsKICAgIH0KCiAgICBSZXdhcmRbXSBwcml2YXRlIHJld2FyZHM7CiAgICBieXRlczMyW10gcHJpdmF0ZSBoYXNoZXM7CiAgICBtYXBwaW5nKGJ5dGVzMzIgPT4gUmV3YXJkKSBwcml2YXRlIGhhc2hUb1Jld2FyZDsKCiAgICB1aW50MjU2IGNvbnN0YW50IE4gPSAxMDA7CgogICAgZnVuY3Rpb24gc2V0VXAoKSBwdWJsaWMgewogICAgICAgIHRva2VuID0gbmV3IFRva2VuKCJ0ZXN0IiwgIlRFU1QiLCAxOCk7CgogICAgICAgIC8vIEluaXRpYWxpemUgdXNlcnMgYW5kIGFpcmRyb3AgYW1vdW50cwogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IE47IGkrKykgewogICAgICAgICAgICByZXdhcmRzLnB1c2goCiAgICAgICAgICAgICAgICBSZXdhcmQoe3RvOiBhZGRyZXNzKHVpbnQxNjAoaSkpLCBhbW91bnQ6IChpICsgMSkgKiAxMDB9KQogICAgICAgICAgICApOwogICAgICAgICAgICBoYXNoZXMucHVzaChrZWNjYWsyNTYoYWJpLmVuY29kZShyZXdhcmRzW2ldLnRvLCByZXdhcmRzW2ldLmFtb3VudCkpKTsKICAgICAgICAgICAgaGFzaFRvUmV3YXJkW2hhc2hlc1tpXV0gPSByZXdhcmRzW2ldOwogICAgICAgIH0KCiAgICAgICAgaGFzaGVzID0gTWVya2xlSGVscGVyLnNvcnQoaGFzaGVzKTsKCiAgICAgICAgYnl0ZXMzMiByb290ID0gTW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lY2NhazI1NihiLCBhKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfZWZmaWNpZW50S2VjY2FrMjU2KGJ5dGVzMzIgYSwgYnl0ZXMzMiBiKQogICAgICAgIHByaXZhdGUKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMiB2YWx1ZSkKICAgIHsKICAgICAgICAvLy8gQHNvbGlkaXR5IG1lbW9yeS1zYWZlLWFzc2VtYmx5CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBtc3RvcmUoMHgwMCwgYSkKICAgICAgICAgICAgbXN0b3JlKDB4MjAsIGIpCiAgICAgICAgICAgIHZhbHVlIDo9IGtlY2NhazI1NigweDAwLCAweDQwKQogICAgICAgIH0KICAgIH0KfQo="},{fileName:"MerkleHelper.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmxpYnJhcnkgTWVya2xlSGVscGVyIHsKICAgIC8vIEJ1YmJsZSBzb3J0CiAgICBmdW5jdGlvbiBzb3J0KGJ5dGVzMzJbXSBtZW1vcnkgYXJyKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzJbXSBtZW1vcnkpCiAgICB7CiAgICAgICAgdWludDI1NiBuID0gYXJyLmxlbmd0aDsKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgZm9yICh1aW50MjU2IGogPSAwOyBqIDwgbiAtIDEgLSBpOyBqKyspIHsKICAgICAgICAgICAgICAgIGlmIChhcnJbal0gPiBhcnJbaiArIDFdKSB7CiAgICAgICAgICAgICAgICAgICAgKGFycltqXSwgYXJyW2ogKyAxXSkgPSAoYXJyW2ogKyAxXSwgYXJyW2pdKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIGFycjsKICAgIH0KCiAgICBmdW5jdGlvbiB5dWxLZWNjYWsyNTYoYnl0ZXMzMiBhLCBieXRlczMyIGIpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMiB2KQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbXN0b3JlKDB4MDAsIGEpCiAgICAgICAgICAgIG1zdG9yZSgweDIwLCBiKQogICAgICAgICAgICB2IDo9IGtlY2NhazI1NigweDAwLCAweDQwKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBjYWxjUm9vdChieXRlczMyW10gbWVtb3J5IGhhc2hlcykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyKQogICAgewogICAgICAgIHVpbnQyNTYgbiA9IGhhc2hlcy5sZW5ndGg7CgogICAgICAgIHdoaWxlIChuID4gMSkgewogICAgICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCBuOyBpICs9IDIpIHsKICAgICAgICAgICAgICAgIGJ5dGVzMzIgbGVmdCA9IGhhc2hlc1tpXTsKICAgICAgICAgICAgICAgIGJ5dGVzMzIgcmlnaHQgPSBoYXNoZXNbaSArIDEgPCBuID8gaSArIDEgOiBpXTsKICAgICAgICAgICAgICAgIChsZWZ0LCByaWdodCkgPSBsZWZ0IDw9IHJpZ2h0ID8gKGxlZnQsIHJpZ2h0KSA6IChyaWdodCwgbGVmdCk7CiAgICAgICAgICAgICAgICBoYXNoZXNbaSA+PiAxXSA9IHl1bEtlY2NhazI1NihsZWZ0LCByaWdodCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgbiA9IChuICsgKG4gJiAxKSkgPj4gMTsKICAgICAgICB9CgogICAgICAgIHJldHVybiBoYXNoZXNbMF07CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UHJvb2YoYnl0ZXMzMltdIG1lbW9yeSBoYXNoZXMsIHVpbnQyNTYgaW5kZXgpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMltdIG1lbW9yeSkKICAgIHsKICAgICAgICBieXRlczMyW10gbWVtb3J5IHByb29mID0gbmV3IGJ5dGVzMzJbXSgwKTsKICAgICAgICB1aW50MjU2IGxlbiA9IDA7CgogICAgICAgIHVpbnQyNTYgbiA9IGhhc2hlcy5sZW5ndGg7CiAgICAgICAgdWludDI1NiBrID0gaW5kZXg7CgogICAgICAgIHdoaWxlIChuID4gMSkgewogICAgICAgICAgICAvLyBHZXQgcHJvb2YgZm9yIHRoaXMgbGV2ZWwKICAgICAgICAgICAgdWludDI1NiBqID0gayAmIDEgPT0gMSA/IGsgLSAxIDogKGsgKyAxIDwgbiA/IGsgKyAxIDogayk7CiAgICAgICAgICAgIGJ5dGVzMzIgaCA9IGhhc2hlc1tqXTsKCiAgICAgICAgICAgIC8vIHByb29mLnB1c2goaCkKICAgICAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAgICAgbGVuIDo9IGFkZChsZW4sIDEpCiAgICAgICAgICAgICAgICBsZXQgcG9zIDo9IGFkZChwcm9vZiwgc2hsKDUsIGxlbikpCiAgICAgICAgICAgICAgICBtc3RvcmUocG9zLCBoKQogICAgICAgICAgICAgICAgbXN0b3JlKHByb29mLCBsZW4pCiAgICAgICAgICAgICAgICBtc3RvcmUoMHg0MCwgYWRkKHBvcywgMHgyMCkpCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGsgPj49IDE7CgogICAgICAgICAgICAvLyBDYWxjdWxhdGUgbmV4dCBsZXZlbCBvZiBoYXNoZXMKICAgICAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgbjsgaSArPSAyKSB7CiAgICAgICAgICAgICAgICBieXRlczMyIGxlZnQgPSBoYXNoZXNbaV07CiAgICAgICAgICAgICAgICBieXRlczMyIHJpZ2h0ID0gaGFzaGVzW2kgKyAxIDwgbiA/IGkgKyAxIDogaV07CiAgICAgICAgICAgICAgICAobGVmdCwgcmlnaHQpID0gbGVmdCA8PSByaWdodCA/IChsZWZ0LCByaWdodCkgOiAocmlnaHQsIGxlZnQpOwogICAgICAgICAgICAgICAgaGFzaGVzW2kgPj4gMV0gPSB5dWxLZWNjYWsyNTYobGVmdCwgcmlnaHQpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIG4gPSAobiArIChuICYgMSkpID4+IDE7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gcHJvb2Y7CiAgICB9CgogICAgZnVuY3Rpb24gdmVyaWZ5KGJ5dGVzMzJbXSBtZW1vcnkgcHJvb2YsIGJ5dGVzMzIgcm9vdCwgYnl0ZXMzMiBsZWFmKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYnl0ZXMzMiBoID0gbGVhZjsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgcHJvb2YubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgKGJ5dGVzMzIgbGVmdCwgYnl0ZXMzMiByaWdodCkgPQogICAgICAgICAgICAgICAgaCA8PSBwcm9vZltpXSA/IChoLCBwcm9vZltpXSkgOiAocHJvb2ZbaV0sIGgpOwogICAgICAgICAgICBoID0geXVsS2VjY2FrMjU2KGxlZnQsIHJpZ2h0KTsKICAgICAgICB9CgogICAgICAgIHJldHVybiBoID09IHJvb3Q7CiAgICB9Cn0K"},{fileName:"MerkleProof.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVAovLyBPcGVuWmVwcGVsaW4gQ29udHJhY3RzCgpwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCB7SGFzaGVzfSBmcm9tICIuL0hhc2hlcy5zb2wiOwoKbGlicmFyeSBNZXJrbGVQcm9vZiB7CiAgICBmdW5jdGlvbiB2ZXJpZnkoYnl0ZXMzMltdIG1lbW9yeSBwcm9vZiwgYnl0ZXMzMiByb290LCBieXRlczMyIGxlYWYpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYm9vbCkKICAgIHsKICAgICAgICByZXR1cm4gcHJvY2Vzc1Byb29mKHByb29mLCBsZWFmKSA9PSByb290OwogICAgfQoKICAgIGZ1bmN0aW9uIHByb2Nlc3NQcm9vZihieXRlczMyW10gbWVtb3J5IHByb29mLCBieXRlczMyIGxlYWYpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICBieXRlczMyIGNvbXB1dGVkSGFzaCA9IGxlYWY7CiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgcHJvb2YubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgY29tcHV0ZWRIYXNoID0gSGFzaGVzLmNvbW11dGF0aXZlS2VjY2FrMjU2KGNvbXB1dGVkSGFzaCwgcHJvb2ZbaV0pOwogICAgICAgIH0KICAgICAgICByZXR1cm4gY29tcHV0ZWRIYXNoOwogICAgfQp9Cg=="},{fileName:"Token.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIEVSQzIwICsgbWludCArIGF1dGhvcml6YXRpb24KY29udHJhY3QgVG9rZW4gewogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVzcyBpbmRleGVkIGZyb20sIGFkZHJlc3MgaW5kZXhlZCB0bywgdWludDI1NiB2YWx1ZSk7CiAgICBldmVudCBBcHByb3ZhbCgKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3duZXIsIGFkZHJlc3MgaW5kZXhlZCBzcGVuZGVyLCB1aW50MjU2IHZhbHVlCiAgICApOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwc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XJdLCAibm90IGF1dGhvcml6ZWQiKTsKICAgICAgICBfbWludCh0bywgYW1vdW50KTsKICAgIH0KfQo="}],nj=`

Example of airdrop contract using Merkle tree.

+`,OC=({prev:s,next:a})=>i.jsx(A,{version:EC,title:QC,description:TC,cyfrinLink:UC,html:LC,prev:s,next:a,codes:_C}),PC="0.8.26",$C="Merkle Airdrop",qC="Airdrop contract using Merkle tree",sj="https://www.cyfrin.io/glossary/merkle-airdrop-solidity-code-example",aj=[{fileName:"Airdrop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCB7TWVya2xlUHJvb2Z9IGZyb20gIi4vTWVya2xlUHJvb2Yuc29sIjsKCmludGVyZmFjZSBJVG9rZW4gewogICAgZnVuY3Rpb24gbWludChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IEFpcmRyb3AgewogICAgZXZlbnQgQ2xhaW0oYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpOwoKICAgIElUb2tlbiBwdWJsaWMgaW1tdXRhYmxlIHRva2VuOwogICAgYnl0ZXMzMiBwdWJsaWMgaW1tdXRhYmxlIHJvb3Q7CiAgICBtYXBwaW5nKGJ5dGVzMzIgPT4gYm9vbCkgcHVibGljIGNsYWltZWQ7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4sIGJ5dGVzMzIgX3Jvb3QpIHsKICAgICAgICB0b2tlbiA9IElUb2tlbihfdG9rZW4pOwogICAgICAgIHJvb3QgPSBfcm9vdDsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRMZWFmSGFzaChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4ga2VjY2Fr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XRlIHRva2VuOwogICAgQWlyZHJvcCBwcml2YXRlIGFpcmRyb3A7CgogICAgc3RydWN0IFJld2FyZCB7CiAgICAgICAgYWRkcmVzcyB0bzsKICAgICAgICB1aW50MjU2IGFtb3VudDsKICAgIH0KCiAgICBSZXdhcmRbXSBwcml2YXRlIHJld2FyZHM7CiAgICBieXRlczMyW10gcHJpdmF0ZSBoYXNoZXM7CiAgICBtYXBwaW5nKGJ5dGVzMzIgPT4gUmV3YXJkKSBwcml2YXRlIGhhc2hUb1Jld2FyZDsKCiAgICB1aW50MjU2IGNvbnN0YW50IE4gPSAxMDA7CgogICAgZnVuY3Rpb24gc2V0VXAoKSBwdWJsaWMgewogICAgICAgIHRva2VuID0gbmV3IFRva2VuKCJ0ZXN0IiwgIlRFU1QiLCAxOCk7CgogICAgICAgIC8vIEluaXRpYWxpemUgdXNlcnMgYW5kIGFpcmRyb3AgYW1vdW50cwogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IE47IGkrKykgewogICAgICAgICAgICByZXdhcmRzLnB1c2goCiAgICAgICAgICAgICAgICBSZXdhcmQoe3RvOiBhZGRyZXNzKHVpbnQxNjAoaSkpLCBhbW91bnQ6IChpICsgMSkgKiAxMDB9KQogICAgICAgICAgICApOwogICAgICAgICAgICBoYXNoZXMucHVzaChrZWNjYWsyNTYoYWJpLmVuY29kZShyZXdhcmRzW2ldLnRvLCByZXdhcmRzW2ldLmFtb3VudCkpKTsKICAgICAgICAgICAgaGFzaFRvUmV3YXJkW2hhc2hlc1tpXV0gPSByZXdhcmRzW2ldOwogICAgICAgIH0KCiAgICAgICAgaGFzaGVzID0gTWVya2xlSGVscGVyLnNvcnQoaGFzaGVzKTsKCiAgICAgICAgYnl0ZXMzMiByb290ID0gTWVya2xlSGVscGVyLmNhbGNSb290KGhhc2hlcyk7CgogICAgICAgIGFpcmRyb3AgPSBuZXcgQWlyZHJvcChhZGRyZXNzKHRva2VuKSwgcm9vdCk7CgogICAgICAgIHRva2VuLnNld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ICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMiB2YWx1ZSkKICAgIHsKICAgICAgICAvLy8gQHNvbGlkaXR5IG1lbW9yeS1zYWZlLWFzc2VtYmx5CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBtc3RvcmUoMHgwMCwgYSkKICAgICAgICAgICAgbXN0b3JlKDB4MjAsIGIpCiAgICAgICAgICAgIHZhbHVlIDo9IGtlY2NhazI1NigweDAwLCAweDQwKQogICAgICAgIH0KICAgIH0KfQo="},{fileName:"MerkleHelper.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmxpYnJhcnkgTWVya2xlSGVscGVyIHsKICAgIC8vIEJ1YmJsZSBzb3J0CiAgICBmdW5jdGlvbiBzb3J0KGJ5dGVzMzJbXSBtZW1vcnkgYXJyKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzJbXSBtZW1vcnkpCiAgICB7CiAgICAgICAgdWludDI1NiBuID0gYXJyLmxlbmd0aDsKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgZm9yICh1aW50MjU2IGogPSAwOyBqIDwgbiAtIDEgLSBpOyBqKyspIHsKICAgICAgICAgICAgICAgIGlmIChhcnJbal0gPiBhcnJbaiArIDFdKSB7CiAgICAgICAgICAgICAgICAgICAgKGFycltqXSwgYXJyW2ogKyAxXSkgPSAoYXJyW2ogKyAxXSwgYXJyW2pdKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIGFycjsKICAgIH0KCiAgICBmdW5jdGlvbiB5dWxLZWNjYWsyNTYoYnl0ZXMzMiBhLCBieXRlczMyIGIpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMiB2KQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbXN0b3JlKDB4MDAsIGEpCiAgICAgICAgICAgIG1zdG9yZSgweDIwLCBiKQogICAgICAgICAgICB2IDo9IGtlY2NhazI1NigweDAwLCAweDQwKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBjYWxjUm9vdChieXRlczMyW10gbWVtb3J5IGhhc2hlcykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyKQogICAgewogICAgICAgIHVpbnQyNTYgbiA9IGhhc2hlcy5sZW5ndGg7CgogICAgICAgIHdoaWxlIChuID4gMSkgewogICAgICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCBuOyBpICs9IDIpIHsKICAgICAgICAgICAgICAgIGJ5dGVzMzIgbGVmdCA9IGhhc2hlc1tpXTsKICAgICAgICAgICAgICAgIGJ5dGVzMzIgcmlnaHQgPSBoYXNoZXNbaSArIDEgPCBuID8gaSArIDEgOiBpXTsKICAgICAgICAgICAgICAgIChsZWZ0LCByaWdodCkgPSBsZWZ0IDw9IHJpZ2h0ID8gKGxlZnQsIHJpZ2h0KSA6IChyaWdodCwgbGVmdCk7CiAgICAgICAgICAgICAgICBoYXNoZXNbaSA+PiAxXSA9IHl1bEtlY2NhazI1NihsZWZ0LCByaWdodCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgbiA9IChuICsgKG4gJiAxKSkgPj4gMTsKICAgICAgICB9CgogICAgICAgIHJldHVybiBoYXNoZXNbMF07CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UHJvb2YoYnl0ZXMzMltdIG1lbW9yeSBoYXNoZXMsIHVpbnQyNTYgaW5kZXgpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMltdIG1lbW9yeSkKICAgIHsKICAgICAgICBieXRlczMyW10gbWVtb3J5IHByb29mID0gbmV3IGJ5dGVzMzJbXSgwKTsKICAgICAgICB1aW50MjU2IGxlbiA9IDA7CgogICAgICAgIHVpbnQyNTYgbiA9IGhhc2hlcy5sZW5ndGg7CiAgICAgICAgdWludDI1NiBrID0gaW5kZXg7CgogICAgICAgIHdoaWxlIChuID4gMSkgewogICAgICAgICAgICAvLyBHZXQgcHJvb2YgZm9yIHRoaXMgbGV2ZWwKICAgICAgICAgICAgdWludDI1NiBqID0gayAmIDEgPT0gMSA/IGsgLSAxIDogKGsgKyAxIDwgbiA/IGsgKyAxIDogayk7CiAgICAgICAgICAgIGJ5dGVzMzIgaCA9IGhhc2hlc1tqXTsKCiAgICAgICAgICAgIC8vIHByb29mLnB1c2goaCkKICAgICAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAgICAgbGVuIDo9IGFkZChsZW4sIDEpCiAgICAgICAgICAgICAgICBsZXQgcG9zIDo9IGFkZChwcm9vZiwgc2hsKDUsIGxlbikpCiAgICAgICAgICAgICAgICBtc3RvcmUocG9zLCBoKQogICAgICAgICAgICAgICAgbXN0b3JlKHByb29mLCBsZW4pCiAgICAgICAgICAgICAgICBtc3RvcmUoMHg0MCwgYWRkKHBvcywgMHgyMCkpCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGsgPj49IDE7CgogICAgICAgICAgICAvLyBDYWxjdWxhdGUgbmV4dCBsZXZlbCBvZiBoYXNoZXMKICAgICAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgbjsgaSArPSAyKSB7CiAgICAgICAgICAgICAgICBieXRlczMyIGxlZnQgPSBoYXNoZXNbaV07CiAgICAgICAgICAgICAgICBieXRlczMyIHJpZ2h0ID0gaGFzaGVzW2kgKyAxIDwgbiA/IGkgKyAxIDogaV07CiAgICAgICAgICAgICAgICAobGVmdCwgcmlnaHQpID0gbGVmdCA8PSByaWdodCA/IChsZWZ0LCByaWdodCkgOiAocmlnaHQsIGxlZnQpOwogICAgICAgICAgICAgICAgaGFzaGVzW2kgPj4gMV0gPSB5dWxLZWNjYWsyNTYobGVmdCwgcmlnaHQpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIG4gPSAobiArIChuICYgMSkpID4+IDE7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gcHJvb2Y7CiAgICB9CgogICAgZnVuY3Rpb24gdmVyaWZ5KGJ5dGVzMzJbXSBtZW1vcnkgcHJvb2YsIGJ5dGVzMzIgcm9vdCwgYnl0ZXMzMiBsZWFmKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYnl0ZXMzMiBoID0gbGVhZjsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgcHJvb2YubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgKGJ5dGVzMzIgbGVmdCwgYnl0ZXMzMiByaWdodCkgPQogICAgICAgICAgICAgICAgaCA8PSBwcm9vZltpXSA/IChoLCBwcm9vZltpXSkgOiAocHJvb2ZbaV0sIGgpOwogICAgICAgICAgICBoID0geXVsS2VjY2FrMjU2KGxlZnQsIHJpZ2h0KTsKICAgICAgICB9CgogICAgICAgIHJldHVybiBoID09IHJvb3Q7CiAgICB9Cn0K"},{fileName:"MerkleProof.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVAovLyBPcGVuWmVwcGVsaW4gQ29udHJhY3RzCgpwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCB7SGFzaGVzfSBmcm9tICIuL0hhc2hlcy5zb2wiOwoKbGlicmFyeSBNZXJrbGVQcm9vZiB7CiAgICBmdW5jdGlvbiB2ZXJpZnkoYnl0ZXMzMltdIG1lbW9yeSBwcm9vZiwgYnl0ZXMzMiByb290LCBieXRlczMyIGxlYWYpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYm9vbCkKICAgIHsKICAgICAgICByZXR1cm4gcHJvY2Vzc1Byb29mKHByb29mLCBsZWFmKSA9PSByb290OwogICAgfQoKICAgIGZ1bmN0aW9uIHByb2Nlc3NQcm9vZihieXRlczMyW10gbWVtb3J5IHByb29mLCBieXRlczMyIGxlYWYpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICBieXRlczMyIGNvbXB1dGVkSGFzaCA9IGxlYWY7CiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgcHJvb2YubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgY29tcHV0ZWRIYXNoID0gSGFzaGVzLmNvbW11dGF0aXZlS2VjY2FrMjU2KGNvbXB1dGVkSGFzaCwgcHJvb2ZbaV0pOwogICAgICAgIH0KICAgICAgICByZXR1cm4gY29tcHV0ZWRIYXNoOwogICAgfQp9Cg=="},{fileName:"Token.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIEVSQzIwICsgbWludCArIGF1dGhvcml6YXRpb24KY29udHJhY3QgVG9rZW4gewogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVzcyBpbmRleGVkIGZyb20sIGFkZHJlc3MgaW5kZXhlZCB0bywgdWludDI1NiB2YWx1ZSk7CiAgICBldmVudCBBcHByb3ZhbCgKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3duZXIsIGFkZHJlc3MgaW5kZXhlZCBzcGVuZGVyLCB1aW50MjU2IHZhbHVlCiAgICApOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CiAgICBtYXBwaW5nKGFkZHJlc3MgPT4gbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpKS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YWwgcmV0dXJucyAoYm9vbCkgewogICAgICAgIGFsbG93YW5jZVttc2cuc2VuZGVyXVtzcGVuZGVyXSA9IGFtb3VudDsKICAgICAgICBlbWl0IEFwcHJvdmFsKG1zZy5zZW5kZXIsIHNwZW5kZXIsIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3Mgc2VuZGVyLCBhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIGFsbG93YW5jZVtzZW5kZXJdW21zZy5zZW5kZXJdIC09IGFtb3VudDsKICAgICAgICBiYWxhbmNlT2Zbc2VuZGVyXSAtPSBhbW91bnQ7CiAgICAgICAgYmFsYW5jZU9mW3JlY2lwaWVudF0gKz0gYW1vdW50OwogICAgICAgIGVtaXQgVHJhbnNmZXIoc2VuZGVyLCByZWNpcGllbnQsIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbnQoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpIGludGVybmFsIHsKICAgICAgICBiYWxhbmNlT2ZbdG9dICs9IGFtb3VudDsKICAgICAgICB0b3RhbFN1cHBseSArPSBhbW91bnQ7CiAgICAgICAgZW1pdCBUcmFuc2ZlcihhZGRyZXNzKDApLCB0bywgYW1vdW50KTsKICAgIH0KCiAgICBmdW5jdGlvbiBtaW50KGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShhdXRob3JpemVkW21zZy5zZW5kZXJdLCAibm90IGF1dGhvcml6ZWQiKTsKICAgICAgICBfbWludCh0bywgYW1vdW50KTsKICAgIH0KfQo="}],nj=`

Example of airdrop contract using Merkle tree.

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.26;
 
@@ -479,7 +479,7 @@ Error generating stack: `+e.message+`
         }
     }
 }
-
`,lj=({prev:s,next:a})=>i.jsx(A,{version:PC,title:$C,description:qC,cyfrinLink:sj,html:nj,prev:s,next:a,codes:aj}),pj="0.8.26",ej="Assembly Binary Exponentiation",cj="Example of binary exponentiation in assembly",tj="",oj=[{fileName:"AssemblyBinExp.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5QmluRXhwIHsKICAgIC8vIEJpbmFyeSBleHBvbmVudGlhdGlvbiB0byBjYWxjdWxhdGUgeCoqbgogICAgZnVuY3Rpb24gcnBvdyh1aW50MjU2IHgsIHVpbnQyNTYgbiwgdWludDI1NiBiKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICAvLyB4ID0gMAogICAgICAgICAgICBjYXNlIDAgewogICAgICAgICAgICAgICAgc3dpdGNoIG4KICAgICAgICAgICAgICAgIC8vIG4gPSAwIC0tPiB4KipuID0gMCoqMCAtLT4gMQogICAgICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSBiIH0KICAgICAgICAgICAgICAgIC8vIG4gPiAwIC0tPiB4KipuID0gMCoqbiAtLT4gMAogICAgICAgICAgICAgICAgZGVmYXVsdCB7IHogOj0gMCB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZGVmYXVsdCB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggbW9kKG4sIDIpCiAgICAgICAgICAgICAgICAvLyB4ID4gMCBhbmQgbiBpcyBldmVuIC0tPiB6ID0gMQogICAgICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSBiIH0KICAgICAgICAgICAgICAgIC8vIHggPiAwIGFuZCBuIGlzIG9kZCAtLT4geiA9IHgKICAgICAgICAgICAgICAgIGRlZmF1bHQgeyB6IDo9IHggfQoKICAgICAgICAgICAgICAgIGxldCBoYWxmIDo9IGRpdihiLCAyKSAvLyBmb3Igcm91bmRpbmcuCiAgICAgICAgICAgICAgICAvLyBuID0gbiAvIDIsIHdoaWxlIG4gPiAwLCBuID0gbiAvIDIKICAgICAgICAgICAgICAgIGZvciB7IG4gOj0gZGl2KG4sIDIpIH0gbiB7IG4gOj0gZGl2KG4sIDIpIH0gewogICAgICAgICAgICAgICAgICAgIGxldCB4eCA6PSBtdWwoeCwgeCkKICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB4eCAvIHggIT0geAogICAgICAgICAgICAgICAgICAgIGlmIGlzemVybyhlcShkaXYoeHgsIHgpLCB4KSkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICAgICAgICAgIC8vIFJvdW5kICh4eCArIGhhbGYpIC8gYgogICAgICAgICAgICAgICAgICAgIGxldCB4eFJvdW5kIDo9IGFkZCh4eCwgaGFsZikKICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB4eFJvdW5kIDwgeHgKICAgICAgICAgICAgICAgICAgICBpZiBsdCh4eFJvdW5kLCB4eCkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICAgICAgICAgIHggOj0gZGl2KHh4Um91bmQsIGIpCiAgICAgICAgICAgICAgICAgICAgLy8gaWYgbiAlIDIgPT0gMQogICAgICAgICAgICAgICAgICAgIGlmIG1vZChuLCAyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eCA6PSBtdWwoeiwgeCkKICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmV2ZXJ0IGlmIHggIT0gMCBhbmQgenggLyB4ICE9IHoKICAgICAgICAgICAgICAgICAgICAgICAgaWYgYW5kKGlzemVybyhpc3plcm8oeCkpLCBpc3plcm8oZXEoZGl2KHp4LCB4KSwgeikpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXZlcnQoMCwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAvLyBSb3VuZCAoenggKyBoYWxmKSAvIGIKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp4Um91bmQgOj0gYWRkKHp4LCBoYWxmKQogICAgICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB6eFJvdW5kIDwgengKICAgICAgICAgICAgICAgICAgICAgICAgaWYgbHQoenhSb3VuZCwgengpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICAgICAgICAgICAgICAgICAgeiA6PSBkaXYoenhSb3VuZCwgYikKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0K"}],rj=`

Example of binary exponentiation in assembly

+`,lj=({prev:s,next:a})=>i.jsx(A,{version:PC,title:$C,description:qC,cyfrinLink:sj,html:nj,prev:s,next:a,codes:aj}),pj="0.8.26",ej="Assembly Binary Exponentiation",cj="Example of binary exponentiation in assembly",tj="https://www.cyfrin.io/glossary/assembly-binary-exponentiation-solidity-code-example",oj=[{fileName:"AssemblyBinExp.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5QmluRXhwIHsKICAgIC8vIEJpbmFyeSBleHBvbmVudGlhdGlvbiB0byBjYWxjdWxhdGUgeCoqbgogICAgZnVuY3Rpb24gcnBvdyh1aW50MjU2IHgsIHVpbnQyNTYgbiwgdWludDI1NiBiKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICAvLyB4ID0gMAogICAgICAgICAgICBjYXNlIDAgewogICAgICAgICAgICAgICAgc3dpdGNoIG4KICAgICAgICAgICAgICAgIC8vIG4gPSAwIC0tPiB4KipuID0gMCoqMCAtLT4gMQogICAgICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSBiIH0KICAgICAgICAgICAgICAgIC8vIG4gPiAwIC0tPiB4KipuID0gMCoqbiAtLT4gMAogICAgICAgICAgICAgICAgZGVmYXVsdCB7IHogOj0gMCB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZGVmYXVsdCB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggbW9kKG4sIDIpCiAgICAgICAgICAgICAgICAvLyB4ID4gMCBhbmQgbiBpcyBldmVuIC0tPiB6ID0gMQogICAgICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSBiIH0KICAgICAgICAgICAgICAgIC8vIHggPiAwIGFuZCBuIGlzIG9kZCAtLT4geiA9IHgKICAgICAgICAgICAgICAgIGRlZmF1bHQgeyB6IDo9IHggfQoKICAgICAgICAgICAgICAgIGxldCBoYWxmIDo9IGRpdihiLCAyKSAvLyBmb3Igcm91bmRpbmcuCiAgICAgICAgICAgICAgICAvLyBuID0gbiAvIDIsIHdoaWxlIG4gPiAwLCBuID0gbiAvIDIKICAgICAgICAgICAgICAgIGZvciB7IG4gOj0gZGl2KG4sIDIpIH0gbiB7IG4gOj0gZGl2KG4sIDIpIH0gewogICAgICAgICAgICAgICAgICAgIGxldCB4eCA6PSBtdWwoeCwgeCkKICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB4eCAvIHggIT0geAogICAgICAgICAgICAgICAgICAgIGlmIGlzemVybyhlcShkaXYoeHgsIHgpLCB4KSkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICAgICAgICAgIC8vIFJvdW5kICh4eCArIGhhbGYpIC8gYgogICAgICAgICAgICAgICAgICAgIGxldCB4eFJvdW5kIDo9IGFkZCh4eCwgaGFsZikKICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB4eFJvdW5kIDwgeHgKICAgICAgICAgICAgICAgICAgICBpZiBsdCh4eFJvdW5kLCB4eCkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICAgICAgICAgIHggOj0gZGl2KHh4Um91bmQsIGIpCiAgICAgICAgICAgICAgICAgICAgLy8gaWYgbiAlIDIgPT0gMQogICAgICAgICAgICAgICAgICAgIGlmIG1vZChuLCAyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eCA6PSBtdWwoeiwgeCkKICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmV2ZXJ0IGlmIHggIT0gMCBhbmQgenggLyB4ICE9IHoKICAgICAgICAgICAgICAgICAgICAgICAgaWYgYW5kKGlzemVybyhpc3plcm8oeCkpLCBpc3plcm8oZXEoZGl2KHp4LCB4KSwgeikpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXZlcnQoMCwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAvLyBSb3VuZCAoenggKyBoYWxmKSAvIGIKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp4Um91bmQgOj0gYWRkKHp4LCBoYWxmKQogICAgICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB6eFJvdW5kIDwgengKICAgICAgICAgICAgICAgICAgICAgICAgaWYgbHQoenhSb3VuZCwgengpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICAgICAgICAgICAgICAgICAgeiA6PSBkaXYoenhSb3VuZCwgYikKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0K"}],rj=`

Example of binary exponentiation in assembly

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.26;
 
@@ -536,7 +536,7 @@ Error generating stack: `+e.message+`
         }
     }
 }
-
`,ij=({prev:s,next:a})=>i.jsx(A,{version:pj,title:ej,description:cj,cyfrinLink:tj,html:rj,prev:s,next:a,codes:oj}),gj="0.8.26",hj="Bi-Directional Payment Channel",Ij="An example of bi-directional payment channels in Solidity",dj="",Cj=[{fileName:"BiDirectionalPaymentChannel.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9FQ0RTQS5zb2wiOwoKLyoKT3BlbmluZyBhIGNoYW5uZWwKMS4gQWxpY2UgYW5kIEJvYiBmdW5kIGEgbXVsdGktc2lnIHdhbGxldAoyLiBQcmVjb21wdXRlIHBheW1lbnQgY2hhbm5lbCBhZGRyZXNzCjMuIEFsaWNlIGFuZCBCb2IgZXhjaGFuZ2VzIHNpZ25hdHVyZXMgb2YgaW5pdGlhbCBiYWxhbmNlcwo0LiBBbGljZSBhbmQgQm9iIGNyZWF0ZXMgYSB0cmFuc2FjdGlvbiB0aGF0IGNhbiBkZXBsb3kgYSBwYXltZW50IGNoYW5uZWwgZnJvbQogICB0aGUgbXVsdGktc2lnIHdhbGxldAoKVXBkYXRlIGNoYW5uZWwgYmFsYW5jZXMKMS4gUmVwZWF0IHN0ZXBzIDEgLSAzIGZyb20gb3BlbmluZyBhIGNoYW5uZWwKMi4gRnJvbSBtdWx0aS1zaWcgd2FsbGV0IGNyZWF0ZSBhIHRyYW5zYWN0aW9uIHRoYXQgd2lsbAogICAtIGRlbGV0ZSB0aGUgdHJhbnNhY3Rpb24gdGhhdCB3b3VsZCBoYXZlIGRlcGxveWVkIHRoZSBvbGQgcGF5bWVudCBjaGFubmVsCiAgIC0gYW5kIHRoZW4gY3JlYXRlIGEgdHJhbnNhY3Rpb24gdGhhdCBjYW4gZGVwbG95IGEgcGF5bWVudCBjaGFubmVsIHdpdGggdGhlCiAgICAgb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gdXNlciA9IF91c2Vyc1tpXTsKCiAgICAgICAgICAgIHJlcXVpcmUoIWlzVXNlclt1c2VyXSwgInVzZXIgbXVzdCBiZSB1bmlxdWUiKTsKICAgICAgICAgICAgdXNlcnNbaV0gPSB1c2VyOwogICAgICAgICAgICBpc1VzZXJbdXNlcl0gPSB0cnVlOwoKICAgICAgICAgICAgYmFsYW5jZXNbdXNlcl0gPSBfYmFsYW5jZXNbaV07CiAgICAgICAgfQoKICAgICAgICBleHBpcmVzQXQgPSBfZXhwaXJlc0F0OwogICAgICAgIGNoYWxsZW5nZVBlcmlvZCA9IF9jaGFsbGVuZ2VQZXJpb2Q7CiAgICB9CgogICAgZnVuY3Rpb24gdmVyaWZ5KAogICAgICAgIGJ5dGVzWzJdIG1lbW9yeSBfc2lnbmF0dXJlcywKICAgICAgICBhZGRyZXNzIF9jb250cmFjdCwKICAgICAgICBhZGRyZXNzWzJdIG1lbW9yeSBfc2lnbmVycywKICAgICAgICB1aW50MjU2WzJdIG1lbW9yeSBfYmFsYW5jZXMsCiAgICAgICAgdWludDI1NiBfbm9uY2UKICAgICkgcHVibGljIHB1cmUgcmV0dXJucyAoYm9vbCkgewogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IF9zaWduYXR1cmVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIC8qCiAgICAgICAgICAgIE5PVEU6IHNpZ24gd2l0aCBhZGRyZXNzIG9mIHRoaXMgY29udHJhY3QgdG8gcHJvdGVjdAogICAgICAgICAgICAgICAgICBhZ2FpbnMgcmVwbGF5IGF0dGFjayBvbiBvdGhlciBjb250cmFjdHMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgYm9vbCB2YWxpZCA9IF9zaWduZXJzW2ldCiAgICAgICAgICAgICAgICA9PSBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfY29udHJhY3QsIF9iYWxhbmNlcywgX25vbmNlKSkKICAgICAgICAgICAgICAgICAgICAudG9FdGhTaWduZWRNZXNzYWdlSGFzaCgpLnJlY292ZXIoX3NpZ25hdHVyZXNbaV0pOwoKICAgICAgICAgICAgaWYgKCF2YWxpZCkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gdHJ1ZTsKICAgIH0KCiAgICBtb2RpZmllciBjaGVja1NpZ25hdHVyZXMoCiAgICAgICAgYnl0ZXNbMl0gbWVtb3J5IF9zaWduYXR1cmVzLAogICAgICAgIHVpbnQyNTZbMl0gbWVtb3J5IF9iYWxhbmNlcywKICAgICAgICB1aW50MjU2IF9ub25jZQogICAgKSB7CiAgICAgICAgLy8gTm90ZTogY29weSBzdG9yYWdlIGFycmF5IHRvIG1lbW9yeQogICAgICAgIGFkZHJlc3NbMl0gbWVtb3J5IHNpZ25lcnM7CiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgdXNlcnMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgc2lnbmVyc1tpXSA9IHVzZXJzW2ldOwogICAgICAgIH0KCiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgdmVyaWZ5KF9zaWduYXR1cmVzLCBhZGRyZXNzKHRoaXMpLCBzaWduZXJzLCBfYmFsYW5jZXMsIF9ub25jZSksCiAgICAgICAgICAgICJJbnZhbGlkIHNpZ25hdHVyZSIKICAgICAgICApOwoKICAgICAgICBfOwogICAgfQoKICAgIG1vZGlmaWVyIG9ubHlVc2VyKCkgewogICAgICAgIHJlcXVpcmUoaXNVc2VyW21zZy5zZW5kZXJdLCAiTm90IHVzZXIiKTsKICAgICAgICBfOwogICAgfQoKICAgIGZ1bmN0aW9uIGNoYWxsZW5nZUV4aXQoCiAgICAgICAgdWludDI1NlsyXSBtZW1vcnkgX2JhbGFuY2VzLAogICAgICAgIHVpbnQyNTYgX25vbmNlLAogICAgICAgIGJ5dGVzWzJdIG1lbW9yeSBfc2lnbmF0dXJlcwogICAgKQogICAgICAg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c2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CgogICAgICAgIGVtaXQgV2l0aGRyYXcobXNnLnNlbmRlciwgYW1vdW50KTsKICAgIH0KfQo="},{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDgoKHVpbnQyNTYodnMpID4+IDI1NSkgKyAyNyk7CiAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzMzIgciwgYnl0ZXMzMiB2cykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIF90aHJvd0Vycm9yKGVycm9yKTsKICAgICAgICByZXR1cm4gcmVjb3ZlcmVkOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyeVJlY292ZXIoYnl0ZXMzMiBoYXNoLCB1aW50OCB2LCBieXRlczMyIHIsIGJ5dGVzMzIgcykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzLCBSZWNvdmVyRXJyb3IpCi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iBpbnN0ZWFkIDI3LzI4LCBhZGQgMjcgdG8gdiB0byBhY2NlcHQKICAgICAgICAvLyB0aGVzZSBtYWxsZWFibGUgc2lnbmF0dXJlcyBhcyB3ZWxsLgogICAgICAgIGlmICgKICAgICAgICAgICAgdWludDI1NihzKQogICAgICAgICAgICAgICAgPiAweDdGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGNUQ1NzZFNzM1N0E0NTAxRERGRTkyRjQ2NjgxQjIwQTAKICAgICAgICApIHsKICAgICAgICAgICAgcmV0dXJuIChhZGRyZXNzKDApLCBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZVMpOwogICAgICAgIH0KICAgICAgICBpZiAodiAhPSAyNyAmJiB2ICE9IDI4KSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVWKTsKICAgICAgICB9CgogICAgICAgIC8vIElmIHRoZSBzaWduYXR1cmUgaXMgdmFsaWQgKGFuZCBub3QgbWFsbGVhYmxlKSwgcmV0dXJuIHRoZSBzaWduZXIgYWRkcmVzcwogICAgICAgIGFkZHJlc3Mgc2lnbmVyID0gZWNyZWNvdmVyKGhhc2gsIHYsIHIsIHMpOwogICAgICAgIGlmIChzaWduZXIgPT0gYWRkcmVzcygwKSkgewogICAgICAgICAgICByZXR1cm4gKGFkZHJlc3MoMCksIFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKTsKICAgICAgICB9CgogICAgICAgIHJldHVybiAoc2lnbmVyLCBSZWNvdmVyRXJyb3IuTm9FcnJvcik7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIHVpbnQ4IHYsIGJ5dGVzMzIgciwgYnl0ZXMzMiBzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgKGFkZHJlc3MgcmVjb3ZlcmVkLCBSZWNvdmVyRXJyb3IgZXJyb3IpID0gdHJ5UmVjb3ZlcihoYXNoLCB2LCByLCBzKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKGJ5dGVzMzIgaGFzaCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyKQogICAgewogICAgICAgIC8vIDMyIGlzIHRoZSBsZW5ndGggaW4gYnl0ZXMgb2YgaGFzaCwKICAgICAgICAvLyBlbmZvcmNlZCBieSB0aGUgdHlwZSBzaWduYXR1cmUgYWJvdmUKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KAogICAgICAgICAgICBhYmkuZW5jb2RlUGFja2VkKCJceDE5RXRoZXJldW0gU2lnbmVkIE1lc3NhZ2U6XG4zMiIsIGhhc2gpCiAgICAgICAgKTsKICAgIH0KfQo="}],jj=`

Bi-directional payment channels allow participants Alice and Bob to repeatedly transfer Ether off chain.

+`,ij=({prev:s,next:a})=>i.jsx(A,{version:pj,title:ej,description:cj,cyfrinLink:tj,html:rj,prev:s,next:a,codes:oj}),gj="0.8.26",hj="Bi-Directional Payment Channel",Ij="An example of bi-directional payment channels in Solidity",dj="https://www.cyfrin.io/glossary/bi-directional-payment-channel-solidity-code-example",Cj=[{fileName:"BiDirectionalPaymentChannel.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9FQ0RTQS5zb2wiOwoKLyoKT3BlbmluZyBhIGNoYW5uZWwKMS4gQWxpY2UgYW5kIEJvYiBmdW5kIGEgbXVsdGktc2lnIHdhbGxldAoyLiBQcmVjb21wdXRlIHBheW1lbnQgY2hhbm5lbCBhZGRyZXNzCjMuIE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KICAgICAgICBhZGRyZXNzWzJdIG1lbW9yeSBfc2lnbmVycywKICAgICAgICB1aW50MjU2WzJdIG1lbW9yeSBfYmFsYW5jZXMsCiAgICAgICAgdWludDI1NiBfbm9uY2UKICAgICkgcHVibGljIHB1cmUgcmV0dXJucyAoYm9vbCkgewogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IF9zaWduYXR1cmVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIC8qCiAgICAgICAgICAgIE5PVEU6IHNpZ24gd2l0aCBhZGRyZXNzIG9mIHRoaXMgY29udHJhY3QgdG8gcHJvdGVjdAogICAgICAgICAgICAgICAgICBhZ2FpbnMgcmVwbGF5IGF0dGFjayBvbiBvdGhlciBjb250cmFjdHMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgYm9vbCB2YWxpZCA9IF9zaWduZXJzW2ldCiAgICAgICAgICAgICAgICA9PSBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfY29udHJhY3QsIF9iYWxhbmNlcywgX25vbmNlKSkKICAgICAgICAgICAgICAgICAgICAudG9FdGhTaWduZWRNZXNzYWdlSGFzaCgpLnJlY292ZXIoX3NpZ25hdHVyZXNbaV0pOwoKICAgICAgICAgICAgaWYgKCF2YWxpZCkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gdHJ1ZTsKICAgIH0KCiAgICBtb2RpZmllciBjaGVja1NpZ25hdHVyZXMoCiAgICAgICAgYnl0ZXNbMl0gbWVtb3J5IF9zaWduYXR1cmVzLAogICAgICAgIHVpbnQyNTZbMl0gbWVtb3J5IF9iYWxhbmNlcywKICAgICAgICB1aW50MjU2IF9ub25jZQogICAgKSB7CiAgICAgICAgLy8gTm90ZTogY29weSBzdG9yYWdlIGFycmF5IHRvIG1lbW9yeQogICAgICAgIGFkZHJlc3NbMl0gbWVtb3J5IHNpZ25lcnM7CiAgICAgICAg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xpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gd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BhYmkuZW5jb2RlUGFja2VkKCJceDE5RXRoZXJldW0gU2lnbmVkIE1lc3NhZ2U6XG4zMiIsIGhhc2gpCiAgICAgICAgKTsKICAgIH0KfQo="}],jj=`

Bi-directional payment channels allow participants Alice and Bob to repeatedly transfer Ether off chain.

Payments can go both ways, Alice pays Bob and Bob pays Alice.

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.26;
@@ -852,7 +852,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
         );
     }
 }
-
`,Aj=({prev:s,next:a})=>i.jsx(A,{version:gj,title:hj,description:Ij,cyfrinLink:dj,html:jj,prev:s,next:a,codes:Cj}),uj="0.8.26",yj="Precompute Contract Address with Create2",mj="Precompute contract address with create2",bj="",wj=[{fileName:"Create2.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgLy8gUmV0dXJucyB0aGUgYWRkcmVzcyBvZiB0aGUgbmV3bHkgZGVwbG95ZWQgY29udHJhY3QKICAgIGZ1bmN0aW9uIGRlcGxveShhZGRyZXNzIF9vd25lciwgdWludDI1NiBfZm9vLCBieXRlczMyIF9zYWx0KQogICAgICAgIHB1YmxpYwogICAgICAgIHBheWFibGUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIC8vIFRoaXMgc3ludGF4IGlzIGEgbmV3ZXIgd2F5IHRvIGludm9rZSBjcmVhdGUyIHdpdGhvdXQgYXNzZW1ibHksIHlvdSBqdXN0IG5lZWQgdG8gcGFzcyBzYWx0CiAgICAgICAgLy8gaHR0cHM6Ly9kb2NzLnNvbGlkaXR5bGFuZy5vcmcvZW4vbGF0ZXN0L2NvbnRyb2wtc3RydWN0dXJlcy5odG1sI3NhbHRlZC1jb250cmFjdC1jcmVhdGlvbnMtY3JlYXRlMgogICAgICAgIHJldHVybiBhZGRyZXNzKG5ldyBUZXN0Q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aGlzKSArIHMgKyBrZWNjYWsyNTYobWVtW3DigKYocCtuKSkpCiAgICAgICAgICAgICAgcyA9IGJpZy1lbmRpYW4gMjU2LWJpdCB2YWx1ZQogICAgICAgICovCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBhZGRyIDo9CiAgICAgICAgICAgICAgICBjcmVhdGUyKAogICAgICAgICAgICAgICAgICAgIGNhbGx2YWx1ZSgpLCAvLyB3ZWkgc2VudCB3aXRoIGN1cnJlbnQgY2FsbAogICAgICAgICAgICAgICAgICAgIC8vIEFjdHVhbCBjb2RlIHN0YXJ0cyBhZnRlciBza2lwcGluZyB0aGUgZmlyc3QgMzIgYnl0ZXMKICAgICAgICAgICAgICAgICAgICBhZGQoYnl0ZWNvZGUsIDB4MjApLAogICAgICAgICAgICAgICAgICAgIG1sb2FkKGJ5dGVjb2RlKSwgLy8gTG9hZCB0aGUgc2l6ZSBvZiBjb2RlIGNvbnRhaW5lZCBpbiB0aGUgZmlyc3QgMzIgYnl0ZXMKICAgICAgICAgICAgICAgICAgICBfc2FsdCAvLyBTYWx0IGZyb20gZnVuY3Rpb24gYXJndW1lbnRzCiAgICAgICAgICAgICAgICApCgogICAgICAgICAgICBpZiBpc3plcm8oZXh0Y29kZXNpemUoYWRkcikpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CgogICAgICAgIGVtaXQgRGVwbG95ZWQoYWRkciwgX3NhbHQpOwogICAgfQp9Cgpjb250cmFjdCBUZXN0Q29udHJhY3QgewogICAgYWRkcmVzcyBwdWJsaWMgb3duZXI7CiAgICB1aW50MjU2IHB1YmxpYyBmb287CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfb3duZXIsIHVpbnQyNTYgX2ZvbykgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICAgICAgZm9vID0gX2ZvbzsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRCYWxhbmNlKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],kj=`

Contract address can be precomputed, before the contract is deployed, using create2

+`,Aj=({prev:s,next:a})=>i.jsx(A,{version:gj,title:hj,description:Ij,cyfrinLink:dj,html:jj,prev:s,next:a,codes:Cj}),uj="0.8.26",yj="Precompute Contract Address with Create2",mj="Precompute contract address with create2",bj="https://www.cyfrin.io/glossary/precompute-contract-address-with-create2-solidity-code-example",wj=[{fileName:"Create2.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgLy8gUmV0dXJucyB0aGUgYWRkcmVzcyBvZiB0aGUgbmV3bHkgZGVwbG95ZWQgY29udHJhY3QKICAgIGZ1bmN0aW9uIGRlcGxveShhZGRyZXNzIF9vd25lciwgdWludDI1NiBfZm9vLCBieXRlczMyIF9zYWx0KQogICAgICAgIHB1YmxpYwogICAgICAgIHBheWFibGUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIC8vIFRoaXMgc3ludGF4IGlzIGEgbmV3ZXIgd2F5IHRvIGludm9rZSBjcmVhdGUyIHdpdGhvdXQgYXNzZW1ibHksIHlvdSBqdXN0IG5lZWQgdG8gcGFzcyBzYWx0CiAgICAgICAgLy8gaHR0cHM6Ly9kb2NzLnNvbGlkaXR5bGFuZy5vcmcvZW4vbGF0ZXN0L2NvbnRyb2wtc3RydWN0dXJlcy5odG1sI3NhbHRlZC1jb250cmFjdC1jcmVhdGlvbnMtY3JlYXRlMgogICAgICAgIHJldHVybiBhZGRyZXNzKG5ldyBUZXN0Q29udHJhY3R7c2FsdDogX3NhbHR9KF9vd25lciwgX2ZvbykpOwogICAgfQp9CgovLyBUaGlzIGlzIHRoZSBvbGRlciB3YXkgb2YgZG9pbmcgaXQgdXNpbmcgYXNzZW1ibHk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zZW1ibHkgewogICAgICAgICAgICBhZGRyIDo9CiAgICAgICAgICAgICAgICBjcmVhdGUyKAogICAgICAgICAgICAgICAgICAgIGNhbGx2YWx1ZSgpLCAvLyB3ZWkgc2VudCB3aXRoIGN1cnJlbnQgY2FsbAogICAgICAgICAgICAgICAgICAgIC8vIEFjdHVhbCBjb2RlIHN0YXJ0cyBhZnRlciBza2lwcGluZyB0aGUgZmlyc3QgMzIgYnl0ZXMKICAgICAgICAgICAgICAgICAgICBhZGQoYnl0ZWNvZGUsIDB4MjApLAogICAgICAgICAgICAgICAgICAgIG1sb2FkKGJ5dGVjb2RlKSwgLy8gTG9hZCB0aGUgc2l6ZSBvZiBjb2RlIGNvbnRhaW5lZCBpbiB0aGUgZmlyc3QgMzIgYnl0ZXMKICAgICAgICAgICAgICAgICAgICBfc2FsdCAvLyBTYWx0IGZyb20gZnVuY3Rpb24gYXJndW1lbnRzCiAgICAgICAgICAgICAgICApCgogICAgICAgICAgICBpZiBpc3plcm8oZXh0Y29kZXNpemUoYWRkcikpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CgogICAgICAgIGVtaXQgRGVwbG95ZWQoYWRkciwgX3NhbHQpOwogICAgfQp9Cgpjb250cmFjdCBUZXN0Q29udHJhY3QgewogICAgYWRkcmVzcyBwdWJsaWMgb3duZXI7CiAgICB1aW50MjU2IHB1YmxpYyBmb287CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfb3duZXIsIHVpbnQyNTYgX2ZvbykgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICAgICAgZm9vID0gX2ZvbzsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRCYWxhbmNlKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],kj=`

Contract address can be precomputed, before the contract is deployed, using create2

// 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",Bj="Crowd Fund",Gj="An example of crowd funding contract",fj="",Vj=[{fileName:"CrowdFund.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcywgYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7Cn0KCmNvbnRyYWN0IENyb3dkRnVuZCB7CiAgICBldmVudCBMYXVuY2goCiAgICAgICAgdWludDI1NiBpZCwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgY3JlYXRvciwKICAgICAgICB1aW50MjU2IGdvYWwsCiAgICAgICAgdWludDMyIHN0YXJ0QXQsCiAgICAgICAgdWludDMyIGVuZEF0CiAgICApOwogICAgZXZlbnQgQ2FuY2VsKHVpbnQyNTYgaWQpOwogICAgZXZlbnQgUGxlZGdlKHVpbnQyNTYgaW5kZXhlZCBpZCwgYWRkcmVzcyBpbmRleGVkIGNhbGxlciwgdWludDI1NiBhbW91bnQpOwogICAgZXZlbnQgVW5wbGVkZ2UodWludDI1NiBpbmRleGVkIGlkLCBhZGRyZXNzIGluZGV4ZWQgY2FsbGVyLCB1aW50MjU2IGFtb3VudCk7CiAgICBldmVudCBDbGFpbSh1aW50MjU2IGlkKTsKICAgIGV2ZW50IFJlZnVuZCh1aW50MjU2IGlkLCBhZGRyZXNzIGluZGV4ZWQgY2FsbGVyLCB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EFtb3VudFtfaWRdW21zZy5zZW5kZXJdOwogICAgICAgIHBsZWRnZWRBbW91bnRbX2lkXVttc2cuc2VuZGVyXSA9IDA7CiAgICAgICAgdG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgYmFsKTsKCiAgICAgICAgZW1pdCBSZWZ1bmQoX2lkLCBtc2cuc2VuZGVyLCBiYWwpOwogICAgfQp9Cg=="}],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="https://www.cyfrin.io/glossary/crowd-fund-solidity-code-example",Vj=[{fileName:"CrowdFund.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcywgYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7Cn0KCmNvbnRyYWN0IENyb3dkRnVuZCB7CiAgICBldmVudCBMYXVuY2goCiAgICAgICAgdWludDI1NiBpZCwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgY3JlYXRvciwKICAgICAgICB1aW50MjU2IGdvYWwsCiAgICAgICAgdWludDMyIHN0YXJ0QXQsCiAgICAgICAgdWludDMyIGVuZEF0CiAgICApOwogICAgZXZlbnQgQ2FuY2VsKHVpbnQyNTYgaWQpOwogICAgZXZlbnQgUGxlZGdlKHVpbnQyNTYgaW5kZXhlZCBpZCwgYWRkcmVzcyBpbmRleGVkIGNhbGxlciwgdWludDI1NiBhbW91bnQpOwogICAgZXZlbnQgVW5wbG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pcmUoYmxvY2sudGltZXN0YW1wID4gY2FtcGFpZ24uZW5kQXQsICJub3QgZW5kZWQiKTsKICAgICAgICByZXF1aXJlKGNhbXBhaWduLnBsZWRnZWQgPCBjYW1wYWlnbi5nb2FsLCAicGxlZGdlZCA+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: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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFByb3h5IHsKICAgIGV2ZW50IERlcGxveShhZGRyZXNzKTsKCiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIGZ1bmN0aW9uIGRlcGxveShieXRlcyBtZW1vcnkgX2NvZGUpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcyBhZGRyKQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gY3JlYXRlKHYsIHAsIG4pCiA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ICAgIHVpbnQyNTYgcHVibGljIHk7CgogICAgY29uc3RydWN0b3IodWludDI1NiBfeCwgdWludDI1NiBfeSkgcGF5YWJsZSB7CiAgICAgICAgeCA9IF94OwogICAgICAgIHkgPSBfeTsKICAgIH0KfQoKY29udHJhY3QgSGVscGVyIHsKICAgIGZ1bmN0aW9uIGdldEJ5dGVjb2RlMSgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgYnl0ZXMgbWVtb3J5IGJ5dGVjb2RlID0gdHlwZShUZXN0Q29udHJhY3QxKS5jcmVhdGlvbkNvZGU7CiAgICAgICAgcmV0dXJuIGJ5dGVjb2RlOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEJ5dGVjb2RlMih1aW50MjU2IF94LCB1aW50MjU2IF95KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkKICAgIHsKICAgICAgICBieXRlcyBtZW1vcnkgYnl0ZWNvZGUgPSB0eXBlKFRlc3RDb250cmFjdDIpLmNyZWF0aW9uQ29kZTsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVBhY2tlZChieXRlY29kZSwgYWJpLmVuY29kZShfeCwgX3kpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRDYWxsZGF0YShhZGRyZXNzIF9vd25lcikgZXh0ZXJuYWwgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoInNldE93bmVyKGFkZHJlc3MpIiwgX293bmVyKTsKICAgIH0KfQo="}],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="https://www.cyfrin.io/glossary/deploy-any-contract-solidity-code-example",Fj=[{fileName:"Proxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFByb3h5IHsKICAgIGV2ZW50IERlcGxveShhZGRyZXNzKTsKCiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIGZ1bmN0aW9uIGRlcGxveShieXRlcyBtZW1vcnkgX2NvZGUpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcyBhZGRyKQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gY3JlYXRlKHYsIHAsIG4pCiAgICAgICAgICAgIC8vIHYgPSBhbW91bnQgb2YgRVRIIHRvIHNlbmQKICAgICAgICAgICAgLy8gcCA9IHBvaW50ZXIgaW4gbWVtb3J5IHRvIHN0YXJ0IG9mIGNvZGUKICAgICAgICAgICAgLy8gbiA9IHNpemUgb2YgY29kZQogICAgICAgICAgICBhZGRyIDo9IGNyZWF0ZShjYWxsdmFsdWUoKSwgYWRkKF9jb2RlLCAweDIwKSwgbWxvYWQoX2NvZGUpKQogICAgICAgIH0KICAgICAgICAvLyByZXR1cm4gYWRkcmVzcyAwIG9uIGVycm9yCiAgICAgICAgcmVxdWlyZShhZGRyICE9IGFkZHJlc3MoMCksICJkZXBsb3kgZmFpbGVkIik7CgogICAgICAgIGVtaXQgRGVwbG95KGFkZHIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4ZWN1dGUoYWRkcmVzcyBfdGFyZ2V0LCBieXRlcyBtZW1vcnkgX2RhdGEpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIChib29sIHN1Y2Nlc3MsKSA9IF90YXJnZXQuY2FsbHt2YWx1ZTogbXNnLnZhbHVlfShfZGF0YSk7CiAgICAgICAgcmVxd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XR1cm4gYWJpLmVuY29kZVBhY2tlZChieXRlY29kZSwgYWJpLmVuY29kZShfeCwgX3kpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRDYWxsZGF0YShhZGRyZXNzIF9vd25lcikgZXh0ZXJuYWwgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoInNldE93bmVyKGFkZHJlc3MpIiwgX293bmVyKTsKICAgIH0KfQo="}],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;
    @@ -1155,7 +1155,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
             return abi.encodeWithSignature("setOwner(address)", _owner);
         }
     }
    -
    `,Mj=({prev:s,next:a})=>i.jsx(A,{version:vj,title:Rj,description:Nj,cyfrinLink:Hj,html:Kj,prev:s,next:a,codes:Fj}),Sj="0.8.26",xj="Dutch Auction",Jj="An example of Dutch auction in Solidity",zj="",Dj=[{fileName:"DutchAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIF9mcm9tLCBhZGRyZXNzIF90bywgdWludDI1NiBfbmZ0SWQpCiAgICAgICAgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IER1dGNoQXVjdGlvbiB7CiAgICB1aW50MjU2IHByaXZhdGUgY29uc3RhbnQgRFVSQVRJT04gPSA3IGRheXM7CgogICAgSUVSQzcyMSBwdWJsaWMgaW1tdXRhYmxlIG5mdDsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBuZnRJZDsKCiAgICBhZGRyZXNzIHBheWFibGU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0ZSAqIHRpbWVFbGFwc2VkOwogICAgICAgIHJldHVybiBzdGFydGluZ1ByaWNlIC0gZGlzY291bnQ7CiAgICB9CgogICAgZnVuY3Rpb24gYnV5KCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgcmVxdWlyZShibG9jay50aW1lc3RhbXAgPCBleHBpcmVzQXQsICJhdWN0aW9uIGV4cGlyZWQiKTsKCiAgICAgICAgdWludDI1NiBwcmljZSA9IGdldFByaWNlKCk7CiAgICAgICAgcmVxdWlyZShtc2cudmFsdWUgPj0gcHJpY2UsICJFVEggPCBwcmljZSIpOwoKICAgICAgICBuZnQudHJhbnNmZXJGcm9tKHNlbGxlciwgbXNnLnNlbmRlciwgbmZ0SWQpOwogICAgICAgIHVpbnQyNTYgcmVmdW5kID0gbXNnLnZhbHVlIC0gcHJpY2U7CiAgICAgICAgaWYgKHJlZnVuZCA+IDApIHsKICAgICAgICAgICAgcGF5YWJsZShtc2cuc2VuZGVyKS50cmFuc2ZlcihyZWZ1bmQpOwogICAgICAgIH0KICAgICAgICBzZWxmZGVzdHJ1Y3Qoc2VsbGVyKTsKICAgIH0KfQo="}],Ej=`

    Dutch auction for NFT.

    +`,Mj=({prev:s,next:a})=>i.jsx(A,{version:vj,title:Rj,description:Nj,cyfrinLink:Hj,html:Kj,prev:s,next:a,codes:Fj}),Sj="0.8.26",xj="Dutch Auction",Jj="An example of Dutch auction in Solidity",zj="https://www.cyfrin.io/glossary/dutch-auction-solidity-code-example",Dj=[{fileName:"DutchAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIF9mcm9tLCBhZGRyZXNzIF90bywgdWludDI1NiBfbmZ0SWQpCiAgICAgICAgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IER1dGNoQXVjdGlvbiB7CiAgICB1aW50MjU2IHByaXZhdGUgY29uc3RhbnQgRFVSQVRJT04gPSA3IGRheXM7CgogICAgSUVSQzcyMSBwdWJsaWMgaW1tdXRhYmxlIG5mdDsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBuZnRJZDsKCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIGltbXV0YWJsZSBzZWxsZXI7CiAgICB1aW50MjU2IHB1YmxpYyBpbW11dGFibGUgc3RhcnRpbmdQcmljZTsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBzdGFydEF0OwogICAgdWludDI1NiBwdWJsaWMgaW1tdXRhYmxlIGV4cGlyZXNBdDsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBkaXNjb3VudFJhdGU7CgogICAgY29uc3RydWN0b3IoCiAgICAgICAgdWludDI1NiBfc3RhcnRpbmdQcmljZSwKICAgICAgICB1aW50MjU2IF9kaXNjb3VudFJhdGUsCiAgICAgICAgYWRkcmVzcyBfbmZ0LAogICAgICAgIHVpbnQyNTYgX25mdElkCiAgICApIHsKICAgICAgICBzZWxsZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgICAgIHN0YXJ0aW5nUHJpY2UgPSBfc3RhcnRpbmdQcmljZTsKICAgICAgICBzdGFydEF0ID0gYmxvY2sudGltZXN0YW1wOwogICAgICAgIGV4cGlyZXNBdCA9IGJsb2NrLnRpbWVzdGFtcCArIERVUkFUSU9OOwogICAgICAgIGRpc2NvdW50UmF0ZSA9IF9kaXNjb3VudFJhdGU7CgogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIF9zdGFydGluZ1ByaWNlID49IF9kaXNjb3VudFJhdGUgKiBEVVJBVElPTiwgInN0YXJ0aW5nIHByaWNlIDwgbWluIgogICAgICAgICk7CgogICAgICAgIG5mdCA9IElFUkM3MjEoX25mdCk7CiAgICAgICAgbmZ0SWQgPSBfbmZ0SWQ7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UHJpY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgdWludDI1NiB0aW1lRWxhcHNlZCA9IGJsb2NrLnRpbWVzdGFtcCAtIHN0YXJ0QXQ7CiAgICAgICAgdWludDI1NiBkaXNjb3VudCA9IGRpc2NvdW50UmF0ZSAqIHRpbWVFbGFwc2VkOwogICAgICAgIHJldHVybiBzdGFydGluZ1ByaWNlIC0gZGlzY291bnQ7CiAgICB9CgogICAgZnVuY3Rpb24gYnV5KCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgcmVxdWlyZShibG9jay50aW1lc3RhbXAgPCBleHBpcmVzQXQsICJhdWN0aW9uIGV4cGlyZWQiKTsKCiAgICAgICAgdWludDI1NiBwcmljZSA9IGdldFByaWNlKCk7CiAgICAgICAgcmVxdWlyZShtc2cudmFsdWUgPj0gcHJpY2UsICJFVEggPCBwcmljZSIpOwoKICAgICAgICBuZnQudHJhbnNmZXJGcm9tKHNlbGxlciwgbXNnLnNlbmRlciwgbmZ0SWQpOwogICAgICAgIHVpbnQyNTYgcmVmdW5kID0gbXNnLnZhbHVlIC0gcHJpY2U7CiAgICAgICAgaWYgKHJlZnVuZCA+IDApIHsKICAgICAgICAgICAgcGF5YWJsZShtc2cuc2VuZGVyKS50cmFuc2ZlcihyZWZ1bmQpOwogICAgICAgIH0KICAgICAgICBzZWxmZGVzdHJ1Y3Qoc2VsbGVyKTsKICAgIH0KfQo="}],Ej=`

    Dutch auction for NFT.

    Auction

    1. Seller of NFT deploys this contract setting a starting price for the NFT.
    2. @@ -1224,7 +1224,7 @@ Closing a channel when Alice and Bob do not agree on the final balances selfdestruct(seller); } } -`,Qj=({prev:s,next:a})=>i.jsx(A,{version:Sj,title:xj,description:Jj,cyfrinLink:zj,html:Ej,prev:s,next:a,codes:Dj}),Tj="0.8.26",Uj="English Auction",_j="An example of English auction in Solidity",Lj="",Oj=[{fileName:"EnglishAuction.sol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ZXJuYWwgewogICAgICAgIHVpbnQyNTYgYmFsID0gYmlkc1ttc2cuc2VuZGVyXTsKICAgICAgICBiaWRzW21zZy5zZW5kZXJdID0gMDsKICAgICAgICBwYXlhYmxlKG1zZy5zZW5kZXIpLnRyYW5zZmVyKGJhbCk7CgogICAgICAgIGVtaXQgV2l0aGRyYXcobXNnLnNlbmRlciwgYmFsKTsKICAgIH0KCiAgICBmdW5jdGlvbiBlbmQoKSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShzdGFydGVkLCAibm90IHN0YXJ0ZWQiKTsKICAgICAgICByZXF1aXJlKGJsb2NrLnRpbWVzdGFtcCA+PSBlbmRBdCwgIm5vdCBlbmRlZCIpOwogICAgICAgIHJlcXVpcmUoIWVuZGVkLCAiZW5kZWQiKTsKCiAgICAgICAgZW5kZWQgPSB0cnVlOwogICAgICAgIGlmIChoaWdoZXN0QmlkZGVyICE9IGFkZHJlc3MoMCkpIHsKICAgICAgICAgICAgbmZ0LnNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyh0aGlzKSwgaGlnaGVzdEJpZGRlciwgbmZ0SWQpOwogICAgICAgICAgICBzZWxsZXIudHJhbnNmZXIoaGlnaGVzdEJpZCk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbmZ0LnNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyh0aGlzKSwgc2VsbGVyLCBuZnRJZCk7CiAgICAgICAgfQoKICAgICAgICBlbWl0IEVuZChoaWdoZXN0QmlkZGVyLCBoaWdoZXN0QmlkKTsKICAgIH0KfQo="}],Pj=`

      English auction for NFT.

      +`,Qj=({prev:s,next:a})=>i.jsx(A,{version:Sj,title:xj,description:Jj,cyfrinLink:zj,html:Ej,prev:s,next:a,codes:Dj}),Tj="0.8.26",Uj="English Auction",_j="An example of English auction in Solidity",Lj="https://www.cyfrin.io/glossary/english-auction-solidity-code-example",Oj=[{fileName:"EnglishAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUl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YmFsID0gYmlkc1ttc2cuc2VuZGVyXTsKICAgICAgICBiaWRzW21zZy5zZW5kZXJdID0gMDsKICAgICAgICBwYXlhYmxlKG1zZy5zZW5kZXIpLnRyYW5zZmVyKGJhbCk7CgogICAgICAgIGVtaXQgV2l0aGRyYXcobXNnLnNlbmRlciwgYmFsKTsKICAgIH0KCiAgICBmdW5jdGlvbiBlbmQoKSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShzdGFydGVkLCAibm90IHN0YXJ0ZWQiKTsKICAgICAgICByZXF1aXJlKGJsb2NrLnRpbWVzdGFtcCA+PSBlbmRBdCwgIm5vdCBlbmRlZCIpOwogICAgICAgIHJlcXVpcmUoIWVuZGVkLCAiZW5kZWQiKTsKCiAgICAgICAgZW5kZWQgPSB0cnVlOwogICAgICAgIGlmIChoaWdoZXN0QmlkZGVyICE9IGFkZHJlc3MoMCkpIHsKICAgICAgICAgICAgbmZ0LnNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyh0aGlzKSwgaGlnaGVzdEJpZGRlciwgbmZ0SWQpOwogICAgICAgICAgICBzZWxsZXIudHJhbnNmZXIoaGlnaGVzdEJpZCk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbmZ0LnNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyh0aGlzKSwgc2VsbGVyLCBuZnRJZCk7CiAgICAgICAgfQoKICAgICAgICBlbWl0IEVuZChoaWdoZXN0QmlkZGVyLCBoaWdoZXN0QmlkKTsKICAgIH0KfQo="}],Pj=`

      English auction for NFT.

      Auction

      1. Seller of NFT deploys this contract.
      2. @@ -1322,7 +1322,7 @@ Closing a channel when Alice and Bob do not agree on the final balances emit End(highestBidder, highestBid); } } -`,$j=({prev:s,next:a})=>i.jsx(A,{version:Tj,title:Uj,description:_j,cyfrinLink:Lj,html:Pj,prev:s,next:a,codes:Oj}),qj="0.8.26",sA="ERC1155",aA="Example of ERC1155 multi token in Solidity",nA="",lA=[{fileName:"ERC1155.sol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UsIGRhdGEKICAgICAgICAgICAgICAgICkgPT0gSUVSQzExNTVUb2tlblJlY2VpdmVyLm9uRVJDMTE1NVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAgICAgInVuc2FmZSB0cmFuc2ZlciIKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc2FmZUJhdGNoVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMsCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIHZhbHVlcywKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBtc2cuc2VuZGVyID09IGZyb20gfHwgaXNBcHByb3ZlZEZvckFsbFtmcm9tXVttc2cuc2VuZGVyXSwKICAgICAgICAgICAgIm5vdCBhcHByb3ZlZCIKICAgICAgICApOwogICAgICAgIHJlcXVpcmUodG8gIT0gYWRkcmVzcygwKSwgInRvID0gMCBhZGRyZXNzIik7CiAgICAgICAgcmVxdWlyZShpZHMubGVuZ3RoID09IHZhbHVlcy5sZW5ndGgsICJpZHMgbGVuZ3RoICE9IHZhbHVlcyBsZW5ndGgiKTsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGJhbGFuY2VPZltmcm9tXVtpZHNbaV1dIC09IHZhbHVlc1tpXTsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXVtpZHNbaV1dICs9IHZhbHVlc1tpXTsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXJCYXRjaChtc2cuc2VuZGVyLCBmcm9tLCB0bywgaWRzLCB2YWx1ZXMpOwoKICAgICAgICBpZiAodG8uY29kZS5sZW5ndGggPiAwKSB7CiAg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2IHZhbHVlLCBieXRlcyBtZW1vcnkgZGF0YSkKICAgICAgICBpbnRlcm5hbAogICAgewogICAgICAgIHJlcXVpcmUodG8gIT0gYWRkcmVzcygwKSwgInRvID0gMCBhZGRyZXNzIik7CgogICAgICAgIGJhbGFuY2VPZlt0b11baWRdICs9IHZhbHVlOwoKICAgICAgICBlbWl0IFRyYW5zZmVyU2luZ2xlKG1zZy5zZW5kZXIsIGFkZHJlc3MoMCksIHRvLCBpZCwgdmFsdWUpOwoKICAgICAgICBpZiAodG8uY29kZS5sZW5ndGggPiAwKSB7CiAgICAgICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgICAgICBJRVJDMTE1NVRva2VuUmVjZWl2ZXIodG8pLm9uRVJDMTE1NVJlY2VpdmVkKAogICAgICAgICAgICAgICAgICAgIG1zZy5zZW5kZXIsIGFkZHJlc3MoMCksIGlkLCB2YWx1ZSwgZGF0YQogICAgICAgICAgICAgICAgKSA9PSBJRVJDMTE1NVRva2VuUmVjZWl2ZXIub25FUkMxMTU1UmVjZWl2ZWQuc2VsZWN0b3IsCiAgICAgICAgICAgICAgICAidW5zYWZlIHRyYW5zZmVyIgogICAgICAgICAgICApOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBfYmF0Y2hNaW50KAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIGlkcywKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgdmFsdWVzLAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIGRhdGEKICAgICkgaW50ZXJuYWwgewogICAgICAgIHJlcXVpcmUodG8gIT0gYWRkcmVzcygwKSwgInRvID0gMCBhZGRyZXNzIik7CiAgICAgICAgcmVxdWlyZShpZHMubGVuZ3RoID09IHZhbHVlcy5sZW5ndGgsICJpZHMgbGVuZ3RoICE9IHZhbHVlcyBsZW5ndGgiKTsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGJhbGFuY2VPZlt0b11baWRzW2ldXSArPSB2YWx1ZXNbaV07CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyQmF0Y2gobXNnLnNlbmRlciwgYWRkcmVzcygwKSwgdG8sIGlkcywgdmFsdWVzKTsKCiAgICAgICAgaWYgKHRvLmNvZGUubGVuZ3RoID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgSUVSQzExNTVUb2tlblJlY2VpdmVyKHRvKS5vbkVSQzExNTVCYXRjaFJlY2VpdmVkKAogICAgICAgICAgICAgICAgICAgIG1zZy5zZW5kZXIsIGFkZHJlc3MoMCksIGlkcywgdmFsdWVzLCBkYXRhCiAgICAgICAgICAgICAgICApID09IElFUkMxMTU1VG9rZW5SZWNlaXZlci5vbkVSQzExNTVCYXRjaFJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAgICAgInVuc2FmZSB0cmFuc2ZlciIKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX2J1cm4oYWRkcmVzcyBmcm9tLCB1aW50MjU2IGlkLCB1aW50MjU2IHZhbHVlKSBpbnRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShmcm9tICE9IGFkZHJlc3MoMCksICJmcm9tID0gMCBhZGRyZXNzIik7CiAgICAgICAgYmFsYW5jZU9mW2Zyb21dW2lkXSAtPSB2YWx1ZTsKICAgICAgICBlbWl0IFRyYW5zZmVyU2luZ2xlKG1zZy5zZW5kZXIsIGZyb20sIGFkZHJlc3MoMCksIGlkLCB2YWx1ZSk7CiAgICB9CgogICAgZnVuY3Rpb24gX2JhdGNoQnVybigKICAgICAgICBhZGRyZXNzIGZyb20sCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIGlkcywKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgdmFsdWVzCiAgICApIGludGVybmFsIHsKICAgICAgICByZXF1a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GRhdGEgdmFsdWVzKQogICAgICAgIGV4dGVybmFsCiAgICB7CiAgICAgICAgX2JhdGNoQnVybihtc2cuc2VuZGVyLCBpZHMsIHZhbHVlcyk7CiAgICB9Cn0K"}],pA=`

        Example of ERC1155

        +`,$j=({prev:s,next:a})=>i.jsx(A,{version:Tj,title:Uj,description:_j,cyfrinLink:Lj,html:Pj,prev:s,next:a,codes:Oj}),qj="0.8.26",sA="ERC1155",aA="Example of ERC1155 multi token in Solidity",nA="https://www.cyfrin.io/glossary/erc-1155-solidity-code-example",lA=[{fileName:"ERC1155.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMTE1NSB7CiAgICBmdW5jdGlvbiBzYWZlVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTYgaWQsCiAgICAgICAgdWludDI1NiB2YWx1ZSwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsOwogICAgZnVuY3Rpb24gc2FmZUJhdGNoVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMsCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIHZhbHVlcywKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3Mgb3duZXIsIHVpbnQyNTYgaWQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBiYWxhbmNlT2ZCYXRjaChhZGRyZXNzW10gY2FsbGRhdGEgb3duZXJzLC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W5kZXhlZCBmcm9tLAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCB0bywKICAgICAgICB1aW50MjU2IGlkLAogICAgICAgIHVpbnQyNTYgdmFsdWUKICAgICk7CiAgICBldmVudCBUcmFuc2ZlckJhdGNoKAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCBvcGVyYXRvciwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgZnJvbSwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgdG8sCiAgICAgICAgdWludDI1NltdIGlkcywKICAgICAgICB1aW50MjU2W10gdmFsdWVzCiAgICApOwogICAgZXZlbnQgQXBwcm92YWxGb3JBbGwoCiAgICAgICAgYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgb3BlcmF0b3IsIGJvb2wgYXBwcm92ZWQKICAgICk7CiAgICBldmVudCBVUkkoc3RyaW5nIHZhbHVlLCB1aW50MjU2IGluZGV4ZWQgaWQpOwoKICAgIC8vIG93bmVyID0+IGlkID0+IGJhbGFuY2UKICAgIG1hcHBpbmcoYWRkcmVzcyA9PiBtYXBwaW5nKHVpbnQyNTYgPT4gdWludDI1NikpIHB1YmxpYyBiYWxhbmNlT2Y7CiAgICAvLyBvd25lciA9PiBvcGVyYXRvciA9PiBhcHByb3ZlZAogICAgbWFwcGluZyhhZGRyZXNzID0+IG1hcHBpbmcoYWRkcmVzcyA9PiBib29sKSkgcHVibGljIGlzQXBwcm92ZWRGb3JBbGw7CgogICAgZnVuY3Rpb24gYmFsYW5jZU9mQmF0Y2goYWRkcmVzc1tdIGNhbGxkYXRhIG93bmVycywgdWludDI1NltdIGNhbGxkYXRhIGlkcykKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2W10gbWVtb3J5IGJhbGFuY2VzKQogICAgewogICAgICAgIHJlcXVpcmUob3duZXJzLmxlbmd0aCA9PSBpZHMubGVuZ3RoLCAib3duZXJzIGxlbmd0a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ZbdG9dW2lkXSArPSB2YWx1ZTsKCiAgICAgICAgZW1pdCBUcmFuc2ZlclNpbmdsZShtc2cuc2VuZGVyLCBmcm9tLCB0bywgaWQsIHZhbHVlKTsKCiAgICAgICAgaWYgKHRvLmNvZGUubGVuZ3RoID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgSUVSQzExNTVUb2tlblJlY2VpdmVyKHRvKS5vbkVSQzExNTVSZWNlaXZlZCgKICAgICAgICAgICAgICAgICAgICBtc2cuc2VuZGVyLCBmcm9tLCBpZCwgdmFsdWUsIGRhdGEKICAgICAgICAgICAgICAgICkgPT0gSUVSQzExNTVUb2tlblJlY2VpdmVyLm9uRVJDMTE1NVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAgICAgInVuc2FmZSB0cmFuc2ZlciIKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc2FmZUJhdGNoVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMsCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIHZhbHVlcywKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBtc2cuc2VuZGVyID09IGZyb20gfHwgaXNBcHByb3ZlZEZvckFsbFtmcm9tXVttc2cuc2VuZGVyXSwKICAgICAgICAgICAgIm5vdCBhcHByb3ZlZCIKICAgICAgICApOwogICAgICAgIHJlcXVpcmUodG8gIT0gYWRkcmVzcygwKSwgInRvID0gMCBhZGRyZXNzIik7CiAgICAgICAgcmVxdWlyZShpZHMubGVuZ3RoID09IHZhbHVlcy5sZW5ndGgsICJpZHMgbGVuZ3RoICE9IHZhbHVlcyBsZW5ndGgiKTsKCiAgICAgICAgZm9yICh1aW50MjU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gICB1aW50MjU2W10gY2FsbGRhdGEgdmFsdWVzLAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIGRhdGEKICAgICkgaW50ZXJuYWwgewogICAgICAgIHJlcXVpcmUodG8gIT0gYWRkcmVzcygwKSwgInRvID0gMCBhZGRyZXNzIik7CiAgICAgICAgcmVxdWlyZShpZHMubGVuZ3RoID09IHZhbHVlcy5sZW5ndGgsICJpZHMgbGVuZ3RoICE9IHZhbHVlcyBsZW5ndGgiKTsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGJhbGFuY2VPZlt0b11baWRzW2ldXSArPSB2YWx1ZXNbaV07CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyQmF0Y2gobXNnLnNlbmRlciwgYWRkcmVzcygwKSwgdG8sIGlkcywgdmFsdWVzKTsKCiAgICAgICAgaWYgKHRvLmNvZGUubGVuZ3RoID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgSUVSQzExNTVUb2tlblJlY2VpdmVyKHRvKS5vbkVSQzExNTVCYXRjaFJlY2VpdmVkKAogICAgICAgICAgICAgICAgICAgIG1zZy5zZW5kZXIsIGFkZHJlc3MoMCksIGlkcywgdmFsdWVzLCBkYXRhCiAgICAgICAgICAgICAgICApID09IElFUkMxMTU1VG9rZW5SZWNlaXZlci5vbkVSQzExNTVCYXRjaFJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAgICAgInVuc2FmZSB0cmFuc2ZlciIKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX2J1cm4oYWRkcmVzcyBmcm9tLCB1aW50MjU2IGlkLCB1aW50MjU2IHZhbHVlKSBpbnRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShmcm9tICE9IGFkZHJlc3MoMCksICJmcm9tID0gMCBhZGRyZXNzIik7CiAgICAgICAgYmF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kYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICBfYmF0Y2hNaW50KG1zZy5zZW5kZXIsIGlkcywgdmFsdWVzLCBkYXRhKTsKICAgIH0KCiAgICBmdW5jdGlvbiBidXJuKHVpbnQyNTYgaWQsIHVpbnQyNTYgdmFsdWUpIGV4dGVybmFsIHsKICAgICAgICBfYnVybihtc2cuc2VuZGVyLCBpZCwgdmFsdWUpOwogICAgfQoKICAgIGZ1bmN0aW9uIGJhdGNoQnVybih1aW50MjU2W10gY2FsbGRhdGEgaWRzLCB1aW50MjU2W10gY2FsbGRhdGEgdmFsdWVzKQogICAgICAgIGV4dGVybmFsCiAgICB7CiAgICAgICAgX2JhdGNoQnVybihtc2cuc2VuZGVyLCBpZHMsIHZhbHVlcyk7CiAgICB9Cn0K"}],pA=`

        Example of ERC1155

        // SPDX-License-Identifier: MIT
         pragma solidity ^0.8.26;
         
        @@ -1583,7 +1583,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
                 _batchBurn(msg.sender, ids, values);
             }
         }
        -
        `,eA=({prev:s,next:a})=>i.jsx(A,{version:qj,title:sA,description:aA,cyfrinLink:nA,html:pA,prev:s,next:a,codes:lA}),cA="0.8.26",tA="ERC20",oA="Example of ERC20 token in Solidity",rA="",iA=[{fileName:"ERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9JRVJDMjAuc29sIjsKCmNvbnRyYWN0IEVSQzIwIGlzIElFUkMyMCB7CiAgICBldmVudCBUcmFuc2ZlcihhZGRyZXNzIGluZGV4ZWQgZnJvbSwgYWRkcmVzcyBpbmRleGVkIHRvLCB1aW50MjU2IHZhbHVlKTsKICAgIGV2ZW50IEFwcHJvdmFsKAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCBvd25lciwgYWRkcmVzcyBpbmRleGVkIHNwZW5kZXIsIHVpbnQyNTYgdmFsdWUKICAgICk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ICAgICAgICApOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHRva2VuMi5hbGxvd2FuY2Uob3duZXIyLCBhZGRyZXNzKHRoaXMpKSA+PSBhbW91bnQyLAogICAgICAgICAgICAiVG9rZW4gMiBhbGxvd2FuY2UgdG9vIGxvdyIKICAgICAgICApOwoKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjEsIG93bmVyMSwgb3duZXIyLCBhbW91bnQxKTsKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjIsIG93bmVyMiwgb3duZXIxLCBhbW91bnQyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfc2FmZVRyYW5zZmVyRnJvbSgKICAgICAgICBJRVJDMjAgdG9rZW4sCiAgICAgICAgYWRkcmVzcyBzZW5kZXIsCiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQsCiAgICAgICAgdWludDI1NiBhbW91bnQKICAgICkgcHJpdmF0ZSB7CiAgICAgICAgYm9vbCBzZW50ID0gdG9rZW4udHJhbnNmZXJGcm9tKHNlbmRlciwgcmVjaXBpZW50LCBhbW91bnQpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIlRva2VuIHRyYW5zZmVyIGZhaWxlZCIpOwogICAgfQp9Cg=="}],gA=`

        Any contract that follow the ERC20 standard is a ERC20 token.

        +`,eA=({prev:s,next:a})=>i.jsx(A,{version:qj,title:sA,description:aA,cyfrinLink:nA,html:pA,prev:s,next:a,codes:lA}),cA="0.8.26",tA="ERC20",oA="Example of ERC20 token in Solidity",rA="https://www.cyfrin.io/glossary/erc-20-solidity-code-example",iA=[{fileName:"ERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9JRVJDMjAuc29sIjsKCmNvbnRyYWN0IEVSQzIwIGlzIElFUkMyMCB7CiAgICBldmVudCBUcmFuc2ZlcihhZGRyZXNzI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PSBvd25lcjIsICJOb3QgYXV0aG9yaXplZCIpOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHRva2VuMS5hbGxvd2FuY2Uob3duZXIxLCBhZGRyZXNzKHRoaXMpKSA+PSBhbW91bnQxLAogICAgICAgICAgICAiVG9rZW4gMSBhbGxvd2FuY2UgdG9vIGxvdyIKICAgICAgICApOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHRva2VuMi5hbGxvd2FuY2Uob3duZXIyLCBhZGRyZXNzKHRoaXMpKSA+PSBhbW91bnQyLAogICAgICAgICAgICAiVG9rZW4gMiBhbGxvd2FuY2UgdG9vIGxvdyIKICAgICAgICApOwoKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjEsIG93bmVyMSwgb3duZXIyLCBhbW91bnQxKTsKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjIsIG93bmVyMiwgb3duZXIxLCBhbW91bnQyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfc2FmZVRyYW5zZmVyRnJvbSgKICAgICAgICBJRVJDMjAgdG9rZW4sCiAgICAgICAgYWRkcmVzcyBzZW5kZXIsCiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQsCiAgICAgICAgdWludDI1NiBhbW91bnQKICAgICkgcHJpdmF0ZSB7CiAgICAgICAgYm9vbCBzZW50ID0gdG9rZW4udHJhbnNmZXJGcm9tKHNlbmRlciwgcmVjaXBpZW50LCBhbW91bnQpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIlRva2VuIHRyYW5zZmVyIGZhaWxlZCIpOwogICAgfQp9Cg=="}],gA=`

        Any contract that follow the ERC20 standard is a ERC20 token.

        ERC20 tokens provide functionalities to

        • transfer tokens
        • @@ -1777,7 +1777,7 @@ How to swap tokens require(sent, "Token transfer failed"); } } -`,hA=({prev:s,next:a})=>i.jsx(A,{version:cA,title:tA,description:oA,cyfrinLink:rA,html:gA,prev:s,next:a,codes:iA}),IA="0.8.26",dA="ERC721",CA="Example of ERC721 non fungible token in Solidity",jA="",AA=[{fileName:"ERC721.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMTY1IHsKICAgIGZ1bmN0aW9uIHN1cHBvcnRzSW50ZXJmYWNlKGJ5dGVzNCBpbnRlcmZhY2VJRCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChib29sKTsKfQoKaW50ZXJmYWNlIElFUkM3MjEgaXMgSUVSQzE2NSB7CiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBvd25lcikgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2IGJhbGFuY2UpOwogICAgZnVuY3Rpb24gb3duZXJPZih1aW50MjU2IHRva2VuSWQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYWRkcmVzcyBvd25lcik7CiAgICBmdW5jdGlvbiBzYWZlVHJhbnNmZXJGcm9tKGFkZHJlc3MgZnJvbSwgYWRkcmVzcyB0bywgdWludDI1NiB0b2tlbklkKQogICAgICAgIGV4dGVybmFsOwogICAgZnVuY3Rpb24gc2FmZVRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIGZyb20sCiAgICAgICAgYWRkcmVzcyB0bywKICAgICAgICB1aW50MjU2IHRva2VuSWQsCiAgICAgICAgYnl0ZXMgY2FsbGRhdGEgZGF0YQogICAgKSBleHRlcm5hbDsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIGZyb20sIGFkZHJlc3MgdG8sIHVpbnQyNTYgdG9rZW5JZCkgZXh0ZXJuYWw7CiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3MgdG8sIHVpbnQyNTYgdG9rZW5JZCkgZXh0ZXJuYWw7CiAgICBmdW5jdGlvbiBnZXRBcHByb3ZlZCh1aW50M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ICB0by5jb2RlLmxlbmd0aCA9PSAwCiAgICAgICAgICAgICAgICB8fCBJRVJDNzIxUmVjZWl2ZXIodG8pLm9uRVJDNzIxUmVjZWl2ZWQobXNnLnNlbmRlciwgZnJvbSwgaWQsICIiKQogICAgICAgICAgICAgICAgICAgID09IElFUkM3MjFSZWNlaXZlci5vbkVSQzcyMVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAidW5zYWZlIHJlY2lwaWVudCIKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHNhZmVUcmFuc2ZlckZyb20oCiAgICAgICAgYWRkcmVzcyBmcm9tLAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludDI1NiBpZCwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICB0cmFuc2ZlckZyb20oZnJvbSwgdG8sIGlkKTsKCiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgdG8uY29kZS5sZW5ndGggPT0gMAogICAgICAgICAgICAgICAgfHwgSUVSQzcyMVJlY2VpdmVyKHRvKS5vbkVSQzcyMVJlY2VpdmVkKG1zZy5zZW5kZXIsIGZyb20sIGlkLCBkYXRhKQogICAgICAgICAgICAgICAgICAgID09IElFUkM3MjFSZWNlaXZlci5vbkVSQzcyMVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAidW5zYWZlIHJlY2lwaWVudCIKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgdG8sIHVpbnQyNTYgaWQpIGludGVybmFsIHsKICAgICAgICByZXF1aXJlKHRvICE9IGFkZHJlc3MoMCksICJtaW50IHRvIHplcm8gYWRkcmVzcyIpOwogICAgICAgIHJlcXVpcmUoX293bmVyT2ZbaWRdID09IGFkZHJlc3MoMCksICJhbHJlYWR5IG1pbnRlZCIpOwoKICAgICAgICBfYmFsYW5jZU9mW3RvXSsrOwogICAgICAgIF9vd25lck9mW2lkXSA9IHRvOwoKICAgICAgICBlbWl0IFRyYW5zZmVyKGFkZHJlc3MoMCksIHRvLCBpZCk7CiAgICB9CgogICAgZnVuY3Rpb24gX2J1cm4odWludDI1NiBpZCkgaW50ZXJuYWwgewogICAgICAgIGFkZHJlc3Mgb3duZXIgPSBfb3duZXJPZltpZF07CiAgICAgICAgcmVxdWlyZShvd25lciAhPSBhZGRyZXNzKDApLCAibm90IG1pbnRlZCIpOwoKICAgICAgICBfYmFsYW5jZU9mW293bmVyXSAtPSAxOwoKICAgICAgICBkZWxldGUgX293bmVyT2ZbaWRdOwogICAgICAgIGRlbGV0ZSBfYXBwcm92YWxzW2lkXTsKCiAgICAgICAgZW1pdCBUcmFuc2Zlcihvd25lciwgYWRkcmVzcygwKSwgaWQpOwogICAgfQp9Cgpjb250cmFjdCBNeU5GVCBpcyBFUkM3MjEgewogICAgZnVuY3Rpb24gbWludChhZGRyZXNzIHRvLCB1aW50MjU2IGlkKSBleHRlcm5hbCB7CiAgICAgICAgX21pbnQodG8sIGlkKTsKICAgIH0KCiAgICBmdW5jdGlvbiBidXJuKHVpbnQyNTYgaWQpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gX293bmVyT2ZbaWRdLCAibm90IG93bmVyIik7CiAgICAgICAgX2J1cm4oaWQpOwogICAgfQp9Cg=="}],uA=`

          Example of ERC721

          +`,hA=({prev:s,next:a})=>i.jsx(A,{version:cA,title:tA,description:oA,cyfrinLink:rA,html:gA,prev:s,next:a,codes:iA}),IA="0.8.26",dA="ERC721",CA="Example of ERC721 non fungible token in Solidity",jA="https://www.cyfrin.io/glossary/erc-721-solidity-code-example",AA=[{fileName:"ERC721.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMTY1IHsKICAgIGZ1bmN0aW9uIHN1cHBvcnRzSW50ZXJmYWN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NlbGVjdG9yLAogICAgICAgICAgICAidW5zYWZlIHJlY2lwaWVudCIKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHNhZmVUcmFuc2ZlckZyb20oCiAgICAgICAgYWRkcmVzcyBmcm9tLAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludDI1NiBpZCwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICB0cmFuc2ZlckZyb20oZnJvbSwgdG8sIGlkKTsKCiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgdG8uY29kZS5sZW5ndGggPT0gMAogICAgICAgICAgICAgICAgfHwgSUVSQzcyMVJlY2VpdmVyKHRvKS5vbkVSQzcyMVJlY2VpdmVkKG1zZy5zZW5kZXIsIGZyb20sIGlkLCBkYXRhKQogICAgICAgICAgICAgICAgICAgID09IElFUkM3MjFSZWNlaXZlci5vbkVSQzcyMVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAidW5zYWZlIHJlY2lwaWVudCIKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgdG8sIHVpbnQyNTYgaWQpIGludGVybmFsIHsKICAgICAgICByZXF1aXJlKHRvICE9IGFkZHJlc3MoMCksICJtaW50IHRvIHplcm8gYWRkcmVzcyIpOwogICAgICAgIHJlcXVpcmUoX293bmVyT2ZbaWRdID09IGFkZHJlc3MoMCksICJhbHJlYWR5IG1pbnRlZCIpOwoKICAgICAgICBfYmFsYW5jZU9mW3RvXSsrOwogICAgICAgIF9vd25lck9mW2lkXSA9IHRvOwoKICAgICAgICBlbWl0IFRyYW5zZmVyKGFkZHJlc3MoMCksIHRvLCBpZCk7CiAgICB9CgogICAgZnVuY3Rpb24gX2J1cm4odWludDI1NiBpZCkgaW50ZXJuYWwgewogICAgICAgIGFkZHJlc3Mgb3duZXIgPSBfb3duZXJPZltpZF07CiAgICAgICAgcmVxdWlyZShvd25lciAhPSBhZGRyZXNzKDApLCAibm90IG1pbnRlZCIpOwoKICAgICAgICBfYmFsYW5jZU9mW293bmVyXSAtPSAxOwoKICAgICAgICBkZWxldGUgX293bmVyT2ZbaWRdOwogICAgICAgIGRlbGV0ZSBfYXBwcm92YWxzW2lkXTsKCiAgICAgICAgZW1pdCBUcmFuc2Zlcihvd25lciwgYWRkcmVzcygwKSwgaWQpOwogICAgfQp9Cgpjb250cmFjdCBNeU5GVCBpcyBFUkM3MjEgewogICAgZnVuY3Rpb24gbWludChhZGRyZXNzIHRvLCB1aW50MjU2IGlkKSBleHRlcm5hbCB7CiAgICAgICAgX21pbnQodG8sIGlkKTsKICAgIH0KCiAgICBmdW5jdGlvbiBidXJuKHVpbnQyNTYgaWQpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gX293bmVyT2ZbaWRdLCAibm90IG93bmVyIik7CiAgICAgICAgX2J1cm4oaWQpOwogICAgfQp9Cg=="}],uA=`

          Example of ERC721

          // SPDX-License-Identifier: MIT
           pragma solidity ^0.8.26;
           
          @@ -1971,7 +1971,7 @@ How to swap tokens
                   _burn(id);
               }
           }
          -
          `,yA=({prev:s,next:a})=>i.jsx(A,{version:IA,title:dA,description:CA,cyfrinLink:jA,html:uA,prev:s,next:a,codes:AA}),mA="0.8.26",bA="Ether Wallet",wA="Simple example of wallet in Solidity",kA="",ZA=[{fileName:"EtherWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEV0aGVyV2FsbGV0IHsKICAgIGFkZHJlc3MgcGF5YWJsZSBwdWJsaWMgb3duZXI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHt9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcodWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IG93bmVyLCAiY2FsbGVyIGlzIG5vdCBvd25lciIpOwogICAgICAgIHBheWFibGUobXNnLnNlbmRlcikudHJhbnNmZXIoX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],WA=`

          An example of a basic wallet.

          +`,yA=({prev:s,next:a})=>i.jsx(A,{version:IA,title:dA,description:CA,cyfrinLink:jA,html:uA,prev:s,next:a,codes:AA}),mA="0.8.26",bA="Ether Wallet",wA="Simple example of wallet in Solidity",kA="https://www.cyfrin.io/glossary/ether-wallet-solidity-code-example",ZA=[{fileName:"EtherWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEV0aGVyV2FsbGV0IHsKICAgIGFkZHJlc3MgcGF5YWJsZSBwdWJsaWMgb3duZXI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHt9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcodWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IG93bmVyLCAiY2FsbGVyIGlzIG5vdCBvd25lciIpOwogICAgICAgIHBheWFibGUobXNnLnNlbmRlcikudHJhbnNmZXIoX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],WA=`

          An example of a basic wallet.

          • Anyone can send ETH.
          • Only the owner can withdraw.
          • @@ -1997,7 +1997,7 @@ How to swap tokens return address(this).balance; } } -`,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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEFHUEwtMy4wLW9ubHkKcHJhZ21hIHNvbGlkaXR5ID49MC44LjA7CgovLy8gQG5vdGljZSBNb2Rlcm4gYW5kIGdhcyBlZmZpY2llbnQgRVJDMjAgKyBFSVAtMjYxMiBpbXBsZW1lbnRhdGlvbi4KLy8vIEBhdXRob3IgU29sbWF0ZSAoaHR0cHM6Ly9naXRodWIuY29tL3RyYW5zbWlzc2lvbnMxMS9zb2xtYXRlL2Jsb2IvbWFpbi9zcmMvdG9rZW5zL0VSQzIwLnNvbCkKLy8vIEBhdXRob3IgTW9kaWZpZWQgZnJvbSBVbmlzd2FwIChodHRwczovL2dpdGh1Yi5jb20vVW5pc3dhcC91bmlzd2FwLXYyLWNvcmUvYmxvYi9tYXN0ZXIvY29udHJhY3RzL1VuaXN3YXBWMkVSQzIwLnNvbCkKLy8vIEBkZXYgRG8gbm90IG1hbnVhbGx5IHNldCBiYWxhbmNlcyB3aXRob3V0IHVwZGF0aW5nIHRvdGFsU3VwcGx5LCBhcyB0aGUgc3VtIG9mIGFsbCB1c2VyIGJhbGFuY2VzIG11c3Qgbm90IGV4Y2VlZCBpdC4KYWJzdHJhY3QgY29udHJhY3QgRVJDMjAgewogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVzcyBpbmRleGVkIGZyb20sIGFkZHJlc3MgaW5k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W50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIGFsbG93YW5jZVttc2cuc2VuZGVyXVtzcGVuZGVyXSA9IGFtb3VudDsKICAgICAgICBlbWl0IEFwcHJvdmFsKG1zZy5zZW5kZXIsIHNwZW5kZXIsIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlydHVhbAogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYmFsYW5jZU9mW21zZy5zZW5kZXJdIC09IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKG1zZy5zZW5kZXIsIHRvLCBhbW91bnQpOwogICAgICAgIHJldHVybiB0cnVlOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIGZyb20sIGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIHVpbnQyNTYgYWxsb3dlZCA9IGFsbG93YW5jZVtmcm9tXVttc2cuc2VuZGVyXTsgLy8gU2F2ZXMgZ2FzIGZvciBsaW1pdGVkIGFwcHJvdmFscy4KICAgICAgICBpZiAoYWxsb3dlZCAhPSB0eXBlKHVpbnQyNTYpLm1heCkgewogICAgICAgICAgICBhbGxvd2FuY2VbZnJvbV1bbXNnLnNlbmRlcl0gPSBhbGxvd2VkIC0gYW1vdW50OwogICAgICAgIH0KICAgICAgICBiYWxhbmNlT2ZbZnJvbV0gLT0gYW1vdW50OwoKICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICBiYWxhbmNlT2ZbdG9dICs9IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gcGVybWl0KAogICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgYWRkcmVzcyBzcGVuZGVyLAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgdWludDI1NiBkZWFkbGluZSwKICAgICAgICB1aW50OCB2LAogICAgICAgIGJ5dGVzMzIgciwKICAgICAgICBieXRlczMyIHMKICAgICkgcHVibGljIHZpcnR1YWwgewogICAgICAgIHJlcXVpcmUoZGVhZGxpbmUgPj0gYmxvY2sudGltZXN0YW1wLCAiUEVSTUlUX0RFQURMSU5FX0VYUElSRUQiKTsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYWRkcmVzcyByZWNvdmVyZWRBZGRyZXNzID0gZWNyZWNvdmVyKAogICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgIGFiaS5lbmNvZGVQYWNrZWQoCiAgICAgICAgICAgICAgICAgICAgICAgICJceDE5XHgwMSIsCiAgICAgICAgICAgICAgICAgICAgICAgIERPTUFJTl9TRVBBUkFUT1IoKSwKICAgICAgICAgICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQZXJtaXQoYWRkcmVzcyBvd25lcixhZGRyZXNzIHNwZW5kZXIsdWludDI1NiB2YWx1ZSx1aW50MjU2IG5vbmNlLHVpbnQyNTYgZGVhZGxpbmUpIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3duZXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BlbmRlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub25jZXNbb3duZXJdKyssCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVhZGxpbmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICB2LAogICAgICAgICAgICAgICAgciwKICAgICAgICAgICAgICAgIHMKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgICAgICByZWNvdmVyZWRBZGRyZXNzICE9IGFkZHJlc3MoMCkgJiYgcmVjb3ZlcmVkQWRkcmVzcyA9PSBvd25lciwKICAgICAgICAgICAgICAgICJJTlZBTElEX1NJR05FUiIKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIGFsbG93YW5jZVtyZWNvdmVyZWRBZGRyZXNzXVtzcGVuZGVyXSA9IHZhbHVlOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBBcHByb3ZhbChvd25lciwgc3BlbmRlciwgdmFsdWUpOwogICAgfQoKICAgIGZ1bmN0aW9uIERPTUFJTl9TRVBBUkFUT1IoKSBwdWJsaWMgdmlldyB2aXJ0dWFsIHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4gYmxvY2suY2hhaW5pZCA9PSBJTklUSUFMX0NIQUlOX0lECiAgICAgICAgICAgID8gSU5JVElBTF9ET01BSU5fU0VQQVJBVE9SCiAgICAgICAgICAgIDogY29tcHV0ZURvbWFpblNlcGFyYXRvcigpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbXB1dGVEb21haW5TZXBhcmF0b3IoKSBpbnRlcm5hbCB2aWV3IHZpcnR1YWwgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBrZWNjYWsyNTYoCiAgICAgICAgICAgIGFiaS5lbmNvZGUoCiAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgIkVJUDcxMkRvbWFpbihzdHJpbmcgbmFtZSxzdHJpbmcgdmVyc2lvbix1aW50MjU2IGNoYWluSWQsYWRkcmVzcyB2ZXJpZnlpbmdDb250cmFjdCkiCiAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAga2VjY2FrMjU2KGJ5dGVzKG5hbWUpKSwKICAgICAgICAgICAgICAgIGtlY2NhazI1NigiMSIpLAogICAgICAgICAgICAgICAgYmxvY2suY2hhaW5pZCwKICAgICAgICAgICAgICAgIGFkZHJlc3ModGhpcykKICAgICAgICAgICAgKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbnQoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKGFkZHJlc3MoMCksIHRvLCBhbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF9idXJuKGFkZHJlc3MgZnJvbSwgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIGJhbGFuY2VPZltmcm9tXSAtPSBhbW91bnQ7CgogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHRvdGFsU3VwcGx5IC09IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgYWRkcmVzcygwKSwgYW1vdW50KTsKICAgIH0KfQoKY29udHJhY3QgR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50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gcGVybWl0KAogICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgYWRkcmVzcyBzcGVuZGVyLAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgdWludDI1NiBkZWFkbGluZSwKICAgICAgICB1aW50OCB2LAogICAgICAgIGJ5dGVzMzIgciwKICAgICAgICBieXRlczMyIHMKICAgICkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IEdhc2xlc3NUb2tlblRyYW5zZmVyIHsKICAgIGZ1bmN0aW9uIHNlbmQoCiAgICAgICAgYWRkcmVzcyB0b2tlbiwKICAgICAgICBhZGRyZXNzIHNlbmRlciwKICAgICAgICBhZGRyZXNzIHJlY2VpdmVyLAogICAgICAgIHVpbnQyNTYgYW1vdW50LAogICAgICAgIHVpbnQyNTYgZmVlLAogICAgICAgIHVpbnQyNTYgZGVhZGxpbmUsCiAgICAgICAgLy8gUGVybWl0IHNpZ25hdHVyZQogICAgICAgIHVpbnQ4IHYsCiAgICAgICAgYnl0ZXMzMiByLAogICAgICAgIGJ5dGVzMzIgcwogICAgKSBleHRlcm5hbCB7CiAgICAgICAgLy8gUGVybWl0CiAgICAgICAgSUVSQzIwUGVybWl0KHRva2VuKS5wZXJtaXQoCiAgICAgICAgICAgIHNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50ICsgZmVlLCBkZWFkbGluZSwgdiwgciwgcwogICAgICAgICk7CiAgICAgICAgLy8gU2VuZCBhbW91bnQgdG8gcmVjZWl2ZXIKICAgICAgICBJRVJDMjBQZXJtaXQodG9rZW4pLnRyYW5zZmVyRnJvbShzZW5kZXIsIHJlY2VpdmVyLCBhbW91bnQpOwogICAgICAgIC8vIFRha2UgZmVlIC0gc2VuZCBmZWUgdG8gbXNnLnNlbmRlcgogICAgICAgIElFUkMyMFBlcm1pdCh0b2tlbikudHJhbnNmZXJGcm9tKHNlbmRlciwgbXNnLnNlbmRlciwgZmVlKTsKICAgIH0KfQo="}],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="https://www.cyfrin.io/glossary/gasless-token-transfer-solidity-code-example",XA=[{fileName:"ERC20Permit.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEFHUEwtMy4wLW9ubHkKcHJhZ21hIHNvbGlkaXR5ID49MC44LjA7CgovLy8gQG5vdGljZSBNb2Rlcm4gYW5kIGdhcyBlZmZpY2llbnQgRVJDMjAgKyBFSVAtMjYxMiBpbXBsZW1lbnRhdGlvbi4KLy8vIEBhdXRob3IgU29sbWF0ZSAoaHR0cHM6Ly9naXRodWIuY29tL3RyYW5zbWlzc2lvbnMxMS9zb2xtYXRlL2Jsb2IvbWFpbi9zcmMvdG9rZW5zL0VSQzIwLnNvbCkKLy8vIEBhdXRob3IgTW9kaWZpZWQgZnJvbSBVbmlzd2FwIChodHRwczovL2dpdGh1Yi5jb20vVW5pc3dhcC91bmlzd2FwLXYyLWNvcmUvYmxvYi9tYXN0ZXIvY29udHJhY3RzL1VuaXN3YXBWMkVSQzIwLnNvbCkKLy8vIEBkZXYgRG8gbm90IG1hbnVhbGx5IHNldCBiYWxhbmNlcyB3aXRob3V0IHVwZGF0aW5nIHRvdGFsU3VwcGx5LCBhcyB0aGUgc3VtIG9mIGFsbCB1c2VyIGJhbGFuY2VzIG11c3Qgbm90IGV4Y2VlZCBpdC4KYWJzdHJhY3QgY29udHJhY3QgRVJDMjAgewogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVzcyBpbmRleGVkIGZyb20sIGFkZHJlc3MgaW5kZXhlZCB0bywgdWludDI1NiBhbW91bnQpOwogICAgZXZl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wKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIGFsbG93YW5jZVttc2cuc2VuZGVyXVtzcGVuZGVyXSA9IGFtb3VudDsKICAgICAgICBlbWl0IEFwcHJvdmFsKG1zZy5zZW5kZXIsIHNwZW5kZXIsIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlydHVhbAogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYmFsYW5jZU9mW21zZy5zZW5kZXJdIC09IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKG1zZy5zZW5kZXIsIHRvLCBhbW91bnQpOwogICAgICAgIHJldHVybiB0cnVlOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIGZyb20sIGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIHVpbnQyNTYgYWxsb3dlZCA9IGFsbG93YW5jZVtmcm9tXVttc2cuc2VuZGVyXTsgLy8gU2F2ZXMgZ2FzIGZvciBsaW1pdGVkIGFwcHJvdmFscy4KICAgICAgICBpZiAoYWxsb3dlZCAhPSB0eXBlKHVpbnQyNTYpLm1heCkgewogICAgICAgICAgICBhbGxvd2FuY2VbZnJvbV1bbXNnLnNlbmRlcl0gPSBhbGxvd2VkIC0gYW1vdW50OwogICAgICAgIH0KICAgICAgICBiYWxhbmNlT2ZbZnJvbV0gLT0gYW1vdW50OwoKICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICBiYWxhbmNlT2ZbdG9dICs9IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gcGVybWl0KAogICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgYWRkcmVzcyBzcGVuZGVyLAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgdWludDI1NiBkZWFkbGluZSwKICAgICAgICB1aW50OCB2LAogICAgICAgIGJ5dGVzMzIgciwKICAgICAgICBieXRlczMyIHMKICAgICkgcHVibGljIHZpcnR1YWwgewogICAgICAgIHJlcXVpcmUoZGVhZGxpbmUgPj0gYmxvY2sudGltZXN0YW1wLCAiUEVSTUlUX0RFQURMSU5FX0VYUElSRUQiKTsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYWRkcmVzcyByZWNvdmVyZWRBZGRyZXNzID0gZWNyZWNvdmVyKAogICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgIGFiaS5lbmNvZGVQYWNrZWQoCiAgICAgICAgICAgICAgICAgICAgICAgICJceDE5XHgwMSIsCiAgICAgICAgICAgICAgICAgICAgICAgIERPTUFJTl9TRVBBUkFUT1IoKSwKICAgICAgICAgICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQZXJtaXQoYWRkcmVzcyBvd25lcixhZGRyZXNzIHNwZW5kZXIsdWludDI1NiB2YWx1ZSx1aW50MjU2IG5vbmNlLHVpbnQyNTYgZGVhZGxpbmUpIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3duZXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BlbmRlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub25jZXNbb3duZXJdKyssCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVhZGxpbmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICB2LAogICAgICAgICAgICAgICAgciwKICAgICAgICAgICAgICAgIHMKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgICAgICByZWNvdmVyZWRBZGRyZXNzICE9IGFkZHJlc3MoMCkgJiYgcmVjb3ZlcmVkQWRkcmVzcyA9PSBvd25lciwKICAgICAgICAgICAgICAgICJJTlZBTElEX1NJR05FUiIKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIGFsbG93YW5jZVtyZWNvdmVyZWRBZGRyZXNzXVtzcGVuZGVyXSA9IHZhbHVlOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBBcHByb3ZhbChvd25lciwgc3BlbmRlciwgdmFsdWUpOwogICAgfQoKICAgIGZ1bmN0aW9uIERPTUFJTl9TRVBBUkFUT1IoKSBwdWJsaWMgdmlldyB2aXJ0dWFsIHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4gYmxvY2suY2hhaW5pZCA9PSBJTklUSUFMX0NIQUlOX0lECiAgICAgICAgICAgID8gSU5JVElBTF9ET01BSU5fU0VQQVJBVE9SCiAgICAgICAgICAgIDogY29tcHV0ZURvbWFpblNlcGFyYXRvcigpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbXB1dGVEb21haW5TZXBhcmF0b3IoKSBpbnRlcm5hbCB2aWV3IHZpcnR1YWwgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBrZWNjYWsyNTYoCiAgICAgICAgICAgIGFiaS5lbmNvZGUoCiAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgIkVJUDcxMkRvbWFpbihzdHJpbmcgbmFtZSxzdHJpbmcgdmVyc2lvbix1aW50MjU2IGNoYWluSWQsYWRkcmVzcyB2ZXJpZnlpbmdDb250cmFjdCkiCiAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAga2VjY2FrMjU2KGJ5dGVzKG5hbWUpKSwKICAgICAgICAgICAgICAgIGtlY2NhazI1NigiMSIpLAogICAgICAgICAgICAgICAgYmxvY2suY2hhaW5pZCwKICAgICAgICAgICAgICAgIGFkZHJlc3ModGhpcykKICAgICAgICAgICAgKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbnQoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKGFkZHJlc3MoMCksIHRvLCBhbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF9idXJuKGFkZHJlc3MgZnJvbSwgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIGJhbGFuY2VPZltmcm9tXSAtPSBhbW91bnQ7CgogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHRvdGFsU3VwcGx5IC09IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgYWRkcmVzcygwKSwgYW1vdW50KTsKICAgIH0KfQoKY29udHJhY3QgRVJDMjBQZXJtaXQgaXMgRVJDMjAgewogICAgY29uc3RydWN0b3Ioc3RyaW5nIG1lbW9yeSBfbmFtZSwgc3RyaW5nIG1lbW9yeSBfc3ltYm9sLCB1aW50OCBfZGVjaW1hbHMpCiAgICAgICAgRVJDMjAoX25hbWUsIF9zeW1ib2wsIF9kZWNpbWFscykKICAgIHt9CgogICAgZnVuY3Rpb24gbWludChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkgcHVibGljIHsKICAgICAgICBfbWludCh0bywgYW1vdW50KTsKICAgIH0KfQo="},{fileName:"GaslessTokenTransfer.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmludGVyZmFjZSBJRVJDMjBQZXJtaXQgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcyBzZW5kZXIsIGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAg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ciwgZmVlKTsKICAgIH0KfQo="}],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: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.

            +`,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="https://www.cyfrin.io/glossary/iterable-mapping-solidity-code-example",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;
             
            @@ -2307,7 +2307,7 @@ How to swap tokens
                     assert(map.getKeyAtIndex(2) == address(2));
                 }
             }
            -
            `,xA=({prev:s,next:a})=>i.jsx(A,{version:NA,title:HA,description:FA,cyfrinLink:KA,html:SA,prev:s,next:a,codes:MA}),JA="0.8.26",zA="Merkle Tree",DA="Learn about Merkle tree in Solidity",EA="",QA=[{fileName:"MerkleTree.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1lcmtsZVByb29mIHsKICAgIGZ1bmN0aW9uIHZlcmlmeSgKICAgICAgICBieXRlczMyW10gbWVtb3J5IHByb29mLAogICAgICAgIGJ5dGVzMzIgcm9vdCwKICAgICAgICBieXRlczMyIGxlYWYsCiAgICAgICAgdWludDI1NiBpbmRleAogICAgKSBwdWJsaWMgcHVyZSByZXR1cm5zIChib29sKSB7CiAgICAgICAgYnl0ZXMzMiBoYXNoID0gbGVhZjsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgcHJvb2YubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgYnl0ZXMzMiBwcm9vZkVsZW1lbnQgPSBwcm9vZltpXTsKCiAgICAgICAgICAgIGlmIChpbmRleCAlIDIgPT0gMCkgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKGhhc2gsIHByb29mRWxlbWVudCkpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKHByb29mRWxlbWVudCwgaGFzaCkpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBpbmRleCA9IGluZGV4IC8gMjsKICAgICAgICB9CgogICAgICAgIHJldHVybiBoYXNoID09IHJvb3Q7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RNZXJrbGVQcm9vZiBpcyBNZXJrbGVQcm9vZiB7CiAgICBieXRlczMyW10gcHVibGljIGhhc2hlczsKCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBzdHJpbmdbNF0gbWVtb3J5IHRyYW5zYWN0aW9ucyA9CiAgICAgICAgICAgIFsiYWxpY2UgLT4gYm9iIiwgImJvYiAtPiBkYXZlIiwgImNhcm9sIC0+IGFsaWNlIiwgImRhdmUgLT4gYm9iIl07CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IHRyYW5zYWN0aW9ucy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBoYXNoZXMucHVzaChrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZCh0cmFuc2FjdGlvbnNbaV0pKSk7CiAgICAgICAgfQoKICAgICAgICB1aW50MjU2IG4gPSB0cmFuc2FjdGlvbnMubGVuZ3RoOwogICAgICAgIHVpbnQyNTYgb2Zmc2V0ID0gMDsKCiAgICAgICAgd2hpbGUgKG4gPiAwKSB7CiAgICAgICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IG4gLSAxOyBpICs9IDIpIHsKICAgICAgICAgICAgICAgIGhhc2hlcy5wdXNoKAogICAgICAgICAgICAgICAgICAgIGtlY2NhazI1NigKICAgICAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZVBhY2tlZCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc2hlc1tvZmZzZXQgKyBpXSwgaGFzaGVzW29mZnNldCArIGkgKyAxXQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBvZmZzZXQgKz0gbjsKICAgICAgICAgICAgbiA9IG4gLyAyOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBnZXRSb290KCkgcHVibGljIHZpZXcgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBoYXNoZXNbaGFzaGVzLmxlbmd0aCAtIDFdOwogICAgfQoKICAgIC8qIHZlcmlmeQogICAgM3JkIGxlYWYKICAgIDB4ZGNhMzMyNmFkN2U4MTIxYmY5Y2Y5YzEyMzMzZTZiMjI3MWFiZTgyM2VjOWVkZmU0MmY4MTNiMWU3NjhmYTU3YgoKICAgIHJvb3QKICAgIDB4Y2MwODZmY2MwMzgxODliNDY0MWRiMmNjNGYxZGUzYmIxMzJhZWZiZDY1ZDUxMGQ4MTc1OTE1NTA5Mzc4MThjNwoKICAgIGluZGV4CiAgICAyCgogICAgcHJvb2YKICAgIDB4OGRhOWUxYzgyMGY5ZGJkMTU4OWZkNjU4NTg3MmJjMTA2MzU4ODYyNTcyOWU3YWIwNzk3Y2ZjNjNhMDBiZDk1MAogICAgMHg5OTU3ODhmZmMxMDNiOTg3YWQ1MGY1ZTU3MDdmZDA5NDQxOWViMTJkOTU1MmNjNDIzYmQwY2Q4NmEzODYxNDMzCiAgICAqLwp9Cg=="}],TA=`

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

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

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

            in a set without revealing the entire set.

            // SPDX-License-Identifier: MIT
             pragma solidity ^0.8.26;
            @@ -2385,7 +2385,7 @@ How to swap tokens
                 0x995788ffc103b987ad50f5e5707fd094419eb12d9552cc423bd0cd86a3861433
                 */
             }
            -
            `,UA=({prev:s,next:a})=>i.jsx(A,{version:JA,title:zA,description:DA,cyfrinLink:EA,html:TA,prev:s,next:a,codes:QA}),_A="0.8.26",LA="Minimal Proxy Contract",OA="Deploy contracts cheaply with minimal proxy contract",PA="",$A=[{fileName:"MinimalProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIG9yaWdpbmFsIGNvZGUKLy8gaHR0cHM6Ly9naXRodWIuY29tL29wdGlvbmFsaXR5L2Nsb25lLWZhY3RvcnkvYmxvYi9tYXN0ZXIvY29udHJhY3RzL0Nsb25lRmFjdG9yeS5zb2wKCmNvbnRyYWN0IE1pbmltYWxQcm94eSB7CiAgICBmdW5jdGlvbiBjbG9uZShhZGRyZXNzIHRhcmdldCkgZXh0ZXJuYWwgcmV0dXJucyAoYWRkcmVzcyByZXN1bHQpIHsKICAgICAgICAvLyBjb252ZXJ0IGFkZHJlc3MgdG8gMjAgYnl0ZXMKICAgICAgICBieXRlczIwIHRhcmdldEJ5dGVzID0gYnl0ZXMyMCh0YXJnZXQpOwoKICAgICAgICAvLyBhY3R1YWwgY29kZSAvLwogICAgICAgIC8vIDNkNjAyZDgwNjAwYTNkMzk4MWYzMzYzZDNkMzczZDNkM2QzNjNkNzNiZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlNWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzCgogICAgICAgIC8vIGNyZWF0aW9uIGNvZGUgLy8KICAgICAgICAvLyBjb3B5IHJ1bnRpbWUgY29kZSBpbnRvIG1lbW9yeSBhbmQgcmV0dXJuIGl0CiAgICAgICAgLy8gM2Q2MDJkODA2MDBhM2QzOTgxZjMKCiAgICAgICAgLy8gcnVudGltZSBjb2RlIC8vCiAgICAgICAgLy8gY29kZSB0byBkZWxlZ2F0ZWNhbGwgdG8gYWRkcmVzcwogICAgICAgIC8vIDM2M2QzZDM3M2QzZDNkMzYzZDczIGFkZHJlc3MgNWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzCgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLyoKICAgICAgICAgICAgcmVhZHMgdGhlIDMyIGJ5dGVzIG9mIG1lbW9yeSBzdGFydGluZyBhdCBwb2ludGVyIHN0b3JlZCBpbiAweDQwCgogICAgICAgICAgICBJbiBzb2xpZGl0eSwgdGhlIDB4NDAgc2xvdCBpbiBtZW1vcnkgaXMgc3BlY2lhbDogaXQgY29udGFpbnMgdGhlICJmcmVlIG1lbW9yeSBwb2ludGVyIgogICAgICAgICAgICB3aGljaCBwb2ludHMgdG8gdGhlIGVuZCBvZiB0aGUgY3VycmVudGx5IGFsbG9jYXRlZCBtZW1vcnkuCiAgICAgICAgICAgICovCiAgICAgICAgICAgIGxldCBjbG9uZSA6PSBtbG9hZCgweDQwKQogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIgogICAgICAgICAgICBtc3RvcmUoCiAgICAgICAgICAgICAgICBjbG9uZSwKICAgICAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3MzAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICAgIHwKICAgICAgICAgICAgMHgzZDYwMmQ4MDYwMGEzZDM5ODFmMzM2M2QzZDM3M2QzZDNkMzYzZDczMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlcgogICAgICAgICAgICAqLwogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIiArIDIwIGJ5dGVzCiAgICAgICAgICAgIC8vIDB4MTQgPSAyMAogICAgICAgICAgICBtc3RvcmUoYWRkKGNsb25lLCAweDE0KSwgdGFyZ2V0Qnl0ZXMpCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gc3RvcmUgMzIgYnl0ZXMgdG8gbWVtb3J5IHN0YXJ0aW5nIGF0ICJjbG9uZSIgKyA0MCBieXRlcwogICAgICAgICAgICAvLyAweDI4ID0gNDAKICAgICAgICAgICAgbXN0b3JlKAogICAgICAgICAgICAgICAgYWRkKGNsb25lLCAweDI4KSwKICAgICAgICAgICAgICAgIDB4NWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8ICAgICAgICAgICAxNSBieXRlcyAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmU1YWY0M2Q4MjgwM2U5MDNkOTE2MDJiNTdmZDViZjMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gY3JlYXRlIG5ldyBjb250cmFjdAogICAgICAgICAgICAvLyBzZW5kIDAgRXRoZXIKICAgICAgICAgICAgLy8gY29kZSBzdGFydHMgYXQgcG9pbnRlciBzdG9yZWQgaW4gImNsb25lIgogICAgICAgICAgICAvLyBjb2RlIHNpemUgMHgzNyAoNTUgYnl0ZXMpCiAgICAgICAgICAgIHJlc3VsdCA6PSBjcmVhdGUoMCwgY2xvbmUsIDB4MzcpCiAgICAgICAgfQogICAgfQp9Cg=="}],qA=`

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

            +`,UA=({prev:s,next:a})=>i.jsx(A,{version:JA,title:zA,description:DA,cyfrinLink:EA,html:TA,prev:s,next:a,codes:QA}),_A="0.8.26",LA="Minimal Proxy Contract",OA="Deploy contracts cheaply with minimal proxy contract",PA="https://www.cyfrin.io/glossary/minimal-proxy-contract-solidity-code-example",$A=[{fileName:"MinimalProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIG9yaWdpbmFsIGNvZGUKLy8gaHR0cHM6Ly9naXRodWIuY29tL29wdGlvbmFsaXR5L2Nsb25lLWZhY3RvcnkvYmxvYi9tYXN0ZXIvY29udHJhY3RzL0Nsb25lRmFjdG9yeS5zb2wKCmNvbnRyYWN0IE1pbmltYWxQcm94eSB7CiAgICBmdW5jdGlvbiBjbG9uZShhZGRyZXNzIHRhcmdldCkgZXh0ZXJuYWwgcmV0dXJucyAoYWRkcmVzcyByZXN1bH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QwKQogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIgogICAgICAgICAgICBtc3RvcmUoCiAgICAgICAgICAgICAgICBjbG9uZSwKICAgICAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3MzAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICAgIHwKICAgICAgICAgICAgMHgzZDYwMmQ4MDYwMGEzZDM5ODFmMzM2M2QzZDM3M2QzZDNkMzYzZDczMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlcgogICAgICAgICAgICAqLwogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIiArIDIwIGJ5dGVzCiAgICAgICAgICAgIC8vIDB4MTQgPSAyMAogICAgICAgICAgICBtc3RvcmUoYWRkKGNsb25lLCAweDE0KSwgdGFyZ2V0Qnl0ZXMpCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gc3RvcmUgMzIgYnl0ZXMgdG8gbWVtb3J5IHN0YXJ0aW5nIGF0ICJjbG9uZSIgKyA0MCBieXRlcwogICAgICAgICAgICAvLyAweDI4ID0gNDAKICAgICAgICAgICAgbXN0b3JlKAogICAgICAgICAgICAgICAgYWRkKGNsb25lLCAweDI4KSwKICAgICAgICAgICAgICAgIDB4NWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8ICAgICAgICAgICAxNSBieXRlcyAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmU1YWY0M2Q4MjgwM2U5MDNkOTE2MDJiNTdmZDViZjMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gY3JlYXRlIG5ldyBjb250cmFjdAogICAgICAgICAgICAvLyBzZW5kIDAgRXRoZXIKICAgICAgICAgICAgLy8gY29kZSBzdGFydHMgYXQgcG9pbnRlciBzdG9yZWQgaW4gImNsb25lIgogICAgICAgICAgICAvLyBjb2RlIHNpemUgMHgzNyAoNTUgYnl0ZXMpCiAgICAgICAgICAgIHJlc3VsdCA6PSBjcmVhdGUoMCwgY2xvbmUsIDB4MzcpCiAgICAgICAgfQogICAgfQp9Cg=="}],qA=`

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

            // SPDX-License-Identifier: MIT
             pragma solidity ^0.8.26;
             
            @@ -2457,7 +2457,7 @@ How to swap tokens
                     }
                 }
             }
            -
            `,su=({prev:s,next:a})=>i.jsx(A,{version:_A,title:LA,description:OA,cyfrinLink:PA,html:qA,prev:s,next:a,codes:$A}),au="0.8.26",nu="Multi Call",lu="An example of contract to aggregate multiple calls.",pu="",eu=[{fileName:"MultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE11bHRpQ2FsbCB7CiAgICBmdW5jdGlvbiBtdWx0aUNhbGwoYWRkcmVzc1tdIGNhbGxkYXRhIHRhcmdldHMsIGJ5dGVzW10gY2FsbGRhdGEgZGF0YSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChieXRlc1tdIG1lbW9yeSkKICAgIHsKICAgICAgICByZXF1aXJlKHRhcmdldHMubGVuZ3RoID09IGRhdGEubGVuZ3RoLCAidGFyZ2V0IGxlbmd0aCAhPSBkYXRhIGxlbmd0aCIpOwoKICAgICAgICBieXRlc1tdIG1lbW9yeSByZXN1bHRzID0gbmV3IGJ5dGVzW10oZGF0YS5sZW5ndGgpOwoKICAgICAgICBmb3IgKHVpbnQyNTYgaTsgaSA8IHRhcmdldHMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IHJlc3VsdCkgPSB0YXJnZXRzW2ldLnN0YXRpY2NhbGwoZGF0YVtpXSk7CiAgICAgICAgICAgIHJlcXVpcmUoc3VjY2VzcywgImNhbGwgZmFpbGVkIik7CiAgICAgICAgICAgIHJlc3VsdHNbaV0gPSByZXN1bHQ7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gcmVzdWx0czsKICAgIH0KfQo="},{fileName:"TestMultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRlc3RNdWx0aUNhbGwgewogICAgZnVuY3Rpb24gdGVzdCh1aW50MjU2IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4gX2k7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0RGF0YSh1aW50MjU2IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKHRoaXMudGVzdC5zZWxlY3RvciwgX2kpOwogICAgfQp9Cg=="}],cu=`

            An example of contract that aggregates multiple queries using a for loop and staticcall.

            +`,su=({prev:s,next:a})=>i.jsx(A,{version:_A,title:LA,description:OA,cyfrinLink:PA,html:qA,prev:s,next:a,codes:$A}),au="0.8.26",nu="Multi Call",lu="An example of contract to aggregate multiple calls.",pu="https://www.cyfrin.io/glossary/multi-call-solidity-code-example",eu=[{fileName:"MultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE11bHRpQ2FsbCB7CiAgICBmdW5jdGlvbiBtdWx0aUNhbGwoYWRkcmVzc1tdIGNhbGxkYXRhIHRhcmdldHMsIGJ5dGVzW10gY2FsbGRhdGEgZGF0YSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChieXRlc1tdIG1lbW9yeSkKICAgIHsKICAgICAgICByZXF1aXJlKHRhcmdldHMubGVuZ3RoID09IGRhdGEubGVuZ3RoLCAidGFyZ2V0IGxlbmd0aCAhPSBkYXRhIGxlbmd0aCIpOwoKICAgICAgICBieXRlc1tdIG1lbW9yeSByZXN1bHRzID0gbmV3IGJ5dGVzW10oZGF0YS5sZW5ndGgpOwoKICAgICAgICBmb3IgKHVpbnQyNTYgaTsgaSA8IHRhcmdldHMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IHJlc3VsdCkgPSB0YXJnZXRzW2ldLnN0YXRpY2NhbGwoZGF0YVtpXSk7CiAgICAgICAgICAgIHJlcXVpcmUoc3VjY2VzcywgImNhbGwgZmFpbGVkIik7CiAgICAgICAgICAgIHJlc3VsdHNbaV0gPSByZXN1bHQ7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gcmVzdWx0czsKICAgIH0KfQo="},{fileName:"TestMultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRlc3RNdWx0aUNhbGwgewogICAgZnVuY3Rpb24gdGVzdCh1aW50MjU2IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4gX2k7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0RGF0YSh1aW50MjU2IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKHRoaXMudGVzdC5zZWxlY3RvciwgX2kpOwogICAgfQp9Cg=="}],cu=`

            An example of contract that aggregates multiple queries using a for loop and staticcall.

            // SPDX-License-Identifier: MIT
             pragma solidity ^0.8.26;
             
            @@ -2493,7 +2493,7 @@ How to swap tokens
                     return abi.encodeWithSelector(this.test.selector, _i);
                 }
             }
            -
            `,tu=({prev:s,next:a})=>i.jsx(A,{version:au,title:nu,description:lu,cyfrinLink:pu,html:cu,prev:s,next:a,codes:eu}),ou="0.8.26",ru="Multi Delegatecall",iu="An example of contract to call multiple functions in a single transaction",gu="",hu=[{fileName:"MultiDelegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE11bHRpRGVsZWdhdGVjYWxsIHsKICAgIGVycm9yIERlbGVnYXRlY2FsbEZhaWxlZCgpOwoKICAgIGZ1bmN0aW9uIG11bHRpRGVsZWdhdGVjYWxsKGJ5dGVzW10gbWVtb3J5IGRhdGEpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAoYnl0ZXNbXSBtZW1vcnkgcmVzdWx0cykKICAgIHsKICAgICAgICByZXN1bHRzID0gbmV3IGJ5dGVzW10oZGF0YS5sZW5ndGgpOwoKICAgICAgICBmb3IgKHVpbnQyNTYgaTsgaSA8IGRhdGEubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgKGJvb2wgb2ssIGJ5dGVzIG1lbW9yeSByZXMpID0gYWRkcmVzcyh0aGlzKS5kZWxlZ2F0ZWNhbGwoZGF0YVtpXSk7CiAgICAgICAgICAgIGlmICghb2spIHsKICAgICAgICAgICAgICAgIHJldmVydCBEZWxlZ2F0ZWNhbGxGYWlsZWQoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXN1bHRzW2ldID0gcmVzOwogICAgICAgIH0KICAgIH0KfQoKLy8gV2h5IHVzZSBtdWx0aSBkZWxlZ2F0ZWNhbGw/IFdoeSBub3QgbXVsdGkgY2FsbD8KLy8gYWxpY2UgLT4gbXVsdGkgY2FsbCAtLS0gY2FsbCAtLS0+IHRlc3QgKG1zZy5zZW5kZXIgPSBtdWx0aSBjYWxsKQovLyBhbGljZSAtPiB0ZXN0IC0tLSBkZWxlZ2F0ZWNhbGwgLS0tPiB0ZXN0IChtc2cuc2VuZGVyID0gYWxpY2UpCmNvbnRyYWN0IFRlc3RNdW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vZGVXaXRoU2VsZWN0b3IoVGVzdE11bHRpRGVsZWdhdGVjYWxsLmZ1bmMxLnNlbGVjdG9yLCB4LCB5KTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRGdW5jMkRhdGEoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKFRlc3RNdWx0aURlbGVnYXRlY2FsbC5mdW5jMi5zZWxlY3Rvcik7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0TWludERhdGEoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKFRlc3RNdWx0aURlbGVnYXRlY2FsbC5taW50LnNlbGVjdG9yKTsKICAgIH0KfQo="}],Iu=`

            An example of calling multiple functions with a single transaction, using delegatecall.

            +`,tu=({prev:s,next:a})=>i.jsx(A,{version:au,title:nu,description:lu,cyfrinLink:pu,html:cu,prev:s,next:a,codes:eu}),ou="0.8.26",ru="Multi Delegatecall",iu="An example of contract to call multiple functions in a single transaction",gu="https://www.cyfrin.io/glossary/multi-delegatecall-solidity-code-example",hu=[{fileName:"MultiDelegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE11bHRpRGVsZWdhdGVjYWxsIHsKICAgIGVycm9yIERlbGVnYXRlY2FsbEZhaWxlZCgpOwoKICAgIGZ1bmN0aW9uIG11bHRpRGVsZWdhdGVjYWxsKGJ5dGVzW10gbWVtb3J5IGRhdGEpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAoYnl0ZXNbXSBtZW1vcnkgcmVzdWx0cykKICAgIHsKICAgICAgICByZXN1bHRzID0gbmV3IG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0aURlbGVnYXRlY2FsbC5taW50LnNlbGVjdG9yKTsKICAgIH0KfQo="}],Iu=`

            An example of calling multiple functions with a single transaction, using delegatecall.

            // SPDX-License-Identifier: MIT
             pragma solidity ^0.8.26;
             
            @@ -2561,7 +2561,7 @@ How to swap tokens
                     return abi.encodeWithSelector(TestMultiDelegatecall.mint.selector);
                 }
             }
            -
            `,du=({prev:s,next:a})=>i.jsx(A,{version:ou,title:ru,description:iu,cyfrinLink:gu,html:Iu,prev:s,next:a,codes:hu}),Cu="0.8.26",ju="Multi-Sig Wallet",Au="An example of multi-sig wallet in Solidity",uu="",yu=[{fileName:"MultiSigWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE11bHRpU2lnV2FsbGV0IHsKICAgIGV2ZW50IERlcG9zaXQoYWRkcmVzcyBpbmRleGVkIHNlbmRlciwgdWludDI1NiBhbW91bnQsIHVpbnQyNTYgYmFsYW5jZSk7CiAgICBldmVudCBTdWJtaXRUcmFuc2FjdGlvbigKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3duZXIsCiAgICAgICAgdWludDI1NiBpbmRleGVkIHR4SW5kZXgsCiAgICAgICAgYWRkcmVzcyBpbmRleGVkIHRvLAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgYnl0ZXMgZGF0YQogICAgKTsKICAgIGV2ZW50IENvbmZpcm1UcmFuc2FjdGlvbihhZGRyZXNzIGluZGV4ZWQgb3duZXIsIHVpbnQyNTYgaW5kZXhlZCB0eEluZGV4KTsKICAgIGV2ZW50IFJldm9rZUNvbmZpcm1hdGlvbihhZGRyZXNzIGluZGV4ZWQgb3duZXIsIHVpbnQyNTYgaW5kZXhlZCB0eEluZGV4KTsKICAgIGV2ZW50IEV4ZWN1dGVUcmFuc2FjdGlvbihhZGRyZXNzIGluZGV4ZWQgb3duZXIsIHVpbnQyNTYgaW5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90eEluZGV4KSB7CiAgICAgICAgcmVxdWlyZSghaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdLCAidHggYWxyZWFkeSBjb25maXJtZWQiKTsKICAgICAgICBfOwogICAgfQoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3NbXSBtZW1vcnkgX293bmVycywgdWludDI1NiBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkKSB7CiAgICAgICAgcmVxdWlyZShfb3duZXJzLmxlbmd0aCA+IDAsICJvd25lcnMgcmVxdWlyZWQiKTsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkID4gMAogICAgICAgICAgICAgICAgJiYgX251bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA8PSBfb3duZXJzLmxlbmd0aCwKICAgICAgICAgICAgImludmFsaWQgbnVtYmVyIG9mIHJlcXVpcmVkIGNvbmZpcm1hdGlvbnMiCiAgICAgICAgKTsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgX293bmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBhZGRyZXNzIG93bmVyID0gX293bmVyc1tpXTsKCiAgICAgICAgICAgIHJlcXVpcmUob3duZXIgIT0gYWRkcmVzcygwKSwgImludmFsaWQgb3duZXIiKTsKICAgICAgICAgICAgcmVxdWlyZSghaXNPd25lcltvd25lcl0sICJvd25lciBub3QgdW5pcXVlIik7CgogICAgICAgICAgICBpc093bmVyW293bmVyXSA9IHRydWU7CiAgICAgICAgICAgIG93bmVycy5wdXNoKG93bmVyKTsKICAgICAgICB9CgogICAgICAgIG51bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA9IF9udW1Db25maXJtYXRpb25zUmVxdWlyZWQ7CiAgICB9CgogICAgcmVjZWl2ZSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIGVtaXQgRGVwb3NpdChtc2cuc2VuZGVyLCBtc2cudmFsdWUsIGFkZHJlc3ModGhpcykuYmFsYW5jZSk7CiAgICB9CgogICAgZnVuY3Rpb24gc3VibWl0VHJhbnNhY3Rpb24oYWRkcmVzcyBfdG8sIHVpbnQyNTYgX3ZhbHVlLCBieXRlcyBtZW1vcnkgX2RhdGEpCiAgICAgICAgcHVibGljCiAgICAgICAgb25seU93bmVyCiAgICB7CiAgICAgICAgdWludDI1NiB0eEluZGV4ID0gdHJhbnNhY3Rpb25zLmxlbmd0aDsKCiAgICAgICAgdHJhbnNhY3Rpb25zLnB1c2goCiAgICAgICAgICAgIFRyYW5zYWN0aW9uKHsKICAgICAgICAgICAgICAgIHRvOiBfdG8sCiAgICAgICAgICAgICAgICB2YWx1ZTogX3ZhbHVlLAogICAgICAgICAgICAgICAgZGF0YTogX2RhdGEsCiAgICAgICAgICAgICAgICBleGVjdXRlZDogZmFsc2UsCiAgICAgICAgICAgICAgICBudW1Db25maXJtYXRpb25zOiAwCiAgICAgICAgICAgIH0pCiAgICAgICAgKTsKCiAgICAgICAgZW1pdCBTdWJtaXRUcmFuc2FjdGlvbihtc2cuc2VuZGVyLCB0eEluZGV4LCBfdG8sIF92YWx1ZSwgX2RhdGEpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbmZpcm1UcmFuc2FjdGlvbih1aW50MjU2IF90eEluZGV4KQogICAgICAgIHB1YmxpYwogICAgICAgIG9ubHlPd25lcgogICAgICAgIHR4RXhpc3RzKF90eEluZGV4KQogICAgICAgIG5vdEV4ZWN1dGVkKF90eEluZGV4KQogICAgICAgIG5vdENvbmZpcm1lZChfdHhJbmRleCkKICAgIHsKICAgICAgICBUcmFuc2FjdGlvbiBzdG9yYWdlIHRyYW5zYWN0aW9uID0gdHJhbnNhY3Rpb25zW190eEluZGV4XTsKICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zICs9IDE7CiAgICAgICAgaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdID0gdHJ1ZTsKCiAgICAgICAgZW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tfdHhJbmRleF07CgogICAgICAgIHJlcXVpcmUoaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdLCAidHggbm90IGNvbmZpcm1lZCIpOwoKICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zIC09IDE7CiAgICAgICAgaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdID0gZmFsc2U7CgogICAgICAgIGVtaXQgUmV2b2tlQ29uZmlybWF0aW9uKG1zZy5zZW5kZXIsIF90eEluZGV4KTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRPd25lcnMoKSBwdWJsaWMgdmlldyByZXR1cm5zIChhZGRyZXNzW10gbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIG93bmVyczsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRUcmFuc2FjdGlvbkNvdW50KCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB0cmFuc2FjdGlvbnMubGVuZ3RoOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldFRyYW5zYWN0aW9uKHVpbnQyNTYgX3R4SW5kZXgpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKAogICAgICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgICAgICB1aW50MjU2IHZhbHVlLAogICAgICAgICAgICBieXRlcyBtZW1vcnkgZGF0YSwKICAgICAgICAgICAgYm9vbCBleGVjdXRlZCwKICAgICAgICAgICAgdWludDI1NiBudW1Db25maXJtYXRpb25zCiAgICAgICAgKQogICAgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXR1cm4gKAogICAgICAgICAgICB0cmFuc2FjdGlvbi50bywKICAgICAgICAgICAgdHJhbnNhY3Rpb24udmFsdWUsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmRhdGEsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmV4ZWN1dGVkLAogICAgICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zCiAgICAgICAgKTsKICAgIH0KfQo="},{fileName:"TestContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRlc3RDb250cmFjdCB7CiAgICB1aW50MjU2IHB1YmxpYyBpOwoKICAgIGZ1bmN0aW9uIGNhbGxNZSh1aW50MjU2IGopIHB1YmxpYyB7CiAgICAgICAgaSArPSBqOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldERhdGEoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoImNhbGxNZSh1aW50MjU2KSIsIDEyMyk7CiAgICB9Cn0K"}],mu=`

            Let's create an multi-sig wallet. Here are the specifications.

            +`,du=({prev:s,next:a})=>i.jsx(A,{version:ou,title:ru,description:iu,cyfrinLink:gu,html:Iu,prev:s,next:a,codes:hu}),Cu="0.8.26",ju="Multi-Sig Wallet",Au="An example of multi-sig wallet in Solidity",uu="https://www.cyfrin.io/glossary/multisig-wallet-solidity-code-example",yu=[{fileName:"MultiSigWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE11bHRpU2lnV2FsbGV0IHsKICAgIGV2ZW50IERlcG9zaXQoYWRkcmVzcyBpbmRleGVkIHNlbmRlciwgdWludDI1NiBhbW91bnQsIHVpbnQyNTYgYmFsYW5jZSk7CiAgICBldmVudCBTdWJtaXRUcmFuc2FjdGlvbigKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3duZXIsCiAgICAgICAgdWludDI1NiBpbmR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KTsKICAgICAgICBfOwogICAgfQoKICAgIG1vZGlmaWVyIHR4RXhpc3RzKHVpbnQyNTYgX3R4SW5kZXgpIHsKICAgICAgICByZXF1aXJlKF90eEluZGV4IDwgdHJhbnNhY3Rpb25zLmxlbmd0aCwgInR4IGRvZXMgbm90IGV4aXN0Iik7CiAgICAgICAgXzsKICAgIH0KCiAgICBtb2RpZmllciBub3RFeGVjdXRlZCh1aW50MjU2IF90eEluZGV4KSB7CiAgICAgICAgcmVxdWlyZSghdHJhbnNhY3Rpb25zW190eEluZGV4XS5leGVjdXRlZCwgInR4IGFscmVhZHkgZXhlY3V0ZWQiKTsKICAgICAgICBfOwogICAgfQoKICAgIG1vZGlmaWVyIG5vdENvbmZpcm1lZCh1aW50MjU2IF90eEluZGV4KSB7CiAgICAgICAgcmVxdWlyZSghaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdLCAidHggYWxyZWFkeSBjb25maXJtZWQiKTsKICAgICAgICBfOwogICAgfQoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3NbXSBtZW1vcnkgX293bmVycywgdWludDI1NiBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkKSB7CiAgICAgICAgcmVxdWlyZShfb3duZXJzLmxlbmd0aCA+IDAsICJvd25lcnMgcmVxdWlyZWQiKTsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkID4gMAogICAgICAgICAgICAgICAgJiYgX251bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA8PSBfb3duZXJzLmxlbmd0aCwKICAgICAgICAgICAgImludmFsaWQgbnVtYmVyIG9mIHJlcXVpcmVkIGNvbmZpcm1hdGlvbnMiCiAgICAgICAgKTsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgX293bmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBhZGRyZXNzIG93bmVyID0gX293bmVyc1tpXTsKCiAgICAgICAgICAgIHJlcXVpcmUob3duZXIgIT0gYWRkcmVzcygwKSwgImludmFsaWQgb3duZXIiKTsKICAgICAgICAgICAgcmVxdWlyZSghaXNPd25lcltvd25lcl0sICJvd25lciBub3QgdW5pcXVlIik7CgogICAgICAgICAgICBpc093bmVyW293bmVyXSA9IHRydWU7CiAgICAgICAgICAgIG93bmVycy5wdXNoKG93bmVyKTsKICAgICAgICB9CgogICAgICAgIG51bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA9IF9udW1Db25maXJtYXRpb25zUmVxdWlyZWQ7CiAgICB9CgogICAgcmVjZWl2ZSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIGVtaXQgRGVwb3NpdChtc2cuc2VuZGVyLCBtc2cudmFsdWUsIGFkZHJlc3ModGhpcykuYmFsYW5jZSk7CiAgICB9CgogICAgZnVuY3Rpb24gc3VibWl0VHJhbnNhY3Rpb24oYWRkcmVzcyBfdG8sIHVpbnQyNTYgX3ZhbHVlLCBieXRlcyBtZW1vcnkgX2RhdGEpCiAgICAgICAgcHVibGljCiAgICAgICAgb25seU93bmVyCiAgICB7CiAgICAgICAgdWludDI1NiB0eEluZGV4ID0gdHJhbnNhY3Rpb25zLmxlbmd0aDsKCiAgICAgICAgdHJhbnNhY3Rpb25zLnB1c2goCiAgICAgICAgICAgIFRyYW5zYWN0aW9uKHsKICAgICAgICAgICAgICAgIHRvOiBfdG8sCiAgICAgICAgICAgICAgICB2YWx1ZTogX3ZhbHVlLAogICAgICAgICAgICAgICAgZGF0YTogX2RhdGEsCiAgICAgICAgICAgICAgICBleGVjdXRlZDogZmFsc2UsCiAgICAgICAgICAgICAgICBudW1Db25maXJtYXRpb25zOiAwCiAgICAgICAgICAgIH0pCiAgICAgICAgKTsKCiAgICAgICAgZW1pdCBTdWJtaXRUcmFuc2FjdGlvbihtc2cuc2VuZGVyLCB0eEluZGV4LCBfdG8sIF92YWx1ZSwgX2RhdGEpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbmZpcm1UcmFuc2FjdGlvbih1aW50MjU2IF90eEluZGV4KQogICAgICAgIHB1YmxpYwogICAgICAgIG9ubHlPd25lcgogICAgICAgIHR4RXhpc3RzKF90eEluZGV4KQogICAgICAgIG5vdEV4ZWN1dGVkKF90eEluZGV4KQogICAgICAgIG5vdENvbmZpcm1lZChfdHhJbmRleCkKICAgIHsKICAgICAgICBUcmFuc2FjdGlvbiBzdG9yYWdlIHRyYW5zYWN0aW9uID0gdHJhbnNhY3Rpb25zW190eEluZGV4XTsKICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zICs9IDE7CiAgICAgICAgaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdID0gdHJ1ZTsKCiAgICAgICAgZW1pdCBDb25maXJtVHJhbnNhY3Rpb24obXNnLnNlbmRlciwgX3R4SW5kZXgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4ZWN1dGVUcmFuc2FjdGlvbih1aW50MjU2IF90eEluZGV4KQogICAgICAgIHB1YmxpYwogICAgICAgIG9ubHlPd25lcgogICAgICAgIHR4RXhpc3RzKF90eEluZGV4KQogICAgICAgIG5vdEV4ZWN1dGVkKF90eEluZGV4KQogICAgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zID49IG51bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCwKICAgICAgICAgICAgImNhbm5vdCBleGVjdXRlIHR4IgogICAgICAgICk7CgogICAgICAgIHRyYW5zYWN0aW9uLmV4ZWN1dGVkID0gdHJ1ZTsKCiAgICAgICAgKGJvb2wgc3VjY2VzcywpID0KICAgICAgICAgICAgdHJhbnNhY3Rpb24udG8uY2FsbHt2YWx1ZTogdHJhbnNhY3Rpb24udmFsdWV9KHRyYW5zYWN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gIHJldHVybnMgKAogICAgICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgICAgICB1aW50MjU2IHZhbHVlLAogICAgICAgICAgICBieXRlcyBtZW1vcnkgZGF0YSwKICAgICAgICAgICAgYm9vbCBleGVjdXRlZCwKICAgICAgICAgICAgdWludDI1NiBudW1Db25maXJtYXRpb25zCiAgICAgICAgKQogICAgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXR1cm4gKAogICAgICAgICAgICB0cmFuc2FjdGlvbi50bywKICAgICAgICAgICAgdHJhbnNhY3Rpb24udmFsdWUsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmRhdGEsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmV4ZWN1dGVkLAogICAgICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zCiAgICAgICAgKTsKICAgIH0KfQo="},{fileName:"TestContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRlc3RDb250cmFjdCB7CiAgICB1aW50MjU2IHB1YmxpYyBpOwoKICAgIGZ1bmN0aW9uIGNhbGxNZSh1aW50MjU2IGopIHB1YmxpYyB7CiAgICAgICAgaSArPSBqOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldERhdGEoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoImNhbGxNZSh1aW50MjU2KSIsIDEyMyk7CiAgICB9Cn0K"}],mu=`

            Let's create an multi-sig wallet. Here are the specifications.

            The wallet owners can

            • submit a transaction
            • @@ -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="",Bu=[{fileName:"Factory.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgZXZlbnQgTG9nKGFkZHJlc3MgYWRkcik7CgogICAgLy8gRGVwbG95cyBhIGNvbnRyYWN0IHRoYXQgYWx3YXlzIHJldHVybnMgMjU1CiAgICBmdW5jdGlvbiBkZXBsb3koKSBleHRlcm5hbCB7CiAgICAgICAgYnl0ZXMgbWVtb3J5IGJ5dGVjb2RlID0gaGV4IjY5NjBmZjYwMDA1MjYwMjA2MDAwZjM2MDAwNTI2MDBhNjAxNmYzIjsKICAgICAgICBhZGRyZXNzIGFkZHI7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBjcmVhdGUodmFsdWUsIG9mZnNldCwgc2l6ZSkKICAgICAgICAgICAgYWRkciA6PSBjcmVhdGUoMCwgYWRkKGJ5dGVjb2RlLCAweDIwKSwgMHgxMykKICAgICAgICB9CiAgICAgICAgcmVxdWlyZShhZGRyICE9IGFkZHJlc3MoMCkpOwoKICAgICAgICBlbWl0IExvZyhhZGRyKTsKICAgIH0KfQoKaW50ZXJmYWNlIElDb250cmFjdCB7CiAgICBmdW5jdGlvbiBnZXRWYWx1ZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7Cn0KCi8vIGh0dHBzOi8vd3d3LmV2bS5jb2Rlcy9wbGF5Z3JvdW5kCi8qClJ1biB0aW1lIGNvZGUgLSByZXR1cm4gMjU1CjYwZmY2MDAwNTI2MDIwNjAwMGYzCgovLyBTdG9yZSAyNTUgdG8gbWVtb3J5Cm1zdG9yZShwLCB2KSAtIHN0b3JlIHYgYXQgbWVtb3J5IHAgdG8gcCArIDMyCgpQVVNIMSAweGZmClBVU0gxIDAKTVNUT1JFCgovLyBSZXR1cm4gMzIgYnl0ZXMgZnJvbSBtZW1vcnkKcmV0dXJuKHAsIHMpIC0gZW5kIGV4ZWN1dGlvbiBhbmQgcmV0dXJuIGRhdGEgZnJvbSBtZW1vcnkgcCB0byBwICsgcwoKUFVTSDEgMHgyMApQVVNIMSAwClJFVFVSTgoKQ3JlYXRpb24gY29kZSAtIHJldHVybiBydW50aW1lIGNvZGUKNjk2MGZmNjAwMDUyNjAyMDYwMDBmMzYwMDA1MjYwMGE2MDE2ZjMKCi8vIFN0b3JlIHJ1biB0aW1lIGNvZGUgdG8gbWVtb3J5ClBVU0gxMCAwWDYwZmY2MDAwNTI2MDIwNjAwMGYzClBVU0gxIDAKTVNUT1JFCgovLyBSZXR1cm4gMTAgYnl0ZXMgZnJvbSBtZW1vcnkgc3RhcnRpbmcgYXQgb2Zmc2V0IDIyClBVU0gxIDB4MGEKUFVTSDEgMHgxNgpSRVRVUk4KKi8K"}],Gu=`

              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="https://www.cyfrin.io/glossary/simple-bytecode-contract-solidity-code-example",Bu=[{fileName:"Factory.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgZXZlbnQgTG9nKGFkZHJlc3MgYWRkcik7CgogICAgLy8gRGVwbG95cyBhIGNvbnRyYWN0IHRoYXQgYWx3YXlzIHJldHVybnMgMjU1CiAgICBmdW5jdGlvbiBkZXBsb3koKSBleHRlcm5hbCB7CiAgICAgICAgYnl0ZXMgbWVtb3J5IGJ5dGVjb2RlID0gaGV4Ij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UT1JFCgovLyBSZXR1cm4gMTAgYnl0ZXMgZnJvbSBtZW1vcnkgc3RhcnRpbmcgYXQgb2Zmc2V0IDIyClBVU0gxIDB4MGEKUFVTSDEgMHgxNgpSRVRVUk4KKi8K"}],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:Gu,prev:s,next:a,codes:Bu}),Vu="0.8.26",Yu="Time Lock",Xu="Time Lock",vu="",Ru=[{fileName:"TimeLock.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRpbWVMb2NrIHsKICAgIGVycm9yIE5vdE93bmVyRXJyb3IoKTsKICAgIGVycm9yIEFscmVhZHlRdWV1ZWRFcnJvcihieXRlczMyIHR4SWQpOwogICAgZXJyb3IgVGltZXN0YW1wTm90SW5SYW5nZUVycm9yKHVpbnQyNTYgYmxvY2tUaW1lc3RhbXAsIHVpbnQyNTYgdGltZXN0YW1wKTsKICAgIGVycm9yIE5vdFF1ZXVlZEVycm9yKGJ5dGVzMzIgdHhJZCk7CiAgICBlcnJvciBUaW1lc3RhbXBOb3RQYXNzZWRFcnJvcih1aW50MjU2IGJsb2NrVGltZXN0bWFwLCB1aW50MjU2IHRpbWVzdGFtcCk7CiAgICBlcnJvciBUaW1lc3RhbXBFeHBpcmVkRXJyb3IodWludDI1NiBibG9ja1RpbWVzdGFtcCwgdWludDI1NiBleHBpcmVzQXQpOwogICAgZXJyb3IgVHhGYWlsZWRFcnJvcigpOwoKICAgIGV2ZW50IFF1ZXVlKAogICAgICAgIGJ5dGVzMzIgaW5kZXhlZCB0eElkLAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCB0YXJnZXQsCiAgICAgICAgdWludDI1NiB2YWx1ZSwKICAgICAgICBzdHJpbmcgZnVuYywKICAgICAgICBieXRlcyBkYXRhLAogICAgICAgIHVpbnQyNTYgdGltZXN0YW1wCiAgICApOwogICAgZXZlbnQgRXhlY3V0ZSgKICAgICAgICBieXRlczMyIGluZGV4ZWQgdHhJZCwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgdGFyZ2V0LAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgc3RyaW5nIGZ1bmMsCiAgICAgICAgYnl0ZXMgZGF0YSwKICAgICAgICB1aW50MjU2IHRpbWVzdGFtcAogICAgKTsKICAgIGV2ZW50IENhbmNlbChieXRlczMyIGluZGV4ZWQgdHhJZCk7CgogICAgdWludDI1NiBwdWJsaWMgY29uc3RhbnQgTUlOX0RFTEFZID0gMTA7IC8vIHNlY29uZHMKICAgIHVpbnQyNTYgcHVibGljIGNvbnN0YW50IE1BWF9ERUxBWSA9IDEwMDA7IC8vIHNlY29uZHMKICAgIHVpbnQyNTYgcHVibGljIGNvbnN0YW50IEdSQUNFX1BFUklPRCA9IDEwMDA7IC8vIHNlY29uZHMKCiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIC8vIHR4IGlkID0+IHF1ZXVlZAogICAgbWFwcGluZyhieXRlczMyID0+IGJvb2wpIHB1YmxpYyBxdWV1ZWQ7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIG1vZGlmaWVyIG9ubHlPd25lcigpIHsKICAgICAgICBpZiAobXNnLnNlbmRlciAhPSBvd25lcikgewogICAgICAgICAgICByZXZlcnQgTm90T3duZXJFcnJvcigpOwogICAgICAgIH0KICAgICAgICBfOwogICAgfQoKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHt9CgogICAgZnVuY3Rpb24gZ2V0VHhJZCgKICAgICAgICBhZGRyZXNzIF90YXJnZXQ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MgbWVtb3J5IHJlcykgPSBfdGFyZ2V0LmNhbGx7dmFsdWU6IF92YWx1ZX0oZGF0YSk7CiAgICAgICAgaWYgKCFvaykgewogICAgICAgICAgICByZXZlcnQgVHhGYWlsZWRFcnJvcigpOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBFeGVjdXRlKHR4SWQsIF90YXJnZXQsIF92YWx1ZSwgX2Z1bmMsIF9kYXRhLCBfdGltZXN0YW1wKTsKCiAgICAgICAgcmV0dXJuIHJlczsKICAgIH0KCiAgICBmdW5jdGlvbiBjYW5jZWwoYnl0ZXMzMiBfdHhJZCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICAgICAgICBpZiAoIXF1ZXVlZFtfdHhJZF0pIHsKICAgICAgICAgICAgcmV2ZXJ0IE5vdFF1ZXVlZEVycm9yKF90eElkKTsKICAgICAgICB9CgogICAgICAgIHF1ZXVlZFtfdHhJZF0gPSBmYWxzZTsKCiAgICAgICAgZW1pdCBDYW5jZWwoX3R4SWQpOwogICAgfQp9Cg=="}],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="https://www.cyfrin.io/glossary/time-lock-solidity-code-example",Ru=[{fileName:"TimeLock.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRpbWVMb2NrIHsKICAgIGVycm9yIE5vdE93bmVyRXJyb3IoKTsKICAgIGVycm9yIEFscmVhZHlRdWV1ZWRFcnJvcihieXRlczMyIHR4SWQpOwogICAgZXJyb3IgVGltZXN0YW1wTm90SW5SYW5nZUVycm9yKHVpbnQyNTYgYmxvY2tUaW1lc3RhbXAsIHVpbnQyNTYgdGltZXN0YW1wKTsKICAgIGVycm9yI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GNhbiBiZSBleGVjdXRlZC4KICAgICAqLwogICAgZnVuY3Rpb24gcXVldWUoCiAgICAgICAgYWRkcmVzcyBfdGFyZ2V0LAogICAgICAgIHVpbnQyNTYgX3ZhbHVlLAogICAgICAgIHN0cmluZyBjYWxsZGF0YSBfZnVuYywKICAgICAgICBieXRlcyBjYWxsZGF0YSBfZGF0YSwKICAgICAgICB1aW50MjU2IF90aW1lc3RhbXAKICAgICkgZXh0ZXJuYWwgb25seU93bmVyIHJldHVybnMgKGJ5dGVzMzIgdHhJZCkgewogICAgICAgIHR4SWQgPSBnZXRUeElkKF90YXJnZXQsIF92YWx1ZSwgX2Z1bmMsIF9kYXRhLCBfdGltZXN0YW1wKTsKICAgICAgICBpZiAocXVldWVkW3R4SWRdKSB7CiAgICAgICAgICAgIHJldmVydCBBbHJlYWR5UXVldWVkRXJyb3IodHhJZCk7CiAgICAgICAgfQogICAgICAgIC8vIC0tLXwtLS0tLS0tLS0tLS18LS0tLS0tLS0tLS0tLS0tfC0tLS0tLS0KICAgICAgICAvLyAgYmxvY2sgICAgYmxvY2sgKyBtaW4gICAgIGJsb2NrICsgbWF4CiAgICAgICAgaWYgKAogICAgICAgICAgICBfdGltZXN0YW1wIDwgYmxvY2sudGltZXN0YW1wICsgTUlOX0RFTEFZCiAgICAgICAgICAgICAgICB8fCBfdGltZXN0YW1wID4gYmxvY2sudGltZXN0YW1wICsgTUFYX0RFTEFZCiAgICAgICAgKSB7CiAgICAgICAgICAgIHJldmVydCBUaW1lc3RhbXBOb3RJblJhbmdlRXJyb3IoYmxvY2sudGltZXN0YW1wLCBfdGltZXN0YW1wKTsKICAgICAgICB9CgogICAgICAgIHF1ZXVlZFt0eElkXSA9IHRydWU7CgogICAgICAgIGVtaXQgUXVldWUodHhJZCwgX3RhcmdldCwgX3ZhbHVlLCBfZnVuYywgX2RhdGEsIF90aW1lc3RhbXApOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4ZWN1dGUoCiAgICAgICAgYWRkcmVzc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pZiAoYnl0ZXMoX2Z1bmMpLmxlbmd0aCA+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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDgoKHVpbnQyNTYodnMpID4+IDI1NSkgKyAyNyk7CiAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzMzIgciwgYnl0ZXMzMiB2cykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIF90aHJvd0Vycm9yKGVycm9yKTsKICAgICAgICByZXR1cm4gcmVjb3ZlcmVkOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyeVJlY292ZXIoYnl0ZXMzMiBoYXNoLCB1aW50OCB2LCBieXRlczMyIHIsIGJ5dGVzMzIgcykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAg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NiBfYW1vdW50KQogICAgICAgIHByaXZhdGUKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4gX2dldEhhc2goX2Ftb3VudCkudG9FdGhTaWduZWRNZXNzYWdlSGFzaCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEV0aFNpZ25lZEhhc2godWludDI1NiBfYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJ5dGVzMzIpCiAgICB7CiAgICAgICAgcmV0dXJuIF9nZXRFdGhTaWduZWRIYXNoKF9hbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF92ZXJpZnkodWludDI1NiBfYW1vdW50LCBieXRlcyBtZW1vcnkgX3NpZykKICAgICAgICBwcml2YXRlCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIF9nZXRFdGhTaWduZWRIYXNoKF9hbW91bnQpLnJlY292ZXIoX3NpZykgPT0gc2VuZGVyOwogICAgfQoKICAgIGZ1bmN0aW9uIHZlcmlmeSh1aW50MjU2IF9hbW91bnQsIGJ5dGVzIG1lbW9yeSBfc2lnKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIF92ZXJpZnkoX2Ftb3VudCwgX3NpZyk7CiAgICB9CgogICAgZnVuY3Rpb24gY2xvc2UodWludDI1NiBfYW1vdW50LCBieXRlcyBtZW1vcnkgX3NpZykgZXh0ZXJuYWwgZ3VhcmQgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSByZWNlaXZlciwgIiFyZWNlaXZlciIpOwogICAgICAgIHJlcXVpcmUoX3ZlcmlmeShfYW1vdW50LCBfc2lnKSwgImludmFsaWQgc2lnIik7CgogICAgICAgIChib29sIHNlbnQsKSA9IHJlY2VpdmVyLmNhbGx7dmFsdWU6IF9hbW91bnR9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgICAgIHNlbGZkZXN0cnVjdChzZW5kZXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNhbmNlbCgpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gc2VuZGVyLCAiIXNlbmRlciIpOwogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wID49IGV4cGlyZXNBdCwgIiFleHBpcmVkIik7CiAgICAgICAgc2VsZmRlc3RydWN0KHNlbmRlcik7CiAgICB9Cn0K"}],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="https://www.cyfrin.io/glossary/unidirectional-payment-channel-solidity-code-example",xu=[{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDgoKHVpbnQyNTYodnMpID4+IDI1NSkgKyAyNyk7CiAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICB9CgogICAgZnVuY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ZXMzMikgewogICAgICAgIC8vIE5PVEU6IHNpZ24gd2l0aCBhZGRyZXNzIG9mIHRoaXMgY29udHJhY3QgdG8gcHJvdGVjdCBhZ2FpbnN0CiAgICAgICAgLy8gcmVwbGF5IGF0dGFjayBvbiBvdGhlciBjb250cmFjdHMKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQoYWRkcmVzcyh0aGlzKSwgX2Ftb3VudCkpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEhhc2godWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4gX2dldEhhc2goX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gX2dldEV0aFNpZ25lZEhhc2godWludDI1NiBfYW1vdW50KQogICAgICAgIHByaXZhdGUKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4gX2dldEhhc2goX2Ftb3VudCkudG9FdGhTaWduZWRNZXNzYWdlSGFzaCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEV0aFNpZ25lZEhhc2godWludDI1NiBfYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJ5dGVzMzIpCiAgICB7CiAgICAgICAgcmV0dXJuIF9nZXRFdGhTaWduZWRIYXNoKF9hbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF92ZXJpZnkodWludDI1NiBfYW1vdW50LCBieXRlcyBtZW1vcnkgX3NpZykKICAgICAgICBwcml2YXRlCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIF9nZXRFdGhTaWduZWRIYXNoKF9hbW91bnQpLnJlY292ZXIoX3NpZykgPT0gc2VuZGVyOwogICAgfQoKICAgIGZ1bmN0aW9uIHZlcmlmeSh1aW50MjU2IF9hbW91bnQsIGJ5dGVzIG1lbW9yeSBfc2lnKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIF92ZXJpZnkoX2Ftb3VudCwgX3NpZyk7CiAgICB9CgogICAgZnVuY3Rpb24gY2xvc2UodWludDI1NiBfYW1vdW50LCBieXRlcyBtZW1vcnkgX3NpZykgZXh0ZXJuYWwgZ3VhcmQgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSByZWNlaXZlciwgIiFyZWNlaXZlciIpOwogICAgICAgIHJlcXVpcmUoX3ZlcmlmeShfYW1vdW50LCBfc2lnKSwgImludmFsaWQgc2lnIik7CgogICAgICAgIChib29sIHNlbnQsKSA9IHJlY2VpdmVyLmNhbGx7dmFsdWU6IF9hbW91bnR9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgICAgIHNlbGZkZXN0cnVjdChzZW5kZXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNhbmNlbCgpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gc2VuZGVyLCAiIXNlbmRlciIpOwogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wID49IGV4cGlyZXNBdCwgIiFleHBpcmVkIik7CiAgICAgICAgc2VsZmRlc3RydWN0KHNlbmRlcik7CiAgICB9Cn0K"}],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.
              • @@ -3219,7 +3219,7 @@ After a minimum waiting period, the transaction can be executed.

                ); } } -`,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="",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pbXBsZW1lbnRhdGlvbiwgMCwgY2FsbGRhdGFzaXplKCksIDAsIDApCgogICAgICAgICAgICAvLyBDb3B5IHRoZSByZXR1cm5lZCBkYXRhLgogICAgICAgICAgICAvLyByZXR1cm5kYXRhY29weSh0LCBmLCBzKSAtIGNvcHkgcyBieXRlcyBmcm9tIHJldHVybmRhdGEgYXQgcG9zaXRpb24gZiB0byBtZW0gYXQgcG9zaXRpb24gdAogICAgICAgICAgICAvLyByZXR1cm5kYXRhc2l6ZSgpIC0gc2l6ZSBvZiB0aGUgbGFzdCByZXR1cm5kYXRhCiAgICAgICAgICAgIHJldHVybmRhdGFjb3B5KDAsIDAsIHJldHVybmRhdGFzaXplKCkpCgogICAgICAgICAgICBzd2l0Y2ggcmVzdWx0CiAgICAgICAgICAgIC8vIGRlbGVnYXRlY2FsbCByZXR1cm5zIDAgb24gZXJyb3IuCiAgICAgICAgICAgIGNhc2UgMCB7CiAgICAgICAgICAgICAgICAvLyByZXZlcnQocCwgcykgLSBlbmQgZXhlY3V0aW9uLCByZXZlcnQgc3RhdGUgY2hhbmdlcywgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldmVydCgwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgICAgIGRlZmF1bHQgewogICAgICAgICAgICAgICAgLy8gcmV0dXJuKHAsIHMpIC0gZW5kIGV4ZWN1dGlvbiwgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldHVybigwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIF9mYWxsYmFjaygpIHByaXZhdGUgewogICAgICAgIF9kZWxlZ2F0ZShfZ2V0SW1wbGVtZW50YXRpb24oKSk7CiAgICB9CgogICAgZmFsbGJhY2soKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBfZmFsb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gIFN0b3JhZ2VTbG90LmdldEFkZHJlc3NTbG90KHNsb3QpLnZhbHVlID0gX2FkZHI7CiAgICB9Cn0K"}],_u=`

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

                +`,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="https://www.cyfrin.io/glossary/upgradeable-proxy-solidity-code-example",Uu=[{fileName:"UpgradeableProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIFRyYW5zcGFyZW50IHVwZ3JhZGVhYmxlIHByb3h5IHBhdHRlcm4KCmNvbnRyYWN0IENvdW50ZXJWMSB7CiAgICB1aW50MjU2IHB1YmxpYyBjb3VudDsKCiAgICBmdW5jdGlvbiBpbmMoKSBleHRlcm5hbCB7CiAgICAgICAgY291bnQgKz0gMTsKICAgIH0KfQoKY29udHJhY3QgQ291bnRlclYyIHsKICAgIHVpbnQyNTYgcHVibGljIGNvdW50OwoKICAgIGZ1bmN0aW9uIGluYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCArPSAxOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCAtPSAxOwogICAgfQp9Cgpjb250cmFjdCBCdWdneVByb3h5IHsKICAgIGFkZHJlc3MgcHVibGljIGltcGxlbWVudGF0aW9uOwogICAgYWRkcmVzcyBwdWJsaWMgYWRtaW47CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgYWRtaW4gPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIGZ1bmN0aW9uIF9kZWxlZ2F0ZSgpIHByaXZhdGUgewogICAgICAgIChib29sIG9rLCkgPSBpbXBsZW1lbnRhdGlvbi5kZWxlZ2F0ZWNhbGwobXNnLmRh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ICAgIC8vIC0gcHJvdmlkaW5nIGcgZ2FzCiAgICAgICAgICAgIC8vIC0gYW5kIG91dHB1dCBhcmVhIG1lbVtvdXTigKYob3V0K291dHNpemUpKQogICAgICAgICAgICAvLyAtIHJldHVybmluZyAwIG9uIGVycm9yIChlZy4gb3V0IG9mIGdhcykgYW5kIDEgb24gc3VjY2VzcwogICAgICAgICAgICBsZXQgcmVzdWx0IDo9CiAgICAgICAgICAgICAgICBkZWxlZ2F0ZWNhbGwoZ2FzKCksIF9pbXBsZW1lbnRhdGlvbiwgMCwgY2FsbGRhdGFzaXplKCksIDAsIDApCgogICAgICAgICAgICAvLyBDb3B5IHRoZSByZXR1cm5lZCBkYXRhLgogICAgICAgICAgICAvLyByZXR1cm5kYXRhY29weSh0LCBmLCBzKSAtIGNvcHkgcyBieXRlcyBmcm9tIHJldHVybmRhdGEgYXQgcG9zaXRpb24gZiB0byBtZW0gYXQgcG9zaXRpb24gdAogICAgICAgICAgICAvLyByZXR1cm5kYXRhc2l6ZSgpIC0gc2l6ZSBvZiB0aGUgbGFzdCByZXR1cm5kYXRhCiAgICAgICAgICAgIHJldHVybmRhdGFjb3B5KDAsIDAsIHJldHVybmRhdGFzaXplKCkpCgogICAgICAgICAgICBzd2l0Y2ggcmVzdWx0CiAgICAgICAgICAgIC8vIGRlbGVnYXRlY2FsbCByZXR1cm5zIDAgb24gZXJyb3IuCiAgICAgICAgICAgIGNhc2UgMCB7CiAgICAgICAgICAgICAgICAvLyByZXZlcnQocCwgcykgLSBlbmQgZXhlY3V0aW9uLCByZXZlcnQgc3RhdGUgY2hhbmdlcywgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldmVydCgwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgICAgIGRlZmF1bHQgewogICAgICAgICAgICAgICAgLy8gcmV0dXJuKHAsIHMpIC0gZW5kIGV4ZWN1dGlvbiwgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldHVybigwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIF9mYWxsYmFjaygpIHByaXZhdGUgewogICAgICAgIF9kZWxlZ2F0ZShfZ2V0SW1wbGVtZW50YXRpb24oKSk7CiAgICB9CgogICAgZmFsbGJhY2soKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBfZmFsbGJhY2soKTsKICAgIH0KCiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgX2ZhbGxiYWNrKCk7CiAgICB9Cn0KCmNvbnRyYWN0IFByb3h5QWRtaW4gewogICAgYWRkcmVzcyBwdWJsaWMgb3duZXI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIG1vZGlmaWVyIG9ubHlPd25lcigpIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gb3duZXIsICJub3Qgb3duZXIiKTsKICAgICAgICBfOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldFByb3h5QWRtaW4oYWRkcmVzcyBwcm94eSkgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChhZGRyZXNzKSB7CiAgICAgICAgKGJvb2wgb2ssIGJ5dGVzIG1lbW9yeSByZXMpID0KICAgICAgICAgICAgcHJveHkuc3RhdGljY2FsbChhYmkuZW5jb2RlQ2FsbChQcm94eS5hZG1pbiwgKCkpKTsKICAgICAgICByZXF1aXJlKG9rLCAiY2FsbCBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gYWJpLmRlY29kZShyZXMsIChhZGRyZXNzKSk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UHJveHlJbXBsZW1lbnRhdGlvbihhZGRyZXNzIHByb3h5KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgKGJvb2wgb2ssIGJ5dGVzIG1lbW9yeSByZXMpID0KICAgICAgICAgICAgcHJveHkuc3RhdGljY2FsbChhYmkuZW5jb2RlQ2FsbChQcm94eS5pbXBsZW1lbnRhdGlvbiwgKCkpKTsKICAgICAgICByZXF1aXJlKG9rLCAiY2FsbCBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gYWJpLmRlY29kZShyZXMsIChhZGRyZXNzKSk7CiAgICB9CgogICAgZnVuY3Rpb24gY2hhbmdlUHJveHlBZG1pbihhZGRyZXNzIHBheWFibGUgcHJveHksIGFkZHJlc3MgYWRtaW4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBvbmx5T3duZXIKICAgIHsKICAgICAgICBQcm94eShwcm94eSkuY2hhbmdlQWRtaW4oYWRtaW4pOwogICAgfQoKICAgIGZ1bmN0aW9uIHVwZ3JhZGUoYWRkcmVzcyBwYXlhYmxlIHByb3h5LCBhZGRyZXNzIGltcGxlbWVudGF0aW9uKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgb25seU93bmVyCiAgICB7CiAgICAgICAgUHJveHkocHJveHkpLnVwZ3JhZGVUbyhpbXBsZW1lbnRhdGlvbik7CiAgICB9Cn0KCmxpYnJhcnkgU3RvcmFnZVNsb3QgewogICAgc3RydWN0IEFkZHJlc3NTbG90IHsKICAgICAgICBhZGRyZXNzIHZhbHVlOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEFkZHJlc3NTbG90KGJ5dGVzMzIgc2xvdCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChBZGRyZXNzU2xvdCBzdG9yYWdlIHIpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICByLnNsb3QgOj0gc2xvdAogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgVGVzdFNsb3QgewogICAgYnl0ZXMzMiBwdWJsaWMgY29uc3RhbnQgc2xvdCA9IGtlY2NhazI1NigiVEVTVF9TTE9UIik7CgogICAgZnVuY3Rpb24gZ2V0U2xvdCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYWRkcmVzcykgewogICAgICAgIHJldHVybiBTdG9yYWdlU2xvdC5nZXRBZGRyZXNzU2xvdChzbG90KS52YWx1ZTsKICAgIH0KCiAgICBmdW5jdGlvbiB3cml0ZVNsb3QoYWRkcmVzcyBfYWRkcikgZXh0ZXJuYWwgewogICAgICAgIFN0b3JhZ2VTbG90LmdldEFkZHJlc3NTbG90KHNsb3QpLnZhbHVlID0gX2FkZHI7CiAgICB9Cn0K"}],_u=`

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

                This example shows

                • how to use delegatecall and return data when fallback is called.
                • @@ -3476,7 +3476,7 @@ After a minimum waiting period, the transaction can be executed.

                  StorageSlot.getAddressSlot(slot).value = _addr; } } -`,Lu=({prev:s,next:a})=>i.jsx(A,{version:Du,title:Eu,description:Qu,cyfrinLink:Tu,html:_u,prev:s,next:a,codes:Uu}),Ou="0.8.26",Pu="Write to Any Slot",$u="Write to Any Slot",qu="",sy=[{fileName:"Slot.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmxpYnJhcnkgU3RvcmFnZVNsb3QgewogICAgLy8gV3JhcCBhZGRyZXNzIGluIGEgc3RydWN0IHNvIHRoYXQgaXQgY2FuIGJlIHBhc3NlZCBhcm91bmQgYXMgYSBzdG9yYWdlIHBvaW50ZXIKICAgIHN0cnVjdCBBZGRyZXNzU2xvdCB7CiAgICAgICAgYWRkcmVzcyB2YWx1ZTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRBZGRyZXNzU2xvdChieXRlczMyIHNsb3QpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoQWRkcmVzc1Nsb3Qgc3RvcmFnZSBwb2ludGVyKQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gR2V0IHRoZSBwb2ludGVyIHRvIEFkZHJlc3NTbG90IHN0b3JlZCBhdCBzbG90CiAgICAgICAgICAgIHBvaW50ZXIuc2xvdCA6PSBzbG90CiAgICAgICAgfQogICAgfQp9Cgpjb250cmFjdCBUZXN0U2xvdCB7CiAgICBieXRlczMyIHB1YmxpYyBjb25zdGFudCBURVNUX1NMT1QgPSBrZWNjYWsyNTYoIlRFU1RfU0xPVCIpOwoKICAgIGZ1bmN0aW9uIHdyaXRlKGFkZHJlc3MgX2FkZHIpIGV4dGVybmFsIHsKICAgICAgICBTdG9yYWdlU2xvdC5BZGRyZXNzU2xvdCBzdG9yYWdlIGRhdGEgPQogICAgICAgICAgICBTdG9yYWdlU2xvdC5nZXRBZGRyZXNzU2xvdChURVNUX1NMT1QpOwogICAgICAgIGRhdGEudmFsdWUgPSBfYWRkcjsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXQoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKGFkZHJlc3MpIHsKICAgICAgICBTdG9yYWdlU2xvdC5BZGRyZXNzU2xvdCBzdG9yYWdlIGRhdGEgPQogICAgICAgICAgICBTdG9yYWdlU2xvdC5nZXRBZGRyZXNzU2xvdChURVNUX1NMT1QpOwogICAgICAgIHJldHVybiBkYXRhLnZhbHVlOwogICAgfQp9Cg=="}],ay=`

                  Solidity storage is like an array of length 2^256. +`,Lu=({prev:s,next:a})=>i.jsx(A,{version:Du,title:Eu,description:Qu,cyfrinLink:Tu,html:_u,prev:s,next:a,codes:Uu}),Ou="0.8.26",Pu="Write to Any Slot",$u="Write to Any Slot",qu="https://www.cyfrin.io/glossary/write-to-any-slot-solidity-code-example",sy=[{fileName:"Slot.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmxpYnJhcnkgU3RvcmFnZVNsb3Qgewog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nZhbHVlOwogICAgfQp9Cg=="}],ay=`

                  Solidity storage is like an array of length 2^256. Each slot in the array can store 32 bytes.

                  Order of declaration and the type of state variables define which slots it will use.

                  However using assembly, you can write to any slot.

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

                  return data.value; } } -`,ny=({prev:s,next:a})=>i.jsx(A,{version:Ou,title:Pu,description:$u,cyfrinLink:qu,html:ay,prev:s,next:a,codes:sy}),ly="0.8.26",py="Array",ey="Learn about arrays in Solidity",cy="https://www.cyfrin.io/glossary/array-code-example",ty=[{fileName:"Array.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFycmF5IHsKICAgIC8vIFNldmVyYWwgd2F5cyB0byBpbml0aWFsaXplIGFuIGFycmF5CiAgICB1aW50MjU2W10gcHVibGljIGFycjsKICAgIHVpbnQyNTZbXSBwdWJsaWMgYXJyMiA9IFsxLCAyLCAzXTsKICAgIC8vIEZpeGVkIHNpemVkIGFycmF5LCBhbGwgZWxlbWVudHMgaW5pdGlhbGl6ZSB0byAwCiAgICB1aW50MjU2WzEwXSBwdWJsaWMgbXlGaXhlZFNpemVBcnI7CgogICAgZnVuY3Rpb24gZ2V0KHVpbnQyNTYgaSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhcnJbaV07CiAgICB9CgogICAgLy8gU29saWRpdHkgY2FuIHJldHVybiB0aGUgZW50aXJlIGFycmF5LgogICAgLy8gQnV0IHRoaXMgZnVuY3Rpb24gc2hvdWxkIGJlIGF2b2lkZWQgZm9yCiAgICAvLyBhcnJheXMgdGhhdCBjYW4gZ3JvdyBpbmRlZmluaXRlbHkgaW4gbGVuZ3RoLgogICAgZnVuY3Rpb24gZ2V0QXJyKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NltdIG1lbW9yeSkgewogICAgICAgIHJldHVybiB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3RoID09IDQpOwoKICAgICAgICBhcnIgPSBbMV07CiAgICAgICAgcmVtb3ZlKDApOwogICAgICAgIC8vIFtdCiAgICAgICAgYXNzZXJ0KGFyci5sZW5ndGggPT0gMCk7CiAgICB9Cn0K"},{fileName:"ArrayReplaceFromEnd.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFycmF5UmVwbGFjZUZyb21FbmQgewogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CgogICAgLy8gRGVsZXRpbmcgYW4gZWxlbWVudCBjcmVhdGVzIGEgZ2FwIGluIHRoZSBhcnJheS4KICAgIC8vIE9uZSB0cmljayB0byBrZWVwIHRoZSBhcnJheSBjb21wYWN0IGlzIHRvCiAgICAvLyBtb3ZlIHRoZSBsYXN0IGVsZW1lbnQgaW50byB0aGUgcGxhY2UgdG8gZGVsZXRlLgogICAgZnVuY3Rpb24gcmVtb3ZlKHVpbnQyNTYgaW5kZXgpIHB1YmxpYyB7CiAgICAgICAgLy8gTW92ZSB0aGUgbGFzdCBlbGVtZW50IGludG8gdGhlIHBsYWNlIHRvIGRlbGV0ZQogICAgICAgIGFycltpbmRleF0gPSBhcnJbYXJyLmxlbmd0aCAtIDFdOwogICAgICAgIC8vIFJlbW92ZSB0aGUgbGFzdCBlbGVtZW50CiAgICAgICAgYXJyLnBvcCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3QoKSBwdWJsaWMgewogICAgICAgIGFyciA9IFsxLCAyLCAzLCA0XTsKCiAgICAgICAgcmVtb3ZlKDEpOwogICAgICAgIC8vIFsxLCA0LCAzXQogICAgICAgIGFzc2VydChhcnIubGVuZ3RoID09IDMpOwogICAgICAgIGFzc2VydChhcnJbMF0gPT0gMSk7CiAgICAgICAgYXNzZXJ0KGFyclsxXSA9PSA0KTsKICAgICAgICBhc3NlcnQoYXJyWzJdID09IDMpOwoKICAgICAgICByZW1vdmUoMik7CiAgICAgICAgLy8gWzEsIDRdCiAgICAgICAgYXNzZXJ0KGFyci5sZW5ndGggPT0gMik7CiAgICAgICAgYXNzZXJ0KGFyclswXSA9PSAxKTsKICAgICAgICBhc3NlcnQoYXJyWzFdID09IDQpOwogICAgfQp9Cg=="}],oy=`

                  Array can have a compile-time fixed size or a dynamic size.

                  +`,ny=({prev:s,next:a})=>i.jsx(A,{version:Ou,title:Pu,description:$u,cyfrinLink:qu,html:ay,prev:s,next:a,codes:sy}),ly="0.8.26",py="Array",ey="Learn about arrays in Solidity",cy="https://www.cyfrin.io/glossary/array-solidity-code-example",ty=[{fileName:"Array.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFycmF5IHsKICAgIC8vIFNldmVyYWwgd2F5cyB0byBpbml0aWFsaXplIGFuIGFycmF5CiAgICB1aW50MjU2W10gcHVibGljIGFycjsKICAgIHVpbnQyNTZbXSBwdWJsaWMgYXJyMiA9IFsxLCAyLCAzXTsKICAgIC8vIEZpeGVkIHNpemVkIGFycmF5LCBhbGwgZWxlbWVudHMgaW5pdGlhbGl6ZSB0byAwCiAgICB1aW50MjU2WzEwXSBwdWJsaWMgbXlGaXhlZFNpemVBcnI7CgogICAgZnVuY3Rpb24gZ2V0KHVpbnQyNTYgaSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhcnJbaV07CiAgICB9CgogICAgLy8gU29saWRpdHkgY2FuIHJldHVybiB0aGUgZW50aXJlIGFycmF5LgogICAgLy8gQnV0IHRoaXMgZnVuY3Rpb24gc2hvdWxkIGJlIGF2b2lkZWQgZm9yCiAgICAvLyBhcnJheXMgdGhhdCBjYW4gZ3JvdyBpbmRlZmluaXRlbHkgaW4gbGVuZ3RoLgogICAgZnVuY3Rpb24gZ2V0QXJyKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NltdIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhcnI7CiAgICB9CgogICAgZnVuY3Rpb24gcHVzaCh1aW50MjU2IGkpIHB1YmxpYyB7CiAgICAgICAgLy8gQXBwZW5kIHRvIGFycmF5CiAgICAgICAgLy8gVGhpcyB3aWxsIGluY3JlYXNlIHRoZSBhcnJheSBsZW5ndGggYnkgMS4KICAgICAgICBhcnIucHVzaChpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBwb3AoKSBwdWJsaWMgewogICAgICAgIC8vIFJlbW92ZSBsYXN0IGVsZW1lbnQgZnJvbSBhcnJheQogICAgICAgIC8vIFRoaXMgd2lsbCBkZWNyZWFzZSB0aGUgYXJyYXkgbGVuZ3RoIGJ5IDEKICAgICAgICBhcnIucG9wKCk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0TGVuZ3RoKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhcnIubGVuZ3RoOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZSh1aW50MjU2IGluZGV4KSBwdWJsaWMgewogICAgICAgIC8vIERlbGV0ZSBkb2VzIG5vdCBjaGFuZ2UgdGhlIGFycmF5IGxlbmd0aC4KICAgICAgICAvLyBJdCByZXNldHMgdGhlIHZhbHVlIGF0IGluZGV4IHRvIGl0J3MgZGVmYXVsdCB2YWx1ZSwKICAgICAgICAvLyBpbiB0aGlzIGNhc2UgMAogICAgICAgIGRlbGV0ZSBhcnJbaW5kZXhdOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4YW1wbGVzKCkgZXh0ZXJuYWwgcHVyZSB7CiAgICAgICAgLy8gY3JlYXRlIGFycmF5IGluIG1lbW9yeSwgb25seSBmaXhlZCBzaXplIGNhbiBiZSBjcmVhdGVkCiAgICAgICAgdWludDI1NltdIG1lbW9yeSBhID0gbmV3IHVpbnQyNTZbXSg1KTsKICAgIH0KfQo="},{fileName:"ArrayRemoveByShifting.sol",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JyWzNdID09IDUpOwogICAgICAgIGFzc2VydChhcnIubGVuZ3RoID09IDQpOwoKICAgICAgICBhcnIgPSBbMV07CiAgICAgICAgcmVtb3ZlKDApOwogICAgICAgIC8vIFtdCiAgICAgICAgYXNzZXJ0KGFyci5sZW5ndGggPT0gMCk7CiAgICB9Cn0K"},{fileName:"ArrayReplaceFromEnd.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFycmF5UmVwbGFjZUZyb21FbmQgewogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CgogICAgLy8gRGVsZXRpbmcgYW4gZWxlbWVudCBjcmVhdGVzIGEgZ2FwIGluIHRoZSBhcnJheS4KICAgIC8vIE9uZSB0cmljayB0byBrZWVwIHRoZSBhcnJheSBjb21wYWN0IGlzIHRvCiAgICAvLyBtb3ZlIHRoZSBsYXN0IGVsZW1lbnQgaW50byB0aGUgcGxhY2UgdG8gZGVsZXRlLgogICAgZnVuY3Rpb24gcmVtb3ZlKHVpbnQyNTYgaW5kZXgpIHB1YmxpYyB7CiAgICAgICAgLy8gTW92ZSB0aGUgbGFzdCBlbGVtZW50IGludG8gdGhlIHBsYWNlIHRvIGRlbGV0ZQogICAgICAgIGFycltpbmRleF0gPSBhcnJbYXJyLmxlbmd0aCAtIDFdOwogICAgICAgIC8vIFJlbW92ZSB0aGUgbGFzdCBlbGVtZW50CiAgICAgICAgYXJyLnBvcCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3QoKSBwdWJsaWMgewogICAgICAgIGFyciA9IFsxLCAyLCAzLCA0XTsKCiAgICAgICAgcmVtb3ZlKDEpOwogICAgICAgIC8vIFsxLCA0LCAzXQogICAgICAgIGFzc2VydChhcnIubGVuZ3RoID09IDMpOwogICAgICAgIGFzc2VydChhcnJbMF0gPT0gMSk7CiAgICAgICAgYXNzZXJ0KGFyclsxXSA9PSA0KTsKICAgICAgICBhc3NlcnQoYXJyWzJdID09IDMpOwoKICAgICAgICByZW1vdmUoMik7CiAgICAgICAgLy8gWzEsIDRdCiAgICAgICAgYXNzZXJ0KGFyci5sZW5ndGggPT0gMik7CiAgICAgICAgYXNzZXJ0KGFyclswXSA9PSAxKTsKICAgICAgICBhc3NlcnQoYXJyWzFdID09IDQpOwogICAgfQp9Cg=="}],oy=`

                  Array can have a compile-time fixed size or a dynamic size.

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

                  assert(arr[1] == 4); } } -
                  `,ry=({prev:s,next:a})=>i.jsx(A,{version:ly,title:py,description:ey,cyfrinLink:cy,html:oy,prev:s,next:a,codes:ty}),iy="0.8.26",gy="Assembly Error",hy="Example of error in assembly",Iy="https://www.cyfrin.io/glossary/assembly-error-code-example",dy=[{fileName:"AssemblyError.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5RXJyb3IgewogICAgZnVuY3Rpb24geXVsX3JldmVydCh1aW50MjU2IHgpIHB1YmxpYyBwdXJlIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIHJldmVydChwLCBzKSAtIGVuZCBleGVjdXRpb24KICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV2ZXJ0IHN0YXRlIGNoYW5nZXMKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgaWYgZ3QoeCwgMTApIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9Cn0K"}],Cy=`

                  Example of error in assembly

                  +`,ry=({prev:s,next:a})=>i.jsx(A,{version:ly,title:py,description:ey,cyfrinLink:cy,html:oy,prev:s,next:a,codes:ty}),iy="0.8.26",gy="Assembly Error",hy="Example of error in assembly",Iy="https://www.cyfrin.io/glossary/assembly-error-solidity-code-example",dy=[{fileName:"AssemblyError.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5RXJyb3IgewogICAgZnVuY3Rpb24geXVsX3JldmVydCh1aW50MjU2IHgpIHB1YmxpYyBwdXJlIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIHJldmVydChwLCBzKSAtIGVuZCBleGVjdXRpb24KICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV2ZXJ0IHN0YXRlIGNoYW5nZXMKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgaWYgZ3QoeCwgMTApIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9Cn0K"}],Cy=`

                  Example of error in assembly

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

                  } } } -
                  `,jy=({prev:s,next:a})=>i.jsx(A,{version:iy,title:gy,description:hy,cyfrinLink:Iy,html:Cy,prev:s,next:a,codes:dy}),Ay="0.8.26",uy="Assembly Conditional Statements",yy="Example of conditional statements in assembly",my="https://www.cyfrin.io/glossary/assembly-conditional-statements-code-example",by=[{fileName:"AssemblyIf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5SWYgewogICAgZnVuY3Rpb24geXVsX2lmKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBpZiBjb25kaXRpb24gPSAxIHsgY29kZSB9CiAgICAgICAgICAgIC8vIG5vIGVsc2UKICAgICAgICAgICAgLy8gaWYgMCB7IHogOj0gOTkgfQogICAgICAgICAgICAvLyBpZiAxIHsgeiA6PSA5OSB9CiAgICAgICAgICAgIGlmIGx0KHgsIDEwKSB7IHogOj0gOTkgfQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB5dWxfc3dpdGNoKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICBjYXNlIDEgeyB6IDo9IDEwIH0KICAgICAgICAgICAgY2FzZSAyIHsgeiA6PSAyMCB9CiAgICAgICAgICAgIGRlZmF1bHQgeyB6IDo9IDAgfQogICAgICAgIH0KICAgIH0KfQo="}],wy=`

                  Example of conditional statements in assembly

                  +`,jy=({prev:s,next:a})=>i.jsx(A,{version:iy,title:gy,description:hy,cyfrinLink:Iy,html:Cy,prev:s,next:a,codes:dy}),Ay="0.8.26",uy="Assembly Conditional Statements",yy="Example of conditional statements in assembly",my="https://www.cyfrin.io/glossary/assembly-conditional-statements-solidity-code-example",by=[{fileName:"AssemblyIf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5SWYgewogICAgZnVuY3Rpb24geXVsX2lmKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBpZiBjb25kaXRpb24gPSAxIHsgY29kZSB9CiAgICAgICAgICAgIC8vIG5vIGVsc2UKICAgICAgICAgICAgLy8gaWYgMCB7IHogOj0gOTkgfQogICAgICAgICAgICAvLyBpZiAxIHsgeiA6PSA5OSB9CiAgICAgICAgICAgIGlmIGx0KHgsIDEwKSB7IHogOj0gOTkgfQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB5dWxfc3dpdGNoKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICBjYXNlIDEgeyB6IDo9IDEwIH0KICAgICAgICAgICAgY2FzZSAyIHsgeiA6PSAyMCB9CiAgICAgICAgICAgIGRlZmF1bHQgeyB6IDo9IDAgfQogICAgICAgIH0KICAgIH0KfQo="}],wy=`

                  Example of conditional statements in assembly

                  // SPDX-License-Identifier: MIT
                   pragma solidity ^0.8.26;
                   
                  @@ -3676,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",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

                  +`,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-solidity-code-example",fy=[{fileName:"AssemblyLoop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5TG9vcCB7CiAgICBmdW5jdGlvbiB5dWxfZm9yX2xvb3AoKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGZvciB7IGxldCBpIDo9IDAgfSBsdChpLCAxMCkgeyBpIDo9IGFkZChpLCAxKSB9IHsgeiA6PSBhZGQoeiwgMSkgfQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB5dWxfd2hpbGVfbG9vcCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTYgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGkgOj0gMAogICAgICAgICAgICBmb3Ige30gbHQoaSwgNSkge30gewogICAgICAgICAgICAgICAgaSA6PSBhZGQoaSwgMSkKICAgICAgICAgICAgICAgIHogOj0gYWRkKHosIDEpCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0K"}],Vy=`

                  Example of loop in assembly

                  // SPDX-License-Identifier: MIT
                   pragma solidity ^0.8.26;
                   
                  @@ -3697,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: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

                  +`,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-solidity-code-example",Hy=[{fileName:"AssemblyMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5TWF0aCB7CiAgICBmdW5jdGlvbiB5dWxfYWRkKHVpbnQyNTYgeCwgdWludDI1NiB5KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHogOj0gYWRkKHgsIHkpCiAgICAgICAgICAgIGlmIGx0KHosIHgpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24geXVsX211bCh1aW50MjU2IHgsIHVpbnQyNTYgeSkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICBjYXNlIDAgeyB6IDo9IDAgfQogICAgICAgICAgICBkZWZhdWx0IHsKICAgICAgICAgICAgICAgIHogOj0gbXVsKHgsIHkpCiAgICAgICAgICAgICAgICBpZiBpc3plcm8oZXEoZGl2KHosIHgpLCB5KSkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIC8vIFJvdW5kIHRvIG5lYXJlc3QgbXVsdGlwbGUgb2YgYgogICAgZnVuY3Rpb24geXVsX2ZpeGVkX3BvaW50X3JvdW5kKHVpbnQyNTYgeCwgdWludDI1NiBiKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBiID0gMTAwCiAgICAgICAgICAgIC8vIHggPSA5MAogICAgICAgICAgICAvLyB6ID0gOTAgLyAxMDAgKiAxMDAgPSAwLCB3YW50IHogPSAxMDAKICAgICAgICAgICAgLy8geiA6PSBtdWwoZGl2KHgsIGIpLCBiKQoKICAgICAgICAgICAgbGV0IGhhbGYgOj0gZGl2KGIsIDIpCiAgICAgICAgICAgIHogOj0gYWRkKHgsIGhhbGYpCiAgICAgICAgICAgIHogOj0gbXVsKGRpdih6LCBiKSwgYikKICAgICAgICAgICAgLy8geCA9IDkwCiAgICAgICAgICAgIC8vIGhhbGYgPSA1MAogICAgICAgICAgICAvLyB6ID0gOTAgKyA1MCA9IDE0MAogICAgICAgICAgICAvLyB6ID0gMTQwIC8gMTAwICogMTAwID0gMTAwCiAgICAgICAgfQogICAgfQp9Cg=="}],Fy=`

                  Example of math in assembly

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

                  } } } -
                  `,Ky=({prev:s,next:a})=>i.jsx(A,{version:Xy,title:vy,description:Ry,cyfrinLink:Ny,html:Fy,prev:s,next:a,codes:Hy}),My="0.8.26",Sy="Assembly Variable",xy="Example of how to declare variable inside assembly",Jy="https://www.cyfrin.io/glossary/assembly-variable-code-example",zy=[{fileName:"AssemblyVariable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFzc2VtYmx5VmFyaWFibGUgewogICAgZnVuY3Rpb24geXVsX2xldCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTYgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gTGFuZ3VhZ2UgdXNlZCBmb3IgYXNzZW1ibHkgaXMgY2FsbGVkIFl1bAogICAgICAgICAgICAvLyBMb2NhbCB2YXJpYWJsZXMKICAgICAgICAgICAgbGV0IHggOj0gMTIzCiAgICAgICAgICAgIHogOj0gNDU2CiAgICAgICAgfQogICAgfQp9Cg=="}],Dy=`

                  Example of how to declare variables inside assembly

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

                  Example of how to declare variables inside assembly

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

                  } } } -
                  `,Ey=({prev:s,next:a})=>i.jsx(A,{version:My,title:Sy,description:xy,cyfrinLink:Jy,html:Dy,prev:s,next:a,codes:zy}),Qy="0.8.26",Ty="Bitwise Operators",Uy="Learn about bitwise operators in Solidity",_y="https://www.cyfrin.io/glossary/bitwise-operators-code-example",Ly=[{fileName:"Bitwise.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEJpdHdpc2VPcHMgewogICAgLy8geCAgICAgPSAxMTEwID0gOCArIDQgKyAyICsgMCA9IDE0CiAgICAvLyB5ICAgICA9IDEwMTEgPSA4ICsgMCArIDIgKyAxID0gMTEKICAgIC8vIHggJiB5ID0gMTAxMCA9IDggKyAwICsgMiArIDAgPSAxMAogICAgZnVuY3Rpb24gYW5kKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4geCAmIHk7CiAgICB9CgogICAgLy8geCAgICAgPSAxMTAwID0gOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB5ICAgICA9IDEwMDEgPSA4ICsgMCArIDAgKyAxID0gOQogICAgLy8geCB8IHkgPSAxMTAxID0gOCArIDQgKyAwICsgMSA9IDEzCiAgICBmdW5jdGlvbiBvcih1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHggfCB5OwogICAgfQoKICAgIC8vIHggICAgID0gMTEwMCA9IDggKyA0ICsgMCArIDAgPSAxMgogICAgLy8geSAgICAgPSAwMTAxID0gMCArIDQgKyAwICsgMSA9IDUKICAgIC8vIHggXiB5ID0gMTAwMSA9IDggKyAwICsgMCArIDEgPSA5CiAgICBmdW5jdGlvbiB4b3IodWludDI1NiB4LCB1aW50MjU2IHkpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB4IF4geTsKICAgIH0KCiAgICAvLyB4ICA9IDAwMDAxMTAwID0gICAwICsgIDAgKyAgMCArICAwICsgOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB+eCA9IDExMTEwMDExID0gMTI4ICsgNjQgKyAzMiArIDE2ICsgMCArIDAgKyAyICsgMSA9IDI0MwogICAgZnVuY3Rpb24gbm90KHVpbnQ4IHgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDgpIHsKICAgICAgICByZXR1cm4gfng7CiAgICB9CgogICAgLy8gMSA8PCAwID0gMDAwMSAtLT4gMDAwMSA9IDEKICAgIC8vIDEgPDwgMSA9IDAwMDEgLS0+IDAwMTAgPSAyCiAgICAvLyAxIDw8IDIgPSAwMDAxIC0tPiAwMTAwID0gNAogICAgLy8gMSA8PCAzID0gMDAwMSAtLT4gMTAwMCA9IDgKICAgIC8vIDMgPDwgMiA9IDAwMTEgLS0+IDExMDAgPSAxMgogICAgZnVuY3Rpb24gc2hpZnRMZWZ0KHVpbnQyNTYgeCwgdWludDI1NiBiaXRzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYpCiAgICB7CiAgICAgICAgcmV0dXJuIHggPDwgYml0czsKICAgIH0KCiAgICAvLyA4ICA+PiAwID0gMTAwMCAtLT4gMTAwMCA9IDgKICAgIC8vIDggID4+IDEgPSAxMDAwIC0tPiAwMTAwID0gNAogICAgLy8gOCAgPj4gMiA9IDEwMDAgLS0+IDAwMTAgPSAyCiAgICAvLyA4ICA+PiAzID0gMTAwMCAtLT4gMDAwMSA9IDEKICAgIC8vIDggID4+IDQgPSAxMDAwIC0tPiAwMDAwID0gMAogICAgLy8gMTIgPj4gMSA9IDExMDAgLS0+IDAxMTAgPSA2CiAgICBmdW5jdGlvbiBzaGlmdFJpZ2h0KHVpbnQyNTYgeCwgdWludDI1NiBiaXRzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYpCiAgICB7CiAgICAgICAgcmV0dXJuIHggPj4gYml0czsKICAgIH0KCiAgICAvLyBHZXQgbGFzdCBuIGJpdHMgZnJvbSB4CiAgICBmdW5jdGlvbiBnZXRMYXN0TkJpdHModWludDI1NiB4LCB1aW50MjU2IG4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NikKICAgIHsKICAgICAgICAvLyBFeGFtcGxlLCBsYXN0IDMgYml0cwogICAgICAgIC8vIHggICAgICAgID0gMTEwMSA9IDEzCiAgICAgICAgLy8gbWFzayAgICAgPSAwMTExID0gNwogICAgICAgIC8vIHggJiBtYXNrID0gMDEwMSA9IDUKICAgICAgICB1aW50MjU2IG1hc2sgPSAoMSA8PCBuKSAtIDE7CiAgICAgICAgcmV0dXJuIHggJiBtYXNrOwogICAgfQoKICAgIC8vIEdldCBsYXN0IG4gYml0cyBmcm9tIHggdXNpbmcgbW9kIG9wZXJhdG9yCiAgICBmdW5jdGlvbiBnZXRMYXN0TkJpdHNVc2luZ01vZCh1aW50MjU2IHgsIHVpbnQyNTYgbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIDEgPDwgbiA9IDIgKiogbgogICAgICAgIHJldHVybiB4ICUgKDEgPDwgbik7CiAgICB9CgogICAgLy8gR2V0IHBvc2l0aW9uIG9mIG1vc3Qgc2lnbmlmaWNhbnQgYml0CiAgICAvLyB4ID0gMTEwMCA9IDEyLCBtb3N0IHNpZ25pZmljYW50IGJpdCA9IDEwMDAsIHNvIHRoaXMgZnVuY3Rpb24gd2lsbCByZXR1cm4gMwogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgdWludDI1NiBpID0gMDsKICAgICAgICB3aGlsZSAoKHggPj49IDEpID4gMCkgewogICAgICAgICAgICArK2k7CiAgICAgICAgfQogICAgICAgIHJldHVybiBpOwogICAgfQoKICAgIC8vIEdldCBmaXJzdCBuIGJpdHMgZnJvbSB4CiAgICAvLyBsZW4gPSBsZW5ndGggb2YgYml0cyBpbiB4ID0gcG9zaXRpb24gb2YgbW9zdCBzaWduaWZpY2FudCBiaXQgb2YgeCwgKyAxCiAgICBmdW5jdGlvbiBnZXRGaXJzdE5CaXRzKHVpbnQyNTYgeCwgdWludDI1NiBuLCB1aW50MjU2IGxlbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIEV4YW1wbGUKICAgICAgICAvLyB4ICAgICAgICA9IDExMTAgPSAxNCwgbiA9IDIsIGxlbiA9IDQKICAgICAgICAvLyBtYXNrICAgICA9IDExMDAgPSAxMgogICAgICAgIC8vIHggJiBtYXNrID0gMTEwMCA9IDEyCiAgICAgICAgdWludDI1NiBtYXNrID0gKCgxIDw8IG4pIC0gMSkgPDwgKGxlbiAtIG4pOwogICAgICAgIHJldHVybiB4ICYgbWFzazsKICAgIH0KfQo="},{fileName:"MostSignificantBitAssembly.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEFzc2VtYmx5IHsKICAgIGZ1bmN0aW9uIG1vc3RTaWduaWZpY2FudEJpdCh1aW50MjU2IHgpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBtc2IpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNywgZ3QoeCwgMHhGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIC8vIG9yIGNhbiBiZSByZXBsYWNlZCB3aXRoIGFkZAogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg2LCBndCh4LCAweEZGRkZGRkZGRkZGRkZGRkYpKQogICAgICAgICAgICB4IDo9IHNocihmLCB4KQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg1LCBndCh4LCAweEZGRkZGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNCwgZ3QoeCwgMHhGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoMywgZ3QoeCwgMHhGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDIsIGd0KHgsIDB4RikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDEsIGd0KHgsIDB4MykpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gZ3QoeCwgMHgxKQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgIH0KfQo="},{fileName:"MostSignificantBitFunction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEZ1bmN0aW9uIHsKICAgIC8vIEZpbmQgbW9zdCBzaWduaWZpY2FudCBiaXQgdXNpbmcgYmluYXJ5IHNlYXJjaAogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IG1zYikKICAgIHsKICAgICAgICAvLyB4ID49IDIgKiogMTI4CiAgICAgICAgaWYgKHggPj0gMHgxMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTI4OwogICAgICAgICAgICBtc2IgKz0gMTI4OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogNjQKICAgICAgICBpZiAoeCA+PSAweDEwMDAwMDAwMDAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDY0OwogICAgICAgICAgICBtc2IgKz0gNjQ7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAzMgogICAgICAgIGlmICh4ID49IDB4MTAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDMyOwogICAgICAgICAgICBtc2IgKz0gMzI7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAxNgogICAgICAgIGlmICh4ID49IDB4MTAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTY7CiAgICAgICAgICAgIG1zYiArPSAxNjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDgKICAgICAgICBpZiAoeCA+PSAweDEwMCkgewogICAgICAgICAgICB4ID4+PSA4OwogICAgICAgICAgICBtc2IgKz0gODsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDQKICAgICAgICBpZiAoeCA+PSAweDEwKSB7CiAgICAgICAgICAgIHggPj49IDQ7CiAgICAgICAgICAgIG1zYiArPSA0OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogMgogICAgICAgIGlmICh4ID49IDB4NCkgewogICAgICAgICAgICB4ID4+PSAyOwogICAgICAgICAgICBtc2IgKz0gMjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDEKICAgICAgICBpZiAoeCA+PSAweDIpIG1zYiArPSAxOwogICAgfQp9Cg=="}],Oy=`
                  // SPDX-License-Identifier: MIT
                  +
                  `,Ey=({prev:s,next:a})=>i.jsx(A,{version:My,title:Sy,description:xy,cyfrinLink:Jy,html:Dy,prev:s,next:a,codes:zy}),Qy="0.8.26",Ty="Bitwise Operators",Uy="Learn about bitwise operators in Solidity",_y="https://www.cyfrin.io/glossary/bitwise-operators-solidity-code-example",Ly=[{fileName:"Bitwise.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEJpdHdpc2VPcHMgewogICAgLy8geCAgICAgPSAxMTEwID0gOCArIDQgKyAyICsgMCA9IDE0CiAgICAvLyB5ICAgICA9IDEwMTEgPSA4ICsgMCArIDIgKyAxID0gMTEKICAgIC8vIHggJiB5ID0gMTAxMCA9IDggKyAwICsgMiArIDAgPSAxMAogICAgZnVuY3Rpb24gYW5kKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4geCAmIHk7CiAgICB9CgogICAgLy8geCAgICAgPSAxMTAwID0gOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB5ICAgICA9IDEwMDEgPSA4ICsgMCArIDAgKyAxID0gOQogICAgLy8geCB8IHkgPSAxMTAxID0gOCArIDQgKyAwICsgMSA9IDEzCiAgICBmdW5jdGlvbiBvcih1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHggfCB5OwogICAgfQoKICAgIC8vIHggICAgID0gMTEwMCA9IDggKyA0ICsgMCArIDAgPSAxMgogICAgLy8geSAgICAgPSAwMTAxID0gMCArIDQgKyAwICsgMSA9IDUKICAgIC8vIHggXiB5ID0gMTAwMSA9IDggKyAwICsgMCArIDEgPSA5CiAgICBmdW5jdGlvbiB4b3IodWludDI1NiB4LCB1aW50MjU2IHkpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB4IF4geTsKICAgIH0KCiAgICAvLyB4ICA9IDAwMDAxMTAwID0gICAwICsgIDAgKyAgMCArICAwICsgOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB+eCA9IDExMTEwMDExID0gMTI4ICsgNjQgKyAzMiArIDE2ICsgMCArIDAgKyAyICsgMSA9IDI0MwogICAgZnVuY3Rpb24gbm90KHVpbnQ4IHgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodW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sKICAgICAgICAvLyBFeGFtcGxlLCBsYXN0IDMgYml0cwogICAgICAgIC8vIHggICAgICAgID0gMTEwMSA9IDEzCiAgICAgICAgLy8gbWFzayAgICAgPSAwMTExID0gNwogICAgICAgIC8vIHggJiBtYXNrID0gMDEwMSA9IDUKICAgICAgICB1aW50MjU2IG1hc2sgPSAoMSA8PCBuKSAtIDE7CiAgICAgICAgcmV0dXJuIHggJiBtYXNrOwogICAgfQoKICAgIC8vIEdldCBsYXN0IG4gYml0cyBmcm9tIHggdXNpbmcgbW9kIG9wZXJhdG9yCiAgICBmdW5jdGlvbiBnZXRMYXN0TkJpdHNVc2luZ01vZCh1aW50MjU2IHgsIHVpbnQyNTYgbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIDEgPDwgbiA9IDIgKiogbgogICAgICAgIHJldHVybiB4ICUgKDEgPDwgbik7CiAgICB9CgogICAgLy8gR2V0IHBvc2l0aW9uIG9mIG1vc3Qgc2lnbmlmaWNhbnQgYml0CiAgICAvLyB4ID0gMTEwMCA9IDEyLCBtb3N0IHNpZ25pZmljYW50IGJpdCA9IDEwMDAsIHNvIHRoaXMgZnVuY3Rpb24gd2lsbCByZXR1cm4gMwogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgdWludDI1NiBpID0gMDsKICAgICAgICB3aGlsZSAoKHggPj49IDEpID4gMCkgewogICAgICAgICAgICArK2k7CiAgICAgICAgfQogICAgICAgIHJldHVybiBpOwogICAgfQoKICAgIC8vIEdldCBmaXJzdCBuIGJpdHMgZnJvbSB4CiAgICAvLyBsZW4gPSBsZW5ndGggb2YgYml0cyBpbiB4ID0gcG9zaXRpb24gb2YgbW9zdCBzaWduaWZpY2FudCBiaXQgb2YgeCwgKyAxCiAgICBmdW5jdGlvbiBnZXRGaXJzdE5CaXRzKHVpbnQyNTYgeCwgdWludDI1NiBuLCB1aW50MjU2IGxlbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIEV4YW1wbGUKICAgICAgICAvLyB4ICAgICAgICA9IDExMTAgPSAxNCwgbiA9IDIsIGxlbiA9IDQKICAgICAgICAvLyBtYXNrICAgICA9IDExMDAgPSAxMgogICAgICAgIC8vIHggJiBtYXNrID0gMTEwMCA9IDEyCiAgICAgICAgdWludDI1NiBtYXNrID0gKCgxIDw8IG4pIC0gMSkgPDwgKGxlbiAtIG4pOwogICAgICAgIHJldHVybiB4ICYgbWFzazsKICAgIH0KfQo="},{fileName:"MostSignificantBitAssembly.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEFzc2VtYmx5IHsKICAgIGZ1bmN0aW9uIG1vc3RTaWduaWZpY2FudEJpdCh1aW50MjU2IHgpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBtc2IpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNywgZ3QoeCwgMHhGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIC8vIG9yIGNhbiBiZSByZXBsYWNlZCB3aXRoIGFkZAogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg2LCBndCh4LCAweEZGRkZGRkZGRkZGRkZGRkYpKQogICAgICAgICAgICB4IDo9IHNocihmLCB4KQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg1LCBndCh4LCAweEZGRkZGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNCwgZ3QoeCwgMHhGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoMywgZ3QoeCwgMHhGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDIsIGd0KHgsIDB4RikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDEsIGd0KHgsIDB4MykpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gZ3QoeCwgMHgxKQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgIH0KfQo="},{fileName:"MostSignificantBitFunction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEZ1bmN0aW9uIHsKICAgIC8vIEZpbmQgbW9zdCBzaWduaWZpY2FudCBiaXQgdXNpbmcgYmluYXJ5IHNlYXJjaAogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IG1zYikKICAgIHsKICAgICAgICAvLyB4ID49IDIgKiogMTI4CiAgICAgICAgaWYgKHggPj0gMHgxMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTI4OwogICAgICAgICAgICBtc2IgKz0gMTI4OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogNjQKICAgICAgICBpZiAoeCA+PSAweDEwMDAwMDAwMDAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDY0OwogICAgICAgICAgICBtc2IgKz0gNjQ7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAzMgogICAgICAgIGlmICh4ID49IDB4MTAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDMyOwogICAgICAgICAgICBtc2IgKz0gMzI7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAxNgogICAgICAgIGlmICh4ID49IDB4MTAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTY7CiAgICAgICAgICAgIG1zYiArPSAxNjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDgKICAgICAgICBpZiAoeCA+PSAweDEwMCkgewogICAgICAgICAgICB4ID4+PSA4OwogICAgICAgICAgICBtc2IgKz0gODsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDQKICAgICAgICBpZiAoeCA+PSAweDEwKSB7CiAgICAgICAgICAgIHggPj49IDQ7CiAgICAgICAgICAgIG1zYiArPSA0OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogMgogICAgICAgIGlmICh4ID49IDB4NCkgewogICAgICAgICAgICB4ID4+PSAyOwogICAgICAgICAgICBtc2IgKz0gMjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDEKICAgICAgICBpZiAoeCA+PSAweDIpIG1zYiArPSAxOwogICAgfQp9Cg=="}],Oy=`
                  // SPDX-License-Identifier: MIT
                   pragma solidity ^0.8.26;
                   
                   contract BitwiseOps {
                  @@ -3965,7 +3965,7 @@ Each slot in the array can store 32 bytes.

                  } } } -
                  `,Py=({prev:s,next:a})=>i.jsx(A,{version:Qy,title:Ty,description:Uy,cyfrinLink:_y,html:Oy,prev:s,next:a,codes:Ly}),$y="0.8.26",qy="Call",sm="In Solidity call is a low level function to interact with other contracts",am="https://www.cyfrin.io/glossary/call-code-example",nm=[{fileName:"Call.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFJlY2VpdmVyIHsKICAgIGV2ZW50IFJlY2VpdmVkKGFkZHJlc3MgY2FsbGVyLCB1aW50MjU2IGFtb3VudCwgc3RyaW5nIG1lc3NhZ2UpOwoKICAgIGZhbGxiYWNrKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgZW1pdCBSZWNlaXZlZChtc2cuc2VuZGVyLCBtc2cudmFsdWUsICJGYWxsYmFjayB3YXMgY2FsbGVkIik7CiAgICB9CgogICAgZnVuY3Rpb24gZm9vKHN0cmluZyBtZW1vcnkgX21lc3NhZ2UsIHVpbnQyNTYgX3gpCiAgICAgICAgcHVibGljCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYpCiAgICB7CiAgICAgICAgZW1pdCBSZWNlaXZlZChtc2cuc2VuZGVyLCBtc2cudmFsdWUsIF9tZXNzYWdlKTsKCiAgICAgICAgcmV0dXJuIF94ICsgMTsKICAg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ZHIuY2FsbHt2YWx1ZTogbXNnLnZhbHVlfSgKICAgICAgICAgICAgYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoImRvZXNOb3RFeGlzdCgpIikKICAgICAgICApOwoKICAgICAgICBlbWl0IFJlc3BvbnNlKHN1Y2Nlc3MsIGRhdGEpOwogICAgfQp9Cg=="}],lm=`

                  call is a low level function to interact with other contracts.

                  +`,Py=({prev:s,next:a})=>i.jsx(A,{version:Qy,title:Ty,description:Uy,cyfrinLink:_y,html:Oy,prev:s,next:a,codes:Ly}),$y="0.8.26",qy="Call",sm="In Solidity call is a low level function to interact with other contracts",am="https://www.cyfrin.io/glossary/call-solidity-code-example",nm=[{fileName:"Call.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFJlY2VpdmVyIHsKICAgIGV2ZW50IFJlY2VpdmVkKGFkZHJlc3MgY2FsbGVyLCB1aW50MjU2IGFtb3VudCwgc3RyaW5nIG1lc3NhZ2UpOwoKICAgIGZhbGxiYWNrKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgZW1pdCBSZWNlaXZlZChtc2cuc2VuZGVyLCBtc2cudmFsdWUsICJGYWxsYmFjayB3YXMgY2FsbGVkIik7CiAgICB9CgogICAgZnVuY3Rpb24gZm9vKHN0cmluZyBtZW1vcnkgX21lc3NhZ2UsIHVpbnQyNTYgX3gpCiAgICAgICAgcHVibGljCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYpCiAgICB7CiAgICAgICAgZW1pdCBSZWNlaXZlZChtc2cuc2VuZGVyLCBtc2cudmFsdWUsIF9tZXNzYWdlKTsKCiAgICAgICAgcmV0dXJuIF94ICsgMTsKICAgIH0KfQoKY29udHJhY3QgQ2FsbGVyIHsKICAgIGV2ZW50IFJlc3BvbnNlKGJvb2wgc3VjY2VzcywgYnl0ZXMgZGF0Y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RFeGlzdCgpIikKICAgICAgICApOwoKICAgICAgICBlbWl0IFJlc3BvbnNlKHN1Y2Nlc3MsIGRhdGEpOwogICAgfQp9Cg=="}],lm=`

                  call is a low level function to interact with other contracts.

                  This is the recommended method to use when you're just sending Ether via calling the fallback function.

                  However it is not the recommend way to call existing functions.

                  Few reasons why low-level call is not recommended

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

                  emit Response(success, data); } } -`,pm=({prev:s,next:a})=>i.jsx(A,{version:$y,title:qy,description:sm,cyfrinLink:am,html:lm,prev:s,next:a,codes:nm}),em="0.8.26",cm="Calling Other Contract",tm="In Solidity, contract can call other contracts in several ways",om="https://www.cyfrin.io/glossary/calling-other-contract-code-example",rm=[{fileName:"CallingContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENhbGxlZSB7CiAgICB1aW50MjU2IHB1YmxpYyB4OwogICAgdWludDI1NiBwdWJsaWMgdmFsdWU7CgogICAgZnVuY3Rpb24gc2V0WCh1aW50MjU2IF94KSBwdWJsaWMgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHggPSBfeDsKICAgICAgICByZXR1cm4geDsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYYW5kU2VuZEV0aGVyKHVpbnQyNTYgX3gpCiAgICAgICAgcHVibGljCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYsIHVpbnQyNTYpCiAgICB7CiAgICAgICAgeCA9IF94OwogICAgICAgIHZhbHVlID0gbXNnLnZhbHVlOwoKICAgICAgICByZXR1cm4gKHgsIHZhbHVlKTsKICAgIH0KfQoKY29udHJhY3QgQ2FsbGVyIHsKICAgIGZ1bmN0aW9uIHNldFgoQ2FsbGVlIF9jYWxsZWUsIHVpbnQyNTYgX3gpIHB1YmxpYyB7CiAgICAgICAgdWludDI1NiB4ID0gX2NhbGxlZS5zZXRYKF94KTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYRnJvbUFkZHJlc3MoYWRkcmVzcyBfYWRkciwgdWludDI1NiBfeCkgcHVibGljIHsKICAgICAgICBDYWxsZWUgY2FsbGVlID0gQ2FsbGVlKF9hZGRyKTsKICAgICAgICBjYWxsZWUuc2V0WChfeCk7CiAgICB9CgogICAgZnVuY3Rpb24gc2V0WGFuZFNlbmRFdGhlcihDYWxsZWUgX2NhbGxlZSwgdWludDI1NiBfeCkgcHVibGljIHBheWFibGUgewogICAgICAgICh1aW50MjU2IHgsIHVpbnQyNTYgdmFsdWUpID0KICAgICAgICAgICAgX2NhbGxlZS5zZXRYYW5kU2VuZEV0aGVye3ZhbHVlOiBtc2cudmFsdWV9KF94KTsKICAgIH0KfQo="}],im=`

                  Contract can call other contracts in 2 ways.

                  +`,pm=({prev:s,next:a})=>i.jsx(A,{version:$y,title:qy,description:sm,cyfrinLink:am,html:lm,prev:s,next:a,codes:nm}),em="0.8.26",cm="Calling Other Contract",tm="In Solidity, contract can call other contracts in several ways",om="https://www.cyfrin.io/glossary/calling-other-contract-solidity-code-example",rm=[{fileName:"CallingContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENhbGxlZSB7CiAgICB1aW50MjU2IHB1YmxpYyB4OwogICAgdWludDI1NiBwdWJsaWMgdmFsdWU7CgogICAgZnVuY3Rpb24gc2V0WCh1aW50MjU2IF94KSBwdWJsaWMgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHggPSBfeDsKICAgICAgICByZXR1cm4geDsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYYW5kU2VuZEV0aGVyKHVpbnQyNTYgX3gpCiAgICAgICAgcHVibGljCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYsIHVpbnQyNTYpCiAgICB7CiAgICAgICAgeCA9IF94OwogICAgICAgIHZhbHVlID0gbXNnLnZhbHVlOwoKICAgICAgICByZXR1cm4gKHgsIHZhbHVlKTsKICAgIH0KfQoKY29udHJhY3QgQ2FsbGVyIHsKICAgIGZ1bmN0aW9uIHNldFgoQ2FsbGVlIF9jYWxsZWUsIHVpbnQyNTYgX3gpIHB1YmxpYyB7CiAgICAgICAgdWludDI1NiB4ID0gX2NhbGxlZS5zZXRYKF94KTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYRnJvbUFkZHJlc3MoYWRkcmVzcyBfYWRkciwgdWludDI1NiBfeCkgcHVibGljIHsKICAgICAgICBDYWxsZWUgY2FsbGVlID0gQ2FsbGVlKF9hZGRyKTsKICAgICAgICBjYWxsZWUuc2V0WChfeCk7CiAgICB9CgogICAgZnVuY3Rpb24gc2V0WGFuZFNlbmRFdGhlcihDYWxsZWUgX2NhbGxlZSwgdWludDI1NiBfeCkgcHVibGljIHBheWFibGUgewogICAgICAgICh1aW50MjU2IHgsIHVpbnQyNTYgdmFsdWUpID0KICAgICAgICAgICAgX2NhbGxlZS5zZXRYYW5kU2VuZEV0aGVye3ZhbHVlOiBtc2cudmFsdWV9KF94KTsKICAgIH0KfQo="}],im=`

                  Contract can call other contracts in 2 ways.

                  The easiest way to is to just call it, like A.foo(x, y, z).

                  Another way to call other contracts is to use the low-level call.

                  This method is not recommended.

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

                  _callee.setXandSendEther{value: msg.value}(_x); } } -`,gm=({prev:s,next:a})=>i.jsx(A,{version:em,title:cm,description:tm,cyfrinLink:om,html:im,prev:s,next:a,codes:rm}),hm="0.8.26",Im="Constants",dm="Constant variables",Cm="https://www.cyfrin.io/glossary/constants-code-example",jm=[{fileName:"Constants.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENvbnN0YW50cyB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBjb25zdGFudCBNWV9BRERSRVNTID0KICAgICAgICAweDc3Nzc4ODg4OTk5OUFhQUFiQmJiQ2NjY2RkRGRlZWVFZkZGZkNjQ2M7CiAgICB1aW50MjU2IHB1YmxpYyBjb25zdGFudCBNWV9VSU5UID0gMTIzOwp9Cg=="}],Am=`

                  Constants are variables that cannot be modified.

                  +`,gm=({prev:s,next:a})=>i.jsx(A,{version:em,title:cm,description:tm,cyfrinLink:om,html:im,prev:s,next:a,codes:rm}),hm="0.8.26",Im="Constants",dm="Constant variables",Cm="https://www.cyfrin.io/glossary/constants-solidity-code-example",jm=[{fileName:"Constants.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENvbnN0YW50cyB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBjb25zdGFudCBNWV9BRERSRVNTID0KICAgICAgICAweDc3Nzc4ODg4OTk5OUFhQUFiQmJiQ2NjY2RkRGRlZWVFZkZGZkNjQ2M7CiAgICB1aW50MjU2IHB1YmxpYyBjb25zdGFudCBNWV9VSU5UID0gMTIzOwp9Cg=="}],Am=`

                  Constants are variables that cannot be modified.

                  Their value is hard coded and using constants can save gas cost.

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

                  0x777788889999AaAAbBbbCcccddDdeeeEfFFfCcCc; uint256 public constant MY_UINT = 123; } -
                  `,um=({prev:s,next:a})=>i.jsx(A,{version:hm,title:Im,description:dm,cyfrinLink:Cm,html:Am,prev:s,next:a,codes:jm}),ym="0.8.26",mm="Constructor",bm="Learn how to initialize smart contracts in Solidity using a constructor",wm="https://www.cyfrin.io/glossary/constructor-code-example",km=[{fileName:"Constructor.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIEJhc2UgY29udHJhY3QgWApjb250cmFjdCBYIHsKICAgIHN0cmluZyBwdWJsaWMgbmFtZTsKCiAgICBjb25zdHJ1Y3RvcihzdHJpbmcgbWVtb3J5IF9uYW1lKSB7CiAgICAgICAgbmFtZSA9IF9uYW1lOwogICAgfQp9CgovLyBCYXNlIGNvbnRyYWN0IFkKY29udHJhY3QgWSB7CiAgICBzdHJpbmcgcHVibGljIHRleHQ7CgogICAgY29uc3RydWN0b3Ioc3RyaW5nIG1lbW9yeSBfdGV4dCkgewogICAgICAgIHRleHQgPSBfdGV4dDsKICAgIH0KfQoKLy8gVGhlcmUgYXJlIDIgd2F5cyB0byBpbml0aWFsaXplIHBhcmVudCBjb250cmFjdCB3aXRoIHBhcmFtZXRlcnMuCgovLyBQYXNzIHRoZSBwYXJhbWV0ZXJzIGhlcmUgaW4gdGhlIGluaGVyaXRhbmNlIGxpc3QuCmNvbnRyYWN0IEIgaXMgWCgiSW5wdXQgdG8gWCIpLCBZKCJJbnB1dCB0byBZIikge30KCmNvbnRyYWN0IEMgaXMgWCwgWSB7CiAgICAvLyBQYXNzIHRoZSBwYXJhbWV0ZXJzIGhlcmUgaW4gdGhlIGNvbnN0cnVjdG9yLAogICAgLy8gc2ltaWxhciB0byBmdW5jdGlvbiBtb2RpZmllcnMuCiAgICBjb25zdHJ1Y3RvcihzdHJpbmcgbWVtb3J5IF9uYW1lLCBzdHJpbmcgbWVtb3J5IF90ZXh0KSBYKF9uYW1lKSBZKF90ZXh0KSB7fQp9CgovLyBQYXJlbnQgY29uc3RydWN0b3JzIGFyZSBhbHdheXMgY2FsbGVkIGluIHRoZSBvcmRlciBvZiBpbmhlcml0YW5jZQovLyByZWdhcmRsZXNzIG9mIHRoZSBvcmRlciBvZiBwYXJlbnQgY29udHJhY3RzIGxpc3RlZCBpbiB0aGUKLy8gY29uc3RydWN0b3Igb2YgdGhlIGNoaWxkIGNvbnRyYWN0LgoKLy8gT3JkZXIgb2YgY29uc3RydWN0b3JzIGNhbGxlZDoKLy8gMS4gWAovLyAyLiBZCi8vIDMuIEQKY29udHJhY3QgRCBpcyBYLCBZIHsKICAgIGNvbnN0cnVjdG9yKCkgWCgiWCB3YXMgY2FsbGVkIikgWSgiWSB3YXMgY2FsbGVkIikge30KfQoKLy8gT3JkZXIgb2YgY29uc3RydWN0b3JzIGNhbGxlZDoKLy8gMS4gWAovLyAyLiBZCi8vIDMuIEUKY29udHJhY3QgRSBpcyBYLCBZIHsKICAgIGNvbnN0cnVjdG9yKCkgWSgiWSB3YXMgY2FsbGVkIikgWCgiWCB3YXMgY2FsbGVkIikge30KfQo="}],Zm=`

                  A constructor is an optional function that is executed upon contract creation.

                  +`,um=({prev:s,next:a})=>i.jsx(A,{version:hm,title:Im,description:dm,cyfrinLink:Cm,html:Am,prev:s,next:a,codes:jm}),ym="0.8.26",mm="Constructor",bm="Learn how to initialize smart contracts in Solidity using a constructor",wm="https://www.cyfrin.io/glossary/constructor-solidity-code-example",km=[{fileName:"Constructor.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIEJhc2UgY29udHJhY3QgWApjb250cmFjdCBYIHsKICAgIHN0cmluZyBwdWJsaWMgbmFtZTsKCiAgICBjb25zdHJ1Y3RvcihzdHJpbmcgbWVtb3J5IF9uYW1lKSB7CiAgICAgICAgbmFtZSA9IF9uYW1lOwogICAgfQp9CgovLyBCYXNlIGNvbnRyYWN0IFkKY29udHJhY3QgWSB7CiAgICBzdHJpbmcgcHVibGljIHRleHQ7CgogICAgY29uc3RydWN0b3Ioc3RyaW5nIG1lbW9yeSBfdGV4dCkgewogICAgICAgIHRleHQg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CgiWCB3YXMgY2FsbGVkIikge30KfQo="}],Zm=`

                  A constructor is an optional function that is executed upon contract creation.

                  Here are examples of how to pass arguments to constructors.

                  // SPDX-License-Identifier: MIT
                   pragma solidity ^0.8.26;
                  @@ -4126,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}),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 +`,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-solidity-code-example",Ym=[{fileName:"DataLocations.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IERhdGFMb2NhdGlvbnMgewogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CiAgICBtYXBwaW5nKHVpbnQyNTYgPT4gYWRkcmVzcykgbWFwOwoKICAgIHN0cnVjdCBNeVN0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5CiAgICB9Cn0K"}],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)
                  • @@ -7372,7 +7372,7 @@ IERC20 constant PAIR address indexed owner, address indexed spender, uint256 amount ); } -`,Fw=({prev:s,next:a})=>i.jsx(A,{version:Yw,title:Xw,description:vw,cyfrinLink:Rw,html:Hw,prev:s,next:a,codes:Nw}),Kw="0.8.26",Mw="Delegatecall",Sw="Example of how to use deletegatecall in Solidity",xw="https://www.cyfrin.io/glossary/delegatecall-code-example",Jw=[{fileName:"Delegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE5PVEU6IERlcGxveSB0aGlzIGNvbnRyYWN0IGZpcnN0CmNvbnRyYWN0IEIgewogICAgLy8gTk9URTogc3RvcmFnZSBsYXlvdXQgbXVzdCBiZSB0aGUgc2FtZSBhcyBjb250cmFjdCBBCiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKHVpbnQyNTYgX251bSkgcHVibGljIHBheWFibGUgewogICAgICAgIG51bSA9IF9udW07CiAgICAgICAgc2VuZGVyID0gbXNnLnNlbmRlcjsKICAgICAgICB2YWx1ZSA9IG1zZy52YWx1ZTsKICAgIH0KfQoKY29udHJhY3QgQSB7CiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKGFkZHJlc3MgX2NvbnRyYWN0LCB1aW50MjU2IF9udW0pIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICAvLyBBJ3Mgc3RvcmFnZSBpcyBzZXQsIEIgaXMgbm90IG1vZGlmaWVkLgogICAgICAgIChib29sIHN1Y2Nlc3MsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF9jb250cmFjdC5kZWxlZ2F0ZWNhbGwoCiAgICAgICAgICAgIGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJzZXRWYXJzKHVpbnQyNTYpIiwgX251bSkKICAgICAgICApOwogICAgfQp9Cg=="}],zw=`

                    delegatecall is a low level function similar to call.

                    +`,Fw=({prev:s,next:a})=>i.jsx(A,{version:Yw,title:Xw,description:vw,cyfrinLink:Rw,html:Hw,prev:s,next:a,codes:Nw}),Kw="0.8.26",Mw="Delegatecall",Sw="Example of how to use deletegatecall in Solidity",xw="https://www.cyfrin.io/glossary/delegatecall-solidity-code-example",Jw=[{fileName:"Delegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIE5PVEU6IERlcGxveSB0aGlzIGNvbnRyYWN0IGZpcnN0CmNvbnRyYWN0IEIgewogICAgLy8gTk9URTogc3RvcmFnZSBsYXlvdXQgbXVzdCBiZSB0aGUgc2FtZSBhcyBjb250cmFjdCBBCiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKHVpbnQyNTYgX251bSkgcHVibGljIHBheWFibGUgewogICAgICAgIG51bSA9IF9udW07CiAgICAgICAgc2VuZGVyID0gbXNnLnNlbmRlcjsKICAgICAgICB2YWx1ZSA9IG1zZy52YWx1ZTsKICAgIH0KfQoKY29udHJhY3QgQSB7CiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKGFkZHJlc3MgX2NvbnRyYWN0LCB1aW50MjU2IF9udW0pIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICAvLyBBJ3Mgc3RvcmFnZSBpcyBzZXQsIEIgaXMgbm90IG1vZGlmaWVkLgogICAgICAgIChib29sIHN1Y2Nlc3MsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF9jb250cmFjdC5kZWxlZ2F0ZWNhbGwoCiAgICAgICAgICAgIGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJzZXRWYXJzKHVpbnQyNTYpIiwgX251bSkKICAgICAgICApOwogICAgfQp9Cg=="}],zw=`

                    delegatecall is a low level function similar to call.

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

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

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

                    +
                    `,Dw=({prev:s,next:a})=>i.jsx(A,{version:Kw,title:Mw,description:Sw,cyfrinLink:xw,html:zw,prev:s,next:a,codes:Jw}),Ew="0.8.26",Qw="Enum",Tw="Example of enums in Solidity",Uw="https://www.cyfrin.io/glossary/enum-solidity-code-example",_w=[{fileName:"Enum.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEVudW0gewogICAgLy8gRW51bSByZXByZXNlbnRpbmcgc2hpcHBpbmcgc3RhdHVzCiAgICBlbnVtIFN0YXR1cyB7CiAgICAgICAgUGVuZGluZywKICAgICAgICBTaGlwcGVkLAogICAgICAgIEFjY2VwdGVkLAogICAgICAgIFJlamVjdGVkLAogICAgICAgIENhbmNlbGVkCiAgICB9CgogICAgLy8gRGVmYXVsdCB2YWx1ZSBpcyB0aGUgZmlyc3QgZWxlbWVudCBsaXN0ZWQgaW4KICAgIC8vIGRlZmluaXRpb24gb2YgdGhlIHR5cGUsIGluIHRoaXMgY2FzZSAiUGVuZGluZyIKICAgIFN0YXR1cyBwdWJsaWMgc3RhdHVzOwoKICAgIC8vIFJldHVybnMgdWludAogICAgLy8gUGVuZGluZyAgLSAwCiAgICAvLyBTaGlwcGVkICAtIDEKICAgIC8vIEFjY2VwdGVkIC0gMgogICAgLy8gUmVqZWN0ZWQgLSAzCiAgICAvLyBDYW5jZWxlZCAtIDQKICAgIGZ1bmN0aW9uIGdldCgpIHB1YmxpYyB2aWV3IHJldHVybnMgKFN0YXR1cykgewogICAgICAgIHJldHVybiBzdGF0dXM7CiAgICB9CgogICAgLy8gVXBkYXRlIHN0YXR1cyBieSBwYXNzaW5nIHVpbnQgaW50byBpbnB1dAogICAgZnVuY3Rpb24gc2V0KFN0YXR1cyBfc3RhdHVzKSBwdWJsaWMgewogICAgICAgIHN0YXR1cyA9IF9zdGF0dXM7CiAgICB9CgogICAgLy8gWW91IGNhbiB1cGRhdGUgdG8gYSBzcGVjaWZpYyBlbnVtIGxpa2UgdGhpcwogICAgZnVuY3Rpb24gY2FuY2VsKCkgcHVibGljIHsKICAgICAgICBzdGF0dXMgPSBTdGF0dXMuQ2FuY2VsZWQ7CiAgICB9CgogICAgLy8gZGVsZXRlIHJlc2V0cyB0aGUgZW51bSB0byBpdHMgZmlyc3QgdmFsdWUsIDAKICAgIGZ1bmN0aW9uIHJlc2V0KCkgcHVibGljIHsKICAgICAgICBkZWxldGUgc3RhdHVzOwogICAgfQp9Cg=="},{fileName:"EnumDeclaration.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKLy8gVGhpcyBpcyBzYXZlZCAnRW51bURlY2xhcmF0aW9uLnNvbCcKCmVudW0gU3RhdHVzIHsKICAgIFBlbmRpbmcsCiAgICBTaGlwcGVkLAogICAgQWNjZXB0ZWQsCiAgICBSZWplY3RlZCwKICAgIENhbmNlbGVkCn0K"},{fileName:"EnumImport.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9FbnVtRGVjbGFyYXRpb24uc29sIjsKCmNvbnRyYWN0IEVudW0gewogICAgU3RhdHVzIHB1YmxpYyBzdGF0dXM7Cn0K"}],Lw=`

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

                    Enums can be declared outside of a contract.

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.26;
                    @@ -7470,7 +7470,7 @@ IERC20 constant PAIR contract Enum {
                         Status public status;
                     }
                    -
                    `,Ow=({prev:s,next:a})=>i.jsx(A,{version:Ew,title:Qw,description:Tw,cyfrinLink:Uw,html:Lw,prev:s,next:a,codes:_w}),Pw="0.8.26",$w="Error",qw="Example of how to throw errors in Solidity",sk="https://www.cyfrin.io/glossary/error-code-example",ak=[{fileName:"Account.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFjY291bnQgewogICAgdWludDI1NiBwdWJsaWMgYmFsYW5jZTsKICAgIHVpbnQyNTYgcHVibGljIGNvbnN0YW50IE1BWF9VSU5UID0gMiAqKiAyNTYgLSAxOwoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludDI1NiBfYW1vdW50KSBwdWJsaWMgewogICAgICAgIHVpbnQyNTYgb2xkQmFsYW5jZSA9IGJhbGFuY2U7CiAgICAgICAgdWludDI1NiBuZXdCYWxhbmNlID0gYmFsYW5jZSArIF9hbW91bnQ7CgogICAgICAgIC8vIGJhbGFuY2UgKyBfYW1vdW50IGRvZXMgbm90IG92ZXJmbG93IGlmIGJhbGFuY2UgKyBfYW1vdW50ID49IGJhbGFuY2UKICAgICAgICByZXF1aXJlKG5ld0JhbGFuY2UgPj0gb2xkQmFsYW5jZSwgIk92ZXJmbG93Iik7CgogICAgICAgIGJhbGFuY2UgPSBuZX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IHsKICAgICAgICAgICAgcmV2ZXJ0IEluc3VmZmljaWVudEJhbGFuY2UoewogICAgICAgICAgICAgICAgYmFsYW5jZTogYmFsLAogICAgICAgICAgICAgICAgd2l0aGRyYXdBbW91bnQ6IF93aXRoZHJhd0Ftb3VudAogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICB9Cn0K"}],nk=`

                    An error will undo all changes made to the state during a transaction.

                    +`,Ow=({prev:s,next:a})=>i.jsx(A,{version:Ew,title:Qw,description:Tw,cyfrinLink:Uw,html:Lw,prev:s,next:a,codes:_w}),Pw="0.8.26",$w="Error",qw="Example of how to throw errors in Solidity",sk="https://www.cyfrin.io/glossary/error-solidity-code-example",ak=[{fileName:"Account.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEFjY291bnQgewogICAgdWludDI1NiBwdWJsaWMgYmFsYW5jZTsKICAgIHVpbnQyNTYgcHVibGljIGNvbnN0YW50IE1BWF9VSU5UID0gMiAqKiAyNTYgLSAxOwoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludDI1NiBfYW1vdW50KSBwdWJsaWMgewogICAgICAgIHVpbnQyNTYgb2xkQmFsYW5jZSA9IGJhbGFuY2U7CiAgICAgICAgdWludDI1NiBuZXdCYWxhbmNlID0gYmFsYW5jZSArIF9hbW91bnQ7CgogICAgICAgIC8vIGJhbGFuY2UgKyBfYW1vdW50IGRvZXMgbm90IG92ZXJmbG93IGlmIGJhbGFuY2UgKyBfYW1vdW50ID49IGJhbGFuY2UKICAgICAgICByZXF1aXJlKG5ld0JhbGFuY2UgPj0gb2xkQmFsYW5jZSwgIk92ZXJmbG93Iik7CgogICAgICAgIGJhbGFuY2UgPSBuZXdCYWxhbmNlOwoKICAgICAgICBhc3NlcnQoYmFsYW5jZSA+PSBvbGRCYWxhbmNlKTsKICAgIH0KCiAgICBmdW5jdGlvbiB3aXRoZHJhd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ICAgd2l0aGRyYXdBbW91bnQ6IF93aXRoZHJhd0Ftb3VudAogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICB9Cn0K"}],nk=`

                    An error will undo all changes made to the state during a transaction.

                    You can throw an error by calling require, revert or assert.

                    • require is used to validate inputs and conditions before execution.
                    • @@ -7558,7 +7558,7 @@ assertion probably means that there is a bug. assert(balance <= oldBalance); } } -`,lk=({prev:s,next:a})=>i.jsx(A,{version:Pw,title:$w,description:qw,cyfrinLink:sk,html:nk,prev:s,next:a,codes:ak}),pk="0.8.26",ek="Ether and Wei",ck="An example of Ether and Wei in Solidity",tk="https://www.cyfrin.io/glossary/ether-and-wei-code-example",ok=[{fileName:"EtherUnits.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEV0aGVyVW5pdHMgewogICAgdWludDI1NiBwdWJsaWMgb25lV2VpID0gMSB3ZWk7CiAgICAvLyAxIHdlaSBpcyBlcXVhbCB0byAxCiAgICBib29sIHB1YmxpYyBpc09uZVdlaSA9IChvbmVXZWkgPT0gMSk7CgogICAgdWludDI1NiBwdWJsaWMgb25lR3dlaSA9IDEgZ3dlaTsKICAgIC8vIDEgZ3dlaSBpcyBlcXVhbCB0byAxMF45IHdlaQogICAgYm9vbCBwdWJsaWMgaXNPbmVHd2VpID0gKG9uZUd3ZWkgPT0gMWU5KTsKCiAgICB1aW50MjU2IHB1YmxpYyBvbmVFdGhlciA9IDEgZXRoZXI7CiAgICAvLyAxIGV0aGVyIGlzIGVxdWFsIHRvIDEwXjE4IHdlaQogICAgYm9vbCBwdWJsaWMgaXNPbmVFdGhlciA9IChvbmVFdGhlciA9PSAxZTE4KTsKfQo="}],rk=`

                      Transactions are paid with ether.

                      +`,lk=({prev:s,next:a})=>i.jsx(A,{version:Pw,title:$w,description:qw,cyfrinLink:sk,html:nk,prev:s,next:a,codes:ak}),pk="0.8.26",ek="Ether and Wei",ck="An example of Ether and Wei in Solidity",tk="https://www.cyfrin.io/glossary/ether-and-wei-solidity-code-example",ok=[{fileName:"EtherUnits.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEV0aGVyVW5pdHMgewogICAgdWludDI1NiBwdWJsaWMgb25lV2VpID0gMSB3ZWk7CiAgICAvLyAxIHdlaSBpcyBlcXVhbCB0byAxCiAgICBib29sIHB1YmxpYyBpc09uZVdlaSA9IChvbmVXZWkgPT0gMSk7CgogICAgdWludDI1NiBwdWJsaWMgb25lR3dlaSA9IDEgZ3dlaTsKICAgIC8vIDEgZ3dlaSBpcyBlcXVhbCB0byAxMF45IHdlaQogICAgYm9vbCBwdWJsaWMgaXNPbmVHd2VpID0gKG9uZUd3ZWkgPT0gMWU5KTsKCiAgICB1aW50MjU2IHB1YmxpYyBvbmVFdGhlciA9IDEgZXRoZXI7CiAgICAvLyAxIGV0aGVyIGlzIGVxdWFsIHRvIDEwXjE4IHdlaQogICAgYm9vbCBwdWJsaWMgaXNPbmVFdGhlciA9IChvbmVFdGhlciA9PSAxZTE4KTsKfQo="}],rk=`

                      Transactions are paid with ether.

                      Similar to how one dollar is equal to 100 cent, one ether is equal to 1018 wei.

                      // SPDX-License-Identifier: MIT
                       pragma solidity ^0.8.26;
                      @@ -7576,7 +7576,7 @@ assertion probably means that there is a bug.
                           // 1 ether is equal to 10^18 wei
                           bool public isOneEther = (oneEther == 1e18);
                       }
                      -
                      `,ik=({prev:s,next:a})=>i.jsx(A,{version:pk,title:ek,description:ck,cyfrinLink:tk,html:rk,prev:s,next:a,codes:ok}),gk="0.8.26",hk="Events",Ik="Example of how to emit events in Solidity",dk="https://www.cyfrin.io/glossary/events-code-example",Ck=[{fileName:"Events.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEV2ZW50IHsKICAgIC8vIEV2ZW50IGRlY2xhcmF0aW9uCiAgICAvLyBVcCB0byAzIHBhcmFtZXRlcnMgY2FuIGJlIGluZGV4ZWQuCiAgICAvLyBJbmRleGVkIHBhcmFtZXRlcnMgaGVscHMgeW91IGZpbHRlciB0aGUgbG9ncyBieSB0aGUgaW5kZXhlZCBwYXJhbWV0ZXIKICAgIGV2ZW50IExvZyhhZGRyZXNzIGluZGV4ZWQgc2VuZGVyLCBzdHJpbmcgbWVzc2FnZSk7CiAgICBldmVudCBBbm90aGVyTG9nKCk7CgogICAgZnVuY3Rpb24gdGVzdCgpIHB1YmxpYyB7CiAgICAgICAgZW1pdCBMb2cobXNnLnNlbmRlciwgIkhlbGxvIFdvcmxkISIpOwogICAgICAgIGVtaXQgTG9nKG1zZy5zZW5kZXIsICJIZWxsbyBFVk0hIik7CiAgICAgICAgZW1pdCBBbm90aGVyTG9nKCk7CiAgICB9Cn0K"}],jk=`

                      Events allow logging to the Ethereum blockchain. Some use cases for events are:

                      +`,ik=({prev:s,next:a})=>i.jsx(A,{version:pk,title:ek,description:ck,cyfrinLink:tk,html:rk,prev:s,next:a,codes:ok}),gk="0.8.26",hk="Events",Ik="Example of how to emit events in Solidity",dk="https://www.cyfrin.io/glossary/events-solidity-code-example",Ck=[{fileName:"Events.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEV2ZW50IHsKICAgIC8vIEV2ZW50IGRlY2xhcmF0aW9uCiAgICAvLyBVcCB0byAzIHBhcmFtZXRlcnMgY2FuIGJlIGluZGV4ZWQuCiAgICAvLyBJbmRleGVkIHBhcmFtZXRlcnMgaGVscHMgeW91IGZpbHRlciB0aGUgbG9ncyBieSB0aGUgaW5kZXhlZCBwYXJhbWV0ZXIKICAgIGV2ZW50IExvZyhhZGRyZXNzIGluZGV4ZWQgc2VuZGVyLCBzdHJpbmcgbWVzc2FnZSk7CiAgICBldmVudCBBbm90aGVyTG9nKCk7CgogICAgZnVuY3Rpb24gdGVzdCgpIHB1YmxpYyB7CiAgICAgICAgZW1pdCBMb2cobXNnLnNlbmRlciwgIkhlbGxvIFdvcmxkISIpOwogICAgICAgIGVtaXQgTG9nKG1zZy5zZW5kZXIsICJIZWxsbyBFVk0hIik7CiAgICAgICAgZW1pdCBBbm90aGVyTG9nKCk7CiAgICB9Cn0K"}],jk=`

                      Events allow logging to the Ethereum blockchain. Some use cases for events are:

                      • Listening for events and updating user interface
                      • A cheap form of storage
                      • @@ -7597,7 +7597,7 @@ assertion probably means that there is a bug. emit AnotherLog(); } } -`,Ak=({prev:s,next:a})=>i.jsx(A,{version:gk,title:hk,description:Ik,cyfrinLink:dk,html:jk,prev:s,next:a,codes:Ck}),uk="0.8.26",yk="Events Advanced",mk="Advanced topics and concepts related to Solidity events",bk="https://www.cyfrin.io/glossary/events-advanced-code-example",wk=[{fileName:"EventsAdvanced.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4xNDsKCi8vIEV2ZW50LURyaXZlbiBBcmNoaXRlY3R1cmUKY29udHJhY3QgRXZlbnREcml2ZW5BcmNoaXRlY3R1cmUgewogICAgZXZlbnQgVHJhbnNmZXJJbml0aWF0ZWQoCiAgICAgICAgYWRkcmVzcyBpbmRleGVkIGZyb20sIGFkZHJlc3MgaW5kZXhlZCB0bywgdWludDI1NiB2YWx1ZQogICAgKTsKICAgIGV2ZW50IFRyYW5zZmVyQ29uZmlybWVkKAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCBmcm9tLCBhZGRyZXNzIGluZGV4ZWQgdG8sIHVpbnQyNTYgdmFsdWUKICAgICk7CgogICAgbWFwcGluZyhieXRlczMyID0+IGJvb2wpIHB1YmxpYyB0cmFuc2ZlckNvbmZpcm1hdGlvbnM7CgogICAgZnVuY3Rpb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mliZXJMaXN0W2ldKS5oYW5kbGVUcmFuc2ZlckV2ZW50KAogICAgICAgICAgICAgICAgbXNnLnNlbmRlciwgdG8sIHZhbHVlCiAgICAgICAgICAgICk7CiAgICAgICAgfQogICAgfQp9Cg=="}],kk=`

                        This page covers advanced topics and use cases related to events in Solidity, building upon the basics covered in the Events page.

                        +`,Ak=({prev:s,next:a})=>i.jsx(A,{version:gk,title:hk,description:Ik,cyfrinLink:dk,html:jk,prev:s,next:a,codes:Ck}),uk="0.8.26",yk="Events Advanced",mk="Advanced topics and concepts related to Solidity events",bk="https://www.cyfrin.io/glossary/events-advanced-solidity-code-example",wk=[{fileName:"EventsAdvanced.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4xNDsKCi8vIEV2ZW50LURyaXZlbiBBcmNoaXRlY3R1cmUKY29udHJhY3QgRXZlbnREcml2ZW5BcmNoaXRlY3R1cmUgewogICAgZXZlbnQgVHJhbnNmZXJJbml0aWF0ZWQoCiAgICAgICAgYWRkcmVzcyBpbmRleGVkIGZyb20sIGFkZHJlc3MgaW5kZXhlZCB0bywgdWludDI1NiB2YWx1ZQogICAgKTsKICAgIGV2ZW50IFRyYW5zZmVyQ29uZmlybWVkKAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCBmcm9tLCBhZGRyZXNzIGluZGV4ZWQgdG8sIHVpbnQyNTYgdmFsdWUKICAgICk7CgogICAgbWFwcGluZyhieXRlczMyID0+IGJvb2wpIHB1YmxpYyB0cmFuc2ZlckNvbmZpcm1hdGlvbnM7CgogICAgZnVuY3Rpb24gaW5pdGlhdGVUcmFuc2ZlcihhZGRyZXNzIHRvLCB1aW50MjU2IHZhbHVlKSBwdWJsaWMgewogICAgICAgIGVtaXQgVHJhbnNmZXJJbml0aWF0ZWQobXNnLnNlbmRlciwgdG8sIHZhbHVlKTsKICAgICAgICAvLyAuLi4gKGluaXRpYXRlIHRyYW5zZmVyI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y5zZW5kZXJdID0gdHJ1ZTsKICAgICAgICBzdWJzY3JpYmVyTGlzdC5wdXNoKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIHVuc3Vic2NyaWJlKCkgcHVibGljIHsKICAgICAgICByZXF1aXJlKHN1YnNjcmliZXJzW21zZy5zZW5kZXJdLCAiTm90IHN1YnNjcmliZWQiKTsKICAgICAgICBzdWJzY3JpYmVyc1ttc2cuc2VuZGVyXSA9IGZhbHNlOwogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IHN1YnNjcmliZXJMaXN0Lmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGlmIChzdWJzY3JpYmVyTGlzdFtpXSA9PSBtc2cuc2VuZGVyKSB7CiAgICAgICAgICAgICAgICBzdWJzY3JpYmVyTGlzdFtpXSA9IHN1YnNjcmliZXJMaXN0W3N1YnNjcmliZXJMaXN0Lmxlbmd0aCAtIDFdOwogICAgICAgICAgICAgICAgc3Vic2NyaWJlckxpc3QucG9wKCk7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIHRvLCB1aW50MjU2IHZhbHVlKSBwdWJsaWMgewogICAgICAgIGVtaXQgTG9nVHJhbnNmZXIobXNnLnNlbmRlciwgdG8sIHZhbHVlKTsKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCBzdWJzY3JpYmVyTGlzdC5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBJRXZlbnRTdWJzY3JpYmVyKHN1YnNjcmliZXJMaXN0W2ldKS5oYW5kbGVUcmFuc2ZlckV2ZW50KAogICAgICAgICAgICAgICAgbXNnLnNlbmRlciwgdG8sIHZhbHVlCiAgICAgICAgICAgICk7CiAgICAgICAgfQogICAgfQp9Cg=="}],kk=`

                        This page covers advanced topics and use cases related to events in Solidity, building upon the basics covered in the Events page.

                        Events in Solidity are a powerful tool that enables various advanced functionalities and architectures. Some advanced use cases for events include:

                        • Event filtering and monitoring for real-time updates and analytics
                        • @@ -8876,7 +8876,7 @@ assertion probably means that there is a bug. } } } -`,Mk=({prev:s,next:a})=>i.jsx(A,{version:vk,title:Rk,description:Nk,cyfrinLink:Hk,html:Kk,prev:s,next:a,codes:Fk}),Sk="0.8.26",xk="Fallback",Jk="Example of how to use fallback in Solidity",zk="https://www.cyfrin.io/glossary/fallback-code-example",Dk=[{fileName:"Fallback.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZhbGxiYWNrIHsKICAgIGV2ZW50IExvZyhzdHJpbmcgZnVuYywgdWludDI1NiBnYXMpOwoKICAgIC8vIEZhbGxiYWNrIGZ1bmN0aW9uIG11c3QgYmUgZGVjbGFyZWQgYXMgZXh0ZXJuYWwuCiAgICBmYWxsYmFjaygpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIC8vIHNlbmQgLyB0cmFuc2ZlciAoZm9yd2FyZHMgMjMwMCBnYXMgdG8gdGhpcyBmYWxsYmFjayBmdW5jdGlvbikKICAgICAgICAvLyBjYWxsIChmb3J3YXJkcyBhbGwgb2YgdGhlIGdhcykKICAgICAgICBlbWl0IExvZygiZmFsbGJhY2siLCBnYXNsZWZ0KCkpOwogICAgfQoKICAgIC8vIFJlY2VpdmUgaXMgYSB2YXJpYW50IG9mIGZhbGxiYWNrIHRoYXQgaXMgdHJpZ2dlcmVkIHdoZW4gbXNnLmRhdGEgaXMgZW1wdHkKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBlbWl0IExvZygicmVjZWl2ZSIsIGdhc2xlZnQoKSk7CiAgICB9CgogICAgLy8gSGVscGVyIGZ1bmN0aW9uIHRvIGNoZWNrIHRoZSBiYWxhbmNlIG9mIHRoaXMgY29udHJhY3QKICAgIGZ1bmN0aW9uIGdldEJhbGFuY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGFkZHJlc3ModGhpcykuYmFsYW5jZTsKICAgIH0KfQoKY29udHJhY3QgU2VuZFRvRmFsbGJhY2sgewogICAgZnVuY3Rpb24gdHJhbnNmZXJUb0ZhbGxiYWNrKGFkZHJlc3MgcGF5YWJsZSBfdG8pIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICBfdG8udHJhbnNmZXIobXNnLnZhbHVlKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYWxsRmFsbGJhY2soYWRkcmVzcyBwYXlhYmxlIF90bykgcHVibGljIHBheWFibGUgewogICAgICAgIChib29sIHNlbnQsKSA9IF90by5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="},{fileName:"FallbackInputOutput.sol",code:"cHJhZ21hIHNvbGlkaXR5IF4wLjguMjY7CgovLyBUZXN0RmFsbGJhY2tJbnB1dE91dHB1dCAtPiBGYWxsYmFja0lucHV0T3V0cHV0IC0+IENvdW50ZXIKY29udHJhY3QgRmFsbGJhY2tJbnB1dE91dHB1dCB7CiAgICBhZGRyZXNzIGltbXV0YWJsZSB0YXJnZXQ7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdGFyZ2V0KSB7CiAgICAgICAgdGFyZ2V0ID0gX3RhcmdldDsKICAgIH0KCiAgICBmYWxsYmFjayhieXRlcyBjYWxsZGF0YSBkYXRhKSBleHRlcm5hbCBwYXlhYmxlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIChib29sIG9rLCBieXRlcyBtZW1vcnkgcmVzKSA9IHRhcmdldC5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KGRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgICAgIHJldHVybiByZXM7CiAgICB9Cn0KCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gZ2V0KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQoKICAgIGZ1bmN0aW9uIGluYygpIGV4dGVybmFsIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICBjb3VudCArPSAxOwogICAgICAgIHJldHVybiBjb3VudDsKICAgIH0KfQoKY29udHJhY3QgVGVzdEZhbGxiYWNrSW5wdXRPdXRwdXQgewogICAgZXZlbnQgTG9nKGJ5dGVzIHJlcyk7CgogICAgZnVuY3Rpb24gdGVzdChhZGRyZXNzIF9mYWxsYmFjaywgYnl0ZXMgY2FsbGRhdGEgZGF0YSkgZXh0ZXJuYWwgewogICAgICAgIChib29sIG9rLCBieXRlcyBtZW1vcnkgcmVzKSA9IF9mYWxsYmFjay5jYWxsKGRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgICAgIGVtaXQgTG9nKHJlcyk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0VGVzdERhdGEoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSwgYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIChhYmkuZW5jb2RlQ2FsbChDb3VudGVyLmdldCwgKCkpLCBhYmkuZW5jb2RlQ2FsbChDb3VudGVyLmluYywgKCkpKTsKICAgIH0KfQo="}],Ek=`

                          fallback is a special function that is executed either when

                          +`,Mk=({prev:s,next:a})=>i.jsx(A,{version:vk,title:Rk,description:Nk,cyfrinLink:Hk,html:Kk,prev:s,next:a,codes:Fk}),Sk="0.8.26",xk="Fallback",Jk="Example of how to use fallback in Solidity",zk="https://www.cyfrin.io/glossary/fallback-solidity-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IHsKICAgICAgICBfdG8udHJhbnNmZXIobXNnLnZhbHVlKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYWxsRmFsbGJhY2soYWRkcmVzcyBwYXlhYmxlIF90bykgcHVibGljIHBheWFibGUgewogICAgICAgIChib29sIHNlbnQsKSA9IF90by5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="},{fileName:"FallbackInputOutput.sol",code:"cHJhZ21hIHNvbGlkaXR5IF4wLjguMjY7CgovLyBUZXN0RmFsbGJhY2tJbnB1dE91dHB1dCAtPiBGYWxsYmFja0lucHV0T3V0cHV0IC0+IENvdW50ZXIKY29udHJhY3QgRmFsbGJhY2tJbnB1dE91dHB1dCB7CiAgICBhZGRyZXNzIGltbXV0YWJsZSB0YXJnZXQ7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdGFyZ2V0KSB7CiAgICAgICAgdGFyZ2V0ID0gX3RhcmdldDsKICAgIH0KCiAgICBmYWxsYmFjayhieXRlcyBjYWxsZGF0YSBkYXRhKSBleHRlcm5hbCBwYXlhYmxlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIChib29sIG9rLCBieXRlcyBtZW1vcnkgcmVzKSA9IHRhcmdldC5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KGRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgICAgIHJldHVybiByZXM7CiAgICB9Cn0KCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gZ2V0KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQoKICAgIGZ1bmN0aW9uIGluYygpIGV4dGVybmFsIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICBjb3VudCArPSAxOwogICAgICAgIHJldHVybiBjb3VudDsKICAgIH0KfQoKY29udHJhY3QgVGVzdEZhbGxiYWNrSW5wdXRPdXRwdXQgewogICAgZXZlbnQgTG9nKGJ5dGVzIHJlcyk7CgogICAgZnVuY3Rpb24gdGVzdChhZGRyZXNzIF9mYWxsYmFjaywgYnl0ZXMgY2FsbGRhdGEgZGF0YSkgZXh0ZXJuYWwgewogICAgICAgIChib29sIG9rLCBieXRlcyBtZW1vcnkgcmVzKSA9IF9mYWxsYmFjay5jYWxsKGRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgICAgIGVtaXQgTG9nKHJlcyk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0VGVzdERhdGEoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSwgYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIChhYmkuZW5jb2RlQ2FsbChDb3VudGVyLmdldCwgKCkpLCBhYmkuZW5jb2RlQ2FsbChDb3VudGVyLmluYywgKCkpKTsKICAgIH0KfQo="}],Ek=`

                          fallback is a special function that is executed either when

                          • a function that does not exist is called or
                          • Ether is sent directly to a contract but receive() does not exist or msg.data is not empty
                          • @@ -8984,7 +8984,7 @@ assertion probably means that there is a bug. count -= 1; } } -`,$k=({prev:s,next:a})=>i.jsx(A,{version:Tk,title:Uk,description:_k,cyfrinLink:Lk,html:Pk,prev:s,next:a,codes:Ok}),qk="0.8.26",s0="Function",a0="Example of how to write functions in Solidity",n0="https://www.cyfrin.io/glossary/function-code-example",l0=[{fileName:"Function.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZ1bmN0aW9uIHsKICAgIC8vIEZ1bmN0aW9ucyBjYW4gcmV0dXJuIG11b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HJldHVybiBzb21lRnVuY1dpdGhNYW55SW5wdXRzKHsKICAgICAgICAgICAgYTogYWRkcmVzcygwKSwKICAgICAgICAgICAgYjogdHJ1ZSwKICAgICAgICAgICAgYzogImMiLAogICAgICAgICAgICB4OiAxLAogICAgICAgICAgICB5OiAyLAogICAgICAgICAgICB6OiAzCiAgICAgICAgfSk7CiAgICB9Cn0K"}],p0=`

                            There are several ways to return outputs from a function.

                            +`,$k=({prev:s,next:a})=>i.jsx(A,{version:Tk,title:Uk,description:_k,cyfrinLink:Lk,html:Pk,prev:s,next:a,codes:Ok}),qk="0.8.26",s0="Function",a0="Example of how to write functions in Solidity",n0="https://www.cyfrin.io/glossary/function-solidity-code-example",l0=[{fileName:"Function.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZ1bmN0aW9uIHsKICAgIC8vIEZ1bmN0aW9ucyBjYW4gcmV0dXJuIG11bHRpcGxlIHZhbHVlcy4KICAgIGZ1bmN0aW9uIHJldHVybk1hbnkoKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2LCBib29sLCB1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuICgxLCB0cnVlLCAyKTsKICAgIH0KCiAgICAvLyBSZXR1cm4gdmFsdWVzIGNhbiBiZSBuYW1lZC4KICAgIGZ1bmN0aW9uIG5hbWVkKCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB4LCBib29sIGIsIHVpbnQyNTYgeSkgewogICAgICAgIHJldHVybiAoMSwgdHJ1ZSwgMik7CiAgICB9CgogICAgLy8gUmV0dXJuIHZhbHVlcyBjYW4gYmUgYXNzaWduZWQgdG8gdGhlaXIgbmFtZS4KICAgIC8vIEluIHRoaXMgY2FzZSB0aGUgcmV0dXJuIHN0YXRlbWVudCBjYW4gYmUgb21pdHRlZC4KICAgIGZ1bmN0aW9uIGFzc2lnbmVkKCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB4LCBib29sIGIsIHVpbnQyNTYgeSkgewogICAgICAgIHggPSAxOwogICAgICAgIGIgPSB0cnVlOwogICAgICAgIHkgPSAyOwogICAgfQoKICAgIC8vIFVzZSBkZXN0cnVjdHVyaW5nIGFzc2lnbm1lbnQgd2hlbiBjYWxsaW5nIGFub3RoZXIKICAgIC8vIGZ1bmN0aW9uIHRoYXQgcmV0dXJucyBtdWx0aXBsZSB2YWx1ZXMuCiAgICBmdW5jdGlvbiBkZXN0cnVjdHVyaW5nQXNzaWdubWVudHMoKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2LCBib29sLCB1aW50MjU2LCB1aW50MjU2LCB1aW50MjU2KQogICAgewogICAgICAgICh1aW50MjU2IGksIGJvb2wgYiwgdWludDI1NiBqKSA9IHJldHVybk1hbnkoKTsKCiAgICAgICAgLy8gVmFsdWVzIGNhbiBiZSBsZWZ0IG91dC4KICAgICAgICAodWludDI1NiB4LCwgdWludDI1NiB5KSA9ICg0LCA1LCA2KTsKCiAgICAgICAgcmV0dXJuIChpLCBiLCBqLCB4LCB5KTsKICAgIH0KCiAgICAvLyBDYW5ub3QgdXNlIG1hcCBmb3IgZWl0aGVyIGlucHV0IG9yIG91dHB1dAoKICAgIC8vIENhbiB1c2UgYXJyYXkgZm9yIGlucHV0CiAgICBmdW5jdGlvbiBhcnJheUlucHV0KHVpbnQyNTZbXSBtZW1vcnkgX2FycikgcHVibGljIHt9CgogICAgLy8gQ2FuIHVzZSBhcnJheSBmb3Igb3V0cHV0CiAgICB1aW50MjU2W10gcHVibGljIGFycjsKCiAgICBmdW5jdGlvbiBhcnJheU91dHB1dCgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQyNTZbXSBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYXJyOwogICAgfQp9CgovLyBDYWxsIGZ1bmN0aW9uIHdpdGgga2V5LXZhbHVlIGlucHV0cwpjb250cmFjdCBYWVogewogICAgZnVuY3Rpb24gc29tZUZ1bmNXaXRoTWFueUlucHV0cygKICAgICAgICB1aW50MjU2IHgsCiAgICAgICAgdWludDI1NiB5LAogICAgICAgIHVpbnQyNTYgeiwKICAgICAgICBhZGRyZXNzIGEsCiAgICAgICAgYm9vbCBiLAogICAgICAgIHN0cmluZyBtZW1vcnkgYwogICAgKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7fQoKICAgIGZ1bmN0aW9uIGNhbGxGdW5jKCkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHNvbWVGdW5jV2l0aE1hbnlJbnB1dHMoMSwgMiwgMywgYWRkcmVzcygwKSwgdHJ1ZSwgImMiKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYWxsRnVuY1dpdGhLZXlWYWx1ZSgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBzb21lRnVuY1dpdGhNYW55SW5wdXRzKHsKICAgICAgICAgICAgYTogYWRkcmVzcygwKSwKICAgICAgICAgICAgYjogdHJ1ZSwKICAgICAgICAgICAgYzogImMiLAogICAgICAgICAgICB4OiAxLAogICAgICAgICAgICB5OiAyLAogICAgICAgICAgICB6OiAzCiAgICAgICAgfSk7CiAgICB9Cn0K"}],p0=`

                            There are several ways to return outputs from a function.

                            Public functions cannot accept certain data types as inputs or outputs

                            // SPDX-License-Identifier: MIT
                             pragma solidity ^0.8.26;
                            @@ -9062,7 +9062,7 @@ assertion probably means that there is a bug.
                                     });
                                 }
                             }
                            -
                            `,e0=({prev:s,next:a})=>i.jsx(A,{version:qk,title:s0,description:a0,cyfrinLink:n0,html:p0,prev:s,next:a,codes:l0}),c0="0.8.26",t0="Function Modifier",o0="Example of how to write function modifier in Solidity",r0="https://www.cyfrin.io/glossary/function-modifier-code-example",i0=[{fileName:"FunctionModifier.sol",code:"Ly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aWVyIHZhbGlkQWRkcmVzcyhhZGRyZXNzIF9hZGRyKSB7CiAgICAgICAgcmVxdWlyZShfYWRkciAhPSBhZGRyZXNzKDApLCAiTm90IHZhbGlkIGFkZHJlc3MiKTsKICAgICAgICBfOwogICAgfQoKICAgIGZ1bmN0aW9uIGNoYW5nZU93bmVyKGFkZHJlc3MgX25ld093bmVyKQogICAgICAgIHB1YmxpYwogICAgICAgIG9ubHlPd25lcgogICAgICAgIHZhbGlkQWRkcmVzcyhfbmV3T3duZXIpCiAgICB7CiAgICAgICAgb3duZXIgPSBfbmV3T3duZXI7CiAgICB9CgogICAgLy8gTW9kaWZpZXJzIGNhbiBiZSBjYWxsZWQgYmVmb3JlIGFuZCAvIG9yIGFmdGVyIGEgZnVuY3Rpb24uCiAgICAvLyBUaGlzIG1vZGlmaWVyIHByZXZlbnRzIGEgZnVuY3Rpb24gZnJvbSBiZWluZyBjYWxsZWQgd2hpbGUKICAgIC8vIGl0IGlzIHN0aWxsIGV4ZWN1dGluZy4KICAgIG1vZGlmaWVyIG5vUmVlbnRyYW5jeSgpIHsKICAgICAgICByZXF1aXJlKCFsb2NrZWQsICJObyByZWVudHJhbmN5Iik7CgogICAgICAgIGxvY2tlZCA9IHRydWU7CiAgICAgICAgXzsKICAgICAgICBsb2NrZWQgPSBmYWxzZTsKICAgIH0KCiAgICBmdW5jdGlvbiBkZWNyZW1lbnQodWludDI1NiBpKSBwdWJsaWMgbm9SZWVudHJhbmN5IHsKICAgICAgICB4IC09IGk7CgogICAgICAgIGlmIChpID4gMSkgewogICAgICAgICAgICBkZWNyZW1lbnQoaSAtIDEpOwogICAgICAgIH0KICAgIH0KfQo="}],g0=`

                            Modifiers are code that can be run before and / or after a function call.

                            +`,e0=({prev:s,next:a})=>i.jsx(A,{version:qk,title:s0,description:a0,cyfrinLink:n0,html:p0,prev:s,next:a,codes:l0}),c0="0.8.26",t0="Function Modifier",o0="Example of how to write function modifier in Solidity",r0="https://www.cyfrin.io/glossary/function-modifier-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gdGhlIHplcm8gYWRkcmVzcy4KICAgIG1vZGlmaWVyIHZhbGlkQWRkcmVzcyhhZGRyZXNzIF9hZGRyKSB7CiAgICAgICAgcmVxdWlyZShfYWRkciAhPSBhZGRyZXNzKDApLCAiTm90IHZhbGlkIGFkZHJlc3MiKTsKICAgICAgICBfOwogICAgfQoKICAgIGZ1bmN0aW9uIGNoYW5nZU93bmVyKGFkZHJlc3MgX25ld093bmVyKQogICAgICAgIHB1YmxpYwogICAgICAgIG9ubHlPd25lcgogICAgICAgIHZhbGlkQWRkcmVzcyhfbmV3T3duZXIpCiAgICB7CiAgICAgICAgb3duZXIgPSBfbmV3T3duZXI7CiAgICB9CgogICAgLy8gTW9kaWZpZXJzIGNhbiBiZSBjYWxsZWQgYmVmb3JlIGFuZCAvIG9yIGFmdGVyIGEgZnVuY3Rpb24uCiAgICAvLyBUaGlzIG1vZGlmaWVyIHByZXZlbnRzIGEgZnVuY3Rpb24gZnJvbSBiZWluZyBjYWxsZWQgd2hpbGUKICAgIC8vIGl0IGlzIHN0aWxsIGV4ZWN1dGluZy4KICAgIG1vZGlmaWVyIG5vUmVlbnRyYW5jeSgpIHsKICAgICAgICByZXF1aXJlKCFsb2NrZWQsICJObyByZWVudHJhbmN5Iik7CgogICAgICAgIGxvY2tlZCA9IHRydWU7CiAgICAgICAgXzsKICAgICAgICBsb2NrZWQgPSBmYWxzZTsKICAgIH0KCiAgICBmdW5jdGlvbiBkZWNyZW1lbnQodWludDI1NiBpKSBwdWJsaWMgbm9SZWVudHJhbmN5IHsKICAgICAgICB4IC09IGk7CgogICAgICAgIGlmIChpID4gMSkgewogICAgICAgICAgICBkZWNyZW1lbnQoaSAtIDEpOwogICAgICAgIH0KICAgIH0KfQo="}],g0=`

                            Modifiers are code that can be run before and / or after a function call.

                            Modifiers can be used to:

                            • Restrict access
                            • @@ -9128,7 +9128,7 @@ assertion probably means that there is a bug. } } } -`,h0=({prev:s,next:a})=>i.jsx(A,{version:c0,title:t0,description:o0,cyfrinLink:r0,html:g0,prev:s,next:a,codes:i0}),I0="0.8.26",d0="Function Selector",C0="Example of how function selectors are computed",j0="https://www.cyfrin.io/glossary/function-selector-code-example",A0=[{fileName:"FunctionSelector.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZ1bmN0aW9uU2VsZWN0b3IgewogICAgLyoKICAgICJ0cmFuc2ZlcihhZGRyZXNzLHVpbnQyNTYpIgogICAgMHhhOTA1OWNiYgogICAgInRyYW5zZmVyRnJvbShhZGRyZXNzLGFkZHJlc3MsdWludDI1NikiCiAgICAweDIzYjg3MmRkCiAgICAqLwogICAgZnVuY3Rpb24gZ2V0U2VsZWN0b3Ioc3RyaW5nIGNhbGxkYXRhIF9mdW5jKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzNCkKICAgIHsKICAgICAgICByZXR1cm4gYnl0ZXM0KGtlY2NhazI1NihieXRlcyhfZnVuYykpKTsKICAgIH0KfQo="}],u0=`

                              When a function is called, the first 4 bytes of calldata specifies which function to call.

                              +`,h0=({prev:s,next:a})=>i.jsx(A,{version:c0,title:t0,description:o0,cyfrinLink:r0,html:g0,prev:s,next:a,codes:i0}),I0="0.8.26",d0="Function Selector",C0="Example of how function selectors are computed",j0="https://www.cyfrin.io/glossary/function-selector-solidity-code-example",A0=[{fileName:"FunctionSelector.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEZ1bmN0aW9uU2VsZWN0b3IgewogICAgLyoKICAgICJ0cmFuc2ZlcihhZGRyZXNzLHVpbnQyNTYpIgogICAgMHhhOTA1OWNiYgogICAgInRyYW5zZmVyRnJvbShhZGRyZXNzLGFkZHJlc3MsdWludDI1NikiCiAgICAweDIzYjg3MmRkCiAgICAqLwogICAgZnVuY3Rpb24gZ2V0U2VsZWN0b3Ioc3RyaW5nIGNhbGxkYXRhIF9mdW5jKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzNCkKICAgIHsKICAgICAgICByZXR1cm4gYnl0ZXM0KGtlY2NhazI1NihieXRlcyhfZnVuYykpKTsKICAgIH0KfQo="}],u0=`

                              When a function is called, the first 4 bytes of calldata specifies which function to call.

                              This 4 bytes is called a function selector.

                              Take for example, this code below. It uses call to execute transfer on a contract at the address addr.

                              addr.call(abi.encodeWithSignature("transfer(address,uint256)", 0xSomeAddress, 123))
                              @@ -9153,7 +9153,7 @@ assertion probably means that there is a bug.
                                       return bytes4(keccak256(bytes(_func)));
                                   }
                               }
                              -
                              `,y0=({prev:s,next:a})=>i.jsx(A,{version:I0,title:d0,description:C0,cyfrinLink:j0,html:u0,prev:s,next:a,codes:A0}),m0="0.8.26",b0="Gas",w0="Example of gas and gas limit in Solidity",k0="https://www.cyfrin.io/glossary/gas-and-gas-price-code-example",Z0=[{fileName:"Gas.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEdhcyB7CiAgICB1aW50MjU2IHB1YmxpYyBpID0gMDsKCiAgICAvLyBVc2luZyB1cCBhbGwgb2YgdGhlIGdhcyB0aGF0IHlvdSBzZW5kIGNhdXNlcyB5b3VyIHRyYW5zYWN0aW9uIHRvIGZhaWwuCiAgICAvLyBTdGF0ZSBjaGFuZ2VzIGFyZSB1bmRvbmUuCiAgICAvLyBHYXMgc3BlbnQgYXJlIG5vdCByZWZ1bmRlZC4KICAgIGZ1bmN0aW9uIGZvcmV2ZXIoKSBwdWJsaWMgewogICAgICAgIC8vIEhlcmUgd2UgcnVuIGEgbG9vcCB1bnRpbCBhbGwgb2YgdGhlIGdhcyBhcmUgc3BlbnQKICAgICAgICAvLyBhbmQgdGhlIHRyYW5zYWN0aW9uIGZhaWxzCiAgICAgICAgd2hpbGUgKHRydWUpIHsKICAgICAgICAgICAgaSArPSAxOwogICAgICAgIH0KICAgIH0KfQo="}],W0=`

                              How much ether do you need to pay for a transaction?

                              +`,y0=({prev:s,next:a})=>i.jsx(A,{version:I0,title:d0,description:C0,cyfrinLink:j0,html:u0,prev:s,next:a,codes:A0}),m0="0.8.26",b0="Gas",w0="Example of gas and gas limit in Solidity",k0="https://www.cyfrin.io/glossary/gas-and-gas-price-solidity-code-example",Z0=[{fileName:"Gas.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEdhcyB7CiAgICB1aW50MjU2IHB1YmxpYyBpID0gMDsKCiAgICAvLyBVc2luZyB1cCBhbGwgb2YgdGhlIGdhcyB0aGF0IHlvdSBzZW5kIGNhdXNlcyB5b3VyIHRyYW5zYWN0aW9uIHRvIGZhaWwuCiAgICAvLyBTdGF0ZSBjaGFuZ2VzIGFyZSB1bmRvbmUuCiAgICAvLyBHYXMgc3BlbnQgYXJlIG5vdCByZWZ1bmRlZC4KICAgIGZ1bmN0aW9uIGZvcmV2ZXIoKSBwdWJsaWMgewogICAgICAgIC8vIEhlcmUgd2UgcnVuIGEgbG9vcCB1bnRpbCBhbGwgb2YgdGhlIGdhcyBhcmUgc3BlbnQKICAgICAgICAvLyBhbmQgdGhlIHRyYW5zYWN0aW9uIGZhaWxzCiAgICAgICAgd2hpbGUgKHRydWUpIHsKICAgICAgICAgICAgaSArPSAxOwogICAgICAgIH0KICAgIH0KfQo="}],W0=`

                              How much ether do you need to pay for a transaction?

                              You pay gas spent * gas price amount of ether, where

                              • gas is a unit of computation
                              • @@ -9185,7 +9185,7 @@ assertion probably means that there is a bug. } } } -`,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.

                                +`,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-solidity-code-example",X0=[{fileName:"GasGolf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIGdhcyBnb2xmCmNvbnRyYWN0IEdhc0dvbGYgewogICAgLy8gc3RhcnQgLSA1MDkwOCBnYXMKICAgIC8vIHVzZSBjYWxsZGF0YSAtIDQ5MTYzIGdhcwogICAgLy8gbG9hZCBzdGF0ZSB2YXJpYWJs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ciAodWludDI1NiBpID0gMDsgaSA8IGxlbjspIHsKICAgICAgICAgICAgdWludDI1NiBudW0gPSBudW1zW2ldOwogICAgICAgICAgICBpZiAobnVtICUgMiA9PSAwICYmIG51bSA8IDk5KSB7CiAgICAgICAgICAgICAgICBfdG90YWwgKz0gbnVtOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgICAgICArK2k7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHRvdGFsID0gX3RvdGFsOwogICAgfQp9Cg=="}],v0=`

                                Some gas saving techniques.

                                • Replacing memory with calldata
                                • Loading state variable to memory
                                • @@ -11168,7 +11168,7 @@ if the signer's intention was to approve a transaction once.

                                  emit Withdraw(msg.sender, amount); } } -`,EW=({prev:s,next:a})=>i.jsx(A,{version:MW,title:SW,description:xW,cyfrinLink:JW,html:DW,prev:s,next:a,codes:zW}),QW="0.8.26",TW="Hashing with Keccak256",UW="Example of hashing using Keccak256 in Solidity",_W="https://www.cyfrin.io/glossary/hashing-with-keccak256-code-example",LW=[{fileName:"Keccak256.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEhhc2hGdW5jdGlvbiB7CiAgICBmdW5jdGlvbiBoYXNoKHN0cmluZyBtZW1vcnkgX3RleHQsIHVpbnQyNTYgX251bSwgYWRkcmVzcyBfYWRkcikKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQoX3RleHQsIF9udW0sIF9hZGRyKSk7CiAgICB9CgogICAgLy8gRXhhbXBsZSBvZiBoYXNoIGNvbGxpc2lvbgogICAgLy8gSGFzaCBjb2xsaXNpb24gY2FuIG9jY3VyIHdoZW4geW91IHBhc3MgbW9yZSB0aGFuIG9uZSBkeW5hbWljIGRhdGEgdHlwZQogICAgLy8gdG8gYWJpLmVuY29kZVBhY2tlZC4gSW4gc3VjaCBjYXNlLCB5b3Ugc2hvdWxkIHVzZSBhYmkuZW5jb2RlIGluc3RlYWQuCiAgICBmdW5jdGlvbiBjb2xsaXNpb24oc3RyaW5nIG1lbW9yeSBfdGV4dCwgc3RyaW5nIG1lbW9yeSBfYW5vdGhlclRleHQpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzIpCiAgICB7CiAgICAgICAgLy8gZW5jb2RlUGFja2VkKEFBQSwgQkJCKSAtPiBBQUFCQkIKICAgICAgICAvLyBlbmNvZGVQYWNrZWQoQUEsIEFCQkIpIC0+IEFBQUJCQgogICAgICAgIHJldHVybiBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfdGV4dCwgX2Fub3RoZXJUZXh0KSk7CiAgICB9Cn0KCmNvbnRyYWN0IEd1ZXNzVGhlTWFnaWNXb3JkIHsKICAgIGJ5dGVzMzIgcHVibGljIGFuc3dlciA9CiAgICAgICAgMHg2MDI5OGY3OGNjMGI0NzE3MGJhNzljMTBhYTM4NTFkNzY0OGJkOTZmMmY4ZTQ2YTE5ZGJjNzc3YzM2ZmIwYzAwOwoKICAgIC8vIE1hZ2ljIHdvcmQgaXMgIlNvbGlkaXR5IgogICAgZnVuY3Rpb24gZ3Vlc3Moc3RyaW5nIG1lbW9yeSBfd29yZCkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIHJldHVybiBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfd29yZCkpID09IGFuc3dlcjsKICAgIH0KfQo="}],OW=`

                                  keccak256 computes the Keccak-256 hash of the input.

                                  +`,EW=({prev:s,next:a})=>i.jsx(A,{version:MW,title:SW,description:xW,cyfrinLink:JW,html:DW,prev:s,next:a,codes:zW}),QW="0.8.26",TW="Hashing with Keccak256",UW="Example of hashing using Keccak256 in Solidity",_W="https://www.cyfrin.io/glossary/hashing-with-keccak256-solidity-code-example",LW=[{fileName:"Keccak256.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEhhc2hGdW5jdGlvbiB7CiAgICBmdW5jdGlvbiBoYXNoKHN0cmluZyBtZW1vcnkgX3RleHQsIHVpbnQyNTYgX251bSwgYWRkcmVzcyBfYWRkcikKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQoX3RleHQsIF9udW0sIF9hZGRyKSk7CiAgICB9CgogICAgLy8gRXhhbXBsZSBvZiBoYXNoIGNvbGxpc2lvbgogICAgLy8gSGFzaCBjb2xsaXNpb24gY2FuIG9jY3VyIHdoZW4geW91IHBhc3MgbW9yZSB0aGFuIG9uZSBkeW5hbWljIGRhdGEgdHlwZQogICAgLy8gdG8gYWJpLmVuY29kZVBhY2tlZC4gSW4gc3VjaCBjYXNlLCB5b3Ugc2hvdWxkIHVzZSBhYmkuZW5jb2RlIGluc3RlYWQuCiAgICBmdW5jdGlvbiBjb2xsaXNpb24oc3RyaW5nIG1lbW9yeSBfdGV4dCwgc3RyaW5nIG1lbW9yeSBfYW5vdGhlclRleHQpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzIpCiAgICB7CiAgICAgICAgLy8gZW5jb2RlUGFja2VkKEFBQSwgQkJCKSAtPiBBQUFCQkIKICAgICAgICAvLyBlbmNvZGVQYWNrZWQoQUEsIEFCQkIpIC0+IEFBQUJCQgogICAgICAgIHJldHVybiBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfdGV4dCwgX2Fub3RoZXJUZXh0KSk7CiAgICB9Cn0KCmNvbnRyYWN0IEd1ZXNzVGhlTWFnaWNXb3JkIHsKICAgIGJ5dGVzMzIgcHVibGljIGFuc3dlciA9CiAgICAgICAgMHg2MDI5OGY3OGNjMGI0NzE3MGJhNzljMTBhYTM4NTFkNzY0OGJkOTZmMmY4ZTQ2YTE5ZGJjNzc3YzM2ZmIwYzAwOwoKICAgIC8vIE1hZ2ljIHdvcmQgaXMgIlNvbGlkaXR5IgogICAgZnVuY3Rpb24gZ3Vlc3Moc3RyaW5nIG1lbW9yeSBfd29yZCkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIHJldHVybiBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfd29yZCkpID09IGFuc3dlcjsKICAgIH0KfQo="}],OW=`

                                  keccak256 computes the Keccak-256 hash of the input.

                                  Some use cases are:

                                  • Creating a deterministic unique ID from a input
                                  • @@ -11218,7 +11218,7 @@ if the signer's intention was to approve a transaction once.

                                    contract HelloWorld { string public greet = "Hello World!"; } -`,p2=({prev:s,next:a})=>i.jsx(A,{version:$W,title:qW,description:s2,cyfrinLink:a2,html:l2,prev:s,next:a,codes:n2}),e2="0.8.26",c2="If / Else",t2="If / Else conditional statement in Solidity",o2="https://www.cyfrin.io/glossary/if-else-code-example",r2=[{fileName:"IfElse.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IElmRWxzZSB7CiAgICBmdW5jdGlvbiBmb28odWludDI1NiB4KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgaWYgKHggPCAxMCkgewogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9IGVsc2UgaWYgKHggPCAyMCkgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICByZXR1cm4gMjsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVybmFyeSh1aW50MjU2IF94KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgLy8gaWYgKF94IDwgMTApIHsKICAgICAgICAvLyAgICAgcmV0dXJuIDE7CiAgICAgICAgLy8gfQogICAgICAgIC8vIHJldHVybiAyOwoKICAgICAgICAvLyBzaG9ydGhhbmQgd2F5IHRvIHdyaXRlIGlmIC8gZWxzZSBzdGF0ZW1lbnQKICAgICAgICAvLyB0aGUgIj8iIG9wZXJhdG9yIGlzIGNhbGxlZCB0aGUgdGVybmFyeSBvcGVyYXRvcgogICAgICAgIHJldHVybiBfeCA8IDEwID8gMSA6IDI7CiAgICB9Cn0K"}],i2=`

                                    Solidity supports conditional statements if, else if and else.

                                    +`,p2=({prev:s,next:a})=>i.jsx(A,{version:$W,title:qW,description:s2,cyfrinLink:a2,html:l2,prev:s,next:a,codes:n2}),e2="0.8.26",c2="If / Else",t2="If / Else conditional statement in Solidity",o2="https://www.cyfrin.io/glossary/if-else-solidity-code-example",r2=[{fileName:"IfElse.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IElmRWxzZSB7CiAgICBmdW5jdGlvbiBmb28odWludDI1NiB4KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgaWYgKHggPCAxMCkgewogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9IGVsc2UgaWYgKHggPCAyMCkgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICByZXR1cm4gMjsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVybmFyeSh1aW50MjU2IF94KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgLy8gaWYgKF94IDwgMTApIHsKICAgICAgICAvLyAgICAgcmV0dXJuIDE7CiAgICAgICAgLy8gfQogICAgICAgIC8vIHJldHVybiAyOwoKICAgICAgICAvLyBzaG9ydGhhbmQgd2F5IHRvIHdyaXRlIGlmIC8gZWxzZSBzdGF0ZW1lbnQKICAgICAgICAvLyB0aGUgIj8iIG9wZXJhdG9yIGlzIGNhbGxlZCB0aGUgdGVybmFyeSBvcGVyYXRvcgogICAgICAgIHJldHVybiBfeCA8IDEwID8gMSA6IDI7CiAgICB9Cn0K"}],i2=`

                                    Solidity supports conditional statements if, else if and else.

                                    // SPDX-License-Identifier: MIT
                                     pragma solidity ^0.8.26;
                                     
                                    @@ -11244,7 +11244,7 @@ if the signer's intention was to approve a transaction once.

                                    return _x < 10 ? 1 : 2; } } -
                                    `,g2=({prev:s,next:a})=>i.jsx(A,{version:e2,title:c2,description:t2,cyfrinLink:o2,html:i2,prev:s,next:a,codes:r2}),h2="0.8.26",I2="Immutable",d2="Immutable variables",C2="https://www.cyfrin.io/glossary/immutable-code-example",j2=[{fileName:"Immutable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEltbXV0YWJsZSB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBpbW11dGFibGUgTVlfQUREUkVTUzsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBNWV9VSU5UOwoKICAgIGNvbnN0cnVjdG9yKHVpbnQyNTYgX215VWludCkgewogICAgICAgIE1ZX0FERFJFU1MgPSBtc2cuc2VuZGVyOwogICAgICAgIE1ZX1VJTlQgPSBfbXlVaW50OwogICAgfQp9Cg=="}],A2=`

                                    Immutable variables are like constants. Values of immutable variables can be set inside the constructor but cannot be modified afterwards.

                                    +`,g2=({prev:s,next:a})=>i.jsx(A,{version:e2,title:c2,description:t2,cyfrinLink:o2,html:i2,prev:s,next:a,codes:r2}),h2="0.8.26",I2="Immutable",d2="Immutable variables",C2="https://www.cyfrin.io/glossary/immutable-solidity-code-example",j2=[{fileName:"Immutable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IEltbXV0YWJsZSB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBpbW11dGFibGUgTVlfQUREUkVTUzsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBNWV9VSU5UOwoKICAgIGNvbnN0cnVjdG9yKHVpbnQyNTYgX215VWludCkgewogICAgICAgIE1ZX0FERFJFU1MgPSBtc2cuc2VuZGVyOwogICAgICAgIE1ZX1VJTlQgPSBfbXlVaW50OwogICAgfQp9Cg=="}],A2=`

                                    Immutable variables are like constants. Values of immutable variables can be set inside the constructor but cannot be modified afterwards.

                                    // SPDX-License-Identifier: MIT
                                     pragma solidity ^0.8.26;
                                     
                                    @@ -11258,7 +11258,7 @@ if the signer's intention was to approve a transaction once.

                                    MY_UINT = _myUint; } } -
                                    `,u2=({prev:s,next:a})=>i.jsx(A,{version:h2,title:I2,description:d2,cyfrinLink:C2,html:A2,prev:s,next:a,codes:j2}),y2="0.8.26",m2="Import",b2="Learn how to import other Solidity files",w2="https://www.cyfrin.io/glossary/import-code-example",k2=[{fileName:"Foo.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCnN0cnVjdCBQb2ludCB7CiAgICB1aW50MjU2IHg7CiAgICB1aW50MjU2IHk7Cn0KCmVycm9yIFVuYXV0aG9yaXplZChhZGRyZXNzIGNhbGxlcik7CgpmdW5jdGlvbiBhZGQodWludDI1NiB4LCB1aW50MjU2IHkpIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgcmV0dXJuIHggKyB5Owp9Cgpjb250cmFjdCBGb28gewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkZvbyI7Cn0K"},{fileName:"Import.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIGltcG9ydCBGb28uc29sIGZyb20gY3VycmVudCBkaXJlY3RvcnkKaW1wb3J0ICIuL0Zvby5zb2wiOwoKLy8gaW1wb3J0IHtzeW1ib2wxIGFzIGFsaWFzLCBzeW1ib2wyfSBmcm9tICJmaWxlbmFtZSI7CmltcG9ydCB7VW5hdXRob3JpemVkLCBhZGQgYXMgZnVuYywgUG9pbnR9IGZyb20gIi4vRm9vLnNvbCI7Cgpjb250cmFjdCBJbXBvcnQgewogICAgLy8gSW5pdGlhbGl6ZSBGb28uc29sCiAgICBGb28gcHVibGljIGZvbyA9IG5ldyBGb28oKTsKCiAgICAvLyBUZXN0IEZvby5zb2wgYnkgZ2V0dGluZyBpdCdzIG5hbWUuCiAgICBmdW5jdGlvbiBnZXRGb29OYW1lKCkgcHVibGljIHZpZXcgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiBmb28ubmFtZSgpOwogICAgfQp9Cg=="}],Z2=`

                                    You can import local and external files in Solidity.

                                    +`,u2=({prev:s,next:a})=>i.jsx(A,{version:h2,title:I2,description:d2,cyfrinLink:C2,html:A2,prev:s,next:a,codes:j2}),y2="0.8.26",m2="Import",b2="Learn how to import other Solidity files",w2="https://www.cyfrin.io/glossary/import-solidity-code-example",k2=[{fileName:"Foo.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCnN0cnVjdCBQb2ludCB7CiAgICB1aW50MjU2IHg7CiAgICB1aW50MjU2IHk7Cn0KCmVycm9yIFVuYXV0aG9yaXplZChhZGRyZXNzIGNhbGxlcik7CgpmdW5jdGlvbiBhZGQodWludDI1NiB4LCB1aW50MjU2IHkpIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgcmV0dXJuIHggKyB5Owp9Cgpjb250cmFjdCBGb28gewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkZvbyI7Cn0K"},{fileName:"Import.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIGltcG9ydCBGb28uc29sIGZyb20gY3VycmVudCBkaXJlY3RvcnkKaW1wb3J0ICIuL0Zvby5zb2wiOwoKLy8gaW1wb3J0IHtzeW1ib2wxIGFzIGFsaWFzLCBzeW1ib2wyfSBmcm9tICJmaWxlbmFtZSI7CmltcG9ydCB7VW5hdXRob3JpemVkLCBhZGQgYXMgZnVuYywgUG9pbnR9IGZyb20gIi4vRm9vLnNvbCI7Cgpjb250cmFjdCBJbXBvcnQgewogICAgLy8gSW5pdGlhbGl6ZSBGb28uc29sCiAgICBGb28gcHVibGljIGZvbyA9IG5ldyBGb28oKTsKCiAgICAvLyBUZXN0IEZvby5zb2wgYnkgZ2V0dGluZyBpdCdzIG5hbWUuCiAgICBmdW5jdGlvbiBnZXRGb29OYW1lKCkgcHVibGljIHZpZXcgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiBmb28ubmFtZSgpOwogICAgfQp9Cg=="}],Z2=`

                                    You can import local and external files in Solidity.

                                    Local

                                    Here is our folder structure.

                                    ├── Import.sol
                                    @@ -11308,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}),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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIEdyYXBoIG9mIGluaGVyaXRhbmNlCiAgICBBCiAgIC8gXAogIEIgICBDCiAvIFwgLwpGICBELEUKCiovCgpjb250cmFjdCBBIHsKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQSI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBpbmhlcml0IG90aGVyIGNvbnRyYWN0cyBieSB1c2luZyB0aGUga2V5d29yZCAnaXMnLgpjb250cmFjdCBCIGlzIEEgewogICAgLy8gT3ZlcnJpZGUgQS5mb28oKQogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIHB1cmUgdmlydHVhbCBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuICJCIjsKICAgIH0KfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIE92ZXJyaWRlIEEuZm9vKCkKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgb3ZlcnJpZGUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQyI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBjYW4gaW5oZXJpdCBmcm9tIG11bHRpcGxlIHBhcmVudCBjb250cmFjdHMuCi8vIFdoZW4gYSBmdW5jdGlvbiBpcyBjYWxsZWQgdGhhdCBpcyBkZWZpbmVkIG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XJuIHN1cGVyLmZvbygpOwogICAgfQp9Cg=="}],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-solidity-code-example",Y2=[{fileName:"Inheritance.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIEdyYXBoIG9mIGluaGVyaXRhbmNlCiAgICBBCiAgIC8gXAogIEIgICBDCiAvIFwgLwpGICBELEUKCiovCgpjb250cmFjdCBBIHsKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQSI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBpbmhlcml0IG90aGVyIGNvbnRyYWN0cyBieSB1c2luZyB0aGUga2V5d29yZCAnaXMnLgpjb250cmFjdCBCIGlzIEEgewogICAgLy8gT3ZlcnJpZGUgQS5mb28oKQogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIHB1cmUgdmlydHVhbCBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuICJCIjsKICAgIH0KfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIE92ZXJyaWRlIEEuZm9vKCkKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgb3ZlcnJpZGUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQyI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBjYW4gaW5oZXJpdCBmcm9tIG11bHRpcGxlIHBhcmVud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aWMgcHVyZSBvdmVycmlkZShBLCBCKSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIHN1cGVyLmZvbygpOwogICAgfQp9Cg=="}],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.

                                    @@ -11374,7 +11374,7 @@ F D,E return super.foo(); } } -`,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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWwgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9Cn0KCmludGVyZmFjZSBJQ291bnRlciB7CiAgICBmdW5jdGlvbiBjb3VudCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IE15Q29udHJhY3QgewogICAgZnVuY3Rpb24gaW5jcmVtZW50Q291bnRlcihhZGRyZXNzIF9jb3VudGVyKSBleHRlcm5hbCB7CiAgICAgICAgSUNvdW50ZXIoX2NvdW50ZXIpLmluY3JlbWVudCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldENvdW50KGFkZHJlc3MgX2NvdW50ZXIpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBJQ291bnRlcihfY291bn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CiAgICAgICAgcmV0dXJuIChyZXNlcnZlMCwgcmVzZXJ2ZTEpOwogICAgfQp9Cg=="}],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-solidity-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
                                    • @@ -11437,7 +11437,7 @@ F D,E return (reserve0, reserve1); } } -`,S2=({prev:s,next:a})=>i.jsx(A,{version:R2,title:N2,description:H2,cyfrinLink:F2,html:M2,prev:s,next:a,codes:K2}),x2="0.8.26",J2="Library",z2="Example of how to write and use libraries in your Solidity code",D2="https://www.cyfrin.io/glossary/library-code-example",E2=[{fileName:"Library.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmxpYnJhcnkgTWF0aCB7CiAgICBmdW5jdGlvbiBzcXJ0KHVpbnQyNTYgeSkgaW50ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBpZiAoeSA+IDMpIHsKICAgICAgICAgICAgeiA9IHk7CiAgICAgICAgICAgIHVpbnQyNTYgeCA9IHkgLyAyICsgMTsKICAgICAgICAgICAgd2hpbGUgKHggPCB6KSB7CiAgICAgICAgICAgICAgICB6ID0geDsKICAgICAgICAgICAgICAgIHggPSAoeSAvIHggKyB4KSAvIDI7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgaWYgKHkgIT0gMCkgewogICAgICAgICAgICB6ID0gMTsKICAgICAgICB9CiAgICAgICAgLy8gZWxzZSB6ID0gMCAoZGVmYXVsdCB2YWx1ZSkKICAgIH0KfQoKY29udHJhY3QgVGVzdE1hdGggewogICAgZnVuY3Rpb24gdGVzdFNxdWFyZVJvb3QodWludDI1NiB4KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIE1hdGguc3FydCh4KTsKICAgIH0KfQoKLy8gQXJyYXkgZnVuY3Rpb24gdG8gZGVsZXRlIGVsZW1lbnQgYXQgaW5kZXggYW5kIHJlLW9yZ2FuaXplIHRoZSBhcnJheQovLyBzbyB0aGF0IHRoZXJlIGFyZSBubyBnYXBzIGJldHdlZW4gdGhlIGVsZW1lbnRzLgpsaWJyYXJ5IEFycmF5IHsKICAgIGZ1bmN0aW9uIHJlbW92ZSh1aW50MjU2W10gc3RvcmFnZSBhcnIsIHVpbnQyNTYgaW5kZXgpIHB1YmxpYyB7CiAgICAgICAgLy8gTW92ZSB0aGUgbGFzdCBlbGVtZW50IGludG8gdGhlIHBsYWNlIHRvIGRlbGV0ZQogICAgICAgIHJlcXVpcmUoYXJyLmxlbmd0aCA+IDAsICJDYW4ndCByZW1vdmUgZnJvbSBlbXB0eSBhcnJheSIpOwogICAgICAgIGFycltpbmRleF0gPSBhcnJbYXJyLmxlbmd0aCAtIDFdOwogICAgICAgIGFyci5wb3AoKTsKICAgIH0KfQoKY29udHJhY3QgVGVzdEFycmF5IHsKICAgIHVzaW5nIEFycmF5IGZvciB1aW50MjU2W107CgogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CgogICAgZnVuY3Rpb24gdGVzdEFycmF5UmVtb3ZlKCkgcHVibGljIHsKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCAzOyBpKyspIHsKICAgICAgICAgICAgYXJyLnB1c2goaSk7CiAgICAgICAgfQoKICAgICAgICBhcnIucmVtb3ZlKDEpOwoKICAgICAgICBhc3NlcnQoYXJyLmxlbmd0aCA9PSAyKTsKICAgICAgICBhc3NlcnQoYXJyWzBdID09IDApOwogICAgICAgIGFzc2VydChhcnJbMV0gPT0gMik7CiAgICB9Cn0K"}],Q2=`

                                      Libraries are similar to contracts, but you can't declare any state variable and +`,S2=({prev:s,next:a})=>i.jsx(A,{version:R2,title:N2,description:H2,cyfrinLink:F2,html:M2,prev:s,next:a,codes:K2}),x2="0.8.26",J2="Library",z2="Example of how to write and use libraries in your Solidity code",D2="https://www.cyfrin.io/glossary/library-solidity-code-example",E2=[{fileName:"Library.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmxpYnJhcnkgTWF0aCB7CiAgICBmdW5jdGlvbiBzcXJ0KHVpbnQyNTYgeSkgaW50ZXJuYWwgcHVyZSBy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VGVzdEFycmF5IHsKICAgIHVzaW5nIEFycmF5IGZvciB1aW50MjU2W107CgogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CgogICAgZnVuY3Rpb24gdGVzdEFycmF5UmVtb3ZlKCkgcHVibGljIHsKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCAzOyBpKyspIHsKICAgICAgICAgICAgYXJyLnB1c2goaSk7CiAgICAgICAgfQoKICAgICAgICBhcnIucmVtb3ZlKDEpOwoKICAgICAgICBhc3NlcnQoYXJyLmxlbmd0aCA9PSAyKTsKICAgICAgICBhc3NlcnQoYXJyWzBdID09IDApOwogICAgICAgIGFzc2VydChhcnJbMV0gPT0gMik7CiAgICB9Cn0K"}],Q2=`

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

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

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

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

                                      assert(arr[1] == 2); } } -`,T2=({prev:s,next:a})=>i.jsx(A,{version:x2,title:J2,description:z2,cyfrinLink:D2,html:Q2,prev:s,next:a,codes:E2}),U2="0.8.26",_2="For and While Loop",L2="Example of for and while loop in Solidity",O2="https://www.cyfrin.io/glossary/for-and-while-loop-code-example",P2=[{fileName:"Loop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IExvb3AgewogICAgZnVuY3Rpb24gbG9vcCgpIHB1YmxpYyB7CiAgICAgICAgLy8gZm9yIGxvb3AKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCAxMDsgaSsrKSB7CiAgICAgICAgICAgIGlmIChpID09IDMpIHsKICAgICAgICAgICAgICAgIC8vIFNraXAgdG8gbmV4dCBpdGVyYXRpb24gd2l0aCBjb250aW51ZQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGkgPT0gNSkgewogICAgICAgICAgICAgICAgLy8gRXhpdCBsb29wIHdpdGggYnJlYWsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICAvLyB3aGlsZSBsb29wCiAgICAgICAgdWludDI1NiBqOwogICAgICAgIHdoaWxlIChqIDwgMTApIHsKICAgICAgICAgICAgaisrOwogICAgICAgIH0KICAgIH0KfQo="}],$2=`

                                      Solidity supports for, while, and do while loops.

                                      +`,T2=({prev:s,next:a})=>i.jsx(A,{version:x2,title:J2,description:z2,cyfrinLink:D2,html:Q2,prev:s,next:a,codes:E2}),U2="0.8.26",_2="For and While Loop",L2="Example of for and while loop in Solidity",O2="https://www.cyfrin.io/glossary/for-and-while-loop-solidity-code-example",P2=[{fileName:"Loop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IExvb3AgewogICAgZnVuY3Rpb24gbG9vcCgpIHB1YmxpYyB7CiAgICAgICAgLy8gZm9yIGxvb3AKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCAxMDsgaSsrKSB7CiAgICAgICAgICAgIGlmIChpID09IDMpIHsKICAgICAgICAgICAgICAgIC8vIFNraXAgdG8gbmV4dCBpdGVyYXRpb24gd2l0aCBjb250aW51ZQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGkgPT0gNSkgewogICAgICAgICAgICAgICAgLy8gRXhpdCBsb29wIHdpdGggYnJlYWsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICAvLyB3aGlsZSBsb29wCiAgICAgICAgdWludDI1NiBqOwogICAgICAgIHdoaWxlIChqIDwgMTApIHsKICAgICAgICAgICAgaisrOwogICAgICAgIH0KICAgIH0KfQo="}],$2=`

                                      Solidity supports for, while, and do while loops.

                                      Don't write loops that are unbounded as this can hit the gas limit, causing your transaction to fail.

                                      For the reason above, while and do while loops are rarely used.

                                      // SPDX-License-Identifier: MIT
                                      @@ -11521,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}),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+IHVpbnQyNTYpIHB1YmxpYyBteU1hcDsKCiAgICBmdW5jdGlvbiBnZXQoYWRkcmVzcyBfYWRkcikgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIC8vIE1hcHBpbmcgYWx3YXlzIHJldHVybnMgYSB2YWx1ZS4KICAgICAgICAvLyBJZiB0aGUgdmFsdWUgd2FzIG5ldmVyIHNldCwgaXQgd2lsbCByZXR1cm4gdGhlIGRlZmF1bHQgdmFsdWUuCiAgICAgICAgcmV0dXJuIG15TWFwW19hZGRyXTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoYWRkcmVzcyBfYWRkciwgdWludDI1NiBfaSkgcHVibGljIHsKICAgICAgICAvLyBVcGRhdGUgdGhlIHZhbHVlIGF0IHRoaXMgYWRkcmVzcwogICAgICAgIG15TWFwW19hZGRyXSA9IF9pOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyKSBwdWJsaWMgewogICAgICAgIC8vIFJlc2V0IHRoZSB2YWx1ZSB0byB0aGUgZGVmYXVsdCB2YWx1ZS4KICAgICAgICBkZWxldGUgbXlNYXBbX2FkZHJdOwogICAgfQp9Cgpjb250cmFjdCBOZXN0ZWRNYXBwaW5nIHsKICAgIC8vIE5lc3RlZCBtYXBwaW5nIChtYXBwaW5nIGZyb20gYWRkcmVzcyB0byBhbm90aGVyIG1hcHBpbmcpCiAgICBtYXBwaW5nKGFkZHJlc3MgPT4gbWFwcGluZyh1aW50MjU2ID0+IGJvb2wpKSBwdWJsaWMgbmVzdGVkOwoKICAgIGZ1bmN0aW9uIGdldChhZGRyZXNzIF9hZGRyMSwgdWludDI1NiBfaSkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIC8vIFlvdSBjYW4gZ2V0IHZhbHVlcyBmcm9tIGEgbmVzdGVkIG1hcHBpbmcKICAgICAgICAvLyBldmVuIHdoZW4gaXQgaXMgbm90IGluaXRpYWxpemVkCiAgICAgICAgcmV0dXJuIG5lc3RlZFtfYWRkcjFdW19pXTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoYWRkcmVzcyBfYWRkcjEsIHVpbnQyNTYgX2ksIGJvb2wgX2JvbykgcHVibGljIHsKICAgICAgICBuZXN0ZWRbX2FkZHIxXVtfaV0gPSBfYm9vOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyMSwgdWludDI1NiBfaSkgcHVibGljIHsKICAgICAgICBkZWxldGUgbmVzdGVkW19hZGRyMV1bX2ldOwogICAgfQp9Cg=="}],eB=`

                                      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-solidity-code-example",pB=[{fileName:"Mapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saW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AgIC8vIFlvdSBjYW4gZ2V0IHZhbHVlcyBmcm9tIGEgbmVzdGVkIG1hcHBpbmcKICAgICAgICAvLyBldmVuIHdoZW4gaXQgaXMgbm90IGluaXRpYWxpemVkCiAgICAgICAgcmV0dXJuIG5lc3RlZFtfYWRkcjFdW19pXTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoYWRkcmVzcyBfYWRkcjEsIHVpbnQyNTYgX2ksIGJvb2wgX2JvbykgcHVibGljIHsKICAgICAgICBuZXN0ZWRbX2FkZHIxXVtfaV0gPSBfYm9vOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyMSwgdWludDI1NiBfaSkgcHVibGljIHsKICAgICAgICBkZWxldGUgbmVzdGVkW19hZGRyMV1bX2ldOwogICAgfQp9Cg=="}],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.

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

                                      delete nested[_addr1][_i]; } } -`,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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENhciB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIHN0cmluZyBwdWJsaWMgbW9kZWw7CiAgICBhZGRyZXNzIHB1YmxpYyBjYXJBZGRyOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX293bmVyLCBzdHJpbmcgbWVtb3J5IF9tb2RlbCkgcGF5YWJsZS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ZTogbXNnLnZhbHVlLCBzYWx0OiBfc2FsdH0oX293bmVyLCBfbW9kZWwpOwogICAgICAgIGNhcnMucHVzaChjYXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldENhcih1aW50MjU2IF9pbmRleCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoCiAgICAgICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgICAgIHN0cmluZyBtZW1vcnkgbW9kZWwsCiAgICAgICAgICAgIGFkZHJlc3MgY2FyQWRkciwKICAgICAgICAgICAgdWludDI1NiBiYWxhbmNlCiAgICAgICAgKQogICAgewogICAgICAgIENhciBjYXIgPSBjYXJzW19pbmRleF07CgogICAgICAgIHJldHVybiAoY2FyLm93bmVyKCksIGNhci5tb2RlbCgpLCBjYXIuY2FyQWRkcigpLCBhZGRyZXNzKGNhcikuYmFsYW5jZSk7CiAgICB9Cn0K"}],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.

                                      +`,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-solidity-code-example",gB=[{fileName:"NewContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IENhciB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIHN0cmluZyBwdWJsaWMgbW9kZWw7CiAgICBhZGRyZXNzIHB1YmxpYyBjYXJBZGRyOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX293bmVyLCBzdHJpbmcgbWVtb3J5IF9tb2RlbCkgcGF5YWJsZSB7CiAgICAgICAgb3duZX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CBzYWx0OiBfc2FsdH0oX293bmVyLCBfbW9kZWwpOwogICAgICAgIGNhcnMucHVzaChjYXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldENhcih1aW50MjU2IF9pbmRleCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoCiAgICAgICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgICAgIHN0cmluZyBtZW1vcnkgbW9kZWwsCiAgICAgICAgICAgIGFkZHJlc3MgY2FyQWRkciwKICAgICAgICAgICAgdWludDI1NiBiYWxhbmNlCiAgICAgICAgKQogICAgewogICAgICAgIENhciBjYXIgPSBjYXJzW19pbmRleF07CgogICAgICAgIHJldHVybiAoY2FyLm93bmVyKCksIGNhci5tb2RlbCgpLCBjYXIuY2FyQWRkcigpLCBhZGRyZXNzKGNhcikuYmFsYW5jZSk7CiAgICB9Cn0K"}],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;
                                       
                                      @@ -11630,7 +11630,7 @@ you can't send ether.

                                      return (car.owner(), car.model(), car.carAddr(), address(car).balance); } } -
                                      `,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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFBheWFibGUgewogICAgLy8gUGF5YWJsZSBhZGRyZXNzIGNhbiBzZW5kIEV0aGVyIHZpYSB0cmFuc2ZlciBvciBzZW5kCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIG93bmVyOwoKICAgIC8vIFBheWFibGUgY29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sKICAgIH0KCiAgICAvLyBGdW5jdGlvbiB0byB0cmFuc2ZlciBFdGhlciBmcm9tIHRoaXMgY29udHJhY3QgdG8gYWRkcmVzcyBmcm9tIGlucHV0CiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIHBheWFibGUgX3RvLCB1aW50MjU2IF9hbW91bnQpIHB1YmxpYyB7CiAgICAgICAgLy8gTm90ZSB0aGF0ICJ0byIgaXMgZGVjbGFyZWQgYXMgcGF5YWJsZQogICAgICAgIChib29sIHN1Y2Nlc3MsKSA9IF90by5jYWxse3ZhbHVlOiBfYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzdWNjZXNzLCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KfQo="}],yB=`

                                      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-solidity-code-example",uB=[{fileName:"Payable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFBheWFibGUgewogICAgLy8gUGF5YWJsZSBhZGRyZXNzIGNhbiBzZW5kIEV0aGVyIHZpYSB0cmFuc2ZlciBvciBzZW5kCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIG93bmVyOwoKICAgIC8vIFBheWFibGUgY29uc3RydWN0b3IgY2FuIHJlY2VpdmUgRXRoZXIKICAgIGNvbnN0cnVjdG9yKCkgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGRlcG9zaXQgRXRoZXIgaW50byB0aGlzIGNvbnRyYWN0LgogICAgLy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Ly8gTm90ZSB0aGF0ICJ0byIgaXMgZGVjbGFyZWQgYXMgcGF5YWJsZQogICAgICAgIChib29sIHN1Y2Nlc3MsKSA9IF90by5jYWxse3ZhbHVlOiBfYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzdWNjZXNzLCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KfQo="}],yB=`

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

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

                                      require(success, "Failed to send Ether"); } } -
                                      `,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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFByaW1pdGl2ZXMgewogICAgYm9vbCBwdWJsaWMgYm9vID0gdHJ1ZTsKCiAgICAvKgogICAgdWludCBzdGFuZHMgZm9yIHVuc2lnbmVkIGludGVnZXIsIG1lYW5pbmcgbm9uIG5lZ2F0aXZlIGludGVnZXJzCiAgICBkaWZmZXJlbnQgc2l6ZXMgYXJlIGF2YWlsYWJsZQogICAgICAgIHVpbnQ4ICAgcmFuZ2VzIGZyb20gMCB0byAyICoqIDggLSAxCiAgICAgICAgdWludDE2ICByYW5nZXMgZnJvbSAwIHRvIDIgKiogMTYgLSAxCiAgICAgICAgLi4uCiAgICAgICAgdWludDI1NiByYW5nZXMgZnJvbSAwIHRvIDIgKiogMjU2IC0gMQogICAgKi8KICAgIHVpbnQ4IHB1YmxpYyB1OCA9IDE7CiAgICB1aW50MjU2IHB1YmxpYyB1MjU2ID0gNDU2OwogICAgdWludDI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gZHluYW1pYyBhcnJheSBvZiBieXRlcy4gCiAgICAgSXTigJlzIGEgc2hvcnRoYW5kIGZvciBieXRlW10gLgogICAgKi8KICAgIGJ5dGVzMSBhID0gMHhiNTsgLy8gIFsxMDExMDEwMV0KICAgIGJ5dGVzMSBiID0gMHg1NjsgLy8gIFswMTAxMDExMF0KCiAgICAvLyBEZWZhdWx0IHZhbHVlcwogICAgLy8gVW5hc3NpZ25lZCB2YXJpYWJsZXMgaGF2ZSBhIGRlZmF1bHQgdmFsdWUKICAgIGJvb2wgcHVibGljIGRlZmF1bHRCb287IC8vIGZhbHNlCiAgICB1aW50MjU2IHB1YmxpYyBkZWZhdWx0VWludDsgLy8gMAogICAgaW50MjU2IHB1YmxpYyBkZWZhdWx0SW50OyAvLyAwCiAgICBhZGRyZXNzIHB1YmxpYyBkZWZhdWx0QWRkcjsgLy8gMHgwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCn0K"}],BB=`

                                      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-solidity-code-example",WB=[{fileName:"Primitives.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFByaW1pdGl2ZXMgewogICAgYm9vbCBwdWJsaWMgYm9vID0gdHJ1ZTsKCiAgICAvKgogICAgdWludCBzdGFuZHMgZm9yIHVuc2lnbmVkIGludGVnZXIsIG1lYW5pbmcgbm9uIG5lZ2F0aXZlIGludGVnZXJzCiAgICBkaWZmZXJlbnQgc2l6ZXMgYXJlIGF2YWlsYWJsZQogICAgICAgIHVpbnQ4ICAgcmFuZ2VzIGZyb20gMCB0byAy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Ugb2YgYnl0ZXMuIAogICAgU29saWRpdHkgcHJlc2VudHMgdHdvIHR5cGUgb2YgYnl0ZXMgdHlwZXMgOgoKICAgICAtIGZpeGVkLXNpemVkIGJ5dGUgYXJyYXlzCiAgICAgLSBkeW5hbWljYWxseS1zaXplZCBieXRlIGFycmF5cy4KICAgICAKICAgICBUaGUgdGVybSBieXRlcyBpbiBTb2xpZGl0eSByZXByZXNlbnRzIGEgZHluYW1pYyBhcnJheSBvZiBieXRlcy4gCiAgICAgSXTigJlzIGEgc2hvcnRoYW5kIGZvciBieXRlW10gLgogICAgKi8KICAgIGJ5dGVzMSBhID0gMHhiNTsgLy8gIFsxMDExMDEwMV0KICAgIGJ5dGVzMSBiID0gMHg1NjsgLy8gIFswMTAxMDExMF0KCiAgICAvLyBEZWZhdWx0IHZhbHVlcwogICAgLy8gVW5hc3NpZ25lZCB2YXJpYWJsZXMgaGF2ZSBhIGRlZmF1bHQgdmFsdWUKICAgIGJvb2wgcHVibGljIGRlZmF1bHRCb287IC8vIGZhbHNlCiAgICB1aW50MjU2IHB1YmxpYyBkZWZhdWx0VWludDsgLy8gMAogICAgaW50MjU2IHB1YmxpYyBkZWZhdWx0SW50OyAvLyAwCiAgICBhZGRyZXNzIHB1YmxpYyBkZWZhdWx0QWRkcjsgLy8gMHgwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCn0K"}],BB=`

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

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

                                        int256 public defaultInt; // 0 address public defaultAddr; // 0x0000000000000000000000000000000000000000 } -`,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:"Sending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lZCBmb3Igc2VuZGluZyBFdGhlci4KICAgICAgICBfdG8udHJhbnNmZXIobXNnLnZhbHVlKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZW5kVmlhU2VuZChhZGRyZXNzIHBheWFibGUgX3RvKSBwdWJsaWMgcGF5YWJsZSB7CiAgICAgICAgLy8gU2VuZCByZXR1cm5zIGEgYm9vbGVhbiB2YWx1ZSBpbmRpY2F0aW5nIHN1Y2Nlc3Mgb3IgZmFpbHVyZS4KICAgICAgICAvLyBUaGlzIGZ1bmN0aW9uIGlzIG5vdCByZWNvbW1lbmRlZCBmb3Igc2VuZGluZyBFdGhlci4KICAgICAgICBib29sIHNlbnQgPSBfdG8uc2VuZChtc2cudmFsdWUpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICB9CgogICAgZnVuY3Rpb24gc2VuZFZpYUNhbGwoYWRkcmVzcyBwYXlhYmxlIF90bykgcHVibGljIHBheWFibGUgewogICAgICAgIC8vIENhbGwgcmV0dXJucyBhIGJvb2xlYW4gdmFsdWUgaW5kaWNhdGluZyBzdWNjZXNzIG9yIGZhaWx1cmUuCiAgICAgICAgLy8gVGhpcyBpcyB0aGUgY3VycmVudCByZWNvbW1lbmRlZCBtZXRob2QgdG8gdXNlLgogICAgICAgIChib29sIHNlbnQsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF90by5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],RB=`

                                        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-solidity-code-example",vB=[{file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W1lbmRlZCBmb3Igc2VuZGluZyBFdGhlci4KICAgICAgICBfdG8udHJhbnNmZXIobXNnLnZhbHVlKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZW5kVmlhU2VuZChhZGRyZXNzIHBheWFibGUgX3RvKSBwdWJsaWMgcGF5YWJsZSB7CiAgICAgICAgLy8gU2VuZCByZXR1cm5zIGEgYm9vbGVhbiB2YWx1ZSBpbmRpY2F0aW5nIHN1Y2Nlc3Mgb3IgZmFpbHVyZS4KICAgICAgICAvLyBUaGlzIGZ1bmN0aW9uIGlzIG5vdCByZWNvbW1lbmRlZCBmb3Igc2VuZGluZyBFdGhlci4KICAgICAgICBib29sIHNlbnQgPSBfdG8uc2VuZChtc2cudmFsdWUpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICB9CgogICAgZnVuY3Rpb24gc2VuZFZpYUNhbGwoYWRkcmVzcyBwYXlhYmxlIF90bykgcHVibGljIHBheWFibGUgewogICAgICAgIC8vIENhbGwgcmV0dXJucyBhIGJvb2xlYW4gdmFsdWUgaW5kaWNhdGluZyBzdWNjZXNzIG9yIGZhaWx1cmUuCiAgICAgICAgLy8gVGhpcyBpcyB0aGUgY3VycmVudCByZWNvbW1lbmRlZCBtZXRob2QgdG8gdXNlLgogICAgICAgIChib29sIHNlbnQsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF90by5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],RB=`

                                        How to send Ether?

                                        You can send Ether to other contracts by

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

                                          require(sent, "Failed to send Ether"); } } -`,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 +`,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-solidity-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
                                          @@ -11831,7 +11831,7 @@ in the child contract.

                                          // C.getName returns "Contract C" } -
                                          `,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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIFNpZ25hdHVyZSBWZXJpZmljYXRpb24KCkh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mcgYXQgdGhlIG1lbW9yeSBhZGRyZXNzIHAgaW50byBtZW1vcnkKICAgICAgICAgICAgKi8KCiAgICAgICAgICAgIC8vIGZpcnN0IDMyIGJ5dGVzLCBhZnRlciB0aGUgbGVuZ3RoIHByZWZpeAogICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWcsIDMyKSkKICAgICAgICAgICAgLy8gc2Vjb25kIDMyIGJ5dGVzCiAgICAgICAgICAgIHMgOj0gbWxvYWQoYWRkKHNpZywgNjQpKQogICAgICAgICAgICAvLyBmaW5hbCBieXRlIChmaXJzdCBieXRlIG9mIHRoZSBuZXh0IDMyIGJ5dGVzKQogICAgICAgICAgICB2IDo9IGJ5dGUoMCwgbWxvYWQoYWRkKHNpZywgOTYpKSkKICAgICAgICB9CgogICAgICAgIC8vIGltcGxpY2l0bHkgcmV0dXJuIChyLCBzLCB2KQogICAgfQp9Cg=="}],UB=`

                                          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-solidity-code-example",TB=[{fileName:"Signature.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIFNpZ25hdHVyZSBWZXJpZmljYXRpb24KCkhvdyB0byBTaWduIGFuZCBWZXJpZnkKIyBTaWduaW5nCjEuIENyZWF0ZSBtZXNzYWdlIHRvIHNpZ24KMi4gSGFzaCB0aGUgbWVzc2FnZQozLiBTaWduIHRoZSBoYXNoIChvZmYgY2hhaW4sIGtlZXAgeW91ciBwcml2YXRlIGtleSBzZWNyZXQpCgojIFZlcmlmeQoxLiBSZWNyZWF0ZSBoYXNoIGZyb20gdGhlIG9yaWdpbmFsIG1lc3NhZ2UKMi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WRkKHNpZywgNjQpKQogICAgICAgICAgICAvLyBmaW5hbCBieXRlIChmaXJzdCBieXRlIG9mIHRoZSBuZXh0IDMyIGJ5dGVzKQogICAgICAgICAgICB2IDo9IGJ5dGUoMCwgbWxvYWQoYWRkKHNpZywgOTYpKSkKICAgICAgICB9CgogICAgICAgIC8vIGltcGxpY2l0bHkgcmV0dXJuIChyLCBzLCB2KQogICAgfQp9Cg=="}],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;
                                          @@ -11959,7 +11959,7 @@ How to Sign and Verify
                                                   // implicitly return (r, s, v)
                                               }
                                           }
                                          -
                                          `,_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.

                                          +`,_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-solidity-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;
                                          @@ -11978,7 +11978,7 @@ How to Sign and Verify
                                                   return num;
                                               }
                                           }
                                          -
                                          `,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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRvZG9zIHsKICAgIHN0cnVjdCBUb2RvIHsKICAgICAgICBzdHJpbmcgdGV4dDsKICAgICAgICBib29sIGNvbXBsZXRlZDsKICAgIH0KCiAgICAvLyBBbiBhcnJheSBvZiAnVG9kbycgc3RydWN0cwogICAgVG9kb1tdIHB1YmxpYyB0b2RvczsKCiAgICBmdW5jdGlvbiBjcmVhdGUoc3RyaW5nIGNhbGxkYXRhIF90ZXh0KSBwdWJsaWMgewogICAgICAgIC8vIDMgd2F5cyB0byBpbml0aWFsaXplIGEgc3RydWN0CiAgICAgICAgLy8gLSBjYWxsaW5nIGl0IGxpa2UgYSBmdW5jdGlvbgogICAgICAgIHRvZG9zLnB1c2goVG9kbyhfdGV4dCwgZmFsc2UpKTs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h1aW50MjU2IF9pbmRleCkgcHVibGljIHsKICAgICAgICBUb2RvIHN0b3JhZ2UgdG9kbyA9IHRvZG9zW19pbmRleF07CiAgICAgICAgdG9kby5jb21wbGV0ZWQgPSAhdG9kby5jb21wbGV0ZWQ7CiAgICB9Cn0K"}],tG=`

                                          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-solidity-code-example",cG=[{fileName:"StructDeclaration.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKLy8gVGhpcyBpcyBzYXZlZCAnU3RydWN0RGVjbGFyYXRpb24uc29sJwoKc3RydWN0IFRvZG8gewogICAgc3RyaW5nIHRleHQ7CiAgICBib29sIGNvbXBsZXRlZDsKfQo="},{fileName:"StructImport.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmltcG9ydCAiLi9TdHJ1Y3REZWNsYXJhdGlvbi5zb2wiOwoKY29udHJhY3QgVG9kb3MgewogICAgLy8gQW4gYXJyYXkgb2YgJ1RvZG8nIHN0cnVjdHMKICAgIFRvZG9bXSBwdWJsaWMgdG9kb3M7Cn0K"},{fileName:"Structs.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFRvZG9zIHsKICAgIHN0cnVjdCBUb2RvIHsKICAgICAgICBzdHJpbmcgdGV4dDsKICAgICAgICBib29sIGNvbXBsZXRlZDsKICAgIH0KCiAgICAvLyBBbiBhcnJheSBvZiAnVG9kbycgc3RydWN0cwogICAgVG9kb1tdIHB1Ymxp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pbnQyNTYgX2luZGV4LCBzdHJpbmcgY2FsbGRhdGEgX3RleHQpIHB1YmxpYyB7CiAgICAgICAgVG9kbyBzdG9yYWdlIHRvZG8gPSB0b2Rvc1tfaW5kZXhdOwogICAgICAgIHRvZG8udGV4dCA9IF90ZXh0OwogICAgfQoKICAgIC8vIHVwZGF0ZSBjb21wbGV0ZWQKICAgIGZ1bmN0aW9uIHRvZ2dsZUNvbXBsZXRlZCh1aW50MjU2IF9pbmRleCkgcHVibGljIHsKICAgICAgICBUb2RvIHN0b3JhZ2UgdG9kbyA9IHRvZG9zW19pbmRleF07CiAgICAgICAgdG9kby5jb21wbGV0ZWQgPSAhdG9kby5jb21wbGV0ZWQ7CiAgICB9Cn0K"}],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
                                          @@ -12052,7 +12052,7 @@ How to Sign and Verify
                                               // An array of 'Todo' structs
                                               Todo[] public todos;
                                           }
                                          -
                                          `,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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIEluaGVyaXRhbmNlIHRyZWUKICAgQQogLyAgXApCICAgQwogXCAvCiAgRAoqLwoKY29udHJhY3QgQSB7CiAgICAvLyBUaGlzIGlzIGNhbGxlZCBhbiBldmVudC4gWW91IGNhbiBlbWl0IGV2ZW50cyBmcm9tIHlvdXIgZnVuY3Rpb24KICAgIC8vIGFuZCB0aGV5IGFyZSBsb2dnZWQgaW50byB0aGUgdHJhbnNhY3Rpb24gbG9nLgogICAgLy8gSW4gb3VyI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sIGl0IG9ubHkgY2FsbGVkIEMgYW5kIHRoZW4gQS4KICAgIC8vIC0gQ2FsbCBELmJhciBhbmQgY2hlY2sgdGhlIHRyYW5zYWN0aW9uIGxvZ3MKICAgIC8vICAgRCBjYWxsZWQgQywgdGhlbiBCLCBhbmQgZmluYWxseSBBLgogICAgLy8gICBBbHRob3VnaCBzdXBlciB3YXMgY2FsbGVkIHR3aWNlIChieSBCIGFuZCBDKSBpdCBvbmx5IGNhbGxlZCBBIG9uY2UuCgogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIG92ZXJyaWRlKEIsIEMpIHsKICAgICAgICBzdXBlci5mb28oKTsKICAgIH0KCiAgICBmdW5jdGlvbiBiYXIoKSBwdWJsaWMgb3ZlcnJpZGUoQiwgQykgewogICAgICAgIHN1cGVyLmJhcigpOwogICAgfQp9Cg=="}],dG=`

                                          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-solidity-code-example",IG=[{fileName:"Super.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8qIEluaGVyaXRhbmNlIHRyZWUKICAgQQogLyAgXApCICAgQwogXCAvCiAgRAoqLwoKY29udHJhY3QgQSB7CiAgICAvLyBUaGlzIGlzIGNhbGxlZCBhbiBldmVudC4gWW91IGNhbiBlbWl0IGV2ZW50cyBmcm9tIHlvdXIgZnVuY3Rpb24KICAgIC8vIGFuZCB0aGV5IGFyZSBsb2dnZWQgaW50byB0aGUgdHJhbnNhY3Rpb24gbG9nLgogICAgLy8gSW4gb3VyIGNhc2UsIHRoaXMgd2lsbCBiZSB1c2VmdWwgZm9yIHRyYWNpbmcgZnVuY3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bCBELmJhciBhbmQgY2hlY2sgdGhlIHRyYW5zYWN0aW9uIGxvZ3MKICAgIC8vICAgRCBjYWxsZWQgQywgdGhlbiBCLCBhbmQgZmluYWxseSBBLgogICAgLy8gICBBbHRob3VnaCBzdXBlciB3YXMgY2FsbGVkIHR3aWNlIChieSBCIGFuZCBDKSBpdCBvbmx5IGNhbGxlZCBBIG9uY2UuCgogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIG92ZXJyaWRlKEIsIEMpIHsKICAgICAgICBzdXBlci5mb28oKTsKICAgIH0KCiAgICBmdW5jdGlvbiBiYXIoKSBwdWJsaWMgb3ZlcnJpZGUoQiwgQykgewogICAgICAgIHN1cGVyLmJhcigpOwogICAgfQp9Cg=="}],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;
                                          @@ -12252,7 +12252,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                   return false;
                                               }
                                           }
                                          -
                                          `,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:"cHJhZ21hIHNvbGlkaXR5IF4wLjguMjY7CgovLyBNYWtlIHN1cmUgRVZNIHZlcnNpb24gYW5kIFZNIHNldCB0byBDYW5jdW4KCi8vIFN0b3JhZ2UgLSBkYXRhIGlzIHN0b3JlZCBvbiB0aGUgYmxvY2tjaGFpbgovLyBNZW1vcnkgLSBkYXRhIGlzIGNsZWFyZWQgb3V0IGFmdGVyIGEgZnVuY3Rpb24gY2FsbAovLyBUcmFuc2llbnQgc3RvcmFnZSAtIGRhdGEgaXMgY2xlYXJlZCBvdXQgYWZ0ZXIgYSB0cmFuc2FjdGlvbg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lHdWFyZCB7CiAgICBib29sIHByaXZhdGUgbG9ja2VkOwoKICAgIG1vZGlmaWVyIGxvY2soKSB7CiAgICAgICAgcmVxdWlyZSghbG9ja2VkKTsKICAgICAgICBsb2NrZWQgPSB0cnVlOwogICAgICAgIF87CiAgICAgICAgbG9ja2VkID0gZmFsc2U7CiAgICB9CgogICAgLy8gMzUzMTMgZ2FzCiAgICBmdW5jdGlvbiB0ZXN0KCkgcHVibGljIGxvY2sgewogICAgICAgIC8vIElnbm9yZSBjYWxsIGVycm9yCiAgICAgICAgYnl0ZXMgbWVtb3J5IGIgPSAiIjsKICAgICAgICBtc2cuc2VuZGVyLmNhbGwoYik7CiAgICB9Cn0KCmNvbnRyYWN0IFJlZW50cmFuY3lHdWFyZFRyYW5zaWVudCB7CiAgICBieXRlczMyIGNvbnN0YW50IFNMT1QgPSAwOwoKICAgIG1vZGlmaWVyIGxvY2soKSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBpZiB0bG9hZChTTE9UKSB7IHJldmVydCgwLCAwKSB9CiAgICAgICAgICAgIHRzdG9yZShTTE9ULCAxKQogICAgICAgIH0KICAgICAgICBfOwogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgdHN0b3JlKFNMT1QsIDApCiAgICAgICAgfQogICAgfQoKICAgIC8vIDIxODg3IGdhcwogICAgZnVuY3Rpb24gdGVzdCgpIGV4dGVybmFsIGxvY2sgewogICAgICAgIC8vIElnbm9yZSBjYWxsIGVycm9yCiAgICAgICAgYnl0ZXMgbWVtb3J5IGIgPSAiIjsKICAgICAgICBtc2cuc2VuZGVyLmNhbGwoYik7CiAgICB9Cn0K"}],fG=`

                                          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-solidity-code-example",GG=[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gpIHB1YmxpYyB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICB0c3RvcmUoU0xPVCwgMzIxKQogICAgICAgIH0KICAgICAgICBieXRlcyBtZW1vcnkgYiA9ICIiOwogICAgICAgIG1zZy5zZW5kZXIuY2FsbChiKTsKICAgIH0KCiAgICBmdW5jdGlvbiB2YWwoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2IHYpIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHYgOj0gdGxvYWQoU0xPVCkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IFJlZW50cmFuY3lHdWFyZCB7CiAgICBib29sIHByaXZhdGUgbG9ja2VkOwoKICAgIG1vZGlmaWVyIGxvY2soKSB7CiAgICAgICAgcmVxdWlyZSghbG9ja2VkKTsKICAgICAgICBsb2NrZWQgPSB0cnVlOwogICAgICAgIF87CiAgICAgICAgbG9ja2VkID0gZmFsc2U7CiAgICB9CgogICAgLy8gMzUzMTMgZ2FzCiAgICBmdW5jdGlvbiB0ZXN0KCkgcHVibGljIGxvY2sgewogICAgICAgIC8vIElnbm9yZSBjYWxsIGVycm9yCiAgICAgICAgYnl0ZXMgbWVtb3J5IGIgPSAiIjsKICAgICAgICBtc2cuc2VuZGVyLmNhbGwoYik7CiAgICB9Cn0KCmNvbnRyYWN0IFJlZW50cmFuY3lHdWFyZFRyYW5zaWVudCB7CiAgICBieXRlczMyIGNvbnN0YW50IFNMT1QgPSAwOwoKICAgIG1vZGlmaWVyIGxvY2soKSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBpZiB0bG9hZChTTE9UKSB7IHJldmVydCgwLCAwKSB9CiAgICAgICAgICAgIHRzdG9yZShTTE9ULCAxKQogICAgICAgIH0KICAgICAgICBfOwogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgdHN0b3JlKFNMT1QsIDApCiAgICAgICAgfQogICAgfQoKICAgIC8vIDIxODg3IGdhcwogICAgZnVuY3Rpb24gdGVzdCgpIGV4dGVybmFsIGxvY2sgewogICAgICAgIC8vIElnbm9yZSBjYWxsIGVycm9yCiAgICAgICAgYnl0ZXMgbWVtb3J5IGIgPSAiIjsKICAgICAgICBtc2cuc2VuZGVyLmNhbGwoYik7CiAgICB9Cn0K"}],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
                                          @@ -12345,7 +12345,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                   msg.sender.call(b);
                                               }
                                           }
                                          -
                                          `,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:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIEV4dGVybmFsIGNvbnRyYWN0IHVzZWQgZm9yIHRyeSAvIGNhdGNoIGV4YW1wbGVzCmNvbnRyYWN0IEZvbyB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICBjb25zdHJ1Y3RvcihhZGRyZXNzIF9vd25lcikgewogICAgICAgIHJlcXVpcmUoX293bmVyICE9IGFkZHJlc3MoMCksICJpbnZhbGlkIGFkZHJlc3MiKTsKICAgICAgICBhc3NlcnQoX293bmVyICE9IDB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMSk7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICB9CgogICAgZnVuY3Rpb24gbXlGdW5jKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJlcXVpcmUoeCAhPSAw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AwMDAwMDAwMDAwMDAwMCkgPT4gTG9nKCJpbnZhbGlkIGFkZHJlc3MiKQogICAgLy8gdHJ5Q2F0Y2hOZXdDb250cmFjdCgweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDEpID0+IExvZ0J5dGVzKCIiKQogICAgLy8gdHJ5Q2F0Y2hOZXdDb250cmFjdCgweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDIpID0+IExvZygiRm9vIGNyZWF0ZWQiKQogICAgZnVuY3Rpb24gdHJ5Q2F0Y2hOZXdDb250cmFjdChhZGRyZXNzIF9vd25lcikgcHVibGljIHsKICAgICAgICB0cnkgbmV3IEZvbyhfb3duZXIpIHJldHVybnMgKEZvbyBmb28pIHsKICAgICAgICAgICAgLy8geW91IGNhbiB1c2UgdmFyaWFibGUgZm9vIGhlcmUKICAgICAgICAgICAgZW1pdCBMb2coIkZvbyBjcmVhdGVkIik7CiAgICAgICAgfSBjYXRjaCBFcnJvcihzdHJpbmcgbWVtb3J5IHJlYXNvbikgewogICAgICAgICAgICAvLyBjYXRjaCBmYWlsaW5nIHJldmVydCgpIGFuZCByZXF1aXJlKCkKICAgICAgICAgICAgZW1pdCBMb2cocmVhc29uKTsKICAgICAgICB9IGNhdGNoIChieXRlcyBtZW1vcnkgcmVhc29uKSB7CiAgICAgICAgICAgIC8vIGNhdGNoIGZhaWxpbmcgYXNzZXJ0KCkKICAgICAgICAgICAgZW1pdCBMb2dCeXRlcyhyZWFzb24pOwogICAgICAgIH0KICAgIH0KfQo="}],HG=`

                                          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-solidity-code-example",NG=[{fileName:"TryCatch.sol",code:"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ZW1pdCBMb2coIkZvbyBjcmVhdGVkIik7CiAgICAgICAgfSBjYXRjaCBFcnJvcihzdHJpbmcgbWVtb3J5IHJlYXNvbikgewogICAgICAgICAgICAvLyBjYXRjaCBmYWlsaW5nIHJldmVydCgpIGFuZCByZXF1aXJlKCkKICAgICAgICAgICAgZW1pdCBMb2cocmVhc29uKTsKICAgICAgICB9IGNhdGNoIChieXRlcyBtZW1vcnkgcmVhc29uKSB7CiAgICAgICAgICAgIC8vIGNhdGNoIGZhaWxpbmcgYXNzZXJ0KCkKICAgICAgICAgICAgZW1pdCBMb2dCeXRlcyhyZWFzb24pOwogICAgICAgIH0KICAgIH0KfQo="}],HG=`

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

                                          // SPDX-License-Identifier: MIT
                                           pragma solidity ^0.8.26;
                                           
                                          @@ -12404,7 +12404,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                   }
                                               }
                                           }
                                          -
                                          `,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.

                                          +`,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-solidity-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;
                                          @@ -12440,7 +12440,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                   }
                                               }
                                           }
                                          -
                                          `,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:"User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FsIHZpZXcgewogICAgICAgIC8vIFR1cm4gdmFsdWUgdHlwZSBpbnRvIHVzZXIgZGVmaW5lZCB2YWx1ZSB0eXBlCiAgICAgICAgRHVyYXRpb24gZCA9IER1cmF0aW9uLndyYXAoMSk7CiAgICAgICAgVGltZXN0YW1wIHQgPSBUaW1lc3RhbXAud3JhcCh1aW50NjQoYmxvY2sudGltZXN0YW1wKSk7CiAgICAgICAgLy8gVHVybiB1c2VyIGRlZmluZWQgdmFsdWUgdHlwZSBiYWNrIGludG8gcHJpbWl0aXZlIHZhbHVlIHR5cGUKICAgICAgICB1aW50NjQgZF91NjQgPSBEdXJhdGlvbi51bndyYXAoZCk7CiAgICAgICAgdWludDY0IHRfdTU0ID0gVGltZXN0YW1wLnVud3JhcCh0KTsKCiAgICAgICAgLy8gTGliQ2xvY2sgZXhhbXBsZQogICAgICAgIENsb2NrIGNsb2NrID0gQ2xvY2sud3JhcCgwKTsKICAgICAgICBjbG9jayA9IExpYkNsb2NrLndyYXAoZCwgdCk7CiAgICAgICAgLy8gT29wcyEgd3Jvbmcgb3JkZXIgb2YgaW5wdXRzCiAgICAgICAgLy8gVGhpcyB3aWxsIG5vdCBjb21waWxlCiAgICAgICAgLy8gY2xvY2sgPSBMaWJDbG9jay53cmFwKHQsIGQpOwogICAgfQp9Cg=="}],LG=`
                                          // 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-solidity-code-example",_G=[{fileName:"UserDefinedValueTypes.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCi8vIENvZGUgY29waWVkIGZyb20gb3B0aW1pc20KLy8gaHR0cHM6Ly9naXRodWIuY29tL2V0aGVyZXVt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lc3RhbXAud3JhcCh1aW50NjQoYmxvY2sudGltZXN0YW1wKSk7CiAgICAgICAgLy8gVHVybiB1c2VyIGRlZmluZWQgdmFsdWUgdHlwZSBiYWNrIGludG8gcHJpbWl0aXZlIHZhbHVlIHR5cGUKICAgICAgICB1aW50NjQgZF91NjQgPSBEdXJhdGlvbi51bndyYXAoZCk7CiAgICAgICAgdWludDY0IHRfdTU0ID0gVGltZXN0YW1wLnVud3JhcCh0KTsKCiAgICAgICAgLy8gTGliQ2xvY2sgZXhhbXBsZQogICAgICAgIENsb2NrIGNsb2NrID0gQ2xvY2sud3JhcCgwKTsKICAgICAgICBjbG9jayA9IExpYkNsb2NrLndyYXAoZCwgdCk7CiAgICAgICAgLy8gT29wcyEgd3Jvbmcgb3JkZXIgb2YgaW5wdXRzCiAgICAgICAgLy8gVGhpcyB3aWxsIG5vdCBjb21waWxlCiAgICAgICAgLy8gY2xvY2sgPSBMaWJDbG9jay53cmFwKHQsIGQpOwogICAgfQp9Cg=="}],LG=`
                                          // SPDX-License-Identifier: MIT
                                           pragma solidity ^0.8.26;
                                           
                                           // Code copied from optimism
                                          @@ -12526,7 +12526,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                   // clock = LibClock.wrap(t, d);
                                               }
                                           }
                                          -
                                          `,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

                                          +`,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-solidity-code-example",af=[{fileName:"Variables.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmNvbnRyYWN0IFZhcmlhYmxlcyB7CiAgICAvLyBTdGF0ZSB2YXJpYWJsZXMgYXJlIHN0b3JlZCBvbiB0aGUgYmxvY2tjaGFpbi4KICAgIHN0cmluZyBwdWJsaWMgdGV4dCA9ICJIZWxsbyI7CiAgICB1aW50MjU2IHB1YmxpYyBudW0gPSAxMjM7CgogICAgZnVuY3Rpb24gZG9Tb21ldGhpbmcoKSBwdWJsaWMgewogICAgICAgIC8vIExvY2FsIHZhcmlhYmxlcyBhcmUgbm90IHNhdmVkIHRvIHRoZSBibG9ja2NoYWluLgogICAgICAgIHVpbnQyNTYgaSA9IDQ1NjsKCiAgICAgICAgLy8gSGVyZSBhcmUgc29tZSBnbG9iYWwgdmFyaWFibGVzCiAgICAgICAgdWludDI1NiB0aW1lc3RhbXAgPSBibG9jay50aW1lc3RhbXA7IC8vIEN1cnJlbnQgYmxvY2sgdGltZXN0YW1wCiAgICAgICAgYWRkcmVzcyBzZW5kZXIgPSBtc2cuc2VuZGVyOyAvLyBhZGRyZXNzIG9mIHRoZSBjYWxsZXIKICAgIH0KfQo="}],nf=`

                                          There are 3 types of variables in Solidity

                                          • local
                                            • declared inside a function
                                            • @@ -12557,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: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.

                                              +`,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-solidity-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
                                              @@ -12576,7 +12576,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                       return i + j;
                                                   }
                                               }
                                              -
                                              `,gf=({prev:s,next:a})=>i.jsx(A,{version:pf,title:ef,description:cf,cyfrinLink:tf,html:rf,prev:s,next:a,codes:of}),hf="0.8.26",If="Visibility",df="An example of external, internal, private and public functions in Solidity",Cf="https://www.cyfrin.io/glossary/visibility-code-example",jf=[{fileName:"Visibility.sol",code:"Ly8gU1BEWC1MaWN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1YmxpYyBwdWJsaWNWYXIgPSAibXkgcHVibGljIHZhcmlhYmxlIjsKICAgIC8vIFN0YXRlIHZhcmlhYmxlcyBjYW5ub3QgYmUgZXh0ZXJuYWwgc28gdGhpcyBjb2RlIHdvbid0IGNvbXBpbGUuCiAgICAvLyBzdHJpbmcgZXh0ZXJuYWwgZXh0ZXJuYWxWYXIgPSAibXkgZXh0ZXJuYWwgdmFyaWFibGUiOwp9Cgpjb250cmFjdCBDaGlsZCBpcyBCYXNlIHsKICAgIC8vIEluaGVyaXRlZCBjb250cmFjdHMgZG8gbm90IGhhdmUgYWNjZXNzIHRvIHByaXZhdGUgZnVuY3Rpb25zCiAgICAvLyBhbmQgc3RhdGUgdmFyaWFibGVzLgogICAgLy8gZnVuY3Rpb24gdGVzdFByaXZhdGVGdW5jKCkgcHVibGljIHB1cmUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgLy8gICAgIHJldHVybiBwcml2YXRlRnVuYygpOwogICAgLy8gfQoKICAgIC8vIEludGVybmFsIGZ1bmN0aW9uIGNhbiBiZSBjYWxsZWQgaW5zaWRlIGNoaWxkIGNvbnRyYWN0cy4KICAgIGZ1bmN0aW9uIHRlc3RJbnRlcm5hbEZ1bmMoKSBwdWJsaWMgcHVyZSBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGludGVybmFsRnVuYygpOwogICAgfQp9Cg=="}],Af=`

                                              Functions and state variables have to declare whether they are accessible by other contracts.

                                              +`,gf=({prev:s,next:a})=>i.jsx(A,{version:pf,title:ef,description:cf,cyfrinLink:tf,html:rf,prev:s,next:a,codes:of}),hf="0.8.26",If="Visibility",df="An example of external, internal, private and public functions in Solidity",Cf="https://www.cyfrin.io/glossary/visibility-solidity-code-example",jf=[{fileName:"Visibility.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNjsKCmN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0YXRlIHZhcmlhYmxlcyBjYW5ub3QgYmUgZXh0ZXJuYWwgc28gdGhpcyBjb2RlIHdvbid0IGNvbXBpbGUuCiAgICAvLyBzdHJpbmcgZXh0ZXJuYWwgZXh0ZXJuYWxWYXIgPSAibXkgZXh0ZXJuYWwgdmFyaWFibGUiOwp9Cgpjb250cmFjdCBDaGlsZCBpcyBCYXNlIHsKICAgIC8vIEluaGVyaXRlZCBjb250cmFjdHMgZG8gbm90IGhhdmUgYWNjZXNzIHRvIHByaXZhdGUgZnVuY3Rpb25zCiAgICAvLyBhbmQgc3RhdGUgdmFyaWFibGVzLgogICAgLy8gZnVuY3Rpb24gdGVzdFByaXZhdGVGdW5jKCkgcHVibGljIHB1cmUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgLy8gICAgIHJldHVybiBwcml2YXRlRnVuYygpOwogICAgLy8gfQoKICAgIC8vIEludGVybmFsIGZ1bmN0aW9uIGNhbiBiZSBjYWxsZWQgaW5zaWRlIGNoaWxkIGNvbnRyYWN0cy4KICAgIGZ1bmN0aW9uIHRlc3RJbnRlcm5hbEZ1bmMoKSBwdWJsaWMgcHVyZSBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGludGVybmFsRnVuYygpOwogICAgfQp9Cg=="}],Af=`

                                              Functions and state variables have to declare whether they are accessible by other contracts.

                                              Functions can be declared as

                                              • public - any contract and account can call
                                              • @@ -12651,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]",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,{})})); +`,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:void 0,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 685c680af..ea85881bd 100644 --- a/bitwise/index.html +++ b/bitwise/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/call/index.html b/call/index.html index 685c680af..ea85881bd 100644 --- a/call/index.html +++ b/call/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/calling-contract/index.html b/calling-contract/index.html index 685c680af..ea85881bd 100644 --- a/calling-contract/index.html +++ b/calling-contract/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/constants/index.html b/constants/index.html index 685c680af..ea85881bd 100644 --- a/constants/index.html +++ b/constants/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/constructor/index.html b/constructor/index.html index 685c680af..ea85881bd 100644 --- a/constructor/index.html +++ b/constructor/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/data-locations/index.html b/data-locations/index.html index 685c680af..ea85881bd 100644 --- a/data-locations/index.html +++ b/data-locations/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/chainlink-price-oracle/index.html b/defi/chainlink-price-oracle/index.html index 685c680af..ea85881bd 100644 --- a/defi/chainlink-price-oracle/index.html +++ b/defi/chainlink-price-oracle/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/constant-product-amm/index.html b/defi/constant-product-amm/index.html index 685c680af..ea85881bd 100644 --- a/defi/constant-product-amm/index.html +++ b/defi/constant-product-amm/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/constant-sum-amm/index.html b/defi/constant-sum-amm/index.html index 685c680af..ea85881bd 100644 --- a/defi/constant-sum-amm/index.html +++ b/defi/constant-sum-amm/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/dai-proxy/index.html b/defi/dai-proxy/index.html index 685c680af..ea85881bd 100644 --- a/defi/dai-proxy/index.html +++ b/defi/dai-proxy/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/discrete-staking-rewards/index.html b/defi/discrete-staking-rewards/index.html index 685c680af..ea85881bd 100644 --- a/defi/discrete-staking-rewards/index.html +++ b/defi/discrete-staking-rewards/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/stable-swap-amm/index.html b/defi/stable-swap-amm/index.html index 685c680af..ea85881bd 100644 --- a/defi/stable-swap-amm/index.html +++ b/defi/stable-swap-amm/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/staking-rewards/index.html b/defi/staking-rewards/index.html index 685c680af..ea85881bd 100644 --- a/defi/staking-rewards/index.html +++ b/defi/staking-rewards/index.html @@ -28,8 +28,8 @@ 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 685c680af..ea85881bd 100644 --- a/defi/uniswap-v2-add-remove-liquidity/index.html +++ b/defi/uniswap-v2-add-remove-liquidity/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/uniswap-v2-flash-swap/index.html b/defi/uniswap-v2-flash-swap/index.html index 685c680af..ea85881bd 100644 --- a/defi/uniswap-v2-flash-swap/index.html +++ b/defi/uniswap-v2-flash-swap/index.html @@ -28,8 +28,8 @@ 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 685c680af..ea85881bd 100644 --- a/defi/uniswap-v2-optimal-one-sided-supply/index.html +++ b/defi/uniswap-v2-optimal-one-sided-supply/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/uniswap-v2/index.html b/defi/uniswap-v2/index.html index 685c680af..ea85881bd 100644 --- a/defi/uniswap-v2/index.html +++ b/defi/uniswap-v2/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/uniswap-v3-flash-swap/index.html b/defi/uniswap-v3-flash-swap/index.html index 685c680af..ea85881bd 100644 --- a/defi/uniswap-v3-flash-swap/index.html +++ b/defi/uniswap-v3-flash-swap/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/uniswap-v3-flash/index.html b/defi/uniswap-v3-flash/index.html index 685c680af..ea85881bd 100644 --- a/defi/uniswap-v3-flash/index.html +++ b/defi/uniswap-v3-flash/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/uniswap-v3-liquidity/index.html b/defi/uniswap-v3-liquidity/index.html index 685c680af..ea85881bd 100644 --- a/defi/uniswap-v3-liquidity/index.html +++ b/defi/uniswap-v3-liquidity/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/uniswap-v3-swap/index.html b/defi/uniswap-v3-swap/index.html index 685c680af..ea85881bd 100644 --- a/defi/uniswap-v3-swap/index.html +++ b/defi/uniswap-v3-swap/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/defi/vault/index.html b/defi/vault/index.html index 685c680af..ea85881bd 100644 --- a/defi/vault/index.html +++ b/defi/vault/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/delegatecall/index.html b/delegatecall/index.html index 685c680af..ea85881bd 100644 --- a/delegatecall/index.html +++ b/delegatecall/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/enum/index.html b/enum/index.html index 685c680af..ea85881bd 100644 --- a/enum/index.html +++ b/enum/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/error/index.html b/error/index.html index 685c680af..ea85881bd 100644 --- a/error/index.html +++ b/error/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/ether-units/index.html b/ether-units/index.html index 685c680af..ea85881bd 100644 --- a/ether-units/index.html +++ b/ether-units/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/events-advanced/index.html b/events-advanced/index.html index 685c680af..ea85881bd 100644 --- a/events-advanced/index.html +++ b/events-advanced/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/events/index.html b/events/index.html index 685c680af..ea85881bd 100644 --- a/events/index.html +++ b/events/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/evm/memory/index.html b/evm/memory/index.html index 685c680af..ea85881bd 100644 --- a/evm/memory/index.html +++ b/evm/memory/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/evm/storage/index.html b/evm/storage/index.html index 685c680af..ea85881bd 100644 --- a/evm/storage/index.html +++ b/evm/storage/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/fallback/index.html b/fallback/index.html index 685c680af..ea85881bd 100644 --- a/fallback/index.html +++ b/fallback/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/first-app/index.html b/first-app/index.html index 685c680af..ea85881bd 100644 --- a/first-app/index.html +++ b/first-app/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/function-modifier/index.html b/function-modifier/index.html index 685c680af..ea85881bd 100644 --- a/function-modifier/index.html +++ b/function-modifier/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/function-selector/index.html b/function-selector/index.html index 685c680af..ea85881bd 100644 --- a/function-selector/index.html +++ b/function-selector/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/function/index.html b/function/index.html index 685c680af..ea85881bd 100644 --- a/function/index.html +++ b/function/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/gas-golf/index.html b/gas-golf/index.html index 685c680af..ea85881bd 100644 --- a/gas-golf/index.html +++ b/gas-golf/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/gas/index.html b/gas/index.html index 685c680af..ea85881bd 100644 --- a/gas/index.html +++ b/gas/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/accessing-private-data/index.html b/hacks/accessing-private-data/index.html index 685c680af..ea85881bd 100644 --- a/hacks/accessing-private-data/index.html +++ b/hacks/accessing-private-data/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/block-timestamp-manipulation/index.html b/hacks/block-timestamp-manipulation/index.html index 685c680af..ea85881bd 100644 --- a/hacks/block-timestamp-manipulation/index.html +++ b/hacks/block-timestamp-manipulation/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/contract-size/index.html b/hacks/contract-size/index.html index 685c680af..ea85881bd 100644 --- a/hacks/contract-size/index.html +++ b/hacks/contract-size/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/delegatecall/index.html b/hacks/delegatecall/index.html index 685c680af..ea85881bd 100644 --- a/hacks/delegatecall/index.html +++ b/hacks/delegatecall/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/denial-of-service/index.html b/hacks/denial-of-service/index.html index 685c680af..ea85881bd 100644 --- a/hacks/denial-of-service/index.html +++ b/hacks/denial-of-service/index.html @@ -28,8 +28,8 @@ 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 685c680af..ea85881bd 100644 --- a/hacks/deploy-different-contracts-same-address/index.html +++ b/hacks/deploy-different-contracts-same-address/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/front-running/index.html b/hacks/front-running/index.html index 685c680af..ea85881bd 100644 --- a/hacks/front-running/index.html +++ b/hacks/front-running/index.html @@ -28,8 +28,8 @@ 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 685c680af..ea85881bd 100644 --- a/hacks/hiding-malicious-code-with-external-contract/index.html +++ b/hacks/hiding-malicious-code-with-external-contract/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/honeypot/index.html b/hacks/honeypot/index.html index 685c680af..ea85881bd 100644 --- a/hacks/honeypot/index.html +++ b/hacks/honeypot/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/overflow/index.html b/hacks/overflow/index.html index 685c680af..ea85881bd 100644 --- a/hacks/overflow/index.html +++ b/hacks/overflow/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/phishing-with-tx-origin/index.html b/hacks/phishing-with-tx-origin/index.html index 685c680af..ea85881bd 100644 --- a/hacks/phishing-with-tx-origin/index.html +++ b/hacks/phishing-with-tx-origin/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/randomness/index.html b/hacks/randomness/index.html index 685c680af..ea85881bd 100644 --- a/hacks/randomness/index.html +++ b/hacks/randomness/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/re-entrancy/index.html b/hacks/re-entrancy/index.html index 685c680af..ea85881bd 100644 --- a/hacks/re-entrancy/index.html +++ b/hacks/re-entrancy/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/self-destruct/index.html b/hacks/self-destruct/index.html index 685c680af..ea85881bd 100644 --- a/hacks/self-destruct/index.html +++ b/hacks/self-destruct/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/signature-replay/index.html b/hacks/signature-replay/index.html index 685c680af..ea85881bd 100644 --- a/hacks/signature-replay/index.html +++ b/hacks/signature-replay/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/vault-inflation/index.html b/hacks/vault-inflation/index.html index 685c680af..ea85881bd 100644 --- a/hacks/vault-inflation/index.html +++ b/hacks/vault-inflation/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hacks/weth-permit/index.html b/hacks/weth-permit/index.html index 685c680af..ea85881bd 100644 --- a/hacks/weth-permit/index.html +++ b/hacks/weth-permit/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hashing/index.html b/hashing/index.html index 685c680af..ea85881bd 100644 --- a/hashing/index.html +++ b/hashing/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/hello-world/index.html b/hello-world/index.html index 685c680af..ea85881bd 100644 --- a/hello-world/index.html +++ b/hello-world/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/if-else/index.html b/if-else/index.html index 685c680af..ea85881bd 100644 --- a/if-else/index.html +++ b/if-else/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/immutable/index.html b/immutable/index.html index 685c680af..ea85881bd 100644 --- a/immutable/index.html +++ b/immutable/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/import/index.html b/import/index.html index 685c680af..ea85881bd 100644 --- a/import/index.html +++ b/import/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/index.html b/index.html index 685c680af..ea85881bd 100644 --- a/index.html +++ b/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/inheritance/index.html b/inheritance/index.html index 685c680af..ea85881bd 100644 --- a/inheritance/index.html +++ b/inheritance/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/interface/index.html b/interface/index.html index 685c680af..ea85881bd 100644 --- a/interface/index.html +++ b/interface/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/library/index.html b/library/index.html index 685c680af..ea85881bd 100644 --- a/library/index.html +++ b/library/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/loop/index.html b/loop/index.html index 685c680af..ea85881bd 100644 --- a/loop/index.html +++ b/loop/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/mapping/index.html b/mapping/index.html index 685c680af..ea85881bd 100644 --- a/mapping/index.html +++ b/mapping/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/new-contract/index.html b/new-contract/index.html index 685c680af..ea85881bd 100644 --- a/new-contract/index.html +++ b/new-contract/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/payable/index.html b/payable/index.html index 685c680af..ea85881bd 100644 --- a/payable/index.html +++ b/payable/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/primitives/index.html b/primitives/index.html index 685c680af..ea85881bd 100644 --- a/primitives/index.html +++ b/primitives/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/sending-ether/index.html b/sending-ether/index.html index 685c680af..ea85881bd 100644 --- a/sending-ether/index.html +++ b/sending-ether/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/shadowing-inherited-state-variables/index.html b/shadowing-inherited-state-variables/index.html index 685c680af..ea85881bd 100644 --- a/shadowing-inherited-state-variables/index.html +++ b/shadowing-inherited-state-variables/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/signature/index.html b/signature/index.html index 685c680af..ea85881bd 100644 --- a/signature/index.html +++ b/signature/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/state-variables/index.html b/state-variables/index.html index 685c680af..ea85881bd 100644 --- a/state-variables/index.html +++ b/state-variables/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/structs/index.html b/structs/index.html index 685c680af..ea85881bd 100644 --- a/structs/index.html +++ b/structs/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/super/index.html b/super/index.html index 685c680af..ea85881bd 100644 --- a/super/index.html +++ b/super/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/tests/echidna/index.html b/tests/echidna/index.html index 685c680af..ea85881bd 100644 --- a/tests/echidna/index.html +++ b/tests/echidna/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/transient-storage/index.html b/transient-storage/index.html index 685c680af..ea85881bd 100644 --- a/transient-storage/index.html +++ b/transient-storage/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/try-catch/index.html b/try-catch/index.html index 685c680af..ea85881bd 100644 --- a/try-catch/index.html +++ b/try-catch/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/unchecked-math/index.html b/unchecked-math/index.html index 685c680af..ea85881bd 100644 --- a/unchecked-math/index.html +++ b/unchecked-math/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/user-defined-value-types/index.html b/user-defined-value-types/index.html index 685c680af..ea85881bd 100644 --- a/user-defined-value-types/index.html +++ b/user-defined-value-types/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/variables/index.html b/variables/index.html index 685c680af..ea85881bd 100644 --- a/variables/index.html +++ b/variables/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/view-and-pure-functions/index.html b/view-and-pure-functions/index.html index 685c680af..ea85881bd 100644 --- a/view-and-pure-functions/index.html +++ b/view-and-pure-functions/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/visibility/index.html b/visibility/index.html index 685c680af..ea85881bd 100644 --- a/visibility/index.html +++ b/visibility/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + +