From 0d13b08067faa7e3b5c4f34a1df84a2cfcc4f51c Mon Sep 17 00:00:00 2001 From: t4sk Date: Sun, 12 May 2024 15:11:10 +0900 Subject: [PATCH] Updates --- 404.html | 4 +- abi-decode/index.html | 4 +- abi-encode/index.html | 4 +- app/assembly-bin-exp/index.html | 4 +- app/bi-directional-payment-channel/index.html | 4 +- app/create2/index.html | 4 +- app/crowd-fund/index.html | 4 +- app/deploy-any-contract/index.html | 4 +- app/dutch-auction/index.html | 4 +- app/english-auction/index.html | 4 +- app/erc1155/index.html | 4 +- app/erc20/index.html | 4 +- app/erc721/index.html | 4 +- app/ether-wallet/index.html | 4 +- app/gasless-token-transfer/index.html | 4 +- app/iterable-mapping/index.html | 4 +- app/merkle-tree/index.html | 4 +- app/minimal-proxy/index.html | 4 +- app/multi-call/index.html | 4 +- app/multi-delegatecall/index.html | 4 +- app/multi-sig-wallet/index.html | 4 +- app/simple-bytecode-contract/index.html | 4 +- app/time-lock/index.html | 4 +- .../index.html | 4 +- app/upgradeable-proxy/index.html | 4 +- app/write-to-any-slot/index.html | 4 +- array/index.html | 4 +- assembly-error/index.html | 4 +- assembly-if/index.html | 4 +- assembly-loop/index.html | 4 +- assembly-math/index.html | 4 +- assembly-variable/index.html | 4 +- ...cord-akqDA9xj.png => discord-BqSoMD3G.png} | Bin ...{index-kX5Eg0dF.css => index-CRfkSDR0.css} | 0 .../{index-fo9ufR1Y.js => index-c8uSEX4g.js} | 266 +++++++++--------- ...ram-zGrx4xca.png => telegram-DMavHjFx.png} | Bin bitwise/index.html | 4 +- call/index.html | 4 +- calling-contract/index.html | 4 +- constants/index.html | 4 +- constructor/index.html | 4 +- data-locations/index.html | 4 +- defi/chainlink-price-oracle/index.html | 4 +- defi/constant-product-amm/index.html | 4 +- defi/constant-sum-amm/index.html | 4 +- defi/dai-proxy/index.html | 4 +- defi/discrete-staking-rewards/index.html | 4 +- defi/stable-swap-amm/index.html | 4 +- defi/staking-rewards/index.html | 4 +- .../index.html | 4 +- defi/uniswap-v2-flash-swap/index.html | 4 +- .../index.html | 4 +- defi/uniswap-v2/index.html | 4 +- defi/uniswap-v3-flash-swap/index.html | 4 +- defi/uniswap-v3-flash/index.html | 4 +- defi/uniswap-v3-liquidity/index.html | 4 +- defi/uniswap-v3-swap/index.html | 4 +- defi/vault/index.html | 4 +- delegatecall/index.html | 4 +- enum/index.html | 4 +- error/index.html | 4 +- ether-units/index.html | 4 +- events/index.html | 4 +- evm/memory/index.html | 4 +- evm/storage/index.html | 4 +- fallback/index.html | 4 +- first-app/index.html | 4 +- function-modifier/index.html | 4 +- function-selector/index.html | 4 +- function/index.html | 4 +- gas-golf/index.html | 4 +- gas/index.html | 4 +- hacks/accessing-private-data/index.html | 4 +- hacks/block-timestamp-manipulation/index.html | 4 +- hacks/contract-size/index.html | 4 +- hacks/delegatecall/index.html | 4 +- hacks/denial-of-service/index.html | 4 +- .../index.html | 4 +- hacks/front-running/index.html | 4 +- .../index.html | 4 +- hacks/honeypot/index.html | 4 +- hacks/overflow/index.html | 4 +- hacks/phishing-with-tx-origin/index.html | 4 +- hacks/randomness/index.html | 4 +- hacks/re-entrancy/index.html | 4 +- hacks/self-destruct/index.html | 4 +- hacks/signature-replay/index.html | 4 +- hacks/vault-inflation/index.html | 4 +- hacks/weth-permit/index.html | 4 +- hashing/index.html | 4 +- hello-world/index.html | 4 +- if-else/index.html | 4 +- immutable/index.html | 4 +- import/index.html | 4 +- index.html | 4 +- inheritance/index.html | 4 +- interface/index.html | 4 +- library/index.html | 4 +- loop/index.html | 4 +- mapping/index.html | 4 +- new-contract/index.html | 4 +- payable/index.html | 4 +- primitives/index.html | 4 +- sending-ether/index.html | 4 +- .../index.html | 4 +- signature/index.html | 4 +- state-variables/index.html | 4 +- structs/index.html | 4 +- super/index.html | 4 +- tests/echidna/index.html | 4 +- transient-storage/index.html | 4 +- try-catch/index.html | 4 +- unchecked-math/index.html | 4 +- variables/index.html | 4 +- view-and-pure-functions/index.html | 4 +- visibility/index.html | 4 +- 116 files changed, 357 insertions(+), 357 deletions(-) rename assets/{discord-akqDA9xj.png => discord-BqSoMD3G.png} (100%) rename assets/{index-kX5Eg0dF.css => index-CRfkSDR0.css} (100%) rename assets/{index-fo9ufR1Y.js => index-c8uSEX4g.js} (94%) rename assets/{telegram-zGrx4xca.png => telegram-DMavHjFx.png} (100%) diff --git a/404.html b/404.html index e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 100644 --- a/abi-encode/index.html +++ b/abi-encode/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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 100644 --- a/assembly-variable/index.html +++ b/assembly-variable/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/assets/discord-akqDA9xj.png b/assets/discord-BqSoMD3G.png similarity index 100% rename from assets/discord-akqDA9xj.png rename to assets/discord-BqSoMD3G.png diff --git a/assets/index-kX5Eg0dF.css b/assets/index-CRfkSDR0.css similarity index 100% rename from assets/index-kX5Eg0dF.css rename to assets/index-CRfkSDR0.css diff --git a/assets/index-fo9ufR1Y.js b/assets/index-c8uSEX4g.js similarity index 94% rename from assets/index-fo9ufR1Y.js rename to assets/index-c8uSEX4g.js index d7d51c1f2..f3fc0affa 100644 --- a/assets/index-fo9ufR1Y.js +++ b/assets/index-c8uSEX4g.js @@ -1,4 +1,4 @@ -function yg(s,a){for(var n=0;nl[p]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))l(p);new MutationObserver(p=>{for(const e of p)if(e.type==="childList")for(const c of e.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function n(p){const e={};return p.integrity&&(e.integrity=p.integrity),p.referrerPolicy&&(e.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?e.credentials="include":p.crossOrigin==="anonymous"?e.credentials="omit":e.credentials="same-origin",e}function l(p){if(p.ep)return;p.ep=!0;const e=n(p);fetch(p.href,e)}})();var Il=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ko(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Mo={exports:{}},jp={},So={exports:{}},v={};/** +function yg(s,a){for(var n=0;nl[p]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))l(p);new MutationObserver(p=>{for(const e of p)if(e.type==="childList")for(const c of e.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function n(p){const e={};return p.integrity&&(e.integrity=p.integrity),p.referrerPolicy&&(e.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?e.credentials="include":p.crossOrigin==="anonymous"?e.credentials="omit":e.credentials="same-origin",e}function l(p){if(p.ep)return;p.ep=!0;const e=n(p);fetch(p.href,e)}})();var Il=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fo(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ko={exports:{}},jp={},Mo={exports:{}},v={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function yg(s,a){for(var n=0;n>>1,$=f[T];if(0>>1;Tp(Mp,X))ka<$&&0>p(hl,Mp)?(f[T]=hl,f[ka]=X,T=ka):(f[T]=Mp,f[wa]=X,T=wa);else if(ka<$&&0>p(hl,X))f[T]=hl,f[ka]=X,T=ka;else break s}}return R}function p(f,R){var X=f.sortIndex-R.sortIndex;return X!==0?X:f.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var e=performance;s.unstable_now=function(){return e.now()}}else{var c=Date,t=c.now();s.unstable_now=function(){return c.now()-t}}var o=[],i=[],I=1,d=null,j=3,A=!1,m=!1,b=!1,B=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(f){for(var R=n(i);R!==null;){if(R.callback===null)l(i);else if(R.startTime<=f)l(i),R.sortIndex=R.expirationTime,a(o,R);else break;R=n(i)}}function y(f){if(b=!1,C(f),!m)if(n(o)!==null)m=!0,Fp(Z);else{var R=n(i);R!==null&&Kp(y,R.startTime-f)}}function Z(f,R){m=!1,b&&(b=!1,h(Y),Y=-1),A=!0;var X=j;try{for(C(R),d=n(o);d!==null&&(!(d.expirationTime>R)||f&&!Rs());){var T=d.callback;if(typeof T=="function"){d.callback=null,j=d.priorityLevel;var $=T(d.expirationTime<=R);R=s.unstable_now(),typeof $=="function"?d.callback=$:d===n(o)&&l(o),C(R)}else l(o);d=n(o)}if(d!==null)var gl=!0;else{var wa=n(i);wa!==null&&Kp(y,wa.startTime-R),gl=!1}return gl}finally{d=null,j=X,A=!1}}var k=!1,G=null,Y=-1,x=5,N=-1;function Rs(){return!(s.unstable_now()-Nf||125T?(f.sortIndex=X,a(i,f),n(o)===null&&f===n(i)&&(b?(h(Y),Y=-1):b=!0,Kp(y,X-T))):(f.sortIndex=$,a(o,f),m||A||(m=!0,Fp(Z))),f},s.unstable_shouldYield=Rs,s.unstable_wrapCallback=function(f){var R=j;return function(){var X=j;j=R;try{return f.apply(this,arguments)}finally{j=X}}}})(Po);Oo.exports=Po;var zg=Oo.exports;/** + */(function(s){function a(f,R){var X=f.length;f.push(R);s:for(;0>>1,$=f[T];if(0>>1;Tp(Mp,X))ka<$&&0>p(hl,Mp)?(f[T]=hl,f[ka]=X,T=ka):(f[T]=Mp,f[wa]=X,T=wa);else if(ka<$&&0>p(hl,X))f[T]=hl,f[ka]=X,T=ka;else break s}}return R}function p(f,R){var X=f.sortIndex-R.sortIndex;return X!==0?X:f.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var e=performance;s.unstable_now=function(){return e.now()}}else{var c=Date,t=c.now();s.unstable_now=function(){return c.now()-t}}var o=[],i=[],I=1,d=null,j=3,u=!1,m=!1,b=!1,Z=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(f){for(var R=n(i);R!==null;){if(R.callback===null)l(i);else if(R.startTime<=f)l(i),R.sortIndex=R.expirationTime,a(o,R);else break;R=n(i)}}function y(f){if(b=!1,C(f),!m)if(n(o)!==null)m=!0,Fp(W);else{var R=n(i);R!==null&&Kp(y,R.startTime-f)}}function W(f,R){m=!1,b&&(b=!1,h(Y),Y=-1),u=!0;var X=j;try{for(C(R),d=n(o);d!==null&&(!(d.expirationTime>R)||f&&!Rs());){var T=d.callback;if(typeof T=="function"){d.callback=null,j=d.priorityLevel;var $=T(d.expirationTime<=R);R=s.unstable_now(),typeof $=="function"?d.callback=$:d===n(o)&&l(o),C(R)}else l(o);d=n(o)}if(d!==null)var gl=!0;else{var wa=n(i);wa!==null&&Kp(y,wa.startTime-R),gl=!1}return gl}finally{d=null,j=X,u=!1}}var k=!1,G=null,Y=-1,x=5,N=-1;function Rs(){return!(s.unstable_now()-Nf||125T?(f.sortIndex=X,a(i,f),n(o)===null&&f===n(i)&&(b?(h(Y),Y=-1):b=!0,Kp(y,X-T))):(f.sortIndex=$,a(o,f),m||u||(m=!0,Fp(W))),f},s.unstable_shouldYield=Rs,s.unstable_wrapCallback=function(f){var R=j;return function(){var X=j;j=R;try{return f.apply(this,arguments)}finally{j=X}}}})(Oo);Lo.exports=Oo;var zg=Lo.exports;/** * @license React * react-dom.production.min.js * @@ -30,15 +30,15 @@ function yg(s,a){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ce=Object.prototype.hasOwnProperty,Dg=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,It={},dt={};function Eg(s){return Ce.call(dt,s)?!0:Ce.call(It,s)?!1:Dg.test(s)?dt[s]=!0:(It[s]=!0,!1)}function Qg(s,a,n,l){if(n!==null&&n.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return l?!1:n!==null?!n.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function Tg(s,a,n,l){if(a===null||typeof a>"u"||Qg(s,a,n,l))return!0;if(l)return!1;if(n!==null)switch(n.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function hs(s,a,n,l,p,e,c){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=l,this.attributeNamespace=p,this.mustUseProperty=n,this.propertyName=s,this.type=a,this.sanitizeURL=e,this.removeEmptyString=c}var ps={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){ps[s]=new hs(s,0,!1,s,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var a=s[0];ps[a]=new hs(a,1,!1,s[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(s){ps[s]=new hs(s,2,!1,s.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){ps[s]=new hs(s,2,!1,s,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){ps[s]=new hs(s,3,!1,s.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(s){ps[s]=new hs(s,3,!0,s,null,!1,!1)});["capture","download"].forEach(function(s){ps[s]=new hs(s,4,!1,s,null,!1,!1)});["cols","rows","size","span"].forEach(function(s){ps[s]=new hs(s,6,!1,s,null,!1,!1)});["rowSpan","start"].forEach(function(s){ps[s]=new hs(s,5,!1,s.toLowerCase(),null,!1,!1)});var Cc=/[\-:]([a-z])/g;function jc(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var a=s.replace(Cc,jc);ps[a]=new hs(a,1,!1,s,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var a=s.replace(Cc,jc);ps[a]=new hs(a,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(s){var a=s.replace(Cc,jc);ps[a]=new hs(a,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(s){ps[s]=new hs(s,1,!1,s.toLowerCase(),null,!1,!1)});ps.xlinkHref=new hs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(s){ps[s]=new hs(s,1,!1,s.toLowerCase(),null,!0,!0)});function uc(s,a,n,l){var p=ps.hasOwnProperty(a)?ps[a]:null;(p!==null?p.type!==0:l||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ce=Object.prototype.hasOwnProperty,Dg=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ht={},It={};function Eg(s){return Ce.call(It,s)?!0:Ce.call(ht,s)?!1:Dg.test(s)?It[s]=!0:(ht[s]=!0,!1)}function Qg(s,a,n,l){if(n!==null&&n.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return l?!1:n!==null?!n.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function Tg(s,a,n,l){if(a===null||typeof a>"u"||Qg(s,a,n,l))return!0;if(l)return!1;if(n!==null)switch(n.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function hs(s,a,n,l,p,e,c){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=l,this.attributeNamespace=p,this.mustUseProperty=n,this.propertyName=s,this.type=a,this.sanitizeURL=e,this.removeEmptyString=c}var ps={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){ps[s]=new hs(s,0,!1,s,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var a=s[0];ps[a]=new hs(a,1,!1,s[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(s){ps[s]=new hs(s,2,!1,s.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){ps[s]=new hs(s,2,!1,s,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){ps[s]=new hs(s,3,!1,s.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(s){ps[s]=new hs(s,3,!0,s,null,!1,!1)});["capture","download"].forEach(function(s){ps[s]=new hs(s,4,!1,s,null,!1,!1)});["cols","rows","size","span"].forEach(function(s){ps[s]=new hs(s,6,!1,s,null,!1,!1)});["rowSpan","start"].forEach(function(s){ps[s]=new hs(s,5,!1,s.toLowerCase(),null,!1,!1)});var Cc=/[\-:]([a-z])/g;function jc(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var a=s.replace(Cc,jc);ps[a]=new hs(a,1,!1,s,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var a=s.replace(Cc,jc);ps[a]=new hs(a,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(s){var a=s.replace(Cc,jc);ps[a]=new hs(a,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(s){ps[s]=new hs(s,1,!1,s.toLowerCase(),null,!1,!1)});ps.xlinkHref=new hs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(s){ps[s]=new hs(s,1,!1,s.toLowerCase(),null,!0,!0)});function Ac(s,a,n,l){var p=ps.hasOwnProperty(a)?ps[a]:null;(p!==null?p.type!==0:l||!(2t||p[c]!==e[t]){var o=` -`+p[c].replace(" at new "," at ");return s.displayName&&o.includes("")&&(o=o.replace("",s.displayName)),o}while(1<=c&&0<=t);break}}}finally{Jp=!1,Error.prepareStackTrace=n}return(s=s?s.displayName||s.name:"")?Vn(s):""}function Ug(s){switch(s.tag){case 5:return Vn(s.type);case 16:return Vn("Lazy");case 13:return Vn("Suspense");case 19:return Vn("SuspenseList");case 0:case 2:case 15:return s=zp(s.type,!1),s;case 11:return s=zp(s.type.render,!1),s;case 1:return s=zp(s.type,!0),s;default:return""}}function ye(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case za:return"Fragment";case Ja:return"Portal";case je:return"Profiler";case Ac:return"StrictMode";case ue:return"Suspense";case Ae:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case ar:return(s.displayName||"Context")+".Consumer";case sr:return(s._context.displayName||"Context")+".Provider";case yc:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case mc:return a=s.displayName||null,a!==null?a:ye(s.type)||"Memo";case na:a=s._payload,s=s._init;try{return ye(s(a))}catch{}}return null}function _g(s){var a=s.type;switch(s.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(a);case 8:return a===Ac?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function ua(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function lr(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Lg(s){var a=lr(s)?"checked":"value",n=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),l=""+s[a];if(!s.hasOwnProperty(a)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var p=n.get,e=n.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return p.call(this)},set:function(c){l=""+c,e.call(this,c)}}),Object.defineProperty(s,a,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function jl(s){s._valueTracker||(s._valueTracker=Lg(s))}function pr(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var n=a.getValue(),l="";return s&&(l=lr(s)?s.checked?"true":"false":s.value),s=l,s!==n?(a.setValue(s),!0):!1}function El(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function me(s,a){var n=a.checked;return E({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??s._wrapperState.initialChecked})}function jt(s,a){var n=a.defaultValue==null?"":a.defaultValue,l=a.checked!=null?a.checked:a.defaultChecked;n=ua(a.value!=null?a.value:n),s._wrapperState={initialChecked:l,initialValue:n,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function er(s,a){a=a.checked,a!=null&&uc(s,"checked",a,!1)}function be(s,a){er(s,a);var n=ua(a.value),l=a.type;if(n!=null)l==="number"?(n===0&&s.value===""||s.value!=n)&&(s.value=""+n):s.value!==""+n&&(s.value=""+n);else if(l==="submit"||l==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?we(s,a.type,n):a.hasOwnProperty("defaultValue")&&we(s,a.type,ua(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function ut(s,a,n){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var l=a.type;if(!(l!=="submit"&&l!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+s._wrapperState.initialValue,n||a===s.value||(s.value=a),s.defaultValue=a}n=s.name,n!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,n!==""&&(s.name=n)}function we(s,a,n){(a!=="number"||El(s.ownerDocument)!==s)&&(n==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+n&&(s.defaultValue=""+n))}var fn=Array.isArray;function qa(s,a,n,l){if(s=s.options,a){a={};for(var p=0;p"+a.valueOf().toString()+"",a=ul.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;a.firstChild;)s.appendChild(a.firstChild)}});function zn(s,a){if(a){var n=s.firstChild;if(n&&n===s.lastChild&&n.nodeType===3){n.nodeValue=a;return}}s.textContent=a}var Xn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Og=["Webkit","ms","Moz","O"];Object.keys(Xn).forEach(function(s){Og.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),Xn[a]=Xn[s]})});function rr(s,a,n){return a==null||typeof a=="boolean"||a===""?"":n||typeof a!="number"||a===0||Xn.hasOwnProperty(s)&&Xn[s]?(""+a).trim():a+"px"}function ir(s,a){s=s.style;for(var n in a)if(a.hasOwnProperty(n)){var l=n.indexOf("--")===0,p=rr(n,a[n],l);n==="float"&&(n="cssFloat"),l?s.setProperty(n,p):s[n]=p}}var Pg=E({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function We(s,a){if(a){if(Pg[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(w(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(w(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(w(61))}if(a.style!=null&&typeof a.style!="object")throw Error(w(62))}}function Be(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ge=null;function bc(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ve=null,sn=null,an=null;function mt(s){if(s=rl(s)){if(typeof Ve!="function")throw Error(w(280));var a=s.stateNode;a&&(a=bp(a),Ve(s.stateNode,s.type,a))}}function gr(s){sn?an?an.push(s):an=[s]:sn=s}function hr(){if(sn){var s=sn,a=an;if(an=sn=null,mt(s),a)for(s=0;s>>=0,s===0?32:31-(oh(s)/rh|0)|0}var Al=64,yl=4194304;function Yn(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function _l(s,a){var n=s.pendingLanes;if(n===0)return 0;var l=0,p=s.suspendedLanes,e=s.pingedLanes,c=n&268435455;if(c!==0){var t=c&~p;t!==0?l=Yn(t):(e&=c,e!==0&&(l=Yn(e)))}else c=n&~p,c!==0?l=Yn(c):e!==0&&(l=Yn(e));if(l===0)return 0;if(a!==0&&a!==l&&!(a&p)&&(p=l&-l,e=a&-a,p>=e||p===16&&(e&4194240)!==0))return a;if(l&4&&(l|=n&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=l;0n;n++)a.push(s);return a}function tl(s,a,n){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-Fs(a),s[a]=n}function Ih(s,a){var n=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var l=s.eventTimes;for(s=s.expirationTimes;0=Nn),ft=" ",Yt=!1;function Xr(s,a){switch(s){case"keyup":return Jh.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vr(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Da=!1;function Dh(s,a){switch(s){case"compositionend":return vr(a);case"keypress":return a.which!==32?null:(Yt=!0,ft);case"textInput":return s=a.data,s===ft&&Yt?null:s;default:return null}}function Eh(s,a){if(Da)return s==="compositionend"||!fc&&Xr(s,a)?(s=Yr(),Hl=Bc=ca=null,Da=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:n,offset:a-s};s=l}s:{for(;n;){if(n.nextSibling){n=n.nextSibling;break s}n=n.parentNode}n=void 0}n=Nt(n)}}function Kr(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?Kr(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function Mr(){for(var s=window,a=El();a instanceof s.HTMLIFrameElement;){try{var n=typeof a.contentWindow.location.href=="string"}catch{n=!1}if(n)s=a.contentWindow;else break;a=El(s.document)}return a}function Yc(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}function qh(s){var a=Mr(),n=s.focusedElem,l=s.selectionRange;if(a!==n&&n&&n.ownerDocument&&Kr(n.ownerDocument.documentElement,n)){if(l!==null&&Yc(n)){if(a=l.start,s=l.end,s===void 0&&(s=a),"selectionStart"in n)n.selectionStart=a,n.selectionEnd=Math.min(s,n.value.length);else if(s=(a=n.ownerDocument||document)&&a.defaultView||window,s.getSelection){s=s.getSelection();var p=n.textContent.length,e=Math.min(l.start,p);l=l.end===void 0?e:Math.min(l.end,p),!s.extend&&e>l&&(p=l,l=e,e=p),p=Ht(n,e);var c=Ht(n,l);p&&c&&(s.rangeCount!==1||s.anchorNode!==p.node||s.anchorOffset!==p.offset||s.focusNode!==c.node||s.focusOffset!==c.offset)&&(a=a.createRange(),a.setStart(p.node,p.offset),s.removeAllRanges(),e>l?(s.addRange(a),s.extend(c.node,c.offset)):(a.setEnd(c.node,c.offset),s.addRange(a)))}}for(a=[],s=n;s=s.parentNode;)s.nodeType===1&&a.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ea=null,Ne=null,Fn=null,He=!1;function Ft(s,a,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;He||Ea==null||Ea!==El(l)||(l=Ea,"selectionStart"in l&&Yc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Fn&&_n(Fn,l)||(Fn=l,l=Pl(Ne,"onSelect"),0Ua||(s.current=Je[Ua],Je[Ua]=null,Ua--)}function K(s,a){Ua++,Je[Ua]=s.current,s.current=a}var Aa={},os=ma(Aa),js=ma(!1),Xa=Aa;function cn(s,a){var n=s.type.contextTypes;if(!n)return Aa;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 us(s){return s=s.childContextTypes,s!=null}function ql(){S(js),S(os)}function Dt(s,a,n){if(os.current!==Aa)throw Error(w(168));K(os,a),K(js,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,_g(s)||"Unknown",p));return E({},n,l)}function sp(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Aa,Xa=os.current,K(os,s),K(js,js.current),!0}function Et(s,a,n){var l=s.stateNode;if(!l)throw Error(w(169));n?(s=Ur(s,a,Xa),l.__reactInternalMemoizedMergedChildContext=s,S(js),S(os),K(os,s)):S(js),K(js,n)}var Qs=null,wp=!1,ne=!1;function _r(s){Qs===null?Qs=[s]:Qs.push(s)}function gI(s){wp=!0,_r(s)}function ba(){if(!ne&&Qs!==null){ne=!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 Rs=j(h,G,N.value,y);if(Rs===null){G===null&&(G=x);break}s&&G&&Rs.alternate===null&&a(h,G),g=e(Rs,g,Y),k===null?Z=Rs:k.sibling=Rs,k=Rs,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=A(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(An){return a(h,An)}),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&&Pt(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=Dl(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=ie(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(fn(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=re(C,h.mode,y),g.return=h,h=g),c(h)):n(h,g)}return B}var on=ni(!0),li=ni(!1),il={},Ds=ma(il),$n=ma(il),qn=ma(il);function Va(s){if(s===il)throw Error(w(174));return s}function Sc(s,a){switch(K(qn,a),K($n,s),K(Ds,il),s=a.nodeType,s){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:Ze(null,"");break;default:s=s===8?a.parentNode:a,a=s.namespaceURI||null,s=s.tagName,a=Ze(a,s)}S(Ds),K(Ds,a)}function rn(){S(Ds),S($n),S(qn)}function pi(s){Va(qn.current);var a=Va(Ds.current),n=Ze(a,s.type);a!==n&&(K($n,s),K(Ds,n))}function xc(s){$n.current===s&&(S(Ds),S($n))}var z=ma(0);function cp(s){for(var a=s;a!==null;){if(a.tag===13){var n=a.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var le=[];function Jc(){for(var s=0;sn?n:4,s(!0);var l=pe.transition;pe.transition={};try{s(!1),a()}finally{F=n,pe.transition=l}}function mi(){return Ys().memoizedState}function CI(s,a,n){var l=Ca(s);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},bi(s))wi(a,n);else if(n=$r(s,a,n,l),n!==null){var p=is();Ks(n,s,l,p),ki(n,a,l)}}function jI(s,a,n){var l=Ca(s),p={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(bi(s))wi(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,Kc(a)):(p.next=o.next,o.next=p),a.interleaved=p;return}}catch{}finally{}n=$r(s,a,p,l),n!==null&&(p=is(),Ks(n,s,l,p),ki(n,a,l))}}function bi(s){var a=s.alternate;return s===D||a!==null&&a===D}function wi(s,a){Kn=tp=!0;var n=s.pending;n===null?a.next=a:(a.next=n.next,n.next=a),s.pending=a}function ki(s,a,n){if(n&4194240){var l=a.lanes;l&=s.pendingLanes,n|=l,a.lanes=n,kc(s,n)}}var op={readContext:fs,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},uI={readContext:fs,useCallback:function(s,a){return xs().memoizedState=[s,a===void 0?null:a],s},useContext:fs,useEffect:qt,useImperativeHandle:function(s,a,n){return n=n!=null?n.concat([s]):null,Sl(4194308,4,Ci.bind(null,a,s),n)},useLayoutEffect:function(s,a){return Sl(4194308,4,s,a)},useInsertionEffect:function(s,a){return Sl(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=CI.bind(null,D,s),[l.memoizedState,s]},useRef:function(s){var a=xs();return s={current:s},a.memoizedState=s},useState:$t,useDebugValue:Tc,useDeferredValue:function(s){return xs().memoizedState=s},useTransition:function(){var s=$t(!1),a=s[0];return s=dI.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||ti(l,a,n)}p.memoizedState=n;var e={value:n,getSnapshot:a};return p.queue=e,qt(ri.bind(null,l,e,s),[s]),l.flags|=2048,nl(9,oi.bind(null,l,e,n,a),void 0,null),n},useId:function(){var s=xs(),a=ss.identifierPrefix;if(J){var n=Us,l=Ts;n=(l&~(1<<32-Fs(l)-1)).toString(32)+n,a=":"+a+"R"+n,n=sl++,0")&&(o=o.replace("",s.displayName)),o}while(1<=c&&0<=t);break}}}finally{Jp=!1,Error.prepareStackTrace=n}return(s=s?s.displayName||s.name:"")?Vn(s):""}function Ug(s){switch(s.tag){case 5:return Vn(s.type);case 16:return Vn("Lazy");case 13:return Vn("Suspense");case 19:return Vn("SuspenseList");case 0:case 2:case 15:return s=zp(s.type,!1),s;case 11:return s=zp(s.type.render,!1),s;case 1:return s=zp(s.type,!0),s;default:return""}}function ye(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case za:return"Fragment";case Ja:return"Portal";case je:return"Profiler";case uc:return"StrictMode";case Ae:return"Suspense";case ue:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case sr:return(s.displayName||"Context")+".Consumer";case qo:return(s._context.displayName||"Context")+".Provider";case yc:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case mc:return a=s.displayName||null,a!==null?a:ye(s.type)||"Memo";case na:a=s._payload,s=s._init;try{return ye(s(a))}catch{}}return null}function _g(s){var a=s.type;switch(s.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(a);case 8:return a===uc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function Aa(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function nr(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Lg(s){var a=nr(s)?"checked":"value",n=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),l=""+s[a];if(!s.hasOwnProperty(a)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var p=n.get,e=n.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return p.call(this)},set:function(c){l=""+c,e.call(this,c)}}),Object.defineProperty(s,a,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function jl(s){s._valueTracker||(s._valueTracker=Lg(s))}function lr(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var n=a.getValue(),l="";return s&&(l=nr(s)?s.checked?"true":"false":s.value),s=l,s!==n?(a.setValue(s),!0):!1}function El(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function me(s,a){var n=a.checked;return E({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??s._wrapperState.initialChecked})}function Ct(s,a){var n=a.defaultValue==null?"":a.defaultValue,l=a.checked!=null?a.checked:a.defaultChecked;n=Aa(a.value!=null?a.value:n),s._wrapperState={initialChecked:l,initialValue:n,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function pr(s,a){a=a.checked,a!=null&&Ac(s,"checked",a,!1)}function be(s,a){pr(s,a);var n=Aa(a.value),l=a.type;if(n!=null)l==="number"?(n===0&&s.value===""||s.value!=n)&&(s.value=""+n):s.value!==""+n&&(s.value=""+n);else if(l==="submit"||l==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?we(s,a.type,n):a.hasOwnProperty("defaultValue")&&we(s,a.type,Aa(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function jt(s,a,n){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var l=a.type;if(!(l!=="submit"&&l!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+s._wrapperState.initialValue,n||a===s.value||(s.value=a),s.defaultValue=a}n=s.name,n!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,n!==""&&(s.name=n)}function we(s,a,n){(a!=="number"||El(s.ownerDocument)!==s)&&(n==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+n&&(s.defaultValue=""+n))}var fn=Array.isArray;function qa(s,a,n,l){if(s=s.options,a){a={};for(var p=0;p"+a.valueOf().toString()+"",a=Al.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;a.firstChild;)s.appendChild(a.firstChild)}});function zn(s,a){if(a){var n=s.firstChild;if(n&&n===s.lastChild&&n.nodeType===3){n.nodeValue=a;return}}s.textContent=a}var Xn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Og=["Webkit","ms","Moz","O"];Object.keys(Xn).forEach(function(s){Og.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),Xn[a]=Xn[s]})});function or(s,a,n){return a==null||typeof a=="boolean"||a===""?"":n||typeof a!="number"||a===0||Xn.hasOwnProperty(s)&&Xn[s]?(""+a).trim():a+"px"}function rr(s,a){s=s.style;for(var n in a)if(a.hasOwnProperty(n)){var l=n.indexOf("--")===0,p=or(n,a[n],l);n==="float"&&(n="cssFloat"),l?s.setProperty(n,p):s[n]=p}}var Pg=E({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function We(s,a){if(a){if(Pg[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(w(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(w(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(w(61))}if(a.style!=null&&typeof a.style!="object")throw Error(w(62))}}function Be(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ge=null;function bc(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ve=null,sn=null,an=null;function yt(s){if(s=rl(s)){if(typeof Ve!="function")throw Error(w(280));var a=s.stateNode;a&&(a=bp(a),Ve(s.stateNode,s.type,a))}}function ir(s){sn?an?an.push(s):an=[s]:sn=s}function gr(){if(sn){var s=sn,a=an;if(an=sn=null,yt(s),a)for(s=0;s>>=0,s===0?32:31-(oh(s)/rh|0)|0}var ul=64,yl=4194304;function Yn(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function _l(s,a){var n=s.pendingLanes;if(n===0)return 0;var l=0,p=s.suspendedLanes,e=s.pingedLanes,c=n&268435455;if(c!==0){var t=c&~p;t!==0?l=Yn(t):(e&=c,e!==0&&(l=Yn(e)))}else c=n&~p,c!==0?l=Yn(c):e!==0&&(l=Yn(e));if(l===0)return 0;if(a!==0&&a!==l&&!(a&p)&&(p=l&-l,e=a&-a,p>=e||p===16&&(e&4194240)!==0))return a;if(l&4&&(l|=n&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=l;0n;n++)a.push(s);return a}function tl(s,a,n){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-Fs(a),s[a]=n}function Ih(s,a){var n=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var l=s.eventTimes;for(s=s.expirationTimes;0=Nn),Vt=" ",ft=!1;function Rr(s,a){switch(s){case"keyup":return Jh.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xr(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Da=!1;function Dh(s,a){switch(s){case"compositionend":return Xr(a);case"keypress":return a.which!==32?null:(ft=!0,Vt);case"textInput":return s=a.data,s===Vt&&ft?null:s;default:return null}}function Eh(s,a){if(Da)return s==="compositionend"||!fc&&Rr(s,a)?(s=fr(),Hl=Bc=ca=null,Da=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:n,offset:a-s};s=l}s:{for(;n;){if(n.nextSibling){n=n.nextSibling;break s}n=n.parentNode}n=void 0}n=vt(n)}}function Fr(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?Fr(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function Kr(){for(var s=window,a=El();a instanceof s.HTMLIFrameElement;){try{var n=typeof a.contentWindow.location.href=="string"}catch{n=!1}if(n)s=a.contentWindow;else break;a=El(s.document)}return a}function Yc(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}function qh(s){var a=Kr(),n=s.focusedElem,l=s.selectionRange;if(a!==n&&n&&n.ownerDocument&&Fr(n.ownerDocument.documentElement,n)){if(l!==null&&Yc(n)){if(a=l.start,s=l.end,s===void 0&&(s=a),"selectionStart"in n)n.selectionStart=a,n.selectionEnd=Math.min(s,n.value.length);else if(s=(a=n.ownerDocument||document)&&a.defaultView||window,s.getSelection){s=s.getSelection();var p=n.textContent.length,e=Math.min(l.start,p);l=l.end===void 0?e:Math.min(l.end,p),!s.extend&&e>l&&(p=l,l=e,e=p),p=Nt(n,e);var c=Nt(n,l);p&&c&&(s.rangeCount!==1||s.anchorNode!==p.node||s.anchorOffset!==p.offset||s.focusNode!==c.node||s.focusOffset!==c.offset)&&(a=a.createRange(),a.setStart(p.node,p.offset),s.removeAllRanges(),e>l?(s.addRange(a),s.extend(c.node,c.offset)):(a.setEnd(c.node,c.offset),s.addRange(a)))}}for(a=[],s=n;s=s.parentNode;)s.nodeType===1&&a.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ea=null,Ne=null,Fn=null,He=!1;function Ht(s,a,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;He||Ea==null||Ea!==El(l)||(l=Ea,"selectionStart"in l&&Yc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Fn&&_n(Fn,l)||(Fn=l,l=Pl(Ne,"onSelect"),0Ua||(s.current=Je[Ua],Je[Ua]=null,Ua--)}function K(s,a){Ua++,Je[Ua]=s.current,s.current=a}var ua={},os=ma(ua),js=ma(!1),Xa=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 As(s){return s=s.childContextTypes,s!=null}function ql(){S(js),S(os)}function zt(s,a,n){if(os.current!==ua)throw Error(w(168));K(os,a),K(js,n)}function Tr(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,_g(s)||"Unknown",p));return E({},n,l)}function sp(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ua,Xa=os.current,K(os,s),K(js,js.current),!0}function Dt(s,a,n){var l=s.stateNode;if(!l)throw Error(w(169));n?(s=Tr(s,a,Xa),l.__reactInternalMemoizedMergedChildContext=s,S(js),S(os),K(os,s)):S(js),K(js,n)}var Qs=null,wp=!1,ne=!1;function Ur(s){Qs===null?Qs=[s]:Qs.push(s)}function gI(s){wp=!0,Ur(s)}function ba(){if(!ne&&Qs!==null){ne=!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?W=N:k.sibling=N,k=N,G=x}if(Y===C.length)return n(h,G),J&&Za(h,Y),W;if(G===null){for(;YY?(x=G,G=null):x=G.sibling;var Rs=j(h,G,N.value,y);if(Rs===null){G===null&&(G=x);break}s&&G&&Rs.alternate===null&&a(h,G),g=e(Rs,g,Y),k===null?W=Rs:k.sibling=Rs,k=Rs,G=x}if(N.done)return n(h,G),J&&Za(h,Y),W;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?W=N:k.sibling=N,k=N);return J&&Za(h,Y),W}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?W=N:k.sibling=N,k=N);return s&&G.forEach(function(un){return a(h,un)}),J&&Za(h,Y),W}function Z(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 W=C.key,k=g;k!==null;){if(k.key===W){if(W=C.type,W===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===W||typeof W=="object"&&W!==null&&W.$$typeof===na&&Ot(W)===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=Dl(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=ie(C,h.mode,y),g.return=h,h=g}return c(h);case na:return k=C._init,Z(h,g,k(C._payload),y)}if(fn(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=re(C,h.mode,y),g.return=h,h=g),c(h)):n(h,g)}return Z}var on=ai(!0),ni=ai(!1),il={},Ds=ma(il),$n=ma(il),qn=ma(il);function Va(s){if(s===il)throw Error(w(174));return s}function Sc(s,a){switch(K(qn,a),K($n,s),K(Ds,il),s=a.nodeType,s){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:Ze(null,"");break;default:s=s===8?a.parentNode:a,a=s.namespaceURI||null,s=s.tagName,a=Ze(a,s)}S(Ds),K(Ds,a)}function rn(){S(Ds),S($n),S(qn)}function li(s){Va(qn.current);var a=Va(Ds.current),n=Ze(a,s.type);a!==n&&(K($n,s),K(Ds,n))}function xc(s){$n.current===s&&(S(Ds),S($n))}var z=ma(0);function cp(s){for(var a=s;a!==null;){if(a.tag===13){var n=a.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var le=[];function Jc(){for(var s=0;sn?n:4,s(!0);var l=pe.transition;pe.transition={};try{s(!1),a()}finally{F=n,pe.transition=l}}function yi(){return Ys().memoizedState}function CI(s,a,n){var l=Ca(s);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},mi(s))bi(a,n);else if(n=Pr(s,a,n,l),n!==null){var p=is();Ks(n,s,l,p),wi(n,a,l)}}function jI(s,a,n){var l=Ca(s),p={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(mi(s))bi(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,Kc(a)):(p.next=o.next,o.next=p),a.interleaved=p;return}}catch{}finally{}n=Pr(s,a,p,l),n!==null&&(p=is(),Ks(n,s,l,p),wi(n,a,l))}}function mi(s){var a=s.alternate;return s===D||a!==null&&a===D}function bi(s,a){Kn=tp=!0;var n=s.pending;n===null?a.next=a:(a.next=n.next,n.next=a),s.pending=a}function wi(s,a,n){if(n&4194240){var l=a.lanes;l&=s.pendingLanes,n|=l,a.lanes=n,kc(s,n)}}var op={readContext:fs,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},AI={readContext:fs,useCallback:function(s,a){return xs().memoizedState=[s,a===void 0?null:a],s},useContext:fs,useEffect:$t,useImperativeHandle:function(s,a,n){return n=n!=null?n.concat([s]):null,Sl(4194308,4,di.bind(null,a,s),n)},useLayoutEffect:function(s,a){return Sl(4194308,4,s,a)},useInsertionEffect:function(s,a){return Sl(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=CI.bind(null,D,s),[l.memoizedState,s]},useRef:function(s){var a=xs();return s={current:s},a.memoizedState=s},useState:Pt,useDebugValue:Tc,useDeferredValue:function(s){return xs().memoizedState=s},useTransition:function(){var s=Pt(!1),a=s[0];return s=dI.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||ci(l,a,n)}p.memoizedState=n;var e={value:n,getSnapshot:a};return p.queue=e,$t(oi.bind(null,l,e,s),[s]),l.flags|=2048,nl(9,ti.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=cp(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 $c(),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 WI(s,a){switch(Xc(a),a.tag){case 1:return us(a.type)&&ql(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return rn(),S(js),S(os),Jc(),s=a.flags,s&65536&&!(s&128)?(a.flags=s&-65537|128,a):null;case 5:return xc(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 Fc(a.type._context),null;case 22:case 23:return $c(),null;case 24:return null;default:return null}}var Vl=!1,ts=!1,BI=typeof WeakSet=="function"?WeakSet:Set,V=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 oo=!1;function GI(s,a){if(Fe=Ll,s=Mr(),Yc(s)){if("selectionStart"in s)var n={start:s.selectionStart,end:s.selectionEnd};else s:{n=(n=s.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var p=l.anchorOffset,e=l.focusNode;l=l.focusOffset;try{n.nodeType,e.nodeType}catch{n=null;break s}var c=0,t=-1,o=-1,i=0,I=0,d=s,j=null;a:for(;;){for(var A;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),(A=d.firstChild)!==null;)j=d,d=A;for(;;){if(d===s)break a;if(j===n&&++i===p&&(t=c),j===e&&++I===l&&(o=c),(A=d.nextSibling)!==null)break;d=j,j=d.parentNode}d=A}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},Ll=!1,V=a;V!==null;)if(a=V,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,V=s;else for(;V!==null;){a=V;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:vs(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,V=s;break}V=a.return}return m=oo,oo=!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 Wp(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 Hi(s){var a=s.alternate;a!==null&&(s.alternate=null,Hi(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[rI],delete a[iI])),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 Fi(s){return s.tag===5||s.tag===3||s.tag===4}function ro(s){s:for(;;){for(;s.sibling===null;){if(s.return===null||Fi(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=$l));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;)Ki(s,a,n),n=n.sibling}function Ki(s,a,n){if(zs&&typeof zs.onCommitFiberUnmount=="function")try{zs.onCommitFiberUnmount(up,n)}catch{}switch(n.tag){case 5:ts||Pa(n,a);case 6:var l=ns,p=Ns;ns=null,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?ae(s.parentNode,n):s.nodeType===1&&ae(s,n),Tn(s)):ae(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 io(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var n=s.stateNode;n===null&&(n=s.stateNode=new BI),a.forEach(function(l){var p=FI.bind(null,s,l);n.has(l)||(n.add(l),l.then(p,p))})}}function Xs(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,gp=0,H&6)throw Error(w(331));var p=H;for(H|=4,V=s.current;V!==null;){var e=V,c=e.child;if(V.flags&16){var t=e.deletions;if(t!==null){for(var o=0;oU()-Oc?fa(s,0):Lc|=n),As(s,a)}function Qi(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 HI(s){var a=s.memoizedState,n=0;a!==null&&(n=a.retryLane),Qi(s,n)}function FI(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),Qi(s,n)}var Ti;Ti=function(s,a,n){if(s!==null)if(s.memoizedProps!==a.pendingProps||js.current)Cs=!0;else{if(!(s.lanes&n)&&!(a.flags&128))return Cs=!1,kI(s,a,n);Cs=!!(s.flags&131072)}else Cs=!1,J&&a.flags&1048576&&Lr(a,np,a.index);switch(a.lanes=0,a.tag){case 2:var l=a.type;xl(s,a),s=a.pendingProps;var p=cn(a,os.current);ln(a,n),p=Dc(null,a,l,s,p,n);var e=Ec();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,us(l)?(e=!0,sp(a)):e=!1,a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,Mc(a),p.updater=kp,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(xl(s,a),s=a.pendingProps,p=l._init,l=p(l._payload),a.type=l,p=a.tag=MI(l),s=vs(l,s),p){case 0:a=_e(null,a,l,s,n);break s;case 1:a=eo(null,a,l,s,n);break s;case 11:a=lo(null,a,l,s,n);break s;case 14:a=po(null,a,l,vs(l.type,s),n);break s}throw Error(w(306,l,""))}return a;case 0:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),_e(s,a,l,p,n);case 1:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),eo(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,qr(s,a),ep(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=co(s,a,l,n,p);break s}else if(l!==p){p=gn(Error(w(424)),a),a=co(s,a,l,n,p);break s}else for(ms=ha(a.stateNode.containerInfo.firstChild),bs=a,J=!0,Hs=null,n=li(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 pi(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),Vi(s,a),rs(s,a,c,n),a.child;case 6:return s===null&&De(a),null;case 13:return Yi(s,a,n);case 4:return Sc(a,a.stateNode.containerInfo),l=a.pendingProps,s===null?a.child=on(a,null,l,n):rs(s,a,l,n),a.child;case 11:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),lo(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(lp,l._currentValue),l._currentValue=c,e!==null)if(Ms(e.value,c)){if(e.children===p.children&&!js.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 i=e.updateQueue;if(i!==null){i=i.shared;var I=i.pending;I===null?o.next=o:(o.next=I.next,I.next=o),i.pending=o}}e.lanes|=n,o=e.alternate,o!==null&&(o.lanes|=n),Ee(e.return,n,a),t.lanes|=n;break}o=o.next}}else if(e.tag===10)c=e.type===a.type?null:e.child;else if(e.tag===18){if(c=e.return,c===null)throw Error(w(341));c.lanes|=n,t=c.alternate,t!==null&&(t.lanes|=n),Ee(c,n,a),c=e.sibling}else c=e.child;if(c!==null)c.return=e;else for(c=e;c!==null;){if(c===a){c=null;break}if(e=c.sibling,e!==null){e.return=c.return,c=e;break}c=c.return}e=c}rs(s,a,p.children,n),a=a.child}return a;case 9:return p=a.type,l=a.pendingProps.children,ln(a,n),p=fs(p),l=l(p),a.flags|=1,rs(s,a,l,n),a.child;case 14:return l=a.type,p=vs(l,a.pendingProps),p=vs(l.type,p),po(s,a,l,p,n);case 15:return Bi(s,a,a.type,a.pendingProps,n);case 17:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),xl(s,a),a.tag=1,us(l)?(s=!0,sp(a)):s=!1,ln(a,n),ai(a,l,p),Te(a,l,p,n),Le(null,a,l,!0,s,n);case 19:return Ri(s,a,n);case 22:return Gi(s,a,n)}throw Error(w(156,a.tag))};function Ui(s,a){return yr(s,a)}function KI(s,a,n,l){this.tag=s,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gs(s,a,n,l){return new KI(s,a,n,l)}function st(s){return s=s.prototype,!(!s||!s.isReactComponent)}function MI(s){if(typeof s=="function")return st(s)?1:0;if(s!=null){if(s=s.$$typeof,s===yc)return 11;if(s===mc)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 Dl(s,a,n,l,p,e){var c=2;if(l=s,typeof s=="function")st(s)&&(c=1);else if(typeof s=="string")c=5;else s:switch(s){case za:return Ya(n.children,p,e,a);case Ac:c=8,p|=8;break;case je:return s=Gs(12,n,a,p|2),s.elementType=je,s.lanes=e,s;case ue:return s=Gs(13,n,a,p),s.elementType=ue,s.lanes=e,s;case Ae:return s=Gs(19,n,a,p),s.elementType=Ae,s.lanes=e,s;case nr:return Gp(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 yc:c=11;break s;case mc: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 Gp(s,a,n,l){return s=Gs(22,s,l,a),s.elementType=nr,s.lanes=n,s.stateNode={isHidden:!1},s}function re(s,a,n){return s=Gs(6,s,null,a),s.lanes=n,s}function ie(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 SI(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=Ep(0),this.expirationTimes=Ep(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ep(0),this.identifierPrefix=l,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function at(s,a,n,l,p,e,c,t,o){return s=new SI(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},Mc(e),s}function xI(s,a,n){var l=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pi)}catch(s){console.error(s)}}Pi(),Lo.exports=ks;var QI=Lo.exports,$i,qi,yo=QI;qi=yo.createRoot,$i=yo.hydrateRoot;const sg={theme:"light",sideNav:!0,initialized:!1},ag=W.createContext({state:sg,init:s=>{},setTheme:s=>{},toggleSideNav:()=>{}});function et(){return W.useContext(ag)}function mo(s,a){try{localStorage.setItem(s,a)}catch(n){console.error(n)}}const bo=({children:s})=>{const[a,n]=W.useState(sg);function l(t){t=="dark"?(document.body.classList.remove("light"),document.body.classList.add("dark")):(document.body.classList.remove("dark"),document.body.classList.add("light"))}function p(t){try{const o=localStorage.getItem("theme")||"light";let i=t.width>=500;{const I=localStorage.getItem("sideNav");I&&(i=I=="true")}l(o),n(I=>({...I,theme:o,sideNav:i}))}catch(o){console.error(o)}n(o=>({...o,initialized:!0}))}function e(t){l(t),n({...a,theme:t}),mo("theme",t)}function c(){const t=!a.sideNav;n({...a,sideNav:t}),mo("sideNav",t)}return r.jsx(ag.Provider,{value:W.useMemo(()=>({state:a,init:p,setTheme:e,toggleSideNav:c}),[a]),children:s})};/** - * @remix-run/router v1.14.1 +`+e.stack}return{value:s,source:a,stack:p,digest:null}}function te(s,a,n){return{value:s,source:null,stack:n??null,digest:a??null}}function Ue(s,a){try{console.error(a.value)}catch(n){setTimeout(function(){throw n})}}var mI=typeof WeakMap=="function"?WeakMap:Map;function ki(s,a,n){n=_s(-1,n),n.tag=3,n.payload={element:null};var l=a.value;return n.callback=function(){ip||(ip=!0,lc=l),Ue(s,a)},n}function Zi(s,a,n){n=_s(-1,n),n.tag=3;var l=s.type.getDerivedStateFromError;if(typeof l=="function"){var p=a.value;n.payload=function(){return l(p)},n.callback=function(){Ue(s,a)}}var e=s.stateNode;return e!==null&&typeof e.componentDidCatch=="function"&&(n.callback=function(){Ue(s,a),typeof l!="function"&&(da===null?da=new Set([this]):da.add(this));var c=a.stack;this.componentDidCatch(a.value,{componentStack:c!==null?c:""})}),n}function qt(s,a,n){var l=s.pingCache;if(l===null){l=s.pingCache=new mI;var p=new Set;l.set(a,p)}else p=l.get(a),p===void 0&&(p=new Set,l.set(a,p));p.has(n)||(p.add(n),s=NI.bind(null,s,a,n),a.then(s,s))}function so(s){do{var a;if((a=s.tag===13)&&(a=s.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return s;s=s.return}while(s!==null);return null}function ao(s,a,n,l,p){return s.mode&1?(s.flags|=65536,s.lanes=p,s):(s===a?s.flags|=65536:(s.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(a=_s(-1,1),a.tag=2,Ia(n,a,1))),n.lanes|=1),s)}var bI=qs.ReactCurrentOwner,Cs=!1;function rs(s,a,n,l){a.child=s===null?ni(a,null,n,l):on(a,s.child,n,l)}function no(s,a,n,l,p){n=n.render;var e=a.ref;return ln(a,p),l=Dc(s,a,n,l,e,p),n=Ec(),s!==null&&!Cs?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~p,$s(s,a,p)):(J&&n&&Rc(a),a.flags|=1,rs(s,a,l,p),a.child)}function lo(s,a,n,l,p){if(s===null){var e=n.type;return typeof e=="function"&&!st(e)&&e.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(a.tag=15,a.type=e,Wi(s,a,e,l,p)):(s=Dl(n.type,null,l,a,a.mode,p),s.ref=a.ref,s.return=a,a.child=s)}if(e=s.child,!(s.lanes&p)){var c=e.memoizedProps;if(n=n.compare,n=n!==null?n:_n,n(c,l)&&s.ref===a.ref)return $s(s,a,p)}return a.flags|=1,s=ja(e,l),s.ref=a.ref,s.return=a,a.child=s}function Wi(s,a,n,l,p){if(s!==null){var e=s.memoizedProps;if(_n(e,l)&&s.ref===a.ref)if(Cs=!1,a.pendingProps=l=e,(s.lanes&p)!==0)s.flags&131072&&(Cs=!0);else return a.lanes=s.lanes,$s(s,a,p)}return _e(s,a,n,l,p)}function Bi(s,a,n){var l=a.pendingProps,p=l.children,e=s!==null?s.memoizedState:null;if(l.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},K($a,ys),ys|=n;else{if(!(n&1073741824))return s=e!==null?e.baseLanes|n:n,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:s,cachePool:null,transitions:null},a.updateQueue=null,K($a,ys),ys|=s,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=e!==null?e.baseLanes:n,K($a,ys),ys|=l}else e!==null?(l=e.baseLanes|n,a.memoizedState=null):l=n,K($a,ys),ys|=l;return rs(s,a,p,n),a.child}function Gi(s,a){var n=a.ref;(s===null&&n!==null||s!==null&&s.ref!==n)&&(a.flags|=512,a.flags|=2097152)}function _e(s,a,n,l,p){var e=As(n)?Xa:os.current;return e=cn(a,e),ln(a,p),n=Dc(s,a,n,l,e,p),l=Ec(),s!==null&&!Cs?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~p,$s(s,a,p)):(J&&l&&Rc(a),a.flags|=1,rs(s,a,n,p),a.child)}function po(s,a,n,l,p){if(As(n)){var e=!0;sp(a)}else e=!1;if(ln(a,p),a.stateNode===null)xl(s,a),si(a,n,l),Te(a,n,l,p),l=!0;else if(s===null){var c=a.stateNode,t=a.memoizedProps;c.props=t;var o=c.context,i=n.contextType;typeof i=="object"&&i!==null?i=fs(i):(i=As(n)?Xa:os.current,i=cn(a,i));var I=n.getDerivedStateFromProps,d=typeof I=="function"||typeof c.getSnapshotBeforeUpdate=="function";d||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(t!==l||o!==i)&&Lt(a,c,l,i),la=!1;var j=a.memoizedState;c.state=j,ep(a,l,c,p),o=a.memoizedState,t!==l||j!==o||js.current||la?(typeof I=="function"&&(Qe(a,n,I,l),o=a.memoizedState),(t=la||_t(a,n,t,l,j,o,i))?(d||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(a.flags|=4194308)):(typeof c.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=l,a.memoizedState=o),c.props=l,c.state=o,c.context=i,l=t):(typeof c.componentDidMount=="function"&&(a.flags|=4194308),l=!1)}else{c=a.stateNode,$r(s,a),t=a.memoizedProps,i=a.type===a.elementType?t:vs(a.type,t),c.props=i,d=a.pendingProps,j=c.context,o=n.contextType,typeof o=="object"&&o!==null?o=fs(o):(o=As(n)?Xa:os.current,o=cn(a,o));var u=n.getDerivedStateFromProps;(I=typeof u=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(t!==d||j!==o)&&Lt(a,c,l,o),la=!1,j=a.memoizedState,c.state=j,ep(a,l,c,p);var m=a.memoizedState;t!==d||j!==m||js.current||la?(typeof u=="function"&&(Qe(a,n,u,l),m=a.memoizedState),(i=la||_t(a,n,i,l,j,m,o)||!1)?(I||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,m,o),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,m,o)),typeof c.componentDidUpdate=="function"&&(a.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof c.componentDidUpdate!="function"||t===s.memoizedProps&&j===s.memoizedState||(a.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||t===s.memoizedProps&&j===s.memoizedState||(a.flags|=1024),a.memoizedProps=l,a.memoizedState=m),c.props=l,c.state=m,c.context=o,l=i):(typeof c.componentDidUpdate!="function"||t===s.memoizedProps&&j===s.memoizedState||(a.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||t===s.memoizedProps&&j===s.memoizedState||(a.flags|=1024),l=!1)}return Le(s,a,n,l,e,p)}function Le(s,a,n,l,p,e){Gi(s,a);var c=(a.flags&128)!==0;if(!l&&!c)return p&&Dt(a,n,!1),$s(s,a,e);l=a.stateNode,bI.current=a;var t=c&&typeof n.getDerivedStateFromError!="function"?null:l.render();return a.flags|=1,s!==null&&c?(a.child=on(a,s.child,null,e),a.child=on(a,null,t,e)):rs(s,a,t,e),a.memoizedState=l.state,p&&Dt(a,n,!0),a.child}function Vi(s){var a=s.stateNode;a.pendingContext?zt(s,a.pendingContext,a.pendingContext!==a.context):a.context&&zt(s,a.context,!1),Sc(s,a.containerInfo)}function eo(s,a,n,l,p){return tn(),vc(p),a.flags|=256,rs(s,a,n,l),a.child}var Oe={dehydrated:null,treeContext:null,retryLane:0};function Pe(s){return{baseLanes:s,cachePool:null,transitions:null}}function fi(s,a,n){var l=a.pendingProps,p=z.current,e=!1,c=(a.flags&128)!==0,t;if((t=c)||(t=s!==null&&s.memoizedState===null?!1:(p&2)!==0),t?(e=!0,a.flags&=-129):(s===null||s.memoizedState!==null)&&(p|=1),K(z,p&1),s===null)return De(a),s=a.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(a.mode&1?s.data==="$!"?a.lanes=8:a.lanes=1073741824:a.lanes=1,null):(c=l.children,s=l.fallback,e?(l=a.mode,e=a.child,c={mode:"hidden",children:c},!(l&1)&&e!==null?(e.childLanes=0,e.pendingProps=c):e=Gp(c,l,0,null),s=Ya(s,l,n,null),e.return=a,s.return=a,e.sibling=s,a.child=e,a.child.memoizedState=Pe(n),a.memoizedState=Oe,s):Uc(a,c));if(p=s.memoizedState,p!==null&&(t=p.dehydrated,t!==null))return wI(s,a,c,l,t,p,n);if(e){e=l.fallback,c=a.mode,p=s.child,t=p.sibling;var o={mode:"hidden",children:l.children};return!(c&1)&&a.child!==p?(l=a.child,l.childLanes=0,l.pendingProps=o,a.deletions=null):(l=ja(p,o),l.subtreeFlags=p.subtreeFlags&14680064),t!==null?e=ja(t,e):(e=Ya(e,c,n,null),e.flags|=2),e.return=a,l.return=a,l.sibling=e,a.child=l,l=e,e=a.child,c=s.child.memoizedState,c=c===null?Pe(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},e.memoizedState=c,e.childLanes=s.childLanes&~n,a.memoizedState=Oe,l}return e=s.child,s=e.sibling,l=ja(e,{mode:"visible",children:l.children}),!(a.mode&1)&&(l.lanes=n),l.return=a,l.sibling=null,s!==null&&(n=a.deletions,n===null?(a.deletions=[s],a.flags|=16):n.push(s)),a.child=l,a.memoizedState=null,l}function Uc(s,a){return a=Gp({mode:"visible",children:a},s.mode,0,null),a.return=s,s.child=a}function Gl(s,a,n,l){return l!==null&&vc(l),on(a,s.child,null,n),s=Uc(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function wI(s,a,n,l,p,e,c){if(n)return a.flags&256?(a.flags&=-257,l=te(Error(w(422))),Gl(s,a,c,l)):a.memoizedState!==null?(a.child=s.child,a.flags|=128,null):(e=l.fallback,p=a.mode,l=Gp({mode:"visible",children:l.children},p,0,null),e=Ya(e,p,c,null),e.flags|=2,l.return=a,e.return=a,l.sibling=e,a.child=l,a.mode&1&&on(a,s.child,null,c),a.child.memoizedState=Pe(c),a.memoizedState=Oe,e);if(!(a.mode&1))return Gl(s,a,c,null);if(p.data==="$!"){if(l=p.nextSibling&&p.nextSibling.dataset,l)var t=l.dgst;return l=t,e=Error(w(419)),l=te(e,l,void 0),Gl(s,a,c,l)}if(t=(c&s.childLanes)!==0,Cs||t){if(l=ss,l!==null){switch(c&-c){case 4:p=2;break;case 16:p=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=p&(l.suspendedLanes|c)?0:p,p!==0&&p!==e.retryLane&&(e.retryLane=p,Ps(s,p),Ks(l,s,p,-1))}return qc(),l=te(Error(w(421))),Gl(s,a,c,l)}return p.data==="$?"?(a.flags|=128,a.child=s.child,a=HI.bind(null,s),p._reactRetry=a,null):(s=e.treeContext,ms=ha(p.nextSibling),bs=a,J=!0,Hs=null,s!==null&&(Ws[Bs++]=Ts,Ws[Bs++]=Us,Ws[Bs++]=va,Ts=s.id,Us=s.overflow,va=a),a=Uc(a,l.children),a.flags|=4096,a)}function co(s,a,n){s.lanes|=a;var l=s.alternate;l!==null&&(l.lanes|=a),Ee(s.return,a,n)}function oe(s,a,n,l,p){var e=s.memoizedState;e===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:p}:(e.isBackwards=a,e.rendering=null,e.renderingStartTime=0,e.last=l,e.tail=n,e.tailMode=p)}function Yi(s,a,n){var l=a.pendingProps,p=l.revealOrder,e=l.tail;if(rs(s,a,l.children,n),l=z.current,l&2)l=l&1|2,a.flags|=128;else{if(s!==null&&s.flags&128)s:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&co(s,n,a);else if(s.tag===19)co(s,n,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break s;for(;s.sibling===null;){if(s.return===null||s.return===a)break s;s=s.return}s.sibling.return=s.return,s=s.sibling}l&=1}if(K(z,l),!(a.mode&1))a.memoizedState=null;else switch(p){case"forwards":for(n=a.child,p=null;n!==null;)s=n.alternate,s!==null&&cp(s)===null&&(p=n),n=n.sibling;n=p,n===null?(p=a.child,a.child=null):(p=n.sibling,n.sibling=null),oe(a,!1,p,n,e);break;case"backwards":for(n=null,p=a.child,a.child=null;p!==null;){if(s=p.alternate,s!==null&&cp(s)===null){a.child=p;break}s=p.sibling,p.sibling=n,n=p,p=s}oe(a,!0,n,null,e);break;case"together":oe(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function xl(s,a){!(a.mode&1)&&s!==null&&(s.alternate=null,a.alternate=null,a.flags|=2)}function $s(s,a,n){if(s!==null&&(a.dependencies=s.dependencies),Ha|=a.lanes,!(n&a.childLanes))return null;if(s!==null&&a.child!==s.child)throw Error(w(153));if(a.child!==null){for(s=a.child,n=ja(s,s.pendingProps),a.child=n,n.return=a;s.sibling!==null;)s=s.sibling,n=n.sibling=ja(s,s.pendingProps),n.return=a;n.sibling=null}return a.child}function kI(s,a,n){switch(a.tag){case 3:Vi(a),tn();break;case 5:li(a);break;case 1:As(a.type)&&sp(a);break;case 4:Sc(a,a.stateNode.containerInfo);break;case 10:var l=a.type._context,p=a.memoizedProps.value;K(lp,l._currentValue),l._currentValue=p;break;case 13:if(l=a.memoizedState,l!==null)return l.dehydrated!==null?(K(z,z.current&1),a.flags|=128,null):n&a.child.childLanes?fi(s,a,n):(K(z,z.current&1),s=$s(s,a,n),s!==null?s.sibling:null);K(z,z.current&1);break;case 19:if(l=(n&a.childLanes)!==0,s.flags&128){if(l)return Yi(s,a,n);a.flags|=128}if(p=a.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),K(z,z.current),l)break;return null;case 22:case 23:return a.lanes=0,Bi(s,a,n)}return $s(s,a,n)}var Ri,$e,Xi,vi;Ri=function(s,a){for(var n=a.child;n!==null;){if(n.tag===5||n.tag===6)s.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break;for(;n.sibling===null;){if(n.return===null||n.return===a)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};$e=function(){};Xi=function(s,a,n,l){var p=s.memoizedProps;if(p!==l){s=a.stateNode,Va(Ds.current);var e=null;switch(n){case"input":p=me(s,p),l=me(s,l),e=[];break;case"select":p=E({},p,{value:void 0}),l=E({},l,{value:void 0}),e=[];break;case"textarea":p=ke(s,p),l=ke(s,l),e=[];break;default:typeof p.onClick!="function"&&typeof l.onClick=="function"&&(s.onclick=$l)}We(n,l);var c;n=null;for(i in p)if(!l.hasOwnProperty(i)&&p.hasOwnProperty(i)&&p[i]!=null)if(i==="style"){var t=p[i];for(c in t)t.hasOwnProperty(c)&&(n||(n={}),n[c]="")}else i!=="dangerouslySetInnerHTML"&&i!=="children"&&i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Jn.hasOwnProperty(i)?e||(e=[]):(e=e||[]).push(i,null));for(i in l){var o=l[i];if(t=p!=null?p[i]:void 0,l.hasOwnProperty(i)&&o!==t&&(o!=null||t!=null))if(i==="style")if(t){for(c in t)!t.hasOwnProperty(c)||o&&o.hasOwnProperty(c)||(n||(n={}),n[c]="");for(c in o)o.hasOwnProperty(c)&&t[c]!==o[c]&&(n||(n={}),n[c]=o[c])}else n||(e||(e=[]),e.push(i,n)),n=o;else i==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,t=t?t.__html:void 0,o!=null&&t!==o&&(e=e||[]).push(i,o)):i==="children"?typeof o!="string"&&typeof o!="number"||(e=e||[]).push(i,""+o):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&(Jn.hasOwnProperty(i)?(o!=null&&i==="onScroll"&&M("scroll",s),e||t===o||(e=[])):(e=e||[]).push(i,o))}n&&(e=e||[]).push("style",n);var i=e;(a.updateQueue=i)&&(a.flags|=4)}};vi=function(s,a,n,l){n!==l&&(a.flags|=4)};function Bn(s,a){if(!J)switch(s.tailMode){case"hidden":a=s.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?s.tail=null:n.sibling=null;break;case"collapsed":n=s.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:l.sibling=null}}function cs(s){var a=s.alternate!==null&&s.alternate.child===s.child,n=0,l=0;if(a)for(var p=s.child;p!==null;)n|=p.lanes|p.childLanes,l|=p.subtreeFlags&14680064,l|=p.flags&14680064,p.return=s,p=p.sibling;else for(p=s.child;p!==null;)n|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=s,p=p.sibling;return s.subtreeFlags|=l,s.childLanes=n,a}function ZI(s,a,n){var l=a.pendingProps;switch(Xc(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cs(a),null;case 1:return As(a.type)&&ql(),cs(a),null;case 3:return l=a.stateNode,rn(),S(js),S(os),Jc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(s===null||s.child===null)&&(Wl(a)?a.flags|=4:s===null||s.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,Hs!==null&&(cc(Hs),Hs=null))),$e(s,a),cs(a),null;case 5:xc(a);var p=Va(qn.current);if(n=a.type,s!==null&&a.stateNode!=null)Xi(s,a,n,l,p),s.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!l){if(a.stateNode===null)throw Error(w(166));return cs(a),null}if(s=Va(Ds.current),Wl(a)){l=a.stateNode,n=a.type;var e=a.memoizedProps;switch(l[Js]=a,l[Pn]=e,s=(a.mode&1)!==0,n){case"dialog":M("cancel",l),M("close",l);break;case"iframe":case"object":case"embed":M("load",l);break;case"video":case"audio":for(p=0;p<\/script>",s=s.removeChild(s.firstChild)):typeof l.is=="string"?s=c.createElement(n,{is:l.is}):(s=c.createElement(n),n==="select"&&(c=s,l.multiple?c.multiple=!0:l.size&&(c.size=l.size))):s=c.createElementNS(s,n),s[Js]=a,s[Pn]=l,Ri(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=cp(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 $c(),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 WI(s,a){switch(Xc(a),a.tag){case 1:return As(a.type)&&ql(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return rn(),S(js),S(os),Jc(),s=a.flags,s&65536&&!(s&128)?(a.flags=s&-65537|128,a):null;case 5:return xc(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 Fc(a.type._context),null;case 22:case 23:return $c(),null;case 24:return null;default:return null}}var Vl=!1,ts=!1,BI=typeof WeakSet=="function"?WeakSet:Set,V=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 to=!1;function GI(s,a){if(Fe=Ll,s=Kr(),Yc(s)){if("selectionStart"in s)var n={start:s.selectionStart,end:s.selectionEnd};else s:{n=(n=s.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var p=l.anchorOffset,e=l.focusNode;l=l.focusOffset;try{n.nodeType,e.nodeType}catch{n=null;break s}var c=0,t=-1,o=-1,i=0,I=0,d=s,j=null;a:for(;;){for(var u;d!==n||p!==0&&d.nodeType!==3||(t=c+p),d!==e||l!==0&&d.nodeType!==3||(o=c+l),d.nodeType===3&&(c+=d.nodeValue.length),(u=d.firstChild)!==null;)j=d,d=u;for(;;){if(d===s)break a;if(j===n&&++i===p&&(t=c),j===e&&++I===l&&(o=c),(u=d.nextSibling)!==null)break;d=j,j=d.parentNode}d=u}n=t===-1||o===-1?null:{start:t,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ke={focusedElem:s,selectionRange:n},Ll=!1,V=a;V!==null;)if(a=V,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,V=s;else for(;V!==null;){a=V;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,Z=m.memoizedState,h=a.stateNode,g=h.getSnapshotBeforeUpdate(a.elementType===a.type?b:vs(a.type,b),Z);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,V=s;break}V=a.return}return m=to,to=!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 Wp(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[rI],delete a[iI])),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 oo(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=$l));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(Ap,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?ae(s.parentNode,n):s.nodeType===1&&ae(s,n),Tn(s)):ae(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 ro(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var n=s.stateNode;n===null&&(n=s.stateNode=new BI),a.forEach(function(l){var p=FI.bind(null,s,l);n.has(l)||(n.add(l),l.then(p,p))})}}function Xs(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,gp=0,H&6)throw Error(w(331));var p=H;for(H|=4,V=s.current;V!==null;){var e=V,c=e.child;if(V.flags&16){var t=e.deletions;if(t!==null){for(var o=0;oU()-Oc?fa(s,0):Lc|=n),us(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),us(s,n))}function HI(s){var a=s.memoizedState,n=0;a!==null&&(n=a.retryLane),Ei(s,n)}function FI(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||js.current)Cs=!0;else{if(!(s.lanes&n)&&!(a.flags&128))return Cs=!1,kI(s,a,n);Cs=!!(s.flags&131072)}else Cs=!1,J&&a.flags&1048576&&_r(a,np,a.index);switch(a.lanes=0,a.tag){case 2:var l=a.type;xl(s,a),s=a.pendingProps;var p=cn(a,os.current);ln(a,n),p=Dc(null,a,l,s,p,n);var e=Ec();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,As(l)?(e=!0,sp(a)):e=!1,a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,Mc(a),p.updater=kp,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(xl(s,a),s=a.pendingProps,p=l._init,l=p(l._payload),a.type=l,p=a.tag=MI(l),s=vs(l,s),p){case 0:a=_e(null,a,l,s,n);break s;case 1:a=po(null,a,l,s,n);break s;case 11:a=no(null,a,l,s,n);break s;case 14:a=lo(null,a,l,vs(l.type,s),n);break s}throw Error(w(306,l,""))}return a;case 0:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),_e(s,a,l,p,n);case 1:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),po(s,a,l,p,n);case 3:s:{if(Vi(a),s===null)throw Error(w(387));l=a.pendingProps,e=a.memoizedState,p=e.element,$r(s,a),ep(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=eo(s,a,l,n,p);break s}else if(l!==p){p=gn(Error(w(424)),a),a=eo(s,a,l,n,p);break s}else for(ms=ha(a.stateNode.containerInfo.firstChild),bs=a,J=!0,Hs=null,n=ni(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 li(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 fi(s,a,n);case 4:return Sc(a,a.stateNode.containerInfo),l=a.pendingProps,s===null?a.child=on(a,null,l,n):rs(s,a,l,n),a.child;case 11:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),no(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(lp,l._currentValue),l._currentValue=c,e!==null)if(Ms(e.value,c)){if(e.children===p.children&&!js.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 i=e.updateQueue;if(i!==null){i=i.shared;var I=i.pending;I===null?o.next=o:(o.next=I.next,I.next=o),i.pending=o}}e.lanes|=n,o=e.alternate,o!==null&&(o.lanes|=n),Ee(e.return,n,a),t.lanes|=n;break}o=o.next}}else if(e.tag===10)c=e.type===a.type?null:e.child;else if(e.tag===18){if(c=e.return,c===null)throw Error(w(341));c.lanes|=n,t=c.alternate,t!==null&&(t.lanes|=n),Ee(c,n,a),c=e.sibling}else c=e.child;if(c!==null)c.return=e;else for(c=e;c!==null;){if(c===a){c=null;break}if(e=c.sibling,e!==null){e.return=c.return,c=e;break}c=c.return}e=c}rs(s,a,p.children,n),a=a.child}return a;case 9:return p=a.type,l=a.pendingProps.children,ln(a,n),p=fs(p),l=l(p),a.flags|=1,rs(s,a,l,n),a.child;case 14:return l=a.type,p=vs(l,a.pendingProps),p=vs(l.type,p),lo(s,a,l,p,n);case 15:return Wi(s,a,a.type,a.pendingProps,n);case 17:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:vs(l,p),xl(s,a),a.tag=1,As(l)?(s=!0,sp(a)):s=!1,ln(a,n),si(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 ur(s,a)}function KI(s,a,n,l){this.tag=s,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gs(s,a,n,l){return new KI(s,a,n,l)}function st(s){return s=s.prototype,!(!s||!s.isReactComponent)}function MI(s){if(typeof s=="function")return st(s)?1:0;if(s!=null){if(s=s.$$typeof,s===yc)return 11;if(s===mc)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 Dl(s,a,n,l,p,e){var c=2;if(l=s,typeof s=="function")st(s)&&(c=1);else if(typeof s=="string")c=5;else s:switch(s){case za:return Ya(n.children,p,e,a);case uc: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 ar:return Gp(n,p,e,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case qo:c=10;break s;case sr:c=9;break s;case yc:c=11;break s;case mc: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 Gp(s,a,n,l){return s=Gs(22,s,l,a),s.elementType=ar,s.lanes=n,s.stateNode={isHidden:!1},s}function re(s,a,n){return s=Gs(6,s,null,a),s.lanes=n,s}function ie(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 SI(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=Ep(0),this.expirationTimes=Ep(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ep(0),this.identifierPrefix=l,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function at(s,a,n,l,p,e,c,t,o){return s=new SI(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},Mc(e),s}function xI(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(),_o.exports=ks;var QI=_o.exports,Pi,$i,uo=QI;$i=uo.createRoot,Pi=uo.hydrateRoot;const qi={theme:"light",sideNav:!0,initialized:!1},sg=B.createContext({state:qi,init:s=>{},setTheme:s=>{},toggleSideNav:()=>{}});function et(){return B.useContext(sg)}function yo(s,a){try{localStorage.setItem(s,a)}catch(n){console.error(n)}}const mo=({children:s})=>{const[a,n]=B.useState(qi);function l(t){t=="dark"?(document.body.classList.remove("light"),document.body.classList.add("dark")):(document.body.classList.remove("dark"),document.body.classList.add("light"))}function p(t){try{const o=localStorage.getItem("theme")||"light";let i=t.width>=500;{const I=localStorage.getItem("sideNav");I&&(i=I=="true")}l(o),n(I=>({...I,theme:o,sideNav:i}))}catch(o){console.error(o)}n(o=>({...o,initialized:!0}))}function e(t){l(t),n({...a,theme:t}),yo("theme",t)}function c(){const t=!a.sideNav;n({...a,sideNav:t}),yo("sideNav",t)}return r.jsx(sg.Provider,{value:B.useMemo(()=>({state:a,init:p,setTheme:e,toggleSideNav:c}),[a]),children:s})};/** + * @remix-run/router v1.15.3 * * Copyright (c) Remix Software Inc. * @@ -46,8 +46,8 @@ Error generating stack: `+e.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function pl(){return pl=Object.assign?Object.assign.bind():function(s){for(var a=1;a"u")throw new Error(a)}function ct(s,a){if(!s){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function UI(){return Math.random().toString(36).substr(2,8)}function ko(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||UI()})}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 _I(s,a,n,l){l===void 0&&(l={});let{window:p=document.defaultView,v5Compat:e=!1}=l,c=p.history,t=oa.Pop,o=null,i=I();i==null&&(i=0,c.replaceState(pl({},c.state,{idx:i}),""));function I(){return(c.state||{idx:null}).idx}function d(){t=oa.Pop;let B=I(),h=B==null?null:B-i;i=B,o&&o({action:t,location:b.location,delta:h})}function j(B,h){t=oa.Push;let g=tc(b.location,B,h);n&&n(g,B),i=I()+1;let C=ko(g,i),y=b.createHref(g);try{c.pushState(C,"",y)}catch(Z){if(Z instanceof DOMException&&Z.name==="DataCloneError")throw Z;p.location.assign(y)}e&&o&&o({action:t,location:b.location,delta:1})}function A(B,h){t=oa.Replace;let g=tc(b.location,B,h);n&&n(g,B),i=I();let C=ko(g,i),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 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(wo,d),o=B,()=>{p.removeEventListener(wo,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:A,go(B){return c.go(B)}};return b}var Zo;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Zo||(Zo={}));function LI(s,a,n){n===void 0&&(n="/");let l=typeof a=="string"?jn(a):a,p=cg(l.pathname||"/",n);if(p==null)return null;let e=lg(s);OI(e);let c=null;for(let t=0;c==null&&t{let o={relativePath:t===void 0?e.path||"":t,caseSensitive:e.caseSensitive===!0,childrenIndex:c,route:e};o.relativePath.startsWith("/")&&(P(o.relativePath.startsWith(l),'Absolute route path "'+o.relativePath+'" nested under path '+('"'+l+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),o.relativePath=o.relativePath.slice(l.length));let i=Ra([l,o.relativePath]),I=n.concat(o);e.children&&e.children.length>0&&(P(e.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+i+'".')),lg(e.children,a,I,i)),!(e.path==null&&!e.index)&&a.push({path:i,score:ld(i,e.index),routesMeta:I})};return s.forEach((e,c)=>{var t;if(e.path===""||!((t=e.path)!=null&&t.includes("?")))p(e,c);else for(let o of pg(e.path))p(e,c,o)}),a}function pg(s){let a=s.split("/");if(a.length===0)return[];let[n,...l]=a,p=n.endsWith("?"),e=n.replace(/\?$/,"");if(l.length===0)return p?[e,""]:[e];let c=pg(l.join("/")),t=[];return t.push(...c.map(o=>o===""?e:[e,o].join("/"))),p&&t.push(...c),t.map(o=>s.startsWith("/")&&o===""?"/":o)}function OI(s){s.sort((a,n)=>a.score!==n.score?n.score-a.score:pd(a.routesMeta.map(l=>l.childrenIndex),n.routesMeta.map(l=>l.childrenIndex)))}const PI=/^:\w+$/,$I=3,qI=2,sd=1,ad=10,nd=-2,Wo=s=>s==="*";function ld(s,a){let n=s.split("/"),l=n.length;return n.some(Wo)&&(l+=nd),a&&(l+=qI),n.filter(p=>!Wo(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){let{routesMeta:n}=s,l={},p="/",e=[];for(let c=0;c{let{paramName:j,isOptional:A}=I;if(j==="*"){let b=t[d]||"";c=e.slice(0,e.length-b.length).replace(/(.)\/+$/,"$1")}const m=t[d];return A&&!m?i[j]=void 0:i[j]=od(m||"",j),i},{}),pathname:e,pathnameBase:c,pattern:s}}function cd(s,a,n){a===void 0&&(a=!1),n===void 0&&(n=!0),ct(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 decodeURI(s)}catch(a){return ct(!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 od(s,a){try{return decodeURIComponent(s)}catch(n){return ct(!1,'The value for the URL param "'+a+'" will not be decoded because'+(' the string "'+s+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),s}}function cg(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 rd(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:id(n,a):a,search:Cd(l),hash:jd(p)}}function id(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 ge(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 gd(s){return s.filter((a,n)=>n===0||a.route.path&&a.route.path.length>0)}function hd(s,a){let n=gd(s);return a?n.map((l,p)=>p===s.length-1?l.pathname:l.pathnameBase):n.map(l=>l.pathnameBase)}function Id(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("?"),ge("?","pathname","search",p)),P(!p.pathname||!p.pathname.includes("#"),ge("#","pathname","hash",p)),P(!p.search||!p.search.includes("#"),ge("#","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=rd(p,t),i=c&&c!=="/"&&c.endsWith("/"),I=(e||c===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(i||I)&&(o.pathname+="/"),o}const Ra=s=>s.join("/").replace(/\/\/+/g,"/"),dd=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),Cd=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,jd=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function ud(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}const tg=["post","put","patch","delete"];new Set(tg);const Ad=["get",...tg];new Set(Ad);/** - * React Router v6.21.1 + */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 UI(){return Math.random().toString(36).substr(2,8)}function wo(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||UI()})}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 _I(s,a,n,l){l===void 0&&(l={});let{window:p=document.defaultView,v5Compat:e=!1}=l,c=p.history,t=oa.Pop,o=null,i=I();i==null&&(i=0,c.replaceState(pl({},c.state,{idx:i}),""));function I(){return(c.state||{idx:null}).idx}function d(){t=oa.Pop;let Z=I(),h=Z==null?null:Z-i;i=Z,o&&o({action:t,location:b.location,delta:h})}function j(Z,h){t=oa.Push;let g=tc(b.location,Z,h);n&&n(g,Z),i=I()+1;let C=wo(g,i),y=b.createHref(g);try{c.pushState(C,"",y)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;p.location.assign(y)}e&&o&&o({action:t,location:b.location,delta:1})}function u(Z,h){t=oa.Replace;let g=tc(b.location,Z,h);n&&n(g,Z),i=I();let C=wo(g,i),y=b.createHref(g);c.replaceState(C,"",y),e&&o&&o({action:t,location:b.location,delta:0})}function m(Z){let h=p.location.origin!=="null"?p.location.origin:p.location.href,g=typeof Z=="string"?Z:ng(Z);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(Z){if(o)throw new Error("A history only accepts one active listener");return p.addEventListener(bo,d),o=Z,()=>{p.removeEventListener(bo,d),o=null}},createHref(Z){return a(p,Z)},createURL:m,encodeLocation(Z){let h=m(Z);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:j,replace:u,go(Z){return c.go(Z)}};return b}var ko;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(ko||(ko={}));function LI(s,a,n){n===void 0&&(n="/");let l=typeof a=="string"?jn(a):a,p=cg(l.pathname||"/",n);if(p==null)return null;let e=lg(s);OI(e);let c=null;for(let t=0;c==null&&t{let o={relativePath:t===void 0?e.path||"":t,caseSensitive:e.caseSensitive===!0,childrenIndex:c,route:e};o.relativePath.startsWith("/")&&(P(o.relativePath.startsWith(l),'Absolute route path "'+o.relativePath+'" nested under path '+('"'+l+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),o.relativePath=o.relativePath.slice(l.length));let i=Ra([l,o.relativePath]),I=n.concat(o);e.children&&e.children.length>0&&(P(e.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+i+'".')),lg(e.children,a,I,i)),!(e.path==null&&!e.index)&&a.push({path:i,score:ld(i,e.index),routesMeta:I})};return s.forEach((e,c)=>{var t;if(e.path===""||!((t=e.path)!=null&&t.includes("?")))p(e,c);else for(let o of pg(e.path))p(e,c,o)}),a}function pg(s){let a=s.split("/");if(a.length===0)return[];let[n,...l]=a,p=n.endsWith("?"),e=n.replace(/\?$/,"");if(l.length===0)return p?[e,""]:[e];let c=pg(l.join("/")),t=[];return t.push(...c.map(o=>o===""?e:[e,o].join("/"))),p&&t.push(...c),t.map(o=>s.startsWith("/")&&o===""?"/":o)}function OI(s){s.sort((a,n)=>a.score!==n.score?n.score-a.score:pd(a.routesMeta.map(l=>l.childrenIndex),n.routesMeta.map(l=>l.childrenIndex)))}const PI=/^:[\w-]+$/,$I=3,qI=2,sd=1,ad=10,nd=-2,Zo=s=>s==="*";function ld(s,a){let n=s.split("/"),l=n.length;return n.some(Zo)&&(l+=nd),a&&(l+=qI),n.filter(p=>!Zo(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){let{routesMeta:n}=s,l={},p="/",e=[];for(let c=0;c{let{paramName:j,isOptional:u}=I;if(j==="*"){let b=t[d]||"";c=e.slice(0,e.length-b.length).replace(/(.)\/+$/,"$1")}const m=t[d];return u&&!m?i[j]=void 0:i[j]=(m||"").replace(/%2F/g,"/"),i},{}),pathname:e,pathnameBase:c,pattern:s}}function cd(s,a,n){a===void 0&&(a=!1),n===void 0&&(n=!0),ag(s==="*"||!s.endsWith("*")||s.endsWith("/*"),'Route path "'+s+'" will be treated as if it were '+('"'+s.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+s.replace(/\*$/,"/*")+'".'));let l=[],p="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,t,o)=>(l.push({paramName:t,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(l.push({paramName:"*"}),p+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?p+="\\/*$":s!==""&&s!=="/"&&(p+="(?:(?=\\/|$))"),[new RegExp(p,a?void 0:"i"),l]}function td(s){try{return s.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return ag(!1,'The URL path "'+s+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),s}}function cg(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 ge(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===s.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("?"),ge("?","pathname","search",p)),P(!p.pathname||!p.pathname.includes("#"),ge("#","pathname","hash",p)),P(!p.search||!p.search.includes("#"),ge("#","search","hash",p)));let e=s===""||p.pathname==="",c=e?"/":p.pathname,t;if(c==null)t=n;else{let d=a.length-1;if(!l&&c.startsWith("..")){let j=c.split("/");for(;j[0]==="..";)j.shift(),d-=1;p.pathname=j.join("/")}t=d>=0?a[d]:"/"}let o=od(p,t),i=c&&c!=="/"&&c.endsWith("/"),I=(e||c===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(i||I)&&(o.pathname+="/"),o}const Ra=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 tg=["post","put","patch","delete"];new Set(tg);const Ad=["get",...tg];new Set(Ad);/** + * React Router v6.22.3 * * Copyright (c) Remix Software Inc. * @@ -55,8 +55,8 @@ Error generating stack: `+e.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function el(){return el=Object.assign?Object.assign.bind():function(s){for(var a=1;a{t.current=!0}),W.useCallback(function(i,I){if(I===void 0&&(I={}),!t.current)return;if(typeof i=="number"){l.go(i);return}let d=Id(i,JSON.parse(c),e,I.relative==="path");s==null&&a!=="/"&&(d.pathname=d.pathname==="/"?a:Ra([a,d.pathname])),(I.replace?l.replace:l.push)(d,I.state,I)},[a,l,c,e,s])}function wd(s,a){return kd(s,a)}function kd(s,a,n,l){Np()||P(!1);let{navigator:p}=W.useContext(Xp),{matches:e}=W.useContext(un),c=e[e.length-1],t=c?c.params:{};c&&c.pathname;let o=c?c.pathnameBase:"/";c&&c.route;let i=Hp(),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=i;let j=I.pathname||"/",A=o==="/"?j:j.slice(o.length)||"/",m=LI(s,{pathname:A}),b=Vd(m&&m.map(B=>Object.assign({},B,{params:Object.assign({},t,B.params),pathname:Ra([o,p.encodeLocation?p.encodeLocation(B.pathname).pathname:B.pathname]),pathnameBase:B.pathnameBase==="/"?o:Ra([o,p.encodeLocation?p.encodeLocation(B.pathnameBase).pathname:B.pathnameBase])})),e,n,l);return a&&b?W.createElement(vp.Provider,{value:{location:el({pathname:"/",search:"",hash:"",state:null,key:"default"},I),navigationType:oa.Pop}},b):b}function Zd(){let s=Xd(),a=ud(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 Wd=W.createElement(Zd,null);class Bd 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(un.Provider,{value:this.props.routeContext},W.createElement(og.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Gd(s){let{routeContext:a,match:n,children:l}=s,p=W.useContext(tt);return p&&p.static&&p.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(p.staticContext._deepestRenderedBoundaryId=n.route.id),W.createElement(un.Provider,{value:a},l)}function Vd(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((e=n)!=null&&e.errors)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]));I>=0||P(!1),c=c.slice(0,Math.min(c.length,I+1))}let o=!1,i=-1;if(n&&l&&l.v7_partialHydration)for(let I=0;I=0?c=c.slice(0,i+1):c=[c[0]];break}}}return c.reduceRight((I,d,j)=>{let A,m=!1,b=null,B=null;n&&(A=t&&d.route.id?t[d.route.id]:void 0,b=d.route.errorElement||Wd,o&&(i<0&&j===0?(Nd("route-fallback",!1),m=!0,B=null):i===j&&(m=!0,B=d.route.hydrateFallbackElement||null)));let h=a.concat(c.slice(0,j+1)),g=()=>{let C;return A?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(Gd,{match:d,routeContext:{outlet:I,matches:h,isDataRoute:n!=null},children:C})};return n&&(d.route.ErrorBoundary||d.route.errorElement||j===0)?W.createElement(Bd,{location:n.location,revalidation:n.revalidation,component:b,error:A,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}var ig=function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s}(ig||{}),dp=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}(dp||{});function fd(s){let a=W.useContext(tt);return a||P(!1),a}function Yd(s){let a=W.useContext(yd);return a||P(!1),a}function Rd(s){let a=W.useContext(un);return a||P(!1),a}function gg(s){let a=Rd(),n=a.matches[a.matches.length-1];return n.route.id||P(!1),n.route.id}function Xd(){var s;let a=W.useContext(og),n=Yd(dp.UseRouteError),l=gg(dp.UseRouteError);return a!==void 0?a:(s=n.errors)==null?void 0:s[l]}function vd(){let{router:s}=fd(ig.UseNavigateStable),a=gg(dp.UseNavigateStable),n=W.useRef(!1);return rg(()=>{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])}const Bo={};function Nd(s,a,n){!a&&!Bo[s]&&(Bo[s]=!0)}function hg(s){P(!1)}function Hd(s){let{basename:a="/",children:n=null,location:l,navigationType:p=oa.Pop,navigator:e,static:c=!1,future:t}=s;Np()&&P(!1);let o=a.replace(/^\/*/,"/"),i=W.useMemo(()=>({basename:o,navigator:e,static:c,future:el({v7_relativeSplatPath:!1},t)}),[o,t,e,c]);typeof l=="string"&&(l=jn(l));let{pathname:I="/",search:d="",hash:j="",state:A=null,key:m="default"}=l,b=W.useMemo(()=>{let B=cg(I,o);return B==null?null:{location:{pathname:B,search:d,hash:j,state:A,key:m},navigationType:p}},[o,I,d,j,A,m,p]);return b==null?null:W.createElement(Xp.Provider,{value:i},W.createElement(vp.Provider,{children:n,value:b}))}function Fd(s){let{children:a,location:n}=s;return wd(oc(a),n)}new Promise(()=>{});function oc(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,oc(l.props.children,e));return}l.type!==hg&&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=oc(l.props.children,e)),n.push(c)}),n}/** - * React Router DOM v6.21.1 + */function el(){return el=Object.assign?Object.assign.bind():function(s){for(var a=1;a{t.current=!0}),B.useCallback(function(i,I){if(I===void 0&&(I={}),!t.current)return;if(typeof i=="number"){l.go(i);return}let d=hd(i,JSON.parse(c),e,I.relative==="path");s==null&&a!=="/"&&(d.pathname=d.pathname==="/"?a:Ra([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){Np()||P(!1);let{navigator:p}=B.useContext(Xp),{matches:e}=B.useContext(An),c=e[e.length-1],t=c?c.params:{};c&&c.pathname;let o=c?c.pathnameBase:"/";c&&c.route;let i=Hp(),I;if(a){var d;let Z=typeof a=="string"?jn(a):a;o==="/"||(d=Z.pathname)!=null&&d.startsWith(o)||P(!1),I=Z}else I=i;let j=I.pathname||"/",u=j;if(o!=="/"){let Z=o.replace(/^\//,"").split("/");u="/"+j.replace(/^\//,"").split("/").slice(Z.length).join("/")}let m=LI(s,{pathname:u}),b=Gd(m&&m.map(Z=>Object.assign({},Z,{params:Object.assign({},t,Z.params),pathname:Ra([o,p.encodeLocation?p.encodeLocation(Z.pathname).pathname:Z.pathname]),pathnameBase:Z.pathnameBase==="/"?o:Ra([o,p.encodeLocation?p.encodeLocation(Z.pathnameBase).pathname:Z.pathnameBase])})),e,n,l);return a&&b?B.createElement(vp.Provider,{value:{location:el({pathname:"/",search:"",hash:"",state:null,key:"default"},I),navigationType:oa.Pop}},b):b}function kd(){let s=Rd(),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 B.createElement(B.Fragment,null,B.createElement("h2",null,"Unexpected Application Error!"),B.createElement("h3",{style:{fontStyle:"italic"}},a),n?B.createElement("pre",{style:p},n):null,null)}const Zd=B.createElement(kd,null);class Wd extends B.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?B.createElement(An.Provider,{value:this.props.routeContext},B.createElement(og.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Bd(s){let{routeContext:a,match:n,children:l}=s,p=B.useContext(ct);return p&&p.static&&p.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(p.staticContext._deepestRenderedBoundaryId=n.route.id),B.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((e=n)!=null&&e.errors)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]));I>=0||P(!1),c=c.slice(0,Math.min(c.length,I+1))}let o=!1,i=-1;if(n&&l&&l.v7_partialHydration)for(let I=0;I=0?c=c.slice(0,i+1):c=[c[0]];break}}}return c.reduceRight((I,d,j)=>{let u,m=!1,b=null,Z=null;n&&(u=t&&d.route.id?t[d.route.id]:void 0,b=d.route.errorElement||Zd,o&&(i<0&&j===0?(vd("route-fallback",!1),m=!0,Z=null):i===j&&(m=!0,Z=d.route.hydrateFallbackElement||null)));let h=a.concat(c.slice(0,j+1)),g=()=>{let C;return u?C=b:m?C=Z:d.route.Component?C=B.createElement(d.route.Component,null):d.route.element?C=d.route.element:C=I,B.createElement(Bd,{match:d,routeContext:{outlet:I,matches:h,isDataRoute:n!=null},children:C})};return n&&(d.route.ErrorBoundary||d.route.errorElement||j===0)?B.createElement(Wd,{location:n.location,revalidation:n.revalidation,component:b,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}var ig=function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s}(ig||{}),dp=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}(dp||{});function Vd(s){let a=B.useContext(ct);return a||P(!1),a}function fd(s){let a=B.useContext(ud);return a||P(!1),a}function Yd(s){let a=B.useContext(An);return a||P(!1),a}function gg(s){let a=Yd(),n=a.matches[a.matches.length-1];return n.route.id||P(!1),n.route.id}function Rd(){var s;let a=B.useContext(og),n=fd(dp.UseRouteError),l=gg(dp.UseRouteError);return a!==void 0?a:(s=n.errors)==null?void 0:s[l]}function Xd(){let{router:s}=Vd(ig.UseNavigateStable),a=gg(dp.UseNavigateStable),n=B.useRef(!1);return rg(()=>{n.current=!0}),B.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])}const Wo={};function vd(s,a,n){!a&&!Wo[s]&&(Wo[s]=!0)}function hg(s){P(!1)}function Nd(s){let{basename:a="/",children:n=null,location:l,navigationType:p=oa.Pop,navigator:e,static:c=!1,future:t}=s;Np()&&P(!1);let o=a.replace(/^\/*/,"/"),i=B.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=B.useMemo(()=>{let Z=cg(I,o);return Z==null?null:{location:{pathname:Z,search:d,hash:j,state:u,key:m},navigationType:p}},[o,I,d,j,u,m,p]);return b==null?null:B.createElement(Xp.Provider,{value:i},B.createElement(vp.Provider,{children:n,value:b}))}function Hd(s){let{children:a,location:n}=s;return bd(oc(a),n)}new Promise(()=>{});function oc(s,a){a===void 0&&(a=[]);let n=[];return B.Children.forEach(s,(l,p)=>{if(!B.isValidElement(l))return;let e=[...a,p];if(l.type===B.Fragment){n.push.apply(n,oc(l.props.children,e));return}l.type!==hg&&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=oc(l.props.children,e)),n.push(c)}),n}/** + * React Router DOM v6.22.3 * * 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 rc(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 Kd(s,a){let n=rc(s);return a&&a.forEach((l,p)=>{n.has(p)||a.getAll(p).forEach(e=>{n.append(p,e)})}),n}const Md="startTransition",Go=Hg[Md];function Sd(s){let{basename:a,children:n,future:l,window:p}=s,e=W.useRef();e.current==null&&(e.current=TI({window:p,v5Compat:!0}));let c=e.current,[t,o]=W.useState({action:c.action,location:c.location}),{v7_startTransition:i}=l||{},I=W.useCallback(d=>{i&&Go?Go(()=>o(d)):o(d)},[o,i]);return W.useLayoutEffect(()=>c.listen(I),[c,I]),W.createElement(Hd,{basename:a,children:n,location:t.location,navigationType:t.action,navigator:c,future:l})}var Vo;(function(s){s.UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState"})(Vo||(Vo={}));var fo;(function(s){s.UseFetcher="useFetcher",s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(fo||(fo={}));function xd(s){let a=W.useRef(rc(s)),n=W.useRef(!1),l=Hp(),p=W.useMemo(()=>Kd(l.search,n.current?null:a.current),[l.search]),e=md(),c=W.useCallback((t,o)=>{const i=rc(typeof t=="function"?t(p):t);n.current=!0,e("?"+i,o)},[e,p]);return[p,c]}const Jd="_component_nqcni_1",zd="_sideNav_nqcni_6",Dd="_main_nqcni_13",Ed="_children_nqcni_21",Rl={component:Jd,sideNav:zd,main:Dd,children:Ed},Qd="_list_1ltry_1",Td="_title_1ltry_6",Ud="_listItem_1ltry_11",_d="_listItemActive_1ltry_18",Ld="_link_1ltry_26",xa={list:Qd,title:Td,listItem:Ud,listItemActive:_d,link:Ld},Od=[{lang:"Armenian",url:"https://pranatech.org/solidity-by-example-hy/"},{lang:"Persian",url:"https://solidifa.ir/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"}],Pd=[{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:"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:"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"}],$d=[{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"}],qd=[{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"}],sC=[{path:"storage",title:"EVM Storage Layout"},{path:"memory",title:"EVM Memory Layout"}],aC=[{path:"echidna",title:"Echidna"}],nC=[{path:"uniswap-v2",title:"Uniswap V2 Swap"},{path:"uniswap-v2-add-remove-liquidity",title:"Uniswap V2 Add Remove Liquidity"},{path:"uniswap-v2-optimal-one-sided-supply",title:"Uniswap V2 Optimal One Sided Supply"},{path:"uniswap-v2-flash-swap",title:"Uniswap V2 Flash Swap"},{path:"uniswap-v3-swap",title:"Uniswap V3 Swap"},{path:"uniswap-v3-liquidity",title:"Uniswap V3 Liquidity"},{path:"uniswap-v3-flash",title:"Uniswap V3 Flash Loan"},{path:"uniswap-v3-flash-swap",title:"Uniswap V3 Flash Swap Arbitrage"},{path:"chainlink-price-oracle",title:"Chainlink Price Oracle"},{path:"dai-proxy",title:"DAI Proxy"},{path:"staking-rewards",title:"Staking Rewards"},{path:"discrete-staking-rewards",title:"Discrete Staking Rewards"},{path:"vault",title:"Vault"},{path:"constant-sum-amm",title:"Constant Sum AMM"},{path:"constant-product-amm",title:"Constant Product AMM"},{path:"stable-swap-amm",title:"Stable Swap AMM"}],ot=[{title:"",routes:Pd.map(s=>({...s,path:`/${s.path}`}))},{title:"Applications",routes:$d.map(s=>({...s,path:`/app/${s.path}`}))},{title:"Hacks",routes:qd.map(s=>({...s,path:`/hacks/${s.path}`}))},{title:"EVM",routes:sC.map(s=>({...s,path:`/evm/${s.path}`}))},{title:"Tests",routes:aC.map(s=>({...s,path:`/tests/${s.path}`}))},{title:"DeFi",routes:nC.map(s=>({...s,path:`/defi/${s.path}`}))}],Cp=ot.map(({routes:s})=>s).flat(),lC=Cp.reduce((s,a,n)=>(s[a.path]=n,s),{});function pC(s){const a=lC[s];if(a>=0){const n=Cp[a-1]||null,l=Cp[a+1]||null;return{prev:n,next:l}}return{prev:null,next:null}}const eC=({onClick:s})=>{const a=Hp();function n(l,p){l.preventDefault(),s(p)}return r.jsxs(r.Fragment,{children:[r.jsx("h3",{className:xa.category,children:"Basic"}),ot.map(({routes:l,title:p},e)=>r.jsxs("div",{children:[p&&r.jsx("h3",{className:xa.title,children:p}),r.jsx("ul",{className:xa.list,children:l.map(({path:c,title:t})=>{const o=!!eg(c,a.pathname);return r.jsx("li",{className:o?xa.listItemActive:xa.listItem,children:r.jsx("a",{className:xa.link,href:c,onClick:i=>n(i,c),children:t})},c)})})]},e))]})},cC=({size:s,className:a="",onClick:n})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",strokeWidth:2,stroke:"currentColor",className:a,width:s,height:s,onClick:n,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})}),tC="_component_15x91_1",oC="_a_15x91_13",rC="_center_15x91_16",iC="_logo_15x91_21",gC="_header_15x91_24",hC="_mode_15x91_28",IC="_hamburger_15x91_33",aa={component:tC,a:oC,center:rC,logo:iC,header:gC,mode:hC,hamburger:IC},dC=({size:s,className:a=""})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#fff",viewBox:"0 0 438.277 438.277",width:s,height:s,className:a,children:r.jsx("path",{d:"M428.756 300.104c-.664-3.81-2.334-7.047-4.996-9.713-5.9-5.903-12.752-7.142-20.554-3.716-20.937 9.708-42.641 14.558-65.097 14.558-28.171 0-54.152-6.94-77.943-20.838-23.791-13.894-42.631-32.736-56.525-56.53-13.899-23.793-20.844-49.773-20.844-77.945 0-21.888 4.333-42.683 12.991-62.384 8.66-19.7 21.176-36.973 37.543-51.82 6.283-5.898 7.713-12.752 4.287-20.557-3.236-7.801-9.041-11.511-17.415-11.132-29.121 1.141-56.72 7.664-82.797 19.556C111.33 31.478 88.917 47.13 70.168 66.548c-18.747 19.414-33.595 42.399-44.54 68.95-10.942 26.553-16.416 54.39-16.416 83.511 0 29.694 5.806 58.054 17.416 85.082 11.613 27.028 27.218 50.344 46.824 69.949 19.604 19.599 42.92 35.207 69.951 46.822 27.028 11.607 55.384 17.415 85.075 17.415 42.64 0 81.987-11.563 118.054-34.69 36.069-23.124 63.05-54.006 80.944-92.645 1.524-3.423 1.951-7.036 1.28-10.838zm-122.191 84.064c-24.646 11.711-50.676 17.562-78.087 17.562-24.743 0-48.39-4.853-70.947-14.558-22.554-9.705-41.971-22.695-58.246-38.972-16.271-16.272-29.259-35.686-38.97-58.241-9.707-22.556-14.561-46.203-14.561-70.948 0-40.922 12.135-77.466 36.403-109.636 24.266-32.165 55.531-53.959 93.788-65.379-19.795 31.405-29.694 65.379-29.694 101.926 0 34.644 8.564 66.715 25.697 96.223 17.128 29.499 40.446 52.811 69.95 69.948 29.499 17.129 61.565 25.694 96.211 25.694 10.656 0 21.129-.855 31.408-2.57-17.318 20.938-38.307 37.255-62.952 48.951z"})}),CC=({size:s,className:a=""})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 302.4 302.4",width:s,height:s,className:a,children:[r.jsx("path",{d:"M204.8 97.6C191.2 84 172 75.2 151.2 75.2s-40 8.4-53.6 22.4c-13.6 13.6-22.4 32.8-22.4 53.6s8.8 40 22.4 53.6c13.6 13.6 32.8 22.4 53.6 22.4s40-8.4 53.6-22.4c13.6-13.6 22.4-32.8 22.4-53.6s-8.4-40-22.4-53.6zm-14.4 92.8c-10 10-24 16-39.2 16s-29.2-6-39.2-16-16-24-16-39.2 6-29.2 16-39.2 24-16 39.2-16 29.2 6 39.2 16 16 24 16 39.2-6 29.2-16 39.2z",stroke:"#252519",strokeWidth:12}),r.jsx("path",{d:"M292 140.8h-30.8c-5.6 0-10.4 4.8-10.4 10.4 0 5.6 4.8 10.4 10.4 10.4H292c5.6 0 10.4-4.8 10.4-10.4 0-5.6-4.8-10.4-10.4-10.4zm-140.8 110c-5.6 0-10.4 4.8-10.4 10.4V292c0 5.6 4.8 10.4 10.4 10.4 5.6 0 10.4-4.8 10.4-10.4v-30.8c0-5.6-4.8-10.4-10.4-10.4zm106.8-7.2-22-22c-3.6-4-10.4-4-14.4 0s-4 10.4 0 14.4l22 22c4 4 10.4 4 14.4 0s4-10.4 0-14.4zM151.2 0c-5.6 0-10.4 4.8-10.4 10.4v30.8c0 5.6 4.8 10.4 10.4 10.4 5.6 0 10.4-4.8 10.4-10.4V10.4c0-5.6-4.8-10.4-10.4-10.4zm107.2 44.4c-4-4-10.4-4-14.4 0l-22 22c-4 4-4 10.4 0 14.4 3.6 4 10.4 4 14.4 0l22-22c4-4 4-10.4 0-14.4zM41.2 140.8H10.4c-5.6 0-10.4 4.8-10.4 10.4s4.4 10.4 10.4 10.4h30.8c5.6 0 10.4-4.8 10.4-10.4 0-5.6-4.8-10.4-10.4-10.4zm39.2 80.8c-3.6-4-10.4-4-14.4 0l-22 22c-4 4-4 10.4 0 14.4s10.4 4 14.4 0l22-22c4-4 4-10.4 0-14.4zm0-155.2-22-22c-4-4-10.4-4-14.4 0s-4 10.4 0 14.4l22 22c4 4 10.4 4 14.4 0s4-10.4 0-14.4z",stroke:"#252519",strokeWidth:5})]}),jC=({size:s,className:a="",fill:n})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1300 1300",xmlSpace:"preserve",width:s,height:s,className:a,fill:n,children:[r.jsx("path",{opacity:.45,d:"M773.772 253.308 643.068 485.61H381.842l130.614-232.302h261.316"}),r.jsx("path",{opacity:.6,d:"M643.068 485.61h261.318L773.772 253.308H512.456L643.068 485.61z"}),r.jsx("path",{opacity:.8,d:"M512.456 717.822 643.068 485.61 512.456 253.308 381.842 485.61l130.614 232.212z"}),r.jsx("path",{opacity:.45,d:"m513.721 1066.275 130.704-232.303h261.318l-130.705 232.303H513.721"}),r.jsx("path",{opacity:.6,d:"M644.424 833.973H383.107l130.613 232.303h261.317L644.424 833.973z"}),r.jsx("path",{opacity:.8,d:"M775.038 601.761 644.424 833.973l130.614 232.303 130.704-232.303-130.704-232.212z"})]});function uC(){const{state:s,setTheme:a,toggleSideNav:n}=et();function l(){a(s.theme=="light"?"dark":"light")}return r.jsxs("div",{className:aa.component,children:[r.jsx(cC,{size:20,className:aa.hamburger,onClick:n}),r.jsxs("div",{className:aa.center,children:[r.jsx("a",{href:"/",className:aa.a,children:r.jsx(jC,{className:aa.logo,size:30,fill:s.theme=="dark"?"rgb(0, 255, 0)":"currentColor"})}),r.jsx("h3",{className:aa.header,children:r.jsx("a",{href:"/",className:aa.a,children:"Solidity by Example"})})]}),r.jsx("button",{className:aa.mode,onClick:l,children:s.theme=="dark"?r.jsx(dC,{size:20}):r.jsx(CC,{size:20})})]})}const Ig="https://cryptojobslist.com/solidity",AC="_component_h47vh_1",yC="_row_h47vh_8",mC="_bar_h47vh_13",bC="_to_h47vh_21",wC="_social_h47vh_24",kC="_sce_h47vh_29",ZC="_telegram_h47vh_34",WC="_discord_h47vh_38",BC="_youTube_h47vh_42",Is={component:AC,row:yC,bar:mC,to:bC,social:wC,sce:kC,telegram:ZC,discord:WC,youTube:BC},GC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK0AAADACAYAAAB2xePHAAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAAtdEVYdENyZWF0aW9uIFRpbWUARnJpIDE5IEZlYiAyMDIxIDA2OjI5OjE1IEFNIEpTVJ0PYF0AAA5FSURBVHic7Z3Li2RXHce/5956d1dXV/ekk0AmBC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WGXiCrqzcHWlvZv5/r1+ntrTz8POms/rJqZMMGTp7k4kW6uqLJaMLqHB2xVdiyhatXOX48pXzUmQvTmfGp1ejrY2CA3bvDdlyW50grK3Z0cORIyEfbtsVUsjQ9c+ps3MiZM1y4wKZNMRQsS9ecOj09XLvG0aO0VTqrkvDIaWTJEnbtYnAw5KOWliqiPgcjp5HOzpCPrlxh8+bFjrY0R7HYUZ5Tshy/xVYxb4aH2bOH7m4uXVrsaFM1TEvlt04zZmY4dox9+xgbqyrqdN2cdDl9OoyWwcGqI0/nUjVnYIDt28NTfPXGkKQ5IyNhpHR1cfZsTCVTNaF8Iz5PnnDiBHv3hsQbn6kaRmKr0N8fRsuNG7GVNDKcI97XdPMmO3eGR4S0jIHhmhjmjI9z+DCHDjGdVsprIII5p05x8CD371ca9hl4UMODSkOeP19puH/AcI47sVUkys85bsVWkSiDLwoJmtOWZ6H8dCi2ksQYyhir1+dciSolPb5ltnipP6KQFPmaFwWTT+ORUDA5kkMWEvIncTUlw6fZ3OfNgpaCUwnUAcds/QVP/6u1YHnBZwmIjNHOFbOrfJpT8EHBUAKCq2h3i1C9n8/14e+WFLXgPWFJ0TvCkqLXxajn+fd4jJ/wg7Cs6DLOZU1mQ5ua04wi/Am4Fq8Id7lWs4vSVjX0W4W7X17GaZ9zqvriszr19xb++ov9EZ40bD/GVNkfFWYzJ8vjJsp+fWHaJH7BnSzsmzd/AkgxNaTAmykLAAAAAElFTkSuQmCC",VC="/assets/telegram-zGrx4xca.png",fC="/assets/discord-akqDA9xj.png";function YC(){return r.jsxs("div",{className:Is.component,children:[r.jsxs("div",{className:Is.row,children:[r.jsx("img",{src:GC,alt:"smart contract engineer",className:Is.sce}),r.jsx("a",{href:"https://www.smartcontract.engineer",target:"__blank",children:"Smart Contract Engineer"})]}),r.jsxs("div",{className:Is.social,children:[r.jsxs("div",{className:Is.row,children:[r.jsx("img",{src:fC,alt:"discord",className:Is.discord}),r.jsx("a",{href:"https://discord.gg/bt8FK2wkcW",target:"__blank",children:"Discord"})]}),r.jsxs("div",{className:Is.row,children:[r.jsx("img",{src:VC,alt:"telegram",className:Is.telegram}),r.jsx("a",{href:"https://t.me/smartcontractprogrammer",target:"__blank",children:"Telegram"})]}),r.jsxs("div",{className:Is.row,children:[r.jsx("img",{src:dg,alt:"youtube",className:Is.youTube}),r.jsx("a",{href:"https://www.youtube.com/channel/UCJWh7F3AFyQ_x01VKzr9eyA",target:"__blank",children:"YouTube"})]})]}),r.jsx("div",{className:Is.row,children:r.jsx("a",{href:"mailto:contact@solidity-by-example.org",children:"contact@solidity-by-example.org"})}),r.jsxs("div",{className:Is.row,children:[r.jsx("a",{href:"https://github.com/solidity-by-example/solidity-by-example.github.io",target:"__blank",children:"Source"}),r.jsx("div",{className:Is.bar,children:"|"}),r.jsx("a",{href:"https://github.com/solidity-by-example/solidity-by-example.github.io/blob/gh-pages/LICENSE",target:"__blank",children:"License"}),r.jsx("div",{className:Is.bar,children:"|"}),r.jsx("a",{href:Ig,target:"__blank",children:"Solidity jobs"})]})]})}const RC=({children:s})=>{const{state:a}=et(),n=W.useRef(null);W.useLayoutEffect(()=>{n.current&&(n.current.scrollTop=parseInt(sessionStorage.getItem("scroll")||"0")||0)},[]);function l(p){var e;sessionStorage.setItem("scroll",(((e=n.current)==null?void 0:e.scrollTop)||0).toString()),window.location.href=p}return r.jsxs("div",{className:Rl.component,children:[r.jsx("div",{ref:n,className:Rl.sideNav,style:a.sideNav?{width:"var(--side-nav-width)",padding:"20px 10px 60px 10px"}:{width:0},children:a.sideNav?r.jsx(eC,{onClick:l}):null}),r.jsxs("div",{className:Rl.main,children:[r.jsx(uC,{}),r.jsxs("div",{className:Rl.children,children:[s,r.jsx(YC,{})]})]})]})},Cg=({title:s,description:a})=>(W.useEffect(()=>{document.title=s;const n=document.querySelector("meta[name='description']");n&&n.setAttribute("content",a)},[]),null),Yo=' ',XC='';function vC(s=[]){W.useEffect(()=>{const a=p=>{try{const e=document.createElement("textarea");e.setAttribute("style","width:1px;border:0;opacity:0;"),document.body.appendChild(e),navigator.clipboard.writeText(p.innerText),document.body.removeChild(e)}catch(e){console.error(e)}},n=[];return document.querySelectorAll("pre").forEach(p=>{var i;if(((i=p.parentElement)==null?void 0:i.className)=="copy-wrapper")return;const e=document.createElement("div");e.className="copy-wrapper",p.parentElement.insertBefore(e,p),e.appendChild(p);const c=document.createElement("button");c.className="copy",c.title="Copy",c.innerHTML=Yo,c.ariaLabel="Copy to clipboard",p.after(c);function t(I){I.preventDefault(),a(p.childNodes[0]),c.innerHTML=XC}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(vC([]),r.jsx("div",{className:`code ${s}`,dangerouslySetInnerHTML:{__html:a}})),HC="_component_ni5i2_1",FC="_content_ni5i2_5",KC="_prevNext_ni5i2_8",he={component:HC,content:FC,prevNext:KC},u=({title:s,version:a,description:n,html:l,prev:p,next:e,codes:c})=>r.jsxs("div",{className:he.component,children:[r.jsx(Cg,{title:`${s} | Solidity by Example | ${a}`,description:n}),r.jsxs("div",{className:he.content,children:[r.jsx("h2",{children:s}),r.jsx(NC,{html:l}),r.jsxs("div",{className:he.prevNext,children:[p&&r.jsxs("a",{href:p.path,children:["< ",p.title]}),e&&r.jsxs("a",{href:e.path,children:[e.title," >"]})]}),r.jsx("h3",{children:"Try on Remix"}),r.jsx("ul",{children:c.map(({fileName:t,code:o},i)=>r.jsx("li",{children:r.jsx("a",{href:`https://remix.ethereum.org/?#code=${o}`,target:"_blank",rel:"noreferrer",children:t})},i))})]})]}),MC="0.8.24",SC="ABI Decode",xC="ABI decode bytes",JC=[{fileName:"AbiDecode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFiaURlY29kZSB7CiAgICBzdHJ1Y3QgTXlTdHJ1Y3QgewogICAgICAgIHN0cmluZyBuYW1lOwogICAgICAgIHVpbnQyNTZbMl0gbnVtczsKICAgIH0KCiAgICBmdW5jdGlvbiBlbmNvZGUoCiAgICAgICAgdWludDI1NiB4LAogICAgICAgIGFkZHJlc3MgYWRkciwKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgYXJyLAogICAgICAgIE15U3RydWN0IGNhbGxkYXRhIG15U3RydWN0CiAgICApIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGFiaS5lbmNvZGUoeCwgYWRkciwgYXJyLCBteVN0cnVjdCk7CiAgICB9CgogICAgZnVuY3Rpb24gZGVjb2RlKGJ5dGVzIGNhbGxkYXRhIGRhdGEpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoCiAgICAgICAgICAgIHVpbnQyNTYgeCwKICAgICAgICAgICAgYWRkcmVzcyBhZGRyLAogICAgICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFyciwKICAgICAgICAgICAgTXlTdHJ1Y3QgbWVtb3J5IG15U3RydWN0CiAgICAgICAgKQogICAgewogICAgICAgIC8vICh1aW50IHgsIGFkZHJlc3MgYWRkciwgdWludFtdIG1lbW9yeSBhcnIsIE15U3RydWN0IG15U3RydWN0KSA9IC4uLgogICAgICAgICh4LCBhZGRyLCBhcnIsIG15U3RydWN0KSA9CiAgICAgICAgICAgIGFiaS5kZWNvZGUoZGF0YSwgKHVpbnQyNTYsIGFkZHJlc3MsIHVpbnQyNTZbXSwgTXlTdHJ1Y3QpKTsKICAgIH0KfQo="}],zC=`

abi.encode encodes data into bytes.

+ */function rc(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 Fd(s,a){let n=rc(s);return a&&a.forEach((l,p)=>{n.has(p)||a.getAll(p).forEach(e=>{n.append(p,e)})}),n}const Kd="6";try{window.__reactRouterVersion=Kd}catch{}const Md="startTransition",Bo=Hg[Md];function Sd(s){let{basename:a,children:n,future:l,window:p}=s,e=B.useRef();e.current==null&&(e.current=TI({window:p,v5Compat:!0}));let c=e.current,[t,o]=B.useState({action:c.action,location:c.location}),{v7_startTransition:i}=l||{},I=B.useCallback(d=>{i&&Bo?Bo(()=>o(d)):o(d)},[o,i]);return B.useLayoutEffect(()=>c.listen(I),[c,I]),B.createElement(Nd,{basename:a,children:n,location:t.location,navigationType:t.action,navigator:c,future:l})}var Go;(function(s){s.UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState"})(Go||(Go={}));var Vo;(function(s){s.UseFetcher="useFetcher",s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(Vo||(Vo={}));function xd(s){let a=B.useRef(rc(s)),n=B.useRef(!1),l=Hp(),p=B.useMemo(()=>Fd(l.search,n.current?null:a.current),[l.search]),e=yd(),c=B.useCallback((t,o)=>{const i=rc(typeof t=="function"?t(p):t);n.current=!0,e("?"+i,o)},[e,p]);return[p,c]}const Jd="_component_nqcni_1",zd="_sideNav_nqcni_6",Dd="_main_nqcni_13",Ed="_children_nqcni_21",Rl={component:Jd,sideNav:zd,main:Dd,children:Ed},Qd="_list_1ltry_1",Td="_title_1ltry_6",Ud="_listItem_1ltry_11",_d="_listItemActive_1ltry_18",Ld="_link_1ltry_26",xa={list:Qd,title:Td,listItem:Ud,listItemActive:_d,link:Ld},Od=[{lang:"Armenian",url:"https://pranatech.org/solidity-by-example-hy/"},{lang:"Persian",url:"https://solidifa.ir/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"}],Pd=[{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:"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:"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"}],$d=[{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"}],qd=[{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"}],sC=[{path:"storage",title:"EVM Storage Layout"},{path:"memory",title:"EVM Memory Layout"}],aC=[{path:"echidna",title:"Echidna"}],nC=[{path:"uniswap-v2",title:"Uniswap V2 Swap"},{path:"uniswap-v2-add-remove-liquidity",title:"Uniswap V2 Add Remove Liquidity"},{path:"uniswap-v2-optimal-one-sided-supply",title:"Uniswap V2 Optimal One Sided Supply"},{path:"uniswap-v2-flash-swap",title:"Uniswap V2 Flash Swap"},{path:"uniswap-v3-swap",title:"Uniswap V3 Swap"},{path:"uniswap-v3-liquidity",title:"Uniswap V3 Liquidity"},{path:"uniswap-v3-flash",title:"Uniswap V3 Flash Loan"},{path:"uniswap-v3-flash-swap",title:"Uniswap V3 Flash Swap Arbitrage"},{path:"chainlink-price-oracle",title:"Chainlink Price Oracle"},{path:"dai-proxy",title:"DAI Proxy"},{path:"staking-rewards",title:"Staking Rewards"},{path:"discrete-staking-rewards",title:"Discrete Staking Rewards"},{path:"vault",title:"Vault"},{path:"constant-sum-amm",title:"Constant Sum AMM"},{path:"constant-product-amm",title:"Constant Product AMM"},{path:"stable-swap-amm",title:"Stable Swap AMM"}],tt=[{title:"",routes:Pd.map(s=>({...s,path:`/${s.path}`}))},{title:"Applications",routes:$d.map(s=>({...s,path:`/app/${s.path}`}))},{title:"Hacks",routes:qd.map(s=>({...s,path:`/hacks/${s.path}`}))},{title:"EVM",routes:sC.map(s=>({...s,path:`/evm/${s.path}`}))},{title:"Tests",routes:aC.map(s=>({...s,path:`/tests/${s.path}`}))},{title:"DeFi",routes:nC.map(s=>({...s,path:`/defi/${s.path}`}))}],Cp=tt.map(({routes:s})=>s).flat(),lC=Cp.reduce((s,a,n)=>(s[a.path]=n,s),{});function pC(s){const a=lC[s];if(a>=0){const n=Cp[a-1]||null,l=Cp[a+1]||null;return{prev:n,next:l}}return{prev:null,next:null}}const eC=({onClick:s})=>{const a=Hp();function n(l,p){l.preventDefault(),s(p)}return r.jsxs(r.Fragment,{children:[r.jsx("h3",{className:xa.category,children:"Basic"}),tt.map(({routes:l,title:p},e)=>r.jsxs("div",{children:[p&&r.jsx("h3",{className:xa.title,children:p}),r.jsx("ul",{className:xa.list,children:l.map(({path:c,title:t})=>{const o=!!eg(c,a.pathname);return r.jsx("li",{className:o?xa.listItemActive:xa.listItem,children:r.jsx("a",{className:xa.link,href:c,onClick:i=>n(i,c),children:t})},c)})})]},e))]})},cC=({size:s,className:a="",onClick:n})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",strokeWidth:2,stroke:"currentColor",className:a,width:s,height:s,onClick:n,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})}),tC="_component_15x91_1",oC="_a_15x91_13",rC="_center_15x91_16",iC="_logo_15x91_21",gC="_header_15x91_24",hC="_mode_15x91_28",IC="_hamburger_15x91_33",aa={component:tC,a:oC,center:rC,logo:iC,header:gC,mode:hC,hamburger:IC},dC=({size:s,className:a=""})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#fff",viewBox:"0 0 438.277 438.277",width:s,height:s,className:a,children:r.jsx("path",{d:"M428.756 300.104c-.664-3.81-2.334-7.047-4.996-9.713-5.9-5.903-12.752-7.142-20.554-3.716-20.937 9.708-42.641 14.558-65.097 14.558-28.171 0-54.152-6.94-77.943-20.838-23.791-13.894-42.631-32.736-56.525-56.53-13.899-23.793-20.844-49.773-20.844-77.945 0-21.888 4.333-42.683 12.991-62.384 8.66-19.7 21.176-36.973 37.543-51.82 6.283-5.898 7.713-12.752 4.287-20.557-3.236-7.801-9.041-11.511-17.415-11.132-29.121 1.141-56.72 7.664-82.797 19.556C111.33 31.478 88.917 47.13 70.168 66.548c-18.747 19.414-33.595 42.399-44.54 68.95-10.942 26.553-16.416 54.39-16.416 83.511 0 29.694 5.806 58.054 17.416 85.082 11.613 27.028 27.218 50.344 46.824 69.949 19.604 19.599 42.92 35.207 69.951 46.822 27.028 11.607 55.384 17.415 85.075 17.415 42.64 0 81.987-11.563 118.054-34.69 36.069-23.124 63.05-54.006 80.944-92.645 1.524-3.423 1.951-7.036 1.28-10.838zm-122.191 84.064c-24.646 11.711-50.676 17.562-78.087 17.562-24.743 0-48.39-4.853-70.947-14.558-22.554-9.705-41.971-22.695-58.246-38.972-16.271-16.272-29.259-35.686-38.97-58.241-9.707-22.556-14.561-46.203-14.561-70.948 0-40.922 12.135-77.466 36.403-109.636 24.266-32.165 55.531-53.959 93.788-65.379-19.795 31.405-29.694 65.379-29.694 101.926 0 34.644 8.564 66.715 25.697 96.223 17.128 29.499 40.446 52.811 69.95 69.948 29.499 17.129 61.565 25.694 96.211 25.694 10.656 0 21.129-.855 31.408-2.57-17.318 20.938-38.307 37.255-62.952 48.951z"})}),CC=({size:s,className:a=""})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 302.4 302.4",width:s,height:s,className:a,children:[r.jsx("path",{d:"M204.8 97.6C191.2 84 172 75.2 151.2 75.2s-40 8.4-53.6 22.4c-13.6 13.6-22.4 32.8-22.4 53.6s8.8 40 22.4 53.6c13.6 13.6 32.8 22.4 53.6 22.4s40-8.4 53.6-22.4c13.6-13.6 22.4-32.8 22.4-53.6s-8.4-40-22.4-53.6zm-14.4 92.8c-10 10-24 16-39.2 16s-29.2-6-39.2-16-16-24-16-39.2 6-29.2 16-39.2 24-16 39.2-16 29.2 6 39.2 16 16 24 16 39.2-6 29.2-16 39.2z",stroke:"#252519",strokeWidth:12}),r.jsx("path",{d:"M292 140.8h-30.8c-5.6 0-10.4 4.8-10.4 10.4 0 5.6 4.8 10.4 10.4 10.4H292c5.6 0 10.4-4.8 10.4-10.4 0-5.6-4.8-10.4-10.4-10.4zm-140.8 110c-5.6 0-10.4 4.8-10.4 10.4V292c0 5.6 4.8 10.4 10.4 10.4 5.6 0 10.4-4.8 10.4-10.4v-30.8c0-5.6-4.8-10.4-10.4-10.4zm106.8-7.2-22-22c-3.6-4-10.4-4-14.4 0s-4 10.4 0 14.4l22 22c4 4 10.4 4 14.4 0s4-10.4 0-14.4zM151.2 0c-5.6 0-10.4 4.8-10.4 10.4v30.8c0 5.6 4.8 10.4 10.4 10.4 5.6 0 10.4-4.8 10.4-10.4V10.4c0-5.6-4.8-10.4-10.4-10.4zm107.2 44.4c-4-4-10.4-4-14.4 0l-22 22c-4 4-4 10.4 0 14.4 3.6 4 10.4 4 14.4 0l22-22c4-4 4-10.4 0-14.4zM41.2 140.8H10.4c-5.6 0-10.4 4.8-10.4 10.4s4.4 10.4 10.4 10.4h30.8c5.6 0 10.4-4.8 10.4-10.4 0-5.6-4.8-10.4-10.4-10.4zm39.2 80.8c-3.6-4-10.4-4-14.4 0l-22 22c-4 4-4 10.4 0 14.4s10.4 4 14.4 0l22-22c4-4 4-10.4 0-14.4zm0-155.2-22-22c-4-4-10.4-4-14.4 0s-4 10.4 0 14.4l22 22c4 4 10.4 4 14.4 0s4-10.4 0-14.4z",stroke:"#252519",strokeWidth:5})]}),jC=({size:s,className:a="",fill:n})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1300 1300",xmlSpace:"preserve",width:s,height:s,className:a,fill:n,children:[r.jsx("path",{opacity:.45,d:"M773.772 253.308 643.068 485.61H381.842l130.614-232.302h261.316"}),r.jsx("path",{opacity:.6,d:"M643.068 485.61h261.318L773.772 253.308H512.456L643.068 485.61z"}),r.jsx("path",{opacity:.8,d:"M512.456 717.822 643.068 485.61 512.456 253.308 381.842 485.61l130.614 232.212z"}),r.jsx("path",{opacity:.45,d:"m513.721 1066.275 130.704-232.303h261.318l-130.705 232.303H513.721"}),r.jsx("path",{opacity:.6,d:"M644.424 833.973H383.107l130.613 232.303h261.317L644.424 833.973z"}),r.jsx("path",{opacity:.8,d:"M775.038 601.761 644.424 833.973l130.614 232.303 130.704-232.303-130.704-232.212z"})]});function AC(){const{state:s,setTheme:a,toggleSideNav:n}=et();function l(){a(s.theme=="light"?"dark":"light")}return r.jsxs("div",{className:aa.component,children:[r.jsx(cC,{size:20,className:aa.hamburger,onClick:n}),r.jsxs("div",{className:aa.center,children:[r.jsx("a",{href:"/",className:aa.a,children:r.jsx(jC,{className:aa.logo,size:30,fill:s.theme=="dark"?"rgb(0, 255, 0)":"currentColor"})}),r.jsx("h3",{className:aa.header,children:r.jsx("a",{href:"/",className:aa.a,children:"Solidity by Example"})})]}),r.jsx("button",{className:aa.mode,onClick:l,children:s.theme=="dark"?r.jsx(dC,{size:20}):r.jsx(CC,{size:20})})]})}const Ig="https://cryptojobslist.com/solidity",uC="_component_h47vh_1",yC="_row_h47vh_8",mC="_bar_h47vh_13",bC="_to_h47vh_21",wC="_social_h47vh_24",kC="_sce_h47vh_29",ZC="_telegram_h47vh_34",WC="_discord_h47vh_38",BC="_youTube_h47vh_42",Is={component:uC,row:yC,bar:mC,to:bC,social:wC,sce:kC,telegram:ZC,discord:WC,youTube:BC},GC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK0AAADACAYAAAB2xePHAAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAAtdEVYdENyZWF0aW9uIFRpbWUARnJpIDE5IEZlYiAyMDIxIDA2OjI5OjE1IEFNIEpTVJ0PYF0AAA5FSURBVHic7Z3Li2RXHce/5956d1dXV/ekk0AmBCQORLIZRSQm2cSJQUwWMiAJJBo3uhAh/huBBCQLXWhMAgnCrBJQ40SQPHyAzia4mOhCbITY8+iurld3Vd17XHTa6a7p6rqP3z3n9zt1Pqt59ONU1bdunfs7n9856r7PPaDh8QgisD0AjyctPrQecfjQesThQ+sRhw+tRxw+tB5x+NB6xOFD6xGHD61HHD60HnH40HrE4UPrEYcPrUccPrQecfjQesRRsj0A04zvGSO+e2x7GPnZC1D9uGZ7FFZYqNDqksb1F/8DBFr8Z0z4aQntF+9E+d8V20MxjvCXLh27z91AdM8Y0ls11Egh6IQYPLFreyhWWJjQRq0I3W/vHPz5rjEQyY1uuF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nDiBHv3hsQbn6kaRmKr0N8fRsuNG7GVNDKcI97XdPMmO3eGR4S0jIHhmhjmjI9z+DCHDjGdVsprIII5p05x8CD371ca9hl4UMODSkOeP19puH/AcI47sVUkys85bsVWkSiDLwoJmtOWZ6H8dCi2ksQYyhir1+dciSolPb5ltnipP6KQFPmaFwWTT+ORUDA5kkMWEvIncTUlw6fZ3OfNgpaCUwnUAcds/QVP/6u1YHnBZwmIjNHOFbOrfJpT8EHBUAKCq2h3i1C9n8/14e+WFLXgPWFJ0TvCkqLXxajn+fd4jJ/wg7Cs6DLOZU1mQ5ua04wi/Am4Fq8Id7lWs4vSVjX0W4W7X17GaZ9zqvriszr19xb++ov9EZ40bD/GVNkfFWYzJ8vjJsp+fWHaJH7BnSzsmzd/AkgxNaTAmykLAAAAAElFTkSuQmCC",VC="/assets/telegram-DMavHjFx.png",fC="/assets/discord-BqSoMD3G.png";function YC(){return r.jsxs("div",{className:Is.component,children:[r.jsxs("div",{className:Is.row,children:[r.jsx("img",{src:GC,alt:"smart contract engineer",className:Is.sce}),r.jsx("a",{href:"https://www.smartcontract.engineer",target:"__blank",children:"Smart Contract Engineer"})]}),r.jsxs("div",{className:Is.social,children:[r.jsxs("div",{className:Is.row,children:[r.jsx("img",{src:fC,alt:"discord",className:Is.discord}),r.jsx("a",{href:"https://discord.gg/bt8FK2wkcW",target:"__blank",children:"Discord"})]}),r.jsxs("div",{className:Is.row,children:[r.jsx("img",{src:VC,alt:"telegram",className:Is.telegram}),r.jsx("a",{href:"https://t.me/smartcontractprogrammer",target:"__blank",children:"Telegram"})]}),r.jsxs("div",{className:Is.row,children:[r.jsx("img",{src:dg,alt:"youtube",className:Is.youTube}),r.jsx("a",{href:"https://www.youtube.com/channel/UCJWh7F3AFyQ_x01VKzr9eyA",target:"__blank",children:"YouTube"})]})]}),r.jsx("div",{className:Is.row,children:r.jsx("a",{href:"mailto:contact@solidity-by-example.org",children:"contact@solidity-by-example.org"})}),r.jsxs("div",{className:Is.row,children:[r.jsx("a",{href:"https://github.com/solidity-by-example/solidity-by-example.github.io",target:"__blank",children:"Source"}),r.jsx("div",{className:Is.bar,children:"|"}),r.jsx("a",{href:"https://github.com/solidity-by-example/solidity-by-example.github.io/blob/gh-pages/LICENSE",target:"__blank",children:"License"}),r.jsx("div",{className:Is.bar,children:"|"}),r.jsx("a",{href:Ig,target:"__blank",children:"Solidity jobs"})]})]})}const RC=({children:s})=>{const{state:a}=et(),n=B.useRef(null);B.useLayoutEffect(()=>{n.current&&(n.current.scrollTop=parseInt(sessionStorage.getItem("scroll")||"0")||0)},[]);function l(p){var e;sessionStorage.setItem("scroll",(((e=n.current)==null?void 0:e.scrollTop)||0).toString()),window.location.href=p}return r.jsxs("div",{className:Rl.component,children:[r.jsx("div",{ref:n,className:Rl.sideNav,style:a.sideNav?{width:"var(--side-nav-width)",padding:"20px 10px 60px 10px"}:{width:0},children:a.sideNav?r.jsx(eC,{onClick:l}):null}),r.jsxs("div",{className:Rl.main,children:[r.jsx(AC,{}),r.jsxs("div",{className:Rl.children,children:[s,r.jsx(YC,{})]})]})]})},Cg=({title:s,description:a})=>(B.useEffect(()=>{document.title=s;const n=document.querySelector("meta[name='description']");n&&n.setAttribute("content",a)},[]),null),fo=' ',XC='';function vC(s=[]){B.useEffect(()=>{const a=p=>{try{const e=document.createElement("textarea");e.setAttribute("style","width:1px;border:0;opacity:0;"),document.body.appendChild(e),navigator.clipboard.writeText(p.innerText),document.body.removeChild(e)}catch(e){console.error(e)}},n=[];return document.querySelectorAll("pre").forEach(p=>{var i;if(((i=p.parentElement)==null?void 0:i.className)=="copy-wrapper")return;const e=document.createElement("div");e.className="copy-wrapper",p.parentElement.insertBefore(e,p),e.appendChild(p);const c=document.createElement("button");c.className="copy",c.title="Copy",c.innerHTML=fo,c.ariaLabel="Copy to clipboard",p.after(c);function t(I){I.preventDefault(),a(p.childNodes[0]),c.innerHTML=XC}function o(I){I.preventDefault(),c.innerHTML=fo}c.addEventListener("click",t),c.addEventListener("blur",o),n.push(()=>{c.removeEventListener("click",t),c.removeEventListener("blur",o)})}),()=>{for(let p=0;p(vC([]),r.jsx("div",{className:`code ${s}`,dangerouslySetInnerHTML:{__html:a}})),HC="_component_ni5i2_1",FC="_content_ni5i2_5",KC="_prevNext_ni5i2_8",he={component:HC,content:FC,prevNext:KC},A=({title:s,version:a,description:n,html:l,prev:p,next:e,codes:c})=>r.jsxs("div",{className:he.component,children:[r.jsx(Cg,{title:`${s} | Solidity by Example | ${a}`,description:n}),r.jsxs("div",{className:he.content,children:[r.jsx("h2",{children:s}),r.jsx(NC,{html:l}),r.jsxs("div",{className:he.prevNext,children:[p&&r.jsxs("a",{href:p.path,children:["< ",p.title]}),e&&r.jsxs("a",{href:e.path,children:[e.title," >"]})]}),r.jsx("h3",{children:"Try on Remix"}),r.jsx("ul",{children:c.map(({fileName:t,code:o},i)=>r.jsx("li",{children:r.jsx("a",{href:`https://remix.ethereum.org/?#code=${o}`,target:"_blank",rel:"noreferrer",children:t})},i))})]})]}),MC="0.8.24",SC="ABI Decode",xC="ABI decode bytes",JC=[{fileName:"AbiDecode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFiaURlY29kZSB7CiAgICBzdHJ1Y3QgTXlTdHJ1Y3QgewogICAgICAgIHN0cmluZyBuYW1lOwogICAgICAgIHVpbnQyNTZbMl0gbnVtczsKICAgIH0KCiAgICBmdW5jdGlvbiBlbmNvZGUoCiAgICAgICAgdWludDI1NiB4LAogICAgICAgIGFkZHJlc3MgYWRkciwKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgYXJyLAogICAgICAgIE15U3RydWN0IGNhbGxkYXRhIG15U3RydWN0CiAgICApIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGFiaS5lbmNvZGUoeCwgYWRkciwgYXJyLCBteVN0cnVjdCk7CiAgICB9CgogICAgZnVuY3Rpb24gZGVjb2RlKGJ5dGVzIGNhbGxkYXRhIGRhdGEpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoCiAgICAgICAgICAgIHVpbnQyNTYgeCwKICAgICAgICAgICAgYWRkcmVzcyBhZGRyLAogICAgICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFyciwKICAgICAgICAgICAgTXlTdHJ1Y3QgbWVtb3J5IG15U3RydWN0CiAgICAgICAgKQogICAgewogICAgICAgIC8vICh1aW50IHgsIGFkZHJlc3MgYWRkciwgdWludFtdIG1lbW9yeSBhcnIsIE15U3RydWN0IG15U3RydWN0KSA9IC4uLgogICAgICAgICh4LCBhZGRyLCBhcnIsIG15U3RydWN0KSA9CiAgICAgICAgICAgIGFiaS5kZWNvZGUoZGF0YSwgKHVpbnQyNTYsIGFkZHJlc3MsIHVpbnQyNTZbXSwgTXlTdHJ1Y3QpKTsKICAgIH0KfQo="}],zC=`

abi.encode encodes data into bytes.

abi.decode decodes bytes back into data.

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.24;
@@ -99,7 +99,7 @@ Error generating stack: `+e.message+`
             abi.decode(data, (uint256, address, uint256[], MyStruct));
     }
 }
-
`,DC=({prev:s,next:a})=>r.jsx(u,{version:MC,title:SC,description:xC,html:zC,prev:s,next:a,codes:JC}),EC="0.8.24",QC="ABI Encode",TC="ABI encode",UC=[{fileName:"AbiEncode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IFRva2VuIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MsIHVpbnQyNTYpIGV4dGVybmFs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AgICByZXR1cm5zIChieXRlcyBtZW1vcnkpCiAgICB7CiAgICAgICAgLy8gVHlwbyBhbmQgdHlwZSBlcnJvcnMgd2lsbCBub3QgY29tcGlsZQogICAgICAgIHJldHVybiBhYmkuZW5jb2RlQ2FsbChJRVJDMjAudHJhbnNmZXIsICh0bywgYW1vdW50KSk7CiAgICB9Cn0K"}],_C=`
// SPDX-License-Identifier: MIT
+
`,DC=({prev:s,next:a})=>r.jsx(A,{version:MC,title:SC,description:xC,html:zC,prev:s,next:a,codes:JC}),EC="0.8.24",QC="ABI Encode",TC="ABI encode",UC=[{fileName:"AbiEncode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IFRva2VuIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MsIHVpbnQyNTYpIGV4dGVybmFsIHt9Cn0KCmNvbnRyYWN0IEFiaUVuY29kZSB7CiAgICBmdW5jdGlvbiB0ZXN0KGFkZHJlc3MgX2NvbnRyYWN0LCBieXRlcyBjYWxsZGF0YSBkYXRhKSBleHRlcm5hbCB7CiAgICAgICAgKGJvb2wgb2ssKSA9IF9jb250cmFjdC5jYWxsKGRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGVuY29kZVdpdGhTaWduYXR1cmUoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KQogICAgewogICAgICAgIC8vIFR5cG8gaXMgbm90IGNoZWNrZWQgLSAidHJhbnNmZXIoYWRkcmVzcywgdWludCkiCiAgICAgICAgcmV0dXJuIGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJ0cmFuc2ZlcihhZGRyZXNzLHVpbnQyNTYpIiwgdG8sIGFtb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZW5jb2RlV2l0aFNlbGVjdG9yKGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkKICAgIHsKICAgICAgICAvLyBUeXBlIGlzIG5vdCBjaGVja2VkIC0gKElFUkMyMC50cmFuc2Zlci5zZWxlY3RvciwgdHJ1ZSwgYW1vdW50KQogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKElFUkMyMC50cmFuc2Zlci5zZWxlY3RvciwgdG8sIGFtb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZW5jb2RlQ2FsbChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlcyBtZW1vcnkpCiAgICB7CiAgICAgICAgLy8gVHlwbyBhbmQgdHlwZSBlcnJvcnMgd2lsbCBub3QgY29tcGlsZQogICAgICAgIHJldHVybiBhYmkuZW5jb2RlQ2FsbChJRVJDMjAudHJhbnNmZXIsICh0bywgYW1vdW50KSk7CiAgICB9Cn0K"}],_C=`
// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.24;
 
 interface IERC20 {
@@ -143,7 +143,7 @@ Error generating stack: `+e.message+`
         return abi.encodeCall(IERC20.transfer, (to, amount));
     }
 }
-
`,LC=({prev:s,next:a})=>r.jsx(u,{version:EC,title:QC,description:TC,html:_C,prev:s,next:a,codes:UC}),OC="0.8.24",PC="Assembly Binary Exponentiation",$C="Example of binary exponentiation in assembly",qC=[{fileName:"AssemblyBinExp.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5QmluRXhwIHsKICAgIC8vIEJpbmFyeSBleHBvbmVudGlhdGlvbiB0byBjYWxjdWxhdGUgeCoqbgogICAgZnVuY3Rpb24gcnBvdyh1aW50MjU2IHgsIHVpbnQyNTYgbiwgdWludDI1NiBiKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICAvLyB4ID0gMAogICAgICAgICAgICBjYXNlIDAgewogICAgICAgICAgICAgICAgc3dpdGNoIG4KICAgICAgICAgICAgICAgIC8vIG4gPSAwIC0tPiB4KipuID0gMCoqMCAtLT4gMQogICAgICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSBiIH0KICAgICAgICAgICAgICAgIC8vIG4gPiAwIC0tPiB4KipuID0gMCoqbiAtLT4gMAogICAgICAgICAgICAgICAgZGVmYXVsdCB7IHogOj0gMCB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZGVmYXVsdCB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggbW9kKG4sIDIpCiAgICAgICAgICAgICAgICAvLyB4ID4gMCBhbmQgbiBpcyBldmVuIC0tPiB6ID0gMQogICAgICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSBiIH0KICAgICAgICAgICAgICAgIC8vIHggPiAwIGFuZCBuIGlzIG9kZCAtLT4geiA9IHgKICAgICAgICAgICAgICAgIGRlZmF1bHQgeyB6IDo9IHggfQoKICAgICAgICAgICAgICAgIGxldCBoYWxmIDo9IGRpdihiLCAyKSAvLyBmb3Igcm91bmRpbmcuCiAgICAgICAgICAgICAgICAvLyBuID0gbiAvIDIsIHdoaWxlIG4gPiAwLCBuID0gbiAvIDIKICAgICAgICAgICAgICAgIGZvciB7IG4gOj0gZGl2KG4sIDIpIH0gbiB7IG4gOj0gZGl2KG4sIDIpIH0gewogICAgICAgICAgICAgICAgICAgIGxldCB4eCA6PSBtdWwoeCwgeCkKICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB4eCAvIHggIT0geAogICAgICAgICAgICAgICAgICAgIGlmIGlzemVybyhlcShkaXYoeHgsIHgpLCB4KSkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICAgICAgICAgIC8vIFJvdW5kICh4eCArIGhhbGYpIC8gYgogICAgICAgICAgICAgICAgICAgIGxldCB4eFJvdW5kIDo9IGFkZCh4eCwgaGFsZikKICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB4eFJvdW5kIDwgeHgKICAgICAgICAgICAgICAgICAgICBpZiBsdCh4eFJvdW5kLCB4eCkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICAgICAgICAgIHggOj0gZGl2KHh4Um91bmQsIGIpCiAgICAgICAgICAgICAgICAgICAgLy8gaWYgbiAlIDIgPT0gMQogICAgICAgICAgICAgICAgICAgIGlmIG1vZChuLCAyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eCA6PSBtdWwoeiwgeCkKICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmV2ZXJ0IGlmIHggIT0gMCBhbmQgenggLyB4ICE9IHoKICAgICAgICAgICAgICAgICAgICAgICAgaWYgYW5kKGlzemVybyhpc3plcm8oeCkpLCBpc3plcm8oZXEoZGl2KHp4LCB4KSwgeikpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXZlcnQoMCwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAvLyBSb3VuZCAoenggKyBoYWxmKSAvIGIKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp4Um91bmQgOj0gYWRkKHp4LCBoYWxmKQogICAgICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB6eFJvdW5kIDwgengKICAgICAgICAgICAgICAgICAgICAgICAgaWYgbHQoenhSb3VuZCwgengpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICAgICAgICAgICAgICAgICAgeiA6PSBkaXYoenhSb3VuZCwgYikKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0K"}],sj=`

Example of binary exponentiation in assembly

+`,LC=({prev:s,next:a})=>r.jsx(A,{version:EC,title:QC,description:TC,html:_C,prev:s,next:a,codes:UC}),OC="0.8.24",PC="Assembly Binary Exponentiation",$C="Example of binary exponentiation in assembly",qC=[{fileName:"AssemblyBinExp.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5QmluRXhwIHsKICAgIC8vIEJpbmFyeSBleHBvbmVudGlhdGlvbiB0byBjYWxjdWxhdGUgeCoqbgogICAgZnVuY3Rpb24gcnBvdyh1aW50MjU2IHgsIHVpbnQyNTYgbiwgdWludDI1NiBiKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICAvLyB4ID0gMAogICAgICAgICAgICBjYXNlIDAgewogICAgICAgICAgICAgICAgc3dpdGNoIG4KICAgICAgICAgICAgICAgIC8vIG4gPSAwIC0tPiB4KipuID0gMCoqMCAtLT4gMQogICAgICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSBiIH0KICAgICAgICAgICAgICAgIC8vIG4gPiAwIC0tPiB4KipuID0gMCoqbiAtLT4gMAogICAgICAgICAgICAgICAgZGVmYXVsdCB7IHogOj0gMCB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZGVmYXVsdCB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggbW9kKG4sIDIpCiAgICAgICAgICAgICAgICAvLyB4ID4gMCBhbmQgbiBpcyBldmVuIC0tPiB6ID0gMQogICAgICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSBiIH0KICAgICAgICAgICAgICAgIC8vIHggPiAwIGFuZCBuIGlzIG9kZCAtLT4geiA9IHgKICAgICAgICAgICAgICAgIGRlZmF1bHQgeyB6IDo9IHggfQoKICAgICAgICAgICAgICAgIGxldCBoYWxmIDo9IGRpdihiLCAyKSAvLyBmb3Igcm91bmRpbmcuCiAgICAgICAgICAgICAgICAvLyBuID0gbiAvIDIsIHdoaWxlIG4gPiAwLCBuID0gbiAvIDIKICAgICAgICAgICAgICAgIGZvciB7IG4gOj0gZGl2KG4sIDIpIH0gbiB7IG4gOj0gZGl2KG4sIDIpIH0gewogICAgICAgICAgICAgICAgICAgIGxldCB4eCA6PSBtdWwoeCwgeCkKICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB4eCAvIHggIT0geAogICAgICAgICAgICAgICAgICAgIGlmIGlzemVybyhlcShkaXYoeHgsIHgpLCB4KSkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICAgICAgICAgIC8vIFJvdW5kICh4eCArIGhhbGYpIC8gYgogICAgICAgICAgICAgICAgICAgIGxldCB4eFJvdW5kIDo9IGFkZCh4eCwgaGFsZikKICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB4eFJvdW5kIDwgeHgKICAgICAgICAgICAgICAgICAgICBpZiBsdCh4eFJvdW5kLCB4eCkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICAgICAgICAgIHggOj0gZGl2KHh4Um91bmQsIGIpCiAgICAgICAgICAgICAgICAgICAgLy8gaWYgbiAlIDIgPT0gMQogICAgICAgICAgICAgICAgICAgIGlmIG1vZChuLCAyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eCA6PSBtdWwoeiwgeCkKICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmV2ZXJ0IGlmIHggIT0gMCBhbmQgenggLyB4ICE9IHoKICAgICAgICAgICAgICAgICAgICAgICAgaWYgYW5kKGlzemVybyhpc3plcm8oeCkpLCBpc3plcm8oZXEoZGl2KHp4LCB4KSwgeikpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXZlcnQoMCwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAvLyBSb3VuZCAoenggKyBoYWxmKSAvIGIKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp4Um91bmQgOj0gYWRkKHp4LCBoYWxmKQogICAgICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB6eFJvdW5kIDwgengKICAgICAgICAgICAgICAgICAgICAgICAgaWYgbHQoenhSb3VuZCwgengpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICAgICAgICAgICAgICAgICAgeiA6PSBkaXYoenhSb3VuZCwgYikKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0K"}],sj=`

Example of binary exponentiation in assembly

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.24;
 
@@ -200,7 +200,7 @@ Error generating stack: `+e.message+`
         }
     }
 }
-
`,aj=({prev:s,next:a})=>r.jsx(u,{version:OC,title:PC,description:$C,html:sj,prev:s,next:a,codes:qC}),nj="0.8.24",lj="Bi-Directional Payment Channel",pj="An example of bi-directional payment channels in Solidity",ej=[{fileName:"BiDirectionalPaymentChannel.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsK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AgIGNoYWxsZW5nZVBlcmlvZCA9IF9jaGFsbGVuZ2VQZXJpb2Q7CiAgICB9CgogICAgZnVuY3Rpb24gdmVyaWZ5KAogICAgICAgIGJ5dGVzWzJdIG1lbW9yeSBfc2lnbmF0dXJlcywKICAgICAgICBhZGRyZXNzIF9jb250cmFjdCwKICAgICAgICBhZGRyZXNzWzJdIG1lbW9yeSBfc2lnbmVycywKICAgICAgICB1aW50MjU2WzJdIG1lbW9yeSBfYmFsYW5jZXMsCiAgICAgICAgdWludDI1NiBfbm9uY2UKICAgICkgcHVibGljIHB1cmUgcmV0dXJucyAoYm9vbCkgewogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IF9zaWduYXR1cmVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIC8qCiAgICAgICAgICAgIE5PVEU6IHNpZ24gd2l0aCBhZGRyZXNzIG9mIHRoaXMgY29udHJhY3QgdG8gcHJvdGVjdAogICAgICAgICAgICAgICAgICBhZ2FpbnMgcmVwbGF5IGF0dGFjayBvbiBvdGhlciBjb250cmFjdHMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgYm9vbCB2YWxpZCA9IF9zaWduZXJzW2ldCiAgICAgICAgICAgICAgICA9PSBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfY29udHJhY3QsIF9iYWxhbmNlcywgX25vbmNlKSkKICAgICAgICAgICAgICAgICAgICAudG9FdGhTaWduZWRNZXNzYWdlSGFzaCgpLnJlY292ZXIoX3NpZ25hdHVyZXNbaV0pOwoKICAgICAgICAgICAgaWYgKCF2YWxpZCkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gdHJ1ZTsKICAgIH0KCiAgICBtb2RpZmllciBjaGVja1NpZ25hdHVyZXMoCiAgICAgICAgYnl0ZXNbMl0gbWVtb3J5IF9zaWduYXR1cmVzLAogICAgICAgIHVpbnQyNTZbMl0gbWVtb3J5IF9iYWxhbmNlcywKICAgICAgICB1aW50MjU2IF9ub25jZQogICAgKSB7CiAgICAgICAgLy8gTm90ZTogY29weSBzdG9yYWdlIGFycmF5IHRvIG1lbW9yeQogICAgICAgIGFkZHJlc3NbMl0gbWVtb3J5IHNpZ25lcnM7CiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgdXNlcnMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgc2lnbmVyc1tpXSA9IHVzZXJzW2ldOwogICAgICAgIH0KCiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgdmVyaWZ5KF9zaWduYXR1cmVzLCBhZGRyZXNzKHRoaXMpLCBzaWduZXJzLCBfYmFsYW5jZXMsIF9ub25jZSksCiAgICAgICAgICAgICJJbnZhbGlkIHNpZ25hdHVyZSIKICAgICAgICApOwoKICAgICAgICBfOwogICAgfQoKICAgIG1vZGlmaWVyIG9ubHlVc2VyKCkgewogICAgICAgIHJlcXVpcmUoaXNVc2VyW21zZy5zZW5kZXJdLCAiTm90IHVzZXIiKTsKICAgICAgICBfOwogICAgfQoKICAgIGZ1bmN0aW9uIGNoYWxsZW5nZUV4aXQoCiAgICAgICAgdWludDI1NlsyXSBtZW1vcnkgX2JhbGFuY2VzLAogICAgICAgIHVpbnQyNTYgX25vbmNlLAogICAgICAgIGJ5dGVzWzJdIG1lbW9yeSBfc2lnbmF0dXJlcwogICAgKQogICAgICAgIHB1YmxpYwogICAgICAgIG9ubHlVc2VyCiAgICAgICAgY2hlY2tTaWduYXR1cmVzKF9zaWduYXR1cmVzLCBfYmFsYW5jZXMsIF9ub25jZSkKICAgICAgICBjaGVja0JhbGFuY2VzKF9iYWxhbmNlcykKICAgIHsKICAgICAgICByZXF1aXJlKGJsb2NrLnRpbWVzdGFtcCA8IGV4cGlyZXNBdCwgIkV4cGlyZWQgY2hhbGxlbmdlIHBlcmlvZCIpOwogICAgICAgIHJlcXVpcmUoX25vbmNlID4gbm9uY2UsICJOb25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NEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAg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QogICAgewogICAgICAgIC8vIDMyIGlzIHRoZSBsZW5ndGggaW4gYnl0ZXMgb2YgaGFzaCwKICAgICAgICAvLyBlbmZvcmNlZCBieSB0aGUgdHlwZSBzaWduYXR1cmUgYWJvdmUKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KAogICAgICAgICAgICBhYmkuZW5jb2RlUGFja2VkKCJceDE5RXRoZXJldW0gU2lnbmVkIE1lc3NhZ2U6XG4zMiIsIGhhc2gpCiAgICAgICAgKTsKICAgIH0KfQo="}],cj=`

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

+`,aj=({prev:s,next:a})=>r.jsx(A,{version:OC,title:PC,description:$C,html:sj,prev:s,next:a,codes:qC}),nj="0.8.24",lj="Bi-Directional Payment Channel",pj="An example of bi-directional payment channels in Solidity",ej=[{fileName:"BiDirectionalPaymentChannel.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG9ydCAiLi9FQ0RTQS5zb2wiOwoKLyoKT3BlbmluZyBhIGNoYW5uZWwKMS4gQWxpY2UgYW5kIEJvYiBmdW5kIGEgbXVsdGktc2lnIHdhbGxldAoyLiBQcmVjb21wdXRlIHBheW1lbnQgY2hhbm5lbCBhZGRyZXNzCjMuIEFsaWNlIGFuZCBCb2IgZXhjaGFuZ2VzIHNpZ25hdHVyZXMgb2YgaW5pdGlhbCBiYWxhbmNlcwo0LiBBbGljZSBhbmQgQm9iIGNyZWF0ZXMgYSB0cmFuc2FjdGlvbiB0aGF0IGNhbiBkZXBsb3kgYSBwYXltZW50IGNoYW5uZWwgZnJvbQogICB0aGUgbXVsdGktc2lnIHdhbGxldAoKVXBkYXRlIGNoYW5uZWwgYmFsYW5jZXMKMS4gUmVwZWF0IHN0ZXBzIDEgLSAzIGZyb20gb3BlbmluZyBhIGNoYW5uZWwKMi4gRnJvbSBtdWx0aS1zaWcgd2FsbGV0IGNyZW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AgICAgICBhZ2FpbnMgcmVwbGF5IGF0dGFjayBvbiBvdGhlciBjb250cmFjdHMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgYm9vbCB2YWxpZCA9IF9zaWduZXJzW2ldCiAgICAgICAgICAgICAgICA9PSBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfY29udHJhY3QsIF9iYWxhbmNlcywgX25vbmNlKSkKICAgICAgICAgICAgICAgICAgICAudG9FdGhTaWduZWRNZXNzYWdlSGFzaCgpLnJlY292ZXIoX3NpZ25hdHVyZXNbaV0pOwoKICAgICAgICAgICAgaWYgKCF2YWxpZCkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gdHJ1ZTsKICAgIH0KCiAgICBtb2RpZmllciBjaGVja1NpZ25hdHVyZXMoCiAgICAgICAgYnl0ZXNbMl0gbWVtb3J5IF9zaWduYXR1cmVzLAogICAgICAgIHVpbnQyNTZbMl0gbWVtb3J5IF9iYWxhbmNlcywKICAgICAgICB1aW50MjU2IF9ub25jZQogICAgKSB7CiAgICAgICAgLy8gTm90ZTogY29weSBzdG9yYWdlIGFycmF5IHRvIG1lbW9yeQogICAgICAgIGFkZHJlc3NbMl0gbWVtb3J5IHNpZ25lcnM7CiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgdXNlcnMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgc2lnbmVyc1tpXSA9IHVzZXJzW2ldOwogICAgICAgIH0KCiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgdmVyaWZ5KF9zaWduYXR1cmVzLCBhZGRyZXNzKHRoaXMpLCBzaWduZXJzLCBfYmFsYW5jZXMsIF9ub25jZSksCiAgICAgICAgICAgICJJbnZhbGlkIHNpZ25hdHVyZSIKICAgICAgICApOwoKICAgICAgICBfOwogICAgfQoKICAgIG1vZGlmaWVyIG9ubHlVc2VyKCkgewogICAgICA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VydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDgoKHVpbnQyNTYodnMpID4+IDI1NSkgKyAyNyk7CiAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzMzIgciwgYnl0ZXMzMiB2cykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwog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B9CgogICAgICAgIHJldHVybiAoc2lnbmVyLCBSZWNvdmVyRXJyb3IuTm9FcnJvcik7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIHVpbnQ4IHYsIGJ5dGVzMzIgciwgYnl0ZXMzMiBzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgKGFkZHJlc3MgcmVjb3ZlcmVkLCBSZWNvdmVyRXJyb3IgZXJyb3IpID0gdHJ5UmVjb3ZlcihoYXNoLCB2LCByLCBzKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKGJ5dGVzMzIgaGFzaCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyKQogICAgewogICAgICAgIC8vIDMyIGlzIHRoZSBsZW5ndGggaW4gYnl0ZXMgb2YgaGFzaCwKICAgICAgICAvLyBlbmZvcmNlZCBieSB0aGUgdHlwZSBzaWduYXR1cmUgYWJvdmUKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KAogICAgICAgICAgICBhYmkuZW5jb2RlUGFja2VkKCJceDE5RXRoZXJldW0gU2lnbmVkIE1lc3NhZ2U6XG4zMiIsIGhhc2gpCiAgICAgICAgKTsKICAgIH0KfQo="}],cj=`

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.24;
@@ -516,7 +516,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
         );
     }
 }
-
`,tj=({prev:s,next:a})=>r.jsx(u,{version:nj,title:lj,description:pj,html:cj,prev:s,next:a,codes:ej}),oj="0.8.24",rj="Precompute Contract Address with Create2",ij="Precompute contract address with create2",gj=[{fileName:"Create2.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgLy8gUmV0dXJucyB0aGUgYWRkcmVzcyBvZiB0aGUgbmV3bHkgZGVwbG95ZWQgY29udHJhY3QKICAgIGZ1bmN0aW9uIGRlcGxveShhZGRyZXNzIF9vd25lciwgdWludDI1NiBfZm9vLCBieXRlczMyIF9zYWx0KQogICAgICAgIHB1YmxpYwogICAgICAgIHBheWFibGUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIC8vIFRoaXMgc3ludGF4IGlzIGEgbmV3ZXIgd2F5IHRvIGludm9rZSBjcmVhdGUyIHdpdGhvdXQgYXNzZW1ibHksIHlvdSBqdXN0IG5lZWQgdG8gcGFzcyBzYWx0CiAgICAgICAgLy8gaHR0cHM6Ly9kb2NzLnNvbGlkaXR5bGFuZy5vcmcvZW4vbGF0ZXN0L2NvbnRyb2wtc3RydWN0dXJlcy5odG1sI3NhbHRlZC1jb250cmFjdC1jcmVhdGlvbnMtY3JlYXRlMgogICAgICAgIHJldHVybiBhZGRyZXNzKG5ldyBUZXN0Q29udHJhY3R7c2FsdDogX3NhbHR9KF9vd25lciwgX2ZvbykpOwogICAgfQp9CgovLyBUaGlzIGlzIHRoZSBvbGRlciB3YXkgb2YgZG9pbmcgaXQgdXNpbmcgYXNzZW1ibHkKY29udHJhY3QgRmFjdG9yeUFzc2VtYmx5IHsKICAgIGV2ZW50IERlcGxveWVkKGFkZHJlc3MgYWRkciwgdWludDI1NiBzYWx0KTsKCiAgICAvLyAxLiBHZXQgYnl0ZWNvZGUgb2YgY29udHJhY3QgdG8gYmUgZGVwbG95ZWQKICAgIC8vIE5PVEU6IF9vd25lciBhbmQgX2ZvbyBhcmUgYXJndW1lbnRzIG9mIHRoZSBUZXN0Q29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KICAgICAgICAgICAgICAgICAgICBhZGQoYnl0ZWNvZGUsIDB4MjApLAogICAgICAgICAgICAgICAgICAgIG1sb2FkKGJ5dGVjb2RlKSwgLy8gTG9hZCB0aGUgc2l6ZSBvZiBjb2RlIGNvbnRhaW5lZCBpbiB0aGUgZmlyc3QgMzIgYnl0ZXMKICAgICAgICAgICAgICAgICAgICBfc2FsdCAvLyBTYWx0IGZyb20gZnVuY3Rpb24gYXJndW1lbnRzCiAgICAgICAgICAgICAgICApCgogICAgICAgICAgICBpZiBpc3plcm8oZXh0Y29kZXNpemUoYWRkcikpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CgogICAgICAgIGVtaXQgRGVwbG95ZWQoYWRkciwgX3NhbHQpOwogICAgfQp9Cgpjb250cmFjdCBUZXN0Q29udHJhY3QgewogICAgYWRkcmVzcyBwdWJsaWMgb3duZXI7CiAgICB1aW50MjU2IHB1YmxpYyBmb287CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfb3duZXIsIHVpbnQyNTYgX2ZvbykgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICAgICAgZm9vID0gX2ZvbzsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRCYWxhbmNlKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],hj=`

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

+`,tj=({prev:s,next:a})=>r.jsx(A,{version:nj,title:lj,description:pj,html:cj,prev:s,next:a,codes:ej}),oj="0.8.24",rj="Precompute Contract Address with Create2",ij="Precompute contract address with create2",gj=[{fileName:"Create2.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgLy8gUmV0dXJucyB0aGUgYWRkcmVzc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ICAgICAgICAgICAgICBfc2FsdCAvLyBTYWx0IGZyb20gZnVuY3Rpb24gYXJndW1lbnRzCiAgICAgICAgICAgICAgICApCgogICAgICAgICAgICBpZiBpc3plcm8oZXh0Y29kZXNpemUoYWRkcikpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CgogICAgICAgIGVtaXQgRGVwbG95ZWQoYWRkciwgX3NhbHQpOwogICAgfQp9Cgpjb250cmFjdCBUZXN0Q29udHJhY3QgewogICAgYWRkcmVzcyBwdWJsaWMgb3duZXI7CiAgICB1aW50MjU2IHB1YmxpYyBmb287CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfb3duZXIsIHVpbnQyNTYgX2ZvbykgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICAgICAgZm9vID0gX2ZvbzsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRCYWxhbmNlKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],hj=`

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

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.24;
 
@@ -613,7 +613,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
         return address(this).balance;
     }
 }
-
`,Ij=({prev:s,next:a})=>r.jsx(u,{version:oj,title:rj,description:ij,html:hj,prev:s,next:a,codes:gj}),dj="0.8.24",Cj="Crowd Fund",jj="An example of crowd funding contract",uj=[{fileName:"CrowdFund.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkc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24ucGxlZGdlZCA+PSBjYW1wYWlnbi5nb2FsLCAicGxlZGdlZCA8IGdvYWwiKTsKICAgICAgICByZXF1aXJlKCFjYW1wYWlnbi5jbGFpbWVkLCAiY2xhaW1lZCIpOwoKICAgICAgICBjYW1wYWlnbi5jbGFpbWVkID0gdHJ1ZTsKICAgICAgICB0b2tlbi50cmFuc2ZlcihjYW1wYWlnbi5jcmVhdG9yLCBjYW1wYWlnbi5wbGVkZ2VkKTsKCiAgICAgICAgZW1pdCBDbGFpbShfaWQpOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlZnVuZCh1aW50MjU2IF9pZCkgZXh0ZXJuYWwgewogICAgICAgIENhbXBhaWduIG1lbW9yeSBjYW1wYWlnbiA9IGNhbXBhaWduc1tfaWRdOwogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wID4gY2FtcGFpZ24uZW5kQXQsICJub3QgZW5kZWQiKTsKICAgICAgICByZXF1aXJlKGNhbXBhaWduLnBsZWRnZWQgPCBjYW1wYWlnbi5nb2FsLCAicGxlZGdlZCA+PSBnb2FsIik7CgogICAgICAgIHVpbnQyNTYgYmFsID0gcGxlZGdlZEFtb3VudFtfaWRdW21zZy5zZW5kZXJdOwogICAgICAgIHBsZWRnZWRBbW91bnRbX2lkXVttc2cuc2VuZGVyXSA9IDA7CiAgICAgICAgdG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgYmFsKTsKCiAgICAgICAgZW1pdCBSZWZ1bmQoX2lkLCBtc2cuc2VuZGVyLCBiYWwpOwogICAgfQp9Cg=="}],Aj=`

Crowd fund ERC20 token

+`,Ij=({prev:s,next:a})=>r.jsx(A,{version:oj,title:rj,description:ij,html:hj,prev:s,next:a,codes:gj}),dj="0.8.24",Cj="Crowd Fund",jj="An example of crowd funding contract",Aj=[{fileName:"CrowdFund.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmlud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nLnNlbmRlciwgIm5vdCBjcmVhdG9yIik7CiAgICAgICAgcmVxdWlyZShibG9jay50aW1lc3RhbXAgPiBjYW1wYWlnbi5lbmRBdCwgIm5vdCBlbmRlZCIpOwogICAgICAgIHJlcXVpcmUoY2FtcGFpZ24ucGxlZGdlZCA+PSBjYW1wYWlnbi5nb2FsLCAicGxlZGdlZCA8IGdvYWwiKTsKICAgICAgICByZXF1aXJlKCFjYW1wYWlnbi5jbGFpbWVkLCAiY2xhaW1lZCIpOwoKICAgICAgICBjYW1wYWlnbi5jbGFpbWVkID0gdHJ1ZTsKICAgICAgICB0b2tlbi50cmFuc2ZlcihjYW1wYWlnbi5jcmVhdG9yLCBjYW1wYWlnbi5wbGVkZ2VkKTsKCiAgICAgICAgZW1pdCBDbGFpbShfaWQpOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlZnVuZCh1aW50MjU2IF9pZCkgZXh0ZXJuYWwgewogICAgICAgIENhbXBhaWduIG1lbW9yeSBjYW1wYWlnbiA9IGNhbXBhaWduc1tfaWRdOwogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wID4gY2FtcGFpZ24uZW5kQXQsICJub3QgZW5kZWQiKTsKICAgICAgICByZXF1aXJlKGNhbXBhaWduLnBsZWRnZWQgPCBjYW1wYWlnbi5nb2FsLCAicGxlZGdlZCA+PSBnb2FsIik7CgogICAgICAgIHVpbnQyNTYgYmFsID0gcGxlZGdlZEFtb3VudFtfaWRdW21zZy5zZW5kZXJdOwogICAgICAgIHBsZWRnZWRBbW91bnRbX2lkXVttc2cuc2VuZGVyXSA9IDA7CiAgICAgICAgdG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgYmFsKTsKCiAgICAgICAgZW1pdCBSZWZ1bmQoX2lkLCBtc2cuc2VuZGVyLCBiYWwpOwogICAgfQp9Cg=="}],uj=`

Crowd fund ERC20 token

  1. User creates a campaign.
  2. Users can pledge, transferring their token to a campaign.
  3. @@ -745,7 +745,7 @@ Closing a channel when Alice and Bob do not agree on the final balances emit Refund(_id, msg.sender, bal); } } -`,yj=({prev:s,next:a})=>r.jsx(u,{version:dj,title:Cj,description:jj,html:Aj,prev:s,next:a,codes:uj}),mj="0.8.24",bj="Deploy Any Contract",wj="Deploy Any Contract",kj=[{fileName:"Proxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFByb3h5IHsKICAgIGV2ZW50IERlcGxveShhZGRyZXNzKTsKCiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIGZ1bmN0aW9uIGRlcGxveShieXRlcyBtZW1vcnkgX2NvZGUpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcyBhZGRyKQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gY3JlYXRlKHYsIHAsIG4pCiAgICAgICAgICAgIC8vIHYgPSBhbW91bnQgb2YgRVRIIHRvIHNlbmQKICAgICAgICAgICAgLy8gcCA9IHBvaW50ZXIgaW4gbWVtb3J5IHRvIHN0YXJ0IG9mIGNvZGUKICAgICAgICAgICAgLy8gbiA9IHNpemUgb2YgY29kZQogICAgICAgICAgICBhZGRyIDo9IGNyZWF0ZShjYWxsdmFsdWUoKSwgYWRkKF9jb2RlLCAweDIwKSwgbWxvYWQoX2NvZGUpKQogICAgICAgIH0KICAgICAgICAvLyByZXR1cm4gYWRkcmVzcyAwIG9uIGVycm9yCiAgICAgICAgcmVxdWlyZShhZGRyICE9IGFkZHJlc3MoMCksICJkZXBsb3kgZmFpbGVkIik7CgogICAgICAgIGVtaXQgRGVwbG95KGFkZHIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4ZWN1dGUoYWRkcmVzcyBfdGFyZ2V0LCBieXRlcyBtZW1vcnkgX2RhdGEpIGV4dGVybmFsIHBheW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kKICAgIHsKICAgICAgICBieXRlcyBtZW1vcnkgYnl0ZWNvZGUgPSB0eXBlKFRlc3RDb250cmFjdDIpLmNyZWF0aW9uQ29kZTsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVBhY2tlZChieXRlY29kZSwgYWJpLmVuY29kZShfeCwgX3kpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRDYWxsZGF0YShhZGRyZXNzIF9vd25lcikgZXh0ZXJuYWwgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoInNldE93bmVyKGFkZHJlc3MpIiwgX293bmVyKTsKICAgIH0KfQo="}],Zj=`

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

    +`,yj=({prev:s,next:a})=>r.jsx(A,{version:dj,title:Cj,description:jj,html:uj,prev:s,next:a,codes:Aj}),mj="0.8.24",bj="Deploy Any Contract",wj="Deploy Any Contract",kj=[{fileName:"Proxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFByb3h5IHsKICAgIGV2ZW50IERlcGxveShhZGRyZXNzKTsKCiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIGZ1bmN0aW9uIGRlcGxveShieXRlcyBtZW1vcnkgX2NvZGUpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcyBhZGRyKQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gY3JlYXRlKHYsIHAsIG4pCiAgICAgICAgICAgIC8vIHYgPSBhbW91bnQgb2YgRVRIIHRvIHNlbmQKICAgICAgICAgICAgLy8gcCA9IHBvaW50ZXIgaW4gbWVtb3J5IHRvIHN0YXJ0IG9mIGNvZGUKICAgICAgICAgICAgLy8gbiA9IHNpemUgb2YgY29kZQogICAgICAgICAgICBhZGRyIDo9IGNyZWF0ZShjYWxsdmFsdWUoKSwgYWRkKF9jb2RlLCAweDIwKSwgbWxvYWQoX2NvZGUpKQogICAgICAgIH0KICAgICAgICAvLyByZXR1cm4gYWRkcmVzcyAwIG9uIGVycm9yCiAgICAgICAgcmVxdWlyZShhZGRyICE9IGFkZHJlc3MoMCksICJkZXBsb3kgZmFpbGVkIik7CgogICAgICAgIGVtaXQgRGVwbG95KGFkZHIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4ZWN1dGUoYWRkcmVzcyBfdGFyZ2V0LCBieXRlcyBtZW1vcnkgX2RhdGEpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIChib29sIHN1Y2Nlc3MsKSA9IF90YXJnZXQuY2FsbHt2YWx1ZTogbXNnLnZhbHVlfShfZGF0YSk7CiAgICAgICAgcmVxdWlyZShzdWNjZXNzLCAiZmFpbGVkIik7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RDb250cmFjdDEgewogICAgYWRkcmVzcyBwdWJsaWMgb3duZXIgPSBtc2cuc2VuZGVyOwoKICAgIGZ1bmN0aW9uIHNldE93bmVyKGFkZHJlc3MgX293bmVyKSBwdWJsaWMgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBvd25lciwgIm5vdCBvd25lciIpOwogICAgICAgIG93bmVyID0gX293bmVyOwogICAgfQp9Cgpjb250cmFjdCBUZXN0Q29udHJhY3QyIHsKICAgIGFkZHJlc3MgcHVibGljIG93bmVyID0gbXNnLnNlbmRlcjsKICAgIHVpbnQyNTYgcHVibGljIHZhbHVlID0gbXNnLnZhbHVlOwogICAgdWludDI1NiBwdWJsaWMgeDsKICAgIHVpbnQyNTYgcHVibGljIHk7CgogICAgY29uc3RydWN0b3IodWludDI1NiBfeCwgdWludDI1NiBfeSkgcGF5YWJsZSB7CiAgICAgICAgeCA9IF94OwogICAgICAgIHkgPSBfeTsKICAgIH0KfQoKY29udHJhY3QgSGVscGVyIHsKICAgIGZ1bmN0aW9uIGdldEJ5dGVjb2RlMSgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgYnl0ZXMgbWVtb3J5IGJ5dGVjb2RlID0gdHlwZShUZXN0Q29udHJhY3QxKS5jcmVhdGlvbkNvZGU7CiAgICAgICAgcmV0dXJuIGJ5dGVjb2RlOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEJ5dGVjb2RlMih1aW50MjU2IF94LCB1aW50MjU2IF95KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkKICAgIHsKICAgICAgICBieXRlcyBtZW1vcnkgYnl0ZWNvZGUgPSB0eXBlKFRlc3RDb250cmFjdDIpLmNyZWF0aW9uQ29kZTsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVBhY2tlZChieXRlY29kZSwgYWJpLmVuY29kZShfeCwgX3kpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRDYWxsZGF0YShhZGRyZXNzIF9vd25lcikgZXh0ZXJuYWwgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoInNldE93bmVyKGFkZHJlc3MpIiwgX293bmVyKTsKICAgIH0KfQo="}],Zj=`

    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.24;
    @@ -819,7 +819,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
             return abi.encodeWithSignature("setOwner(address)", _owner);
         }
     }
    -
    `,Wj=({prev:s,next:a})=>r.jsx(u,{version:mj,title:bj,description:wj,html:Zj,prev:s,next:a,codes:kj}),Bj="0.8.24",Gj="Dutch Auction",Vj="An example of Dutch auction in Solidity",fj=[{fileName:"DutchAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIF9mcm9tLCBhZGRyZXNzIF90bywgdWludDI1NiBfbmZ0SWQpCiAgICAgICAgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IER1dGNoQXVjdGlvbiB7CiAgICB1aW50MjU2IHByaXZhdGUgY29uc3RhbnQgRFVSQVRJT04gPSA3IGRheXM7CgogICAgSUVSQzcyMSBwdWJsaWMgaW1tdXRhYmxlIG5mdDsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBuZnRJZDsKCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIGltbXV0YWJsZSBzZWxsZXI7CiAgICB1aW50MjU2IHB1YmxpYyBpbW11dGFibGUgc3RhcnRpbmdQcmljZTsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBzdGFydEF0OwogICAgdWludDI1NiBwdWJsaWMgaW1tdXRhYmxlIGV4cGlyZXNBdDsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBkaXNjb3VudFJhdGU7CgogICAgY29uc3RydWN0b3IoCiAgICAgICAgdWludDI1NiBfc3RhcnRpbmdQcmljZSwKICAgICAgICB1aW50MjU2IF9kaXNjb3VudFJhdGUsCiAgICAgICAgYWRkcmVzcyBfbmZ0LAogICAgICAgIHVpbnQyNTYgX25mdElkCiAgICApIHsKICAgICAgICBzZWxsZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgICAgIHN0YXJ0aW5nUHJpY2UgPSBfc3RhcnRpbmdQcmljZTsKICAgICAgICBzdGFydEF0ID0gYmxvY2sudGltZXN0YW1wOwogICAgICAgIGV4cGlyZXNBdCA9IGJsb2NrLnRpbWVzdGFtcCArI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yKTsKICAgIH0KfQo="}],Yj=`

    Dutch auction for NFT.

    +`,Wj=({prev:s,next:a})=>r.jsx(A,{version:mj,title:bj,description:wj,html:Zj,prev:s,next:a,codes:kj}),Bj="0.8.24",Gj="Dutch Auction",Vj="An example of Dutch auction in Solidity",fj=[{fileName:"DutchAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIF9mcm9tLCBhZGRyZXNzIF90bywgdWludDI1NiBfbmZ0SWQpCiAgICAgICAgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IER1dGNoQXVjdGlvbiB7CiAgICB1aW50MjU2IHByaXZhdGUgY29uc3RhbnQgRFVSQVRJT04gPSA3IGRheXM7CgogICAgSUVSQzcyMSBwdWJsaWMgaW1tdXRhYmxlIG5mdDsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBuZnRJZDsKCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIGltbXV0YWJsZSBzZWxsZXI7CiAgICB1aW50MjU2IHB1YmxpYyBpbW11dGFibGUgc3RhcnRpbmdQcmljZTsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBzdGFydEF0OwogICAgdWludDI1NiBwdWJsaWMgaW1tdXRhYmxlIGV4cGlyZXNBdDsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBkaXNjb3VudFJhdGU7CgogICAgY29uc3RydWN0b3IoCiAgICAgICAgdWludDI1NiBfc3RhcnRpbmdQcmljZSwKICAgICAgICB1aW50MjU2IF9kaXNjb3VudFJhdGUsCiAgICAgICAgYWRkcmVzcyBfbmZ0LAogICAgICAgIHVpbnQyNTYgX25mdElkCiAgICApIHsKICAgICAgICBzZWxsZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICA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AgICAgaWYgKHJlZnVuZCA+IDApIHsKICAgICAgICAgICAgcGF5YWJsZShtc2cuc2VuZGVyKS50cmFuc2ZlcihyZWZ1bmQpOwogICAgICAgIH0KICAgICAgICBzZWxmZGVzdHJ1Y3Qoc2VsbGVyKTsKICAgIH0KfQo="}],Yj=`

    Dutch auction for NFT.

    Auction

    1. Seller of NFT deploys this contract setting a starting price for the NFT.
    2. @@ -888,7 +888,7 @@ Closing a channel when Alice and Bob do not agree on the final balances selfdestruct(seller); } } -`,Rj=({prev:s,next:a})=>r.jsx(u,{version:Bj,title:Gj,description:Vj,html:Yj,prev:s,next:a,codes:fj}),Xj="0.8.24",vj="English Auction",Nj="An example of English auction in Solidity",Hj=[{fileName:"EnglishAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyBmcm9tLCBhZGRyZXNzIHRvLCB1aW50MjU2IHRva2VuSWQpCiAgICAgICAgZXh0ZXJuYWw7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcywgYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IEVuZ2xpc2hBdWN0aW9uIHsKICAgIGV2ZW50IFN0YXJ0KCk7CiAgICBldmVudCBCaWQoYWRkcmVzcyBpbmRleGVkIHNlbmRlciwgdWludDI1NiBhbW91bnQpOwogICAgZXZlbnQgV2l0aGRyYXcoYWRkcmVzcyBpbmRleGVkIGJpZGRlciwgdWludDI1NiBhbW91bnQpOwogICAgZXZlbnQgRW5kKGFkZHJlc3Mgd2lubmVyLCB1aW50MjU2IGFtb3VudCk7CgogICAgSUVSQzcyMSBwdWJsaWMgbmZ0OwogICAgdWludDI1NiBwdWJsaWMgbmZ0SWQ7CgogICAgYWRkcmVzcy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bHNlIHsKICAgICAgICAgICAgbmZ0LnNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyh0aGlzKSwgc2VsbGVyLCBuZnRJZCk7CiAgICAgICAgfQoKICAgICAgICBlbWl0IEVuZChoaWdoZXN0QmlkZGVyLCBoaWdoZXN0QmlkKTsKICAgIH0KfQo="}],Fj=`

      English auction for NFT.

      +`,Rj=({prev:s,next:a})=>r.jsx(A,{version:Bj,title:Gj,description:Vj,html:Yj,prev:s,next:a,codes:fj}),Xj="0.8.24",vj="English Auction",Nj="An example of English auction in Solidity",Hj=[{fileName:"EnglishAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHNhZmVUcmFuc2ZlckZyb20oYWRkcmVzcyBmcm9tLCBhZGRyZXNzIHRvLCB1aW50MjU2IHRva2VuSWQpCiAgICAgICAgZXh0ZXJuYWw7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcywgYWRkcmVzcywgdWludDI1NikgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IEVuZ2xpc2hBdWN0aW9uIHsKICAgIGV2ZW50IFN0YXJ0KCk7CiAgICBldmVudCBCaWQoYWRkcmVzcyBpbmRleGVkIHNlbmRlciwgdWludDI1NiBhbW91bnQpOwogICAgZXZlbnQgV2l0aGRyYXcoYWRkcmVzcyBpbmRleGVkIGJpZGRlciwgdWludDI1NiBhbW91bnQpOwogICAgZXZlbnQgRW5kKGFkZHJlc3Mgd2lubmVyLCB1aW50MjU2IGFtb3VudCk7CgogICAgSUVSQzcyMSBwdWJsaWMgbmZ0OwogICAgdWludDI1NiBwdWJsaWMgbmZ0SWQ7CgogICAgYWRkcmVzcyBwYXlhYmxlIHB1YmxpYyBzZWxsZXI7CiAgICB1aW50MjU2IHB1YmxpYyBlbmRBdDsKICAgIGJvb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bGVyLCBuZnRJZCk7CiAgICAgICAgfQoKICAgICAgICBlbWl0IEVuZChoaWdoZXN0QmlkZGVyLCBoaWdoZXN0QmlkKTsKICAgIH0KfQo="}],Fj=`

      English auction for NFT.

      Auction

      1. Seller of NFT deploys this contract.
      2. @@ -986,7 +986,7 @@ Closing a channel when Alice and Bob do not agree on the final balances emit End(highestBidder, highestBid); } } -`,Kj=({prev:s,next:a})=>r.jsx(u,{version:Xj,title:vj,description:Nj,html:Fj,prev:s,next:a,codes:Hj}),Mj="0.8.24",Sj="ERC1155",xj="Example of ERC1155 multi token in Solidity",Jj=[{fileName:"ERC1155.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDMTE1NSB7CiAgICBmdW5jdGlvbiBzYWZlVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTYgaWQsCiAgICAgICAgdWludDI1NiB2YWx1ZSwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsOwogICAgZnVuY3Rpb24gc2FmZUJhdGNoVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMsCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIHZhbHVlcywKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3Mgb3duZXIsIHVpbnQyNTYgaWQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBiYWxhbmNlT2ZCYXRjaChhZGRyZ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hdG9yLAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCBmcm9tLAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCB0bywKICAgICAgICB1aW50MjU2IGlkLAogICAgICAgIHVpbnQyNTYgdmFsdWUKICAgICk7CiAgICBldmVudCBUcmFuc2ZlckJhdGNoKAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCBvcGVyYXRvciwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgZnJvbSwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgdG8sCiAgICAgICAgdWludDI1NltdIGlkcywKICAgICAgICB1aW50MjU2W10gdmFsdWVzCiAgICApOwogICAgZXZlbnQgQXBwcm92YWxGb3JBbGwoCiAgICAgICAgYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgb3BlcmF0b3IsIGJvb2wgYXBwcm92ZWQKICAgICk7CiAgICBldmVudCBVUkkoc3RyaW5nIHZhbHVlLCB1aW50MjU2IGluZGV4ZWQgaWQpOwoKICAgIC8vIG93bmVyID0+IGlkID0+IGJhbGFuY2UKICAgIG1hcHBpbmcoYWRkcmVzcyA9PiBtYXBwaW5nKHVpbnQyNTYgPT4gdWludDI1NikpIHB1YmxpYyBiYWxhbmNlT2Y7CiAgICAvLyBvd25lciA9PiBvcGVyYXRvciA9PiBhcHByb3ZlZAogICAgbWFwcGluZyhhZGRyZXNzID0+IG1hcHBpbmcoYWRkcmVzcyA9PiBib29sKSkgcHVibGljIGlzQXBwcm92ZWRGb3JBbGw7CgogICAgZnVuY3Rpb24gYmFsYW5jZU9mQmF0Y2goYWRkcmVzc1tdIGNhbGxkYXRhIG93bmVycywgdWludDI1NltdIGNhbGxkYXRhIGlkcykKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2W10gbWVtb3J5IGJhbGFuY2VzKQogICAgewogICAgICAgIHJlcXVpcmUob3duZXJzLmxlbmd0aCA9PSBpZHMub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x1ZTsKICAgICAgICBiYWxhbmNlT2ZbdG9dW2lkXSArPSB2YWx1ZTsKCiAgICAgICAgZW1pdCBUcmFuc2ZlclNpbmdsZShtc2cuc2VuZGVyLCBmcm9tLCB0bywgaWQsIHZhbHVlKTsKCiAgICAgICAgaWYgKHRvLmNvZGUubGVuZ3RoID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgSUVSQzExNTVUb2tlblJlY2VpdmVyKHRvKS5vbkVSQzExNTVSZWNlaXZlZCgKICAgICAgICAgICAgICAgICAgICBtc2cuc2VuZGVyLCBmcm9tLCBpZCwgdmFsdWUsIGRhdGEKICAgICAgICAgICAgICAgICkgPT0gSUVSQzExNTVUb2tlblJlY2VpdmVyLm9uRVJDMTE1NVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAgICAgInVuc2FmZSB0cmFuc2ZlciIKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc2FmZUJhdGNoVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMsCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIHZhbHVlcywKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBtc2cuc2VuZGVyID09IGZyb20gfHwgaXNBcHByb3ZlZEZvckFsbFtmcm9tXVttc2cuc2VuZGVyXSwKICAgICAgICAgICAgIm5vdCBhcHByb3ZlZCIKICAgICAgICApOwogICAgICAgIHJlcXVpcmUodG8gIT0gYWRkcmVzcygwKSwgInRvID0gMCBhZGRyZXNzIik7CiAgICAgICAgcmVxdWlyZShpZHMubGVuZ3RoID09IHZhbHVlcy5sZW5ndGgsICJpZHMgbGVuZ3RoICE9IHZhbHVlcyBsZW5ndGgi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NltdIGNhbGxkYXRhIGlkcywKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgdmFsdWVzLAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIGRhdGEKICAgICkgaW50ZXJuYWwgewogICAgICAgIHJlcXVpcmUodG8gIT0gYWRkcmVzcygwKSwgInRvID0gMCBhZGRyZXNzIik7CiAgICAgICAgcmVxdWlyZShpZHMubGVuZ3RoID09IHZhbHVlcy5sZW5ndGgsICJpZHMgbGVuZ3RoICE9IHZhbHVlcyBsZW5ndGgiKTsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGJhbGFuY2VPZlt0b11baWRzW2ldXSArPSB2YWx1ZXNbaV07CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyQmF0Y2gobXNnLnNlbmRlciwgYWRkcmVzcygwKSwgdG8sIGlkcywgdmFsdWVzKTsKCiAgICAgICAgaWYgKHRvLmNvZGUubGVuZ3RoID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgSUVSQzExNTVUb2tlblJlY2VpdmVyKHRvKS5vbkVSQzExNTVCYXRjaFJlY2VpdmVkKAogICAgICAgICAgICAgICAgICAgIG1zZy5zZW5kZXIsIGFkZHJlc3MoMCksIGlkcywgdmFsdWVzLCBkYXRhCiAgICAgICAgICAgICAgICApID09IElFUkMxMTU1VG9rZW5SZWNlaXZlci5vbkVSQzExNTVCYXRjaFJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAgICAgInVuc2FmZSB0cmFuc2ZlciIKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX2J1cm4oYWRkcmVzcyBmcm9tLCB1aW50MjU2IGlkLCB1aW50MjU2IHZhbHVlKSBpbnRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShmcm9tICE9IGFkZHJlc3MoMCksICJmcm9tID0gM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ICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICBfYmF0Y2hNaW50KG1zZy5zZW5kZXIsIGlkcywgdmFsdWVzLCBkYXRhKTsKICAgIH0KCiAgICBmdW5jdGlvbiBidXJuKHVpbnQyNTYgaWQsIHVpbnQyNTYgdmFsdWUpIGV4dGVybmFsIHsKICAgICAgICBfYnVybihtc2cuc2VuZGVyLCBpZCwgdmFsdWUpOwogICAgfQoKICAgIGZ1bmN0aW9uIGJhdGNoQnVybih1aW50MjU2W10gY2FsbGRhdGEgaWRzLCB1aW50MjU2W10gY2FsbGRhdGEgdmFsdWVzKQogICAgICAgIGV4dGVybmFsCiAgICB7CiAgICAgICAgX2JhdGNoQnVybihtc2cuc2VuZGVyLCBpZHMsIHZhbHVlcyk7CiAgICB9Cn0K"}],zj=`

        Example of ERC1155

        +`,Kj=({prev:s,next:a})=>r.jsx(A,{version:Xj,title:vj,description:Nj,html:Fj,prev:s,next:a,codes:Hj}),Mj="0.8.24",Sj="ERC1155",xj="Example of ERC1155 multi token in Solidity",Jj=[{fileName:"ERC1155.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDMTE1NSB7CiAgICBmdW5jdGlvbiBzYWZlVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTYgaWQsCiAgICAgICAgdWludDI1NiB2YWx1ZSwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsOwogICAgZnVuY3Rpb24gc2FmZUJhdGNoVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMsCiAgICAgICAg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AgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIG1zZy5zZW5kZXIgPT0gZnJvbSB8fCBpc0FwcHJvdmVkRm9yQWxsW2Zyb21dW21zZy5zZW5kZXJdLAogICAgICAgICAgICAibm90IGFwcHJvdmVkIgogICAgICAgICk7CiAgICAgICAgcmVxdWlyZSh0byAhPSBhZGRyZXNzKDApLCAidG8gPSAwIGFkZHJlc3MiKTsKCiAgICAgICAgYmFsYW5jZU9mW2Zyb21dW2lkXSAtPSB2YWx1ZTsKICAgICAgICBiYWxhbmNlT2ZbdG9dW2lkXSArPSB2YWx1ZTsKCiAgICAgICAgZW1pdCBUcmFuc2ZlclNpbmdsZShtc2cuc2VuZGVyLCBmcm9tLCB0bywgaWQsIHZhbHVlKTsKCiAgICAgICAgaWYgKHRvLmNvZGUubGVuZ3RoID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgSUVSQzExNTVUb2tlblJlY2VpdmVyKHRvKS5vbkVSQzExNTVSZWNlaXZlZCgKICAgICAgICAgICAgICAgICAgICBtc2cuc2VuZGVyLCBmcm9tLCBpZCwgdmFsdWUsIGRhdGEKICAgICAgICAgICAgICAgICkgPT0gSUVSQzExNTVUb2tlblJlY2VpdmVyLm9uRVJDMTE1NVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAgICAgInVuc2FmZSB0cmFuc2ZlciIKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc2FmZUJhdGNoVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMsCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIHZhbHVlcywKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBtc2cuc2VuZGVy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MCksIGlkLCB2YWx1ZSwgZGF0YQogICAgICAgICAgICAgICAgKSA9PSBJRVJDMTE1NVRva2VuUmVjZWl2ZXIub25FUkMxMTU1UmVjZWl2ZWQuc2VsZWN0b3IsCiAgICAgICAgICAgICAgICAidW5zYWZlIHRyYW5zZmVyIgogICAgICAgICAgICApOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBfYmF0Y2hNaW50KAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIGlkcywKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgdmFsdWVzLAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIGRhdGEKICAgICkgaW50ZXJuYWwgewogICAgICAgIHJlcXVpcmUodG8gIT0gYWRkcmVzcygwKSwgInRvID0gMCBhZGRyZXNzIik7CiAgICAgICAgcmVxdWlyZShpZHMubGVuZ3RoID09IHZhbHVlcy5sZW5ndGgsICJpZHMgbGVuZ3RoICE9IHZhbHVlcyBsZW5ndGgiKTsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGJhbGFuY2VPZlt0b11baWRzW2ldXSArPSB2YWx1ZXNbaV07CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyQmF0Y2gobXNnLnNlbmRlciwgYWRkcmVzcygwKSwgdG8sIGlkcywgdmFsdWVzKTsKCiAgICAgICAgaWYgKHRvLmNvZGUubGVuZ3RoID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgSUVSQzExNTVUb2tlblJlY2VpdmVyKHRvKS5vbkVSQzExNTVCYXRjaFJlY2VpdmVkKAogICAgICAgICAgICAgICAgICAgIG1zZy5zZW5kZXIsIGFkZHJlc3MoMCksIGlkcywgdmFsdWVzLCBkYXRhCiAgICAgICAgICAgICAgICApID09IElFUkMxMTU1VG9rZW5SZWNlaXZlci5vb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Rpb24gbWludCh1aW50MjU2IGlkLCB1aW50MjU2IHZhbHVlLCBieXRlcyBtZW1vcnkgZGF0YSkgZXh0ZXJuYWwgewogICAgICAgIF9taW50KG1zZy5zZW5kZXIsIGlkLCB2YWx1ZSwgZGF0YSk7CiAgICB9CgogICAgZnVuY3Rpb24gYmF0Y2hNaW50KAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMsCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIHZhbHVlcywKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICBfYmF0Y2hNaW50KG1zZy5zZW5kZXIsIGlkcywgdmFsdWVzLCBkYXRhKTsKICAgIH0KCiAgICBmdW5jdGlvbiBidXJuKHVpbnQyNTYgaWQsIHVpbnQyNTYgdmFsdWUpIGV4dGVybmFsIHsKICAgICAgICBfYnVybihtc2cuc2VuZGVyLCBpZCwgdmFsdWUpOwogICAgfQoKICAgIGZ1bmN0aW9uIGJhdGNoQnVybih1aW50MjU2W10gY2FsbGRhdGEgaWRzLCB1aW50MjU2W10gY2FsbGRhdGEgdmFsdWVzKQogICAgICAgIGV4dGVybmFsCiAgICB7CiAgICAgICAgX2JhdGNoQnVybihtc2cuc2VuZGVyLCBpZHMsIHZhbHVlcyk7CiAgICB9Cn0K"}],zj=`

        Example of ERC1155

        // SPDX-License-Identifier: MIT
         pragma solidity ^0.8.24;
         
        @@ -1247,7 +1247,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
                 _batchBurn(msg.sender, ids, values);
             }
         }
        -
        `,Dj=({prev:s,next:a})=>r.jsx(u,{version:Mj,title:Sj,description:xj,html:zj,prev:s,next:a,codes:Jj}),Ej="0.8.24",Qj="ERC20",Tj="Example of ERC20 token in Solidity",Uj=[{fileName:"ERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG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1bmN0aW9uIHN3YXAoKSBwdWJsaWMgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBvd25lcjEgfHwgbXNnLnNlbmRlciA9PSBvd25lcjIsICJOb3QgYXV0aG9yaXplZCIpOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHRva2VuMS5hbGxvd2FuY2Uob3duZXIxLCBhZGRyZXNzKHRoaXMpKSA+PSBhbW91bnQxLAogICAgICAgICAgICAiVG9rZW4gMSBhbGxvd2FuY2UgdG9vIGxvdyIKICAgICAgICApOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHRva2VuMi5hbGxvd2FuY2Uob3duZXIyLCBhZGRyZXNzKHRoaXMpKSA+PSBhbW91bnQyLAogICAgICAgICAgICAiVG9rZW4gMiBhbGxvd2FuY2UgdG9vIGxvdyIKICAgICAgICApOwoKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjEsIG93bmVyMSwgb3duZXIyLCBhbW91bnQxKTsKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjIsIG93bmVyMiwgb3duZXIxLCBhbW91bnQyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfc2FmZVRyYW5zZmVyRnJvbSgKICAgICAgICBJRVJDMjAgdG9rZW4sCiAgICAgICAgYWRkcmVzcyBzZW5kZXIsCiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQsCiAgICAgICAgdWludDI1NiBhbW91bnQKICAgICkgcHJpdmF0ZSB7CiAgICAgICAgYm9vbCBzZW50ID0gdG9rZW4udHJhbnNmZXJGcm9tKHNlbmRlciwgcmVjaXBpZW50LCBhbW91bnQpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIlRva2VuIHRyYW5zZmVyIGZhaWxlZCIpOwogICAgfQp9Cg=="}],_j=`

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

        +`,Dj=({prev:s,next:a})=>r.jsx(A,{version:Mj,title:Sj,description:xj,html:zj,prev:s,next:a,codes:Jj}),Ej="0.8.24",Qj="ERC20",Tj="Example of ERC20 token in Solidity",Uj=[{fileName:"ERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG9ydCAiLi9JRVJDMjAuc29sIjsKCmNvbnRyYWN0IEVSQzIwIGlzIElFUkMyMCB7CiAgICBldmVudCBUcmFuc2ZlcihhZGRyZXNzIGluZGV4ZWQgZnJvbSwgYWRkcmVzcyBpbmRleGVkIHRvLCB1aW50MjU2IHZhbHVlKTsKICAgIGV2ZW50IEFwcHJvdmFsKAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCBvd25lciwgYWRkcmVzcyBpbmRleGVkIHNwZW5kZXIsIHVpbnQyNTYgdmFsdWUKICAgICk7CgogICAgdWludDI1NiBwdWJsaWMgdG90YWxTdXBwbHk7CiAgICBtYXBwaW5nKGFkZHJlc3MgPT4gdWludDI1NikgcHVibGljIGJhbGFuY2VPZjsKICAgIG1hcHBpbmcoYWRkcmVzcyA9PiBtYXBwaW5nKGFkZHJlc3MgPT4gdWludDI1NikpIHB1YmxpYyBhbGxvd2FuY2U7CiAgICBzdHJpbmcgcHVibGljIG5hbWU7CiAgICBzdHJpbmcgcHVibGljIHN5bWJvbDsKICAgIHVpbnQ4IHB1YmxpYyBkZWNpbWFsczsKCiAgICBjb25zdHJ1Y3RvcihzdHJpbmcgbWVtb3J5IF9uYW1lLCBzdHJpbmcgbWVtb3J5IF9zeW1ib2wsIHVpbnQ4IF9kZWNpbWFscykgewogICAgICAgIG5hbWUgPSBfbmFtZTsKICAgICAgICBzeW1ib2wgPSBfc3ltYm9sOwogICAgICAgIGRlY2ltYWxzID0gX2RlY2ltYWxzOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnM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ICBlbWl0IFRyYW5zZmVyKGFkZHJlc3MoMCksIHRvLCBhbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF9idXJuKGFkZHJlc3MgZnJvbSwgdWludDI1NiBhbW91bnQpIGludGVybmFsIHsKICAgICAgICBiYWxhbmNlT2ZbZnJvbV0gLT0gYW1vdW50OwogICAgICAgIHRvdGFsU3VwcGx5IC09IGFtb3VudDsKICAgICAgICBlbWl0IFRyYW5zZmVyKGZyb20sIGFkZHJlc3MoMCksIGFtb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gbWludChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgewogICAgICAgIF9taW50KHRvLCBhbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIGJ1cm4oYWRkcmVzcyBmcm9tLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgewogICAgICAgIF9idXJuKGZyb20sIGFtb3VudCk7CiAgICB9Cn0K"},{fileName:"IERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcyBzZW5kZXIsIGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwp9Cg=="},{fileName:"MyToken.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG9ydCAiLi9FUkMyMC5zb2wiOwoKY29udHJhY3QgTXlUb2tlbiBpcyBFUkMyMCB7CiAgICBjb25zdHJ1Y3RvcihzdHJpbmcgbWVtb3J5IG5hbWUsIHN0cmluZyBtZW1vcnkgc3ltYm9sLCB1aW50OCBkZWNpbWFscykKICAgICAgICBFUkMyMChuYW1lLCBzeW1ib2wsIGRlY2ltYWxzKQogICAgewogICAgICAgIC8vIE1pbnQgMTAwIHRva2VucyB0byBtc2cuc2VuZGVyCiAgICAgICAgLy8gU2ltaWxhciB0byBob3cKICAgICAgICAvLyAxIGRvbGxhciA9IDEwMCBjZW50cwogICAgICAgIC8vIDEgdG9rZW4gPSAxICogKDEwICoqIGRlY2ltYWxzKQogICAgICAgIF9taW50KG1zZy5zZW5kZXIsIDEwMCAqIDEwICoqIHVpbnQyNTYoZGVjaW1hbHMpKTsKICAgIH0KfQo="},{fileName:"TokenSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG9ydCAiLi9JRVJDMjAuc29sIjsKCi8qCkhvdyB0byBzd2FwIHRva2VucwoKMS4gQWxpY2UgaGFzIDEwMCB0b2tlbnMgZnJvbSBBbGljZUNvaW4s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gICAgICBhbW91bnQxID0gX2Ftb3VudDE7CiAgICAgICAgdG9rZW4yID0gSUVSQzIwKF90b2tlbjIpOwogICAgICAgIG93bmVyMiA9IF9vd25lcjI7CiAgICAgICAgYW1vdW50MiA9IF9hbW91bnQyOwogICAgfQoKICAgIGZ1bmN0aW9uIHN3YXAoKSBwdWJsaWMgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBvd25lcjEgfHwgbXNnLnNlbmRlciA9PSBvd25lcjIsICJOb3QgYXV0aG9yaXplZCIpOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHRva2VuMS5hbGxvd2FuY2Uob3duZXIxLCBhZGRyZXNzKHRoaXMpKSA+PSBhbW91bnQxLAogICAgICAgICAgICAiVG9rZW4gMSBhbGxvd2FuY2UgdG9vIGxvdyIKICAgICAgICApOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHRva2VuMi5hbGxvd2FuY2Uob3duZXIyLCBhZGRyZXNzKHRoaXMpKSA+PSBhbW91bnQyLAogICAgICAgICAgICAiVG9rZW4gMiBhbGxvd2FuY2UgdG9vIGxvdyIKICAgICAgICApOwoKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjEsIG93bmVyMSwgb3duZXIyLCBhbW91bnQxKTsKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjIsIG93bmVyMiwgb3duZXIxLCBhbW91bnQyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfc2FmZVRyYW5zZmVyRnJvbSgKICAgICAgICBJRVJDMjAgdG9rZW4sCiAgICAgICAgYWRkcmVzcyBzZW5kZXIsCiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQsCiAgICAgICAgdWludDI1NiBhbW91bnQKICAgICkgcHJpdmF0ZSB7CiAgICAgICAgYm9vbCBzZW50ID0gdG9rZW4udHJhbnNmZXJGcm9tKHNlbmRlciwgcmVjaXBpZW50LCBhbW91bnQpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIlRva2VuIHRyYW5zZmVyIGZhaWxlZCIpOwogICAgfQp9Cg=="}],_j=`

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

        ERC20 tokens provide functionalities to

        • transfer tokens
        • @@ -1441,7 +1441,7 @@ How to swap tokens require(sent, "Token transfer failed"); } } -`,Lj=({prev:s,next:a})=>r.jsx(u,{version:Ej,title:Qj,description:Tj,html:_j,prev:s,next:a,codes:Uj}),Oj="0.8.24",Pj="ERC721",$j="Example of ERC721 non fungible token in Solidity",qj=[{fileName:"ERC721.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDMTY1IHsKICAgIGZ1bmN0aW9uIHN1cHBvcnRzSW50ZXJmYWNlKGJ5dGVzNCBpbnRlcmZhY2VJRCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChib29sKTsKfQoKaW50ZXJmYWNlIElFUkM3MjEgaXMgSUVSQzE2NSB7CiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBvd25lcikgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2IGJhbGFuY2UpOwogICAgZnVuY3Rpb24gb3duZXJPZih1aW50MjU2IHRva2VuSWQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYWRkcmVzcyBvd25lcik7CiAgICBmdW5jdGlvbiBzYWZlVHJhbnNmZXJGcm9tKGFkZHJlc3MgZnJvbSwgYWRkcmVzcyB0bywgdWludDI1NiB0b2tlbklkKQogICAgICAgIGV4dGVybmFsOwogICAgZnVuY3Rpb24gc2FmZVRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIGZyb20sCiAgICAgICAgYWRkcmVzcyB0bywKICAgICAgICB1aW50MjU2IHRva2VuSWQsCiAgICAgICAgYnl0ZXMgY2FsbGRhdGEgZGF0YQogICAgKSB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ZF07CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgdG8sIGlkKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzYWZlVHJhbnNmZXJGcm9tKGFkZHJlc3MgZnJvbSwgYWRkcmVzcyB0bywgdWludDI1NiBpZCkgZXh0ZXJuYWwgewogICAgICAgIHRyYW5zZmVyRnJvbShmcm9tLCB0bywgaWQpOwoKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICB0by5jb2RlLmxlbmd0aCA9PSAwCiAgICAgICAgICAgICAgICB8fCBJRVJDNzIxUmVjZWl2ZXIodG8pLm9uRVJDNzIxUmVjZWl2ZWQobXNnLnNlbmRlciwgZnJvbSwgaWQsICIiKQogICAgICAgICAgICAgICAgICAgID09IElFUkM3MjFSZWNlaXZlci5vbkVSQzcyMVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAidW5zYWZlIHJlY2lwaWVudCIKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHNhZmVUcmFuc2ZlckZyb20oCiAgICAgICAgYWRkcmVzcyBmcm9tLAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludDI1NiBpZCwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICB0cmFuc2ZlckZyb20oZnJvbSwgdG8sIGlkKTsKCiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgdG8uY29kZS5sZW5ndGggPT0gMAogICAgICAgICAgICAgICAgfHwgSUVSQzcyMVJlY2VpdmVyKHRvKS5vbkVSQzcyMVJlY2VpdmVkKG1zZy5zZW5kZXIsIGZyb20sIGlkLCBkYXRhKQogICAgICAgICAgICAgICAgICAgID09IElFUkM3MjFSZWNlaXZlci5vbkVSQzcyMVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAidW5zYWZlIHJlY2lwaWVudCIKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgdG8sIHVpbnQyNTYgaWQpIGludGVybmFsIHsKICAgICAgICByZXF1aXJlKHRvICE9IGFkZHJlc3MoMCksICJtaW50IHRvIHplcm8gYWRkcmVzcyIpOwogICAgICAgIHJlcXVpcmUoX293bmVyT2ZbaWRdID09IGFkZHJlc3MoMCksICJhbHJlYWR5IG1pbnRlZCIpOwoKICAgICAgICBfYmFsYW5jZU9mW3RvXSsrOwogICAgICAgIF9vd25lck9mW2lkXSA9IHRvOwoKICAgICAgICBlbWl0IFRyYW5zZmVyKGFkZHJlc3MoMCksIHRvLCBpZCk7CiAgICB9CgogICAgZnVuY3Rpb24gX2J1cm4odWludDI1NiBpZCkgaW50ZXJuYWwgewogICAgICAgIGFkZHJlc3Mgb3duZXIgPSBfb3duZXJPZltpZF07CiAgICAgICAgcmVxdWlyZShvd25lciAhPSBhZGRyZXNzKDApLCAibm90IG1pbnRlZCIpOwoKICAgICAgICBfYmFsYW5jZU9mW293bmVyXSAtPSAxOwoKICAgICAgICBkZWxldGUgX293bmVyT2ZbaWRdOwogICAgICAgIGRlbGV0ZSBfYXBwcm92YWxzW2lkXTsKCiAgICAgICAgZW1pdCBUcmFuc2Zlcihvd25lciwgYWRkcmVzcygwKSwgaWQpOwogICAgfQp9Cgpjb250cmFjdCBNeU5GVCBpcyBFUkM3MjEgewogICAgZnVuY3Rpb24gbWludChhZGRyZXNzIHRvLCB1aW50MjU2IGlkKSBleHRlcm5hbCB7CiAgICAgICAgX21pbnQodG8sIGlkKTsKICAgIH0KCiAgICBmdW5jdGlvbiBidXJuKHVpbnQyNTYgaWQpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gX293bmVyT2ZbaWRdLCAibm90IG93bmVyIik7CiAgICAgICAgX2J1cm4oaWQpOwogICAgfQp9Cg=="}],su=`

          Example of ERC721

          +`,Lj=({prev:s,next:a})=>r.jsx(A,{version:Ej,title:Qj,description:Tj,html:_j,prev:s,next:a,codes:Uj}),Oj="0.8.24",Pj="ERC721",$j="Example of ERC721 non fungible token in Solidity",qj=[{fileName:"ERC721.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDMTY1IHsKICAgIGZ1bmN0aW9uIHN1cHBvcnRzSW50ZXJmYWNlKGJ5dGVzNCBpbnRlcmZhY2VJRCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChib29sKTsKfQoKaW50ZXJmYWNlIElFUkM3MjEgaXMgSUVSQzE2NSB7CiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBvd25lcikgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2IGJhbGFuY2UpOwogICAgZnVuY3Rpb24gb3duZXJPZih1aW50MjU2IHRva2VuSWQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYWRkcmVzcyBvd25lcik7CiAgICBmdW5jdGlvbiBzYWZlVHJhbnNmZXJGcm9tKGFkZHJlc3MgZnJvbSwgYWRkcmVzcyB0bywgdWludDI1NiB0b2tlbklkKQogICAgICAgIGV4dGVybmFsOwogICAgZnVuY3Rpb24gc2FmZVRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIGZyb20sCiAgICAgICAgYWRkcmVzcyB0bywKICAgICAgICB1aW50MjU2IHRva2VuSWQsCiAgICAgICAgYnl0ZXMgY2FsbGRhdGEgZGF0YQogICAgKSBleHRlcm5hbDsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIGZyb20sIGFkZHJlc3MgdG8sIHVpbnQyNTYgdG9rZW5JZCkgZXh0ZXJuYWw7CiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3MgdG8sIHVpbnQyNTYgdG9rZW5JZCkgZXh0ZXJuYWw7CiAgICBmdW5jdGlvbiBnZXRBcHByb3ZlZCh1a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ICAgICB0by5jb2RlLmxlbmd0aCA9PSAwCiAgICAgICAgICAgICAgICB8fCBJRVJDNzIxUmVjZWl2ZXIodG8pLm9uRVJDNzIxUmVjZWl2ZWQobXNnLnNlbmRlciwgZnJvbSwgaWQsICIiKQogICAgICAgICAgICAgICAgICAgID09IElFUkM3MjFSZWNlaXZlci5vbkVSQzcyMVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAidW5zYWZlIHJlY2lwaWVudCIKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHNhZmVUcmFuc2ZlckZyb20oCiAgICAgICAgYWRkcmVzcyBmcm9tLAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludDI1NiBpZCwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICB0cmFuc2ZlckZyb20oZnJvbSwgdG8sIGlkKTsKCiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgdG8uY29kZS5sZW5ndGggPT0gMAogICAgICAgICAgICAgICAgfHwgSUVSQzcyMVJlY2VpdmVyKHRvKS5vbkVSQzcyMVJlY2VpdmVkKG1zZy5zZW5kZXIsIGZyb20sIGlkLCBkYXRhKQogICAgICAgICAgICAgICAgICAgID09IElFUkM3MjFSZWNlaXZlci5vbkVSQzcyMVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAidW5zYWZlIHJlY2lwaWVudCIKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgdG8sIHVpbnQyNTYgaWQpIGludGVybmFsIHsKICAgICAgICByZXF1aXJlKHRvICE9IGFkZHJlc3MoMCksICJtaW50IHRvIHplcm8gYWRkcmVzcyIpOwogICAgICAgIHJlcXVpcmUoX293bmVyT2ZbaWRdID09IGFkZHJlc3MoMCksICJhbHJlYWR5IG1pbnRlZCIpOwoKICAgICAgICBfYmFsYW5jZU9mW3RvXSsrOwogICAgICAgIF9vd25lck9mW2lkXSA9IHRvOwoKICAgICAgICBlbWl0IFRyYW5zZmVyKGFkZHJlc3MoMCksIHRvLCBpZCk7CiAgICB9CgogICAgZnVuY3Rpb24gX2J1cm4odWludDI1NiBpZCkgaW50ZXJuYWwgewogICAgICAgIGFkZHJlc3Mgb3duZXIgPSBfb3duZXJPZltpZF07CiAgICAgICAgcmVxdWlyZShvd25lciAhPSBhZGRyZXNzKDApLCAibm90IG1pbnRlZCIpOwoKICAgICAgICBfYmFsYW5jZU9mW293bmVyXSAtPSAxOwoKICAgICAgICBkZWxldGUgX293bmVyT2ZbaWRdOwogICAgICAgIGRlbGV0ZSBfYXBwcm92YWxzW2lkXTsKCiAgICAgICAgZW1pdCBUcmFuc2Zlcihvd25lciwgYWRkcmVzcygwKSwgaWQpOwogICAgfQp9Cgpjb250cmFjdCBNeU5GVCBpcyBFUkM3MjEgewogICAgZnVuY3Rpb24gbWludChhZGRyZXNzIHRvLCB1aW50MjU2IGlkKSBleHRlcm5hbCB7CiAgICAgICAgX21pbnQodG8sIGlkKTsKICAgIH0KCiAgICBmdW5jdGlvbiBidXJuKHVpbnQyNTYgaWQpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gX293bmVyT2ZbaWRdLCAibm90IG93bmVyIik7CiAgICAgICAgX2J1cm4oaWQpOwogICAgfQp9Cg=="}],sA=`

          Example of ERC721

          // SPDX-License-Identifier: MIT
           pragma solidity ^0.8.24;
           
          @@ -1635,7 +1635,7 @@ How to swap tokens
                   _burn(id);
               }
           }
          -
          `,au=({prev:s,next:a})=>r.jsx(u,{version:Oj,title:Pj,description:$j,html:su,prev:s,next:a,codes:qj}),nu="0.8.24",lu="Ether Wallet",pu="Simple example of wallet in Solidity",eu=[{fileName:"EtherWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEV0aGVyV2FsbGV0IHsKICAgIGFkZHJlc3MgcGF5YWJsZSBwdWJsaWMgb3duZXI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHt9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcodWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IG93bmVyLCAiY2FsbGVyIGlzIG5vdCBvd25lciIpOwogICAgICAgIHBheWFibGUobXNnLnNlbmRlcikudHJhbnNmZXIoX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],cu=`

          An example of a basic wallet.

          +`,aA=({prev:s,next:a})=>r.jsx(A,{version:Oj,title:Pj,description:$j,html:sA,prev:s,next:a,codes:qj}),nA="0.8.24",lA="Ether Wallet",pA="Simple example of wallet in Solidity",eA=[{fileName:"EtherWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEV0aGVyV2FsbGV0IHsKICAgIGFkZHJlc3MgcGF5YWJsZSBwdWJsaWMgb3duZXI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHt9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcodWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IG93bmVyLCAiY2FsbGVyIGlzIG5vdCBvd25lciIpOwogICAgICAgIHBheWFibGUobXNnLnNlbmRlcikudHJhbnNmZXIoX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],cA=`

          An example of a basic wallet.

          • Anyone can send ETH.
          • Only the owner can withdraw.
          • @@ -1661,7 +1661,7 @@ How to swap tokens return address(this).balance; } } -`,tu=({prev:s,next:a})=>r.jsx(u,{version:nu,title:lu,description:pu,html:cu,prev:s,next:a,codes:eu}),ou="0.8.24",ru="Gasless Token Transfer",iu="Gasless ERC20 token transfer with Meta transaction",gu=[{fileName:"ERC20Permit.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEFHUEwtMy4wLW9ubHkKcHJhZ21hIHNvbGlkaXR5ID49MC44LjA7CgovLy8gQG5vdGljZSBNb2Rlcm4gYW5kIGdhcyBlZmZpY2llbnQgRVJDMjAgKyBFSVAtMjYxMiBpbXBsZW1lbnRhdGlvbi4KLy8vIEBhdXRob3IgU29sbWF0ZSAoaHR0cHM6Ly9naXRodWIuY29tL3RyYW5zbWlzc2lvbnMxMS9zb2xtYXRlL2Jsb2IvbWFpbi9zcmMvdG9rZW5zL0VSQzIwLnNvbCkKLy8vIEBhdXRob3IgTW9kaWZpZWQgZnJvbSBVbmlzd2FwIChodHRwczovL2dpdGh1Yi5jb20vVW5pc3dhcC91bmlzd2FwLXYyLWNvcmUvYmxvYi9tYXN0ZXIvY29udHJhY3RzL1VuaXN3YXBWMkVSQzIwLnNvbCkKLy8vIEBkZXYgRG8gbm90IG1hbnVhbGx5IHNldCBiYWxhbmNlcyB3aXRob3V0IHVwZGF0aW5nIHRvdGFsU3VwcGx5LCBhcyB0aGUgc3VtIG9mIGFsbCB1c2VyIGJhbGFuY2VzIG11c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9TRVBBUkFUT1IgPSBjb21wdXRlRG9tYWluU2VwYXJhdG9yKCk7CiAgICB9CgogICAgZnVuY3Rpb24gYXBwcm92ZShhZGRyZXNzIHNwZW5kZXIsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIGFsbG93YW5jZVttc2cuc2VuZGVyXVtzcGVuZGVyXSA9IGFtb3VudDsKICAgICAgICBlbWl0IEFwcHJvdmFsKG1zZy5zZW5kZXIsIHNwZW5kZXIsIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlydHVhbAogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYmFsYW5jZU9mW21zZy5zZW5kZXJdIC09IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKG1zZy5zZW5kZXIsIHRvLCBhbW91bnQpOwogICAgICAgIHJldHVybiB0cnVlOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIGZyb20sIGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIHVpbnQyNTYgYWxsb3dlZCA9IGFsbG93YW5jZVtmcm9tXVttc2cuc2VuZGVyXTsgLy8gU2F2ZXMgZ2FzIGZvciBsaW1pdGVkIGFwcHJvdmFscy4KICAgICAgICBpZiAoYWxsb3dlZCAhPSB0eXBlKHVpbnQyNTYpLm1heCkgewogICAgICAgICAgICBhbGxvd2FuY2VbZnJvbV1bbXNnLnNlbmRlcl0gPSBhbGxvd2VkIC0gYW1vdW50OwogICAgICAgIH0KICAgICAgICBiYWxhbmNlT2ZbZnJvbV0gLT0gYW1vdW50OwoKICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICBiYWxhbmNlT2ZbdG9dICs9IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gcGVybWl0KAogICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgYWRkcmVzcyBzcGVuZGVyLAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgdWludDI1NiBkZWFkbGluZSwKICAgICAgICB1aW50OCB2LAogICAgICAgIGJ5dGVzMzIgciwKICAgICAgICBieXRlczMyIHMKICAgICkgcHVibGljIHZpcnR1YWwgewogICAgICAgIHJlcXVpcmUoZGVhZGxpbmUgPj0gYmxvY2sudGltZXN0YW1wLCAiUEVSTUlUX0RFQURMSU5FX0VYUElSRUQiKTsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYWRkcmVzcyByZWNvdmVyZWRBZGRyZXNzID0gZWNyZWNvdmVyKAogICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgIGFiaS5lbmNvZGVQYWNrZWQoCiAgICAgICAgICAgICAgICAgICAgICAgICJceDE5XHgwMSIsCiAgICAgICAgICAgICAgICAgICAgICAgIERPTUFJTl9TRVBBUkFUT1IoKSwKICAgICAgICAgICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQZXJtaXQoYWRkcmVzcyBvd25lcixhZGRyZXNzIHNwZW5kZXIsdWludDI1NiB2YWx1ZSx1aW50MjU2IG5vbmNlLHVpbnQyNTYgZGVhZGxpbmUpIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3duZXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BlbmRlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub25jZXNbb3duZXJdKyssCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVhZGxpbmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICB2LAogICAgICAgICAgICAgICAgciwKICAgICAgICAgICAgICAgIHMKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgICAgICByZWNvdmVyZWRBZGRyZXNzICE9IGFkZHJlc3MoMCkgJiYgcmVjb3ZlcmVkQWRkcmVzcyA9PSBvd25lciwKICAgICAgICAgICAgICAgICJJTlZBTElEX1NJR05FUiIKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIGFsbG93YW5jZVtyZWNvdmVyZWRBZGRyZXNzXVtzcGVuZGVyXSA9IHZhbHVlOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBBcHByb3ZhbChvd25lciwgc3BlbmRlciwgdmFsdWUpOwogICAgfQoKICAgIGZ1bmN0aW9uIERPTUFJTl9TRVBBUkFUT1IoKSBwdWJsaWMgdmlldyB2aXJ0dWFsIHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4gYmxvY2suY2hhaW5pZCA9PSBJTklUSUFMX0NIQUlOX0lECiAgICAgICAgICAgID8gSU5JVElBTF9ET01BSU5fU0VQQVJBVE9SCiAgICAgICAgICAgIDogY29tcHV0ZURvbWFpblNlcGFyYXRvcigpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbXB1dGVEb21haW5TZXBhcmF0b3IoKSBpbnRlcm5hbCB2aWV3IHZpcnR1YWwgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBrZWNjYWsyNTYoCiAgICAgICAgICAgIGFiaS5lbmNvZGUoCiAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgIkVJUDcxMkRvbWFpbihzdHJpbmcgbmFtZSxzdHJpbmcgdmVyc2lvbix1aW50MjU2IGNoYWluSWQsYWRkcmVzcyB2ZXJpZnlpbmdDb250cmFjdCkiCiAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAga2VjY2FrMjU2KGJ5dGVzKG5hbWUpKSwKICAgICAgICAgICAgICAgIGtlY2NhazI1NigiMSIpLAogICAgICAgICAgICAgICAgYmxvY2suY2hhaW5pZCwKICAgICAgICAgICAgICAgIGFkZHJlc3ModGhpcykKICAgICAgICAgICAgKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbnQoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKGFkZHJlc3MoMCksIHRvLCBhbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF9idXJuKGFkZHJlc3MgZnJvbSwgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIGJhbGFuY2VPZltmcm9tXSAtPSBhbW91bnQ7CgogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHRvdGFsU3VwcGx5IC09IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgYWRkcmVzcygwKSwgYW1vdW50KTsKICAgIH0KfQoKY29udHJhY3QgRVJDMjBQZXJtaXQgaXMgRVJDMjAgewogICAgY29uc3RydWN0b3Ioc3RyaW5nIG1lbW9yeSBfbmFtZSwgc3RyaW5nIG1lbW9yeSBfc3ltYm9sLCB1aW50OCBfZGVjaW1hbHMpCiAgICAgICAgRVJDMjAoX25hbWUsIF9zeW1ib2wsIF9kZWNpbWFscykKICAgIHt9CgogICAgZnVuY3Rpb24gbWludChhZGRyZXNzIHRvLCB1aW50MjU2IGFtb3VudCkgcHVibGljIHsKICAgICAgICBfbWludCh0bywgYW1vdW50KTsKICAgIH0KfQo="},{fileName:"GaslessTokenTransfer.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDMjBQZXJtaXQgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb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W5kZXIsIHJlY2VpdmVyLCBhbW91bnQpOwogICAgICAgIC8vIFRha2UgZmVlIC0gc2VuZCBmZWUgdG8gbXNnLnNlbmRlcgogICAgICAgIElFUkMyMFBlcm1pdCh0b2tlbikudHJhbnNmZXJGcm9tKHNlbmRlciwgbXNnLnNlbmRlciwgZmVlKTsKICAgIH0KfQo="}],hu=`

            Gasless ERC20 token transfer with Meta transaction

            +`,tA=({prev:s,next:a})=>r.jsx(A,{version:nA,title:lA,description:pA,html:cA,prev:s,next:a,codes:eA}),oA="0.8.24",rA="Gasless Token Transfer",iA="Gasless ERC20 token transfer with Meta transaction",gA=[{fileName:"ERC20Permit.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEFHUEwtMy4wLW9ubHkKcHJhZ21hIHNvbGlkaXR5ID49MC44LjA7CgovLy8gQG5vdGljZSBNb2Rlcm4gYW5kIGdhcyBlZmZpY2llbnQgRVJDMjAgKyBFSVAtMjYxMiBpbXBsZW1lbnRhdGlvbi4KLy8vIEBhdXRob3IgU29sbWF0ZSAoaHR0cHM6Ly9naXRodWIuY29tL3RyYW5zbWlzc2lvbnMxMS9zb2xtYXRlL2Jsb2IvbWFpbi9zcmMvdG9rZW5zL0VSQzIwLnNvbCkKLy8vIEBhdXRob3IgTW9kaWZpZWQgZnJvbSBVbmlzd2FwIChodHRwczovL2dpdGh1Yi5jb20vVW5pc3dhcC91bmlzd2FwLXYyLWNvcmUvYmxvYi9tYXN0ZXIvY29udHJhY3RzL1VuaXN3YXBWMkVSQzIwLnNvbCkKLy8vIEBkZXYgRG8gbm90IG1hbnVhbGx5IHNldCBiYWxhbmNlcyB3aXRob3V0IHVwZGF0aW5nIHRvdGFsU3VwcGx5LCBhcyB0aGUgc3VtIG9mIGFsbCB1c2VyIGJhbGFuY2VzIG11c3Qgbm90IGV4Y2VlZCBpdC4KYWJzdHJhY3QgY29udHJhY3QgRVJDMjAgewogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVz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yZXNzIHNwZW5kZXIsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIGFsbG93YW5jZVttc2cuc2VuZGVyXVtzcGVuZGVyXSA9IGFtb3VudDsKICAgICAgICBlbWl0IEFwcHJvdmFsKG1zZy5zZW5kZXIsIHNwZW5kZXIsIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlydHVhbAogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYmFsYW5jZU9mW21zZy5zZW5kZXJdIC09IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKG1zZy5zZW5kZXIsIHRvLCBhbW91bnQpOwogICAgICAgIHJldHVybiB0cnVlOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIGZyb20sIGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIHVpbnQyNTYgYWxsb3dlZCA9IGFsbG93YW5jZVtmcm9tXVttc2cuc2VuZGVyXTsgLy8gU2F2ZXMgZ2FzIGZvciBsaW1pdGVkIGFwcHJvdmFscy4KICAgICAgICBpZiAoYWxsb3dlZCAhPSB0eXBlKHVpbnQyNTYpLm1heCkgewogICAgICAgICAgICBhbGxvd2FuY2VbZnJvbV1bbXNnLnNlbmRlcl0gPSBhbGxvd2VkIC0gYW1vdW50OwogICAgICAgIH0KICAgICAgICBiYWxhbmNlT2ZbZnJvbV0gLT0gYW1vdW50OwoKICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICBiYWxhbmNlT2ZbdG9dICs9IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gcGVybWl0KAogICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgYWRkcmVzcyBzcGVuZGVyLAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgdWludDI1NiBkZWFkbGluZSwKICAgICAgICB1aW50OCB2LAogICAgICAgIGJ5dGVzMzIgciwKICAgICAgICBieXRlczMyIHMKICAgICkgcHVibGljIHZpcnR1YWwgewogICAgICAgIHJlcXVpcmUoZGVhZGxpbmUgPj0gYmxvY2sudGltZXN0YW1wLCAiUEVSTUlUX0RFQURMSU5FX0VYUElSRUQiKTsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYWRkcmVzcyByZWNvdmVyZWRBZGRyZXNzID0gZWNyZWNvdmVyKAogICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgIGFiaS5lbmNvZGVQYWNrZWQoCiAgICAgICAgICAgICAgICAgICAgICAgICJceDE5XHgwMSIsCiAgICAgICAgICAgICAgICAgICAgICAgIERPTUFJTl9TRVBBUkFUT1IoKSwKICAgICAgICAgICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQZXJtaXQoYWRkcmVzcyBvd25lcixhZGRyZXNzIHNwZW5kZXIsdWludDI1NiB2YWx1ZSx1aW50MjU2IG5vbmNlLHVpbnQyNTYgZGVhZGxpbmUpIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3duZXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BlbmRlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub25jZXNbb3duZXJdKyssCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVhZGxpbmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICB2LAogICAgICAgICAgICAgICAgciwKICAgICAgICAgICAgICAgIHMKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgICAgICByZWNvdmVyZWRBZGRyZXNzICE9IGFkZHJlc3MoMCkgJiYgcmVjb3ZlcmVkQWRkcmVzcyA9PSBvd25lciwKICAgICAgICAgICAgICAgICJJTlZBTElEX1NJR05FUiIKICAgICAgICAgICAgKTsKCiAgICAgICAgICAgIGFsbG93YW5jZVtyZWNvdmVyZWRBZGRyZXNzXVtzcGVuZGVyXSA9IHZhbHVlOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBBcHByb3ZhbChvd25lciwgc3BlbmRlciwgdmFsdWUpOwogICAgfQoKICAgIGZ1bmN0aW9uIERPTUFJTl9TRVBBUkFUT1IoKSBwdWJsaWMgdmlldyB2aXJ0dWFsIHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4gYmxvY2suY2hhaW5pZCA9PSBJTklUSUFMX0NIQUlOX0lECiAgICAgICAgICAgID8gSU5JVElBTF9ET01BSU5fU0VQQVJBVE9SCiAgICAgICAgICAgIDogY29tcHV0ZURvbWFpblNlcGFyYXRvcigpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbXB1dGVEb21haW5TZXBhcmF0b3IoKSBpbnRlcm5hbCB2aWV3IHZpcnR1YWwgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBrZWNjYWsyNTYoCiAgICAgICAgICAgIGFiaS5lbmNvZGUoCiAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgIkVJUDcxMkRvbWFpbihzdHJpbmcgbmFtZSxzdHJpbmcgdmVyc2lvbix1aW50MjU2IGNoYWluSWQsYWRkcmVzcyB2ZXJpZnlpbmdDb250cmFjdCkiCiAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAga2VjY2FrMjU2KGJ5dGVzKG5hbWUpKSwKICAgICAgICAgICAgICAgIGtlY2NhazI1NigiMSIpLAogICAgICAgICAgICAgICAgYmxvY2suY2hhaW5pZCwKICAgICAgICAgICAgICAgIGFkZHJlc3ModGhpcykKICAgICAgICAgICAgKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbnQoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IGFtb3VudDsKCiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyKGFkZHJlc3MoMCksIHRvLCBhbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF9idXJuKGFkZHJlc3MgZnJvbSwgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIGJhbGFuY2VPZltmcm9tXSAtPSBhbW91bnQ7CgogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHRvdGFsU3VwcGx5IC09IGFtb3VudDsKICAgICAgICB9CgogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgYWRkcmVzcygwKSw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gogICAgICAgIElFUkMyMFBlcm1pdCh0b2tlbikudHJhbnNmZXJGcm9tKHNlbmRlciwgbXNnLnNlbmRlciwgZmVlKTsKICAgIH0KfQo="}],hA=`

            Gasless ERC20 token transfer with Meta transaction

            // SPDX-License-Identifier: MIT
             pragma solidity ^0.8.24;
             
            @@ -1886,7 +1886,7 @@ How to swap tokens
                     _mint(to, amount);
                 }
             }
            -
            `,Iu=({prev:s,next:a})=>r.jsx(u,{version:ou,title:ru,description:iu,html:hu,prev:s,next:a,codes:gu}),du="0.8.24",Cu="Iterable Mapping",ju="Iterable Mapping in Solidity",uu=[{fileName:"IterableMapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmxpYnJhcnkgSXRlcmFibGVNYXBwaW5nIHsKICAgIC8vIEl0ZXJhYmxlIG1hcHBpbmcgZnJvbSBhZGRyZXNzIHRvIHVpbnQ7CiAgICBzdHJ1Y3QgTWFwIHsKICAgICAgICBhZGRyZXNzW10ga2V5czsKICAgICAgICBtYXBwaW5nKGFkZHJlc3MgPT4gdWludDI1NikgdmFsdWVzOwogICAgICAgIG1hcHBpbmcoYWRkcmVzcyA9PiB1aW50MjU2KSBpbmRleE9mOwogICAgICAgIG1hcHBpbmcoYWRkcmVzcyA9PiBib29sKSBpbnNlcnRlZDsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXQoTWFwIHN0b3JhZ2UgbWFwLCBhZGRyZXNzIGtleSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBtYXAudmFsdWVzW2tleV07CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0S2V5QXRJbmRleChNYXAgc3RvcmFnZSBtYXAsIHVpbnQyNTYgaW5kZXgpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgcmV0dXJuIG1hcC5rZXlzW2luZGV4XTsKICAgIH0KCiAgICBmdW5jdGlvbiBzaXplKE1hcCBzdG9yYWdlIG1hcCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBtYXAua2V5cy5sZW5ndGg7CiAgICB9CgogICAgZnVuY3Rpb24gc2V0KE1hcCBzdG9yYWdlIG1hcCwgYWRkcmVzcyBrZXksIHVpbnQyNTYgdmFsKSBwdWJsaWMgewogICAgICAgIGlmIChtYXAuaW5zZXJ0ZWRba2V5XSkgewogICAgICAgICAgICBtYXAudmFsdWVzW2tleV0gPSB2YWw7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbWFwLmluc2VydGVkW2tleV0gPSB0cnVlOwogICAgICAgICAgICBtYXAudmFsdWVzW2tleV0gPSB2YWw7CiAgICAgICAgICAgIG1hcC5pbmRleE9mW2tleV0gPSBtYXAua2V5cy5sZW5ndGg7CiAgICAgICAgICAgIG1hcC5rZXlzLnB1c2goa2V5KTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gcmVtb3ZlKE1hcCBzdG9yYWdlIG1hcCwgYWRkcmVzcyBrZXkpIHB1YmxpYyB7CiAgICAgICAgaWYgKCFtYXAuaW5zZXJ0ZWRba2V5XSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQoKICAgICAgICBkZWxldGUgbWFwLmluc2VydGVkW2tleV07CiAgICAgICAgZGVsZXRlIG1hcC52YWx1ZXNba2V5XTsKCiAgICAgICAgdWludDI1NiBpbmRleCA9IG1hcC5pbmRleE9mW2tleV07CiAgICAgICAgYWRkcmVzcyBsYXN0S2V5ID0gbWFwLmtleXNbbWFwLmtleXMubGVuZ3RoIC0gMV07CgogICAgICAgIG1hcC5pbmRleE9mW2xhc3RLZXldID0gaW5kZXg7CiAgICAgICAgZGVsZXRlIG1hcC5pbmRleE9mW2tleV07CgogICAgICAgIG1hcC5rZXlzW2luZGV4XSA9IGxhc3RLZXk7CiAgICAgICAgbWFwLmtleXMucG9wKCk7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RJdGVyYWJsZU1hcCB7CiAgICB1c2luZyBJdGVyYWJsZU1hcHBpbmcgZm9yIEl0ZXJhYmxlTWFwcGluZy5NYXA7CgogICAgSXRlcmFibGVNYXBwaW5nLk1hcCBwcml2YXRlIG1hcDsKCiAgICBmdW5jdGlvbiB0ZXN0SXRlcmFibGVNYXAoKSBwdWJsaWMgewogICAgICAgIG1hcC5zZXQoYWRkcmVzcygwKSwgMCk7CiAgICAgICAgbWFwLnNldChhZGRyZXNzKDEpLCAxMDApOwogICAgICAgIG1hcC5zZXQoYWRkcmVzcygyKSwgMjAwKTsgLy8gaW5zZXJ0CiAgICAgICAgbWFwLnNldChhZGRyZXNzKDIpLCAyMDApOyAvLyB1cGRhdGUKICAgICAgICBtYXAuc2V0KGFkZHJlc3MoMyksIDMwMCk7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IG1hcC5zaXplKCk7IGkrKykgewogICAgICAgICAgICBhZGRyZXNzIGtleSA9IG1hcC5nZXRLZXlBdEluZGV4KGkpOwogICAgICAgICAgICBhc3NlcnQobWFwLmdldChrZXkpID09IGkgKiAxMDApOwogICAgICAgIH0KCiAgICAgICAgbWFwLnJlbW92ZShhZGRyZXNzKDEpKTsKCiAgICAgICAgLy8ga2V5cyA9IFthZGRyZXNzKDApLCBhZGRyZXNzKDMpLCBhZGRyZXNzKDIpXQogICAgICAgIGFzc2VydChtYXAuc2l6ZSgpID09IDMpOwogICAgICAgIGFzc2VydChtYXAuZ2V0S2V5QXRJbmRleCgwKSA9PSBhZGRyZXNzKDApKTsKICAgICAgICBhc3NlcnQobWFwLmdldEtleUF0SW5kZXgoMSkgPT0gYWRkcmVzcygzKSk7CiAgICAgICAgYXNzZXJ0KG1hcC5nZXRLZXlBdEluZGV4KDIpID09IGFkZHJlc3MoMikpOwogICAgfQp9Cg=="}],Au=`

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

            +`,IA=({prev:s,next:a})=>r.jsx(A,{version:oA,title:rA,description:iA,html:hA,prev:s,next:a,codes:gA}),dA="0.8.24",CA="Iterable Mapping",jA="Iterable Mapping in Solidity",AA=[{fileName:"IterableMapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmxpYnJhcnkgSXRlcmFibGVNYXBwaW5nIHsKICAgIC8vIEl0ZXJhYmxlIG1hcHBpbmcgZnJvbSBhZGRyZXNzIHRvIHVpbnQ7CiAgICBzdHJ1Y3QgTWFwIHsKICAgICAgICBhZGRyZXNzW10ga2V5czsKICAgICAgICBtYXBwaW5nKGFkZHJlc3MgPT4gdWludDI1NikgdmFsdWVzOwogICAgICAgIG1hcHBpbmcoYWRkcmVzcyA9PiB1aW50MjU2KSBpbmRleE9mOwogICAgICAgIG1hcHBpbmcoYWRkcmVzcyA9PiBib29sKSBpbnNlcnRlZDsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXQoTWFwIHN0b3JhZ2UgbWFwLCBhZGRyZXNzIGtleSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBtYXAudmFsdWVzW2tleV07CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0S2V5QXRJbmRleChNYXAgc3RvcmFnZSBtYXAsIHVpbnQyNTYgaW5kZXgpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgcmV0dXJuIG1hcC5rZXlzW2luZGV4XTsKICAgIH0KCiAgICBmdW5jdGlvbiBzaXplKE1hcCBzdG9yYWdlIG1hcCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBtYXAua2V5cy5sZW5ndGg7CiAgICB9CgogICAgZnVuY3Rpb24gc2V0KE1hcCBzdG9yYWdlIG1hcCwgYWRkcmVzcyBrZXksIHVpbnQyNTYgdmFsKSBwdWJsaWMgewogICAgICAgIGlmIChtYXAuaW5zZXJ0ZWRba2V5XSkgewogICAgICAgICAgICBtYXAudmFsdWVzW2tleV0gPSB2YWw7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbWFwLmluc2VydGVkW2tleV0gPSB0cnVlOwogICAgICAgICAgICBtYXAudmFsdWVzW2tleV0gPSB2YWw7CiAgICAgICAgICAgIG1hcC5pbmRleE9mW2tleV0gPSBtYXAua2V5cy5sZW5ndGg7CiAgICAgICAgICAgIG1hcC5rZXlzLnB1c2goa2V5KTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gcmVtb3ZlKE1hcCBzdG9yYWdlIG1hcCwgYWRkcmVzcyBrZXkpIHB1YmxpYyB7CiAgICAgICAgaWYgKCFtYXAuaW5zZXJ0ZWRba2V5XSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQoKICAgICAgICBkZWxldGUgbWFwLmluc2VydGVkW2tleV07CiAgICAgICAgZGVsZXRlIG1hcC52YWx1ZXNba2V5XTsKCiAgICAgICAgdWludDI1NiBpbmRleCA9IG1hcC5pbmRleE9mW2tleV07CiAgICAgICAgYWRkcmVzcyBsYXN0S2V5ID0gbWFwLmtleXNbbWFwLmtleXMubGVuZ3RoIC0gMV07CgogICAgICAgIG1hcC5pbmRleE9mW2xhc3RLZXldID0gaW5kZXg7CiAgICAgICAgZGVsZXRlIG1hcC5pbmRleE9mW2tleV07CgogICAgICAgIG1hcC5rZXlzW2luZGV4XSA9IGxhc3RLZXk7CiAgICAgICAgbWFwLmtleXMucG9wKCk7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RJdGVyYWJsZU1hcCB7CiAgICB1c2luZyBJdGVyYWJsZU1hcHBpbmcgZm9yIEl0ZXJhYmxlTWFwcGluZy5NYXA7CgogICAgSXRlcmFibGVNYXBwaW5nLk1hcCBwcml2YXRlIG1hcDsKCiAgICBmdW5jdGlvbiB0ZXN0SXRlcmFibGVNYXAoKSBwdWJsaWMgewogICAgICAgIG1hcC5zZXQoYWRkcmVzcygwKSwgMCk7CiAgICAgICAgbWFwLnNldChhZGRyZXNzKDEpLCAxMDApOwogICAgICAgIG1hcC5zZXQoYWRkcmVzcygyKSwgMjAwKTsgLy8gaW5zZXJ0CiAgICAgICAgbWFwLnNldChhZGRyZXNzKDIpLCAyMDApOyAvLyB1cGRhdGUKICAgICAgICBtYXAuc2V0KGFkZHJlc3MoMyksIDMwMCk7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IG1hcC5zaXplKCk7IGkrKykgewogICAgICAgICAgICBhZGRyZXNzIGtleSA9IG1hcC5nZXRLZXlBdEluZGV4KGkpOwogICAgICAgICAgICBhc3NlcnQobWFwLmdldChrZXkpID09IGkgKiAxMDApOwogICAgICAgIH0KCiAgICAgICAgbWFwLnJlbW92ZShhZGRyZXNzKDEpKTsKCiAgICAgICAgLy8ga2V5cyA9IFthZGRyZXNzKDApLCBhZGRyZXNzKDMpLCBhZGRyZXNzKDIpXQogICAgICAgIGFzc2VydChtYXAuc2l6ZSgpID09IDMpOwogICAgICAgIGFzc2VydChtYXAuZ2V0S2V5QXRJbmRleCgwKSA9PSBhZGRyZXNzKDApKTsKICAgICAgICBhc3NlcnQobWFwLmdldEtleUF0SW5kZXgoMSkgPT0gYWRkcmVzcygzKSk7CiAgICAgICAgYXNzZXJ0KG1hcC5nZXRLZXlBdEluZGV4KDIpID09IGFkZHJlc3MoMikpOwogICAgfQp9Cg=="}],uA=`

            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.24;
             
            @@ -1971,7 +1971,7 @@ How to swap tokens
                     assert(map.getKeyAtIndex(2) == address(2));
                 }
             }
            -
            `,yu=({prev:s,next:a})=>r.jsx(u,{version:du,title:Cu,description:ju,html:Au,prev:s,next:a,codes:uu}),mu="0.8.24",bu="Merkle Tree",wu="Learn about Merkle tree in Solidity",ku=[{fileName:"MerkleTree.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE1lcmtsZVByb29mIHsKICAgIGZ1bmN0aW9uIHZlcmlmeSgKICAgICAgICBieXRlczMyW10gbWVtb3J5IHByb29mLAogICAgICAgIGJ5dGVzMzIgcm9vdCwKICAgICAgICBieXRlczMyIGxlYWYsCiAgICAgICAgdWludDI1NiBpbmRleAogICAgKSBwdWJsaWMgcHVyZSByZXR1cm5zIChib29sKSB7CiAgICAgICAgYnl0ZXMzMiBoYXNoID0gbGVhZjsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgcHJvb2YubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgYnl0ZXMzMiBwcm9vZkVsZW1lbnQgPSBwcm9vZltpXTsKCiAgICAgICAgICAgIGlmIChpbmRleCAlIDIgPT0gMCkgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKGhhc2gsIHByb29mRWxlbWVudCkpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKHByb29mRWxlbWVudCwgaGFzaCkpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBpbmRleCA9IGluZGV4IC8gMjsKICAgICAgICB9CgogICAgICAgIHJldHVybiBoYXNoID09IHJvb3Q7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RNZXJrbGVQcm9vZiBpcyBNZXJrbGVQcm9vZiB7CiAgICBieXRlczMyW10gcHVibGljIGhhc2hlczsKCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBzdHJpbmdbNF0gbWVtb3J5IHRyYW5zYWN0aW9ucyA9CiAgICAgICAgICAgIFsiYWxpY2UgLT4gYm9iIiwgImJvYiAtPiBkYXZlIiwgImNhcm9sIC0+IGFsaWNlIiwgImRhdmUgLT4gYm9iIl07CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IHRyYW5zYWN0aW9ucy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBoYXNoZXMucHVzaChrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZCh0cmFuc2FjdGlvbnNbaV0pKSk7CiAgICAgICAgfQoKICAgICAgICB1aW50MjU2IG4gPSB0cmFuc2FjdGlvbnMubGVuZ3RoOwogICAgICAgIHVpbnQyNTYgb2Zmc2V0ID0gMDsKCiAgICAgICAgd2hpbGUgKG4gPiAwKSB7CiAgICAgICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IG4gLSAxOyBpICs9IDIpIHsKICAgICAgICAgICAgICAgIGhhc2hlcy5wdXNoKAogICAgICAgICAgICAgICAgICAgIGtlY2NhazI1NigKICAgICAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZVBhY2tlZCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc2hlc1tvZmZzZXQgKyBpXSwgaGFzaGVzW29mZnNldCArIGkgKyAxXQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBvZmZzZXQgKz0gbjsKICAgICAgICAgICAgbiA9IG4gLyAyOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBnZXRSb290KCkgcHVibGljIHZpZXcgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBoYXNoZXNbaGFzaGVzLmxlbmd0aCAtIDFdOwogICAgfQoKICAgIC8qIHZlcmlmeQogICAgM3JkIGxlYWYKICAgIDB4ZGNhMzMyNmFkN2U4MTIxYmY5Y2Y5YzEyMzMzZTZiMjI3MWFiZTgyM2VjOWVkZmU0MmY4MTNiMWU3NjhmYTU3YgoKICAgIHJvb3QKICAgIDB4Y2MwODZmY2MwMzgxODliNDY0MWRiMmNjNGYxZGUzYmIxMzJhZWZiZDY1ZDUxMGQ4MTc1OTE1NTA5Mzc4MThjNwoKICAgIGluZGV4CiAgICAyCgogICAgcHJvb2YKICAgIDB4OGRhOWUxYzgyMGY5ZGJkMTU4OWZkNjU4NTg3MmJjMTA2MzU4ODYyNTcyOWU3YWIwNzk3Y2ZjNjNhMDBiZDk1MAogICAgMHg5OTU3ODhmZmMxMDNiOTg3YWQ1MGY1ZTU3MDdmZDA5NDQxOWViMTJkOTU1MmNjNDIzYmQwY2Q4NmEzODYxNDMzCiAgICAqLwp9Cg=="}],Zu=`

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

            +`,yA=({prev:s,next:a})=>r.jsx(A,{version:dA,title:CA,description:jA,html:uA,prev:s,next:a,codes:AA}),mA="0.8.24",bA="Merkle Tree",wA="Learn about Merkle tree in Solidity",kA=[{fileName:"MerkleTree.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE1lcmtsZVByb29mIHsKICAgIGZ1bmN0aW9uIHZlcmlmeSgKICAgICAgICBieXRlczMyW10gbWVtb3J5IHByb29mLAogICAgICAgIGJ5dGVzMzIgcm9vdCwKICAgICAgICBieXRlczMyIGxlYWYsCiAgICAgICAgdWludDI1NiBpbmRleAogICAgKSBwdWJsaWMgcHVyZSByZXR1cm5zIChib29sKSB7CiAgICAgICAgYnl0ZXMzMiBoYXNoID0gbGVhZjsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgcHJvb2YubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgYnl0ZXMzMiBwcm9vZkVsZW1lbnQgPSBwcm9vZltpXTsKCiAgICAgICAgICAgIGlmIChpbmRleCAlIDIgPT0gMCkgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKGhhc2gsIHByb29mRWxlbWVudCkpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKHByb29mRWxlbWVudCwgaGFzaCkpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBpbmRleCA9IGluZGV4IC8gMjsKICAgICAgICB9CgogICAgICAgIHJldHVybiBoYXNoID09IHJvb3Q7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RNZXJrbGVQcm9vZiBpcyBNZXJrbGVQcm9vZiB7CiAgICBieXRlczMyW10gcHVibGljIGhhc2hlczsKCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBzdHJpbmdbNF0gbWVtb3J5IHRyYW5zYWN0aW9ucyA9CiAgICAgICAgICAgIFsiYWxpY2UgLT4gYm9iIiwgImJvYiAtPiBkYXZlIiwgImNhcm9sIC0+IGFsaWNlIiwgImRhdmUgLT4gYm9iIl07CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IHRyYW5zYWN0aW9ucy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBoYXNoZXMucHVzaChrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZCh0cmFuc2FjdGlvbnNbaV0pKSk7CiAgICAgICAgfQoKICAgICAgICB1aW50MjU2IG4gPSB0cmFuc2FjdGlvbnMubGVuZ3RoOwogICAgICAgIHVpbnQyNTYgb2Zmc2V0ID0gMDsKCiAgICAgICAgd2hpbGUgKG4gPiAwKSB7CiAgICAgICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IG4gLSAxOyBpICs9IDIpIHsKICAgICAgICAgICAgICAgIGhhc2hlcy5wdXNoKAogICAgICAgICAgICAgICAgICAgIGtlY2NhazI1NigKICAgICAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZVBhY2tlZCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc2hlc1tvZmZzZXQgKyBpXSwgaGFzaGVzW29mZnNldCArIGkgKyAxXQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBvZmZzZXQgKz0gbjsKICAgICAgICAgICAgbiA9IG4gLyAyOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBnZXRSb290KCkgcHVibGljIHZpZXcgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBoYXNoZXNbaGFzaGVzLmxlbmd0aCAtIDFdOwogICAgfQoKICAgIC8qIHZlcmlmeQogICAgM3JkIGxlYWYKICAgIDB4ZGNhMzMyNmFkN2U4MTIxYmY5Y2Y5YzEyMzMzZTZiMjI3MWFiZTgyM2VjOWVkZmU0MmY4MTNiMWU3NjhmYTU3YgoKICAgIHJvb3QKICAgIDB4Y2MwODZmY2MwMzgxODliNDY0MWRiMmNjNGYxZGUzYmIxMzJhZWZiZDY1ZDUxMGQ4MTc1OTE1NTA5Mzc4MThjNwoKICAgIGluZGV4CiAgICAyCgogICAgcHJvb2YKICAgIDB4OGRhOWUxYzgyMGY5ZGJkMTU4OWZkNjU4NTg3MmJjMTA2MzU4ODYyNTcyOWU3YWIwNzk3Y2ZjNjNhMDBiZDk1MAogICAgMHg5OTU3ODhmZmMxMDNiOTg3YWQ1MGY1ZTU3MDdmZDA5NDQxOWViMTJkOTU1MmNjNDIzYmQwY2Q4NmEzODYxNDMzCiAgICAqLwp9Cg=="}],ZA=`

            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.24;
            @@ -2049,7 +2049,7 @@ How to swap tokens
                 0x995788ffc103b987ad50f5e5707fd094419eb12d9552cc423bd0cd86a3861433
                 */
             }
            -
            `,Wu=({prev:s,next:a})=>r.jsx(u,{version:mu,title:bu,description:wu,html:Zu,prev:s,next:a,codes:ku}),Bu="0.8.24",Gu="Minimal Proxy Contract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KICAgICAgICAgICAgLyoKICAgICAgICAgICAgcmVhZHMgdGhlIDMyIGJ5dGVzIG9mIG1lbW9yeSBzdGFydGluZyBhdCBwb2ludGVyIHN0b3JlZCBpbiAweDQwCgogICAgICAgICAgICBJbiBzb2xpZGl0eSwgdGhlIDB4NDAgc2xvdCBpbiBtZW1vcnkgaXMgc3BlY2lhbDogaXQgY29udGFpbnMgdGhlICJmcmVlIG1lbW9yeSBwb2ludGVyIgogICAgICAgICAgICB3aGljaCBwb2ludHMgdG8gdGhlIGVuZCBvZiB0aGUgY3VycmVudGx5IGFsbG9jYXRlZCBtZW1vcnkuCiAgICAgICAgICAgICovCiAgICAgICAgICAgIGxldCBjbG9uZSA6PSBtbG9hZCgweDQwKQogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIgogICAgICAgICAgICBtc3RvcmUoCiAgICAgICAgICAgICAgICBjbG9uZSwKICAgICAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3MzAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICAgIHwKICAgICAgICAgICAgMHgzZDYwMmQ4MDYwMGEzZDM5ODFmMzM2M2QzZDM3M2QzZDNkMzYzZDczMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlcgogICAgICAgICAgICAqLwogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIiArIDIwIGJ5dGVzCiAgICAgICAgICAgIC8vIDB4MTQgPSAyMAogICAgICAgICAgICBtc3RvcmUoYWRkKGNsb25lLCAweDE0KSwgdGFyZ2V0Qnl0ZXMpCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gc3RvcmUgMzIgYnl0ZXMgdG8gbWVtb3J5IHN0YXJ0aW5nIGF0ICJjbG9uZSIgKyA0MCBieXRlcwogICAgICAgICAgICAvLyAweDI4ID0gNDAKICAgICAgICAgICAgbXN0b3JlKAogICAgICAgICAgICAgICAgYWRkKGNsb25lLCAweDI4KSwKICAgICAgICAgICAgICAgIDB4NWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8ICAgICAgICAgICAxNSBieXRlcyAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmU1YWY0M2Q4MjgwM2U5MDNkOTE2MDJiNTdmZDViZjMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gY3JlYXRlIG5ldyBjb250cmFjdAogICAgICAgICAgICAvLyBzZW5kIDAgRXRoZXIKICAgICAgICAgICAgLy8gY29kZSBzdGFydHMgYXQgcG9pbnRlciBzdG9yZWQgaW4gImNsb25lIgogICAgICAgICAgICAvLyBjb2RlIHNpemUgMHgzNyAoNTUgYnl0ZXMpCiAgICAgICAgICAgIHJlc3VsdCA6PSBjcmVhdGUoMCwgY2xvbmUsIDB4MzcpCiAgICAgICAgfQogICAgfQp9Cg=="}],Yu=`

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

            +`,WA=({prev:s,next:a})=>r.jsx(A,{version:mA,title:bA,description:wA,html:ZA,prev:s,next:a,codes:kA}),BA="0.8.24",GA="Minimal Proxy Contract",VA="Deploy contracts cheaply with minimal proxy contract",fA=[{fileName:"MinimalProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIG9yaWdpbmFsIGNvZGUKLy8gaHR0cHM6Ly9naXRodWIuY29tL29wdGlvbmFsaXR5L2Nsb25lLWZhY3RvcnkvYmxvYi9tYXN0ZXIvY29udHJhY3RzL0Nsb25lRmFjdG9yeS5zb2wKCmNvbnRyYWN0IE1pbmltYWxQcm94eSB7CiAgICBmdW5jdGlvbiBjbG9uZShhZGRyZXNzIHRhcmdldCkgZXh0ZXJuYWwgcmV0dXJucyAoYWRkcmVzcyByZXN1bHQpIHsKICAgICAgICAvLyBjb252ZXJ0IGFkZHJlc3MgdG8gMjAgYnl0ZXMKICAgICAgICBieXRlczIwIHRhcmdldEJ5dGVzID0gYnl0ZXMyMCh0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ICAgICAgICAgICBjbG9uZSwKICAgICAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3MzAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICAgIHwKICAgICAgICAgICAgMHgzZDYwMmQ4MDYwMGEzZDM5ODFmMzM2M2QzZDM3M2QzZDNkMzYzZDczMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlcgogICAgICAgICAgICAqLwogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIiArIDIwIGJ5dGVzCiAgICAgICAgICAgIC8vIDB4MTQgPSAyMAogICAgICAgICAgICBtc3RvcmUoYWRkKGNsb25lLCAweDE0KSwgdGFyZ2V0Qnl0ZXMpCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gc3RvcmUgMzIgYnl0ZXMgdG8gbWVtb3J5IHN0YXJ0aW5nIGF0ICJjbG9uZSIgKyA0MCBieXRlcwogICAgICAgICAgICAvLyAweDI4ID0gNDAKICAgICAgICAgICAgbXN0b3JlKAogICAgICAgICAgICAgICAgYWRkKGNsb25lLCAweDI4KSwKICAgICAgICAgICAgICAgIDB4NWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8ICAgICAgICAgICAxNSBieXRlcyAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmU1YWY0M2Q4MjgwM2U5MDNkOTE2MDJiNTdmZDViZjMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gY3JlYXRlIG5ldyBjb250cmFjdAogICAgICAgICAgICAvLyBzZW5kIDAgRXRoZXIKICAgICAgICAgICAgLy8gY29kZSBzdGFydHMgYXQgcG9pbnRlciBzdG9yZWQgaW4gImNsb25lIgogICAgICAgICAgICAvLyBjb2RlIHNpemUgMHgzNyAoNTUgYnl0ZXMpCiAgICAgICAgICAgIHJlc3VsdCA6PSBjcmVhdGUoMCwgY2xvbmUsIDB4MzcpCiAgICAgICAgfQogICAgfQp9Cg=="}],YA=`

            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.24;
             
            @@ -2121,7 +2121,7 @@ How to swap tokens
                     }
                 }
             }
            -
            `,Ru=({prev:s,next:a})=>r.jsx(u,{version:Bu,title:Gu,description:Vu,html:Yu,prev:s,next:a,codes:fu}),Xu="0.8.24",vu="Multi Call",Nu="An example of contract to aggregate multiple calls.",Hu=[{fileName:"MultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE11bHRpQ2FsbCB7CiAgICBmdW5jdGlvbiBtdWx0aUNhbGwoYWRkcmVzc1tdIGNhbGxkYXRhIHRhcmdldHMsIGJ5dGVzW10gY2FsbGRhdGEgZGF0YSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChieXRlc1tdIG1lbW9yeSkKICAgIHsKICAgICAgICByZXF1aXJlKHRhcmdldHMubGVuZ3RoID09IGRhdGEubGVuZ3RoLCAidGFyZ2V0IGxlbmd0aCAhPSBkYXRhIGxlbmd0aCIpOwoKICAgICAgICBieXRlc1tdIG1lbW9yeSByZXN1bHRzID0gbmV3IGJ5dGVzW10oZGF0YS5sZW5ndGgpOwoKICAgICAgICBmb3IgKHVpbnQyNTYgaTsgaSA8IHRhcmdldHMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IHJlc3VsdCkgPSB0YXJnZXRzW2ldLnN0YXRpY2NhbGwoZGF0YVtpXSk7CiAgICAgICAgICAgIHJlcXVpcmUoc3VjY2VzcywgImNhbGwgZmFpbGVkIik7CiAgICAgICAgICAgIHJlc3VsdHNbaV0gPSByZXN1bHQ7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gcmVzdWx0czsKICAgIH0KfQo="},{fileName:"TestMultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFRlc3RNdWx0aUNhbGwgewogICAgZnVuY3Rpb24gdGVzdCh1aW50MjU2IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4gX2k7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0RGF0YSh1aW50MjU2IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKHRoaXMudGVzdC5zZWxlY3RvciwgX2kpOwogICAgfQp9Cg=="}],Fu=`

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

            +`,RA=({prev:s,next:a})=>r.jsx(A,{version:BA,title:GA,description:VA,html:YA,prev:s,next:a,codes:fA}),XA="0.8.24",vA="Multi Call",NA="An example of contract to aggregate multiple calls.",HA=[{fileName:"MultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE11bHRpQ2FsbCB7CiAgICBmdW5jdGlvbiBtdWx0aUNhbGwoYWRkcmVzc1tdIGNhbGxkYXRhIHRhcmdldHMsIGJ5dGVzW10gY2FsbGRhdGEgZGF0YSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChieXRlc1tdIG1lbW9yeSkKICAgIHsKICAgICAgICByZXF1aXJlKHRhcmdldHMubGVuZ3RoID09IGRhdGEubGVuZ3RoLCAidGFyZ2V0IGxlbmd0aCAhPSBkYXRhIGxlbmd0aCIpOwoKICAgICAgICBieXRlc1tdIG1lbW9yeSByZXN1bHRzID0gbmV3IGJ5dGVzW10oZGF0YS5sZW5ndGgpOwoKICAgICAgICBmb3IgKHVpbnQyNTYgaTsgaSA8IHRhcmdldHMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IHJlc3VsdCkgPSB0YXJnZXRzW2ldLnN0YXRpY2NhbGwoZGF0YVtpXSk7CiAgICAgICAgICAgIHJlcXVpcmUoc3VjY2VzcywgImNhbGwgZmFpbGVkIik7CiAgICAgICAgICAgIHJlc3VsdHNbaV0gPSByZXN1bHQ7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gcmVzdWx0czsKICAgIH0KfQo="},{fileName:"TestMultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFRlc3RNdWx0aUNhbGwgewogICAgZnVuY3Rpb24gdGVzdCh1aW50MjU2IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4gX2k7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0RGF0YSh1aW50MjU2IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKHRoaXMudGVzdC5zZWxlY3RvciwgX2kpOwogICAgfQp9Cg=="}],FA=`

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

            // SPDX-License-Identifier: MIT
             pragma solidity ^0.8.24;
             
            @@ -2157,7 +2157,7 @@ How to swap tokens
                     return abi.encodeWithSelector(this.test.selector, _i);
                 }
             }
            -
            `,Ku=({prev:s,next:a})=>r.jsx(u,{version:Xu,title:vu,description:Nu,html:Fu,prev:s,next:a,codes:Hu}),Mu="0.8.24",Su="Multi Delegatecall",xu="An example of contract to call multiple functions in a single transaction",Ju=[{fileName:"MultiDelegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN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5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKFRlc3RNdWx0aURlbGVnYXRlY2FsbC5mdW5jMi5zZWxlY3Rvcik7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0TWludERhdGEoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKFRlc3RNdWx0aURlbGVnYXRlY2FsbC5taW50LnNlbGVjdG9yKTsKICAgIH0KfQo="}],zu=`

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

            +`,KA=({prev:s,next:a})=>r.jsx(A,{version:XA,title:vA,description:NA,html:FA,prev:s,next:a,codes:HA}),MA="0.8.24",SA="Multi Delegatecall",xA="An example of contract to call multiple functions in a single transaction",JA=[{fileName:"MultiDelegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE11bHRpRGVsZWdhdGVjYWxsIHsKICAgIGVycm9yIERlbGVnYXRlY2FsbEZhaWxlZCgpOwoKICAgIGZ1bmN0aW9uIG11bHRpRGVsZWdhdGVjYWxsKGJ5dGVzW10gbWVtb3J5IGRhdGEpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAoYnl0ZXNbXSBtZW1vcnkgcmVzdWx0cykKICAgIHsKICAgICAgICByZXN1bHRzID0gbmV3IGJ5dGVzW10oZGF0YS5sZW5ndGgpOwoKICAgICAgICBmb3IgKHVpbnQyNTYgaTsgaSA8IGRhdGEubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgKGJvb2wgb2ssIGJ5dGVzIG1lbW9yeSByZXMpID0gYWRkcmVzcyh0aGlzKS5kZWxlZ2F0ZWNhbGwoZGF0YVtpXSk7CiAgICAgICAgIC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GVjYWxsCiAgICAvLyB1c2VyIGNhbiBtaW50IG11bHRpcGxlIHRpbWVzIGZvciB0aGUgcHJpY2Ugb2YgbXNnLnZhbHVlCiAgICBmdW5jdGlvbiBtaW50KCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgYmFsYW5jZU9mW21zZy5zZW5kZXJdICs9IG1zZy52YWx1ZTsKICAgIH0KfQoKY29udHJhY3QgSGVscGVyIHsKICAgIGZ1bmN0aW9uIGdldEZ1bmMxRGF0YSh1aW50MjU2IHgsIHVpbnQyNTYgeSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlcyBtZW1vcnkpCiAgICB7CiAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIGFiaS5lbmNvZGVXaXRoU2VsZWN0b3IoVGVzdE11bHRpRGVsZWdhdGVjYWxsLmZ1bmMxLnNlbGVjdG9yLCB4LCB5KTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRGdW5jMkRhdGEoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKFRlc3RNdWx0aURlbGVnYXRlY2FsbC5mdW5jMi5zZWxlY3Rvcik7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0TWludERhdGEoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKFRlc3RNdWx0aURlbGVnYXRlY2FsbC5taW50LnNlbGVjdG9yKTsKICAgIH0KfQo="}],zA=`

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

            // SPDX-License-Identifier: MIT
             pragma solidity ^0.8.24;
             
            @@ -2225,7 +2225,7 @@ How to swap tokens
                     return abi.encodeWithSelector(TestMultiDelegatecall.mint.selector);
                 }
             }
            -
            `,Du=({prev:s,next:a})=>r.jsx(u,{version:Mu,title:Su,description:xu,html:zu,prev:s,next:a,codes:Ju}),Eu="0.8.24",Qu="Multi-Sig Wallet",Tu="An example of multi-sig wallet in Solidity",Uu=[{fileName:"MultiSigWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE11bHRpU2lnV2FsbGV0IHsKICAgIGV2ZW50IERlcG9zaXQoYWRkcmVzcyBpbmRleGVkIHNlbmRlciwgdWludDI1NiBhbW91bnQsIHVpbnQyNTYgYmFsYW5jZSk7CiAgICBldmVudCBTdWJtaXRUcmFuc2FjdGlvbigKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3duZXIsCiAgICAgICAgdWludDI1NiBpbmRleGVkIHR4SW5kZXgsCiAgICAgICAgYWRkcmVzcyBpbmRleGVkIHRvLAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgYnl0ZXMgZGF0YQogICAgKTsKICAgIGV2ZW50IENvbmZpcm1UcmFuc2FjdGlvbihhZGRyZXNzIGluZGV4ZWQgb3duZXIsIHVpbnQyNTYgaW5kZXhlZCB0eEluZGV4KTsKICAgIGV2ZW50IFJldm9rZUNvbmZpcm1hdGlvbihhZGRyZXNzIGluZGV4ZWQgb3duZXIsIHVpbnQyNTYgaW5kZXhlZCB0eEluZGV4KTsKICAgIGV2ZW50IEV4ZWN1dGVUcmFuc2FjdGlvbihhZGRyZXNzIGluZGV4ZWQgb3duZXIsIHVpbnQyNTYgaW5kZXhlZCB0eEluZGV4KTsKCiAgICBhZGRyZXNzW10gcHVibGljIG93bmVyczsKICAgIG1hcHBpbmcoYWRkcmVzcyA9PiBib29sKSBwdWJsaWMgaXNPd25lcjsKICAgIHVpbnQyNTYgcHVibGljIG51bUNvbmZpcm1hdGlvbnNSZXF1aXJlZDsKCiAgICBzdHJ1Y3QgVHJhbnNhY3Rpb24gewogICAgICAgIGFkZHJlc3MgdG87CiAgICAgICAgdWludDI1NiB2YWx1ZTsKICAgICAgICBieXRlcyBkYXRhOwogICAgICAgIGJvb2wgZXhlY3V0ZWQ7CiAgICAgICAgdWludDI1NiBudW1Db25maXJtYXRpb25zOwogICAgfQoKICAgIC8vIG1hcHBpbmcgZnJvbSB0eCBpbmRleCA9PiBvd25lciA9PiBib29sCiAgICBtYXBwaW5nKHVpbnQyNTYgPT4gbWFwcGluZyhhZGRyZXNzID0+IGJvb2wpKSBwdWJsaWMgaXNDb25maXJtZWQ7CgogICAgVHJhbnNhY3Rpb25bXSBwdWJsaWMgdHJhbnNhY3Rpb25zOwoKICAgIG1vZGlmaWVyIG9ubHlPd25lcigpIHsKICAgICAgICByZXF1aXJlKGlzT3duZXJbbXNnLnNlbmRlcl0sICJub3Qgb3duZXIiKTsKICAgICAgICBfOwogICAgfQoKICAgIG1vZGlmaWVyIHR4RXhpc3RzKHVpbnQyNTYgX3R4SW5kZXgpIHsKICAgICAgICByZXF1aXJlKF90eEluZGV4IDwgdHJhbnNhY3Rpb25zLmxlbmd0aCwgInR4IGRvZXMgbm90IGV4aXN0Iik7CiAgICAgICAgXzsKICAgIH0KCiAgICBtb2RpZmllciBub3RFeGVjdXRlZCh1aW50MjU2IF90eEluZGV4KSB7CiAgICAgICAgcmVxdWlyZSghdHJhbnNhY3Rpb25zW190eEluZGV4XS5leGVjdXRlZCwgInR4IGFscmVhZHkgZXhlY3V0ZWQiKTsKICAgICAgICBfOwogICAgfQoKICAgIG1vZGlmaWVyIG5vdENvbmZpcm1lZCh1aW50MjU2IF90eEluZGV4KSB7CiAgICAgICAgcmVxdWlyZSghaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdLCAidHggYWxyZWFkeSBjb25maXJtZWQiKTsKICAgICAgICBfOwogICAgfQoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3NbXSBtZW1vcnkgX293bmVycywgdWludDI1NiBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkKSB7CiAgICAgICAgcmVxdWlyZShfb3duZXJzLmxlbmd0aCA+IDAsICJvd25lcnMgcmVxdWlyZWQiKTsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkID4gMAogICAgICAgICAgICAgICAgJiYgX251bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA8PSBfb3duZXJzLmxlbmd0aCwKICAgICAgICAgICAgImludmFsaWQgbnVtYmVyIG9mIHJlcXVpcmVkIGNvbmZpcm1hdGlvbnMiCiAgICAgICAgKTsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgX293bmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBhZGRyZXNzIG93bmVyID0gX293bmVyc1tpXTsKCiAgICAgICAgICAgIHJlcXVpcmUob3duZXIgIT0gYWRkcmVzcygwKSwgImludmFsaWQgb3duZXIiKTsKICAgICAgICAgICAgcmVxdWlyZSghaXNPd25lcltvd25lcl0sICJvd25lciBub3QgdW5pcXVlIik7CgogICAgICAgICAgICBpc093bmVyW293bmVyXSA9IHRydWU7CiAgICAgICAgICAgIG93bmVycy5wdXNoKG93bmVyKTsKICAgICAgICB9CgogICAgICAgIG51bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA9IF9udW1Db25maXJtYXRpb25zUmVxdWlyZWQ7CiAgICB9CgogICAgcmVjZWl2ZSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIGVtaXQgRGVwb3NpdChtc2cuc2VuZGVyLCBtc2cudmFsdWUsIGFkZHJlc3ModGhpcykuYmFsYW5jZSk7CiAgICB9CgogICAgZnVuY3Rpb24gc3VibWl0VHJhbnNhY3Rpb24oYWRkcmVzcyBfdG8sIHVpbnQyNTYgX3ZhbHVlLCBieXRlcyBtZW1vcnkgX2RhdGEpCiAgICAgICAgcHVibGljCiAgICAgICAgb25seU93bmVyCiAgICB7CiAgICAgICAgdWludDI1NiB0eEluZGV4ID0gdHJhbnNhY3Rpb25zLmxlbmd0aDsKCiAgICAgICAgdHJhbnNhY3Rpb25zLnB1c2goCiAgICAgICAgICAgIFRyYW5zYWN0aW9uKHsKICAgICAgICAgICAgICAgIHRvOiBfdG8sCiAgICAgICAgICAgICAgICB2YWx1ZTogX3ZhbHVlLAogICAgICAgICAgICAgICAgZGF0YTogX2RhdGEsCiAgICAgICAgICAgICAgICBleGVjdXRlZDogZmFsc2UsCiAgICAgICAgICAgICAgICBudW1Db25maXJtYXRpb25zOiAwCiAgICAgICAgICAgIH0pCiAgICAgICAgKTsKCiAgICAgICAgZW1pdCBTdWJtaXRUcmFuc2FjdGlvbihtc2cuc2VuZGVyLCB0eEluZGV4LCBfdG8sIF92YWx1ZSwgX2RhdGEpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbmZpcm1UcmFuc2FjdGlvbih1aW50MjU2IF90eEluZGV4KQogICAgICAgIHB1YmxpYwogICAgICAgIG9ubHlPd25lcgogICAgICAgIHR4RXhpc3RzKF90eEluZGV4KQogICAgICAgIG5vdEV4ZWN1dGVkKF90eEluZGV4KQogICAgICAgIG5vdENvbmZpcm1lZChfdHhJbmRleCkKICAgIHsKICAgICAgICBUcmFuc2FjdGlvbiBzdG9yYWdlIHRyYW5zYWN0aW9uID0gdHJhbnNhY3Rpb25zW190eEluZGV4XTsKICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zICs9IDE7CiAgICAgICAgaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdID0gdHJ1ZTsKCiAgICAgICAgZW1pdCBDb25maXJtVHJhbnNhY3Rpb24obXNnLnNlbmRlciwgX3R4SW5kZXgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4ZWN1dGVUcmFuc2FjdGlvbih1aW50MjU2IF90eEluZGV4KQogICAgICAgIHB1YmxpYwogICAgICAgIG9ubHlPd25lcgogICAgICAgIHR4RXhpc3RzKF90eEluZGV4KQogICAgICAgIG5vdEV4ZW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CgogICAgICAgIGVtaXQgUmV2b2tlQ29uZmlybWF0aW9uKG1zZy5zZW5kZXIsIF90eEluZGV4KTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRPd25lcnMoKSBwdWJsaWMgdmlldyByZXR1cm5zIChhZGRyZXNzW10gbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIG93bmVyczsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRUcmFuc2FjdGlvbkNvdW50KCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB0cmFuc2FjdGlvbnMubGVuZ3RoOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldFRyYW5zYWN0aW9uKHVpbnQyNTYgX3R4SW5kZXgpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKAogICAgICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgICAgICB1aW50MjU2IHZhbHVlLAogICAgICAgICAgICBieXRlcyBtZW1vcnkgZGF0YSwKICAgICAgICAgICAgYm9vbCBleGVjdXRlZCwKICAgICAgICAgICAgdWludDI1NiBudW1Db25maXJtYXRpb25zCiAgICAgICAgKQogICAgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXR1cm4gKAogICAgICAgICAgICB0cmFuc2FjdGlvbi50bywKICAgICAgICAgICAgdHJhbnNhY3Rpb24udmFsdWUsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmRhdGEsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmV4ZWN1dGVkLAogICAgICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zCiAgICAgICAgKTsKICAgIH0KfQo="},{fileName:"TestContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFRlc3RDb250cmFjdCB7CiAgICB1aW50MjU2IHB1YmxpYyBpOwoKICAgIGZ1bmN0aW9uIGNhbGxNZSh1aW50MjU2IGopIHB1YmxpYyB7CiAgICAgICAgaSArPSBqOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldERhdGEoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoImNhbGxNZSh1aW50MjU2KSIsIDEyMyk7CiAgICB9Cn0K"}],_u=`

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

            +`,DA=({prev:s,next:a})=>r.jsx(A,{version:MA,title:SA,description:xA,html:zA,prev:s,next:a,codes:JA}),EA="0.8.24",QA="Multi-Sig Wallet",TA="An example of multi-sig wallet in Solidity",UA=[{fileName:"MultiSigWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE11bHRpU2lnV2FsbGV0IHsKICAgIGV2ZW50IERlcG9zaXQoYWRkcmVzcyBpbmRleGVkIHNlbmRlciwgdWludDI1NiBhbW91bnQsIHVpbnQyNTYgYmFsYW5jZSk7CiAgICBldmVudCBTdWJtaXRUcmFuc2FjdGlvbigKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3duZXIsCiAgICAgICAgdWludDI1NiBpbmRleGVkIHR4SW5kZXgsCiAgICAgICAgYWRkcmVzcyBpbmRleGVkIHRvLAogICAgICAgIHVpbnQyNTYgdmFsdWUsCiAgICAgICAgYnl0ZXMgZGF0YQogICAgKTsKICAgIGV2ZW50IENvbmZpcm1UcmFuc2FjdGlvbihhZGRyZXNzIGluZGV4ZWQgb3duZXIsIHVpbnQyNTYgaW5kZXhlZCB0eEluZGV4KTsKICAgIGV2ZW50IFJldm9rZUNvbmZpcm1hdGlvbihhZGRyZXNzIGluZG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hbnNhY3Rpb25zW190eEluZGV4XS5leGVjdXRlZCwgInR4IGFscmVhZHkgZXhlY3V0ZWQiKTsKICAgICAgICBfOwogICAgfQoKICAgIG1vZGlmaWVyIG5vdENvbmZpcm1lZCh1aW50MjU2IF90eEluZGV4KSB7CiAgICAgICAgcmVxdWlyZSghaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdLCAidHggYWxyZWFkeSBjb25maXJtZWQiKTsKICAgICAgICBfOwogICAgfQoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3NbXSBtZW1vcnkgX293bmVycywgdWludDI1NiBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkKSB7CiAgICAgICAgcmVxdWlyZShfb3duZXJzLmxlbmd0aCA+IDAsICJvd25lcnMgcmVxdWlyZWQiKTsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkID4gMAogICAgICAgICAgICAgICAgJiYgX251bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA8PSBfb3duZXJzLmxlbmd0aCwKICAgICAgICAgICAgImludmFsaWQgbnVtYmVyIG9mIHJlcXVpcmVkIGNvbmZpcm1hdGlvbnMiCiAgICAgICAgKTsKCiAgICAgICAgZm9yICh1aW50MjU2IGkgPSAwOyBpIDwgX293bmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBhZGRyZXNzIG93bmVyID0gX293bmVyc1tpXTsKCiAgICAgICAgICAgIHJlcXVpcmUob3duZXIgIT0gYWRkcmVzcygwKSwgImludmFsaWQgb3duZXIiKTsKICAgICAgICAgICAgcmVxdWlyZSghaXNPd25lcltvd25lcl0sICJvd25lciBub3QgdW5pcXVlIik7CgogICAgICAgICAgICBpc093bmVyW293bmVyXSA9IHRydWU7CiAgICAgICAgICAgIG93bmVycy5wdXNoKG93bmVyKTsKICAgICAgICB9CgogICAgICAgIG51bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA9IF9udW1Db25maXJtYXRpb25zUmVxdWlyZWQ7CiAgICB9CgogICAgcmVjZWl2ZSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIGVtaXQgRGVwb3NpdChtc2cuc2VuZGVyLCBtc2cudmFsdWUsIGFkZHJlc3ModGhpcykuYmFsYW5jZSk7CiAgICB9CgogICAgZnVuY3Rpb24gc3VibWl0VHJhbnNhY3Rpb24oYWRkcmVzcyBfdG8sIHVpbnQyNTYgX3ZhbHVlLCBieXRlcyBtZW1vcnkgX2RhdGEpCiAgICAgICAgcHVibGljCiAgICAgICAgb25seU93bmVyCiAgICB7CiAgICAgICAgdWludDI1NiB0eEluZGV4ID0gdHJhbnNhY3Rpb25zLmxlbmd0aDsKCiAgICAgICAgdHJhbnNhY3Rpb25zLnB1c2goCiAgICAgICAgICAgIFRyYW5zYWN0aW9uKHsKICAgICAgICAgICAgICAgIHRvOiBfdG8sCiAgICAgICAgICAgICAgICB2YWx1ZTogX3ZhbHVlLAogICAgICAgICAgICAgICAgZGF0YTogX2RhdGEsCiAgICAgICAgICAgICAgICBleGVjdXRlZDogZmFsc2UsCiAgICAgICAgICAgICAgICBudW1Db25maXJtYXRpb25zOiAwCiAgICAgICAgICAgIH0pCiAgICAgICAgKTsKCiAgICAgICAgZW1pdCBTdWJtaXRUcmFuc2FjdGlvbihtc2cuc2VuZGVyLCB0eEluZGV4LCBfdG8sIF92YWx1ZSwgX2RhdGEpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbmZpcm1UcmFuc2FjdGlvbih1aW50MjU2IF90eEluZGV4KQogICAgICAgIHB1YmxpYwogICAgICAgIG9ubHlPd25lcgogICAgICAgIHR4RXhpc3RzKF90eEluZGV4KQogICAgICAgIG5vdEV4ZWN1dGVkKF90eEluZGV4KQogICAgICAgIG5vdENvbmZpcm1lZChfdHhJbmRleCkKICAgIHsKICAgICAgICBUcmFuc2FjdGlvbiBzdG9yYWdlIHRyYW5zYWN0aW9uID0gdHJhbnNhY3Rpb25zW190eEluZGV4XTsKICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zICs9IDE7CiAgICAgICAgaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdID0gdHJ1ZTsKCiAgICAgICAgZW1pdCBDb25maXJtVHJhbnNhY3Rpb24obXNnLnNlbmRlciwgX3R4SW5kZXgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4ZWN1dGVUcmFuc2FjdGlvbih1aW50MjU2IF90eEluZGV4KQogICAgICAgIHB1YmxpYwogICAgICAgIG9ubHlPd25lcgogICAgICAgIHR4RXhpc3RzKF90eEluZGV4KQogICAgICAgIG5vdEV4ZWN1dGVkKF90eEluZGV4KQogICAgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zID49IG51bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCwKICAgICAgICAgICAgImNhbm5vdCBleGVjdXRlIHR4IgogICAgICAgICk7CgogICAgICAgIHRyYW5zYWN0aW9uLmV4ZWN1dGVkID0gdHJ1ZTsKCiAgICAgICAgKGJvb2wgc3VjY2VzcywpID0KICAgICAgICAgICAgdHJhbnNhY3Rpb24udG8uY2FsbHt2YWx1ZTogdHJhbnNhY3Rpb24udmFsdWV9KHRyYW5zYWN0aW9uLmRhdGEpOwogICAgICAgIHJlcXVpcmUoc3VjY2VzcywgInR4IGZhaWxlZCIpOwoKICAgICAgICBlbWl0IEV4ZWN1dGVUcmFuc2FjdGlvbihtc2cuc2VuZGVyLCBfdHhJbmRleCk7CiAgICB9CgogICAgZnVuY3Rpb24gcmV2b2tlQ29uZmlybWF0aW9uKHVpbnQyNTYgX3R4SW5kZXgpCiAgICAgICAgcHVibGljCiAgICAgICAgb25seU93bmVyCiAgICAgICAgdHhFeGlzdHMoX3R4SW5kZXgpCiAgICAgICAgbm90RXhlY3V0ZWQoX3R4SW5kZXgpCiAgICB7CiAgICAgICAgVHJhbnNhY3Rpb24gc3RvcmFnZSB0cmFuc2FjdGlvbiA9IHRyYW5zYWN0aW9uc1tfdHhJbmRleF07CgogICAgICAgIHJlcXVpcmUoaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdLCAidHggbm90IGNvbmZpcm1lZCIpOwoKICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zIC09IDE7CiAgICAgICAgaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdID0gZmFsc2U7CgogICAgICAgIGVtaXQgUmV2b2tlQ29uZmlybWF0aW9uKG1zZy5zZW5kZXIsIF90eEluZGV4KTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRPd25lcnMoKSBwdWJsaWMgdmlldyByZXR1cm5zIChhZGRyZXNzW10gbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIG93bmVyczsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRUcmFuc2FjdGlvbkNvdW50KCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB0cmFuc2FjdGlvbnMubGVuZ3RoOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldFRyYW5zYWN0aW9uKHVpbnQyNTYgX3R4SW5kZXgpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKAogICAgICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgICAgICB1aW50MjU2IHZhbHVlLAogICAgICAgICAgICBieXRlcyBtZW1vcnkgZGF0YSwKICAgICAgICAgICAgYm9vbCBleGVjdXRlZCwKICAgICAgICAgICAgdWludDI1NiBudW1Db25maXJtYXRpb25zCiAgICAgICAgKQogICAgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXR1cm4gKAogICAgICAgICAgICB0cmFuc2FjdGlvbi50bywKICAgICAgICAgICAgdHJhbnNhY3Rpb24udmFsdWUsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmRhdGEsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmV4ZWN1dGVkLAogICAgICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zCiAgICAgICAgKTsKICAgIH0KfQo="},{fileName:"TestContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFRlc3RDb250cmFjdCB7CiAgICB1aW50MjU2IHB1YmxpYyBpOwoKICAgIGZ1bmN0aW9uIGNhbGxNZSh1aW50MjU2IGopIHB1YmxpYyB7CiAgICAgICAgaSArPSBqOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldERhdGEoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoImNhbGxNZSh1aW50MjU2KSIsIDEyMyk7CiAgICB9Cn0K"}],_A=`

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

            The wallet owners can

            • submit a transaction
            • @@ -2426,16 +2426,16 @@ How to swap tokens return abi.encodeWithSignature("callMe(uint256)", 123); } } -`,Lu=({prev:s,next:a})=>r.jsx(u,{version:Eu,title:Qu,description:Tu,html:_u,prev:s,next:a,codes:Uu}),Ou="0.8.24",Pu="Simple Bytecode Contract",$u="Simple example of contract written in bytecode",qu=[{fileName:"Factory.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgZXZlbnQgTG9nKGFkZHJlc3MgYWRkcik7CgogICAgLy8g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wMmE2MDAwNTI2MDIwNjAwMGYzNjAwMDUyNjAwYTYwMTZmMwoKLy8gU3RvcmUgcnVuIHRpbWUgY29kZSB0byBtZW1vcnkKUFVTSDEwIDBYNjAyYTYwMDA1MjYwMjA2MDAwZjMKUFVTSDEgMApNU1RPUkUKCi8vIFJldHVybiAxMCBieXRlcyBmcm9tIG1lbW9yeSBzdGFydGluZyBhdCBvZmZzZXQgMjIKUFVTSDEgMHgwYQpQVVNIMSAweDE2ClJFVFVSTgoqLwo="}],sA=`

              Simple example of contract written in bytecode

              +`,LA=({prev:s,next:a})=>r.jsx(A,{version:EA,title:QA,description:TA,html:_A,prev:s,next:a,codes:UA}),OA="0.8.24",PA="Simple Bytecode Contract",$A="Simple example of contract written in bytecode",qA=[{fileName:"Factory.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgZXZlbnQgTG9nKGFkZHJlc3MgYWRkcik7CgogICAgLy8gRGVwbG95cyBhIGNvbnRyYWN0IHRoYXQgYWx3YXlzIHJldHVybnMgMjU1CiAgICBmdW5jdGlvbiBkZXBsb3koKSBleHRlcm5hbCB7CiAgICAgICAgYnl0ZXMgbWVtb3J5IGJ5dGVjb2RlID0gaGV4IjY5NjBmZjYwMDA1MjYwMjA2MDAwZjM2MDAwNTI2MDBhNjAxNmYzIjsKICAgICAgICBhZGRyZXNzIGFkZHI7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBjcmVhdGUodmFsdWUsIG9mZnNldCwgc2l6ZSkKICAgICAgICAgICAgYWRkciA6PSBjcmVhdGUoMCwgYWRkKGJ5dGVjb2RlLCAweDIwKSwgMHgxMykKICAgICAgICB9CiAgICAgICAgcmVxdWlyZShhZGRyICE9IGFkZHJlc3MoMCkpOwoKICAgICAgICBlbWl0IExvZyhhZGRyKTsKICAgIH0KfQoKaW50ZXJmYWNlIElDb250cmFjdCB7CiAgICBmdW5jdGlvbiBnZXRWYWx1ZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7Cn0KCi8vIGh0dHBzOi8vd3d3LmV2bS5jb2Rlcy9wbGF5Z3JvdW5kCi8qClJ1biB0aW1lIGNvZGUgLSByZXR1cm4gMjU1CjYwZmY2MDAwNTI2MDIwNjAwMGYzCgovLyBTdG9yZSAyNTUgdG8gbWVtb3J5Cm1zdG9yZShwLCB2KSAtIHN0b3JlIHYgYXQgbWVtb3J5IHAgdG8gcCArIDMyCgpQVVNIMSAweGZmClBVU0gxIDAKTVNUT1JFCgovLyBSZXR1cm4gMzIgYnl0ZXMgZnJvbSBtZW1vcnkKcmV0dXJuKHAsIHMpIC0gZW5kIGV4ZWN1dGlvbiBhbmQgcmV0dXJuIGRhdGEgZnJvbSBtZW1vcnkgcCB0byBwICsgcwoKUFVTSDEgMHgyMApQVVNIMSAwClJFVFVSTgoKQ3JlYXRpb24gY29kZSAtIHJldHVybiBydW50aW1lIGNvZGUKNjk2MGZmNjAwMDUyNjAyMDYwMDBmMzYwMDA1MjYwMGE2MDE2ZjMKCi8vIFN0b3JlIHJ1biB0aW1lIGNvZGUgdG8gbWVtb3J5ClBVU0gxMCAwWDYwZmY2MDAwNTI2MDIwNjAwMGYzClBVU0gxIDAKTVNUT1JFCgovLyBSZXR1cm4gMTAgYnl0ZXMgZnJvbSBtZW1vcnkgc3RhcnRpbmcgYXQgb2Zmc2V0IDIyClBVU0gxIDB4MGEKUFVTSDEgMHgxNgpSRVRVUk4KKi8K"}],su=`

              Simple example of contract written in bytecode

              // SPDX-License-Identifier: MIT
               pragma solidity ^0.8.24;
               
               contract Factory {
                   event Log(address addr);
               
              -    // Deploys a contract that always returns 42
              +    // Deploys a contract that always returns 255
                   function deploy() external {
              -        bytes memory bytecode = hex"69602a60005260206000f3600052600a6016f3";
              +        bytes memory bytecode = hex"6960ff60005260206000f3600052600a6016f3";
                       address addr;
                       assembly {
                           // create(value, offset, size)
              @@ -2448,18 +2448,18 @@ How to swap tokens
               }
               
               interface IContract {
              -    function getMeaningOfLife() external view returns (uint256);
              +    function getValue() external view returns (uint256);
               }
               
               // https://www.evm.codes/playground
               /*
              -Run time code - return 42
              -602a60005260206000f3
              +Run time code - return 255
              +60ff60005260206000f3
               
              -// Store 42 to memory
              +// Store 255 to memory
               mstore(p, v) - store v at memory p to p + 32
               
              -PUSH1 0x2a
              +PUSH1 0xff
               PUSH1 0
               MSTORE
               
              @@ -2471,10 +2471,10 @@ PUSH1 0
               RETURN
               
               Creation code - return runtime code
              -69602a60005260206000f3600052600a6016f3
              +6960ff60005260206000f3600052600a6016f3
               
               // Store run time code to memory
              -PUSH10 0X602a60005260206000f3
              +PUSH10 0X60ff60005260206000f3
               PUSH1 0
               MSTORE
               
              @@ -2483,7 +2483,7 @@ PUSH1 0x0a
               PUSH1 0x16
               RETURN
               */
              -
              `,aA=({prev:s,next:a})=>r.jsx(u,{version:Ou,title:Pu,description:$u,html:sA,prev:s,next:a,codes:qu}),nA="0.8.24",lA="Time Lock",pA="Time Lock",eA=[{fileName:"TimeLock.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFRpbWVMb2NrIHsKICAgIGVycm9yIE5vdE93bmVyRXJyb3IoKTsKICAgIGVycm9yIEFscmVhZHlRdWV1ZWRFcnJvcihieXRlczMyIHR4SWQpOwogICAgZXJyb3IgVGltZXN0YW1wTm90SW5SYW5nZUVycm9yKHVpbnQyNTYgYmxvY2tUaW1lc3RhbXAsIHVpbnQyNTYgdGltZXN0YW1wKTsKICAgIGVycm9yIE5vdFF1ZXVlZEVycm9yKGJ5dGVzMzIgdHhJZCk7CiAgICBlcnJvciBUaW1lc3RhbXBOb3RQYXNzZWRFcnJvcih1aW50MjU2IGJsb2NrVGltZXN0bWFwLCB1aW50MjU2IHRpbWVzdGFtcC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xsZGF0YSBfZnVuYywKICAgICAgICBieXRlcyBjYWxsZGF0YSBfZGF0YSwKICAgICAgICB1aW50MjU2IF90aW1lc3RhbXAKICAgICkgZXh0ZXJuYWwgb25seU93bmVyIHJldHVybnMgKGJ5dGVzMzIgdHhJZCkgewogICAgICAgIHR4SWQgPSBnZXRUeElkKF90YXJnZXQsIF92YWx1ZSwgX2Z1bmMsIF9kYXRhLCBfdGltZXN0YW1wKTsKICAgICAgICBpZiAocXVldWVkW3R4SWRdKSB7CiAgICAgICAgICAgIHJldmVydCBBbHJlYWR5UXVldWVkRXJyb3IodHhJZCk7CiAgICAgICAgfQogICAgICAgIC8vIC0tLXwtLS0tLS0tLS0tLS18LS0tLS0tLS0tLS0tLS0tfC0tLS0tLS0KICAgICAgICAvLyAgYmxvY2sgICAgYmxvY2sgKyBtaW4gICAgIGJsb2NrICsgbWF4CiAgICAgICAgaWYgKAogICAgICAgICAgICBfdGltZXN0YW1wIDwgYmxvY2sudGltZXN0YW1wICsgTUlOX0RFTEFZCiAgICAgICAgICAgICAgICB8fCBfdGltZXN0YW1wID4gYmxvY2sudGltZXN0YW1wICsgTUFYX0RFTEFZCiAgICAgICAgKSB7CiAgICAgICAgICAgIHJldmVydCBUaW1lc3RhbXBOb3RJblJhbmdlRXJyb3IoYmxvY2sudGltZXN0YW1wLCBfdGltZXN0YW1wKTsKICAgICAgICB9CgogICAgICAgIHF1ZXVlZFt0eElkXSA9IHRydWU7CgogICAgICAgIGVtaXQgUXVldWUodHhJZCwgX3RhcmdldCwgX3ZhbHVlLCBfZnVuYywgX2RhdGEsIF90aW1lc3RhbXApOwogICAgfQoKICAgIGZ1bmN0aW9uIGV4ZWN1dGUoCiAgICAgICAgYWRkcmVzcyBfdGFyZ2V0LAogICAgICAgIHVpbnQyNTYgX3ZhbHVlLAogICAgICAgIHN0cmluZyBjYWxsZGF0YSBfZnVuYywKICAgICAgICBieXRlcyBjYWxsZGF0YSBfZGF0YSwKICAgICAgICB1aW50MjU2IF90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ZChieXRlczQoa2VjY2FrMjU2KGJ5dGVzKF9mdW5jKSkpLCBfZGF0YSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgLy8gY2FsbCBmYWxsYmFjayB3aXRoIGRhdGEKICAgICAgICAgICAgZGF0YSA9IF9kYXRhOwogICAgICAgIH0KCiAgICAgICAgLy8gY2FsbCB0YXJnZXQKICAgICAgICAoYm9vbCBvaywgYnl0ZXMgbWVtb3J5IHJlcykgPSBfdGFyZ2V0LmNhbGx7dmFsdWU6IF92YWx1ZX0oZGF0YSk7CiAgICAgICAgaWYgKCFvaykgewogICAgICAgICAgICByZXZlcnQgVHhGYWlsZWRFcnJvcigpOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBFeGVjdXRlKHR4SWQsIF90YXJnZXQsIF92YWx1ZSwgX2Z1bmMsIF9kYXRhLCBfdGltZXN0YW1wKTsKCiAgICAgICAgcmV0dXJuIHJlczsKICAgIH0KCiAgICBmdW5jdGlvbiBjYW5jZWwoYnl0ZXMzMiBfdHhJZCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICAgICAgICBpZiAoIXF1ZXVlZFtfdHhJZF0pIHsKICAgICAgICAgICAgcmV2ZXJ0IE5vdFF1ZXVlZEVycm9yKF90eElkKTsKICAgICAgICB9CgogICAgICAgIHF1ZXVlZFtfdHhJZF0gPSBmYWxzZTsKCiAgICAgICAgZW1pdCBDYW5jZWwoX3R4SWQpOwogICAgfQp9Cg=="}],cA=`

              TimeLock is a contract that publishes a transaction to be executed in the future. +`,au=({prev:s,next:a})=>r.jsx(A,{version:OA,title:PA,description:$A,html:su,prev:s,next:a,codes:qA}),nu="0.8.24",lu="Time Lock",pu="Time Lock",eu=[{fileName:"TimeLock.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFRpbWVMb2NrIHsKICAgIGVycm9yIE5vdE93bmVyRXJyb3IoK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5jZWwoX3R4SWQpOwogICAgfQp9Cg=="}],cu=`

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

              TimeLocks are commonly used in DAOs.

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

              emit Cancel(_txId); } } -
              `,tA=({prev:s,next:a})=>r.jsx(u,{version:nA,title:lA,description:pA,html:cA,prev:s,next:a,codes:eA}),oA="0.8.24",rA="Uni-Directional Payment Channel",iA="An example of uni-directional payment channels in Solidity",gA=[{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDgoKHVpbnQyNTYodnMpID4+IDI1NSkgKyAyNyk7CiAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzMzIgciwgYnl0ZXMzMiB2cykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIF90aHJvd0Vycm9yKGVycm9yKTsKICAgICAgICByZXR1cm4gcmVjb3Z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vcik7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIHVpbnQ4IHYsIGJ5dGVzMzIgciwgYnl0ZXMzMiBzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgKGFkZHJlc3MgcmVjb3ZlcmVkLCBSZWNvdmVyRXJyb3IgZXJyb3IpID0gdHJ5UmVjb3ZlcihoYXNoLCB2LCByLCBzKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKGJ5dGVzMzIgaGFzaCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChieXRlczMyKQogICAgewogICAgICAgIC8vIDMyIGlzIHRoZSBsZW5ndGggaW4gYnl0ZXMgb2YgaGFzaCwKICAgICAgICAvLyBlbmZvcmNlZCBieSB0aGUgdHlwZSBzaWduYXR1cmUgYWJvdmUKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KAogICAgICAgICAgICBhYmkuZW5jb2RlUGFja2VkKCJceDE5RXRoZXJldW0gU2lnbmVkIE1lc3NhZ2U6XG4zMiIsIGhhc2gpCiAgICAgICAgKTsKICAgIH0KfQo="},{fileName:"UniDirectionalPaymentChannel.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG9ydCAiLi9FQ0RTQS5zb2wiOwoKY29udHJhY3QgUmVlbnRyYW5jeUd1YXJkIHsKICAgIGJvb2wgcHJpdmF0ZSBsb2NrZWQ7CgogICAgbW9kaWZpZXIgZ3VhcmQoKSB7CiAgICAgICAgcmVxdWlyZSghbG9ja2VkKTsKICAgICAgICBsb2NrZWQgPSB0cnVl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CB7CiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IHJlY2VpdmVyLCAiIXJlY2VpdmVyIik7CiAgICAgICAgcmVxdWlyZShfdmVyaWZ5KF9hbW91bnQsIF9zaWcpLCAiaW52YWxpZCBzaWciKTsKCiAgICAgICAgKGJvb2wgc2VudCwpID0gcmVjZWl2ZXIuY2FsbHt2YWx1ZTogX2Ftb3VudH0oIiIpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICAgICAgc2VsZmRlc3RydWN0KHNlbmRlcik7CiAgICB9CgogICAgZnVuY3Rpb24gY2FuY2VsKCkgZXh0ZXJuYWwgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBzZW5kZXIsICIhc2VuZGVyIik7CiAgICAgICAgcmVxdWlyZShibG9jay50aW1lc3RhbXAgPj0gZXhwaXJlc0F0LCAiIWV4cGlyZWQiKTsKICAgICAgICBzZWxmZGVzdHJ1Y3Qoc2VuZGVyKTsKICAgIH0KfQo="}],hA=`

              Payment channels allow participants to repeatedly transfer Ether off chain.

              +`,tu=({prev:s,next:a})=>r.jsx(A,{version:nu,title:lu,description:pu,html:cu,prev:s,next:a,codes:eu}),ou="0.8.24",ru="Uni-Directional Payment Channel",iu="An example of uni-directional payment channels in Solidity",gu=[{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1a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dXJucyAoYm9vbCkKICAgIHsKICAgICAgICByZXR1cm4gX2dldEV0aFNpZ25lZEhhc2goX2Ftb3VudCkucmVjb3Zlcihfc2lnKSA9PSBzZW5kZXI7CiAgICB9CgogICAgZnVuY3Rpb24gdmVyaWZ5KHVpbnQyNTYgX2Ftb3VudCwgYnl0ZXMgbWVtb3J5IF9zaWcpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYm9vbCkKICAgIHsKICAgICAgICByZXR1cm4gX3ZlcmlmeShfYW1vdW50LCBfc2lnKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjbG9zZSh1aW50MjU2IF9hbW91bnQsIGJ5dGVzIG1lbW9yeSBfc2lnKSBleHRlcm5hbCBndWFyZCB7CiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IHJlY2VpdmVyLCAiIXJlY2VpdmVyIik7CiAgICAgICAgcmVxdWlyZShfdmVyaWZ5KF9hbW91bnQsIF9zaWcpLCAiaW52YWxpZCBzaWciKTsKCiAgICAgICAgKGJvb2wgc2VudCwpID0gcmVjZWl2ZXIuY2FsbHt2YWx1ZTogX2Ftb3VudH0oIiIpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICAgICAgc2VsZmRlc3RydWN0KHNlbmRlcik7CiAgICB9CgogICAgZnVuY3Rpb24gY2FuY2VsKCkgZXh0ZXJuYWwgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBzZW5kZXIsICIhc2VuZGVyIik7CiAgICAgICAgcmVxdWlyZShibG9jay50aW1lc3RhbXAgPj0gZXhwaXJlc0F0LCAiIWV4cGlyZWQiKTsKICAgICAgICBzZWxmZGVzdHJ1Y3Qoc2VuZGVyKTsKICAgIH0KfQo="}],hu=`

              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.
              • @@ -2883,7 +2883,7 @@ After a mimimum waiting period, the transaction can be executed.

                ); } } -`,IA=({prev:s,next:a})=>r.jsx(u,{version:oA,title:rA,description:iA,html:hA,prev:s,next:a,codes:gA}),dA="0.8.24",CA="Upgradeable Proxy",jA="Example of upgradeable proxy",uA=[{fileName:"UpgradeableProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIFRyYW5zcGFyZW50IHVwZ3JhZGVhYmxlIHByb3h5IHBhdHRlcm4KCmNvbnRyYWN0IENvdW50ZXJWMSB7CiAgICB1aW50MjU2IHB1YmxpYyBjb3VudDsKCiAgICBmdW5jdGlvbiBpbmMoKSBleHRlcm5hbCB7CiAgICAgICAgY291bnQgKz0gMTsKICAgIH0KfQoKY29udHJhY3QgQ291bnRlclYyIHsKICAgIHVpbnQyNTYgcHVibGljIGNvdW50OwoKICAgIGZ1bmN0aW9uIGluYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCArPSAxOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCAtPSAxOwogICAgfQp9Cgpjb250cmFjdCBCdWdneVByb3h5IHsKICAgIGFkZHJlc3MgcHVibGljIGltcGxlbWVudGF0aW9uOwogICAgYWRkcmVzcyBwdWJsaWMgYWRtaW47CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgYWRtaW4gPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIGZ1bmN0aW9uIF9kZWxlZ2F0ZSgpIHByaXZhdGUgewogICAgICAgIChib29sIG9rLCkgPSBpbXBsZW1lbnRhdGlvbi5kZWxlZ2F0ZWNhbGwobXNnLmRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJkZWxlZ2F0ZWNhbGwgZmFpbGVkIik7CiAgICB9CgogICAgZmFsbGJhY2soKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBfZGVsZWdhd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AwIG9uIGVycm9yIChlZy4gb3V0IG9mIGdhcykgYW5kIDEgb24gc3VjY2VzcwogICAgICAgICAgICBsZXQgcmVzdWx0IDo9CiAgICAgICAgICAgICAgICBkZWxlZ2F0ZWNhbGwoZ2FzKCksIF9pbXBsZW1lbnRhdGlvbiwgMCwgY2FsbGRhdGFzaXplKCksIDAsIDApCgogICAgICAgICAgICAvLyBDb3B5IHRoZSByZXR1cm5lZCBkYXRhLgogICAgICAgICAgICAvLyByZXR1cm5kYXRhY29weSh0LCBmLCBzKSAtIGNvcHkgcyBieXRlcyBmcm9tIHJldHVybmRhdGEgYXQgcG9zaXRpb24gZiB0byBtZW0gYXQgcG9zaXRpb24gdAogICAgICAgICAgICAvLyByZXR1cm5kYXRhc2l6ZSgpIC0gc2l6ZSBvZiB0aGUgbGFzdCByZXR1cm5kYXRhCiAgICAgICAgICAgIHJldHVybmRhdGFjb3B5KDAsIDAsIHJldHVybmRhdGFzaXplKCkpCgogICAgICAgICAgICBzd2l0Y2ggcmVzdWx0CiAgICAgICAgICAgIC8vIGRlbGVnYXRlY2FsbCByZXR1cm5zIDAgb24gZXJyb3IuCiAgICAgICAgICAgIGNhc2UgMCB7CiAgICAgICAgICAgICAgICAvLyByZXZlcnQocCwgcykgLSBlbmQgZXhlY3V0aW9uLCByZXZlcnQgc3RhdGUgY2hhbmdlcywgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldmVydCgwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgICAgIGRlZmF1bHQgewogICAgICAgICAgICAgICAgLy8gcmV0dXJuKHAsIHMpIC0gZW5kIGV4ZWN1dGlvbiwgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldHVybigwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIF9mYWxsYm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sbChQcm94eS5pbXBsZW1lbnRhdGlvbiwgKCkpKTsKICAgICAgICByZXF1aXJlKG9rLCAiY2FsbCBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gYWJpLmRlY29kZShyZXMsIChhZGRyZXNzKSk7CiAgICB9CgogICAgZnVuY3Rpb24gY2hhbmdlUHJveHlBZG1pbihhZGRyZXNzIHBheWFibGUgcHJveHksIGFkZHJlc3MgYWRtaW4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBvbmx5T3duZXIKICAgIHsKICAgICAgICBQcm94eShwcm94eSkuY2hhbmdlQWRtaW4oYWRtaW4pOwogICAgfQoKICAgIGZ1bmN0aW9uIHVwZ3JhZGUoYWRkcmVzcyBwYXlhYmxlIHByb3h5LCBhZGRyZXNzIGltcGxlbWVudGF0aW9uKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgb25seU93bmVyCiAgICB7CiAgICAgICAgUHJveHkocHJveHkpLnVwZ3JhZGVUbyhpbXBsZW1lbnRhdGlvbik7CiAgICB9Cn0KCmxpYnJhcnkgU3RvcmFnZVNsb3QgewogICAgc3RydWN0IEFkZHJlc3NTbG90IHsKICAgICAgICBhZGRyZXNzIHZhbHVlOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEFkZHJlc3NTbG90KGJ5dGVzMzIgc2xvdCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChBZGRyZXNzU2xvdCBzdG9yYWdlIHIpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICByLnNsb3QgOj0gc2xvdAogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgVGVzdFNsb3QgewogICAgYnl0ZXMzMiBwdWJsaWMgY29uc3RhbnQgc2xvdCA9IGtlY2NhazI1NigiVEVTVF9TTE9UIik7CgogICAgZnVuY3Rpb24gZ2V0U2xvdCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYWRkcmVzcykgewogICAgICAgIHJldHVybiBTdG9yYWdlU2xvdC5nZXRBZGRyZXNzU2xvdChzbG90KS52YWx1ZTsKICAgIH0KCiAgICBmdW5jdGlvbiB3cml0ZVNsb3QoYWRkcmVzcyBfYWRkcikgZXh0ZXJuYWwgewogICAgICAgIFN0b3JhZ2VTbG90LmdldEFkZHJlc3NTbG90KHNsb3QpLnZhbHVlID0gX2FkZHI7CiAgICB9Cn0K"}],AA=`

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

                +`,Iu=({prev:s,next:a})=>r.jsx(A,{version:ou,title:ru,description:iu,html:hu,prev:s,next:a,codes:gu}),du="0.8.24",Cu="Upgradeable Proxy",ju="Example of upgradeable proxy",Au=[{fileName:"UpgradeableProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIFRyYW5zcGFyZW50IHVwZ3JhZGVhYmxlIHByb3h5IHBhdHRlcm4KCmNvbnRyYWN0IENvdW50ZXJWMSB7CiAgICB1aW50MjU2IHB1YmxpYyBjb3VudDsKCiAgICBmdW5jdGlvbiBpbmMoKSBleHRlcm5hbCB7CiAgICAgICAgY291bnQgKz0gMTsKICAgIH0KfQoKY29udHJhY3QgQ291bnRlclYyIHsKICAgIHVpbnQyNTYgcHVibGljIGNvdW50OwoKICAgIGZ1bmN0aW9uIGluYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCArPSAxOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCAtPSAxOwogICAgfQp9Cgpjb250cmFjdCBCdWdneVByb3h5IHsKICAgIGFkZHJlc3MgcHVibGljIGltcGxlbWVudGF0aW9uOwogICAgYWRkcmVzcyBwdWJsaWMgYWRtaW47CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgYWRtaW4gPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIGZ1bmN0aW9uIF9kZWxlZ2F0ZSgpIHBy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HJlc3MgYQogICAgICAgICAgICAvLyAtIHdpdGggaW5wdXQgbWVtW2lu4oCmKGluK2luc2l6ZSkpCiAgICAgICAgICAgIC8vIC0gcHJvdmlkaW5nIGcgZ2FzCiAgICAgICAgICAgIC8vIC0gYW5kIG91dHB1dCBhcmVhIG1lbVtvdXTigKYob3V0K291dHNpemUpKQogICAgICAgICAgICAvLyAtIHJldHVybmluZyAwIG9uIGVycm9yIChlZy4gb3V0IG9mIGdhcykgYW5kIDEgb24gc3VjY2VzcwogICAgICAgICAgICBsZXQgcmVzdWx0IDo9CiAgICAgICAgICAgICAgICBkZWxlZ2F0ZWNhbGwoZ2FzKCksIF9pbXBsZW1lbnRhdGlvbiwgMCwgY2FsbGRhdGFzaXplKCksIDAsIDApCgogICAgICAgICAgICAvLyBDb3B5IHRoZSByZXR1cm5lZCBkYXRhLgogICAgICAgICAgICAvLyByZXR1cm5kYXRhY29weSh0LCBmLCBzKSAtIGNvcHkgcyBieXRlcyBmcm9tIHJldHVybmRhdGEgYXQgcG9zaXRpb24gZiB0byBtZW0gYXQgcG9zaXRpb24gdAogICAgICAgICAgICAvLyByZXR1cm5kYXRhc2l6ZSgpIC0gc2l6ZSBvZiB0aGUgbGFzdCByZXR1cm5kYXRhCiAgICAgICAgICAgIHJldHVybmRhdGFjb3B5KDAsIDAsIHJldHVybmRhdGFzaXplKCkpCgogICAgICAgICAgICBzd2l0Y2ggcmVzdWx0CiAgICAgICAgICAgIC8vIGRlbGVnYXRlY2FsbCByZXR1cm5zIDAgb24gZXJyb3IuCiAgICAgICAgICAgIGNhc2UgMCB7CiAgICAgICAgICAgICAgICAvLyByZXZlcnQocCwgcykgLSBlbmQgZXhlY3V0aW9uLCByZXZlcnQgc3RhdGUgY2hhbmdlcywgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgICAgIHJldmVydCgwLCByZXR1cm5kYXRhc2l6ZSgpKQogICAgICAgICAgICB9CiAgICAgICAgICAgIGRlZmF1bH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veHlJbXBsZW1lbnRhdGlvbihhZGRyZXNzIHByb3h5KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgKGJvb2wgb2ssIGJ5dGVzIG1lbW9yeSByZXMpID0KICAgICAgICAgICAgcHJveHkuc3RhdGljY2FsbChhYmkuZW5jb2RlQ2FsbChQcm94eS5pbXBsZW1lbnRhdGlvbiwgKCkpKTsKICAgICAgICByZXF1aXJlKG9rLCAiY2FsbCBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gYWJpLmRlY29kZShyZXMsIChhZGRyZXNzKSk7CiAgICB9CgogICAgZnVuY3Rpb24gY2hhbmdlUHJveHlBZG1pbihhZGRyZXNzIHBheWFibGUgcHJveHksIGFkZHJlc3MgYWRtaW4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBvbmx5T3duZXIKICAgIHsKICAgICAgICBQcm94eShwcm94eSkuY2hhbmdlQWRtaW4oYWRtaW4pOwogICAgfQoKICAgIGZ1bmN0aW9uIHVwZ3JhZGUoYWRkcmVzcyBwYXlhYmxlIHByb3h5LCBhZGRyZXNzIGltcGxlbWVudGF0aW9uKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgb25seU93bmVyCiAgICB7CiAgICAgICAgUHJveHkocHJveHkpLnVwZ3JhZGVUbyhpbXBsZW1lbnRhdGlvbik7CiAgICB9Cn0KCmxpYnJhcnkgU3RvcmFnZVNsb3QgewogICAgc3RydWN0IEFkZHJlc3NTbG90IHsKICAgICAgICBhZGRyZXNzIHZhbHVlOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEFkZHJlc3NTbG90KGJ5dGVzMzIgc2xvdCkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChBZGRyZXNzU2xvdCBzdG9yYWdlIHIpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICByLnNsb3QgOj0gc2xvdAogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgVGVzdFNsb3QgewogICAgYnl0ZXMzMiBwdWJsaWMgY29uc3RhbnQgc2xvdCA9IGtlY2NhazI1NigiVEVTVF9TTE9UIik7CgogICAgZnVuY3Rpb24gZ2V0U2xvdCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYWRkcmVzcykgewogICAgICAgIHJldHVybiBTdG9yYWdlU2xvdC5nZXRBZGRyZXNzU2xvdChzbG90KS52YWx1ZTsKICAgIH0KCiAgICBmdW5jdGlvbiB3cml0ZVNsb3QoYWRkcmVzcyBfYWRkcikgZXh0ZXJuYWwgewogICAgICAgIFN0b3JhZ2VTbG90LmdldEFkZHJlc3NTbG90KHNsb3QpLnZhbHVlID0gX2FkZHI7CiAgICB9Cn0K"}],uu=`

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

                This example shows

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

                  StorageSlot.getAddressSlot(slot).value = _addr; } } -`,yA=({prev:s,next:a})=>r.jsx(u,{version:dA,title:CA,description:jA,html:AA,prev:s,next:a,codes:uA}),mA="0.8.24",bA="Write to Any Slot",wA="Write to Any Slot",kA=[{fileName:"Slot.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmxpYnJhcnkgU3RvcmFnZVNsb3QgewogICAgLy8gV3JhcCBhZGRyZXNzIGluIGEgc3RydWN0IHNvIHRoYXQgaXQgY2FuIGJlIHBhc3NlZCBhcm91bmQgYXMgYSBzdG9yYWdlIHBvaW50ZXIKICAgIHN0cnVjdCBBZGRyZXNzU2xvdCB7CiAgICAgICAgYWRkcmVzcyB2YWx1ZTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRBZGRyZXNzU2xvdChieXRlczMyIHNsb3QpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoQWRkcmVzc1Nsb3Qgc3RvcmFnZSBwb2ludGVyKQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gR2V0IHRoZSBwb2ludGVyIHRvIEFkZHJlc3NTbG90IHN0b3JlZCBhdCBzbG90CiAgICAgICAgICAgIHBvaW50ZXIuc2xvdCA6PSBzbG90CiAgICAgICAgfQogICAgfQp9Cgpjb250cmFjdCBUZXN0U2xvdCB7CiAgICBieXRlczMyIHB1YmxpYyBjb25zdGFudCBURVNUX1NMT1QgPSBrZWNjYWsyNTYoIlRFU1RfU0xPVCIpOwoKICAgIGZ1bmN0aW9uIHdyaXRlKGFkZHJlc3MgX2FkZHIpIGV4dGVybmFsIHsKICAgICAgICBTdG9yYWdlU2xvdC5BZGRyZXNzU2xvdCBzdG9yYWdlIGRhdGEgPQogICAgICAgICAgICBTdG9yYWdlU2xvdC5nZXRBZGRyZXNzU2xvdChURVNUX1NMT1QpOwogICAgICAgIGRhdGEudmFsdWUgPSBfYWRkcjsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXQoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKGFkZHJlc3MpIHsKICAgICAgICBTdG9yYWdlU2xvdC5BZGRyZXNzU2xvdCBzdG9yYWdlIGRhdGEgPQogICAgICAgICAgICBTdG9yYWdlU2xvdC5nZXRBZGRyZXNzU2xvdChURVNUX1NMT1QpOwogICAgICAgIHJldHVybiBkYXRhLnZhbHVlOwogICAgfQp9Cg=="}],ZA=`

                  Solidity storage is like an array of length 2^256. +`,yu=({prev:s,next:a})=>r.jsx(A,{version:du,title:Cu,description:ju,html:uu,prev:s,next:a,codes:Au}),mu="0.8.24",bu="Write to Any Slot",wu="Write to Any Slot",ku=[{fileName:"Slot.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmxpYnJhcnkgU3RvcmFnZVNsb3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XRhLnZhbHVlOwogICAgfQp9Cg=="}],Zu=`

                  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.

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

                  return data.value; } } -`,WA=({prev:s,next:a})=>r.jsx(u,{version:mA,title:bA,description:wA,html:ZA,prev:s,next:a,codes:kA}),BA="0.8.24",GA="Array",VA="Learn about arrays in Solidity",fA=[{fileName:"Array.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFycmF5IHsKICAgIC8vIFNldmVyYWwgd2F5cyB0byBpbml0aWFsaXplIGFuIGFycmF5CiAgICB1aW50MjU2W10gcHVibGljIGFycjsKICAgIHVpbnQyNTZbXSBwdWJsaWMgYXJyMiA9IFsxLCAyLCAzXTsKICAgIC8vIEZpeGVkIHNpemVkIGFycmF5LCBhbGwgZWxlbWVudHMgaW5pdGlhbGl6ZSB0byAwCiAgICB1aW50MjU2WzEwXSBwdWJsaWMgbXlGaXhlZFNpemVBcnI7CgogICAgZnVuY3Rpb24gZ2V0KHVpbnQyNTYgaSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhcnJbaV07CiAgICB9CgogICAgLy8gU29saWRpdHkgY2FuIHJldHVybiB0aGUgZW50aXJlIGFycmF5LgogICAgLy8gQnV0IHRoaXMgZnVuY3Rpb24gc2hvdWxkIGJlIGF2b2lkZWQgZm9yCiAgICAvLyBhcnJheXMgdGhhdCBjYW4gZ3JvdyBpbmRlZmluaXRlbHkgaW4gbGVuZ3RoLgogICAgZnVuY3Rpb24gZ2V0QXJyKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NltdIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhcnI7CiAgICB9CgogICAgZnVuY3Rpb24gc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iAgICAgICAgYXNzZXJ0KGFyci5sZW5ndGggPT0gMik7CiAgICAgICAgYXNzZXJ0KGFyclswXSA9PSAxKTsKICAgICAgICBhc3NlcnQoYXJyWzFdID09IDQpOwogICAgfQp9Cg=="}],YA=`

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

                  +`,Wu=({prev:s,next:a})=>r.jsx(A,{version:mu,title:bu,description:wu,html:Zu,prev:s,next:a,codes:ku}),Bu="0.8.24",Gu="Array",Vu="Learn about arrays in Solidity",fu=[{fileName:"Array.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFycmF5IHsKICAgIC8vIFNldmVyYWwgd2F5cyB0byBpbml0aWFsaXplIGFuIGFycmF5CiAgICB1aW50MjU2W10gcHVibGljIGFycjsKICAgIHVpbnQyNTZbXSBwdWJsaWMgYXJyMiA9IFsxLCAyLCAzXTsKICAgIC8vIEZpeGVkIHNpemVkIGFycmF5LCBhbGwgZWxlbWVudHMgaW5pdGlhbGl6ZSB0byAwCiAgICB1aW50MjU2WzEwXSBwdWJsaWMgbXlGaXhlZFNpemVBcnI7CgogICAgZnVuY3Rpb24gZ2V0KHVpbnQyNTYgaSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhcnJbaV07CiAgICB9CgogICAgLy8gU29saWRpdHkgY2FuIHJldHVybiB0aGUgZW50aXJlIGFycmF5LgogICAgLy8gQnV0IHRoaXMgZnVuY3Rpb24gc2hvdWxkIGJlIGF2b2lkZWQgZm9yCiAgICAvLyBhcnJheXMgdGhhdCBjYW4gZ3JvdyBpbmRlZmluaXRlbHkgaW4gbGVuZ3RoLgogICAgZnVuY3Rpb24gZ2V0QXJyKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NltdIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhcnI7CiAgICB9CgogICAgZnVuY3Rpb24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V07CiAgICAgICAgcmVtb3ZlKDApOwogICAgICAgIC8vIFtdCiAgICAgICAgYXNzZXJ0KGFyci5sZW5ndGggPT0gMCk7CiAgICB9Cn0K"},{fileName:"ArrayReplaceFromEnd.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFycmF5UmVwbGFjZUZyb21FbmQgewogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CgogICAgLy8gRGVsZXRpbmcgYW4gZWxlbWVudCBjcmVhdGVzIGEgZ2FwIGluIHRoZSBhcnJheS4KICAgIC8vIE9uZSB0cmljayB0byBrZWVwIHRoZSBhcnJheSBjb21wYWN0IGlzIHRvCiAgICAvLyBtb3ZlIHRoZSBsYXN0IGVsZW1lbnQgaW50byB0aGUgcGxhY2UgdG8gZGVsZXRlLgogICAgZnVuY3Rpb24gcmVtb3ZlKHVpbnQyNTYgaW5kZXgpIHB1YmxpYyB7CiAgICAgICAgLy8gTW92ZSB0aGUgbGFzdCBlbGVtZW50IGludG8gdGhlIHBsYWNlIHRvIGRlbGV0ZQogICAgICAgIGFycltpbmRleF0gPSBhcnJbYXJyLmxlbmd0aCAtIDFdOwogICAgICAgIC8vIFJlbW92ZSB0aGUgbGFzdCBlbGVtZW50CiAgICAgICAgYXJyLnBvcCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3QoKSBwdWJsaWMgewogICAgICAgIGFyciA9IFsxLCAyLCAzLCA0XTsKCiAgICAgICAgcmVtb3ZlKDEpOwogICAgICAgIC8vIFsxLCA0LCAzXQogICAgICAgIGFzc2VydChhcnIubGVuZ3RoID09IDMpOwogICAgICAgIGFzc2VydChhcnJbMF0gPT0gMSk7CiAgICAgICAgYXNzZXJ0KGFyclsxXSA9PSA0KTsKICAgICAgICBhc3NlcnQoYXJyWzJdID09IDMpOwoKICAgICAgICByZW1vdmUoMik7CiAgICAgICAgLy8gWzEsIDRdCiAgICAgICAgYXNzZXJ0KGFyci5sZW5ndGggPT0gMik7CiAgICAgICAgYXNzZXJ0KGFyclswXSA9PSAxKTsKICAgICAgICBhc3NlcnQoYXJyWzFdID09IDQpOwogICAgfQp9Cg=="}],Yu=`

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

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

                  assert(arr[1] == 4); } } -
                  `,RA=({prev:s,next:a})=>r.jsx(u,{version:BA,title:GA,description:VA,html:YA,prev:s,next:a,codes:fA}),XA="0.8.24",vA="Assembly Error",NA="Example of error in assembly",HA=[{fileName:"AssemblyError.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5RXJyb3IgewogICAgZnVuY3Rpb24geXVsX3JldmVydCh1aW50MjU2IHgpIHB1YmxpYyBwdXJlIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIHJldmVydChwLCBzKSAtIGVuZCBleGVjdXRpb24KICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV2ZXJ0IHN0YXRlIGNoYW5nZXMKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgaWYgZ3QoeCwgMTApIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9Cn0K"}],FA=`

                  Example of error in assembly

                  +`,Ru=({prev:s,next:a})=>r.jsx(A,{version:Bu,title:Gu,description:Vu,html:Yu,prev:s,next:a,codes:fu}),Xu="0.8.24",vu="Assembly Error",Nu="Example of error in assembly",Hu=[{fileName:"AssemblyError.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5RXJyb3IgewogICAgZnVuY3Rpb24geXVsX3JldmVydCh1aW50MjU2IHgpIHB1YmxpYyBwdXJlIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIHJldmVydChwLCBzKSAtIGVuZCBleGVjdXRpb24KICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV2ZXJ0IHN0YXRlIGNoYW5nZXMKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgaWYgZ3QoeCwgMTApIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9Cn0K"}],Fu=`

                  Example of error in assembly

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

                  } } } -
                  `,KA=({prev:s,next:a})=>r.jsx(u,{version:XA,title:vA,description:NA,html:FA,prev:s,next:a,codes:HA}),MA="0.8.24",SA="Assembly Conditional Statements",xA="Example of conditional statements in assembly",JA=[{fileName:"AssemblyIf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5SWYgewogICAgZnVuY3Rpb24geXVsX2lmKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBpZiBjb25kaXRpb24gPSAxIHsgY29kZSB9CiAgICAgICAgICAgIC8vIG5vIGVsc2UKICAgICAgICAgICAgLy8gaWYgMCB7IHogOj0gOTkgfQogICAgICAgICAgICAvLyBpZiAxIHsgeiA6PSA5OSB9CiAgICAgICAgICAgIGlmIGx0KHgsIDEwKSB7IHogOj0gOTkgfQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB5dWxfc3dpdGNoKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICBjYXNlIDEgeyB6IDo9IDEwIH0KICAgICAgICAgICAgY2FzZSAyIHsgeiA6PSAyMCB9CiAgICAgICAgICAgIGRlZmF1bHQgeyB6IDo9IDAgfQogICAgICAgIH0KICAgIH0KfQo="}],zA=`

                  Example of conditional statements in assembly

                  +`,Ku=({prev:s,next:a})=>r.jsx(A,{version:Xu,title:vu,description:Nu,html:Fu,prev:s,next:a,codes:Hu}),Mu="0.8.24",Su="Assembly Conditional Statements",xu="Example of conditional statements in assembly",Ju=[{fileName:"AssemblyIf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5SWYgewogICAgZnVuY3Rpb24geXVsX2lmKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBpZiBjb25kaXRpb24gPSAxIHsgY29kZSB9CiAgICAgICAgICAgIC8vIG5vIGVsc2UKICAgICAgICAgICAgLy8gaWYgMCB7IHogOj0gOTkgfQogICAgICAgICAgICAvLyBpZiAxIHsgeiA6PSA5OSB9CiAgICAgICAgICAgIGlmIGx0KHgsIDEwKSB7IHogOj0gOTkgfQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB5dWxfc3dpdGNoKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICBjYXNlIDEgeyB6IDo9IDEwIH0KICAgICAgICAgICAgY2FzZSAyIHsgeiA6PSAyMCB9CiAgICAgICAgICAgIGRlZmF1bHQgeyB6IDo9IDAgfQogICAgICAgIH0KICAgIH0KfQo="}],zu=`

                  Example of conditional statements in assembly

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

                  } } } -
                  `,DA=({prev:s,next:a})=>r.jsx(u,{version:MA,title:SA,description:xA,html:zA,prev:s,next:a,codes:JA}),EA="0.8.24",QA="Assembly Loop",TA="Example of loop in assembly",UA=[{fileName:"AssemblyLoop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5TG9vcCB7CiAgICBmdW5jdGlvbiB5dWxfZm9yX2xvb3AoKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGZvciB7IGxldCBpIDo9IDAgfSBsdChpLCAxMCkgeyBpIDo9IGFkZChpLCAxKSB9IHsgeiA6PSBhZGQoeiwgMSkgfQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB5dWxfd2hpbGVfbG9vcCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTYgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGkgOj0gMAogICAgICAgICAgICBmb3Ige30gbHQoaSwgNSkge30gewogICAgICAgICAgICAgICAgaSA6PSBhZGQoaSwgMSkKICAgICAgICAgICAgICAgIHogOj0gYWRkKHosIDEpCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0K"}],_A=`

                  Example of loop in assembly

                  +`,Du=({prev:s,next:a})=>r.jsx(A,{version:Mu,title:Su,description:xu,html:zu,prev:s,next:a,codes:Ju}),Eu="0.8.24",Qu="Assembly Loop",Tu="Example of loop in assembly",Uu=[{fileName:"AssemblyLoop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5TG9vcCB7CiAgICBmdW5jdGlvbiB5dWxfZm9yX2xvb3AoKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGZvciB7IGxldCBpIDo9IDAgfSBsdChpLCAxMCkgeyBpIDo9IGFkZChpLCAxKSB9IHsgeiA6PSBhZGQoeiwgMSkgfQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB5dWxfd2hpbGVfbG9vcCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTYgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGkgOj0gMAogICAgICAgICAgICBmb3Ige30gbHQoaSwgNSkge30gewogICAgICAgICAgICAgICAgaSA6PSBhZGQoaSwgMSkKICAgICAgICAgICAgICAgIHogOj0gYWRkKHosIDEpCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0K"}],_u=`

                  Example of loop in assembly

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

                  } } } -
                  `,LA=({prev:s,next:a})=>r.jsx(u,{version:EA,title:QA,description:TA,html:_A,prev:s,next:a,codes:UA}),OA="0.8.24",PA="Assembly Math",$A="Example of math in assembly",qA=[{fileName:"AssemblyMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5TWF0aCB7CiAgICBmdW5jdGlvbiB5dWxfYWRkKHVpbnQyNTYgeCwgdWludDI1NiB5KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHogOj0gYWRkKHgsIHkpCiAgICAgICAgICAgIGlmIGx0KHosIHgpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24geXVsX211bCh1aW50MjU2IHgsIHVpbnQyNTYgeSkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICBjYXNlIDAgeyB6IDo9IDAgfQogICAgICAgICAgICBkZWZhdWx0IHsKICAgICAgICAgICAgICAgIHogOj0gbXVsKHgsIHkpCiAgICAgICAgICAgICAgICBpZiBpc3plcm8oZXEoZGl2KHosIHgpLCB5KSkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIC8vIFJvdW5kIHRvIG5lYXJlc3QgbXVsdGlwbGUgb2YgYgogICAgZnVuY3Rpb24geXVsX2ZpeGVkX3BvaW50X3JvdW5kKHVpbnQyNTYgeCwgdWludDI1NiBiKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBiID0gMTAwCiAgICAgICAgICAgIC8vIHggPSA5MAogICAgICAgICAgICAvLyB6ID0gOTAgLyAxMDAgKiAxMDAgPSAwLCB3YW50IHogPSAxMDAKICAgICAgICAgICAgLy8geiA6PSBtdWwoZGl2KHgsIGIpLCBiKQoKICAgICAgICAgICAgbGV0IGhhbGYgOj0gZGl2KGIsIDIpCiAgICAgICAgICAgIHogOj0gYWRkKHgsIGhhbGYpCiAgICAgICAgICAgIHogOj0gbXVsKGRpdih6LCBiKSwgYikKICAgICAgICAgICAgLy8geCA9IDkwCiAgICAgICAgICAgIC8vIGhhbGYgPSA1MAogICAgICAgICAgICAvLyB6ID0gOTAgKyA1MCA9IDE0MAogICAgICAgICAgICAvLyB6ID0gMTQwIC8gMTAwICogMTAwID0gMTAwCiAgICAgICAgfQogICAgfQp9Cg=="}],sy=`

                  Example of math in assembly

                  +`,Lu=({prev:s,next:a})=>r.jsx(A,{version:Eu,title:Qu,description:Tu,html:_u,prev:s,next:a,codes:Uu}),Ou="0.8.24",Pu="Assembly Math",$u="Example of math in assembly",qu=[{fileName:"AssemblyMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5TWF0aCB7CiAgICBmdW5jdGlvbiB5dWxfYWRkKHVpbnQyNTYgeCwgdWludDI1NiB5KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHogOj0gYWRkKHgsIHkpCiAgICAgICAgICAgIGlmIGx0KHosIHgpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24geXVsX211bCh1aW50MjU2IHgsIHVpbnQyNTYgeSkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICBjYXNlIDAgeyB6IDo9IDAgfQogICAgICAgICAgICBkZWZhdWx0IHsKICAgICAgICAgICAgICAgIHogOj0gbXVsKHgsIHkpCiAgICAgICAgICAgICAgICBpZiBpc3plcm8oZXEoZGl2KHosIHgpLCB5KSkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIC8vIFJvdW5kIHRvIG5lYXJlc3QgbXVsdGlwbGUgb2YgYgogICAgZnVuY3Rpb24geXVsX2ZpeGVkX3BvaW50X3JvdW5kKHVpbnQyNTYgeCwgdWludDI1NiBiKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBiID0gMTAwCiAgICAgICAgICAgIC8vIHggPSA5MAogICAgICAgICAgICAvLyB6ID0gOTAgLyAxMDAgKiAxMDAgPSAwLCB3YW50IHogPSAxMDAKICAgICAgICAgICAgLy8geiA6PSBtdWwoZGl2KHgsIGIpLCBiKQoKICAgICAgICAgICAgbGV0IGhhbGYgOj0gZGl2KGIsIDIpCiAgICAgICAgICAgIHogOj0gYWRkKHgsIGhhbGYpCiAgICAgICAgICAgIHogOj0gbXVsKGRpdih6LCBiKSwgYikKICAgICAgICAgICAgLy8geCA9IDkwCiAgICAgICAgICAgIC8vIGhhbGYgPSA1MAogICAgICAgICAgICAvLyB6ID0gOTAgKyA1MCA9IDE0MAogICAgICAgICAgICAvLyB6ID0gMTQwIC8gMTAwICogMTAwID0gMTAwCiAgICAgICAgfQogICAgfQp9Cg=="}],sy=`

                  Example of math in assembly

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

                  } } } -
                  `,ay=({prev:s,next:a})=>r.jsx(u,{version:OA,title:PA,description:$A,html:sy,prev:s,next:a,codes:qA}),ny="0.8.24",ly="Assembly Variable",py="Example of how to declare variable inside assembly",ey=[{fileName:"AssemblyVariable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5VmFyaWFibGUgewogICAgZnVuY3Rpb24geXVsX2xldCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTYgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gTGFuZ3VhZ2UgdXNlZCBmb3IgYXNzZW1ibHkgaXMgY2FsbGVkIFl1bAogICAgICAgICAgICAvLyBMb2NhbCB2YXJpYWJsZXMKICAgICAgICAgICAgbGV0IHggOj0gMTIzCiAgICAgICAgICAgIHogOj0gNDU2CiAgICAgICAgfQogICAgfQp9Cg=="}],cy=`

                  Example of how to declare variables inside assembly

                  +`,ay=({prev:s,next:a})=>r.jsx(A,{version:Ou,title:Pu,description:$u,html:sy,prev:s,next:a,codes:qu}),ny="0.8.24",ly="Assembly Variable",py="Example of how to declare variable inside assembly",ey=[{fileName:"AssemblyVariable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFzc2VtYmx5VmFyaWFibGUgewogICAgZnVuY3Rpb24geXVsX2xldCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTYgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gTGFuZ3VhZ2UgdXNlZCBmb3IgYXNzZW1ibHkgaXMgY2FsbGVkIFl1bAogICAgICAgICAgICAvLyBMb2NhbCB2YXJpYWJsZXMKICAgICAgICAgICAgbGV0IHggOj0gMTIzCiAgICAgICAgICAgIHogOj0gNDU2CiAgICAgICAgfQogICAgfQp9Cg=="}],cy=`

                  Example of how to declare variables inside assembly

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

                  } } } -
                  `,ty=({prev:s,next:a})=>r.jsx(u,{version:ny,title:ly,description:py,html:cy,prev:s,next:a,codes:ey}),oy="0.8.24",ry="Bitwise Operators",iy="Learn about bitwise operators in Solidity",gy=[{fileName:"Bitwise.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEJpdHdpc2VPcHMgewogICAgLy8geCAgICAgPSAxMTEwID0gOCArIDQgKyAyICsgMCA9IDE0CiAgICAvLyB5ICAgICA9IDEwMTEgPSA4ICsgMCArIDIgKyAxID0gMTEKICAgIC8vIHggJiB5ID0gMTAxMCA9IDggKyAwICsgMiArIDAgPSAxMAogICAgZnVuY3Rpb24gYW5kKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4geCAmIHk7CiAgICB9CgogICAgLy8geCAgICAgPSAxMTAwID0gOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB5ICAgICA9IDEwMDEgPSA4ICsgMCArIDAgKyAxID0gOQogICAgLy8geCB8IHkgPSAxMTAxID0gOCArIDQgKyAwICsgMSA9IDEzCiAgICBmdW5jdGlvbiBvcih1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHggfCB5OwogICAgfQoKICAgIC8vIHggICAgID0gMTEwMCA9IDggKyA0ICsgMCArIDAgPSAxMgogICAgLy8geSAgICAgPSAwMTAxID0gMCArIDQgKyAwICsgMSA9IDUKICAgIC8vIHggXiB5ID0gMTAwMSA9IDggKyAwICsgMCArIDEgPSA5CiAgICBmdW5jdGlvbiB4b3IodWludDI1NiB4LCB1aW50MjU2IHkpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB4IF4geTsKICAgIH0KCiAgICAvLyB4ICA9IDAwMDAxMTAwID0gICAwICsgIDAgKyAgMCArICAwICsgOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB+eCA9IDExMTEwMDExID0gMTI4ICsgNjQgKyAzMiArIDE2ICsgMCArIDAgKyAyICsgMSA9IDI0MwogICAgZnVuY3Rpb24gbm90KHVpbnQ4IHgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDgpIHsKICAgICAgICByZXR1cm4gfng7CiAgICB9Cg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ml0cwogICAgICAgIC8vIHggICAgICAgID0gMTEwMSA9IDEzCiAgICAgICAgLy8gbWFzayAgICAgPSAwMTExID0gNwogICAgICAgIC8vIHggJiBtYXNrID0gMDEwMSA9IDUKICAgICAgICB1aW50MjU2IG1hc2sgPSAoMSA8PCBuKSAtIDE7CiAgICAgICAgcmV0dXJuIHggJiBtYXNrOwogICAgfQoKICAgIC8vIEdldCBsYXN0IG4gYml0cyBmcm9tIHggdXNpbmcgbW9kIG9wZXJhdG9yCiAgICBmdW5jdGlvbiBnZXRMYXN0TkJpdHNVc2luZ01vZCh1aW50MjU2IHgsIHVpbnQyNTYgbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIDEgPDwgbiA9IDIgKiogbgogICAgICAgIHJldHVybiB4ICUgKDEgPDwgbik7CiAgICB9CgogICAgLy8gR2V0IHBvc2l0aW9uIG9mIG1vc3Qgc2lnbmlmaWNhbnQgYml0CiAgICAvLyB4ID0gMTEwMCA9IDEyLCBtb3N0IHNpZ25pZmljYW50IGJpdCA9IDEwMDAsIHNvIHRoaXMgZnVuY3Rpb24gd2lsbCByZXR1cm4gMwogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgdWludDI1NiBpID0gMDsKICAgICAgICB3aGlsZSAoKHggPj49IDEpID4gMCkgewogICAgICAgICAgICArK2k7CiAgICAgICAgfQogICAgICAgIHJldHVybiBpOwogICAgfQoKICAgIC8vIEdldCBmaXJzdCBuIGJpdHMgZnJvbSB4CiAgICAvLyBsZW4gPSBsZW5ndGggb2YgYml0cyBpbiB4ID0gcG9zaXRpb24gb2YgbW9zdCBzaWduaWZpY2FudCBiaXQgb2YgeCwgKyAxCiAgICBmdW5jdGlvbiBnZXRGaXJzdE5CaXRzKHVpbnQyNTYgeCwgdWludDI1NiBuLCB1aW50MjU2IGxlbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIEV4YW1wbGUKICAgICAgICAvLyB4ICAgICAgICA9IDExMTAgPSAxNCwgbiA9IDIsIGxlbiA9IDQKICAgICAgICAvLyBtYXNrICAgICA9IDExMDAgPSAxMgogICAgICAgIC8vIHggJiBtYXNrID0gMTEwMCA9IDEyCiAgICAgICAgdWludDI1NiBtYXNrID0gKCgxIDw8IG4pIC0gMSkgPDwgKGxlbiAtIG4pOwogICAgICAgIHJldHVybiB4ICYgbWFzazsKICAgIH0KfQo="},{fileName:"MostSignificantBitAssembly.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEFzc2VtYmx5IHsKICAgIGZ1bmN0aW9uIG1vc3RTaWduaWZpY2FudEJpdCh1aW50MjU2IHgpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBtc2IpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNywgZ3QoeCwgMHhGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIC8vIG9yIGNhbiBiZSByZXBsYWNlZCB3aXRoIGFkZAogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg2LCBndCh4LCAweEZGRkZGRkZGRkZGRkZGRkYpKQogICAgICAgICAgICB4IDo9IHNocihmLCB4KQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg1LCBndCh4LCAweEZGRkZGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNCwgZ3QoeCwgMHhGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoMywgZ3QoeCwgMHhGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDIsIGd0KHgsIDB4RikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDEsIGd0KHgsIDB4MykpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gZ3QoeCwgMHgxKQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgIH0KfQo="},{fileName:"MostSignificantBitFunction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEZ1bmN0aW9uIHsKICAgIC8vIEZpbmQgbW9zdCBzaWduaWZpY2FudCBiaXQgdXNpbmcgYmluYXJ5IHNlYXJjaAogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IG1zYikKICAgIHsKICAgICAgICAvLyB4ID49IDIgKiogMTI4CiAgICAgICAgaWYgKHggPj0gMHgxMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTI4OwogICAgICAgICAgICBtc2IgKz0gMTI4OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogNjQKICAgICAgICBpZiAoeCA+PSAweDEwMDAwMDAwMDAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDY0OwogICAgICAgICAgICBtc2IgKz0gNjQ7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAzMgogICAgICAgIGlmICh4ID49IDB4MTAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDMyOwogICAgICAgICAgICBtc2IgKz0gMzI7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAxNgogICAgICAgIGlmICh4ID49IDB4MTAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTY7CiAgICAgICAgICAgIG1zYiArPSAxNjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDgKICAgICAgICBpZiAoeCA+PSAweDEwMCkgewogICAgICAgICAgICB4ID4+PSA4OwogICAgICAgICAgICBtc2IgKz0gODsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDQKICAgICAgICBpZiAoeCA+PSAweDEwKSB7CiAgICAgICAgICAgIHggPj49IDQ7CiAgICAgICAgICAgIG1zYiArPSA0OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogMgogICAgICAgIGlmICh4ID49IDB4NCkgewogICAgICAgICAgICB4ID4+PSAyOwogICAgICAgICAgICBtc2IgKz0gMjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDEKICAgICAgICBpZiAoeCA+PSAweDIpIG1zYiArPSAxOwogICAgfQp9Cg=="}],hy=`
                  // SPDX-License-Identifier: MIT
                  +
                  `,ty=({prev:s,next:a})=>r.jsx(A,{version:ny,title:ly,description:py,html:cy,prev:s,next:a,codes:ey}),oy="0.8.24",ry="Bitwise Operators",iy="Learn about bitwise operators in Solidity",gy=[{fileName:"Bitwise.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEJpdHdpc2VPcHMgewogICAgLy8geCAgICAgPSAxMTEwID0gOCArIDQgKyAyICsgMCA9IDE0CiAgICAvLyB5ICAgICA9IDEwMTEgPSA4ICsgMCArIDIgKyAxID0gMTEKICAgIC8vIHggJiB5ID0gMTAxMCA9IDggKyAwICsgMiArIDAgPSAxMAogICAgZnVuY3Rpb24gYW5kKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4geCAmIHk7CiAgICB9CgogICAgLy8geCAgICAgPSAxMTAwID0gOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB5ICAgICA9IDEwMDEgPSA4ICsgMCArIDAgKyAxID0gOQogICAgLy8geCB8IHkgPSAxMTAxID0gOCArIDQgKyAwICsgMSA9IDEzCiAgICBmdW5jdGlvbiBvcih1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHggfCB5OwogICAgfQoKICAgIC8vIHggICAgID0gMTEwMCA9IDggKyA0ICsgMCArIDAgPSAxMgogICAgLy8geSAgICAgPSAwMTAxID0gM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DAwIC0tPiAwMDAwID0gMAogICAgLy8gMTIgPj4gMSA9IDExMDAgLS0+IDAxMTAgPSA2CiAgICBmdW5jdGlvbiBzaGlmdFJpZ2h0KHVpbnQyNTYgeCwgdWludDI1NiBiaXRzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYpCiAgICB7CiAgICAgICAgcmV0dXJuIHggPj4gYml0czsKICAgIH0KCiAgICAvLyBHZXQgbGFzdCBuIGJpdHMgZnJvbSB4CiAgICBmdW5jdGlvbiBnZXRMYXN0TkJpdHModWludDI1NiB4LCB1aW50MjU2IG4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NikKICAgIHsKICAgICAgICAvLyBFeGFtcGxlLCBsYXN0IDMgYml0cwogICAgICAgIC8vIHggICAgICAgID0gMTEwMSA9IDEzCiAgICAgICAgLy8gbWFzayAgICAgPSAwMTExID0gNwogICAgICAgIC8vIHggJiBtYXNrID0gMDEwMSA9IDUKICAgICAgICB1aW50MjU2IG1hc2sgPSAoMSA8PCBuKSAtIDE7CiAgICAgICAgcmV0dXJuIHggJiBtYXNrOwogICAgfQoKICAgIC8vIEdldCBsYXN0IG4gYml0cyBmcm9tIHggdXNpbmcgbW9kIG9wZXJhdG9yCiAgICBmdW5jdGlvbiBnZXRMYXN0TkJpdHNVc2luZ01vZCh1aW50MjU2IHgsIHVpbnQyNTYgbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIDEgPDwgbiA9IDIgKiogbgogICAgICAgIHJldHVybiB4ICUgKDEgPDwgbik7CiAgICB9CgogICAgLy8gR2V0IHBvc2l0aW9uIG9mIG1vc3Qgc2lnbmlmaWNhbnQgYml0CiAgICAvLyB4ID0gMTEwMCA9IDEyLCBtb3N0IHNpZ25pZmljYW50IGJpdCA9IDEwMDAsIHNvIHRoaXMgZnVuY3Rpb24gd2lsbCByZXR1cm4gMwogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgdWludDI1NiBpID0gMDsKICAgICAgICB3aGlsZSAoKHggPj49IDEpID4gMCkgewogICAgICAgICAgICArK2k7CiAgICAgICAgfQogICAgICAgIHJldHVybiBpOwogICAgfQoKICAgIC8vIEdldCBmaXJzdCBuIGJpdHMgZnJvbSB4CiAgICAvLyBsZW4gPSBsZW5ndGggb2YgYml0cyBpbiB4ID0gcG9zaXRpb24gb2YgbW9zdCBzaWduaWZpY2FudCBiaXQgb2YgeCwgKyAxCiAgICBmdW5jdGlvbiBnZXRGaXJzdE5CaXRzKHVpbnQyNTYgeCwgdWludDI1NiBuLCB1aW50MjU2IGxlbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2KQogICAgewogICAgICAgIC8vIEV4YW1wbGUKICAgICAgICAvLyB4ICAgICAgICA9IDExMTAgPSAxNCwgbiA9IDIsIGxlbiA9IDQKICAgICAgICAvLyBtYXNrICAgICA9IDExMDAgPSAxMgogICAgICAgIC8vIHggJiBtYXNrID0gMTEwMCA9IDEyCiAgICAgICAgdWludDI1NiBtYXNrID0gKCgxIDw8IG4pIC0gMSkgPDwgKGxlbiAtIG4pOwogICAgICAgIHJldHVybiB4ICYgbWFzazsKICAgIH0KfQo="},{fileName:"MostSignificantBitAssembly.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEFzc2VtYmx5IHsKICAgIGZ1bmN0aW9uIG1vc3RTaWduaWZpY2FudEJpdCh1aW50MjU2IHgpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBtc2IpCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNywgZ3QoeCwgMHhGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIC8vIG9yIGNhbiBiZSByZXBsYWNlZCB3aXRoIGFkZAogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg2LCBndCh4LCAweEZGRkZGRkZGRkZGRkZGRkYpKQogICAgICAgICAgICB4IDo9IHNocihmLCB4KQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg1LCBndCh4LCAweEZGRkZGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoNCwgZ3QoeCwgMHhGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoMywgZ3QoeCwgMHhGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDIsIGd0KHgsIDB4RikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDEsIGd0KHgsIDB4MykpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gZ3QoeCwgMHgxKQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgIH0KfQo="},{fileName:"MostSignificantBitFunction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEZ1bmN0aW9uIHsKICAgIC8vIEZpbmQgbW9zdCBzaWduaWZpY2FudCBiaXQgdXNpbmcgYmluYXJ5IHNlYXJjaAogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQyNTYgeCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IG1zYikKICAgIHsKICAgICAgICAvLyB4ID49IDIgKiogMTI4CiAgICAgICAgaWYgKHggPj0gMHgxMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTI4OwogICAgICAgICAgICBtc2IgKz0gMTI4OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogNjQKICAgICAgICBpZiAoeCA+PSAweDEwMDAwMDAwMDAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDY0OwogICAgICAgICAgICBtc2IgKz0gNjQ7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAzMgogICAgICAgIGlmICh4ID49IDB4MTAwMDAwMDAwKSB7CiAgICAgICAgICAgIHggPj49IDMyOwogICAgICAgICAgICBtc2IgKz0gMzI7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAxNgogICAgICAgIGlmICh4ID49IDB4MTAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMTY7CiAgICAgICAgICAgIG1zYiArPSAxNjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDgKICAgICAgICBpZiAoeCA+PSAweDEwMCkgewogICAgICAgICAgICB4ID4+PSA4OwogICAgICAgICAgICBtc2IgKz0gODsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDQKICAgICAgICBpZiAoeCA+PSAweDEwKSB7CiAgICAgICAgICAgIHggPj49IDQ7CiAgICAgICAgICAgIG1zYiArPSA0OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogMgogICAgICAgIGlmICh4ID49IDB4NCkgewogICAgICAgICAgICB4ID4+PSAyOwogICAgICAgICAgICBtc2IgKz0gMjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDEKICAgICAgICBpZiAoeCA+PSAweDIpIG1zYiArPSAxOwogICAgfQp9Cg=="}],hy=`
                  // SPDX-License-Identifier: MIT
                   pragma solidity ^0.8.24;
                   
                   contract BitwiseOps {
                  @@ -3629,7 +3629,7 @@ Each slot in the array can store 32 bytes.

                  } } } -
                  `,Iy=({prev:s,next:a})=>r.jsx(u,{version:oy,title:ry,description:iy,html:hy,prev:s,next:a,codes:gy}),dy="0.8.24",Cy="Call",jy="In Solidity call is a low level function to interact with other contracts",uy=[{fileName:"Call.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFJlY2VpdmVyIHsKICAgIGV2ZW50IFJlY2VpdmVkKGFkZHJlc3MgY2FsbGVyLCB1aW50MjU2IGFtb3VudCwgc3RyaW5nIG1lc3NhZ2UpOwoKICAgIGZhbGxiYWNrKCk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3RyaW5nLHVpbnQyNTYpIiwgImNhbGwgZm9vIiwgMTIzKSk7CgogICAgICAgIGVtaXQgUmVzcG9uc2Uoc3VjY2VzcywgZGF0YSk7CiAgICB9CgogICAgLy8gQ2FsbGluZyBhIGZ1bmN0aW9uIHRoYXQgZG9lcyBub3QgZXhpc3QgdHJpZ2dlcnMgdGhlIGZhbGxiYWNrIGZ1bmN0aW9uLgogICAgZnVuY3Rpb24gdGVzdENhbGxEb2VzTm90RXhpc3QoYWRkcmVzcyBwYXlhYmxlIF9hZGRyKSBwdWJsaWMgcGF5YWJsZSB7CiAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IGRhdGEpID0gX2FkZHIuY2FsbHt2YWx1ZTogbXNnLnZhbHVlfSgKICAgICAgICAgICAgYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoImRvZXNOb3RFeGlzdCgpIikKICAgICAgICApOwoKICAgICAgICBlbWl0IFJlc3BvbnNlKHN1Y2Nlc3MsIGRhdGEpOwogICAgfQp9Cg=="}],Ay=`

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

                  +`,Iy=({prev:s,next:a})=>r.jsx(A,{version:oy,title:ry,description:iy,html:hy,prev:s,next:a,codes:gy}),dy="0.8.24",Cy="Call",jy="In Solidity call is a low level function to interact with other contracts",Ay=[{fileName:"Call.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFJlY2VpdmVyIHsKICAgIGV2ZW50IFJlY2VpdmVkKGFkZHJlc3MgY2FsbGVyLCB1aW50MjU2IGFtb3VudCwgc3RyaW5nIG1lc3NhZ2UpOwoKICAgIGZhbGxiYWNrKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgZW1pdCBSZWNlaXZlZChtc2cuc2VuZGVyLCBtc2cudmFsdWUsICJGYWxsYmFjayB3YXMgY2FsbGVkIik7CiAgICB9CgogICAgZnV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1bmN0aW9uIHRoYXQgZG9lcyBub3QgZXhpc3QgdHJpZ2dlcnMgdGhlIGZhbGxiYWNrIGZ1bmN0aW9uLgogICAgZnVuY3Rpb24gdGVzdENhbGxEb2VzTm90RXhpc3QoYWRkcmVzcyBwYXlhYmxlIF9hZGRyKSBwdWJsaWMgcGF5YWJsZSB7CiAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IGRhdGEpID0gX2FkZHIuY2FsbHt2YWx1ZTogbXNnLnZhbHVlfSgKICAgICAgICAgICAgYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoImRvZXNOb3RFeGlzdCgpIikKICAgICAgICApOwoKICAgICAgICBlbWl0IFJlc3BvbnNlKHN1Y2Nlc3MsIGRhdGEpOwogICAgfQp9Cg=="}],uy=`

                  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

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

                  emit Response(success, data); } } -`,yy=({prev:s,next:a})=>r.jsx(u,{version:dy,title:Cy,description:jy,html:Ay,prev:s,next:a,codes:uy}),my="0.8.24",by="Calling Other Contract",wy="In Solidity, contract can call other contracts in several ways",ky=[{fileName:"CallingContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENhbGxlZSB7CiAgICB1aW50MjU2IHB1YmxpYyB4OwogICAgdWludDI1NiBwdWJsaWMgdmFsdWU7CgogICAgZnVuY3Rpb24gc2V0WCh1aW50MjU2IF94KSBwdWJsaWMgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHggPSBfeDsKICAgICAgICByZXR1cm4geDsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYYW5kU2VuZEV0aGVyKHVpbnQyNTYgX3gpCiAgICAgICAgcHVibGljCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYsIHVpbnQyNTYpCiAgICB7CiAgICAgICAgeCA9IF94OwogICAgICAgIHZhbHVlID0gbXNnLnZhbHVlOwoKICAgICAgICByZXR1cm4gKHgsIHZhbHVlKTsKICAgIH0KfQoKY29udHJhY3QgQ2FsbGVyIHsKICAgIGZ1bmN0aW9uIHNldFgoQ2FsbGVlIF9jYWxsZWUsIHVpbnQyNTYgX3gpIHB1YmxpYyB7CiAgICAgICAgdWludDI1NiB4ID0gX2NhbGxlZS5zZXRYKF94KTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYRnJvbUFkZHJlc3MoYWRkcmVzcyBfYWRkciwgdWludDI1NiBfeCkgcHVibGljIHsKICAgICAgICBDYWxsZWUgY2FsbGVlID0gQ2FsbGVlKF9hZGRyKTsKICAgICAgICBjYWxsZWUuc2V0WChfeCk7CiAgICB9CgogICAgZnVuY3Rpb24gc2V0WGFuZFNlbmRFdGhlcihDYWxsZWUgX2NhbGxlZSwgdWludDI1NiBfeCkgcHVibGljIHBheWFibGUgewogICAgICAgICh1aW50MjU2IHgsIHVpbnQyNTYgdmFsdWUpID0KICAgICAgICAgICAgX2NhbGxlZS5zZXRYYW5kU2VuZEV0aGVye3ZhbHVlOiBtc2cudmFsdWV9KF94KTsKICAgIH0KfQo="}],Zy=`

                  Contract can call other contracts in 2 ways.

                  +`,yy=({prev:s,next:a})=>r.jsx(A,{version:dy,title:Cy,description:jy,html:uy,prev:s,next:a,codes:Ay}),my="0.8.24",by="Calling Other Contract",wy="In Solidity, contract can call other contracts in several ways",ky=[{fileName:"CallingContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENhbGxlZSB7CiAgICB1aW50MjU2IHB1YmxpYyB4OwogICAgdWludDI1NiBwdWJsaWMgdmFsdWU7CgogICAgZnVuY3Rpb24gc2V0WCh1aW50MjU2IF94KSBwdWJsaWMgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHggPSBfeDsKICAgICAgICByZXR1cm4geDsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYYW5kU2VuZEV0aGVyKHVpbnQyNTYgX3gpCiAgICAgICAgcHVibGljCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYsIHVpbnQyNTYpCiAgICB7CiAgICAgICAgeCA9IF94OwogICAgICAgIHZhbHVlID0gbXNnLnZhbHVlOwoKICAgICAgICByZXR1cm4gKHgsIHZhbHVlKTsKICAgIH0KfQoKY29udHJhY3QgQ2FsbGVyIHsKICAgIGZ1bmN0aW9uIHNldFgoQ2FsbGVlIF9jYWxsZWUsIHVpbnQyNTYgX3gpIHB1YmxpYyB7CiAgICAgICAgdWludDI1NiB4ID0gX2NhbGxlZS5zZXRYKF94KTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYRnJvbUFkZHJlc3MoYWRkcmVzcyBfYWRkciwgdWludDI1NiBfeCkgcHVibGljIHsKICAgICAgICBDYWxsZWUgY2FsbGVlID0gQ2FsbGVlKF9hZGRyKTsKICAgICAgICBjYWxsZWUuc2V0WChfeCk7CiAgICB9CgogICAgZnVuY3Rpb24gc2V0WGFuZFNlbmRFdGhlcihDYWxsZWUgX2NhbGxlZSwgdWludDI1NiBfeCkgcHVibGljIHBheWFibGUgewogICAgICAgICh1aW50MjU2IHgsIHVpbnQyNTYgdmFsdWUpID0KICAgICAgICAgICAgX2NhbGxlZS5zZXRYYW5kU2VuZEV0aGVye3ZhbHVlOiBtc2cudmFsdWV9KF94KTsKICAgIH0KfQo="}],Zy=`

                  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.

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

                  _callee.setXandSendEther{value: msg.value}(_x); } } -`,Wy=({prev:s,next:a})=>r.jsx(u,{version:my,title:by,description:wy,html:Zy,prev:s,next:a,codes:ky}),By="0.8.24",Gy="Constants",Vy="Constant variables",fy=[{fileName:"Constants.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENvbnN0YW50cyB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBjb25zdGFudCBNWV9BRERSRVNTID0KICAgICAgICAweDc3Nzc4ODg4OTk5OUFhQUFiQmJiQ2NjY2RkRGRlZWVFZkZGZkNjQ2M7CiAgICB1aW50MjU2IHB1YmxpYyBjb25zdGFudCBNWV9VSU5UID0gMTIzOwp9Cg=="}],Yy=`

                  Constants are variables that cannot be modified.

                  +`,Wy=({prev:s,next:a})=>r.jsx(A,{version:my,title:by,description:wy,html:Zy,prev:s,next:a,codes:ky}),By="0.8.24",Gy="Constants",Vy="Constant variables",fy=[{fileName:"Constants.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENvbnN0YW50cyB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBjb25zdGFudCBNWV9BRERSRVNTID0KICAgICAgICAweDc3Nzc4ODg4OTk5OUFhQUFiQmJiQ2NjY2RkRGRlZWVFZkZGZkNjQ2M7CiAgICB1aW50MjU2IHB1YmxpYyBjb25zdGFudCBNWV9VSU5UID0gMTIzOwp9Cg=="}],Yy=`

                  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.24;
                  @@ -3737,7 +3737,7 @@ Each slot in the array can store 32 bytes.

                  0x777788889999AaAAbBbbCcccddDdeeeEfFFfCcCc; uint256 public constant MY_UINT = 123; } -
                  `,Ry=({prev:s,next:a})=>r.jsx(u,{version:By,title:Gy,description:Vy,html:Yy,prev:s,next:a,codes:fy}),Xy="0.8.24",vy="Constructor",Ny="Learn how to initialize smart contracts in Solidity using a constructor",Hy=[{fileName:"Constructor.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIEJhc2UgY29udHJhY3QgWApjb250cmFjdCBYIHsKICAgIHN0cmluZyBwdWJsaWMgbmFtZTsKCiAgICBjb25zdHJ1Y3RvcihzdHJpbmcgbWVtb3J5IF9uYW1lKSB7CiAgICAgICAgbmFtZSA9IF9uYW1lOwogICAgfQp9CgovLyBCYXNlIGNvbnRyYWN0IFkKY29udHJhY3QgWSB7CiAgICBzdHJpbmcgcHVibGljIHRleHQ7CgogICAgY29uc3RydWN0b3Ioc3RyaW5nIG1lbW9yeSBfdGV4dCkgewogICAgICAgIHRleHQgPSBfdGV4dDsKICAgIH0KfQoKLy8gVGhlcmUgYXJlIDIgd2F5cyB0byBpbml0aWFsaXplIHBhcmVudCBjb250cmFjdCB3aXRoIHBhcmFtZXRlcnMuCgovLyBQYXNzIHRoZSBwYXJhbWV0ZXJzIGhlcmUgaW4gdGhlIGluaGVyaXRhbmNlIGxpc3QuCmNvbnRyYWN0IEIgaXMgWCgiSW5wdXQgdG8gWCIpLCBZKCJJbnB1dCB0byBZIikge30KCmNvbnRyYWN0IEMgaXMgWCwgWSB7CiAgICAvLyBQYXNzIHRoZSBwYXJhbWV0ZXJzIGhlcmUgaW4gdGhlIGNvbnN0cnVjdG9yLAogICAgLy8gc2ltaWxhciB0byBmdW5jdGlvbiBtb2RpZmllcnMuCiAgICBjb25zdHJ1Y3RvcihzdHJpbmcgbWVtb3J5IF9uYW1lLCBzdHJpbmcgbWVtb3J5IF90ZXh0KSBYKF9uYW1lKSBZKF90ZXh0KSB7fQp9CgovLyBQYXJlbnQgY29uc3RydWN0b3JzIGFyZSBhbHdheXMgY2FsbGVkIGluIHRoZSBvcmRlciBvZiBpbmhlcml0YW5jZQovLyByZWdhcmRsZXNzIG9mIHRoZSBvcmRlciBvZiBwYXJlbnQgY29udHJhY3RzIGxpc3RlZCBpbiB0aGUKLy8gY29uc3RydWN0b3Igb2YgdGhlIGNoaWxkIGNvbnRyYWN0LgoKLy8gT3JkZXIgb2YgY29uc3RydWN0b3JzIGNhbGxlZDoKLy8gMS4gWAovLyAyLiBZCi8vIDMuIEQKY29udHJhY3QgRCBpcyBYLCBZIHsKICAgIGNvbnN0cnVjdG9yKCkgWCgiWCB3YXMgY2FsbGVkIikgWSgiWSB3YXMgY2FsbGVkIikge30KfQoKLy8gT3JkZXIgb2YgY29uc3RydWN0b3JzIGNhbGxlZDoKLy8gMS4gWAovLyAyLiBZCi8vIDMuIEUKY29udHJhY3QgRSBpcyBYLCBZIHsKICAgIGNvbnN0cnVjdG9yKCkgWSgiWSB3YXMgY2FsbGVkIikgWCgiWCB3YXMgY2FsbGVkIikge30KfQo="}],Fy=`

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

                  +`,Ry=({prev:s,next:a})=>r.jsx(A,{version:By,title:Gy,description:Vy,html:Yy,prev:s,next:a,codes:fy}),Xy="0.8.24",vy="Constructor",Ny="Learn how to initialize smart contracts in Solidity using a constructor",Hy=[{fileName:"Constructor.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIEJhc2UgY29udHJhY3QgWApjb250cmFjdCBYIHsKICAgIHN0cmluZyBwdWJsaWMgbmFtZTsKCiAgICBjb25zdHJ1Y3RvcihzdHJpbmcgbWVtb3J5IF9uYW1lKSB7CiAgICAgICAgbmFtZSA9IF9uYW1lOwogICAgfQp9CgovLyBCYXNlIGNvbnRyYWN0IF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lZDoKLy8gMS4gWAovLyAyLiBZCi8vIDMuIEUKY29udHJhY3QgRSBpcyBYLCBZIHsKICAgIGNvbnN0cnVjdG9yKCkgWSgiWSB3YXMgY2FsbGVkIikgWCgiWCB3YXMgY2FsbGVkIikge30KfQo="}],Fy=`

                  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.24;
                  @@ -3790,7 +3790,7 @@ Each slot in the array can store 32 bytes.

                  contract E is X, Y { constructor() Y("Y was called") X("X was called") {} } -
                  `,Ky=({prev:s,next:a})=>r.jsx(u,{version:Xy,title:vy,description:Ny,html:Fy,prev:s,next:a,codes:Hy}),My="0.8.24",Sy="Data Locations - Storage, Memory and Calldata",xy="Data locations - storage, memory and calldata",Jy=[{fileName:"DataLocations.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IERhdGFMb2NhdGlvbnMgewogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CiAgICBtYXBwaW5nKHVpbnQyNTYgPT4gYWRkcmVzcykgbWFwOwoKICAgIHN0cnVjdCBNeVN0cnVjdCB7CiAgICAgICAgdWludDI1NiBmb287CiAgICB9CgogICAgbWFwcGluZyh1aW50MjU2ID0+IE15U3RydWN0KSBteVN0cnVjdHM7CgogICAgZnVuY3Rpb24gZigpIHB1YmxpYyB7CiAgICAgICAgLy8gY2FsbCBfZiB3aXRoIHN0YXRlIHZhcmlhYmxlcwogICAgICAgIF9mKGFyciwgbWFwLCBteVN0cnVjdHNbMV0pOwoKICAgICAgICAvLyBnZXQgYSBzdHJ1Y3QgZnJvbSBhIG1hcHBpbmcKICAgICAgICBNeVN0cnVjdCBzdG9yYWdlIG15U3RydWN0ID0gbXlTdHJ1Y3RzWzFdOwogICAgICAgIC8vIGNyZWF0ZSBhIHN0cnVjdCBpbiBtZW1vcnkKICAgICAgICBNeVN0cnVjdCBtZW1vcnkgbXlNZW1TdHJ1Y3QgPSBNeVN0cnVjdCgwKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfZigKICAgICAgICB1aW50MjU2W10gc3RvcmFnZSBfYXJyLAogICAgICAgIG1hcHBpbmcodWludDI1NiA9PiBhZGRyZXNzKSBzdG9yYWdlIF9tYXAsCiAgICAgICAgTXlTdHJ1Y3Qgc3RvcmFnZSBfbXlTdHJ1Y3QKICAgICkgaW50ZXJuYWwgewogICAgICAgIC8vIGRvIHNvbWV0aGluZyB3aXRoIHN0b3JhZ2UgdmFyaWFibGVzCiAgICB9CgogICAgLy8gWW91IGNhbiByZXR1cm4gbWVtb3J5IHZhcmlhYmxlcwogICAgZnVuY3Rpb24gZyh1aW50MjU2W10gbWVtb3J5IF9hcnIpIHB1YmxpYyByZXR1cm5zICh1aW50MjU2W10gbWVtb3J5KSB7CiAgICAgICAgLy8gZG8gc29tZXRoaW5nIHdpdGggbWVtb3J5IGFycmF5CiAgICB9CgogICAgZnVuY3Rpb24gaCh1aW50MjU2W10gY2FsbGRhdGEgX2FycikgZXh0ZXJuYWwgewogICAgICAgIC8vIGRvIHNvbWV0aGluZyB3aXRoIGNhbGxkYXRhIGFycmF5CiAgICB9Cn0K"}],zy=`

                  Variables are declared as either storage, memory or calldata to explicitly +`,Ky=({prev:s,next:a})=>r.jsx(A,{version:Xy,title:vy,description:Ny,html:Fy,prev:s,next:a,codes:Hy}),My="0.8.24",Sy="Data Locations - Storage, Memory and Calldata",xy="Data locations - storage, memory and calldata",Jy=[{fileName:"DataLocations.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IERhdGFMb2NhdGlvbnMgewogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CiAgICBtYXBwaW5nKHVpbnQyNTYgPT4gYWRkcmVzcykgbWFwOwoKICAgIHN0cnVjdCBN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FycmF5CiAgICB9Cn0K"}],zy=`

                  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)
                  • @@ -3837,7 +3837,7 @@ specify the location of the data.

                    // do something with calldata array } } -`,Dy=({prev:s,next:a})=>r.jsx(u,{version:My,title:Sy,description:xy,html:zy,prev:s,next:a,codes:Jy}),Ey="0.8.24",Qy="Chainlink Price Oracle",Ty="Chainlink Price Oracle",Uy=[{fileName:"Chainlink.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENoYWlubGlua1ByaWNlT3JhY2xlIHsKICAgIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSBpbnRlcm5hbCBwcmljZUZlZWQ7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgLy8gRVRIIC8gVVNECiAgICAgICAgcHJpY2VGZWVkID0KICAgICAgICAgICAgQWdncmVnYXRvclYzSW50ZXJmYWNlKDB4NWY0ZUMzRGY5Y2JkNDM3MTRGRTI3NDBmNUUzNjE2MTU1YzViODQxOSk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0TGF0ZXN0UHJpY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zIChpbnQyNTYpIHsKICAgICAgICAoCiAgICAgICAgICAgIHVpbnQ4MCByb3VuZElELAogICAgICAgICAgICBpbnQyNTYgcHJpY2UsCiAgICAgICAgICAgIHVpbnQyNTYgc3RhcnRlZEF0LAogICAgICAgICAgICB1aW50MjU2IHRpbWVTdGFtcCwKICAgICAgICAgICAgdWludDgwIGFuc3dlcmVkSW5Sb3VuZAogICAgICAgICkgPSBwcmljZUZlZWQubGF0ZXN0Um91bmREYXRhKCk7CiAgICAgICAgLy8gZm9yIEVUSCAvIFVTRCBwcmljZSBpcyBzY2FsZWQgdXAgYnkgMTAgKiogOAogICAgICAgIHJldHVybiBwcmljZSAvIDFlODsKICAgIH0KfQoKaW50ZXJmYWNlIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSB7CiAgICBmdW5jdGlvbiBsYXRlc3RSb3VuZERhdGEoKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKAogICAgICAgICAgICB1aW50ODAgcm91bmRJZCwKICAgICAgICAgICAgaW50MjU2IGFuc3dlciwKICAgICAgICAgICAgdWludDI1NiBzdGFydGVkQXQsCiAgICAgICAgICAgIHVpbnQyNTYgdXBkYXRlZEF0LAogICAgICAgICAgICB1aW50ODAgYW5zd2VyZWRJblJvdW5kCiAgICAgICAgKTsKfQo="}],_y=`

                    ETH / USD Price Oracle

                    +`,Dy=({prev:s,next:a})=>r.jsx(A,{version:My,title:Sy,description:xy,html:zy,prev:s,next:a,codes:Jy}),Ey="0.8.24",Qy="Chainlink Price Oracle",Ty="Chainlink Price Oracle",Uy=[{fileName:"Chainlink.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENoYWlubGlua1ByaWNlT3JhY2xlIHsKICAgIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSBpbnRlcm5hbCBwcmljZUZlZWQ7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgLy8gRVRIIC8gVVNECiAgICAgICAgcHJpY2VGZWVkID0KICAgICAgICAgICAgQWdncmVnYXRvclYzSW50ZXJmYWNlKDB4NWY0ZUMzRGY5Y2JkNDM3MTRGRTI3NDBmNUUzNjE2MTU1YzViODQxOSk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0TGF0ZXN0UHJpY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zIChpbnQyNTYpIHsKICAgICAgICAoCiAgICAgICAgICAgIHVpbnQ4MCByb3VuZElELAogICAgICAgICAgICBpbnQyNTYgcHJpY2UsCiAgICAgICAgICAgIHVpbnQyNTYgc3RhcnRlZEF0LAogICAgICAgICAgICB1aW50MjU2IHRpbWVTdGFtcCwKICAgICAgICAgICAgdWludDgwIGFuc3dlcmVkSW5Sb3VuZAogICAgICAgICkgPSBwcmljZUZlZWQubGF0ZXN0Um91bmREYXRhKCk7CiAgICAgICAgLy8gZm9yIEVUSCAvIFVTRCBwcmljZSBpcyBzY2FsZWQgdXAgYnkgMTAgKiogOAogICAgICAgIHJldHVybiBwcmljZSAvIDFlODsKICAgIH0KfQoKaW50ZXJmYWNlIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSB7CiAgICBmdW5jdGlvbiBsYXRlc3RSb3VuZERhdGEoKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKAogICAgICAgICAgICB1aW50ODAgcm91bmRJZCwKICAgICAgICAgICAgaW50MjU2IGFuc3dlciwKICAgICAgICAgICAgdWludDI1NiBzdGFydGVkQXQsCiAgICAgICAgICAgIHVpbnQyNTYgdXBkYXRlZEF0LAogICAgICAgICAgICB1aW50ODAgYW5zd2VyZWRJblJvdW5kCiAgICAgICAgKTsKfQo="}],_y=`

                    ETH / USD Price Oracle

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

                    uint80 answeredInRound ); } -
                    `,Ly=({prev:s,next:a})=>r.jsx(u,{version:Ey,title:Qy,description:Ty,html:_y,prev:s,next:a,codes:Uy}),Oy="0.8.24",Py="Constant Product AMM",$y="Constant product AMM",qy=[{fileName:"CPAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENQQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50MjU2IHB1YmxpYyByZXNlcnZlMD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c3ModG9rZW4xKSwKICAgICAgICAgICAgImludmFsaWQgdG9rZW4iCiAgICAgICAgKTsKICAgICAgICByZXF1aXJlKF9hbW91bnRJbiA+IDAsICJhbW91bnQgaW4gPSAwIik7CgogICAgICAgIGJvb2wgaXNUb2tlbjAgPSBfdG9rZW5JbiA9PSBhZGRyZXNzKHRva2VuMCk7CiAgICAgICAgKElFUkMyMCB0b2tlbkluLCBJRVJDMjAgdG9rZW5PdXQsIHVpbnQyNTYgcmVzZXJ2ZUluLCB1aW50MjU2IHJlc2VydmVPdXQpCiAgICAgICAgPSBpc1Rva2VuMAogICAgICAgICAgICA/ICh0b2tlbjAsIHRva2VuMSwgcmVzZXJ2ZTAsIHJlc2VydmUxKQogICAgICAgICAgICA6ICh0b2tlbjEsIHRva2VuMCwgcmVzZXJ2ZTEsIHJlc2VydmUwKTsKCiAgICAgICAgdG9rZW5Jbi50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudEluKTsKCiAgICAgICAgLyoKICAgICAgICBIb3cgbXVjaCBkeSBmb3IgZHg/CgogICAgICAgIHh5ID0gawogICAgICAgICh4ICsgZHgpKHkgLSBkeSkgPSBrCiAgICAgICAgeSAtIGR5ID0gayAvICh4ICsgZHgpCiAgICAgICAgeSAtIGsgLyAoeCArIGR4KSA9IGR5CiAgICAgICAgeSAtIHh5IC8gKHggKyBkeCkgPSBkeQogICAgICAgICh5eCArIHlkeCAtIHh5KSAvICh4ICsgZHgpID0gZHkKICAgICAgICB5ZHggLyAoeCArIGR4KSA9IGR5CiAgICAgICAgKi8KICAgICAgICAvLyAwLjMlIGZlZQogICAgICAgIHVpbnQyNTYgYW1vdW50SW5XaXRoRmVlID0gKF9hbW91bnRJbiAqIDk5NykgLyAxMDAwOwogICAgICAgIGFtb3VudE91dCA9CiAgICAgICAgICAgIChyZXNlcnZlT3V0ICogYW1vdW50SW5XaXRoRmVlKSAvIChyZXNlcnZlSW4gKyBhbW91bnRJbldpdGhGZWUpOwoKICAgICAgICB0b2tlbk91dC50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnRPdXQpOwoKICAgICAgICBfdXBkYXRlKAogICAgICAgICAgICB0b2tlbjAuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpLCB0b2tlbjEuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiBhZGRMaXF1aWRpdHkodWludDI1NiBfYW1vdW50MCwgdWludDI1NiBfYW1vdW50MSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgc2hhcmVzKQogICAgewogICAgICAgIHRva2VuMC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDEpOwoKICAgICAgICAvKgogICAgICAgIEhvdyBtdWNoIGR4LCBkeSB0byBhZGQ/CgogICAgICAgIHh5ID0gawogICAgICAgICh4ICsgZHgpKHkgKyBkeSkgPSBrJwoKICAgICAgICBObyBwcmljZSBjaGFuZ2UsIGJlZm9yZSBhbmQgYWZ0ZXIgYWRkaW5nIGxpcXVpZGl0eQogICAgICAgIHggLyB5ID0gKHggKyBkeCkgLyAoeSArIGR5KQoKICAgICAgICB4KHkgKyBkeSkgPSB5KHggKyBkeCkKICAgICAgICB4ICogZHkgPSB5ICogZHgKCiAgICAgICAgeCAvIHkgPSBkeCAvIGR5CiAgICAgICAgZHkgPSB5IC8geCAqIGR4CiAgICAgICAgKi8KICAgICAgICBpZiAocmVzZXJ2ZTAgPiAwIHx8IHJlc2VydmUxID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgcmVzZXJ2ZTAgKiBfYW1vdW50MSA9PSByZXNlcnZlMSAqIF9hbW91bnQwLCAieCAv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XF1YXRpb24gMiA9IChzcXJ0KHheMnkgKyAyeHlkeCArIGR4XjIgKiB5KSAtIHNxcnQoeF4yeSkpIC8gc3FydCh4XjJ5KQogICAgICAgICAgICAgICAgICAgPSAoc3FydCh5KShzcXJ0KHheMiArIDJ4ZHggKyBkeF4yKSAtIHNxcnQoeF4yKSkgLyAoc3FydCh5KXNxcnQoeF4yKSkKICAgICAgICAKICAgICAgICBzcXJ0KHkpIG9uIHRvcCBhbmQgYm90dG9tIGNhbmNlbHMgb3V0CgogICAgICAgIC0tLSBFcXVhdGlvbiAzIC0tLQogICAgICAgIEVxdWF0aW9uIDIgPSAoc3FydCh4XjIgKyAyeGR4ICsgZHheMikgLSBzcXJ0KHheMikpIC8gKHNxcnQoeF4yKQogICAgICAgID0gKHNxcnQoKHggKyBkeCleMikgLSBzcXJ0KHheMikpIC8gc3FydCh4XjIpICAKICAgICAgICA9ICgoeCArIGR4KSAtIHgpIC8geAogICAgICAgID0gZHggLyB4CgogICAgICAgIFNpbmNlIGR4IC8gZHkgPSB4IC8geSwKICAgICAgICBkeCAvIHggPSBkeSAvIHkKCiAgICAgICAgRmluYWxseQogICAgICAgIChMMSAtIEwwKSAvIEwwID0gZHggLyB4ID0gZHkgLyB5CiAgICAgICAgKi8KICAgICAgICBpZiAodG90YWxTdXBwbHkgPT0gMCkgewogICAgICAgICAgICBzaGFyZXMgPSBfc3FydChfYW1vdW50MCAqIF9hbW91bnQxKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBzaGFyZXMgPSBfbWluKAogICAgICAgICAgICAgICAgKF9hbW91bnQwICogdG90YWxTdXBwbHkpIC8gcmVzZXJ2ZTAsCiAgICAgICAgICAgICAgICAoX2Ftb3VudDEgKiB0b3RhbFN1cHBseSkgLyByZXNlcnZlMQogICAgICAgICAgICApOwogICAgICAgIH0KICAgICAgICByZXF1aXJlKHNoYXJlcyA+IDAsICJzaGFyZXMgPSAwIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2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geCkKCiAgICAgICAgRGl2aWRlIGJvdGggc2lkZXMgb2YgRXF1YXRpb24gMSB3aXRoIHNxcnQoeSAvIHgpCiAgICAgICAgZHggPSBzIC8gVCAqIHNxcnQoeHkpIC8gc3FydCh5IC8geCkKICAgICAgICAgICA9IHMgLyBUICogc3FydCh4XjIpID0gcyAvIFQgKiB4CgogICAgICAgIExpa2V3aXNlCiAgICAgICAgZHkgPSBzIC8gVCAqIHkKICAgICAgICAqLwoKICAgICAgICAvLyBiYWwwID49IHJlc2VydmUwCiAgICAgICAgLy8gYmFsMSA+PSByZXNlcnZlMQogICAgICAgIHVpbnQyNTYgYmFsMCA9IHRva2VuMC5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CiAgICAgICAgdWludDI1NiBiYWwxID0gdG9rZW4xLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKTsKCiAgICAgICAgYW1vdW50MCA9IChfc2hhcmVzICogYmFsMCkgLyB0b3RhbFN1cHBseTsKICAgICAgICBhbW91bnQxID0gKF9zaGFyZXMgKiBiYWwxKSAvIHRvdGFsU3VwcGx5OwogICAgICAgIHJlcXVpcmUoYW1vdW50MCA+IDAgJiYgYW1vdW50MSA+IDAsICJhbW91bnQwIG9yIGFtb3VudDEgPSAwIik7CgogICAgICAgIF9idXJuKG1zZy5zZW5kZXIsIF9zaGFyZXMpOwogICAgICAgIF91cGRhdGUoYmFsMCAtIGFtb3VudDAsIGJhbDEgLSBhbW91bnQxKTsKCiAgICAgICAgdG9rZW4wLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnQxKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfc3FydCh1aW50MjU2IHkpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBpZiAoeSA+IDMpIHsKICAgICAgICAgICAgeiA9IHk7CiAgICAgICAgICAgIHVpbnQyNTYgeCA9IHkgLyAyICsgMTsKICAgICAgICAgICAgd2hpbGUgKHggPCB6KSB7CiAgICAgICAgICAgICAgICB6ID0geDsKICAgICAgICAgICAgICAgIHggPSAoeSAvIHggKyB4KSAvIDI7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgaWYgKHkgIT0gMCkgewogICAgICAgICAgICB6ID0gMTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX21pbih1aW50MjU2IHgsIHVpbnQyNTYgeSkgcHJpdmF0ZSBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4geCA8PSB5ID8geCA6IHk7CiAgICB9Cn0KCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcyBzZW5kZXIsIGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwp9Cg=="}],sm=`

                    Constant product AMM XY = K

                    +`,Ly=({prev:s,next:a})=>r.jsx(A,{version:Ey,title:Qy,description:Ty,html:_y,prev:s,next:a,codes:Uy}),Oy="0.8.24",Py="Constant Product AMM",$y="Constant product AMM",qy=[{fileName:"CPAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENQQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50MjU2IHB1YmxpYyByZXNlcnZlMDsKICAgIHVpbnQyNTYgcHVibGljIHJlc2VydmUxOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4wLCBhZGRyZXNzIF90b2tlbjEpIHsKICAgICAgICB0b2tlbjAgPSBJRVJDMjAoX3Rva2VuMCk7CiAgICAgICAgdG9rZW4xID0gSUVSQzIwKF90b2tlbjEpOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgX3RvLCB1aW50MjU2IF9hbW91bnQpIHByaXZhdGUgewogICAgICAgIGJhbGFuY2VPZltfdG9dICs9IF9hbW91bnQ7CiAgICAgICAgdG90YWxTdXBwbHkgKz0gX2Ftb3VudDsKICAgIH0KCiAgICBmdW5jdGlvbiBfYnVybihhZGRyZXNzIF9mcm9tLCB1aW50MjU2IF9hbW91bnQpIHByaXZhdGUgewogICAgICAgIGJhbGFuY2VPZltfZnJvbV0gLT0gX2Ftb3VudDsKICAgICAgICB0b3RhbFN1cHBseSAtPSBfYW1vdW50OwogICAgfQoKICAgIGZ1b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AtIGR5ID0gayAvICh4ICsgZHgpCiAgICAgICAgeSAtIGsgLyAoeCArIGR4KSA9IGR5CiAgICAgICAgeSAtIHh5IC8gKHggKyBkeCkgPSBkeQogICAgICAgICh5eCArIHlkeCAtIHh5KSAvICh4ICsgZHgpID0gZHkKICAgICAgICB5ZHggLyAoeCArIGR4KSA9IGR5CiAgICAgICAgKi8KICAgICAgICAvLyAwLjMlIGZlZQogICAgICAgIHVpbnQyNTYgYW1vdW50SW5XaXRoRmVlID0gKF9hbW91bnRJbiAqIDk5NykgLyAxMDAwOwogICAgICAgIGFtb3VudE91dCA9CiAgICAgICAgICAgIChyZXNlcnZlT3V0ICogYW1vdW50SW5XaXRoRmVlKSAvIChyZXNlcnZlSW4gKyBhbW91bnRJbldpdGhGZWUpOwoKICAgICAgICB0b2tlbk91dC50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnRPdXQpOwoKICAgICAgICBfdXBkYXRlKAogICAgICAgICAgICB0b2tlbjAuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpLCB0b2tlbjEuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiBhZGRMaXF1aWRpdHkodWludDI1NiBfYW1vdW50MCwgdWludDI1NiBfYW1vdW50MSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgc2hhcmVzKQogICAgewogICAgICAgIHRva2VuMC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDEpOwoKICAgICAgICAvKgogICAgICAgIEhvdyBtdWNoIGR4LCBkeSB0byBhZGQ/CgogICAgICAgIHh5ID0gawogICAgICAgICh4ICsgZHgpKHkgKyBkeSkgPSBrJwoKICAgICAgICBObyBwcmljZSBjaGFuZ2UsIGJlZm9yZSBhbmQgYWZ0ZXIgYWRkaW5nIGxpcXVpZGl0eQogICAgICAgIHggLyB5ID0gKHggKyBkeCkgLyAoeSArIGR5KQoKICAgICAgICB4KHkgKyBkeSkgPSB5KHggKyBkeCkKICAgICAgICB4ICogZHkgPSB5ICogZHgKCiAgICAgICAgeCAvIHkgPSBkeCAvIGR5CiAgICAgICAgZHkgPSB5IC8geCAqIGR4CiAgICAgICAgKi8KICAgICAgICBpZiAocmVzZXJ2ZTAgPiAwIHx8IHJlc2VydmUxID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgcmVzZXJ2ZTAgKiBfYW1vdW50MSA9PSByZXNlcnZlMSAqIF9hbW91bnQwLCAieCAvIHkgIT0gZHggLyBkeSIKICAgICAgICAgICAgKTsKICAgICAgICB9CgogICAgICAgIC8qCiAgICAgICAgSG93IG11Y2ggc2hhcmVzIHRvIG1pbnQ/CgogICAgICAgIGYoeCwgeSkgPSB2YWx1ZSBvZiBsaXF1aWRpdHkKICAgICAgICBXZSB3aWxsIGRlZmluZSBmKHgsIHkpID0gc3FydCh4eSkKCiAgICAgICAgTDAgPSBmKHgsIHkpCiAgICAgICAgTDEgPSBmKHggKyBkeCwgeSArIGR5KQogICAgICAgIFQgPSB0b3RhbCBzaGFyZXMKICAgICAgICBzID0gc2hhcmVzIHRvIG1pbnQKCiAgICAgICAgVG90YWwgc2hhcmVzIHNob3VsZCBpbmNyZWFzZSBwcm9wb3J0aW9uYWwgdG8gaW5jcmVhc2UgaW4gbGlxdWlkaXR5CiAgICAgICAgTDEgLyBMMCA9IChUICsgcykgLyBUCgogICAgICAgIEwxICogVCA9IEwwICogKFQgKyBzKQoKICAgICAgICAoTDEgLSBMMCkgKiBUIC8gTDAgPSBzIAogICAgICAgICovCgogICAgICAgIC8qCiAgICAgICAgQ2xhaW0KICAgICAgICAoTDEgLSBMMCkgLyBMMCA9IGR4IC8geCA9IGR5IC8geQoKICAgICAgICBQ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B5CiAgICAgICAgKi8KICAgICAgICBpZiAodG90YWxTdXBwbHkgPT0gMCkgewogICAgICAgICAgICBzaGFyZXMgPSBfc3FydChfYW1vdW50MCAqIF9hbW91bnQxKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBzaGFyZXMgPSBfbWluKAogICAgICAgICAgICAgICAgKF9hbW91bnQwICogdG90YWxTdXBwbHkpIC8gcmVzZXJ2ZTAsCiAgICAgICAgICAgICAgICAoX2Ftb3VudDEgKiB0b3RhbFN1cHBseSkgLyByZXNlcnZlMQogICAgICAgICAgICApOwogICAgICAgIH0KICAgICAgICByZXF1aXJlKHNoYXJlcyA+IDAsICJzaGFyZXMgPSAwIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2hhcmVzKTsKCiAgICAgICAgX3VwZGF0ZSgKICAgICAgICAgICAgdG9rZW4wLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKSwgdG9rZW4xLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVtb3ZlTGlxdWlkaXR5KHVpbnQyNTYgX3NoYXJlcykKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYW1vdW50MCwgdWludDI1NiBhbW91bnQxKQogICAgewogICAgICAgIC8qCiAgICAgICAgQ2xhaW0KICAgICAgICBkeCwgZHkgPSBhbW91bnQgb2YgbGlxdWlkaXR5IHRvIHJlbW92ZQogICAgICAgIGR4ID0gcyAvIFQgKiB4CiAgICAgICAgZHkgPSBzIC8gVCAqIHkKCiAgICAgICAgUHJvb2YKICAgICAgICBMZXQncyBmaW5kIGR4LCBkeSBzdWNoIHRoYXQKICAgICAgICB2IC8gTCA9IHMgLyBUCiAgICAgICAgCiAgICAgICAgd2hlcmUKICAgICAgICB2ID0gZihkeCwgZHkpID0gc3FydChkeGR5KQogICAgICAgIEwgPSB0b3RhbCBsaXF1aWRpdHkgPSBzcXJ0K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9yIGFtb3VudDEgPSAwIik7CgogICAgICAgIF9idXJuKG1zZy5zZW5kZXIsIF9zaGFyZXMpOwogICAgICAgIF91cGRhdGUoYmFsMCAtIGFtb3VudDAsIGJhbDEgLSBhbW91bnQxKTsKCiAgICAgICAgdG9rZW4wLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnQxKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfc3FydCh1aW50MjU2IHkpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBpZiAoeSA+IDMpIHsKICAgICAgICAgICAgeiA9IHk7CiAgICAgICAgICAgIHVpbnQyNTYgeCA9IHkgLyAyICsgMTsKICAgICAgICAgICAgd2hpbGUgKHggPCB6KSB7CiAgICAgICAgICAgICAgICB6ID0geDsKICAgICAgICAgICAgICAgIHggPSAoeSAvIHggKyB4KSAvIDI7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgaWYgKHkgIT0gMCkgewogICAgICAgICAgICB6ID0gMTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX21pbih1aW50MjU2IHgsIHVpbnQyNTYgeSkgcHJpdmF0ZSBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4geCA8PSB5ID8geCA6IHk7CiAgICB9Cn0KCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcyBzZW5kZXIsIGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwp9Cg=="}],sm=`

                    Constant product AMM XY = K

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

                    external returns (bool); } -
                    `,am=({prev:s,next:a})=>r.jsx(u,{version:Oy,title:Py,description:$y,html:sm,prev:s,next:a,codes:qy}),nm="0.8.24",lm="Constant Sum AMM",pm="Constant sum AMM",em=[{fileName:"CSAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENTQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50MjU2IHB1YmxpYyByZXNlcnZlMDsKICAgIHVpbnQyNTYgcHVibGljIHJlc2VydmUxOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcy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9vbCBpc1Rva2VuMCA9IF90b2tlbkluID09IGFkZHJlc3ModG9rZW4wKTsKCiAgICAgICAgKElFUkMyMCB0b2tlbkluLCBJRVJDMjAgdG9rZW5PdXQsIHVpbnQyNTYgcmVzSW4sIHVpbnQyNTYgcmVzT3V0KSA9CiAgICAgICAgaXNUb2tlbjAKICAgICAgICAgICAgPyAodG9rZW4wLCB0b2tlbjEsIHJlc2VydmUwLCByZXNlcnZlMSkKICAgICAgICAgICAgOiAodG9rZW4xLCB0b2tlbjAsIHJlc2VydmUxLCByZXNlcnZlMCk7CgogICAgICAgIHRva2VuSW4udHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIF9hbW91bnRJbik7CiAgICAgICAgdWludDI1NiBhbW91bnRJbiA9IHRva2VuSW4uYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpIC0gcmVzSW47CgogICAgICAgIC8vIDAuMyUgZmVlCiAgICAgICAgYW1vdW50T3V0ID0gKGFtb3VudEluICogOTk3KSAvIDEwMDA7CgogICAgICAgICh1aW50MjU2IHJlczAsIHVpbnQyNTYgcmVzMSkgPSBpc1Rva2VuMAogICAgICAgICAgICA/IChyZXNJbiArIGFtb3VudEluLCByZXNPdXQgLSBhbW91bnRPdXQpCiAgICAgICAgICAgIDogKHJlc091dCAtIGFtb3VudE91dCwgcmVzSW4gKyBhbW91bnRJbik7CgogICAgICAgIF91cGRhdGUocmVzMCwgcmVzMSk7CiAgICAgICAgdG9rZW5PdXQudHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50T3V0KTsKICAgIH0KCiAgICBmdW5jdGlvbiBhZGRMaXF1aWRpdHkodWludDI1NiBfYW1vdW50MCwgdWludDI1NiBfYW1vdW50MSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgc2hhcmVzKQogICAgewogICAgICAgIHRva2VuMC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDEpOwoKICAgICAgICB1aW50MjU2IGJhbDAgPSB0b2tlbjAuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwogICAgICAgIHVpbnQyNTYgYmFsMSA9IHRva2VuMS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CgogICAgICAgIHVpbnQyNTYgZDAgPSBiYWwwIC0gcmVzZXJ2ZTA7CiAgICAgICAgdWludDI1NiBkMSA9IGJhbDEgLSByZXNlcnZlMTsKCiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50IGluCiAgICAgICAgTCA9IHRvdGFsIGxpcXVpZGl0eQogICAgICAgIHMgPSBzaGFyZXMgdG8gbWludAogICAgICAgIFQgPSB0b3RhbCBzdXBwbHkKCiAgICAgICAgcyBzaG91bGQgYmUgcHJvcG9ydGlvbmFsIHRvIGluY3JlYXNlIGZyb20gTCB0byBMICsgYQogICAgICAgIChMICsgYSkgLyBMID0gKFQgKyBzKSAvIFQKCiAgICAgICAgcyA9IGEgKiBUIC8gTAogICAgICAgICovCiAgICAgICAgaWYgKHRvdGFsU3VwcGx5ID4gMCkgewogICAgICAgICAgICBzaGFyZXMgPSAoKGQwICsgZDEpICogdG90YWxTdXBwbHkpIC8gKHJlc2VydmUwICsgcmVzZXJ2ZTEpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHNoYXJlcyA9IGQwICsgZDE7CiAgICAgICAgfQoKICAgICAgICByZXF1aXJlKHNoYXJlcyA+IDAsICJzaGFyZXMgPSAwIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2hhcmVzKTsKCiAgICAgICAgX3VwZGF0ZShiYWwwLCBiYWwxKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkodWludDI1NiBfc2hhcmVzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NiBkMCwgdWludDI1NiBkMSkKICAgIHsKICAgICAgICAvKgogICAgICAgIGEgPSBhbW91bnQgb3V0CiAgICAgICAgTCA9IHRvdGFsIGxpcXVpZGl0eQogICAgICAgIHMgPSBzaGFyZXMKICAgICAgICBUID0gdG90YWwgc3VwcGx5CgogICAgICAgIGEgLyBMID0gcyAvIFQKCiAgICAgICAgYSA9IEwgKiBzIC8gVAogICAgICAgICAgPSAocmVzZXJ2ZTAgKyByZXNlcnZlMSkgKiBzIC8gVAogICAgICAgICovCiAgICAgICAgZDAgPSAocmVzZXJ2ZTAgKiBfc2hhcmVzKSAvIHRvdGFsU3VwcGx5OwogICAgICAgIGQxID0gKHJlc2VydmUxICogX3NoYXJlcykgLyB0b3RhbFN1cHBseTsKCiAgICAgICAgX2J1cm4obXNnLnNlbmRlciwgX3NoYXJlcyk7CiAgICAgICAgX3VwZGF0ZShyZXNlcnZlMCAtIGQwLCByZXNlcnZlMSAtIGQxKTsKCiAgICAgICAgaWYgKGQwID4gMCkgewogICAgICAgICAgICB0b2tlbjAudHJhbnNmZXIobXNnLnNlbmRlciwgZDApOwogICAgICAgIH0KICAgICAgICBpZiAoZDEgPiAwKSB7CiAgICAgICAgICAgIHRva2VuMS50cmFuc2Zlcihtc2cuc2VuZGVyLCBkMSk7CiAgICAgICAgfQogICAgfQp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGJhbGFuY2VPZihhZGRyZXNzIGFjY291bnQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKICAgIGZ1bmN0aW9uIGFsbG93YW5jZShhZGRyZXNzIG93bmVyLCBhZGRyZXNzIHNwZW5kZXIpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3Mgc2VuZGVyLCBhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKfQo="}],cm=`

                    Constant sum AMM X + Y = K

                    +`,am=({prev:s,next:a})=>r.jsx(A,{version:Oy,title:Py,description:$y,html:sm,prev:s,next:a,codes:qy}),nm="0.8.24",lm="Constant Sum AMM",pm="Constant sum AMM",em=[{fileName:"CSAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENTQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50MjU2IHB1YmxpYyByZXNlcnZlMDsKICAgIHVpbnQyNTYgcHVibGljIHJlc2VydmUxOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4wLCBhZGRyZXNzIF90b2tlbjEpIHsKICAgICAgICAvLyBOT1RFOiBUaGlzIGNvbnRyYWN0IGFzc3VtZXMgdGhhdCB0b2tlbjAgYW5kIHRva2VuMQogICAgICAgIC8vIGJvdGggaGF2ZSBzYW1lIGRlY2ltYWxzCiAgICAgICAgdG9rZW4wID0gSUVSQzIwKF90b2tlbjApOwogICAgICAgIHRva2VuMSA9IElFUkMyMChfdG9rZW4xKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfbWludChhZGRyZXNzIF90bywgdWludDI1NiBfYW1vdW50KSBwcml2YXRlIHsKICAgICAgICBiYWxhbmNlT2ZbX3RvXSArPSBfYW1vdW50OwogICAgICAgIHRvdGFsU3VwcGx5ICs9IF9hbW91bnQ7CiAgICB9CgogICAgZnVuY3Rpb24gX2J1cm4oYWRkcmVzcyBfZnJvbSwgdWludDI1NiBfYW1vdW50KSBwcml2YXRlIHsKICAgICAgICBiYWxhbmNlT2ZbX2Zyb21dIC09IF9hbW91bnQ7CiAgICAgICAgdG90YWxTdXBwbHkgLT0gX2Ftb3VudDsKICAgIH0KCiAgICBmdW5jdGlvbiBfdXBkYXRlKHVpbnQyNTYgX3JlczAsIHVpbnQyNTYgX3JlczEpIHByaXZhdGUgewogICAgICAgIHJlc2VydmUwID0gX3JlczA7CiAgICAgICAgcmVzZXJ2ZTEgPSBfcmVzMTsKICAgIH0KCiAgICBmdW5jdGlvbiBzd2FwKGFkZHJlc3MgX3Rva2VuSW4sIHVpbnQyNTYgX2Ftb3VudEluKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NiBhbW91bnRPdXQpCiAgICB7CiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgX3Rva2VuSW4gPT0gYWRkcmVzcyh0b2tlbjApIHx8IF90b2tlbkluID09IGFkZHJlc3ModG9rZW4xKSwKICAgICAgICAgICAgImludmFsaWQgdG9rZW4iCiAgICAgICAgKTsKCiAgICAgICAgYm9vbCBpc1Rva2VuMCA9IF90b2tlbkluID09IGFkZHJlc3ModG9rZW4wKTsKCiAgICAgICAgKElFUkMyMCB0b2tlbkluLCBJRVJDMjAgdG9rZW5PdXQsIHVpbnQyNTYgcmVzSW4sIHVpbnQyNTYgcmVzT3V0KSA9CiAgICAgICAgaXNUb2tlbjAKICAgICAgICAgICAgPyAodG9rZW4wLCB0b2tlbjEsIHJlc2VydmUwLCByZXNlcnZlMSkKICAgICAgICAgICAgOiAodG9rZW4xLCB0b2tlbjAsIHJlc2VydmUxLCByZXNlcnZlMCk7CgogICAgICAgIHRva2VuSW4udHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIF9hbW91bnRJbik7CiAgICAgICAgdWludDI1NiBhbW91bnRJbiA9IHRva2VuSW4uYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpIC0gcmVzSW47CgogICAgICAgIC8vIDAuMyUgZmVlCiAgICAgICAgYW1vdW50T3V0ID0gKGFtb3VudEluICogOTk3KSAvIDEwMDA7CgogICAgICAgICh1aW50MjU2IHJlczAsIHVpbnQyNTYgcmVzMSkgPSBpc1Rva2VuMAogICAgICAgICAgICA/IChyZXNJbiArIGFtb3VudEluLCByZXNPdXQgLSBhbW91bnRPdXQpCiAgICAgICAgICAgIDogKHJlc091dCAtIGFtb3VudE91dCwgcmVzSW4gKyBhbW91bnRJbik7CgogICAgICAgIF91cGRhdGUocmVzMCwgcmVzMSk7CiAgICAgICAgdG9rZW5PdXQudHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50T3V0KTsKICAgIH0KCiAgICBmdW5jdGlvbiBhZGRMaXF1aWRpdHkodWludDI1NiBfYW1vdW50MCwgdWludDI1NiBfYW1vdW50MSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgc2hhcmVzKQogICAgewogICAgICAgIHRva2VuMC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDEpOwoKICAgICAgICB1aW50MjU2IGJhbDAgPSB0b2tlbjAuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwogICAgICAgIHVpbnQyNTYgYmFsMSA9IHRva2VuMS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CgogICAgICAgIHVpbnQyNTYgZDAgPSBiYWwwIC0gcmVzZXJ2ZTA7CiAgICAgICAgdWludDI1NiBkMSA9IGJhbDEgLSByZXNlcnZlMTsKCiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50IGluCiAgICAgICAgTCA9IHRvdGFsIGxpcXVpZGl0eQogICAgICAgIHMgPSBzaGFyZXMgdG8gbWludAogICAgICAgIFQgPSB0b3RhbCBzdXBwbHkKCiAgICAgICAgcyBzaG91bGQgYmUgcHJvcG9ydGlvbmFsIHRvIGluY3JlYXNlIGZyb20gTCB0byBMICsgYQogICAgICAgIChMICsgYSkgLyBMID0gKFQgKyBzKSAvIFQKCiAgICAgICAgcyA9IGEgKiBUIC8gTAogICAgICAgICovCiAgICAgICAgaWYgKHRvdGFsU3VwcGx5ID4gMCkgewogICAgICAgICAgICBzaGFyZXMgPSAoKGQwICsgZDEpICogdG90YWxTdXBwbHkpIC8gKHJlc2VydmUwICsgcmVzZXJ2ZTEpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHNoYXJlcyA9IGQwICsgZDE7CiAgICAgICAgfQoKICAgICAgICByZXF1aXJlKHNoYXJlcyA+IDAsICJzaGFyZXMgPSAwIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2hhcmVzKTsKCiAgICAgICAgX3VwZGF0ZShiYWwwLCBiYWwxKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkodWludDI1NiBfc2hhcmVzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NiBkMCwgdWludDI1NiBkMSkKICAgIHsKICAgICAgICAvKgogICAgICAgIGEgPSBhbW91bnQgb3V0CiAgICAgICAgT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iAgICAgICAgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3Mgc2VuZGVyLCBhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKfQo="}],cm=`

                    Constant sum AMM X + Y = K

                    Tokens trade one to one.

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

                    external returns (bool); } -
                    `,tm=({prev:s,next:a})=>r.jsx(u,{version:nm,title:lm,description:pm,html:cm,prev:s,next:a,codes:em}),om="0.8.24",rm="DAI Proxy Examples",im="Borrow and repay DAI using DssProxy",gm=[{fileName:"DaiProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmFkZHJlc3MgY29uc3RhbnQgREFJID0gMHg2QjE3NTQ3NEU4OTA5NEM0NERhOThiOTU0RWVkZUFDNDk1MjcxZDBGOwphZGRyZXNzIGNvbnN0YW50IFBST1hZX1JFR0lTVFJZID0gMHg0Njc4ZjBhNjk1OGU0RDJCYzRGMUJBRjdCYzUyRThGMzU2NGYzZkU0OwphZGRyZXNzIGNvbnN0YW50IFBST1hZX0FDVElPTlMgPSAweDgyZWNEMTM1RGNlNjVGYmM2RGJkRDBlNDIzN0UwQUY5M0ZGRDUwMzg7CmFkZHJlc3MgY29uc3RhbnQgQ0RQX01BTkFHRVIgPSAweDVlZjMwYjk5ODYzNDUyNDliYzMyZDg5MjhCN2VlNjRERTk0MzVFMzk7CmFkZHJlc3MgY29uc3RhbnQgSlVHID0gMHgxOWMwOTc2ZjU5MEQ2N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udmFsdWV9KAogICAgICAgICAgICBQUk9YWV9BQ1RJT05TLAogICAgICAgICAgICBhYmkuZW5jb2RlQ2FsbCgKICAgICAgICAgICAgICAgIElEc3NQcm94eUFjdGlvbnMubG9ja0VUSCwgKENEUF9NQU5BR0VSLCBKT0lOX0VUSF9DLCBjZHBJZCkKICAgICAgICAgICAgKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gYm9ycm93KHVpbnQyNTYgZGFpQW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgSURzc1Byb3h5KHByb3h5KS5leGVjdXRlKAogICAgICAgICAgICBQUk9YWV9BQ1RJT05TLAogICAgICAgICAgICBhYmkuZW5jb2RlQ2FsbCgKICAgICAgICAgICAgICAgIElEc3NQcm94eUFjdGlvbnMuZHJhdywKICAgICAgICAgICAgICAgIChDRFBfTUFOQUdFUiwgSlVHLCBKT0lOX0RBSSwgY2RwSWQsIGRhaUFtb3VudCkKICAgICAgICAgICAgKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVwYXkodWludDI1NiBkYWlBbW91bnQpIGV4dGVybmFsIHsKICAgICAgICBkYWkuYXBwcm92ZShwcm94eSwgZGFpQW1vdW50KTsKICAgICAgICBJRHNzUHJveHkocHJveHkpLmV4ZWN1dGUoCiAgICAgICAgICAgIFBST1hZX0FDVElPTlMsCiAgICAgICAgICAgIGFiaS5lbmNvZGVDYWxsKAogICAgICAgICAgICAgICAgSURzc1Byb3h5QWN0aW9ucy53aXBlLCAoQ0RQX01BTkFHRVIsIEpPSU5fREFJLCBjZHBJZCwgZGFpQW1vdW50KQogICAgICAgICAgICApCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZXBheUFsbCgpIGV4dGVybmFsIHsKICAgICAgICBkYWkuYXBwcm92ZShwcm94eSwgdHlwZSh1aW50MjU2KS5tYXgpOwogICAgICAgIElEc3NQcm94eShwcm94eSkuZXhlY3V0ZSgKICAgICAgICAgICAgUFJPWFlfQUN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yBldGhKb2luLCB1aW50MjU2IGNkcElkKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcGF5YWJsZTsKICAgIGZ1bmN0aW9uIGRyYXcoCiAgICAgICAgYWRkcmVzcyBjZHBNYW5hZ2VyLAogICAgICAgIGFkZHJlc3MganVnLAogICAgICAgIGFkZHJlc3MgZGFpSm9pbiwKICAgICAgICB1aW50MjU2IGNkcElkLAogICAgICAgIHVpbnQyNTYgZGFpQW1vdW50CiAgICApIGV4dGVybmFsOwogICAgZnVuY3Rpb24gd2lwZSgKICAgICAgICBhZGRyZXNzIGNkcE1hbmFnZXIsCiAgICAgICAgYWRkcmVzcyBkYWlKb2luLAogICAgICAgIHVpbnQyNTYgY2RwSWQsCiAgICAgICAgdWludDI1NiBkYWlBbW91bnQKICAgICkgZXh0ZXJuYWw7CiAgICBmdW5jdGlvbiB3aXBlQWxsKGFkZHJlc3MgY2RwTWFuYWdlciwgYWRkcmVzcyBkYWlKb2luLCB1aW50MjU2IGNkcElkKQogICAgICAgIGV4dGVybmFsOwogICAgZnVuY3Rpb24gZnJlZUVUSCgKICAgICAgICBhZGRyZXNzIGNkcE1hbmFnZXIsCiAgICAgICAgYWRkcmVzcyBldGhKb2luLAogICAgICAgIHVpbnQyNTYgY2RwSWQsCiAgICAgICAgdWludDI1NiBjb2xsYXRlcmFsQW1vdW50CiAgICApIGV4dGVybmFsOwp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGJhbGFuY2VPZihhZGRyZXNzIGFjY291bnQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBhbGxvd2FuY2UoYWRkcmVzcyBvd25lciwgYWRkcmVzcyBzcGVuZGVyKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVyb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1bmN0aW9uIHRlc3RfcHJveHkoKSBwdWJsaWMgewogICAgICAgIHVpbnQyNTYgY2RwSWQgPSBwcm94eS5jZHBJZCgpOwogICAgICAgIGFkZHJlc3MgdXJuQWRkciA9IGNkcE1hbmFnZXIudXJucyhjZHBJZCk7CgogICAgICAgIGNvbnNvbGUyLmxvZygiQmVmb3JlIGxvY2sgRVRIIik7CiAgICAgICAgcHJpbnQodXJuQWRkcik7CgogICAgICAgIHByb3h5LmxvY2tFdGh7dmFsdWU6IEVUSF9BTU9VTlR9KCk7CiAgICAgICAgY29uc29sZTIubG9nKCIiKTsKICAgICAgICBjb25zb2xlMi5sb2coIkFmdGVyIGxvY2sgRVRIIik7CiAgICAgICAgcHJpbnQodXJuQWRkcik7CgogICAgICAgIHByb3h5LmJvcnJvdyhEQUlfQU1PVU5UKTsKICAgICAgICBjb25zb2xlMi5sb2coIiIpOwogICAgICAgIGNvbnNvbGUyLmxvZygiQWZ0ZXIgYm9ycm93IERBSSIpOwogICAgICAgIHByaW50KHVybkFkZHIpOwoKICAgICAgICBwcm94eS5yZXBheShEQUlfQU1PVU5UIC8gMik7CiAgICAgICAgY29uc29sZTIubG9nKCIiKTsKICAgICAgICBjb25zb2xlMi5sb2coIkFmdGVyIHBhcnRpYWwgcmVwYXkgREFJIik7CiAgICAgICAgcHJpbnQodXJuQWRkcik7CgogICAgICAgIHByb3h5LnJlcGF5QWxsKCk7CiAgICAgICAgY29uc29sZTIubG9nKCIiKTsKICAgICAgICBjb25zb2xlMi5sb2coIkFmdGVyIHJlcGF5IGFsbCBEQUkiKTsKICAgICAgICBwcmludCh1cm5BZGRyKTsKCiAgICAgICAgcHJveHkudW5sb2NrRXRoKEVUSF9BTU9VTlQpOwogICAgICAgIGNvbnNvbGUyLmxvZygiIik7CiAgICAgICAgY29uc29sZTIubG9nKCJBZnRlciB1bmxvY2sgRVRIIik7CiAgICAgICAgcHJpbnQodXJuQWRkcik7CiAgICB9Cn0KCmludGVyZmFjZSBJVmF0IHsKICAgIC8vIENvbGxhdGVyYWwgdHlwZQogICAgc3RydWN0IElsayB7CiAgICAgICAgdWludDI1NiBBcnQ7IC8vIFRvdGFsIG5vcm1hbGl6ZWQgZGVidCAgICAgIFt3YWRdCiAgICAgICAgdWludDI1NiByYXRlOyAvLyBBY2N1bXVsYXRlZCByYXRlcyAgICAgICAgIFtyYXldCiAgICAgICAgdWludDI1NiBzcG90OyAvLyBQcmljZSB3aXRoIHNhZmV0eSBtYXJnaW4gIFtyYXldCiAgICAgICAgdWludDI1NiBsaW5lOyAvLyBEZWJ0IGNlaWxpbmcgICAgICAgICAgICAgIFtyYWRdCiAgICAgICAgdWludDI1NiBkdXN0OyAvLyBVcm4gZGVidCBmbG9vciAgICAgICAgICAgIFtyYWRdCiAgICB9CgogICAgLy8gVmF1bHQKICAgIHN0cnVjdCBVcm4gewogICAgICAgIHVpbnQyNTYgaW5rOyAvLyBMb2NrZWQgY29sbGF0ZXJhbCAgW3dhZF0KICAgICAgICB1aW50MjU2IGFydDsgLy8gTm9ybWFsaXNlZCBkZWJ0ICAgIFt3YWRdCiAgICB9CgogICAgZnVuY3Rpb24gaWxrcyhieXRlczMyIGlsaykgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChJbGsgbWVtb3J5KTsKICAgIGZ1bmN0aW9uIHVybnMoYnl0ZXMzMiBpbGssIGFkZHJlc3MgdXNlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChVcm4gbWVtb3J5KTsKfQoKaW50ZXJmYWNlIElDZHBNYW5hZ2VyIHsKICAgIGZ1bmN0aW9uIHVybnModWludDI1NiBjZHBJZCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChhZGRyZXNzIHVybik7Cn0K"}],hm=`

                    Example

                    +`,tm=({prev:s,next:a})=>r.jsx(A,{version:nm,title:lm,description:pm,html:cm,prev:s,next:a,codes:em}),om="0.8.24",rm="DAI Proxy Examples",im="Borrow and repay DAI using DssProxy",gm=[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BwdWJsaWMgaW1tdXRhYmxlIGNkcElkOwoKICAgIGNvbnN0cnVjdG9yKCkgewogICAgICAgIHByb3h5ID0gSURzc1Byb3h5UmVnaXN0cnkoUFJPWFlfUkVHSVNUUlkpLmJ1aWxkKCk7CiAgICAgICAgYnl0ZXMzMiByZXMgPSBJRHNzUHJveHkocHJveHkpLmV4ZWN1dGUoCiAgICAgICAgICAgIFBST1hZX0FDVElPTlMsCiAgICAgICAgICAgIGFiaS5lbmNvZGVDYWxsKElEc3NQcm94eUFjdGlvbnMub3BlbiwgKENEUF9NQU5BR0VSLCBFVEhfQywgcHJveHkpKQogICAgICAgICk7CiAgICAgICAgY2RwSWQgPSB1aW50MjU2KHJlcyk7CiAgICB9CgogICAgcmVjZWl2ZSgpIGV4dGVybmFsIHBheWFibGUge30KCiAgICBmdW5jdGlvbiBsb2NrRXRoKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgSURzc1Byb3h5KHByb3h5KS5leGVjdXRle3ZhbHVlOiBtc2cudmFsdWV9KAogICAgICAgICAgICBQUk9YWV9BQ1RJT05TLAogICAgICAgICAgICBhYmkuZW5jb2RlQ2FsbCgKICAgICAgICAgICAgICAgIElEc3NQcm94eUFjdGlvbnMubG9ja0VUSCwgKENEUF9NQU5BR0VSLCBKT0lOX0VUSF9DLCBjZHBJZCkKICAgICAgICAgICAgKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gYm9ycm93KHVpbnQyNTYgZGFpQW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgSURzc1Byb3h5KHByb3h5KS5leGVjdXRlKAogICAgICAgICAgICBQUk9YWV9BQ1RJT05TLAogICAgICAgICAgICBhYmkuZW5jb2RlQ2FsbCgKICAgICAgICAgICAgICAgIElEc3NQcm94eUFjdGlvbnMuZHJhdywKICAgICAgICAgICAgICAgIChDRFBfTUFOQUdFUiwgSlVHLCBKT0lOX0RBSSwgY2RwSWQsIGRhaUFtb3VudCkKICAgICAgICAgICAgKQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVwYXkodWludDI1NiBkYWlBbW91bnQpIGV4dGVybmFsIHsKICAgICAgICBkYWkuYXBwcm92ZShwcm94eSwgZGFpQW1vdW50KTsKICAgICAgICBJRHNzUHJveHkocHJveHkpLmV4ZWN1dGUoCiAgICAgICAgICAgIFBST1hZX0FDVElPTlMsCiAgICAgICAgICAgIGFiaS5lbmNvZGVDYWxsKAogICAgICAgICAgICAgICAgSURzc1Byb3h5QWN0aW9ucy53aXBlLCAoQ0RQX01BTkFHRVIsIEpPSU5fREFJLCBjZHBJZCwgZGFpQW1vdW50KQogICAgICAgICAgICApCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZXBheUFsbCgpIGV4dGVybmFsIHsKICAgICAgICBkYWkuYXBwcm92ZShwcm94eSwgdHlwZSh1aW50MjU2KS5tYXgpOwogICAgICAgIElEc3NQcm94eShwcm94eSkuZXhlY3V0ZSgKICAgICAgICAgICAgUFJPWFlfQUNUSU9OUywKICAgICAgICAgICAgYWJpLmVuY29kZUNhbGwoCiAgICAgICAgICAgICAgICBJRHNzUHJveHlBY3Rpb25zLndpcGVBbGwsIChDRFBfTUFOQUdFUiwgSk9JTl9EQUksIGNkcElkKQogICAgICAgICAgICApCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiB1bmxvY2tFdGgodWludDI1NiBldGhBbW91bnQpIGV4dGVybmFsIHsKICAgICAgICBJRHNzUHJveHkocHJveHkpLmV4ZWN1dGUoCiAgICAgICAgICAgIFBST1hZX0FDVElPTlMsCiAgICAgICAgICAgIGFiaS5lbmNvZGVDYWxsKAogICAgICAgICAgICAgICAgSURzc1Byb3h5QWN0aW9ucy5mcmVlRVRILAogICAgICAgICAgICAgICAgKENEUF9NQU5BR0VSLCBKT0lOX0VUSF9DLCBjZHBJZCwgZXRoQW1vdW50KQogICAgICAgICAgICApCiAgICAgICAgKTsKICAgIH0KfQoKaW50ZXJmYWNl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ycm93IERBSSIpOwogICAgICAgIHByaW50KHVybkFkZHIpOwoKICAgICAgICBwcm94eS5yZXBheShEQUlfQU1PVU5UIC8gMik7CiAgICAgICAgY29uc29sZTIubG9nKCIiKTsKICAgICAgICBjb25zb2xlMi5sb2coIkFmdGVyIHBhcnRpYWwgcmVwYXkgREFJIik7CiAgICAgICAgcHJpbnQodXJuQWRkcik7CgogICAgICAgIHByb3h5LnJlcGF5QWxsKCk7CiAgICAgICAgY29uc29sZTIubG9nKCIiKTsKICAgICAgICBjb25zb2xlMi5sb2coIkFmdGVyIHJlcGF5IGFsbCBEQUkiKTsKICAgICAgICBwcmludCh1cm5BZGRyKTsKCiAgICAgICAgcHJveHkudW5sb2NrRXRoKEVUSF9BTU9VTlQpOwogICAgICAgIGNvbnNvbGUyLmxvZygiIik7CiAgICAgICAgY29uc29sZTIubG9nKCJBZnRlciB1bmxvY2sgRVRIIik7CiAgICAgICAgcHJpbnQodXJuQWRkcik7CiAgICB9Cn0KCmludGVyZmFjZSBJVmF0IHsKICAgIC8vIENvbGxhdGVyYWwgdHlwZQogICAgc3RydWN0IElsayB7CiAgICAgICAgdWludDI1NiBBcnQ7IC8vIFRvdGFsIG5vcm1hbGl6ZWQgZGVidCAgICAgIFt3YWRdCiAgICAgICAgdWludDI1NiByYXRlOyAvLyBBY2N1bXVsYXRlZCByYXRlcyAgICAgICAgIFtyYXldCiAgICAgICAgdWludDI1NiBzcG90OyAvLyBQcmljZSB3aXRoIHNhZmV0eSBtYXJnaW4gIFtyYXldCiAgICAgICAgdWludDI1NiBsaW5lOyAvLyBEZWJ0IGNlaWxpbmcgICAgICAgICAgICAgIFtyYWRdCiAgICAgICAgdWludDI1NiBkdXN0OyAvLyBVcm4gZGVidCBmbG9vciAgICAgICAgICAgIFtyYWRdCiAgICB9CgogICAgLy8gVmF1bHQKICAgIHN0cnVjdCBVcm4gewogICAgICAgIHVpbnQyNTYgaW5rOyAvLyBMb2NrZWQgY29sbGF0ZXJhbCAgW3dhZF0KICAgICAgICB1aW50MjU2IGFydDsgLy8gTm9ybWFsaXNlZCBkZWJ0ICAgIFt3YWRdCiAgICB9CgogICAgZnVuY3Rpb24gaWxrcyhieXRlczMyIGlsaykgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChJbGsgbWVtb3J5KTsKICAgIGZ1bmN0aW9uIHVybnMoYnl0ZXMzMiBpbGssIGFkZHJlc3MgdXNlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChVcm4gbWVtb3J5KTsKfQoKaW50ZXJmYWNlIElDZHBNYW5hZ2VyIHsKICAgIGZ1bmN0aW9uIHVybnModWludDI1NiBjZHBJZCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChhZGRyZXNzIHVybik7Cn0K"}],hm=`

                    Example

                    Example of locking ETH collateral, borrowing DAI, repaying DAI and unlocking ETH using DssProxy.

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

                    interface ICdpManager { function urns(uint256 cdpId) external view returns (address urn); } -
                    `,Im=({prev:s,next:a})=>r.jsx(u,{version:om,title:rm,description:im,html:hm,prev:s,next:a,codes:gm}),dm="0.8.24",Cm="Discrete Staking Rewards",jm="Discrete staking rewards",um=[{fileName:"DiscreteStakingRewards.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IERpc2NyZXRlU3Rha2luZ1Jld2FyZHMgewogICAgSUVSQzIwIHB1YmxpYyBpbW11dGFibGUgc3Rha2luZ1Rva2VuOwogICAgSUVSQzIwIHB1YmxpYyBpbW11dGFibGUgcmV3YXJkVG9rZW47CgogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbFN1cHBseTsKCiAgICB1aW50Mj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HJld2FyZCA9IGVhcm5lZFttc2cuc2VuZGVyXTsKICAgICAgICBpZiAocmV3YXJkID4gMCkgewogICAgICAgICAgICBlYXJuZWRbbXNnLnNlbmRlcl0gPSAwOwogICAgICAgICAgICByZXdhcmRUb2tlbi50cmFuc2Zlcihtc2cuc2VuZGVyLCByZXdhcmQpOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIHJld2FyZDsKICAgIH0KfQoKaW50ZXJmYWNlIElFUkMyMCB7CiAgICBmdW5jdGlvbiB0b3RhbFN1cHBseSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBhY2NvdW50KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyByZWNpcGllbnQsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiBhbGxvd2FuY2UoYWRkcmVzcyBvd25lciwgYWRkcmVzcyBzcGVuZGVyKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYXBwcm92ZShhZGRyZXNzIHNwZW5kZXIsIHVpbnQyNTYgYW1vdW50KSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIHNlbmRlciwgYWRkcmVzcyByZWNpcGllbnQsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7Cn0K"}],Am=`

                    Similar to staking rewards contract. Difference is that reward amount may vary at each second.

                    +`,Im=({prev:s,next:a})=>r.jsx(A,{version:om,title:rm,description:im,html:hm,prev:s,next:a,codes:gm}),dm="0.8.24",Cm="Discrete Staking Rewards",jm="Discrete staking rewards",Am=[{fileName:"DiscreteStakingRewards.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IERpc2NyZXRlU3Rha2luZ1Jld2FyZHMgewogICAgSUVSQzIwIHB1YmxpYyBpbW11dGFibGUgc3Rha2luZ1Rva2VuOwogICAgSUVSQzIwIHB1YmxpYyBpbW11dGFibGUgcmV3YXJkVG9rZW47CgogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbFN1cHBseTsKCiAgICB1aW50MjU2IHByaXZhdGUgY29uc3RhbnQgTVVMVElQTElFUiA9IDFlMTg7CiAgICB1aW50MjU2IHByaXZhdGUgcmV3YXJkSW5kZXg7CiAgICBtYXBwaW5nKGFkZHJlc3MgPT4gdWludDI1NikgcHJpdmF0ZSByZXdhcmRJbmRleE9mOwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHByaXZhdGUgZWFybmVkOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX3N0YWtpbmdUb2tlbiwgYWRkcmVzcyBfcmV3YXJkVG9rZW4pIHsKICAgICAgICBzdGFraW5nVG9rZW4gPSBJRVJDMjAoX3N0YWtpbmdUb2tlbik7CiAgICAgICAgcmV3YXJkVG9rZW4gPSBJRVJDMjAoX3Jld2FyZFRva2VuKTsKICAgIH0KCiAgICBmdW5jdGlvbiB1cGRhdGVSZXdhcmRJbmRleCh1aW50MjU2IHJld2FyZCkgZXh0ZXJuYWwgewogICAgICAgIHJld2FyZFRva2VuLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCByZXdhcmQpOwogICAgICAgIHJld2FyZEluZGV4ICs9IChyZXdhcmQgKiBNVUxUSVBMSUVSKSAv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wogICAgICAgIHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYXBwcm92ZShhZGRyZXNzIHNwZW5kZXIsIHVpbnQyNTYgYW1vdW50KSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIHNlbmRlciwgYWRkcmVzcyByZWNpcGllbnQsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7Cn0K"}],um=`

                    Similar to staking rewards contract. Difference is that reward amount may vary at each second.

                    Discrete Staking Rewards

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

                    external returns (bool); } -
                    `,ym=({prev:s,next:a})=>r.jsx(u,{version:dm,title:Cm,description:jm,html:Am,prev:s,next:a,codes:um}),mm="0.8.24",bm="Stable Swap AMM",wm="Curve's stable swap AMM",km=[{fileName:"StableSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkludmFyaWFudCAtIHByaWNlIG9mIHRyYWRlIGFuZCBhbW91bnQgb2YgbGlxdWlkaXR5IGFyZSBkZXRlcm1pbmVkIGJ5IHRoaXMgZXF1YXRpb24KCkFuXm4gc3VtKHhfaSkgKyBEID0gQURuXm4gKyBEXihuICsgMSkgLyAobl5uIHByb2QoeF9pKSkKClRvcGljcwowLiBOZXd0b24ncyBtZXRob2QgeF8obiArIDEpID0geF9uIC0gZih4X24pIC8gZicoeF9uKQoxLiBJbnZhcmlhbnQKMi4gU3dhcAogICAtIENhbGN1bGF0ZSBZCiAgIC0gQ2FsY3VsYXRlIEQKMy4gR2V0IHZpcnR1YWwgcHJpY2UKNC4gQWRkIGxpcXVpZGl0eQogICAtIEltYmFsYW5jZSBmZWUKNS4gUmVtb3ZlIGxpcXVpZGl0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obiArIDEpIERebiAvIChuXm4gcHJvZCh4X2kpKSAtIDEKCiAgICAgICAgICAgICAgICAgICAgIChhcyArIG5wKURfbgogICAgICAgIERfKG4rMSkgPSAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICAgICAgICAgICAgICAoYSAtIDEpRF9uICsgKG4gKyAxKXAKCiAgICAgICAgYSA9IEFuXm4KICAgICAgICBzID0gc3VtKHhfaSkKICAgICAgICBwID0gKERfbileKG4gKyAxKSAvIChuXm4gcHJvZCh4X2kpKQogICAgICAgICovCiAgICAgICAgdWludDI1NiBhID0gQSAqIE47IC8vIEFuXm4KCiAgICAgICAgdWludDI1NiBzOyAvLyB4XzAgKyB4XzEgKyAuLi4gKyB4XyhuLTEpCiAgICAgICAgZm9yICh1aW50MjU2IGk7IGkgPCBOOyArK2kpIHsKICAgICAgICAgICAgcyArPSB4cFtpXTsKICAgICAgICB9CgogICAgICAgIC8vIE5ld3RvbidzIG1ldGhvZAogICAgICAgIC8vIEluaXRpYWwgZ3Vlc3MsIGQgPD0gcwogICAgICAgIHVpbnQyNTYgZCA9IHM7CiAgICAgICAgdWludDI1NiBkX3ByZXY7CiAgICAgICAgZm9yICh1aW50MjU2IGk7IGkgPCAyNTU7ICsraSkgewogICAgICAgICAgICAvLyBwID0gRF4obiArIDEpIC8gKG5ebiAqIHhfMCAqIC4uLiAqIHhfKG4tMSkpCiAgICAgICAgICAgIHVpbnQyNTYgcCA9IGQ7CiAgICAgICAgICAgIGZvciAodWludDI1NiBqOyBqIDwgTjsgKytqKSB7CiAgICAgICAgICAgICAgICBwID0gKHAgKiBkKSAvIChOICogeHBbal0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGRfcHJldiA9IGQ7CiAgICAgICAgICAgIGQgPSAoKGEgKiBzICsgTiAqIHApICogZCkgLyAoKGEgLSAxKSAqIGQgKyAoTiArIDEpICogcCk7CgogICAgICAgICAgICBpZiAoTWF0aC5hYnMoZCwgZF9wcmV2KSA8PSAxKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZDsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXZlcnQoIkQgZGlkbid0IGNvbnZlcmdlIik7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIENhbGN1bGF0ZSB0aGUgbmV3IGJhbGFuY2Ugb2YgdG9rZW4gaiBnaXZlbiB0aGUgbmV3IGJhbGFuY2Ugb2YgdG9rZW4gaQogICAgICogQHBhcmFtIGkgSW5kZXggb2YgdG9rZW4gaW4KICAgICAqIEBwYXJhbSBqIEluZGV4IG9mIHRva2VuIG91dAogICAgICogQHBhcmFtIHggTmV3IGJhbGFuY2Ugb2YgdG9rZW4gaQogICAgICogQHBhcmFtIHhwIEN1cnJlbnQgcHJlY2lzaW9uLWFkanVzdGVkIGJhbGFuY2VzCiAgICAgKi8KICAgIGZ1bmN0aW9uIF9nZXRZKHVpbnQyNTYgaSwgdWludDI1NiBqLCB1aW50MjU2IHgsIHVpbnQyNTZbTl0gbWVtb3J5IHhwKQogICAgICAgIHByaXZhdGUKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NikKICAgIHsKICAgICAgICAvKgogICAgICAgIE5ld3RvbidzIG1ldGhvZCB0byBjb21wdXRlIHkKICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICAgIHkgPSB4X2oKCiAgICAgICAgZih5KSA9IHleMiArIHkoYiAtIEQpIC0gYwoKICAgICAgICAgICAgICAgICAgICB5X25eMiArIGMKICAgICAgICB5XyhuKzEpID0gLS0tLS0tLS0tLS0tLS0KICAgICAgICAgICAgICAgICAgIDJ5X24gKyBiIC0gRAoKICAgICAgICB3aGVyZQogICAgICAgIHMgPSBzdW0oeF9rKSwgayAhPSBqCiAgICAgICAgcCA9IHByb2QoeF9rKSwgayAhPSBqCiAgICAgICAgYiA9IHMgKyBEIC8gKEFuXm4pCiAgICAgICAgYyA9IEReKG4gKyAxKSAvIChuXm4gKiBwICogQW5ebikKICAgICAgICAqLwogICAgICAgIHVpbnQyNTYgYSA9IEEgKiBOOwogICAgICAgIHVpbnQyNTYgZCA9IF9nZXREKHhwKTsKICAgICAgICB1aW50MjU2IHM7CiAgICAgICAgdWludDI1NiBjID0gZDsKCiAgICAgICAgdWludDI1NiBfeDsKICAgICAgICBmb3IgKHVpbnQyNTYgazsgayA8IE47ICsraykgewogICAgICAgICAgICBpZiAoayA9PSBpKSB7CiAgICAgICAgICAgICAgICBfeCA9IHg7CiAgICAgICAgICAgIH0gZWxzZSBpZiAoayA9PSBqKSB7CiAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIF94ID0geHBba107CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHMgKz0gX3g7CiAgICAgICAgICAgIGMgPSAoYyAqIGQpIC8gKE4gKiBfeCk7CiAgICAgICAgfQogICAgICAgIGMgPSAoYyAqIGQpIC8gKE4gKiBhKTsKICAgICAgICB1aW50MjU2IGIgPSBzICsgZCAvIGE7CgogICAgICAgIC8vIE5ld3RvbidzIG1ldGhvZAogICAgICAgIHVpbnQyNTYgeV9wcmV2OwogICAgICAgIC8vIEluaXRpYWwgZ3Vlc3MsIHkgPD0gZAogICAgICAgIHVpbnQyNTYgeSA9IGQ7CiAgICAgICAgZm9yICh1aW50MjU2IF9pOyBfaSA8IDI1NTsgKytfaSkgewogICAgICAgICAgICB5X3ByZXYgPSB5OwogICAgICAgICAgICB5ID0gKHkgKiB5ICsgYykgLyAoMiAqIHkgKyBiIC0gZCk7CiAgICAgICAgICAgIGlmIChNYXRoLmFicyh5LCB5X3ByZXYpIDw9IDEpIHsKICAgICAgICAgICAgICAgIHJldHVybiB5OwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldmVydCgieSBkaWRuJ3QgY29udmVyZ2UiKTsKICAgIH0KCiAgICAvKioKICAgICAqIEBub3RpY2UgQ2FsY3VsYXRlIHRoZSBuZXcgYmFsYW5jZSBvZiB0b2tlbiBpIGdpdmVuIHByZWNpc2lvbi1hZGp1c3RlZAogICAgICogYmFsYW5jZXMgeHAgYW5kIGxpcXVpZGl0eSBkCiAgICAgKiBAZGV2IEVxdWF0aW9uIGlzIGNhbGN1bGF0ZSB5IGlzIHNhbWUgYXMgX2dldFkKICAgICAqIEBwYXJhbSBpIEluZGV4IG9mIHRva2VuIHRvIGNhbGN1bGF0ZSB0aGUgbmV3IGJhbGFuY2UKICAgICAqIEBwYXJhbSB4cCBQcmVjaXNpb24tYWRqdXN0ZWQgYmFsYW5jZXMKICAgICAqIEBwYXJhbSBkIExpcXVpZGl0eSBkCiAgICAgKiBAcmV0dXJuIE5ldyBiYWxhbmNlIG9mIHRva2VuIGkKICAgICAqLwogICAgZnVuY3Rpb24gX2dldFlEKHVpbnQyNTYgaSwgdWludDI1NltOXSBtZW1vcnkgeHAsIHVpbnQyNTYgZCkKICAgICAgICBwcml2YXRlCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYpCiAgICB7CiAgICAgICAgdWludDI1NiBhID0gQSAqIE47CiAgICAgICAgdWludDI1NiBzOwogICAgICAgIHVpbnQyNTYgYyA9IGQ7CgogICAgICAgIHVpbnQyNTYgX3g7CiAgICAgICAgZm9yICh1aW50MjU2IGs7IGsgPCBOOyArK2spIHsKICAgICAgICAgICAgaWYgKGsgIT0gaSkgewogICAgICAgICAgICAgICAgX3ggPSB4cFtrXTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICB9CgogICAgICAgICAgICBzICs9IF94OwogICAgICAgICAgICBjID0gKGMgKiBkKSAvIChOICogX3gpOwogICAgICAgIH0KICAgICAgICBjID0gKGMgKiBkKSAvIChOICogYSk7CiAgICAgICAgdWludDI1NiBiID0gcyArIGQgLyBhOwoKICAgICAgICAvLyBOZXd0b24ncyBtZXRob2QKICAgICAgICB1aW50MjU2IHlfcHJldjsKICAgICAgICAvLyBJbml0aWFsIGd1ZXNzLCB5IDw9IGQKICAgICAgICB1aW50MjU2IHkgPSBkOwogICAgICAgIGZvciAodWludDI1NiBfaTsgX2kgPCAyNTU7ICsrX2kpIHsKICAgICAgICAgICAgeV9wcmV2ID0geTsKICAgICAgICAgICAgeSA9ICh5ICogeSArIGMpIC8gKDIgKiB5ICsgYiAtIGQpOwogICAgICAgICAgICBpZiAoTWF0aC5hYnMoeSwgeV9wcmV2KSA8PSAxKSB7CiAgICAgICAgICAgICAgICByZXR1cm4geTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXZlcnQoInkgZGlkbid0IGNvbnZlcmdlIik7CiAgICB9CgogICAgLy8gRXN0aW1hdGUgdmFsdWUgb2YgMSBzaGFyZQogICAgLy8gSG93IG1hbnkgdG9rZW5zIGlzIG9uZSBzaGFyZSB3b3J0aD8KICAgIGZ1bmN0aW9uIGdldFZpcnR1YWxQcmljZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHVpbnQyNTYgZCA9IF9nZXREKF94cCgpKTsKICAgICAgICB1aW50MjU2IF90b3RhbFN1cHBseSA9IHRvdGFsU3VwcGx5OwogICAgICAgIGlmIChfdG90YWxTdXBwbHkgPiAwKSB7CiAgICAgICAgICAgIHJldHVybiAoZCAqIDEwICoqIERFQ0lNQUxTKSAvIF90b3RhbFN1cHBseTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIDA7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIFN3YXAgZHggYW1vdW50IG9mIHRva2VuIGkgZm9yIHRva2VuIGoKICAgICAqIEBwYXJhbSBpIEluZGV4IG9mIHRva2VuIGluCiAgICAgKiBAcGFyYW0gaiBJbmRleCBvZiB0b2tlbiBvdXQKICAgICAqIEBwYXJhbSBkeCBUb2tlbiBpbiBhbW91bnQKICAgICAqIEBwYXJhbSBtaW5EeSBNaW5pbXVtIHRva2VuIG91dAogICAgICovCiAgICBmdW5jdGlvbiBzd2FwKHVpbnQyNTYgaSwgdWludDI1NiBqLCB1aW50MjU2IGR4LCB1aW50MjU2IG1pbkR5KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NiBkeSkKICAgIHsKICAgICAgICByZXF1aXJlKGkgIT0gaiwgImkgPSBqIik7CgogICAgICAgIElFUkMyMCh0b2tlbnNbaV0pLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBkeCk7CgogICAgICAgIC8vIENhbGN1bGF0ZSBkeQogICAgICAgIHVpbnQyNTZbTl0gbWVtb3J5IHhwID0gX3hwKCk7CiAgICAgICAgdWludDI1NiB4ID0geHBbaV0gKyBkeCAqIG11bHRpcGxpZXJzW2ldOwoKICAgICAgICB1aW50MjU2IHkwID0geHBbal07CiAgICAgICAgdWludDI1NiB5MSA9IF9nZXRZKGksIGosIHgsIHhwKTsKICAgICAgICAvLyB5MCBtdXN0IGJlID49IHkxLCBzaW5jZSB4IGhhcyBpbmNyZWFzZWQKICAgICAgICAvLyAtMSB0byByb3VuZCBkb3duCiAgICAgICAgZHkgPSAoeTAgLSB5MSAtIDEpIC8gbXVsdGlwbGllcnNbal07CgogICAgICAgIC8vIFN1YnRyYWN0IGZlZSBmcm9tIGR5CiAgICAgICAgdWludDI1NiBmZWUgPSAoZHkgKiBTV0FQX0ZFRSkgLyBGRUVfREVOT01JTkFUT1I7CiAgICAgICAgZHkgLT0gZmVlOwogICAgICAgIHJlcXVpcmUoZHkgPj0gbWluRHksICJkeSA8IG1pbiIpOwoKICAgICAgICBiYWxhbmNlc1tpXSArPSBkeDsKICAgICAgICBiYWxhbmNlc1tqXSAtPSBkeTsKCiAgICAgICAgSUVSQzIwKHRva2Vuc1tqXSkudHJhbnNmZXIobXNnLnNlbmRlciwgZHkpOwogICAgfQoKICAgIGZ1bmN0aW9uIGFkZExpcXVpZGl0eSh1aW50MjU2W05dIGNhbGxkYXRhIGFtb3VudHMsIHVpbnQyNTYgbWluU2hhcmVzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NiBzaGFyZXMpCiAgICB7CiAgICAgICAgLy8gY2FsY3VsYXRlIGN1cnJlbnQgbGlxdWlkaXR5IGQwCiAgICAgICAgdWludDI1NiBfdG90YWxTdXBwbHkgPSB0b3RhbFN1cHBseTsKICAgICAgICB1aW50MjU2IGQwOwogICAgICAgIHVpbnQyNTZbTl0gbWVtb3J5IG9sZF94cyA9IF94cCgpOwogICAgICAgIGlmIChfdG90YWxTdXBwbHkgPiAwKSB7CiAgICAgICAgICAgIGQwID0gX2dldEQob2xkX3hzKTsKICAgICAgICB9CgogICAgICAgIC8vIFRyYW5zZmVyIHRva2VucyBpbgogICAgICAgIHVpbnQyNTZbTl0gbWVtb3J5IG5ld194czsKICAgICAgICBmb3IgKHVpbnQyNTYgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICB1aW50MjU2IGFtb3VudCA9IGFtb3VudHNbaV07CiAgICAgICAgICAgIGlmIChhbW91bnQgPiAwKSB7CiAgICAgICAgICAgICAgICBJRVJDMjAodG9rZW5zW2ldKS50cmFuc2ZlckZyb20oCiAgICAgICAgICAgICAgICAgICAgbXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50CiAgICAgICAgICAgICAgICApOwogICAgICAgICAgICAgICAgbmV3X3hzW2ldID0gb2xkX3hzW2ldICsgYW1vdW50ICogbXVsdGlwbGllcnNbaV07CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBuZXdfeHNbaV0gPSBvbGRfeHNbaV07CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIC8vIENhbGN1bGF0ZSBuZXcgbGlxdWlkaXR5IGQxCiAgICAgICAgdWludDI1NiBkMSA9IF9nZXREKG5ld194cyk7CiAgICAgICAgcmVxdWlyZShkMSA+IGQwLCAibGlxdWlkaXR5IGRpZG4ndCBpbmNyZWFzZSIpOwoKICAgICAgICAvLyBSZWNjYWxjdWF0ZSBEIGFjY291bnRpbmcgZm9yIGZlZSBvbiBpbWJhbGFuY2UKICAgICAgICB1aW50MjU2IGQyOwogICAgICAgIGlmIChfdG90YWxTdXBwbHkgPiAwKSB7CiAgICAgICAgICAgIGZvciAodWludDI1NiBpOyBpIDwgTjsgKytpKSB7CiAgICAgICAgICAgICAgICAvLyBUT0RPOiB3aHkgb2xkX3hzW2ldICogZDEgLyBkMD8gd2h5IG5vdCBkMSAvIE4/CiAgICAgICAgICAgICAgICB1aW50MjU2IGlkZWFsQmFsYW5jZSA9IChvbGRfeHNbaV0gKiBkMSkgLyBkMDsKICAgICAgICAgICAgICAgIHVpbnQyNTYgZGlmZiA9IE1hdGguYWJzKG5ld194c1tpXSwgaWRlYWxCYWxhbmNlKTsKICAgICAgICAgICAgICAgIG5ld194c1tpXSAtPSAoTElRVUlESVRZX0ZFRSAqIGRpZmYpIC8gRkVFX0RFTk9NSU5BVE9SOwogICAgICAgICAgICB9CgogICAgICAgICAgICBkMiA9IF9nZXREKG5ld194cyk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgZDIgPSBkMTsKICAgICAgICB9CgogICAgICAgIC8vIFVwZGF0ZSBiYWxhbmNlcwogICAgICAgIGZvciAodWludDI1NiBpOyBpIDwgTjsgKytpKSB7CiAgICAgICAgICAgIGJhbGFuY2VzW2ldICs9IGFtb3VudHNbaV07CiAgICAgICAgfQoKICAgICAgICAvLyBTaGFyZXMgdG8gbWludCA9IChkMiAtIGQwKSAvIGQwICogdG90YWwgc3VwcGx5CiAgICAgICAgLy8gZDEgPj0gZDIgPj0gZDAKICAgICAgICBpZiAoX3RvdGFsU3VwcGx5ID4gMCkgewogICAgICAgICAgICBzaGFyZXMgPSAoKGQyIC0gZDApICogX3RvdGFsU3VwcGx5KSAvIGQwOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHNoYXJlcyA9IGQyOwogICAgICAgIH0KICAgICAgICByZXF1aXJlKHNoYXJlcyA+PSBtaW5TaGFyZXMsICJzaGFyZXMgPCBtaW4iKTsKICAgICAgICBfbWludChtc2cuc2VuZGVyLCBzaGFyZXMpOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZUxpcXVpZGl0eSh1aW50MjU2IHNoYXJlcywgdWludDI1NltOXSBjYWxsZGF0YSBtaW5BbW91bnRzT3V0KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NltOXSBtZW1vcnkgYW1vdW50c091dCkKICAgIHsKICAgICAgICB1aW50MjU2IF90b3RhbFN1cHBseSA9IHRvdGFsU3VwcGx5OwoKICAgICAgICBmb3IgKHVpbnQyNTYgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICB1aW50MjU2IGFtb3VudE91dCA9IChiYWxhbmNlc1tpXSAqIHNoYXJlcykgLyBfdG90YWxTdXBwbHk7CiAgICAgICAgICAgIHJlcXVpcmUoYW1vdW50T3V0ID49IG1pbkFtb3VudHNPdXRbaV0sICJvdXQgPCBtaW4iKTsKCiAgICAgICAgICAgIGJhbGFuY2VzW2ldIC09IGFtb3VudE91dDsKICAgICAgICAgICAgYW1vdW50c091dFtpXSA9IGFtb3VudE91dDsKCiAgICAgICAgICAgIElFUkMyMCh0b2tlbnNbaV0pLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudE91dCk7CiAgICAgICAgfQoKICAgICAgICBfYnVybihtc2cuc2VuZGVyLCBzaGFyZXMpOwogICAgfQoKICAgIC8qKgogICAgICogQG5vdGljZSBDYWxjdWxhdGUgYW1vdW50IG9mIHRva2VuIGkgdG8gcmVjZWl2ZSBmb3Igc2hhcmVzCiAgICAgKiBAcGFyYW0gc2hhcmVzIFNoYXJlcyB0byBidXJuCiAgICAgKiBAcGFyYW0gaSBJbmRleCBvZiB0b2tlbiB0byB3aXRoZHJhdwogICAgICogQHJldHVybiBkeSBBbW91bnQgb2YgdG9rZW4gaSB0byByZWNlaXZlCiAgICAgKiAgICAgICAgIGZlZSBGZWUgZm9yIHdpdGhkcmF3LiBGZWUgYWxyZWFkeSBpbmNsdWRlZCBpbiBkeQogICAgICovCiAgICBmdW5jdGlvbiBfY2FsY1dpdGhkcmF3T25lVG9rZW4odWludDI1NiBzaGFyZXMsIHVpbnQyNTYgaSkKICAgICAgICBwcml2YXRlCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKHVpbnQyNTYgZHksIHVpbnQyNTYgZmVlKQogICAgewogICAgICAgIHVpbnQyNTYgX3RvdGFsU3VwcGx5ID0gdG90YWxTdXBwbHk7CiAgICAgICAgdWludDI1NltOXSBtZW1vcnkgeHAgPSBfeHAoKTsKCiAgICAgICAgLy8gQ2FsY3VsYXRlIGQwIGFuZCBkMQogICAgICAgIHVpbnQyNTYgZDAgPSBfZ2V0RCh4cCk7CiAgICAgICAgdWludDI1NiBkMSA9IGQwIC0gKGQwICogc2hhcmVzKSAvIF90b3RhbFN1cHBseTsKCiAgICAgICAgLy8gQ2FsY3VsYXRlIHJlZHVjdGlvbiBpbiB5IGlmIEQgPSBkMQogICAgICAgIHVpbnQyNTYgeTAgPSBfZ2V0WUQoaSwgeHAsIGQxKTsKICAgICAgICAvLyBkMSA8PSBkMCBzbyB5IG11c3QgYmUgPD0geHBbaV0KICAgICAgICB1aW50MjU2IGR5MCA9ICh4cFtpXSAtIHkwKSAvIG11bHRpcGxpZXJzW2ldOwoKICAgICAgICAvLyBDYWxjdWxhdGUgaW1iYWxhbmNlIGZlZSwgdXBkYXRlIHhwIHdpdGggZmVlcwogICAgICAgIHVpbnQyNTYgZHg7CiAgICAgICAgZm9yICh1aW50MjU2IGo7IGogPCBOOyArK2opIHsKICAgICAgICAgICAgaWYgKGogPT0gaSkgewogICAgICAgICAgICAgICAgZHggPSAoeHBbal0gKiBkMSkgLyBkMCAtIHkwOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgLy8gZDEgLyBkMCA8PSAxCiAgICAgICAgICAgICAgICBkeCA9IHhwW2pdIC0gKHhwW2pdICogZDEpIC8gZDA7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgeHBbal0gLT0gKExJUVVJRElUWV9GRUUgKiBkeCkgLyBGRUVfREVOT01JTkFUT1I7CiAgICAgICAgfQoKICAgICAgICAvLyBSZWNhbGN1bGF0ZSB5IHdpdGggeHAgaW5jbHVkaW5nIGltYmFsYW5jZSBmZWVzCiAgICAgICAgdWludDI1NiB5MSA9IF9nZXRZRChpLCB4cCwgZDEpOwogICAgICAgIC8vIC0gMSB0byByb3VuZCBkb3duCiAgICAgICAgZHkgPSAoeHBbaV0gLSB5MSAtIDEpIC8gbXVsdGlwbGllcnNbaV07CiAgICAgICAgZmVlID0gZHkwIC0gZHk7CiAgICB9CgogICAgZnVuY3Rpb24gY2FsY1dpdGhkcmF3T25lVG9rZW4odWludDI1NiBzaGFyZXMsIHVpbnQyNTYgaSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2IGR5LCB1aW50MjU2IGZlZSkKICAgIHsKICAgICAgICByZXR1cm4gX2NhbGNXaXRoZHJhd09uZVRva2VuKHNoYXJlcywgaSk7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIFdpdGhkcmF3IGxpcXVpZGl0eSBpbiB0b2tlbiBpCiAgICAgKiBAcGFyYW0gc2hhcmVzIFNoYXJlcyB0byBidXJuCiAgICAgKiBAcGFyYW0gaSBUb2tlbiB0byB3aXRoZHJhdwogICAgICogQHBhcmFtIG1pbkFtb3VudE91dCBNaW5pbXVtIGFtb3VudCBvZiB0b2tlbiBpIHRoYXQgbXVzdCBiZSB3aXRoZHJhd24KICAgICAqLwogICAgZnVuY3Rpb24gcmVtb3ZlTGlxdWlkaXR5T25lVG9rZW4oCiAgICAgICAgdWludDI1NiBzaGFyZXMsCiAgICAgICAgdWludDI1NiBpLAogICAgICAgIHVpbnQyNTYgbWluQW1vdW50T3V0CiA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ZXR1cm5zIChib29sKTsKfQo="}],Zm=`

                    Simplified version of Curve's stable swap AMM

                    +`,ym=({prev:s,next:a})=>r.jsx(A,{version:dm,title:Cm,description:jm,html:um,prev:s,next:a,codes:Am}),mm="0.8.24",bm="Stable Swap AMM",wm="Curve's stable swap AMM",km=[{fileName:"StableSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkludmFyaWFudCAtIHByaWNlIG9mIHRyYWRlIGFuZCBhbW91bnQgb2YgbGlxdWlkaXR5IGFyZSBkZXRlcm1pbmVkIGJ5IHRoaXMgZXF1YXRpb24KCkFuXm4gc3VtKHhfaSkgKyBEID0gQURuXm4gKyBEXihuICsgMSkgLyAobl5uIHByb2QoeF9pKSkKClRvcGljcwowLiBOZXd0b24ncyBtZXRob2QgeF8obiArIDEpID0geF9uIC0gZih4X24pIC8gZicoeF9uKQoxLiBJbnZhcmlhbnQKMi4gU3dhcAogICAtIENhbGN1bGF0ZSBZCiAgIC0gQ2FsY3VsYXRlIEQKMy4gR2V0IHZpcnR1YWwgcHJpY2UKNC4gQWRkIGxpcXVpZGl0eQogICAtIEltYmFsYW5jZSBmZWUKNS4gUmVtb3ZlIGxpcXVpZGl0eQo2LiBSZW1vdmUgbGlxdWlkaXR5IG9uZSB0b2tlbgogICAtIENhbGN1bGF0ZSB3aXRoZHJhdyBvbmUgdG9rZW4KICAgLSBnZXRZRApUT0RPOiB0ZXN0PwoqLwoKbGlicmFyeSBNYXRoIHsKICAgIGZ1bmN0aW9uIGFicyh1aW50MjU2IHgsIHVpbnQyNTYgeSkgaW50ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHggPj0geSA/IHggLSB5IDogeSAtIHg7CiAgICB9Cn0KCmNvbnRyYWN0IFN0YWJsZVN3YXAgewogICAgLy8gTnVtYmVyIG9mIHRva2VucwogICAgdWludDI1N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jsgKytpKSB7CiAgICAgICAgICAgIHhwW2ldID0gYmFsYW5jZXNbaV0gKiBtdWx0aXBsaWVyc1tpXTsKICAgICAgICB9CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIENhbGN1bGF0ZSBELCBzdW0gb2YgYmFsYW5jZXMgaW4gYSBwZXJmZWN0bHkgYmFsYW5jZWQgcG9vbAogICAgICogSWYgYmFsYW5jZXMgb2YgeF8wLCB4XzEsIC4uLiB4XyhuLTEpIHRoZW4gc3VtKHhfaSkgPSBECiAgICAgKiBAcGFyYW0geHAgUHJlY2lzaW9uLWFkanVzdGVkIGJhbGFuY2VzCiAgICAgKiBAcmV0dXJuIEQKICAgICAqLwogICAgZnVuY3Rpb24gX2dldEQodWludDI1NltOXSBtZW1vcnkgeHApIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgLyoKICAgICAgICBOZXd0b24ncyBtZXRob2QgdG8gY29tcHV0ZSBECiAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgICAgICBmKEQpID0gQURuXm4gKyBEXihuICsgMSkgLyAobl5uIHByb2QoeF9pKSkgLSBBbl5uIHN1bSh4X2kpIC0gRCAKICAgICAgICBmJyhEKSA9IEFuXm4gKyAobiArIDEpIERebiAvIChuXm4gcHJvZCh4X2kpKSAtIDEKCiAgICAgICAgICAgICAgICAgICAgIChhcyArIG5wKURfbgogICAgICAgIERfKG4rMSkgPSAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICAgICAgICAgICAgICAoYSAtIDEpRF9uICsgKG4gKyAxKXAKCiAgICAgICAgYSA9IEFuXm4KICAgICAgICBzID0gc3VtKHhfaSkKICAgICAgICBwID0gKERfbileKG4gKyAxKSAvIChuXm4gcHJvZCh4X2kpKQogICAgICAgICovCiAgICAgICAgdWludDI1NiBhID0gQSAqIE47IC8vIEFuXm4KCiAgICAgICAgdWludDI1NiBzOyAvLyB4XzAgKyB4XzEgKyAuLi4gKyB4XyhuLTEpCiAgICAgICAgZm9yICh1aW50MjU2IGk7IGkgPCBOOyArK2kpIHsKICAgICAgICAgICAgcyArPSB4cFtpXTsKICAgICAgICB9CgogICAgICAgIC8vIE5ld3RvbidzIG1ldGhvZAogICAgICAgIC8vIEluaXRpYWwgZ3Vlc3MsIGQgPD0gcwogICAgICAgIHVpbnQyNTYgZCA9IHM7CiAgICAgICAgdWludDI1NiBkX3ByZXY7CiAgICAgICAgZm9yICh1aW50MjU2IGk7IGkgPCAyNTU7ICsraSkgewogICAgICAgICAgICAvLyBwID0gRF4obiArIDEpIC8gKG5ebiAqIHhfMCAqIC4uLiAqIHhfKG4tMSkpCiAgICAgICAgICAgIHVpbnQyNTYgcCA9IGQ7CiAgICAgICAgICAgIGZvciAodWludDI1NiBqOyBqIDwgTjsgKytqKSB7CiAgICAgICAgICAgICAgICBwID0gKHAgKiBkKSAvIChOICogeHBbal0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGRfcHJldiA9IGQ7CiAgICAgICAgICAgIGQgPSAoKGEgKiBzICsgTiAqIHApICogZCkgLyAoKGEgLSAxKSAqIGQgKyAoTiArIDEpICogcCk7CgogICAgICAgICAgICBpZiAoTWF0aC5hYnMoZCwgZF9wcmV2KSA8PSAxKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZDsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXZlcnQoIkQgZGlkbid0IGNvbnZlcmdlIik7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIENhbGN1bGF0ZSB0aGUgbmV3IGJhbGFuY2Ugb2YgdG9rZW4gaiBnaXZlbiB0aGUgbmV3IGJhbGFuY2Ugb2YgdG9rZW4gaQogICAgICogQHBhcmFtIGkgSW5kZXggb2YgdG9rZW4gaW4KICAgICAqIEBwYXJhbSBqIEluZGV4IG9mIHRva2VuIG91dAogICAgICogQHBhcmFtIHggTmV3IGJhbGFuY2Ugb2YgdG9rZW4gaQogICAgICogQHBhcmFtIHhwIEN1cnJlbnQgcHJlY2lzaW9uLWFkanVzdGVkIGJhbGFuY2VzCiAgICAgKi8KICAgIGZ1bmN0aW9uIF9nZXRZKHVpbnQyNTYgaSwgdWludDI1NiBqLCB1aW50MjU2IHgsIHVpbnQyNTZbTl0gbWVtb3J5IHhwKQogICAgICAgIHByaXZhdGUKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NikKICAgIHsKICAgICAgICAvKgogICAgICAgIE5ld3RvbidzIG1ldGhvZCB0byBjb21wdXRlIHkKICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICAgIHkgPSB4X2oKCiAgICAgICAgZih5KSA9IHleMiArIHkoYiAtIEQpIC0gYwoKICAgICAgICAgICAgICAgICAgICB5X25eMiArIGMKICAgICAgICB5XyhuKzEpID0gLS0tLS0tLS0tLS0tLS0KICAgICAgICAgICAgICAgICAgIDJ5X24gKyBiIC0gRAoKICAgICAgICB3aGVyZQogICAgICAgIHMgPSBzdW0oeF9rKSwgayAhPSBqCiAgICAgICAgcCA9IHByb2QoeF9rKSwgayAhPSBqCiAgICAgICAgYiA9IHMgKyBEIC8gKEFuXm4pCiAgICAgICAgYyA9IEReKG4gKyAxKSAvIChuXm4gKiBwICogQW5ebikKICAgICAgICAqLwogICAgICAgIHVpbnQyNTYgYSA9IEEgKiBOOwogICAgICAgIHVpbnQyNTYgZCA9IF9nZXREKHhwKTsKICAgICAgICB1aW50MjU2IHM7CiAgICAgICAgdWludDI1NiBjID0gZDsKCiAgICAgICAgdWludDI1NiBfeDsKICAgICAgICBmb3IgKHVpbnQyNTYgazsgayA8IE47ICsraykgewogICAgICAgICAgICBpZiAoayA9PSBpKSB7CiAgICAgICAgICAgICAgICBfeCA9IHg7CiAgICAgICAgICAgIH0gZWxzZSBpZiAoayA9PSBqKSB7CiAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgfSBlbHNlIHsKICAg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mV0dXJuIE5ldyBiYWxhbmNlIG9mIHRva2VuIGkKICAgICAqLwogICAgZnVuY3Rpb24gX2dldFlEKHVpbnQyNTYgaSwgdWludDI1NltOXSBtZW1vcnkgeHAsIHVpbnQyNTYgZCkKICAgICAgICBwcml2YXRlCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYpCiAgICB7CiAgICAgICAgdWludDI1NiBhID0gQSAqIE47CiAgICAgICAgdWludDI1NiBzOwogICAgICAgIHVpbnQyNTYgYyA9IGQ7CgogICAgICAgIHVpbnQyNTYgX3g7CiAgICAgICAgZm9yICh1aW50MjU2IGs7IGsgPCBOOyArK2spIHsKICAgICAgICAgICAgaWYgKGsgIT0gaSkgewogICAgICAgICAgICAgICAgX3ggPSB4cFtrXTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICB9CgogICAgICAgICAgICBzICs9IF94OwogICAgICAgICAgICBjID0gKGMgKiBkKSAvIChOICogX3gpOwogICAgICAgIH0KICAgICAgICBjID0gKGMgKiBkKSAvIChOICogYSk7CiAgICAgICAgdWludDI1NiBiID0gcyArIGQgLyBhOwoKICAgICAgICAvLyBOZXd0b24ncyBtZXRob2QKICAgICAgICB1aW50MjU2IHlfcHJldjsKICAgICAgICAvLyBJbml0aWFsIGd1ZXNzLCB5IDw9IGQKICAgICAgICB1aW50MjU2IHkgPSBkOwogICAgICAgIGZvciAodWludDI1NiBfaTsgX2kgPCAyNTU7ICsrX2kpIHsKICAgICAgICAgICAgeV9wcmV2ID0geTsKICAgICAgICAgICAgeSA9ICh5ICogeSArIGMpIC8gKDIgKiB5ICsgYiAtIGQpOwogICAgICAgICAgICBpZiAoTWF0aC5hYnMoeSwgeV9wcmV2KSA8PSAxKSB7CiAgICAgICAgICAgICAgICByZXR1cm4geTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXZlcnQoInkgZGlkbid0IGNvbnZlcmdlIik7CiAgICB9CgogICAgLy8gRXN0aW1hdGUgdmFsdWUgb2YgMSBzaGFyZQogICAgLy8gSG93IG1hbnkgdG9rZW5zIGlzIG9uZSBzaGFyZSB3b3J0aD8KICAgIGZ1bmN0aW9uIGdldFZpcnR1YWxQcmljZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHVpbnQyNTYgZCA9IF9nZXREKF94cCgpKTsKICAgICAgICB1aW50MjU2IF90b3RhbFN1cHBseSA9IHRvdGFsU3VwcGx5OwogICAgICAgIGlmIChfdG90YWxTdXBwbHkgPiAwKSB7CiAgICAgICAgICAgIHJldHVybiAoZCAqIDEwICoqIERFQ0lNQUxTKSAvIF90b3RhbFN1cHBseTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIDA7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIFN3YXAgZHggYW1vdW50IG9mIHRva2VuIGkgZm9yIHRva2VuIGoKICAgICAqIEBwYXJhbSBpIEluZGV4IG9mIHRva2VuIGluCiAgICAgKiBAcGFyYW0gaiBJbmRleCBvZiB0b2tlbiBvdXQKICAgICAqIEBwYXJhbSBkeCBUb2tlbiBpbiBhbW91bnQKICAgICAqIEBwYXJhbSBtaW5EeSBNaW5pbXVtIHRva2VuIG91dAogICAgICovCiAgICBmdW5jdGlvbiBzd2FwKHVpbnQyNTYgaSwgdWludDI1NiBqLCB1aW50MjU2IGR4LCB1aW50MjU2IG1pbkR5KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NiBkeSkKICAgIHsKICAgICAgICByZXF1aXJlKGkgIT0gaiwgImkgPSBqIik7CgogICAgICAgIElFUkMyMCh0b2tlbnNbaV0pLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBkeCk7CgogICAgICAgIC8vIENhbGN1bGF0ZSBkeQogICAgICAgIHVpbnQyNTZbTl0gbWVtb3J5IHhwID0gX3hwKCk7CiAgICAgICAgdWludDI1NiB4ID0geHBbaV0gKyBkeCAqIG11bHRpcGxpZXJzW2ldOwoKICAgICAgICB1aW50MjU2IHkwID0geHBbal07CiAgICAgICAgdWludDI1NiB5MSA9IF9nZXRZKGksIGosIHgsIHhwKTsKICAgICAgICAvLyB5MCBtdXN0IGJlID49IHkxLCBzaW5jZSB4IGhhcyBpbmNyZWFzZWQKICAgICAgICAvLyAtMSB0byByb3VuZCBkb3duCiAgICAgICAgZHkgPSAoeTAgLSB5MSAtIDEpIC8gbXVsdGlwbGllcnNbal07CgogICAgICAgIC8vIFN1YnRyYWN0IGZlZSBmcm9tIGR5CiAgICAgICAgdWludDI1NiBmZWUgPSAoZHkgKiBTV0FQX0ZFRSkgLyBGRUVfREVOT01JTkFUT1I7CiAgICAgICAgZHkgLT0gZmVlOwogICAgICAgIHJlcXVpcmUoZHkgPj0gbWluRHksICJkeSA8IG1pbiIpOwoKICAgICAgICBiYWxhbmNlc1tpXSArPSBkeDsKICAgICAgICBiYWxhbmNlc1tqXSAtPSBkeTsKCiAgICAgICAgSUVSQzIwKHRva2Vuc1tqXSkudHJhbnNmZXIobXNnLnNlbmRlciwgZHkpOwogICAgfQoKICAgIGZ1bmN0aW9uIGFkZExpcXVpZGl0eSh1aW50MjU2W05dIGNhbGxkYXRhIGFtb3VudHMsIHVpbnQyNTYgbWluU2hhcmVzKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NiBzaGFyZXMpCiAgICB7CiAgICAgICAgLy8gY2FsY3VsYXRlIGN1cnJlbnQgbGlxdWlkaXR5IGQwCiAgICAgICAgdWludDI1NiBfdG90YWxTdXBwbHkgPSB0b3RhbFN1cHBseTsKICAgICAgICB1aW50MjU2IGQwOwogICAgICAgIHVpbnQyNTZbTl0gbWVtb3J5IG9sZF94cyA9IF94cCgpOwogICAgICAgIGlmIChfdG90YWxTdXBwbHkgPiAwKSB7CiAgICAgICAgICAgIGQwID0gX2dldEQob2xkX3hzKTsKICAgICAgICB9CgogICAgICAgIC8vIFRyYW5zZmVyIHRva2VucyBpbgogICAgICAgIHVpbnQyNTZbTl0gbWVtb3J5IG5ld194czsKICAgICAgICBmb3IgKHVpbnQyNTYgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICB1aW50MjU2IGFtb3VudCA9IGFtb3VudHNbaV07CiAgICAgICAgICAgIGlmIChhbW91bnQgPiAwKSB7CiAgICAgICAgICAgICAgICBJRVJDMjAodG9rZW5zW2ldKS50cmFuc2ZlckZyb20oCiAgICAgICAgICAgICAgICAgICAgbXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50CiAgICAgICAgICAgICAgICApOwogICAgICAgICAgICAgICAgbmV3X3hzW2ldID0gb2xkX3hzW2ldICsgYW1vdW50ICogbXVsdGlwbGllcnNbaV07CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBuZXdfeHNbaV0gPSBvbGRfeHNbaV07CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIC8vIENhbGN1bGF0ZSBuZXcgbGlxdWlkaXR5IGQxCiAgICAgICAgdWludDI1NiBkMSA9IF9nZXREKG5ld194cyk7CiAgICAgICAgcmVxdWlyZShkMSA+IGQwLCAibGlxdWlkaXR5IGRpZG4ndCBpbmNyZWFzZSIpOwoKICAgICAgICAvLyBSZWNjYWxjdWF0ZSBEIGFjY291bnRpbmcgZm9yIGZlZSBvbiBpbWJhbGFuY2UKICAgICAgICB1aW50MjU2IGQyOwogICAgICAgIGlmIChfdG90YWxTdXBwbHkgPiAwKSB7CiAgICAgICAgICAgIGZvciAodWludDI1NiBpOyBpIDwgTjsgKytpKSB7CiAgICAgICAgICAgICAgICAvLyBUT0RPOiB3aHkgb2xkX3hzW2ldICogZDEgLyBkMD8gd2h5IG5vdCBkMSAvIE4/CiAgICAgICAgICAgICAgICB1aW50MjU2IGlkZWFsQmFsYW5jZSA9IChvbGRfeHNbaV0gKiBkMSkgLyBkMDsKICAgICAgICAgICAgICAgIHVpbnQyNTYgZGlmZiA9IE1hdGguYWJzKG5ld194c1tpXSwgaWRlYWxCYWxhbmNlKTsKICAgICAgICAgICAgICAgIG5ld194c1tpXSAtPSAoTElRVUlESVRZX0ZFRSAqIGRpZmYpIC8gRkVFX0RFTk9NSU5BVE9SOwogICAgICAgICAgICB9CgogICAgICAgICAgICBkMiA9IF9nZXREKG5ld194cyk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgZDIgPSBkMTsKICAgICAgICB9CgogICAgICAgIC8vIFVwZGF0ZSBiYWxhbmNlcwogICAgICAgIGZvciAodWludDI1NiBpOyBpIDwgTjsgKytpKSB7CiAgICAgICAgICAgIGJhbGFuY2VzW2ldICs9IGFtb3VudHNbaV07CiAgICAgICAgfQoKICAgICAgICAvLyBTaGFyZXMgdG8gbWludCA9IChkMiAtIGQwKSAvIGQwICogdG90YWwgc3VwcGx5CiAgICAgICAgLy8gZDEgPj0gZDIgPj0gZDAKICAgICAgICBpZiAoX3RvdGFsU3VwcGx5ID4gMCkgewogICAgICAgICAgICBzaGFyZXMgPSAoKGQyIC0gZDApICogX3RvdGFsU3VwcGx5KSAvIGQwOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHNoYXJlcyA9IGQyOwogICAgICAgIH0KICAgICAgICByZXF1aXJlKHNoYXJlcyA+PSBtaW5TaGFyZXMsICJzaGFyZXMgPCBtaW4iKTsKICAgICAgICBfbWludChtc2cuc2VuZGVyLCBzaGFyZXMpOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZUxpcXVpZGl0eSh1aW50MjU2IHNoYXJlcywgdWludDI1NltOXSBjYWxsZGF0YSBtaW5BbW91bnRzT3V0KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NltOXSBtZW1vcnkgYW1vdW50c091dCkKICAgIHsKICAgICAgICB1aW50MjU2IF90b3RhbFN1cHBseSA9IHRvdGFsU3VwcGx5OwoKICAgICAgICBmb3IgKHVpbnQyNTYgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICB1aW50MjU2IGFtb3VudE91dCA9IChiYWxhbmNlc1tpXSAqIHNoYXJlcykgLyBfdG90YWxTdXBwbHk7CiAgICAgICAgICAgIHJlcXVpcmUoYW1vdW50T3V0ID49IG1pbkFtb3VudHNPdXRbaV0sICJvdXQgPCBtaW4iKTsKCiAgICAgICAgICAgIGJhbGFuY2VzW2ldIC09IGFtb3VudE91dDsKICAgICAgICAgICAgYW1vdW50c091dFtpXSA9IGFtb3VudE91dDsKCiAgICAgICAgICAgIElFUkMyMCh0b2tlbnNbaV0pLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudE91dCk7CiAgICAgICAgfQoKICAgICAgICBfYnVybihtc2cuc2VuZGVyLCBzaGFyZXMpOwogICAgfQoKICAgIC8qKgogICAgICogQG5vdGljZSBDYWxjdWxhdGUgYW1vdW50IG9mIHRva2VuIGkgdG8gcmVjZWl2ZSBmb3Igc2hhcmVzCiAgICAgKiBAcGFyYW0gc2hhcmVzIFNoYXJlcyB0byBidXJuCiAgICAgKiBAcGFyYW0gaSBJbmRleCBvZiB0b2tlbiB0byB3aXRoZHJhdwogICAgICogQHJldHVybiBkeSBBbW91bnQgb2YgdG9rZW4gaSB0byByZWNlaXZlCiAgICAgKiAgICAgICAgIGZlZSBGZWUgZm9yIHdpdGhkcmF3LiBGZWUgYWxyZWFkeSBpbmNsdWRlZCBpbiBkeQogICAgICovCiAgICBmdW5jdGlvbiBfY2FsY1dpdGhkcmF3T25lVG9rZW4odWludDI1NiBzaGFyZXMsIHVpbnQyNTYgaSkKICAgICAgICBwcml2YXRlCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKHVpbnQyNTYgZHksIHVpbnQyNTYgZmVlKQogICAgewogICAgICAgIHVpbnQyNTYgX3RvdGFsU3VwcGx5ID0gdG90YWxTdXBwbHk7CiAgICAgICAgdWludDI1NltOXSBtZW1vcnkgeHAgPSBfeHAoKTsKCiAgICAgICAgLy8gQ2FsY3VsYXRlIGQwIGFuZCBkMQogICAgICAgIHVpbnQyNTYgZDAgPSBfZ2V0RCh4cCk7CiAgICAgICAgdWludDI1NiBkMSA9IGQwIC0gKGQwICogc2hhcmVzKSAvIF90b3RhbFN1cHBseTsKCiAgICAgICAgLy8gQ2FsY3VsYXRlIHJlZHVjdGlvbiBpbiB5IGlmIEQgPSBkMQogICAgICAgIHVpbnQyNTYgeTAgPSBfZ2V0WUQoaSwgeHAsIGQxKTsKICAgICAgICAvLyBkMSA8PSBkMCBzbyB5IG11c3QgYmUgPD0geHBbaV0KICAgICAgICB1aW50MjU2IGR5MCA9ICh4cFtpXSAtIHkwKSAvIG11bHRpcGxpZXJzW2ldOwoKICAgICAgICAvLyBDYWxjdWxhdGUgaW1iYWxhbmNlIGZlZSwgdXBkYXRlIHhwIHdpdGggZmVlcwogICAgICAgIHVpbnQyNTYgZHg7CiAgICAgICAgZm9yICh1aW50MjU2IGo7IGogPCBOOyArK2opIHsKICAgICAgICAgICAgaWYgKGogPT0gaSkgewogICAgICAgICAgICAgICAgZHggPSAoeHBbal0gKiBkMSkgLyBkMCAtIHkwOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgLy8gZDEgLyBkMCA8PSAxCiAgICAgICAgICAgICAgICBkeCA9IHhwW2pdIC0gKHhwW2pdICogZDEpIC8gZDA7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgeHBbal0gLT0gKExJUVVJRElUWV9GRUUgKiBkeCkgLyBGRUVfREVOT01JTkFUT1I7CiAgICAgICAgfQoKICAgICAgICAvLyBSZWNhbGN1bGF0ZSB5IHdpdGggeHAgaW5jbHVkaW5nIGltYmFsYW5jZSBmZWVzCiAgICAgICAgdWludDI1NiB5MSA9IF9nZXRZRChpLCB4cCwgZDEpOwogICAgICAgIC8vIC0gMSB0byByb3VuZCBkb3duCiAgICAgICAgZHkgPSAoeHBbaV0gLSB5MSAtIDEpIC8gbXVsdGlwbGllcnNbaV07CiAgICAgICAgZmVlID0gZHkwIC0gZHk7CiAgICB9CgogICAgZnVuY3Rpb24gY2FsY1dpdGhkcmF3T25lVG9rZW4odWludDI1NiBzaGFyZXMsIHVpbnQyNTYgaSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2IGR5LCB1aW50MjU2IGZlZSkKICAgIHsKICAgICAgICByZXR1cm4gX2NhbGNXaXRoZHJhd09uZVRva2VuKHNoYXJlcywgaSk7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIFdpdGhkcmF3IGxpcXVpZGl0eSBpbiB0b2tlbiBpCiAgICAgKiBAcGFyYW0gc2hhcmVzIFNoYXJlcyB0byBidXJuCiAgICAgKiBAcGFyYW0gaSBUb2tlbiB0byB3aXRoZHJhdwogICAgICogQHBhcmFtIG1pbkFtb3VudE91dCBNaW5pbXVtIGFtb3VudCBvZiB0b2tlbiBpIHRoYXQgbXVzdCBiZSB3aXRoZHJhd24KICAgICAqLwogICAgZnVuY3Rpb24gcmVtb3ZlTGlxdWlkaXR5T25lVG9rZW4oCiAgICAgICAgdWludDI1NiBzaGFyZXMsCiAgICAgICAgdWludDI1NiBpLAogICAgICAgIHVpbnQyNTYgbWluQW1vdW50T3V0CiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KSB7CiAgICAgICAgKGFtb3VudE91dCwpID0gX2NhbGNXaXRoZHJhd09uZVRva2VuKHNoYXJlcywgaSk7CiAgICAgICAgcmVxdWlyZShhbW91bnRPdXQgPj0gbWluQW1vdW50T3V0LCAib3V0IDwgbWluIik7CgogICAgICAgIGJhbGFuY2VzW2ldIC09IGFtb3VudE91dDsKICAgICAgICBfYnVybihtc2cuc2VuZGVyLCBzaGFyZXMpOwoKICAgICAgICBJRVJDMjAodG9rZW5zW2ldKS50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnRPdXQpOwogICAgfQp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGJhbGFuY2VPZihhZGRyZXNzIGFjY291bnQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKICAgIGZ1bmN0aW9uIGFsbG93YW5jZShhZGRyZXNzIG93bmVyLCBhZGRyZXNzIHNwZW5kZXIpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3Mgc2VuZGVyLCBhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKfQo="}],Zm=`

                    Simplified version of Curve's stable swap AMM

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.24;
                     
                    @@ -5064,7 +5064,7 @@ Topics
                             external
                             returns (bool);
                     }
                    -
                    `,Wm=({prev:s,next:a})=>r.jsx(u,{version:mm,title:bm,description:wm,html:Zm,prev:s,next:a,codes:km}),Bm="0.8.24",Gm="Staking Rewards",Vm="Staking rewards contract based on Synthetix StakingRewards.sol",fm=[{fileName:"StakingRewards.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0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c3MgPT4gc3Rha2VkIGFtb3VudAogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfc3Rha2luZ1Rva2VuLCBhZGRyZXNzIF9yZXdhcmRUb2tlbikgewogICAgICAgIG93bmVyID0gbXNnLnNlbmRlcjsKICAgICAgICBzdGFraW5nVG9rZW4gPSBJRVJDMjAoX3N0YWtpbmdUb2tlbik7CiAgICAgICAgcmV3YXJkc1Rva2VuID0gSUVSQzIwKF9yZXdhcmRUb2tlbik7CiAgICB9CgogICAgbW9kaWZpZXIgb25seU93bmVyKCkgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBvd25lciwgIm5vdCBhdXRob3JpemVkIik7CiAgICAgICAgXzsKICAgIH0KCiAgICBtb2RpZmllciB1cGRhdGVSZXdhcmQoYWRkcmVzcyBfYWNjb3VudCkgewogICAgICAgIHJld2FyZFBlclRva2VuU3RvcmVkID0gcmV3YXJkUGVyVG9rZW4oKTsKICAgICAgICB1cGRhdGVkQXQgPSBsYXN0VGltZVJld2FyZEFwcGxpY2FibGUoKTsKCiAgICAgICAgaWYgKF9hY2NvdW50ICE9IGFkZHJlc3MoMCkpIHsKICAgICAgICAgICAgcmV3YXJkc1tfYWNjb3VudF0gPSBlYXJuZWQoX2FjY291bnQpOwogICAgICAgICAgICB1c2VyUmV3YXJkUGVyVG9rZW5QYWlkW19hY2NvdW50XSA9IHJld2FyZFBlclRva2VuU3RvcmVkOwogICAgICAgIH0KCiAgICAgICAgXzsKICAgIH0KCiAgICBmdW5jdGlvbiBsYXN0VGltZVJld2FyZEFwcGxpY2FibGUoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIF9taW4oZmluaXNoQXQsIGJsb2NrLnRpbWVzdGFtcCk7CiAgICB9CgogICAgZnVuY3Rpb24gcmV3YXJkUGVyVG9rZW4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dmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuICgKICAgICAgICAgICAgKAogICAgICAgICAgICAgICAgYmFsYW5jZU9mW19hY2NvdW50XQogICAgICAgICAgICAgICAgICAgICogKHJld2FyZFBlclRva2VuKCkgLSB1c2VyUmV3YXJkUGVyVG9rZW5QYWlkW19hY2NvdW50XSkKICAgICAgICAgICAgKSAvIDFlMTgKICAgICAgICApICsgcmV3YXJkc1tfYWNjb3VudF07CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UmV3YXJkKCkgZXh0ZXJuYWwgdXBkYXRlUmV3YXJkKG1zZy5zZW5kZXIpIHsKICAgICAgICB1aW50MjU2IHJld2FyZCA9IHJld2FyZHNbbXNnLnNlbmRlcl07CiAgICAgICAgaWYgKHJld2FyZCA+IDApIHsKICAgICAgICAgICAgcmV3YXJkc1ttc2cuc2VuZGVyXSA9IDA7CiAgICAgICAgICAgIHJld2FyZHNUb2tlbi50cmFuc2Zlcihtc2cuc2VuZGVyLCByZXdhcmQpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBzZXRSZXdhcmRzRHVyYXRpb24odWludDI1NiBfZHVyYXRpb24pIGV4dGVybmFsIG9ubHlPd25lciB7CiAgICAgICAgcmVxdWlyZShmaW5pc2hBdCA8IGJsb2NrLnRpbWVzdGFtcCwgInJld2FyZCBkdXJhdGlvbiBub3QgZmluaXNoZWQiKTsKICAgICAgICBkdXJhdGlvbiA9IF9kdXJhdGlvbjsKICAgIH0KCiAgICBmdW5jdGlvbiBub3RpZnlSZXdhcmRBbW91bnQodWludDI1NiBfYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgb25seU93bmVyCiAgICAgICAgdXBkYXRlUmV3YXJkKGFkZHJlc3MoMCkpCiAgICB7CiAgICAgICAgaWYgKGJsb2NrLnRpbWVzdGFtcCA+PSBmaW5pc2hBdCkgewogICAgICAgICAgICByZXdhcmRSYXRlID0gX2Ftb3VudCAvIGR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24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcyBzZW5kZXIsIGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwp9Cg=="}],Ym=`

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

                    +`,Wm=({prev:s,next:a})=>r.jsx(A,{version:mm,title:bm,description:wm,html:Zm,prev:s,next:a,codes:km}),Bm="0.8.24",Gm="Staking Rewards",Vm="Staking rewards contract based on Synthetix StakingRewards.sol",fm=[{fileName:"StakingRewards.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFN0YWtpbmdSZXdhcmRzIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHN0YWtpbmdUb2tlbjsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHJld2FyZHNUb2tlbjsKCiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICAvLyBEdXJhdGlvbiBvZiByZXdhcmRzIHRvIGJlIHBhaWQgb3V0IChpbiBzZWNvbmRzKQogICAgdWludDI1NiBwdWJsaWMgZHVyYXRpb247CiAgICAvLyBUaW1lc3RhbXAgb2Ygd2hlbiB0aGUgcmV3YXJkcyBmaW5pc2gKICAgIHVpbnQyNTYgcHVibGljIGZpbmlzaEF0OwogICAgLy8gTWluaW11bSBvZiBsYXN0IHV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wgIm5vdCBhdXRob3JpemVkIik7CiAgICAgICAgXzsKICAgIH0KCiAgICBtb2RpZmllciB1cGRhdGVSZXdhcmQoYWRkcmVzcyBfYWNjb3VudCkgewogICAgICAgIHJld2FyZFBlclRva2VuU3RvcmVkID0gcmV3YXJkUGVyVG9rZW4oKTsKICAgICAgICB1cGRhdGVkQXQgPSBsYXN0VGltZVJld2FyZEFwcGxpY2FibGUoKTsKCiAgICAgICAgaWYgKF9hY2NvdW50ICE9IGFkZHJlc3MoMCkpIHsKICAgICAgICAgICAgcmV3YXJkc1tfYWNjb3VudF0gPSBlYXJuZWQoX2FjY291bnQpOwogICAgICAgICAgICB1c2VyUmV3YXJkUGVyVG9rZW5QYWlkW19hY2NvdW50XSA9IHJld2FyZFBlclRva2VuU3RvcmVkOwogICAgICAgIH0KCiAgICAgICAgXzsKICAgIH0KCiAgICBmdW5jdGlvbiBsYXN0VGltZVJld2FyZEFwcGxpY2FibGUoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIF9taW4oZmluaXNoQXQsIGJsb2NrLnRpbWVzdGFtcCk7CiAgICB9CgogICAgZnVuY3Rpb24gcmV3YXJkUGVyVG9rZW4oKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgaWYgKHRvdGFsU3VwcGx5ID09IDApIHsKICAgICAgICAgICAgcmV0dXJuIHJld2FyZFBlclRva2VuU3RvcmVkOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIHJld2FyZFBlclRva2VuU3RvcmVkCiAgICAgICAgICAgICsgKHJld2FyZFJhdGUgKiAobGFzdFRpbWVSZXdhcmRBcHBsaWNhYmxlKCkgLSB1cGRhdGVkQXQpICogMWUxOCkKICAgICAgICAgICAgICAgIC8gdG90YWxTdXBwbHk7CiAgICB9CgogICAgZnVuY3Rpb24gc3Rha2UodWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB1cGRhdGVSZXdhcmQob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CiAgICAgICAgaWYgKHJld2FyZCA+IDApIHsKICAgICAgICAgICAgcmV3YXJkc1ttc2cuc2VuZGVyXSA9IDA7CiAgICAgICAgICAgIHJld2FyZHNUb2tlbi50cmFuc2Zlcihtc2cuc2VuZGVyLCByZXdhcmQpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBzZXRSZXdhcmRzRHVyYXRpb24odWludDI1NiBfZHVyYXRpb24pIGV4dGVybmFsIG9ubHlPd25lciB7CiAgICAgICAgcmVxdWlyZShmaW5pc2hBdCA8IGJsb2NrLnRpbWVzdGFtcCwgInJld2FyZCBkdXJhdGlvbiBub3QgZmluaXNoZWQiKTsKICAgICAgICBkdXJhdGlvbiA9IF9kdXJhdGlvbjsKICAgIH0KCiAgICBmdW5jdGlvbiBub3RpZnlSZXdhcmRBbW91bnQodWludDI1NiBfYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgb25seU93bmVyCiAgICAgICAgdXBkYXRlUmV3YXJkKGFkZHJlc3MoMCkpCiAgICB7CiAgICAgICAgaWYgKGJsb2NrLnRpbWVzdGFtcCA+PSBmaW5pc2hBdCkgewogICAgICAgICAgICByZXdhcmRSYXRlID0gX2Ftb3VudCAvIGR1cmF0aW9uOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHVpbnQyNTYgcmVtYWluaW5nUmV3YXJkcyA9IChmaW5pc2hBdCAtIGJsb2NrLnRpbWVzdGFtcCkgKiByZXdhcmRSYXRlOwogICAgICAgICAgICByZXdhcmRSYXRlID0gKF9hbW91bnQgKyByZW1haW5pbmdSZXdhcmRzKSAvIGR1cmF0aW9uOwogICAgICAgIH0KCiAgICAgICAgcmVxdWlyZShyZXdhcmRSYXRlID4gMCwgInJld2FyZCByYXRlID0gMCIpOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHJld2FyZFJhdGUgKiBkdXJhdGlvbiA8PSByZXdhcmRzVG9rZW4uYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpLAogICAgICAgICAgICAicmV3YXJkIGFtb3VudCA+IGJhbGFuY2UiCiAgICAgICAgKTsKCiAgICAgICAgZmluaXNoQXQgPSBibG9jay50aW1lc3RhbXAgKyBkdXJhdGlvbjsKICAgICAgICB1cGRhdGVkQXQgPSBibG9jay50aW1lc3RhbXA7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbih1aW50MjU2IHgsIHVpbnQyNTYgeSkgcHJpdmF0ZSBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICByZXR1cm4geCA8PSB5ID8geCA6IHk7CiAgICB9Cn0KCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcyBzZW5kZXIsIGFkZHJlc3MgcmVjaXBpZW50LCB1aW50MjU2IGFtb3VudCkKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKGJvb2wpOwp9Cg=="}],Ym=`

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

                    Code is a stripped down version of Synthetix StakingRewards.sol

                    Staking Rewards

                    // SPDX-License-Identifier: MIT
                    @@ -5211,7 +5211,7 @@ Topics
                             external
                             returns (bool);
                     }
                    -
                    `,Rm=({prev:s,next:a})=>r.jsx(u,{version:Bm,title:Gm,description:Vm,html:Ym,prev:s,next:a,codes:fm}),Xm="0.8.24",vm="Uniswap V2 Swap",Nm="Uniswap V2 swap",Hm=[{fileName:"UniswapV2SwapExamples.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFVuaXN3YXBWMlN3YXBFeGFtcGxlcyB7CiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgVU5JU1dBUF9WMl9ST1VURVIgPQogICAgICAgIDB4N2EyNTBkNTYzMEI0Y0Y1Mzk3MzlkRjJDNWRBY2I0YzY1OUYyNDg4RDsKCiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgV0VUSCA9IDB4QzAyYWFBMzliMjIzRkU4RDBBMGU1QzRGMjdlQUQ5MDgzQzc1NkNjMjsKICAgIGFkZHJlc3MgcHJpdmF0ZSBjb25zdGFudCBEQUkgPSAweDZCMTc1NDc0RTg5MDk0QzQ0RGE5OGI5NTRFZWRlQUM0OTUyNzFkMEY7CiAgICBhZGRyZXNzIGNvbnN0YW50IFVTREMgPSAweEEwYjg2OTkxYzYyMThiMzZjMWQxOUQ0YTJlOUViMGNFMzYwNmVCNDg7CgogICAgSVVuaXN3YXBWMlJvdXRlciBwcml2YXRlIHJvdXRlciA9IElVbmlzd2FwVjJSb3V0ZXIoVU5JU1dBUF9WMl9ST1VURVIpOwogICAgSUVSQzIwIHByaXZhdGUgd2V0aCA9IElFUkMyMChXRVRIKTsKICAgIElFUkMyMCBwcml2YXRlIGRhaSA9IElFUkMyMChEQUkpOwoKICAgIC8vIFN3YXAgV0VUSCB0byBEQUkKICAgIGZ1bmN0aW9uIHN3YXBTaW5nbGVIb3BFeGFjdEFtb3VudEluKHVpbnQyNTYgYW1vdW50SW4sIHVpbnQyNTYgYW1vdW50T3V0TWluKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAodWludDI1NiBhbW91bnRPdXQpCiAgICB7CiAgICAgICAgd2V0aC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW4pOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluKTsKCiAgICAgICAgYWRkcmVzc1tdIG1lbW9yeSBwYXRoOwogICAgICAgIHBhdGggPSBuZXcgYWRkcmVzc1tdKDIpOwogICAgICAgIHBhdGhbMF0gPSBXRVRIOwogICAgICAgIHBhdGhbMV0gPSBEQUk7CgogICAgICAgIHVpbnQyNTZbXSBtZW1vcnkgYW1vdW50cyA9IHJvdXRlci5zd2FwRXhhY3RUb2tlbnNGb3JUb2tlbnMoCiAgICAgICAgICAgIGFtb3VudEluLCBhbW91bnRPdXRNaW4sIHBhdGgsIG1zZy5zZW5kZXIsIGJsb2NrLnRpbWVzdGFtcAogICAgICAgICk7CgogICAgICAgIC8vIGFtb3VudHNbMF0gPSBXRVRIIGFtb3VudCwgYW1vdW50c1sxXSA9IERBSSBhbW91bnQKICAgICAgICByZXR1cm4gYW1vdW50c1sxXTsKICAgIH0KCiAgICAvLyBTd2FwIERBSSAtPiBXRVRIIC0+IFVTREMKICAgIGZ1bmN0aW9uIHN3YXBNdWx0aUhvcEV4YWN0QW1vdW50SW4odWludDI1NiBhbW91bnRJbiwgdWludDI1NiBhbW91bnRPdXRNaW4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zICh1aW50MjU2IGFtb3VudE91dCkKICAgIHsKICAgICAgICBkYWkudHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudEluKTsKICAgICAgICBkYWkuYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluKTsKCiAgICAgICAgYWRkcmVzc1tdIG1lbW9yeSBwYXRoOwogICAgICAgIHBhdGggPSBuZXcgYWRkcmVzc1tdKDMpOwogICAgICAgIHBhdGhbMF0gPSBEQUk7CiAgICAgICAgcGF0aFsxXSA9IFdFVEg7CiAgICAgICAgcGF0aFsyXSA9IFVTREM7CgogICAgICAgIHVpbnQyNTZbXSBtZW1vcnkgYW1vdW50cyA9IHJvdXRlci5zd2FwRXhhY3RUb2tlbnNGb3JUb2tlbnMoCiAgICAgICAgICAgIGFtb3VudEluLCBhbW91bnRPdXRNaW4sIHBhdGgsIG1zZy5zZW5kZXIsIGJsb2NrLnRpbWVzdGFtcAogICAgICAgICk7CgogICAgICAgIC8vIGFtb3VudHNbMF0gPSBEQUkgYW1vdW50CiAgICAgICAgLy8gYW1vdW50c1sxXSA9IFdFVEggYW1vdW50CiAgICAgICAgLy8gYW1vdW50c1syXSA9IFVTREMgYW1vdW50CiAgICAgICAgcmV0dXJuIGFtb3VudHNbMl07CiAgICB9CgogICAgLy8gU3dhcCBXRVRIIHRvIERBSQogICAgZnVuY3Rpb24gc3dhcFNpbmdsZUhvcEV4YWN0QW1vdW50T3V0KAogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0RGVzaXJlZCwKICAgICAgICB1aW50MjU2IGFtb3VudEluTWF4CiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KSB7CiAgICAgICAgd2V0aC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW5NYXgpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluTWF4KTsKCiAgICAgICAgYWRkcmVzc1tdIG1lbW9yeSBwYXRoOwogICAgICAgIHBhdGggPSBuZXcgYWRkcmVzc1tdKDIpOwogICAgICAgIHBhdGhbMF0gPS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Byb3V0ZXIuc3dhcFRva2Vuc0ZvckV4YWN0VG9rZW5zKAogICAgICAgICAgICBhbW91bnRPdXREZXNpcmVkLCBhbW91bnRJbk1heCwgcGF0aCwgbXNnLnNlbmRlciwgYmxvY2sudGltZXN0YW1wCiAgICAgICAgKTsKCiAgICAgICAgLy8gUmVmdW5kIERBSSB0byBtc2cuc2VuZGVyCiAgICAgICAgaWYgKGFtb3VudHNbMF0gPCBhbW91bnRJbk1heCkgewogICAgICAgICAgICBkYWkudHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50SW5NYXggLSBhbW91bnRzWzBdKTsKICAgICAgICB9CgogICAgICAgIHJldHVybiBhbW91bnRzWzJdOwogICAgfQp9CgppbnRlcmZhY2UgSVVuaXN3YXBWMlJvdXRlciB7CiAgICBmdW5jdGlvbiBzd2FwRXhhY3RUb2tlbnNGb3JUb2tlbnMoCiAgICAgICAgdWludDI1NiBhbW91bnRJbiwKICAgICAgICB1aW50MjU2IGFtb3VudE91dE1pbiwKICAgICAgICBhZGRyZXNzW10gY2FsbGRhdGEgcGF0aCwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTYgZGVhZGxpbmUKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludDI1NltdIG1lbW9yeSBhbW91bnRzKTsKCiAgICBmdW5jdGlvbiBzd2FwVG9rZW5zRm9yRXhhY3RUb2tlbnMoCiAgICAgICAgdWludDI1NiBhbW91bnRPdXQsCiAgICAgICAgdWludDI1NiBhbW91bnRJbk1heCwKICAgICAgICBhZGRyZXNzW10gY2FsbGRhdGEgcGF0aCwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTYgZGVhZGxpbmUKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludDI1NltdIG1lbW9yeSBhbW91bnRzKTsKfQoKaW50ZXJmYWNlIElFUkMyMCB7CiAgICBmdW5jdGlvbiB0b3RhbFN1cHBseSgpIGV4dGVybmFsIHZpZXcg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50T3V0LCB1c2RjQW1vdW50T3V0TWluLCAiYW1vdW50IG91dCA8IG1pbiIpOwogICAgfQoKICAgIC8vIFN3YXAgV0VUSCAtPiBEQUkKICAgIGZ1bmN0aW9uIHRlc3RTd2FwU2luZ2xlSG9wRXhhY3RBbW91bnRPdXQoKSBwdWJsaWMgewogICAgICAgIHVpbnQyNTYgd2V0aEFtb3VudCA9IDFlMTg7CiAgICAgICAgd2V0aC5kZXBvc2l0e3ZhbHVlOiB3ZXRoQW1vdW50fSgpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHVuaSksIHdldGhBbW91bnQpOwoKICAgICAgICB1aW50MjU2IGRhaUFtb3VudERlc2lyZWQgPSAxZTE4OwogICAgICAgIHVpbnQyNTYgZGFpQW1vdW50T3V0ID0KICAgICAgICAgICAgdW5pLnN3YXBTaW5nbGVIb3BFeGFjdEFtb3VudE91dChkYWlBbW91bnREZXNpcmVkLCB3ZXRoQW1vdW50KTsKCiAgICAgICAgY29uc29sZTIubG9nKCJEQUkiLCBkYWlBbW91bnRPdXQpOwogICAgICAgIGFzc2VydEVxKAogICAgICAgICAgICBkYWlBbW91bnRPdXQsIGRhaUFtb3VudERlc2lyZWQsICJhbW91bnQgb3V0ICE9IGFtb3VudCBvdXQgZGVzaXJlZCIKICAgICAgICApOwogICAgfQoKICAgIC8vIFN3YXAgREFJIC0+IFdFVEggLT4gVVNEQwogICAgZnVuY3Rpb24gdGVzdFN3YXBNdWx0aUhvcEV4YWN0QW1vdW50T3V0KCkgcHVibGljIHsKICAgICAgICAvLyBTd2FwIFdFVEggLT4gREFJCiAgICAgICAgdWludDI1NiB3ZXRoQW1vdW50ID0gMWUxODsKICAgICAgICB3ZXRoLmRlcG9zaXR7dmFsdWU6IHdldGhBbW91bnR9KCk7CiAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3ModW5pKSwgd2V0aEFtb3VudCk7CgogICAgICAgIC8vIEJ1eSAxMDAgREFJCiAgICAgICAgdWludDI1NiBkYWlBbW91bnRPdXQgPSAxMDAgKiAxZTE4OwogICAgICAgIHVuaS5zd2FwU2luZ2xlSG9wRXhhY3RBbW91bnRPdXQoZGFpQW1vdW50T3V0LCB3ZXRoQW1vdW50KTsKCiAgICAgICAgLy8gU3dhcCBEQUkgLT4gV0VUSCAtPiBVU0RDCiAgICAgICAgZGFpLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCBkYWlBbW91bnRPdXQpOwoKICAgICAgICB1aW50MjU2IGFtb3VudE91dERlc2lyZWQgPSAxZTY7CiAgICAgICAgdWludDI1NiBhbW91bnRPdXQgPQogICAgICAgICAgICB1bmkuc3dhcE11bHRpSG9wRXhhY3RBbW91bnRPdXQoYW1vdW50T3V0RGVzaXJlZCwgZGFpQW1vdW50T3V0KTsKCiAgICAgICAgY29uc29sZTIubG9nKCJVU0RDIiwgYW1vdW50T3V0KTsKICAgICAgICBhc3NlcnRFcSgKICAgICAgICAgICAgYW1vdW50T3V0LCBhbW91bnRPdXREZXNpcmVkLCAiYW1vdW50IG91dCAhPSBhbW91bnQgb3V0IGRlc2lyZWQiCiAgICAgICAgKTsKICAgIH0KfQo="}],Fm=`

                    swapExactTokensForTokens sells all tokens for another.

                    +`,Rm=({prev:s,next:a})=>r.jsx(A,{version:Bm,title:Gm,description:Vm,html:Ym,prev:s,next:a,codes:fm}),Xm="0.8.24",vm="Uniswap V2 Swap",Nm="Uniswap V2 swap",Hm=[{fileName:"UniswapV2SwapExamples.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFVuaXN3YXBWMlN3YXBFeGFtcGxlcyB7CiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgVU5JU1dBUF9WMl9ST1VURVIgPQogICAgICAgIDB4N2EyNTBkNTYzMEI0Y0Y1Mzk3MzlkRjJDNWRBY2I0YzY1OUYyNDg4RDsKCiAgICBhZGRyZXNz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tlbnMoCiAgICAgICAgICAgIGFtb3VudEluLCBhbW91bnRPdXRNaW4sIHBhdGgsIG1zZy5zZW5kZXIsIGJsb2NrLnRpbWVzdGFtcAogICAgICAgICk7CgogICAgICAgIC8vIGFtb3VudHNbMF0gPSBXRVRIIGFtb3VudCwgYW1vdW50c1sxXSA9IERBSSBhbW91bnQKICAgICAgICByZXR1cm4gYW1vdW50c1sxXTsKICAgIH0KCiAgICAvLyBTd2FwIERBSSAtPiBXRVRIIC0+IFVTREMKICAgIGZ1bmN0aW9uIHN3YXBNdWx0aUhvcEV4YWN0QW1vdW50SW4odWludDI1NiBhbW91bnRJbiwgdWludDI1NiBhbW91bnRPdXRNaW4pCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zICh1aW50MjU2IGFtb3VudE91dCkKICAgIHsKICAgICAgICBkYWkudHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudEluKTsKICAgICAgICBkYWkuYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluKTsKCiAgICAgICAgYWRkcmVzc1tdIG1lbW9yeSBwYXRoOwogICAgICAgIHBhdGggPSBuZXcgYWRkcmVzc1tdKDMpOwogICAgICAgIHBhdGhbMF0gPSBEQUk7CiAgICAgICAgcGF0aFsxXSA9IFdFVEg7CiAgICAgICAgcGF0aFsyXSA9IFVTREM7CgogICAgICAgIHVpbnQyNTZbXSBtZW1vcnkgYW1vdW50cyA9IHJvdXRlci5zd2FwRXhhY3RUb2tlbnNGb3JUb2tlbnMoCiAgICAgICAgICAgIGFtb3VudEluLCBhbW91bnRPdXRNaW4sIHBhdGgsIG1zZy5zZW5kZXIsIGJsb2NrLnRpbWVzdGFtcAogICAgICAgICk7CgogICAgICAgIC8vIGFtb3VudHNbMF0gPSBEQUkgYW1vdW50CiAgICAgICAgLy8gYW1vdW50c1sxXSA9IFdFVEggYW1vdW50CiAgICAgICAgLy8gYW1vdW50c1syXSA9IFVTREMgYW1vdW50CiAgICAgICAgcmV0dXJuIGFtb3VudHNbMl07CiAgICB9CgogICAgLy8gU3dhcCBXRVRIIHRvIERBSQogICAgZnVuY3Rpb24gc3dhcFNpbmdsZUhvcEV4YWN0QW1vdW50T3V0KAogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0RGVzaXJlZCwKICAgICAgICB1aW50MjU2IGFtb3VudEluTWF4CiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KSB7CiAgICAgICAgd2V0aC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW5NYXgpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluTWF4KTsKCiAgICAgICAgYWRkcmVzc1tdIG1lbW9yeSBwYXRoOwogICAgICAgIHBhdGggPSBuZXcgYWRkcmVzc1tdKDIpOwogICAgICAgIHBhdGhbMF0gPSBXRVRIOwogICAgICAgIHBhdGhbMV0gPSBEQUk7CgogICAgICAgIHVpbnQyNTZbXSBtZW1vcnkgYW1vdW50cyA9IHJvdXRlci5zd2FwVG9rZW5zRm9yRXhhY3RUb2tlbnMoCiAgICAgICAgICAgIGFtb3VudE91dERlc2lyZWQsIGFtb3VudEluTWF4LCBwYXRoLCBtc2cuc2VuZGVyLCBibG9jay50aW1lc3RhbXAKICAgICAgICApOwoKICAgICAgICAvLyBSZWZ1bmQgV0VUSCB0byBtc2cuc2VuZGVyCiAgICAgICAgaWYgKGFtb3VudHNbMF0gPCBhbW91bnRJbk1heCkgewogICAgICAgICAgICB3ZXRoLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudEluTWF4IC0gYW1vdW50c1swXSk7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gYW1vdW50c1sxXTsKICAgIH0KCiAgICAvLyBTd2FwIERBSSAtPiBXRVRIIC0+IFVTREMKICAgIGZ1bmN0aW9uIHN3YXBNdWx0aUhvcEV4YWN0QW1vdW50T3V0KAogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0RGVzaXJlZCwKICAgICAgICB1aW50MjU2IGFtb3VudEluTWF4CiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KSB7CiAgICAgICAgZGFpLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBhbW91bnRJbk1heCk7CiAgICAgICAgZGFpLmFwcHJvdmUoYWRkcmVzcyhyb3V0ZXIpLCBhbW91bnRJbk1heCk7CgogICAgICAgIGFkZHJlc3NbXSBtZW1vcnkgcGF0aDsKICAgICAgICBwYXRoID0gbmV3IGFkZHJlc3NbXSgzKTsKICAgICAgICBwYXRoWzBdID0gREFJOwogICAgICAgIHBhdGhbMV0gPSBXRVRIOwogICAgICAgIHBhdGhbMl0gPSBVU0RDOwoKICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFtb3VudHMgPSByb3V0ZXIuc3dhcFRva2Vuc0ZvckV4YWN0VG9rZW5zKAogICAgICAgICAgICBhbW91bnRPdXREZXNpcmVkLCBhbW91bnRJbk1heCwgcGF0aCwgbXNnLnNlbmRlciwgYmxvY2sudGltZXN0YW1wCiAgICAgICAgKTsKCiAgICAgICAgLy8gUmVmdW5kIERBSSB0byBtc2cuc2VuZGVyCiAgICAgICAgaWYgKGFtb3VudHNbMF0gPCBhbW91bnRJbk1heCkgewogICAgICAgICAgICBkYWkudHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50SW5NYXggLSBhbW91bnRzWzBdKTsKICAgICAgICB9CgogICAgICAgIHJldHVybiBhbW91bnRzWzJdOwogICAgfQp9CgppbnRlcmZhY2UgSVVuaXN3YXBWMlJvdXRlciB7CiAgICBmdW5jdGlvbiBzd2FwRXhhY3RUb2tlbnNGb3JUb2tlbnMoCiAgICAgICAgdWludDI1NiBhbW91bnRJbiwKICAgICAgICB1aW50MjU2IGFtb3VudE91dE1pbiwKIC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G9nKCJEQUkiLCBkYWlBbW91bnRPdXQpOwogICAgICAgIGFzc2VydEVxKAogICAgICAgICAgICBkYWlBbW91bnRPdXQsIGRhaUFtb3VudERlc2lyZWQsICJhbW91bnQgb3V0ICE9IGFtb3VudCBvdXQgZGVzaXJlZCIKICAgICAgICApOwogICAgfQoKICAgIC8vIFN3YXAgREFJIC0+IFdFVEggLT4gVVNEQwogICAgZnVuY3Rpb24gdGVzdFN3YXBNdWx0aUhvcEV4YWN0QW1vdW50T3V0KCkgcHVibGljIHsKICAgICAgICAvLyBTd2FwIFdFVEggLT4gREFJCiAgICAgICAgdWludDI1NiB3ZXRoQW1vdW50ID0gMWUxODsKICAgICAgICB3ZXRoLmRlcG9zaXR7dmFsdWU6IHdldGhBbW91bnR9KCk7CiAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3ModW5pKSwgd2V0aEFtb3VudCk7CgogICAgICAgIC8vIEJ1eSAxMDAgREFJCiAgICAgICAgdWludDI1NiBkYWlBbW91bnRPdXQgPSAxMDAgKiAxZTE4OwogICAgICAgIHVuaS5zd2FwU2luZ2xlSG9wRXhhY3RBbW91bnRPdXQoZGFpQW1vdW50T3V0LCB3ZXRoQW1vdW50KTsKCiAgICAgICAgLy8gU3dhcCBEQUkgLT4gV0VUSCAtPiBVU0RDCiAgICAgICAgZGFpLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCBkYWlBbW91bnRPdXQpOwoKICAgICAgICB1aW50MjU2IGFtb3VudE91dERlc2lyZWQgPSAxZTY7CiAgICAgICAgdWludDI1NiBhbW91bnRPdXQgPQogICAgICAgICAgICB1bmkuc3dhcE11bHRpSG9wRXhhY3RBbW91bnRPdXQoYW1vdW50T3V0RGVzaXJlZCwgZGFpQW1vdW50T3V0KTsKCiAgICAgICAgY29uc29sZTIubG9nKCJVU0RDIiwgYW1vdW50T3V0KTsKICAgICAgICBhc3NlcnRFcSgKICAgICAgICAgICAgYW1vdW50T3V0LCBhbW91bnRPdXREZXNpcmVkLCAiYW1vdW50IG91dCAhPSBhbW91bnQgb3V0IGRlc2lyZWQiCiAgICAgICAgKTsKICAgIH0KfQo="}],Fm=`

                    swapExactTokensForTokens sells all tokens for another.

                    swapTokensForExactTokens buys specific amount of tokens set by the caller.

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.24;
                    @@ -5463,7 +5463,7 @@ Topics
                             );
                         }
                     }
                    -
                    `,Km=({prev:s,next:a})=>r.jsx(u,{version:Xm,title:vm,description:Nm,html:Fm,prev:s,next:a,codes:Hm}),Mm="0.8.24",Sm="Uniswap V2 Add Remove Liquidity",xm="Uniswap V2 add remove liquidity",Jm=[{fileName:"UniswapV2Liquidity.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFVuaXN3YXBWMkFkZExpcXVpZGl0eSB7CiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgRkFDVE9SWSA9CiAgICAgICAgMHg1QzY5YkVlNzAxZWY4MTRhMkI2YTNFREQ0QjE2NTJDQjljYzVhQTZmOwogICAgYWRkcmVzcyBwcml2YXRlIGNvbnN0YW50IFJPVVRFUiA9IDB4N2EyNTBkNTYzMEI0Y0Y1Mzk3MzlkRjJDNWRBY2I0YzY1OUYyNDg4RDsKICAgIGFkZHJlc3MgcHJpdmF0ZSBjb25zdGFudCBXRVRIID0gMHhDMDJhYUEzOWIyMjNGRThEMEEwZTVDNEYyN2VBRDkwODNDNzU2Q2MyOwogICAgYWRkcmVzcyBwcml2YXRlIGNvbnN0YW50IFVTRFQgPSAweGRBQzE3Rjk1OEQyZWU1MjNhMjIwNjIwNjk5NDU5N0MxM0Q4MzFlYzc7CgogICAgZnVuY3Rpb24gYWRkTGlxdWlkaXR5KAogICAgICAgIGFkZHJlc3MgX3Rva2VuQSwKICAgICAgICBhZGRyZXNzIF90b2tlbkIsCiAgICAgICAgdWludDI1NiBfYW1vdW50QSwKICAgICAgICB1aW50MjU2IF9hbW91bnRCCiAgICApIGV4dGVybmFsIHsKICAgICAgICBzYWZlVHJhbnNmZXJGcm9tKElFUkMyMChfdG9rZW5BKSwgbXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudEEpOwogICAgICAgIHNhZmVUcmFuc2ZlckZyb20oSUVSQzIwKF90b2tlbkIpLCBtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBfYW1vdW50Qik7CgogICAgICAgIHNhZmVBcHByb3ZlKElFUkMyMChfdG9rZW5BKSwgUk9VVEVSLCBfYW1vdW50QSk7CiAgICAgICAgc2FmZUFwcHJvdmUoSUVSQzIwKF90b2tlbkIpLCBST1VURVIsIF9hbW91bnRCKTsKCiAgICAgICAgKHVpbnQyNTYgYW1vdW50QSwgdWludDI1NiBhbW91bnRCLCB1aW50MjU2IGxpcXVpZGl0eSkgPSBJVW5pc3dhcFYyUm91dGVyKAogICAgICAgICAgICBST1VURVIKICAgICAgICApLmFkZExpcXVpZGl0eSgKICAgICAgICAgICAgX3Rva2VuQSwKICAgICAgICAgICAgX3Rva2VuQiwKICAgICAgICAgICAgX2Ftb3VudEEsCiAgICAgICAgICAgIF9hbW91bnRCLAogICAgICAgICAgICAxLAogICAgICAgICAgICAxLAogICAgICAgICAgICBhZGRyZXNzKHRoaXMpLAogICAgICAgICAgICBibG9jay50aW1lc3RhbXAKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZUxpcXVpZGl0eShhZGRyZXNzIF90b2tlbkEsIGFkZHJlc3MgX3Rva2VuQikgZXh0ZXJuYWwgewogICAgICAgIGFkZHJlc3MgcGFpciA9IElVbmlzd2FwVjJGYWN0b3J5KEZBQ1RPUlkpLmdldFBhaXIoX3Rva2VuQSwgX3Rva2VuQik7CgogICAgICAgIHVpbnQyNTYgbGlxdWlkaXR5ID0gSUVSQzIwKHBhaXIpLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKT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BhbW91bnRCRGVzaXJlZCwKICAgICAgICB1aW50MjU2IGFtb3VudEFNaW4sCiAgICAgICAgdWludDI1NiBhbW91bnRCTWluLAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludDI1NiBkZWFkbGluZQogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50MjU2IGFtb3VudEEsIHVpbnQyNTYgYW1vdW50QiwgdWludDI1NiBsaXF1aWRpdHkpOwoKICAgIGZ1bmN0aW9uIHJlbW92ZUxpcXVpZGl0eSgKICAgICAgICBhZGRyZXNzIHRva2VuQSwKICAgICAgICBhZGRyZXNzIHRva2VuQiwKICAgICAgICB1aW50MjU2IGxpcXVpZGl0eSwKICAgICAgICB1aW50MjU2IGFtb3VudEFNaW4sCiAgICAgICAgdWludDI1NiBhbW91bnRCTWluLAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludDI1NiBkZWFkbGluZQogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50MjU2IGFtb3VudEEsIHVpbnQyNTYgYW1vdW50Qik7Cn0KCmludGVyZmFjZSBJVW5pc3dhcFYyRmFjdG9yeSB7CiAgICBmdW5jdGlvbiBnZXRQYWlyKGFkZHJlc3MgdG9rZW4wLCBhZGRyZXNzIHRva2VuMSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChhZGRyZXNzKTsKfQoKaW50ZXJmYWNlIElFUkMyMCB7CiAgICBmdW5jdGlvbiB0b3RhbFN1cHBseSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBhY2NvdW50KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyByZWNpcGllbnQsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyA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gaW50ZXJuYWwKICAgIHsKICAgICAgICAoYm9vbCBzdWNjZXNzLCBieXRlcyBtZW1vcnkgcmV0dXJuRGF0YSkgPSBhZGRyZXNzKHRva2VuKS5jYWxsKAogICAgICAgICAgICBhYmkuZW5jb2RlQ2FsbChJRVJDMjAuYXBwcm92ZSwgKHNwZW5kZXIsIGFtb3VudCkpCiAgICAgICAgKTsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBzdWNjZXNzCiAgICAgICAgICAgICAgICAmJiAocmV0dXJuRGF0YS5sZW5ndGggPT0gMCB8fCBhYmkuZGVjb2RlKHJldHVybkRhdGEsIChib29sKSkpLAogICAgICAgICAgICAiQXBwcm92ZSBmYWlsIgogICAgICAgICk7CiAgICB9Cn0K"}],zm=`

                    Add / Remove Liquidity

                    +`,Km=({prev:s,next:a})=>r.jsx(A,{version:Xm,title:vm,description:Nm,html:Fm,prev:s,next:a,codes:Hm}),Mm="0.8.24",Sm="Uniswap V2 Add Remove Liquidity",xm="Uniswap V2 add remove liquidity",Jm=[{fileName:"UniswapV2Liquidity.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFVuaXN3YXBWMkFkZExpcXVpZGl0eSB7CiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgRkFDVE9SWSA9CiAgICAgICAgMHg1QzY5YkVlNzAxZWY4MTRhMkI2YTNFREQ0QjE2NTJDQjljYzVhQTZmOwogICAgYWRkcmVzcyBwcml2YXRlIGNvbnN0YW50IFJPVVRFUiA9IDB4N2EyNTBkNTYzMEI0Y0Y1Mzk3MzlkRjJDNWRBY2I0YzY1OUYyNDg4RDsKICAgIGFkZHJlc3MgcHJpdmF0ZSBjb25zdGFudCBXRVRIID0gMHhDMDJhYUEzOWIyMjNGRThEMEEwZTVDNEYyN2VBRDkwODNDNzU2Q2MyOwogICAgYWRkcmVzcyBwcml2YXRlIGNvbnN0YW50IFVTRFQgPSAweGRBQzE3Rjk1OEQyZWU1MjNhMjIwNjIwNjk5NDU5N0MxM0Q4MzFlYzc7CgogICAgZnVuY3Rpb24gYWRkTGlxdWlkaXR5KAogICAgICAgIGFkZHJlc3MgX3Rva2VuQSwKICAgICAgICBhZGRyZXNzIF90b2tlbkIsCiAgICAgICAgdWludDI1NiBfYW1vdW50QSwKICAgICAgICB1aW50MjU2IF9hbW91bnRCCiAgICApIGV4dGVybmFsIHsKICAgICAgICBzYWZlVHJhbnNmZXJGcm9tKElFUkMyMChfdG9rZW5BKSwgbXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudEEpOwogICAgICAgIHNhZmVUcmFuc2ZlckZyb20oSUVSQzIwKF90b2tlbkIpLCBtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBfYW1vdW50Qik7CgogICAgICAgIHNhZmVBcHByb3ZlKElFUkMyMChfdG9rZW5BKSwgUk9VVEVSLCBfYW1vdW50QSk7CiAgICAgICAgc2FmZUFwcHJvdmUoSUVSQzIwKF90b2tlbkIpLCBST1VURVIsIF9hbW91bnRCKTsKCiAgICAgICAgKHVpbnQyNTYgYW1vdW50QSwgdWludDI1NiBhbW91bnRCLCB1aW50MjU2IGxpcXVpZGl0eSkgPSBJVW5pc3dhcFYyUm91dGVyKAogICAgICAgICAgICBST1VURVIKICAgICAgICApLmFkZExpcXVpZGl0eSgKICAgICAgICAgICAgX3Rva2VuQSwKICAgICAgICAgICAgX3Rva2VuQiwKICAgICAgICAgICAgX2Ftb3VudEEsCiAgICAgICAgICAgIF9hbW91bnRCLAogICAgICAgICAgICAxLAogICAgICAgICAgICAxLAogICAgICAgICAgICBhZGRyZXNzKHRoaXMpLAogICAgICAgICAgICBibG9jay50aW1lc3RhbXAKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZUxpcXVpZGl0eShhZGRyZXNzIF90b2tlbkEsIGFkZHJlc3MgX3Rva2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sbCgKICAgICAgICAgICAgYWJpLmVuY29kZUNhbGwoSUVSQzIwLnRyYW5zZmVyRnJvbSwgKHNlbmRlciwgcmVjaXBpZW50LCBhbW91bnQpKQogICAgICAgICk7CiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgc3VjY2VzcwogICAgICAgICAgICAgICAgJiYgKHJldHVybkRhdGEubGVuZ3RoID09IDAgfHwgYWJpLmRlY29kZShyZXR1cm5EYXRhLCAoYm9vbCkpKSwKICAgICAgICAgICAgIlRyYW5zZmVyIGZyb20gZmFpbCIKICAgICAgICApOwogICAgfQoKICAgIC8qKgogICAgICogQGRldiBUaGUgYXBwcm92ZSBmdW5jdGlvbiBtYXkgb3IgbWF5IG5vdCByZXR1cm4gYSBib29sLgogICAgICogVGhlIEVSQy0yMCBzcGVjIHJldHVybnMgYSBib29sLCBidXQgc29tZSB0b2tlbnMgZG9uJ3QgZm9sbG93IHRoZSBzcGVjLgogICAgICogTmVlZCB0byBjaGVjayBpZiBkYXRhIGlzIGVtcHR5IG9yIHRydWUuCiAgICAgKi8KICAgIGZ1bmN0aW9uIHNhZmVBcHByb3ZlKElFUkMyMCB0b2tlbiwgYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkKICAgICAgICBpbnRlcm5hbAogICAgewogICAgICAgIChib29sIHN1Y2Nlc3MsIGJ5dGVzIG1lbW9yeSByZXR1cm5EYXRhKSA9IGFkZHJlc3ModG9rZW4pLmNhbGwoCiAgICAgICAgICAgIGFiaS5lbmNvZGVDYWxsKElFUkMyMC5hcHByb3ZlLCAoc3BlbmRlciwgYW1vdW50KSkKICAgICAgICApOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHN1Y2Nlc3MKICAgICAgICAgICAgICAgICYmIChyZXR1cm5EYXRhLmxlbmd0aCA9PSAwIHx8IGFiaS5kZWNvZGUocmV0dXJuRGF0YSwgKGJvb2wpKSksCiAgICAgICAgICAgICJBcHByb3ZlIGZhaWwiCiAgICAgICAgKTsKICAgIH0KfQoKaW50ZXJmYWNlIElVbmlzd2FwVjJSb3V0ZXIgewogICAgZnVuY3Rpb24gYWRkTGlxdWlkaXR5KAogICAgICAgIGFkZHJlc3MgdG9rZW5BLAogICAgICAgIGFkZHJlc3MgdG9rZW5CLAogICAgICAgIHVpbnQyNTYgYW1vdW50QURlc2lyZWQsCiAgICAgICAgdWludDI1NiBhbW91bnRCRGVzaXJlZCwKICAgICAgICB1aW50MjU2IGFtb3VudEFNaW4sCiAgICAgICAgdWludDI1NiBhbW91bnRCTWluLAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludDI1NiBkZWFkbGluZQogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50MjU2IGFtb3VudEEsIHVpbnQyNTYgYW1vdW50QiwgdWludDI1NiBsaXF1aWRpdHkpOwoKICAgIGZ1bmN0aW9uIHJlbW92ZUxpcXVpZGl0eSgKICAgICAgICBhZGRyZXNzIHRva2VuQSwKICAgICAgICBhZGRyZXNzIHRva2VuQiwKICAgICAgICB1aW50MjU2IGxpcXVpZGl0eSwKICAgICAgICB1aW50MjU2IGFtb3VudEFNaW4sCiAgICAgICAgdWludDI1NiBhbW91bnRCTWluLAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludDI1NiBkZWFkbGluZQogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50MjU2IGFtb3VudEEsIHVpbnQyNTYgYW1vdW50Qik7Cn0KCmludGVyZmFjZSBJVW5pc3dhcFYyRmFjdG9yeSB7CiAgICBmdW5jdGlvbiBnZXRQYWlyKGFkZHJlc3MgdG9rZW4wLCBhZGRyZXNzIHRva2VuMSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zIChhZGRyZXNzKTsKfQoKaW50ZXJmYWNlIElFUkMyMCB7CiAgICBmdW5jdGlvbiB0b3RhbFN1cHBseSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7C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rZW5zIGRvbid0IGZvbGxvdyB0aGUgc3BlYy4KICAgICAqIE5lZWQgdG8gY2hlY2sgaWYgZGF0YSBpcyBlbXB0eSBvciB0cnVlLgogICAgICovCiAgICBmdW5jdGlvbiBzYWZlQXBwcm92ZShJRVJDMjAgdG9rZW4sIGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpCiAgICAgICAgaW50ZXJuYWwKICAgIHsKICAgICAgICAoYm9vbCBzdWNjZXNzLCBieXRlcyBtZW1vcnkgcmV0dXJuRGF0YSkgPSBhZGRyZXNzKHRva2VuKS5jYWxsKAogICAgICAgICAgICBhYmkuZW5jb2RlQ2FsbChJRVJDMjAuYXBwcm92ZSwgKHNwZW5kZXIsIGFtb3VudCkpCiAgICAgICAgKTsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBzdWNjZXNzCiAgICAgICAgICAgICAgICAmJiAocmV0dXJuRGF0YS5sZW5ndGggPT0gMCB8fCBhYmkuZGVjb2RlKHJldHVybkRhdGEsIChib29sKSkpLAogICAgICAgICAgICAiQXBwcm92ZSBmYWlsIgogICAgICAgICk7CiAgICB9Cn0K"}],zm=`

                    Add / Remove Liquidity

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.24;
                     
                    @@ -5687,7 +5687,7 @@ IERC20 constant PAIR Uniswap V2 Flash Swap Example
                    +
                    `,Dm=({prev:s,next:a})=>r.jsx(A,{version:Mm,title:Sm,description:xm,html:zm,prev:s,next:a,codes:Jm}),Em="0.8.24",Qm="Uniswap V2 Flash Swap",Tm="Uniswap V2 flash swap",Um=[{fileName:"UniswapV2FlashSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJVW5pc3dhcFYyQ2FsbGVlIHsKICAgIGZ1bmN0aW9uIHVuaXN3YXBWMkNhbGwoCiAgICAgICAgYWRkcmVzcyBzZW5kZXIsCiAgIC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lOUViMGNFMzYwNmVCNDg7Cgpjb250cmFjdCBVbmlzd2FwVjJGbGFzaFN3YXBUZXN0IGlzIFRlc3QgewogICAgSVdFVEggcHJpdmF0ZSB3ZXRoID0gSVdFVEgoV0VUSCk7CgogICAgVW5pc3dhcFYyRmxhc2hTd2FwIHByaXZhdGUgdW5pID0gbmV3IFVuaXN3YXBWMkZsYXNoU3dhcCgpOwoKICAgIGZ1bmN0aW9uIHNldFVwKCkgcHVibGljIHt9CgogICAgZnVuY3Rpb24gdGVzdEZsYXNoU3dhcCgpIHB1YmxpYyB7CiAgICAgICAgd2V0aC5kZXBvc2l0e3ZhbHVlOiAxZTE4fSgpOwogICAgICAgIC8vIEFwcHJvdmUgZmxhc2ggc3dhcCBmZWUKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCAxZTE4KTsKCiAgICAgICAgdWludDI1NiBhbW91bnRUb0JvcnJvdyA9IDEwICogMWUxODsKICAgICAgICB1bmkuZmxhc2hTd2FwKGFtb3VudFRvQm9ycm93KTsKCiAgICAgICAgYXNzZXJ0R3QodW5pLmFtb3VudFRvUmVwYXkoKSwgYW1vdW50VG9Cb3Jyb3cpOwogICAgfQp9Cg=="}],_m=`

                    Uniswap V2 Flash Swap Example

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

                    Uniswap V3 Foundry example

                    -`,Lm=({prev:s,next:a})=>r.jsx(u,{version:Em,title:Qm,description:Tm,html:_m,prev:s,next:a,codes:Um}),Om="0.8.24",Pm="Uniswap V2 Optimal One Sided Supply",$m="Uniswap V2 Optimal One Sided Supply",qm=[{fileName:"Optimal.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFRlc3RVbmlzd2FwT3B0aW1hbE9uZVNpZGVkU3VwcGx5IHsKICAgI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GZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIHNlbmRlciwgYWRkcmVzcyByZWNpcGllbnQsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7Cn0K"}],sb=`

                    Optimal One Sided Supply

                    +`,Lm=({prev:s,next:a})=>r.jsx(A,{version:Em,title:Qm,description:Tm,html:_m,prev:s,next:a,codes:Um}),Om="0.8.24",Pm="Uniswap V2 Optimal One Sided Supply",$m="Uniswap V2 Optimal One Sided Supply",qm=[{fileName:"Optimal.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFRlc3RVbmlzd2FwT3B0aW1hbE9uZVNpZGVkU3VwcGx5IHsKICAgIGFkZHJlc3MgcHJpdmF0ZSBjb25zdGFudCBGQUNUT1JZID0KICAgICAgICAweDVDNjliRWU3MDFlZjgxNGEyQjZhM0VERDRCMTY1MkNCOWNjNWFBNmY7CiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgUk9VVEVSID0gMHg3YTI1MGQ1NjMwQjRjRjUzOTczOWRGMkM1ZEFjYjRjNjU5RjI0ODhEOwogICAgYWRkcmVzcyBwcml2YXRlIGNvbnN0YW50IFdFVEggPSAweEMwMmFhQTM5YjIyM0ZFOEQwQTBlNUM0RjI3ZUFEOTA4M0M3NTZDYzI7CgogICAgZnVuY3Rpb24gc3FydCh1aW50MjU2IHkpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBpZiAoeSA+IDMpIHsKICAgICAgICAgICAgeiA9IHk7CiAgICAgICAgICAgIHVpbnQyNTYgeCA9IHkgLyAyICsgMTsKICAgICAgICAgICAgd2hpbGUgKHggPCB6KSB7CiAgICAgICAgICAgICAgICB6ID0geDsKICAgICAgICAgICAgICAgIHggPSAoeSAvIHggKyB4K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AgIGZ1bmN0aW9uIGJhbGFuY2VPZihhZGRyZXNzIGFjY291bnQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CgogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyByZWNpcGllbnQsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikKICAgICAgICBleHRlcm5hbAogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2KTsKCiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIHNlbmRlciwgYWRkcmVzcyByZWNpcGllbnQsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7Cn0K"}],sb=`

                    Optimal One Sided Supply

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.24;
                     
                    @@ -5973,7 +5973,7 @@ IERC20 constant PAIR external
                             returns (bool);
                     }
                    -
                    `,ab=({prev:s,next:a})=>r.jsx(u,{version:Om,title:Pm,description:$m,html:sb,prev:s,next:a,codes:qm}),nb="0.8.24",lb="Uniswap V3 Flash Loan",pb="Uniswap V3 Flash Loan",eb=[{fileName:"UniswapV3Flash.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFVuaXN3YXBWM0ZsYXNoIHsKICAgIHN0cnVjdCBGbGFzaENhbGxiYWNrRGF0YSB7CiAgICAgICAgdWludDI1NiBhbW91bnQwOwogICAgICAgIHVpbnQyNTYgYW1vdW50MTsKICAgICAgICBhZGRyZXNzIGNhbGxlcjsKICAgIH0KCiAgICBJVW5pc3dhcFYzUG9vbCBwcml2YXRlIGltbXV0YWJsZSBwb29sOwogICAgSUVSQzIwIHByaXZhdGUgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwcml2YXRlIGltbXV0YWJsZSB0b2tlbjE7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfcG9vbCkgewogICAgICAgIHBvb2wgPSBJVW5pc3dhcFYzUG9vbChfcG9vbCk7CiAgICAgICAgdG9rZW4wID0gSUVSQzIwKHBvb2wudG9rZW4wKCkpOwogICAgICAgIHRva2VuMSA9IElFUkMyMChwb29sLnRva2VuMSgpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBmbGFzaCh1aW50MjU2IGFtb3VudDAsIHVpbnQyNTYgYW1vdW50MSkgZXh0ZXJuYWwgewogICAgICAgIGJ5dGVzIG1lbW9yeSBkYXRhID0gYWJpLmVuY29kZSgKICAgICAgICAgICAgRmxhc2hDYWxsYmFja0RhdGEoewogICAgICAgICAgICAgICAgYW1vdW50MDogYW1vdW50MCwKICAgICAgICAgICAgICAgIGFtb3VudDE6IGFtb3VudDEsCiAgICAgICAgICAgICAgICBjYWxsZXI6IG1zZy5zZW5kZXIKICAgICAgICAgICAgfSkKICAgICAgICApOwogICAgICAgIElVbmlzd2FwVjNQb29sKHBvb2wpLmZsYXNoKGFkZHJlc3ModGhpcyksIGFtb3VudDAsIGFtb3VudDEsIGRhdGEpOwogICAgfQoKICAgIGZ1bmN0aW9uIHVuaXN3YXBWM0ZsYXNoQ2FsbGJhY2soCiAgICAgICAgLy8gUG9vbCBmZWUgeCBhbW91bnQgcmVxdWVzdGVkCiAgICAgICAgdWludDI1NiBmZWUwLAogICAgICAgIHVpbnQyNTYgZmVlMSwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJl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ogICAgICAgIHVpbnQyNTYgZGFpX2FmdGVyID0gZGFpLmJhbGFuY2VPZih1c2VyKTsKCiAgICAgICAgdWludDI1NiBmZWUgPSBkYWlfYmVmb3JlIC0gZGFpX2FmdGVyOwogICAgICAgIGNvbnNvbGUyLmxvZygiREFJIGZlZSIsIGZlZSk7CiAgICB9Cn0K"}],cb=`

                    Uniswap V3 Flash Loan Example

                    +
                    `,ab=({prev:s,next:a})=>r.jsx(A,{version:Om,title:Pm,description:$m,html:sb,prev:s,next:a,codes:qm}),nb="0.8.24",lb="Uniswap V3 Flash Loan",pb="Uniswap V3 Flash Loan",eb=[{fileName:"UniswapV3Flash.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFVuaXN3YXBWM0ZsYXNoIHsKICAgIHN0cnVjdCBGbGFzaENhbGxiYWNrRGF0YSB7CiAgICAgICAgdWludDI1NiBhbW91bnQwOwogICAgICAgIHVpbnQyNTYgYW1vdW50MTsKICAgICAgICBhZGRyZXNzIGNhbGxlcjsKICAgIH0KCiAgICBJVW5pc3dhcFYzUG9vbCBwcml2YXRlIGltbXV0YWJsZSBwb29sOwogICAgSUVSQzIwIHByaXZhdGUgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwcml2YXRlIGltbXV0YWJsZSB0b2tlbjE7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfcG9vbCkgewogICAgICAgIHBvb2wgPSBJVW5pc3dhcFYzUG9vbChfcG9vbCk7CiAgICAgICAgdG9rZW4wID0gSUVSQzIwKHBvb2wudG9rZW4wKCkpOwogICAgICAgIHRva2VuMSA9IElFUkMyMChwb29sLnRva2VuMSgpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBmbGFzaCh1aW50MjU2IGFtb3VudDAsIHVpbnQyNTYgYW1vdW50MSkgZXh0ZXJuYWwgewogICAgICAgIGJ5dGVzIG1lbW9yeSBkYXRhID0gYWJpLmVuY29kZSgKICAgICAgICAgICAgRmxhc2hDYWxsYmFja0RhdGEoewogICAgICAgICAgICAgICAgYW1vdW50MDogYW1vdW50MCwKICAgICAgICAgICAgICAgIGFtb3VudDE6IGFtb3VudDEsCiAgICAgICAgICAgICAgICBjYWxsZXI6IG1zZy5zZW5kZXIKICAgICAgICAgICAgfSkKICAgICAgICApOwogICAgICAgIElVbmlzd2FwVjNQb29sKHBvb2wpLmZsYXNoKGFkZHJlc3ModGhpcyksIGFtb3VudDAsIGFtb3VudDEsIGRhdGEpOwogICAgfQoKICAgIGZ1bmN0aW9uIHVuaXN3YXBWM0ZsYXNoQ2FsbGJhY2soCiAgICAgICAgLy8gUG9vbCBmZWUgeCBhbW91bnQgcmVxdWVzdGVkCiAgICAgICAgdWludDI1NiBmZWUwLAogICAgICAgIHVpbnQyNTYgZmVlMSwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gYWRkcmVzcyhwb29sKSwgIm5vdCBhdXRob3JpemVkIik7CgogICAgICAgIEZsYXNoQ2FsbGJhY2tEYXRhIG1lbW9yeSBkZWNvZGVkID0gYWJpLmRlY29kZShkYXRhLCAoRmxhc2hDYWxsYmFja0RhdGEpKTsKCiAgICAgICAgLy8gV3JpdGUgY3VzdG9tIGNvZGUgaGVyZQogICAgICAgIGlmIChmZWUwID4gMCkgewogICAgICAgICAgICB0b2tlbjAudHJhbnNmZXJGcm9tKGRlY29kZWQuY2FsbGVyLCBhZGRyZXNzKHRoaXMpLCBmZWUwKTsKICAgICAgICB9CiAgICAgICAgaWYgKGZlZTEgPiAwKSB7CiAgICAgICAgICAgIHRva2VuMS50cmFuc2ZlckZyb20oZGVjb2RlZC5jYWxsZXIsIGFkZHJlc3ModGhpcyksIGZlZTEpOwogICAgICAgIH0KCiAgICAgICAgLy8gUmVwYXkgYm9ycm93CiAgICAgICAg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kYWkgPSBJRVJDMjAoREFJKTsKICAgIFVuaXN3YXBWM0ZsYXNoIHByaXZhdGUgdW5pOwogICAgYWRkcmVzcyBjb25zdGFudCB1c2VyID0gYWRkcmVzcygxMSk7CgogICAgZnVuY3Rpb24gc2V0VXAoKSBwdWJsaWMgewogICAgICAgIHVuaSA9IG5ldyBVbmlzd2FwVjNGbGFzaChQT09MKTsKCiAgICAgICAgZGVhbChEQUksIHVzZXIsIDFlNiAqIDFlMTgpOwogICAgICAgIHZtLnByYW5rKHVzZXIpOwogICAgICAgIGRhaS5hcHByb3ZlKGFkZHJlc3ModW5pKSwgdHlwZSh1aW50MjU2KS5tYXgpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfZmxhc2goKSBwdWJsaWMgewogICAgICAgIHVpbnQyNTYgZGFpX2JlZm9yZSA9IGRhaS5iYWxhbmNlT2YodXNlcik7CiAgICAgICAgdm0ucHJhbmsodXNlcik7CiAgICAgICAgdW5pLmZsYXNoKDFlNiAqIDFlMTgsIDApOwogICAgICAgIHVpbnQyNTYgZGFpX2FmdGVyID0gZGFpLmJhbGFuY2VPZih1c2VyKTsKCiAgICAgICAgdWludDI1NiBmZWUgPSBkYWlfYmVmb3JlIC0gZGFpX2FmdGVyOwogICAgICAgIGNvbnNvbGUyLmxvZygiREFJIGZlZSIsIGZlZSk7CiAgICB9Cn0K"}],cb=`

                    Uniswap V3 Flash Loan Example

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.24;
                     
                    @@ -6096,7 +6096,7 @@ IERC20 constant PAIR "DAI fee", fee);
                         }
                     }
                    -
                    `,tb=({prev:s,next:a})=>r.jsx(u,{version:nb,title:lb,description:pb,html:cb,prev:s,next:a,codes:eb}),ob="0.8.24",rb="Uniswap V3 Flash Swap Arbitrage",ib="Uniswap V3 Flash Swap Arbitrage",gb=[{fileName:"UniswapV3FlashSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc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G9rZW5JbiA8IHRva2VuT3V0OwogICAgICAgIC8vIDAgLT4gMSA9PiBzcXJ0IHByaWNlIGRlY3JlYXNlCiAgICAgICAgLy8gMSAtPiAwID0+IHNxcnQgcHJpY2UgaW5jcmVhc2UKICAgICAgICB1aW50MTYwIHNxcnRQcmljZUxpbWl0WDk2ID0KICAgICAgICAgICAgemVyb0Zvck9uZSA/IE1JTl9TUVJUX1JBVElPICsgMSA6IE1BWF9TUVJUX1JBVElPIC0gMTsKCiAgICAgICAgYnl0ZXMgbWVtb3J5IGRhdGEgPSBhYmkuZW5jb2RlKAogICAgICAgICAgICBtc2cuc2VuZGVyLCBwb29sMCwgZmVlMSwgdG9rZW5JbiwgdG9rZW5PdXQsIGFtb3VudEluLCB6ZXJvRm9yT25lCiAgICAgICAgKTsKCiAgICAgICAgSVVuaXN3YXBWM1Bvb2wocG9vbDApLnN3YXAoewogICAgICAgICAgICByZWNpcGllbnQ6IGFkZHJlc3ModGhpcyksCiAgICAgICAgICAgIHplcm9Gb3JPbmU6IHplcm9Gb3JPbmUsCiAgICAgICAgICAgIGFtb3VudFNwZWNpZmllZDogaW50MjU2KGFtb3VudEluKSwKICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IHNxcnRQcmljZUxpbWl0WDk2LAogICAgICAgICAgICBkYXRhOiBkYXRhCiAgICAgICAgfSk7CiAgICB9CgogICAgZnVuY3Rpb24gX3N3YXAoCiAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgIGFkZHJlc3MgdG9rZW5PdXQsCiAgICAgICAgdWludDI0IGZlZSwKICAgICAgICB1aW50MjU2IGFtb3VudEluLAogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0TWluCiAgICApIHByaXZhdGUgcmV0dXJucyAodWludDI1NiBhbW91bnRPdXQpIHsKICAgICAgICBJRVJDMjAodG9rZW5JbikuYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluKTsKCiAgICAgICAgSVN3YXBSb3V0ZXIwMi5FeGFjdElucHV0U2luZ2xlUGFyYW1zIG1lbW9yeSBwYXJhbXMgPSBJU3dhcFJvdXRlcjAyCiAgICAgICAgICAgIC5FeGFjdElucHV0U2luZ2xlUGFyYW1zKHsKICAgICAgICAgICAgdG9rZW5JbjogdG9rZW5JbiwKICAgICAgICAgICAgdG9rZW5PdXQ6IHRva2VuT3V0LAogICAgICAgICAgICBmZWU6IGZlZSwKICAgICAgICAgICAgcmVjaXBpZW50OiBhZGRyZXNzKHRoaXMpLAogICAgICAgICAgICBhbW91bnRJbjogYW1vdW50SW4sCiAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IGFtb3VudE91dE1pbiwKICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IDAKICAgICAgICB9KTsKCiAgICAgICAgYW1vdW50T3V0ID0gcm91dGVyLmV4YWN0SW5wdXRTaW5nbGUocGFyYW1zKTsKICAgIH0KCiAgICBmdW5jdGlvbiB1bmlzd2FwVjNTd2FwQ2FsbGJhY2soCiAgICAgICAgaW50MjU2IGFtb3VudDAsCiAgICAgICAgaW50MjU2IGFtb3VudDEsCiAgICAgICAgYnl0ZXMgY2FsbGRhdGEgZGF0YQogICAgKSBleHRlcm5hbCB7CiAgICAgICAgLy8gRGVjb2RlIGRhdGEKICAgICAgICAoCiAgICAgICAgICAgIGFkZHJlc3MgY2FsbGVyLAogICAgICAgICAgICBhZGRyZXNzIHBvb2wwLAogICAgICAgICAgICB1aW50MjQgZmVlMSwKICAgICAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgICAgICBhZGRyZXNzIHRva2VuT3V0LAogICAgICAgICAgICB1aW50MjU2IGFtb3VudEluLAogICAgICAgICAgICBib29sIHplcm9Gb3JPbmUKICAgICAgICApID0gYWJpLmRlY29kZSgKICAgICAgICAgICAgZGF0YSwgKGFkZHJlc3MsIGFkZHJlc3MsIHVpbnQyNCwgYWRkcmVzcywgYWRkcmVzcywgdWludDI1NiwgYm9vbCkKICAgICAgICApOwoKICAgICAgICB1aW50MjU2IGFtb3VudE91dCA9IHplcm9Gb3JPbmUgPyB1aW50MjU2KC1hbW91bnQxKSA6IHVpbnQyNTYoLWFtb3VudDApOwoKICAgICAgICAvLyBwb29sMCAtPiB0b2tlbkluIC0+IHRva2VuT3V0IChhbW91bnRPdXQpCiAgICAgICAgLy8gU3dhcCBvbiBwb29sIDEgKHN3YXAgdG9rZW5PdXQgLT4gdG9rZW5JbikKICAgICAgICB1aW50MjU2IGJ1eUJhY2tBbW91bnQgPSBfc3dhcCh7CiAgICAgICAgICAgIHRva2VuSW46IHRva2VuT3V0LAogICAgICAgICAgICB0b2tlbk91dDogdG9rZW5JbiwKICAgICAgICAgICAgZmVlOiBmZWUxLAogICAgICAgICAgICBhbW91bnRJbjogYW1vdW50T3V0LAogICAgICAgICAgICBhbW91bnRPdXRNaW46IGFtb3VudEluCiAgICAgICAgfSk7CgogICAgICAgIC8vIFJlcGF5IHBvb2wgMAogICAgICAgIHVpbnQyNTYgcHJvZml0ID0gYnV5QmFja0Ftb3VudCAtIGFtb3VudEluOwogICAgICAgIHJlcXVpcmUocHJvZml0ID4gMCwgInByb2ZpdCA9IDAiKTsKCiAgICAgICAgSUVSQzIwKHRva2VuSW4pLnRyYW5zZmVyKHBvb2wwLCBhbW91bnRJbik7CiAgICAgICAgSUVSQzIwKHRva2VuSW4pLnRyYW5zZmVyKGNhbGxlciwgcHJvZml0KTsKICAgIH0KfQoKaW50ZXJmYWNlIElTd2FwUm91dGVyMDIgewogICAgc3RydWN0IEV4YWN0SW5wdXRTaW5nbGVQYXJhbXMgewogICAgICAgIGFkZHJlc3MgdG9rZW5JbjsKICAgICAgICBhZGRyZXNzIHRva2VuT3V0OwogICAgICAgIHVpbnQyNCBmZWU7CiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQ7CiAgICAgICAgdWludDI1NiBhbW91bnRJbjsKICAgICAgICB1aW50MjU2IGFtb3VudE91dE1pbmltdW07CiAgICAgICAgdWludDE2MCBzcXJ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HBvb2wwCiAgICAgICAgd2V0aC5kZXBvc2l0e3ZhbHVlOiA1MDAgKiAxZTE4fSgpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIDUwMCAqIDFlMTgpOwogICAgICAgIHJvdXRlci5leGFjdElucHV0U2luZ2xlKAogICAgICAgICAgICBJU3dhcFJvdXRlcjAyLkV4YWN0SW5wdXRTaW5nbGVQYXJhbXMoewogICAgICAgICAgICAgICAgdG9rZW5JbjogV0VUSCwKICAgICAgICAgICAgICAgIHRva2VuT3V0OiBEQUksCiAgICAgICAgICAgICAgICBmZWU6IEZFRV8wLAogICAgICAgICAgICAgICAgcmVjaXBpZW50OiBhZGRyZXNzKDApLAogICAgICAgICAgICAgICAgYW1vdW50SW46IDUwMCAqIDFlMTgsCiAgICAgICAgICAgICAgICBhbW91bnRPdXRNaW5pbXVtOiAwLAogICAgICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IDAKICAgICAgICAgICAgfSkKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfZmxhc2hTd2FwKCkgcHVibGljIHsKICAgICAgICB1aW50MjU2IGJhbDAgPSBkYWkuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwogICAgICAgIGZsYXNoU3dhcC5mbGFzaFN3YXAoewogICAgICAgICAgICBwb29sMDogYWRkcmVzcyhwb29sMCksCiAgICAgICAgICAgIGZlZTE6IEZFRV8xLAogICAgICAgICAgICB0b2tlbkluOiBEQUksCiAgICAgICAgICAgIHRva2VuT3V0OiBXRVRILAogICAgICAgICAgICBhbW91bnRJbjogREFJX0FNT1VOVF9JTgogICAgICAgIH0pOwogICAgICAgIHVpbnQyNTYgYmFsMSA9IGRhaS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CiAgICAgICAgdWludDI1NiBwcm9maXQgPSBiYWwxIC0gYmFsMDsKICAgICAgICBhc3NlcnRHdChwcm9maXQsIDAsICJwcm9maXQgPSAwIik7CiAgICAgICAgY29uc29sZTIubG9nKCJQcm9maXQgJWUiLCBwcm9maXQpOwogICAgfQp9Cg=="}],hb=`

                    Uniswap V3 Flash Swap Arbitrage Example

                    +`,tb=({prev:s,next:a})=>r.jsx(A,{version:nb,title:lb,description:pb,html:cb,prev:s,next:a,codes:eb}),ob="0.8.24",rb="Uniswap V3 Flash Swap Arbitrage",ib="Uniswap V3 Flash Swap Arbitrage",gb=[{fileName:"UniswapV3FlashSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmFkZHJlc3MgY29uc3RhbnQgU1dBUF9ST1VURVJfMDIgPSAweDY4YjM0NjU4MzNmYjcyQTcwZWNERjQ4NUUwZTRDN2JEODY2NUZjNDU7Cgpjb250cmFjdCBVbmlzd2FwVjNGbGFzaFN3YXAgewogICAgSVN3YXBSb3V0ZXIwMiBjb25zdGFudCByb3V0ZXIgPSBJU3dhcFJvdXRlcjAyKFNXQVBfUk9VVEVSXzAyKTsKCiAgICB1aW50MTYwIHByaXZhdGUgY29uc3RhbnQgTUlOX1NRUlRfUkFUSU8gPSA0Mjk1MTI4NzM5OwogICAgdWludDE2MCBwcml2YXRlIGNvbnN0YW50IE1BWF9TUVJUX1JBVElPID0KICAgICAgICAxNDYxNDQ2NzAzNDg1MjEwMTAzMjg3MjczMDUyMjAzOTg4ODIyMzc4NzIzOTcwMzQyOwoKICAgIC8vIERBSSAvIFdFVEggMC4zJSBzd2FwIGZlZSAoMjAwMCBEQUkgLyBXRVRIKQogICAgLy8gREFJIC8gV0VUSCAwLjA1JSBzd2FwIGZlZSAoMjEwMCBEQUkgLyBXRVRIKQogICAgLy8gMS4gRmxhc2ggc3dhcCBvbiBwb29sMCAocmVjZWl2ZSBXRVRIKQogICAgLy8gMi4gU3dhcCBvbiBwb29sMSAoV0VUSCAtPiBEQUkpCiAgICAvLyAzLiBTZW5kIERBSSB0byBwb29sMAogICAgLy8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XAoCiAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgIGFkZHJlc3MgdG9rZW5PdXQsCiAgICAgICAgdWludDI0IGZlZSwKICAgICAgICB1aW50MjU2IGFtb3VudEluLAogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0TWluCiAgICApIHByaXZhdGUgcmV0dXJucyAodWludDI1NiBhbW91bnRPdXQpIHsKICAgICAgICBJRVJDMjAodG9rZW5JbikuYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluKTsKCiAgICAgICAgSVN3YXBSb3V0ZXIwMi5FeGFjdElucHV0U2luZ2xlUGFyYW1zIG1lbW9yeSBwYXJhbXMgPSBJU3dhcFJvdXRlcjAyCiAgICAgICAgICAgIC5FeGFjdElucHV0U2luZ2xlUGFyYW1zKHsKICAgICAgICAgICAgdG9rZW5JbjogdG9rZW5JbiwKICAgICAgICAgICAgdG9rZW5PdXQ6IHRva2VuT3V0LAogICAgICAgICAgICBmZWU6IGZlZSwKICAgICAgICAgICAgcmVjaXBpZW50OiBhZGRyZXNzKHRoaXMpLAogICAgICAgICAgICBhbW91bnRJbjogYW1vdW50SW4sCiAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IGFtb3VudE91dE1pbiwKICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IDAKICAgICAgICB9KTsKCiAgICAgICAgYW1vdW50T3V0ID0gcm91dGVyLmV4YWN0SW5wdXRTaW5nbGUocGFyYW1zKTsKICAgIH0KCiAgICBmdW5jdGlvbiB1bmlzd2FwVjNTd2FwQ2FsbGJhY2soCiAgICAgICAgaW50MjU2IGFtb3VudDAsCiAgICAgICAgaW50MjU2IGFtb3VudDEsCiAgICAgICAgYnl0ZXMgY2FsbGRhdGEgZGF0YQogICAgKSBleHRlcm5hbCB7CiAgICAgICAgLy8gRGVjb2RlIGRhdGEKICAgICAgICAoCiAgICAgICAgICAgIGFkZHJlc3MgY2FsbGVyLAogICAgICAgICAgICBhZGRyZXNzIHBvb2wwLAogICAgICAgICAgICB1aW50MjQgZmVlMSwKICAgICAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgICAgICBhZGRyZXNzIHRva2VuT3V0LAogICAgICAgICAgICB1aW50MjU2IGFtb3VudEluLAogICAgICAgICAgICBib29sIHplcm9Gb3JPbmUKICAgICAgICApID0gYWJpLmRlY29kZSgKICAgICAgICAgICAgZGF0YSwgKGFkZHJlc3MsIGFkZHJlc3MsIHVpbnQyNCwgYWRkcmVzcywgYWRkcmVzcywgdWludDI1NiwgYm9vbCkKICAgICAgICApOwoKICAgICAgICB1aW50MjU2IGFtb3VudE91dCA9IHplcm9Gb3JPbmUgPyB1aW50MjU2KC1hbW91bnQxKSA6IHVpbnQyNTYoLWFtb3VudDApOwoKICAgICAgICAvLyBwb29sMCAtPiB0b2tlbkluIC0+IHRva2VuT3V0IChhbW91bnRPdXQpCiAgICAgICAgLy8gU3dhcCBvbiBwb29sIDEgKHN3YXAgdG9rZW5PdXQgLT4gdG9rZW5JbikKICAgICAgICB1aW50MjU2IGJ1eUJhY2tBbW91bnQgPSBfc3dhcCh7CiAgICAgICAgICAgIHRva2VuSW46IHRva2VuT3V0LAogICAgICAgICAgICB0b2tlbk91dDogdG9rZW5JbiwKICAgICAgICAgICAgZmVlOiBmZWUxLAogICAgICAgICAgICBhbW91bnRJbjogYW1vdW50T3V0LAogICAgICAgICAgICBhbW91bnRPdXRNaW46IGFtb3VudEluCiAgICAgICAgfSk7CgogICAgICAgIC8vIFJlcGF5IHBvb2wgMAogICAgICAgIHVpbnQyNTYgcHJvZml0ID0gYnV5QmFja0Ftb3VudCAtIGFtb3VudEluOwogICAgICAgIHJlcXVpcmUocHJvZml0ID4gMCwgInByb2ZpdCA9IDAiKTsKCiAgICAgICAgSUVSQzIwKHRva2VuSW4pLnRyYW5zZmVyKHBvb2wwLCBhbW91bnRJbik7CiAgICAgICAgSUVSQzIwKHRva2VuSW4pLnRyYW5zZmVyKGNhbGxlciwgcHJvZml0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2FwVjNGbGFzaFN3YXAgcHJpdmF0ZSBmbGFzaFN3YXA7CgogICAgdWludDI1NiBwcml2YXRlIGNvbnN0YW50IERBSV9BTU9VTlRfSU4gPSAxMCAqIDFlMTg7CgogICAgZnVuY3Rpb24gc2V0VXAoKSBwdWJsaWMgewogICAgICAgIGZsYXNoU3dhcCA9IG5ldyBVbmlzd2FwVjNGbGFzaFN3YXAoKTsKCiAgICAgICAgLy8gQ3JlYXRlIGFuIGFyYml0cmFnZSBvcHBvcnR1bml0eSAtIG1ha2UgV0VUSCBjaGVhcGVyIG9uIHBvb2wwCiAgICAgICAgd2V0aC5kZXBvc2l0e3ZhbHVlOiA1MDAgKiAxZTE4fSgpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIDUwMCAqIDFlMTgpOwogICAgICAgIHJvdXRlci5leGFjdElucHV0U2luZ2xlKAogICAgICAgICAgICBJU3dhcFJvdXRlcjAyLkV4YWN0SW5wdXRTaW5nbGVQYXJhbXMoewogICAgICAgICAgICAgICAgdG9rZW5JbjogV0VUSCwKICAgICAgICAgICAgICAgIHRva2VuT3V0OiBEQUksCiAgICAgICAgICAgICAgICBmZWU6IEZFRV8wLAogICAgICAgICAgICAgICAgcmVjaXBpZW50OiBhZGRyZXNzKDApLAogICAgICAgICAgICAgICAgYW1vdW50SW46IDUwMCAqIDFlMTgsCiAgICAgICAgICAgICAgICBhbW91bnRPdXRNaW5pbXVtOiAwLAogICAgICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IDAKICAgICAgICAgICAgfSkKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfZmxhc2hTd2FwKCkgcHVibGljIHsKICAgICAgICB1aW50MjU2IGJhbDAgPSBkYWkuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwogICAgICAgIGZsYXNoU3dhcC5mbGFzaFN3YXAoewogICAgICAgICAgICBwb29sMDogYWRkcmVzcyhwb29sMCksCiAgICAgICAgICAgIGZlZTE6IEZFRV8xLAogICAgICAgICAgICB0b2tlbkluOiBEQUksCiAgICAgICAgICAgIHRva2VuT3V0OiBXRVRILAogICAgICAgICAgICBhbW91bnRJbjogREFJX0FNT1VOVF9JTgogICAgICAgIH0pOwogICAgICAgIHVpbnQyNTYgYmFsMSA9IGRhaS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CiAgICAgICAgdWludDI1NiBwcm9maXQgPSBiYWwxIC0gYmFsMDsKICAgICAgICBhc3NlcnRHdChwcm9maXQsIDAsICJwcm9maXQgPSAwIik7CiAgICAgICAgY29uc29sZTIubG9nKCJQcm9maXQgJWUiLCBwcm9maXQpOwogICAgfQp9Cg=="}],hb=`

                    Uniswap V3 Flash Swap Arbitrage Example

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

                    Uniswap V3 Foundry example

                    -`,Ib=({prev:s,next:a})=>r.jsx(u,{version:ob,title:rb,description:ib,html:hb,prev:s,next:a,codes:gb}),db="0.8.24",Cb="Uniswap V3 Liquidity Examples",jb="Uniswap V3 liquidity examples",ub=[{fileName:"UniswapV3Liquidity.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmFkZHJlc3MgY29uc3RhbnQgREFJID0gMHg2QjE3NTQ3NEU4OTA5NEM0NERhOThiOTU0RWVkZUFDNDk1MjcxZDBGOwphZGRyZXNzIGNvbnN0YW50IFdFVEggPSAweEMwMmFhQTM5YjIyM0ZFOEQwQTBlNUM0RjI3ZUFEOTA4M0M3NTZDYzI7CgppbnRlcmZhY2UgSUVSQzcyMVJlY2VpdmVyIHsKICAgIGZ1bmN0aW9uIG9uRVJDNzIxUmVjZWl2ZWQoCiAgICAgICAgYWRkcmVzcyBvcGVyYXRvciwKICAgICAgICBhZGRyZXNzIGZyb20sCiAgICAgICAgdWludDI1N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XJuYWwKICAgICAgICByZXR1cm5zICgKICAgICAgICAgICAgdWludDI1NiB0b2tlbklkLAogICAgICAgICAgICB1aW50MTI4IGxpcXVpZGl0eSwKICAgICAgICAgICAgdWludDI1NiBhbW91bnQwLAogICAgICAgICAgICB1aW50MjU2IGFtb3VudDEKICAgICAgICApCiAgICB7CiAgICAgICAgZGFpLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBhbW91bnQwVG9BZGQpOwogICAgICAgIHdldGgudHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudDFUb0FkZCk7CgogICAgICAgIGRhaS5hcHByb3ZlKGFkZHJlc3Mobm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIpLCBhbW91bnQwVG9BZGQpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKG5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyKSwgYW1vdW50MVRvQWRkKTsKCiAgICAgICAgSU5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyLk1pbnRQYXJhbXMgbWVtb3J5IHBhcmFtcyA9CiAgICAgICAgSU5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyLk1pbnRQYXJhbXMoewogICAgICAgICAgICB0b2tlbjA6IERBSSwKICAgICAgICAgICAgdG9rZW4xOiBXRVRILAogICAgICAgICAgICBmZWU6IDMwMDAsCiAgICAgICAgICAgIHRpY2tMb3dlcjogKE1JTl9USUNLIC8gVElDS19TUEFDSU5HKSAqIFRJQ0tfU1BBQ0lORywKICAgICAgICAgICAgdGlja1VwcGVyOiAoTUFYX1RJQ0sgLyBUSUNLX1NQQUNJTkcpICogVElDS19TUEFDSU5HLAogICAgICAgICAgICBhbW91bnQwRGVzaXJlZDogYW1vdW50MFRvQWRkLAogICAgICAgICAgICBhbW91bnQxRGVzaXJlZDogYW1vdW50MVRvQWRkLAogICAgICAgICAgICBhbW91bnQwTWluOiAwLAogICAgICAgICAgICBhbW91bnQxTWluOiAwLAogICAgICAgICAgICByZWNpcGllbnQ6IGFkZHJlc3ModGhpcyksCiAgICAgICAgICAgIGRlYWRsaW5lOiBibG9jay50aW1lc3RhbXAKICAgICAgICB9KTsKCiAgICAgICAgKHRva2VuSWQsIGxpcXVpZGl0eSwgYW1vdW50MCwgYW1vdW50MSkgPQogICAgICAgICAgICBub25mdW5naWJsZVBvc2l0aW9uTWFuYWdlci5taW50KHBhcmFtcyk7CgogICAgICAgIGlmIChhbW91bnQwIDwgYW1vdW50MFRvQWRkKSB7CiAgICAgICAgICAgIGRhaS5hcHByb3ZlKGFkZHJlc3Mobm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIpLCAwKTsKICAgICAgICAgICAgdWludDI1NiByZWZ1bmQwID0gYW1vdW50MFRvQWRkIC0gYW1vdW50MDsKICAgICAgICAgICAgZGFpLnRyYW5zZmVyKG1zZy5zZW5kZXIsIHJlZnVuZDApOwogICAgICAgIH0KICAgICAgICBpZiAoYW1vdW50MSA8IGFtb3VudDFUb0FkZCkgewogICAgICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhub25mdW5naWJsZVBvc2l0aW9uTWFuYWdlciksIDApOwogICAgICAgICAgICB1aW50MjU2IHJlZnVuZDEgPSBhbW91bnQxVG9BZGQgLSBhbW91bnQxOwogICAgICAgICAgICB3ZXRoLnRyYW5zZmVyKG1zZy5zZW5kZXIsIHJlZnVuZDEpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBjb2xsZWN0QWxsRmVlcyh1aW50MjU2IHRva2VuSWQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zICh1aW50MjU2IGFtb3VudDAsIHVpbnQyNTYgYW1vdW50MSkKICAgIHsKICAgICAgICBJTm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIuQ29sbGVjdFBhcmFtcyBtZW1vcnkgcGFyYW1zID0KICAgICAgIC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WRsaW5lOiBibG9jay50aW1lc3RhbXAKICAgICAgICB9KTsKCiAgICAgICAgKGFtb3VudDAsIGFtb3VudDEpID0KICAgICAgICAgICAgbm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIuZGVjcmVhc2VMaXF1aWRpdHkocGFyYW1zKTsKICAgIH0KfQoKaW50ZXJmYWNlIElOb25mdW5naWJsZVBvc2l0aW9uTWFuYWdlciB7CiAgICBzdHJ1Y3QgTWludFBhcmFtcyB7CiAgICAgICAgYWRkcmVzcyB0b2tlbjA7CiAgICAgICAgYWRkcmVzcyB0b2tlbjE7CiAgICAgICAgdWludDI0IGZlZTsKICAgICAgICBpbnQyNCB0aWNrTG93ZXI7CiAgICAgICAgaW50MjQgdGlja1VwcGVyOwogICAgICAgIHVpbnQyNTYgYW1vdW50MERlc2lyZWQ7CiAgICAgICAgdWludDI1NiBhbW91bnQxRGVzaXJlZDsKICAgICAgICB1aW50MjU2IGFtb3VudDBNaW47CiAgICAgICAgdWludDI1NiBhbW91bnQxTWluOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQyNTYgZGVhZGxpbmU7CiAgICB9CgogICAgZnVuY3Rpb24gbWludChNaW50UGFyYW1zIGNhbGxkYXRhIHBhcmFtcykKICAgICAgICBleHRlcm5hbAogICAgICAgIHBheWFibGUKICAgICAgICByZXR1cm5zICgKICAgICAgICAgICAgdWludDI1NiB0b2tlbklkLAogICAgICAgICAgICB1aW50MTI4IGxpcXVpZGl0eSwKICAgICAgICAgICAgdWludDI1NiBhbW91bnQwLAogICAgICAgICAgICB1aW50MjU2IGFtb3VudDEKICAgICAgICApOwoKICAgIHN0cnVjdCBJbmNyZWFzZUxpcXVpZGl0eVBhcmFtcyB7CiAgICAgICAgdWludDI1NiB0b2tlbklkOwogICAgICAgIHVpbnQyNTYgYW1vdW50MERlc2lyZWQ7CiAgICAgICAgdWludDI1NiBhbW91bnQxRGVzaXJlZDsKICAgICAgICB1aW50MjU2IGFtb3VudDBNaW47CiAgICAgICAgdWludDI1NiBhbW91bnQxTWluOwogICAgICAgIHVpbnQyNTYgZGVhZGxpbmU7CiAgICB9CgogICAgZnVuY3Rpb24gaW5jcmVhc2VMaXF1aWRpdHkoSW5jcmVhc2VMaXF1aWRpdHlQYXJhbXMgY2FsbGRhdGEgcGFyYW1zKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQxMjggbGlxdWlkaXR5LCB1aW50MjU2IGFtb3VudDAsIHVpbnQyNTYgYW1vdW50MSk7CgogICAgc3RydWN0IERlY3JlYXNlTGlxdWlkaXR5UGFyYW1zIHsKICAgICAgICB1aW50MjU2IHRva2VuSWQ7CiAgICAgICAgdWludDEyOCBsaXF1aWRpdHk7CiAgICAgICAgdWludDI1NiBhbW91bnQwTWluOwogICAgICAgIHVpbnQyNTYgYW1vdW50MU1pbjsKICAgICAgICB1aW50MjU2IGRlYWRsaW5lOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlY3JlYXNlTGlxdWlkaXR5KERlY3JlYXNlTGlxdWlkaXR5UGFyYW1zIGNhbGxkYXRhIHBhcmFtcykKICAgICAgICBleHRlcm5hbAogICAgICAgIHBheWFibGUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGFtb3VudDAsIHVpbnQyNTYgYW1vdW50MSk7CgogICAgc3RydWN0IENvbGxlY3RQYXJhbXMgewogICAgICAgIHVpbnQyNTYgdG9rZW5JZDsKICAgICAgICBhZGRyZXNzIHJlY2lwaWVudDsKICAgICAgICB1aW50MTI4IGFtb3VudDBNYXg7CiAgICAgICAgdWludDEyOCBhbW91bnQxTWF4OwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbGxlY3QoQ29sbGVjdFBhcmFtcyBjYWxsZGF0YSBwYXJhbXMpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwYXlhYmxlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBhbW91bnQwLCB1aW50MjU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MTg7CgogICAgICAgICgKICAgICAgICAgICAgdWludDI1NiB0b2tlbklkLAogICAgICAgICAgICB1aW50MTI4IGxpcXVpZGl0eURlbHRhLAogICAgICAgICAgICB1aW50MjU2IGFtb3VudDAsCiAgICAgICAgICAgIHVpbnQyNTYgYW1vdW50MQogICAgICAgICkgPSB1bmkubWludE5ld1Bvc2l0aW9uKGRhaUFtb3VudCwgd2V0aEFtb3VudCk7CiAgICAgICAgbGlxdWlkaXR5ICs9IGxpcXVpZGl0eURlbHRhOwoKICAgICAgICBjb25zb2xlMi5sb2coIi0tLSBNaW50IG5ldyBwb3NpdGlvbiAtLS0iKTsKICAgICAgICBjb25zb2xlMi5sb2coInRva2VuIGlkIiwgdG9rZW5JZCk7CiAgICAgICAgY29uc29sZTIubG9nKCJsaXF1aWRpdHkiLCBsaXF1aWRpdHkpOwogICAgICAgIGNvbnNvbGUyLmxvZygiYW1vdW50IDAiLCBhbW91bnQwKTsKICAgICAgICBjb25zb2xlMi5sb2coImFtb3VudCAxIiwgYW1vdW50MSk7CgogICAgICAgIC8vIENvbGxlY3QgZmVlcwogICAgICAgICh1aW50MjU2IGZlZTAsIHVpbnQyNTYgZmVlMSkgPSB1bmkuY29sbGVjdEFsbEZlZXModG9rZW5JZCk7CgogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIENvbGxlY3QgZmVlcyAtLS0iKTsKICAgICAgICBjb25zb2xlMi5sb2coImZlZSAwIiwgZmVlMCk7CiAgICAgICAgY29uc29sZTIubG9nKCJmZWUgMSIsIGZlZTEpOwoKICAgICAgICAvLyBJbmNyZWFzZSBsaXF1aWRpdHkKICAgICAgICB1aW50MjU2IGRhaUFtb3VudFRvQWRkID0gNSAqIDFlMTg7CiAgICAgICAgdWludDI1NiB3ZXRoQW1vdW50VG9BZGQgPSAwLjUgKiAxZTE4OwoKICAgICAgICAobGlxdWlkaXR5RGVsdGEsIGFtb3VudDAsIGFtb3VudDEpID0gdW5pLmluY3JlYXNlTGlxdWlkaXR5Q3VycmVudFJhbmdlKAogICAgICAgICAgICB0b2tlbklkLCBkYWlBbW91bnRUb0FkZCwgd2V0aEFtb3VudFRvQWRkCiAgICAgICAgKTsKICAgICAgICBsaXF1aWRpdHkgKz0gbGlxdWlkaXR5RGVsdGE7CgogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIEluY3JlYXNlIGxpcXVpZGl0eSAtLS0iKTsKICAgICAgICBjb25zb2xlMi5sb2coImxpcXVpZGl0eSIsIGxpcXVpZGl0eSk7CiAgICAgICAgY29uc29sZTIubG9nKCJhbW91bnQgMCIsIGFtb3VudDApOwogICAgICAgIGNvbnNvbGUyLmxvZygiYW1vdW50IDEiLCBhbW91bnQxKTsKCiAgICAgICAgLy8gRGVjcmVhc2UgbGlxdWlkaXR5CiAgICAgICAgKGFtb3VudDAsIGFtb3VudDEpID0KICAgICAgICAgICAgdW5pLmRlY3JlYXNlTGlxdWlkaXR5Q3VycmVudFJhbmdlKHRva2VuSWQsIGxpcXVpZGl0eSk7CiAgICAgICAgY29uc29sZTIubG9nKCItLS0gRGVjcmVhc2UgbGlxdWlkaXR5IC0tLSIpOwogICAgICAgIGNvbnNvbGUyLmxvZygiYW1vdW50IDAiLCBhbW91bnQwKTsKICAgICAgICBjb25zb2xlMi5sb2coImFtb3VudCAxIiwgYW1vdW50MSk7CiAgICB9Cn0K"}],Ab=`

                    Examples of minting new position, collect fees, increase and decrease liquidity.

                    +`,Ib=({prev:s,next:a})=>r.jsx(A,{version:ob,title:rb,description:ib,html:hb,prev:s,next:a,codes:gb}),db="0.8.24",Cb="Uniswap V3 Liquidity Examples",jb="Uniswap V3 liquidity examples",Ab=[{fileName:"UniswapV3Liquidity.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmFkZHJlc3MgY29uc3RhbnQgREFJID0gMHg2QjE3NTQ3NEU4OTA5NEM0NERhOThiOTU0RWVkZUFDNDk1MjcxZ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cjogKE1JTl9USUNLIC8gVElDS19TUEFDSU5HKSAqIFRJQ0tfU1BBQ0lORywKICAgICAgICAgICAgdGlja1VwcGVyOiAoTUFYX1RJQ0sgLyBUSUNLX1NQQUNJTkcpICogVElDS19TUEFDSU5HLAogICAgICAgICAgICBhbW91bnQwRGVzaXJlZDogYW1vdW50MFRvQWRkLAogICAgICAgICAgICBhbW91bnQxRGVzaXJlZDogYW1vdW50MVRvQWRkLAogICAgICAgICAgICBhbW91bnQwTWluOiAwLAogICAgICAgICAgICBhbW91bnQxTWluOiAwLAogICAgICAgICAgICByZWNpcGllbnQ6IGFkZHJlc3ModGhpcyksCiAgICAgICAgICAgIGRlYWRsaW5lOiBibG9jay50aW1lc3RhbXAKICAgICAgICB9KTsKCiAgICAgICAgKHRva2VuSWQsIGxpcXVpZGl0eSwgYW1vdW50MCwgYW1vdW50MSkgPQogICAgICAgICAgICBub25mdW5naWJsZVBvc2l0aW9uTWFuYWdlci5taW50KHBhcmFtcyk7CgogICAgICAgIGlmIChhbW91bnQwIDwgYW1vdW50MFRvQWRkKSB7CiAgICAgICAgICAgIGRhaS5hcHByb3ZlKGFkZHJlc3Mobm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIpLCAwKTsKICAgICAgICAgICAgdWludDI1NiByZWZ1bmQwID0gYW1vdW50MFRvQWRkIC0gYW1vdW50MDsKICAgICAgICAgICAgZGFpLnRyYW5zZmVyKG1zZy5zZW5kZXIsIHJlZnVuZDApOwogICAgICAgIH0KICAgICAgICBpZiAoYW1vdW50MSA8IGFtb3VudDFUb0FkZCkgewogICAgICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhub25mdW5naWJsZVBvc2l0aW9uTWFuYWdlciksIDApOwogICAgICAgICAgICB1aW50MjU2IHJlZnVuZDEgPSBhbW91bnQxVG9BZGQgLSBhbW91bnQxOwogICAgICAgICAgICB3ZXRoLnRyYW5zZmVyKG1zZy5zZW5kZXIsIHJlZnVuZDEpOwogICAgICAgI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BhcmFtcyA9CiAgICAgICAgSU5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyLkRlY3JlYXNlTGlxdWlkaXR5UGFyYW1zKHsKICAgICAgICAgICAgdG9rZW5JZDogdG9rZW5JZCwKICAgICAgICAgICAgbGlxdWlkaXR5OiBsaXF1aWRpdHksCiAgICAgICAgICAgIGFtb3VudDBNaW46IDAsCiAgICAgICAgICAgIGFtb3VudDFNaW46IDAsCiAgICAgICAgICAgIGRlYWRsaW5lOiBibG9jay50aW1lc3RhbXAKICAgICAgICB9KTsKCiAgICAgICAgKGFtb3VudDAsIGFtb3VudDEpID0KICAgICAgICAgICAgbm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIuZGVjcmVhc2VMaXF1aWRpdHkocGFyYW1zKTsKICAgIH0KfQoKaW50ZXJmYWNlIElOb25mdW5naWJsZVBvc2l0aW9uTWFuYWdlciB7CiAgICBzdHJ1Y3QgTWludFBhcmFtcyB7CiAgICAgICAgYWRkcmVzcyB0b2tlbjA7CiAgICAgICAgYWRkcmVzcyB0b2tlbjE7CiAgICAgICAgdWludDI0IGZlZTsKICAgICAgICBpbnQyNCB0aWNrTG93ZXI7CiAgICAgICAgaW50MjQgdGlja1VwcGVyOwogICAgICAgIHVpbnQyNTYgYW1vdW50MERlc2lyZWQ7CiAgICAgICAgdWludDI1NiBhbW91bnQxRGVzaXJlZDsKICAgICAgICB1aW50MjU2IGFtb3VudDBNaW47CiAgICAgICAgdWludDI1NiBhbW91bnQxTWluOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQyNTYgZGVhZGxpbmU7CiAgICB9CgogICAgZnVuY3Rpb24gbWludChNaW50UGFyYW1zIGNhbGxkYXRhIHBhcmFtcykKICAgICAgICBleHRlcm5hbAogICAgICAgIHBheWFibGUKICAgICAgICByZXR1cm5zICgKICAgICAgICAgICAgdWludDI1NiB0b2tlbklkLAogICAgICAgICAgICB1aW50MTI4IGxpcXVpZGl0eSwKICAgICAgICAgICAgdWludDI1NiBhbW91bnQwLAogICAgICAgICAgICB1aW50MjU2IGFtb3VudDEKICAgICAgICApOwoKICAgIHN0cnVjdCBJbmNyZWFzZUxpcXVpZGl0eVBhcmFtcyB7CiAgICAgICAgdWludDI1NiB0b2tlbklkOwogICAgICAgIHVpbnQyNTYgYW1vdW50MERlc2lyZWQ7CiAgICAgICAgdWludDI1NiBhbW91bnQxRGVzaXJlZDsKICAgICAgICB1aW50MjU2IGFtb3VudDBNaW47CiAgICAgICAgdWludDI1NiBhbW91bnQxTWluOwogICAgICAgIHVpbnQyNTYgZGVhZGxpbmU7CiAgICB9CgogICAgZnVuY3Rpb24gaW5jcmVhc2VMaXF1aWRpdHkoSW5jcmVhc2VMaXF1aWRpdHlQYXJhbXMgY2FsbGRhdGEgcGFyYW1zKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQxMjggbGlxdWlkaXR5LCB1aW50MjU2IGFtb3VudDAsIHVpbnQyNTYgYW1vdW50MSk7CgogICAgc3RydWN0IERlY3JlYXNlTGlxdWlkaXR5UGFyYW1zIHsKICAgICAgICB1aW50MjU2IHRva2VuSWQ7CiAgICAgICAgdWludDEyOCBsaXF1aWRpdHk7CiAgICAgICAgdWludDI1NiBhbW91bnQwTWluOwogICAgICAgIHVpbnQyNTYgYW1vdW50MU1pbjsKICAgICAgICB1aW50MjU2IGRlYWRsaW5lOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlY3JlYXNlTGlxdWlkaXR5KERlY3JlYXNlTGlxdWlkaXR5UGFyYW1zIGNhbGxkYXRhIHBhcmFtcykKICAgICAgICBleHRlcm5hbAogICAgICAgIHBheWFibGUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGFtb3VudDAsIHVpbnQyNTYgYW1vdW50MSk7CgogICAgc3RydWN0IENvbGxlY3RQYXJhbXMgewogICAgICAgIHVpbnQyNTYgdG9rZW5JZDsKICAgICAgICBhZGR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QoKICAgIGZ1bmN0aW9uIHRlc3RMaXF1aWRpdHkoKSBwdWJsaWMgewogICAgICAgIC8vIFRyYWNrIHRvdGFsIGxpcXVpZGl0eQogICAgICAgIHVpbnQxMjggbGlxdWlkaXR5OwoKICAgICAgICAvLyBNaW50IG5ldyBwb3NpdGlvbgogICAgICAgIHVpbnQyNTYgZGFpQW1vdW50ID0gMTAgKiAxZTE4OwogICAgICAgIHVpbnQyNTYgd2V0aEFtb3VudCA9IDFlMTg7CgogICAgICAgICgKICAgICAgICAgICAgdWludDI1NiB0b2tlbklkLAogICAgICAgICAgICB1aW50MTI4IGxpcXVpZGl0eURlbHRhLAogICAgICAgICAgICB1aW50MjU2IGFtb3VudDAsCiAgICAgICAgICAgIHVpbnQyNTYgYW1vdW50MQogICAgICAgICkgPSB1bmkubWludE5ld1Bvc2l0aW9uKGRhaUFtb3VudCwgd2V0aEFtb3VudCk7CiAgICAgICAgbGlxdWlkaXR5ICs9IGxpcXVpZGl0eURlbHRhOwoKICAgICAgICBjb25zb2xlMi5sb2coIi0tLSBNaW50IG5ldyBwb3NpdGlvbiAtLS0iKTsKICAgICAgICBjb25zb2xlMi5sb2coInRva2VuIGlkIiwgdG9rZW5JZCk7CiAgICAgICAgY29uc29sZTIubG9nKCJsaXF1aWRpdHkiLCBsaXF1aWRpdHkpOwogICAgICAgIGNvbnNvbGUyLmxvZygiYW1vdW50IDAiLCBhbW91bnQwKTsKICAgICAgICBjb25zb2xlMi5sb2coImFtb3VudCAxIiwgYW1vdW50MSk7CgogICAgICAgIC8vIENvbGxlY3QgZmVlcwogICAgICAgICh1aW50MjU2IGZlZTAsIHVpbnQyNTYgZmVlMSkgPSB1bmkuY29sbGVjdEFsbEZlZXModG9rZW5JZCk7CgogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIENvbGxlY3QgZmVlcyAtLS0iKTsKICAgICAgICBjb25zb2xlMi5sb2coImZlZSAwIiwgZmVlMCk7CiAgICAgICAgY29uc29sZTIubG9nKCJmZWUgMSIsIGZlZTEpOwoKICAgICAgICAvLyBJbmNyZWFzZSBsaXF1aWRpdHkKICAgICAgICB1aW50MjU2IGRhaUFtb3VudFRvQWRkID0gNSAqIDFlMTg7CiAgICAgICAgdWludDI1NiB3ZXRoQW1vdW50VG9BZGQgPSAwLjUgKiAxZTE4OwoKICAgICAgICAobGlxdWlkaXR5RGVsdGEsIGFtb3VudDAsIGFtb3VudDEpID0gdW5pLmluY3JlYXNlTGlxdWlkaXR5Q3VycmVudFJhbmdlKAogICAgICAgICAgICB0b2tlbklkLCBkYWlBbW91bnRUb0FkZCwgd2V0aEFtb3VudFRvQWRkCiAgICAgICAgKTsKICAgICAgICBsaXF1aWRpdHkgKz0gbGlxdWlkaXR5RGVsdGE7CgogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIEluY3JlYXNlIGxpcXVpZGl0eSAtLS0iKTsKICAgICAgICBjb25zb2xlMi5sb2coImxpcXVpZGl0eSIsIGxpcXVpZGl0eSk7CiAgICAgICAgY29uc29sZTIubG9nKCJhbW91bnQgMCIsIGFtb3VudDApOwogICAgICAgIGNvbnNvbGUyLmxvZygiYW1vdW50IDEiLCBhbW91bnQxKTsKCiAgICAgICAgLy8gRGVjcmVhc2UgbGlxdWlkaXR5CiAgICAgICAgKGFtb3VudDAsIGFtb3VudDEpID0KICAgICAgICAgICAgdW5pLmRlY3JlYXNlTGlxdWlkaXR5Q3VycmVudFJhbmdlKHRva2VuSWQsIGxpcXVpZGl0eSk7CiAgICAgICAgY29uc29sZTIubG9nKCItLS0gRGVjcmVhc2UgbGlxdWlkaXR5IC0tLSIpOwogICAgICAgIGNvbnNvbGUyLmxvZygiYW1vdW50IDAiLCBhbW91bnQwKTsKICAgICAgICBjb25zb2xlMi5sb2coImFtb3VudCAxIiwgYW1vdW50MSk7CiAgICB9Cn0K"}],ub=`

                    Examples of minting new position, collect fees, increase and decrease liquidity.

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

                    Foundry

                    Uniswap V3 Foundry example

                    -`,yb=({prev:s,next:a})=>r.jsx(u,{version:db,title:Cb,description:jb,html:Ab,prev:s,next:a,codes:ub}),mb="0.8.24",bb="Uniswap V3 Swap Examples",wb="Uniswap V3 swap examples",kb=[{fileName:"UniswapV3MultiHopSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmFkZHJlc3MgY29uc3RhbnQgU1dBUF9ST1VURVJfMDIgPSAweDY4YjM0NjU4MzNmYjcyQTcwZWNERjQ4NUUwZTRDN2JEODY2NUZjNDU7CmFkZHJlc3MgY29uc3RhbnQgV0VUSCA9IDB4QzAyYWFBMzliMjIzRkU4RDBBMGU1QzRGMjdlQUQ5MDgzQzc1NkNjMjsKYWRkcmVzcyBjb25zdGFudCBVU0RDID0gMHhBMGI4Njk5MWM2MjE4YjM2YzFkMTlENGEyZTlFYjBjRTM2MDZlQjQ4OwphZGRyZXNzIGNvbnN0YW50IERBSSA9IDB4NkIxNzU0NzRFODkwOTRDNDREYTk4Yjk1NEVlZGVBQzQ5NTI3MWQwRjsKCmNvbnRyYWN0IFVuaXN3YXBWM011bHRpSG9wU3dhcCB7CiAgICBJU3dhcFJvdXRlcjAyIHByaXZhdGUgY29uc3RhbnQgcm91dGVyID0gSVN3YXBSb3V0ZXIwMihTV0FQX1JPVVRFUl8wMik7CiAgICBJRVJDMjAgcHJpdmF0ZSBjb25zdGFudCB3ZXRoID0gSUVSQzIwKFdFVEgpOwogICAgSUVSQzIwIHByaXZhdGUgY29uc3RhbnQgZGFpID0gSUVSQzIwKERBSSk7CgogICAgZnVuY3Rpb24gc3dhcEV4YWN0SW5wdXRNdWx0aUhvcCh1aW50MjU2IGFtb3VudEluLCB1aW50MjU2IGFtb3VudE91dE1pbikKICAgICAgICBleHRlcm5hbAogICAgewogICAgICAgIHdldGgudHJhbnNm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FBhcmFtcyBtZW1vcnkgcGFyYW1zID0gSVN3YXBSb3V0ZXIwMgogICAgICAgICAgICAuRXhhY3RPdXRwdXRQYXJhbXMoewogICAgICAgICAgICBwYXRoOiBwYXRoLAogICAgICAgICAgICByZWNpcGllbnQ6IG1zZy5zZW5kZXIsCiAgICAgICAgICAgIGFtb3VudE91dDogYW1vdW50T3V0LAogICAgICAgICAgICBhbW91bnRJbk1heGltdW06IGFtb3VudEluTWF4CiAgICAgICAgfSk7CgogICAgICAgIHVpbnQyNTYgYW1vdW50SW4gPSByb3V0ZXIuZXhhY3RPdXRwdXQocGFyYW1zKTsKCiAgICAgICAgaWYgKGFtb3VudEluIDwgYW1vdW50SW5NYXgpIHsKICAgICAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgMCk7CiAgICAgICAgICAgIHdldGgudHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50SW5NYXggLSBhbW91bnRJbik7CiAgICAgICAgfQogICAgfQp9CgppbnRlcmZhY2UgSVN3YXBSb3V0ZXIwMiB7CiAgICBzdHJ1Y3QgRXhhY3RJbnB1dFBhcmFtcyB7CiAgICAgICAgYnl0ZXMgcGF0aDsKICAgICAgICBhZGRyZXNzIHJlY2lwaWVudDsKICAgICAgICB1aW50MjU2IGFtb3VudEluOwogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0TWluaW11bTsKICAgIH0KCiAgICBmdW5jdGlvbiBleGFjdElucHV0KEV4YWN0SW5wdXRQYXJhbXMgY2FsbGRhdGEgcGFyYW1zKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KTsKCiAgICBzdHJ1Y3QgRXhhY3RPdXRwdXRQYXJhbXMgewogICAgICAgIGJ5dGVzIHBhdGg7CiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQ7CiAgICAgICAgdWludDI1NiBhbW91bnRPdXQ7CiAgICAgICAg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BkYWkgPSBJRVJDMjAoREFJKTsKCiAgICBmdW5jdGlvbiBzd2FwRXhhY3RJbnB1dFNpbmdsZUhvcCh1aW50MjU2IGFtb3VudEluLCB1aW50MjU2IGFtb3VudE91dE1pbikKICAgICAgICBleHRlcm5hbAogICAgewogICAgICAgIHdldGgudHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudEluKTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhyb3V0ZXIpLCBhbW91bnRJbik7CgogICAgICAgIElTd2FwUm91dGVyMDIuRXhhY3RJbnB1dFNpbmdsZVBhcmFtcyBtZW1vcnkgcGFyYW1zID0gSVN3YXBSb3V0ZXIwMgogICAgICAgICAgICAuRXhhY3RJbnB1dFNpbmdsZVBhcmFtcyh7CiAgICAgICAgICAgIHRva2VuSW46IFdFVEgsCiAgICAgICAgICAgIHRva2VuT3V0OiBEQUksCiAgICAgICAgICAgIGZlZTogMzAwMCwKICAgICAgICAgICAgcmVjaXBpZW50OiBtc2cuc2VuZGVyLAogICAgICAgICAgICBhbW91bnRJbjogYW1vdW50SW4sCiAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IGFtb3VudE91dE1pbiwKICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IDAKICAgICAgICB9KTsKCiAgICAgICAgcm91dGVyLmV4YWN0SW5wdXRTaW5nbGUocGFyYW1zKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzd2FwRXhhY3RPdXRwdXRTaW5nbGVIb3AodWludDI1NiBhbW91bnRPdXQsIHVpbnQyNTYgYW1vdW50SW5NYXgpCiAgICAgICAgZXh0ZXJuYWwKICAgIHsKICAgICAgICB3ZXRoLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBhbW91bnRJbk1heCk7CiAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW5NYXgpOwoKICAgICAgICBJU3dhcFJvdXRlcjAyLkV4YWN0T3V0cHV0U2luZ2xlUGFyYW1zIG1lbW9yeSBwYXJhbXMgPSBJU3dhcFJvdXRlcjAyCiAgICAgICAgICAgIC5FeGFjdE91dHB1dFNpbmdsZVBhcmFtcyh7CiAgICAgICAgICAgIHRva2VuSW46IFdFVEgsCiAgICAgICAgICAgIHRva2VuT3V0OiBEQUksCiAgICAgICAgICAgIGZlZTogMzAwMCwKICAgICAgICAgICAgcmVjaXBpZW50OiBtc2cuc2VuZGVyLAogICAgICAgICAgICBhbW91bnRPdXQ6IGFtb3VudE91dCwKICAgICAgICAgICAgYW1vdW50SW5NYXhpbXVtOiBhbW91bnRJbk1heCwKICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IDAKICAgICAgICB9KTsKCiAgICAgICAgdWludDI1NiBhbW91bnRJbiA9IHJvdXRlci5leGFjdE91dHB1dFNpbmdsZShwYXJhbXMpOwoKICAgICAgICBpZiAoYW1vdW50SW4gPCBhbW91bnRJbk1heCkgewogICAgICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhyb3V0ZXIpLCAwKTsKICAgICAgICAgICAgd2V0aC50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnRJbk1heCAtIGFtb3VudEluKTsKICAgICAgICB9CiAgICB9Cn0KCmludGVyZmFjZSBJU3dhcFJvdXRlcjAyIHsKICAgIHN0cnVjdCBFeGFjdElucHV0U2luZ2xlUGFyYW1zIHsKICAgICAgICBhZGRyZXNzIHRva2VuSW47CiAgICAgICAgYWRkcmVzcyB0b2tlbk91dDsKICAgICAgICB1aW50MjQgZmVlOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQyNTYgYW1vdW50SW47CiAgICAgICAgdWludDI1NiBhbW91bnRPdXRNaW5pbXVtOwogICAgICAgIHVpbnQxNjAgc3FydFByaWNlTGltaXRYOTY7CiAgICB9CgogICAgZnVuY3Rpb24gZXhhY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gICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KQogICAgewogICAgICAgIElFUkMyMCh0b2tlbkluKS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW4pOwogICAgICAgIElFUkMyMCh0b2tlbkluKS5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW4pOwoKICAgICAgICBJU3dhcFJvdXRlci5FeGFjdElucHV0UGFyYW1zIG1lbW9yeSBwYXJhbXMgPSBJU3dhcFJvdXRlci5FeGFjdElucHV0UGFyYW1zKHsKICAgICAgICAgICAgcGF0aDogcGF0aCwKICAgICAgICAgICAgcmVjaXBpZW50OiBtc2cuc2VuZGVyLAogICAgICAgICAgICBkZWFkbGluZTogYmxvY2sudGltZXN0YW1wLAogICAgICAgICAgICBhbW91bnRJbjogYW1vdW50SW4sCiAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IDAKICAgICAgICB9KTsKICAgICAgICBhbW91bnRPdXQgPSByb3V0ZXIuZXhhY3RJbnB1dChwYXJhbXMpOwogICAgfQp9CgppbnRlcmZhY2UgSVN3YXBSb3V0ZXIgewogICAgc3RydWN0IEV4YWN0SW5wdXRTaW5nbGVQYXJhbXMgewogICAgICAgIGFkZHJlc3MgdG9rZW5JbjsKICAgICAgICBhZGRyZXNzIHRva2VuT3V0OwogICAgICAgIHVpbnQyNCBmZWU7CiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQ7CiAgICAgICAgdWludDI1NiBkZWFkbGluZTsKICAgICAgICB1aW50MjU2IGFtb3VudEluOwogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0TWluaW11bTsKICAgICAgICB1aW50MTYwIHNxcnRQcmljZUxpbWl0WDk2OwogICAgfQoKICAgIC8vLyBAbm90aWNlIFN3YXBzIGFtb3VudEluIG9mIG9uZSB0b2tlbiBmb3IgYXMgbXVjaCBhcyBwb3NzaWJsZSBvZiB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l0e3ZhbHVlOiAxZTE4fSgpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHVuaSksIDFlMTgpOwoKICAgICAgICBieXRlcyBtZW1vcnkgcGF0aCA9IGFiaS5lbmNvZGVQYWNrZWQoV0VUSCwgdWludDI0KDMwMDApLCBVU0RDLCB1aW50MjQoMTAwKSwgREFJKTsKCiAgICAgICAgdWludDI1NiBhbW91bnRPdXQgPSB1bmkuc3dhcEV4YWN0SW5wdXRNdWx0aUhvcChwYXRoLCBXRVRILCAxZTE4KTsKCiAgICAgICAgY29uc29sZTIubG9nKCJEQUkiLCBhbW91bnRPdXQpOwogICAgfQp9Cg=="}],Zb=`

                    Uniswap V3 Single Hop Swap

                    +`,yb=({prev:s,next:a})=>r.jsx(A,{version:db,title:Cb,description:jb,html:ub,prev:s,next:a,codes:Ab}),mb="0.8.24",bb="Uniswap V3 Swap Examples",wb="Uniswap V3 swap examples",kb=[{fileName:"UniswapV3MultiHopSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmFkZHJlc3MgY29uc3RhbnQgU1dBUF9ST1VURVJfMDIgPSAweDY4YjM0NjU4MzNmYjcyQTcwZWNERjQ4NUUwZTRDN2JEODY2NUZjNDU7CmFkZHJlc3MgY29uc3RhbnQgV0VUSCA9IDB4QzAyYWFBMzliMjIzRkU4RDBBMGU1QzRGMjdlQUQ5MDgzQzc1NkNjMjsKYWRkcmVzcyBjb25zdGFudCBVU0RDID0gMHhBMGI4Njk5MWM2MjE4YjM2YzFkMTlENGEyZTlFYjBjRTM2MDZlQjQ4OwphZGRyZXNzIGNvbnN0YW50IERBSSA9IDB4NkIxNzU0NzRFODkwOTRDNDREYTk4Yjk1NEVlZGVBQzQ5NTI3MWQwRjsKCmNvbnRyYWN0IFVuaXN3YXBWM011bHRpSG9wU3dhcCB7CiAgICBJU3dhcFJvdXRlcjAyIHByaXZhdGUgY29uc3RhbnQgcm91dGVyID0gSVN3YXBSb3V0ZXIwMihTV0FQX1JPVVRFUl8wMik7CiAgICBJRVJDMjAgcHJpdmF0ZSBjb25zdGFudCB3ZXRoID0gSUVSQzIwKFdFVEgpOwogICAgSUVSQzIwIHByaXZhdGUgY29uc3RhbnQgZGFpID0gSUVSQzIwKERBSSk7CgogICAgZnVuY3Rpb24gc3dhcEV4YWN0SW5wdXRNdWx0aUhvcCh1aW50MjU2IGFtb3VudEluLCB1aW50MjU2IGFtb3VudE91dE1pbikKICAgICAgICBleHRlcm5hbAogICAgewogICAgICAgIHdldGgudHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudEluKTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhyb3V0ZXIpLCBhbW91bnRJbik7CgogICAgICAgIGJ5dGVzIG1lbW9yeSBwYXRoID0KICAgICAgICAgICAgYWJpLmVuY29kZVBhY2tlZChXRVRILCB1aW50MjQoMzAwMCksIFVTREMsIHVpbnQyNCgxMDApLCBEQUkpOwoKICAgICAgICBJU3dhcFJvdXRlcjAyLkV4YWN0SW5wdXRQYXJhbXMgbWVtb3J5IHBhcmFtcyA9IElTd2FwUm91dGVyMDIKICAgICAgICAgICAgLkV4YWN0SW5wdXRQYXJhbXMoewogICAgICAgICAgICBwYXRoOiBwYXRoLAogICAgICAgICAgICByZWNpcGllbnQ6IG1zZy5zZW5kZXIsCiAgICAgICAgICAgIGFtb3VudEluOiBhbW91bnRJbiwKICAgICAgICAgICAgYW1vdW50T3V0TWluaW11bTogYW1vdW50T3V0TWluCiAgICAgICAgfSk7CgogICAgICAgIHJvdXRlci5leGFjdElucHV0KHBhcmFtcyk7CiAgICB9CgogICAgZnVuY3Rpb24gc3dhcEV4YWN0T3V0cHV0TXVsdGlIb3AodWludDI1NiBhbW91bnRPdXQsIHVpbnQyNTYgYW1vdW50SW5NYXgpCiAgICAgICAgZXh0ZXJuYWwKICAgIHsKICAgICAgICB3ZXRoLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBhbW91bnRJbk1heCk7CiAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW5NYXgpOwoKICAgICAgICBieXRlcyBtZW1vcnkgcGF0aCA9CiAgICAgICAgICAgIGFiaS5lbmNvZGVQYWNrZWQoREFJLCB1aW50MjQoMTAwKSwgVVNEQywgdWludDI0KDMwMDApLCBXRVRIKTsKCiAgICAgICAgSVN3YXBSb3V0ZXIwMi5FeGFjdE91dHB1dFBhcmFtcyBtZW1vcnkgcGFyYW1zID0gSVN3YXBSb3V0ZXIwMgogICAgICAgICAgICAuRXhhY3RPdXRwdXRQYXJhbXMoewogICAgICAgICAgICBwYXRoOiBwYXRoLAogICAgICAgICAgICByZWNpcGllbnQ6IG1zZy5zZW5kZXIsCiAgICAgICAgICAgIGFtb3VudE91dDogYW1vdW50T3V0LAogICAgICAgICAgICBhbW91bnRJbk1heGltdW06IGFtb3VudEluTWF4CiAgICAgICAgfSk7CgogICAgICAgIHVpbnQyNTYgYW1vdW50SW4gPSByb3V0ZXIuZXhhY3RPdXRwdXQocGFyYW1zKTsKCiAgICAgICAgaWYgKGFtb3VudEluIDwgYW1vdW50SW5NYXgpIHsKICAgICAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgMCk7CiAgICAgICAgICAgIHdldGgudHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50SW5NYXggLSBhbW91bnRJbik7CiAgICAgICAgfQogICAgfQp9CgppbnRlcmZhY2UgSVN3YXBSb3V0ZXIwMiB7CiAgICBzdHJ1Y3QgRXhhY3RJbnB1dFBhcmFtcyB7CiAgICAgICAgYnl0ZXMgcGF0aDsKICAgICAgICBhZGRyZXNzIHJlY2lwaWVudDsKICAgICAgICB1aW50MjU2IGFtb3VudEluOwogICAgICAgIHVpbnQyNTYgYW1vdW50T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dhcFJvdXRlcjAyIHsKICAgIHN0cnVjdCBFeGFjdElucHV0U2luZ2xlUGFyYW1zIHsKICAgICAgICBhZGRyZXNzIHRva2VuSW47CiAgICAgICAgYWRkcmVzcyB0b2tlbk91dDsKICAgICAgICB1aW50MjQgZmVlOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQyNTYgYW1vdW50SW47CiAgICAgICAgdWludDI1NiBhbW91bnRPdXRNaW5pbXVtOwogICAgICAgIHVpbnQxNjAgc3FydFByaWNlTGltaXRYOTY7CiAgICB9CgogICAgZnVuY3Rpb24gZXhhY3RJbnB1dFNpbmdsZShFeGFjdElucHV0U2luZ2xlUGFyYW1zIGNhbGxkYXRhIHBhcmFtcykKICAgICAgICBleHRlcm5hbAogICAgICAgIHBheWFibGUKICAgICAgICByZXR1cm5zICh1aW50MjU2IGFtb3VudE91dCk7CgogICAgc3RydWN0IEV4YWN0T3V0cHV0U2luZ2xlUGFyYW1zIHsKICAgICAgICBhZGRyZXNzIHRva2VuSW47CiAgICAgICAgYWRkcmVzcyB0b2tlbk91dDsKICAgICAgICB1aW50MjQgZmVlOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQyNTYgYW1vdW50T3V0OwogICAgICAgIHVpbnQyNTYgYW1vdW50SW5NYXhpbXVtOwogICAgICAgIHVpbnQxNjAgc3FydFByaWNlTGltaXRYOTY7CiAgICB9CgogICAgZnVuY3Rpb24gZXhhY3RPdXRwdXRTaW5nbGUoRXhhY3RPdXRwdXRTaW5nbGVQYXJhbXMgY2FsbGRhdGEgcGFyYW1zKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYW1vdW50SW4pOwp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKIC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AgICAgICAgICAgIGFtb3VudEluOiBhbW91bnRJbiwKICAgICAgICAgICAgYW1vdW50T3V0TWluaW11bTogMCwKICAgICAgICAgICAgc3FydFByaWNlTGltaXRYOTY6IDAKICAgICAgICB9KTsKCiAgICAgICAgYW1vdW50T3V0ID0gcm91dGVyLmV4YWN0SW5wdXRTaW5nbGUocGFyYW1zKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzd2FwRXhhY3RJbnB1dE11bHRpSG9wKGJ5dGVzIGNhbGxkYXRhIHBhdGgsIGFkZHJlc3MgdG9rZW5JbiwgdWludDI1NiBhbW91bnRJbikKICAgICAgICBleHRlcm5hbAogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYW1vdW50T3V0KQogICAgewogICAgICAgIElFUkMyMCh0b2tlbkluKS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW4pOwogICAgICAgIElFUkMyMCh0b2tlbkluKS5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW4pOwoKICAgICAgICBJU3dhcFJvdXRlci5FeGFjdElucHV0UGFyYW1zIG1lbW9yeSBwYXJhbXMgPSBJU3dhcFJvdXRlci5FeGFjdElucHV0UGFyYW1zKHsKICAgICAgICAgICAgcGF0aDogcGF0aCwKICAgICAgICAgICAgcmVjaXBpZW50OiBtc2cuc2VuZGVyLAogICAgICAgICAgICBkZWFkbGluZTogYmxvY2sudGltZXN0YW1wLAogICAgICAgICAgICBhbW91bnRJbjogYW1vdW50SW4sCiAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IDAKICAgICAgICB9KTsKICAgICAgICBhbW91bnRPdXQgPSByb3V0ZXIuZXhhY3RJbnB1dChwYXJhbXMpOwogICAgfQp9CgppbnRlcmZhY2UgSVN3YXBSb3V0ZXIgewogICAgc3RydWN0IEV4YWN0SW5wdXRTaW5nbGVQYXJhbXMgewogICAgICAgIGFkZHJlc3MgdG9rZW5JbjsKICAgICAgICB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guZGVwb3NpdHt2YWx1ZTogMWUxOH0oKTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCAxZTE4KTsKCiAgICAgICAgdWludDI1NiBhbW91bnRPdXQgPSB1bmkuc3dhcEV4YWN0SW5wdXRTaW5nbGVIb3AoV0VUSCwgREFJLCAzMDAwLCAxZTE4KTsKCiAgICAgICAgY29uc29sZTIubG9nKCJEQUkiLCBhbW91bnRPdXQpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RNdWx0aUhvcCgpIHB1YmxpYyB7CiAgICAgICAgd2V0aC5kZXBvc2l0e3ZhbHVlOiAxZTE4fSgpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHVuaSksIDFlMTgpOwoKICAgICAgICBieXRlcyBtZW1vcnkgcGF0aCA9IGFiaS5lbmNvZGVQYWNrZWQoV0VUSCwgdWludDI0KDMwMDApLCBVU0RDLCB1aW50MjQoMTAwKSwgREFJKTsKCiAgICAgICAgdWludDI1NiBhbW91bnRPdXQgPSB1bmkuc3dhcEV4YWN0SW5wdXRNdWx0aUhvcChwYXRoLCBXRVRILCAxZTE4KTsKCiAgICAgICAgY29uc29sZTIubG9nKCJEQUkiLCBhbW91bnRPdXQpOwogICAgfQp9Cg=="}],Zb=`

                    Uniswap V3 Single Hop Swap

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.24;
                     
                    @@ -6940,7 +6940,7 @@ IERC20 constant PAIR address(swap)), 0, "DAI balance of swap != 0");
                         }
                     }
                    -
                    `,Wb=({prev:s,next:a})=>r.jsx(u,{version:mb,title:bb,description:wb,html:Zb,prev:s,next:a,codes:kb}),Bb="0.8.24",Gb="Vault",Vb="Vault",fb=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFZhdWx0IHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4pIHsKICAgICAgICB0b2tlbiA9IElFUkMyMChfdG9rZW4pOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgX3RvLCB1aW50MjU2IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW190b10gKz0gX3NoYXJlczsKICAgIH0KCiAgICBmdW5jdGlvbiBfYnVybihhZGRyZXNzIF9mcm9tLCB1aW50MjU2IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5IC09IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW19mcm9tXSAtPSBfc2hhcmVzOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50CiAgICAgICAgQiA9IGJhbGFuY2Ugb2YgdG9rZW4gYmVmb3JlIGRlcG9zaXQKICAgICAgICBUID0gdG90YWwgc3VwcGx5CiAgICAgICAgcyA9IHNoYXJlcyB0byBtaW50CgogICAgICAgIChUICsgcykgLyBUID0gKGEgKyBCKSAvIEIgCgogICAgICAgIHMgPSBhVCAvIEIKICAgICAgICAqLwogICAgICAgIHVpbnQyNTYgc2hhcmVzOwogICAgICAgIGlmICh0b3RhbFN1cHBseSA9PSAwKSB7CiAgICAgICAgICAgIHNoYXJlcyA9IF9hbW91bnQ7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgc2hhcmVzID0gKF9hbW91bnQgKiB0b3RhbFN1cHBseSkgLyB0b2tlbi5iYWxhbm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YWRkcmVzcyBvd25lciwgYWRkcmVzcyBzcGVuZGVyKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKHVpbnQyNTYpOwoKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3Mgc2VuZGVyLCBhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKCiAgICBldmVudCBUcmFuc2ZlcihhZGRyZXNzIGluZGV4ZWQgZnJvbSwgYWRkcmVzcyBpbmRleGVkIHRvLCB1aW50MjU2IGFtb3VudCk7CiAgICBldmVudCBBcHByb3ZhbCgKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3duZXIsIGFkZHJlc3MgaW5kZXhlZCBzcGVuZGVyLCB1aW50MjU2IGFtb3VudAogICAgKTsKfQo="}],Yb=`

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

                    +
                    `,Wb=({prev:s,next:a})=>r.jsx(A,{version:mb,title:bb,description:wb,html:Zb,prev:s,next:a,codes:kb}),Bb="0.8.24",Gb="Vault",Vb="Vault",fb=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFZhdWx0IHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuOwoKICAgIHVpbnQyNTYgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4pIHsKICAgICAgICB0b2tlbiA9IElFUkMyMChfdG9rZW4pOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgX3RvLCB1aW50MjU2IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW190b10gKz0gX3NoYXJlczsKICAgIH0KCiAgICBmdW5jdGlvbiBfYnVybihhZGRyZXNzIF9mcm9tLCB1aW50MjU2IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5IC09IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW19mcm9tXSAtPSBfc2hhcmVzOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludDI1NiBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50CiAgICAgICAgQiA9IGJhbGFuY2Ugb2YgdG9rZW4gYmVmb3JlIGRlcG9zaXQKICAgICAgICBUID0gdG90YWwgc3VwcGx5CiAgICAgICAgcyA9IHNoYXJlcyB0byBtaW50CgogICAgICAgIChUICsgcykgLyBUID0gKGEgKyBCKSAvIEIgCgogICAgICAgIHMgPSBhVCAvIEIKICAgICAgICAqLwogICAgICAgIHVpbnQyNTYgc2hhcmVzOwogICAgICAgIGlmICh0b3RhbFN1cHBseSA9PSAwKSB7CiAgICAgICAgICAgIHNoYXJlcyA9IF9hbW91bnQ7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgc2hhcmVzID0gKF9hbW91bnQgKiB0b3RhbFN1cHBseSkgLyB0b2tlbi5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CiAgICAgICAgfQoKICAgICAgICBfbWludChtc2cuc2VuZGVyLCBzaGFyZXMpOwogICAgICAgIHRva2VuLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBfYW1vdW50KTsKICAgIH0KCiAgICBm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kgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3Mgc2VuZGVyLCBhZGRyZXNzIHJlY2lwaWVudCwgdWludDI1NiBhbW91bnQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zIChib29sKTsKCiAgICBldmVudCBUcmFuc2ZlcihhZGRyZXNzIGluZGV4ZWQgZnJvbSwgYWRkcmVzcyBpbmRleGVkIHRvLCB1aW50MjU2IGFtb3VudCk7CiAgICBldmVudCBBcHByb3ZhbCgKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3duZXIsIGFkZHJlc3MgaW5kZXhlZCBzcGVuZGVyLCB1aW50MjU2IGFtb3VudAogICAgKTsKfQo="}],Yb=`

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

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

                    How the contract works

                      @@ -7036,7 +7036,7 @@ IERC20 constant PAIR address indexed owner, address indexed spender, uint256 amount ); } -
                    `,Rb=({prev:s,next:a})=>r.jsx(u,{version:Bb,title:Gb,description:Vb,html:Yb,prev:s,next:a,codes:fb}),Xb="0.8.24",vb="Delegatecall",Nb="Example of how to use deletegatecall in Solidity",Hb=[{fileName:"Delegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIE5PVEU6IERlcGxveSB0aGlzIGNvbnRyYWN0IGZpcnN0CmNvbnRyYWN0IEIgewogICAgLy8gTk9URTogc3RvcmFnZSBsYXlvdXQgbXVzdCBiZSB0aGUgc2FtZSBhcyBjb250cmFjdCBBCiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKHVpbnQyNTYgX251bSkgcHVibGljIHBheWFibGUgewogICAgICAgIG51bSA9IF9udW07CiAgICAgICAgc2VuZGVyID0gbXNnLnNlbmRlcjsKICAgICAgICB2YWx1ZSA9IG1zZy52YWx1ZTsKICAgIH0KfQoKY29udHJhY3QgQSB7CiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKGFkZHJlc3MgX2NvbnRyYWN0LCB1aW50MjU2IF9udW0pIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICAvLyBBJ3Mgc3RvcmFnZSBpcyBzZXQsIEIgaXMgbm90IG1vZGlmaWVkLgogICAgICAgIChib29sIHN1Y2Nlc3MsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF9jb250cmFjdC5kZWxlZ2F0ZWNhbGwoCiAgICAgICAgICAgIGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJzZXRWYXJzKHVpbnQyNTYpIiwgX251bSkKICAgICAgICApOwogICAgfQp9Cg=="}],Fb=`

                    delegatecall is a low level function similar to call.

                    +`,Rb=({prev:s,next:a})=>r.jsx(A,{version:Bb,title:Gb,description:Vb,html:Yb,prev:s,next:a,codes:fb}),Xb="0.8.24",vb="Delegatecall",Nb="Example of how to use deletegatecall in Solidity",Hb=[{fileName:"Delegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIE5PVEU6IERlcGxveSB0aGlzIGNvbnRyYWN0IGZpcnN0CmNvbnRyYWN0IEIgewogICAgLy8gTk9URTogc3RvcmFnZSBsYXlvdXQgbXVzdCBiZSB0aGUgc2FtZSBhcyBjb250cmFjdCBBCiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKHVpbnQyNTYgX251bSkgcHVibGljIHBheWFibGUgewogICAgICAgIG51bSA9IF9udW07CiAgICAgICAgc2VuZGVyID0gbXNnLnNlbmRlcjsKICAgICAgICB2YWx1ZSA9IG1zZy52YWx1ZTsKICAgIH0KfQoKY29udHJhY3QgQSB7CiAgICB1aW50MjU2IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50MjU2IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKGFkZHJlc3MgX2NvbnRyYWN0LCB1aW50MjU2IF9udW0pIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICAvLyBBJ3Mgc3RvcmFnZSBpcyBzZXQsIEIgaXMgbm90IG1vZGlmaWVkLgogICAgICAgIChib29sIHN1Y2Nlc3MsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF9jb250cmFjdC5kZWxlZ2F0ZWNhbGwoCiAgICAgICAgICAgIGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJzZXRWYXJzKHVpbnQyNTYpIiwgX251bSkKICAgICAgICApOwogICAgfQp9Cg=="}],Fb=`

                    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
                    @@ -7068,7 +7068,7 @@ IERC20 constant PAIR Solidity supports enumerables and they are useful to model choice and keep track of state.

                    +
                    `,Kb=({prev:s,next:a})=>r.jsx(A,{version:Xb,title:vb,description:Nb,html:Fb,prev:s,next:a,codes:Hb}),Mb="0.8.24",Sb="Enum",xb="Example of enums in Solidity",Jb=[{fileName:"Enum.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEV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c3RhdHVzOwogICAgfQp9Cg=="},{fileName:"EnumDeclaration.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKLy8gVGhpcyBpcyBzYXZlZCAnRW51bURlY2xhcmF0aW9uLnNvbCcKCmVudW0gU3RhdHVzIHsKICAgIFBlbmRpbmcsCiAgICBTaGlwcGVkLAogICAgQWNjZXB0ZWQsCiAgICBSZWplY3RlZCwKICAgIENhbmNlbGVkCn0K"},{fileName:"EnumImport.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG9ydCAiLi9FbnVtRGVjbGFyYXRpb24uc29sIjsKCmNvbnRyYWN0IEVudW0gewogICAgU3RhdHVzIHB1YmxpYyBzdGF0dXM7Cn0K"}],zb=`

                    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.24;
                    @@ -7134,7 +7134,7 @@ IERC20 constant PAIR contract Enum {
                         Status public status;
                     }
                    -
                    `,Db=({prev:s,next:a})=>r.jsx(u,{version:Mb,title:Sb,description:xb,html:zb,prev:s,next:a,codes:Jb}),Eb="0.8.24",Qb="Error",Tb="Example of how to throw errors in Solidity",Ub=[{fileName:"Account.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFjY291bnQgewogICAgdWludDI1NiBwdWJsaWMgYmFsYW5jZTsKICAgIHVpbnQyNTYgcHVibGljIGNvbnN0YW50IE1BWF9VSU5UID0gMiAqKiAyNTYgLSAxOwoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludDI1NiBfYW1vdW50KSBwdWJsaWMgewogICAgICAgIHVpbnQyNTYgb2xkQmFsYW5jZSA9IGJhb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5zdWZmaWNpZW50QmFsYW5jZSh1aW50MjU2IGJhbGFuY2UsIHVpbnQyNTYgd2l0aGRyYXdBbW91bnQpOwoKICAgIGZ1bmN0aW9uIHRlc3RDdXN0b21FcnJvcih1aW50MjU2IF93aXRoZHJhd0Ftb3VudCkgcHVibGljIHZpZXcgewogICAgICAgIHVpbnQyNTYgYmFsID0gYWRkcmVzcyh0aGlzKS5iYWxhbmNlOwogICAgICAgIGlmIChiYWwgPCBfd2l0aGRyYXdBbW91bnQpIHsKICAgICAgICAgICAgcmV2ZXJ0IEluc3VmZmljaWVudEJhbGFuY2UoewogICAgICAgICAgICAgICAgYmFsYW5jZTogYmFsLAogICAgICAgICAgICAgICAgd2l0aGRyYXdBbW91bnQ6IF93aXRoZHJhd0Ftb3VudAogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICB9Cn0K"}],_b=`

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

                    +`,Db=({prev:s,next:a})=>r.jsx(A,{version:Mb,title:Sb,description:xb,html:zb,prev:s,next:a,codes:Jb}),Eb="0.8.24",Qb="Error",Tb="Example of how to throw errors in Solidity",Ub=[{fileName:"Account.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEFjY291bnQgewogICAgdWludDI1NiBwdWJsaWMgYmFsYW5jZTsKICAgIHVpbnQyNTYgcHVibGljIGNvbnN0YW50IE1BWF9VSU5UID0gMiAqKiAyNTYgLSAxOwoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludDI1NiBfYW1vdW50KSBwdWJsaWMgewogICAgICAgIHVpbnQyNTYgb2xkQmFsYW5jZSA9IGJhbGFuY2U7CiAgICAgICAgdWludDI1NiBuZXdCYWxhbmNlID0gYmFsYW5jZSArIF9hbW91bnQ7CgogICAgICAgIC8vIGJhbGFuY2UgKyBfYW1vdW50IGRvZXMgbm90IG92ZXJmbG93IGlmIGJhbGFuY2U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ftb3VudCkgcHVibGljIHZpZXcgewogICAgICAgIHVpbnQyNTYgYmFsID0gYWRkcmVzcyh0aGlzKS5iYWxhbmNlOwogICAgICAgIGlmIChiYWwgPCBfd2l0aGRyYXdBbW91bnQpIHsKICAgICAgICAgICAgcmV2ZXJ0IEluc3VmZmljaWVudEJhbGFuY2UoewogICAgICAgICAgICAgICAgYmFsYW5jZTogYmFsLAogICAgICAgICAgICAgICAgd2l0aGRyYXdBbW91bnQ6IF93aXRoZHJhd0Ftb3VudAogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICB9Cn0K"}],_b=`

                    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.
                    • @@ -7222,7 +7222,7 @@ assertion probably means that there is a bug. assert(balance <= oldBalance); } } -`,Lb=({prev:s,next:a})=>r.jsx(u,{version:Eb,title:Qb,description:Tb,html:_b,prev:s,next:a,codes:Ub}),Ob="0.8.24",Pb="Ether and Wei",$b="An example of Ether and Wei in Solidity",qb=[{fileName:"EtherUnits.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEV0aGVyVW5pdHMgewogICAgdWludDI1NiBwdWJsaWMgb25lV2VpID0gMSB3ZWk7CiAgICAvLyAxIHdlaSBpcyBlcXVhbCB0byAxCiAgICBib29sIHB1YmxpYyBpc09uZVdlaSA9IDEgd2VpID09IDE7CgogICAgdWludDI1NiBwdWJsaWMgb25lRXRoZXIgPSAxIGV0aGVyOwogICAgLy8gMSBldGhlciBpcyBlcXVhbCB0byAxMF4xOCB3ZWkKICAgIGJvb2wgcHVibGljIGlzT25lRXRoZXIgPSAxIGV0aGVyID09IDFlMTg7Cn0K"}],sw=`

                      Transactions are paid with ether.

                      +`,Lb=({prev:s,next:a})=>r.jsx(A,{version:Eb,title:Qb,description:Tb,html:_b,prev:s,next:a,codes:Ub}),Ob="0.8.24",Pb="Ether and Wei",$b="An example of Ether and Wei in Solidity",qb=[{fileName:"EtherUnits.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEV0aGVyVW5pdHMgewogICAgdWludDI1NiBwdWJsaWMgb25lV2VpID0gMSB3ZWk7CiAgICAvLyAxIHdlaSBpcyBlcXVhbCB0byAxCiAgICBib29sIHB1YmxpYyBpc09uZVdlaSA9IDEgd2VpID09IDE7CgogICAgdWludDI1NiBwdWJsaWMgb25lRXRoZXIgPSAxIGV0aGVyOwogICAgLy8gMSBldGhlciBpcyBlcXVhbCB0byAxMF4xOCB3ZWkKICAgIGJvb2wgcHVibGljIGlzT25lRXRoZXIgPSAxIGV0aGVyID09IDFlMTg7Cn0K"}],sw=`

                      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.24;
                      @@ -7236,7 +7236,7 @@ assertion probably means that there is a bug.
                           // 1 ether is equal to 10^18 wei
                           bool public isOneEther = 1 ether == 1e18;
                       }
                      -
                      `,aw=({prev:s,next:a})=>r.jsx(u,{version:Ob,title:Pb,description:$b,html:sw,prev:s,next:a,codes:qb}),nw="0.8.24",lw="Events",pw="Example of how to emit events in Solidity",ew=[{fileName:"Events.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEV2ZW50IHsKICAgIC8vIEV2ZW50IGRlY2xhcmF0aW9uCiAgICAvLyBVcCB0byAzIHBhcmFtZXRlcnMgY2FuIGJlIGluZGV4ZWQuCiAgICAvLyBJbmRleGVkIHBhcmFtZXRlcnMgaGVscHMgeW91IGZpbHRlciB0aGUgbG9ncyBieSB0aGUgaW5kZXhlZCBwYXJhbWV0ZXIKICAgIGV2ZW50IExvZyhhZGRyZXNzIGluZGV4ZWQgc2VuZGVyLCBzdHJpbmcgbWVzc2FnZSk7CiAgICBldmVudCBBbm90aGVyTG9nKCk7CgogICAgZnVuY3Rpb24gdGVzdCgpIHB1YmxpYyB7CiAgICAgICAgZW1pdCBMb2cobXNnLnNlbmRlciwgIkhlbGxvIFdvcmxkISIpOwogICAgICAgIGVtaXQgTG9nKG1zZy5zZW5kZXIsICJIZWxsbyBFVk0hIik7CiAgICAgICAgZW1pdCBBbm90aGVyTG9nKCk7CiAgICB9Cn0K"}],cw=`

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

                      +`,aw=({prev:s,next:a})=>r.jsx(A,{version:Ob,title:Pb,description:$b,html:sw,prev:s,next:a,codes:qb}),nw="0.8.24",lw="Events",pw="Example of how to emit events in Solidity",ew=[{fileName:"Events.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEV2ZW50IHsKICAgIC8vIEV2ZW50IGRlY2xhcmF0aW9uCiAgICAvLyBVcCB0byAzIHBhcmFtZXRlcnMgY2FuIGJlIGluZGV4ZWQuCiAgICAvLyBJbmRleGVkIHBhcmFtZXRlcnMgaGVscHMgeW91IGZpbHRlciB0aGUgbG9ncyBieSB0aGUgaW5kZXhlZCBwYXJhbWV0ZXIKICAgIGV2ZW50IExvZyhhZGRyZXNzIGluZGV4ZWQgc2VuZGVyLCBzdHJpbmcgbWVzc2FnZSk7CiAgICBldmVudCBBbm90aGVyTG9nKCk7CgogICAgZnVuY3Rpb24gdGVzdCgpIHB1YmxpYyB7CiAgICAgICAgZW1pdCBMb2cobXNnLnNlbmRlciwgIkhlbGxvIFdvcmxkISIpOwogICAgICAgIGVtaXQgTG9nKG1zZy5zZW5kZXIsICJIZWxsbyBFVk0hIik7CiAgICAgICAgZW1pdCBBbm90aGVyTG9nKCk7CiAgICB9Cn0K"}],cw=`

                      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
                      • @@ -7257,7 +7257,7 @@ assertion probably means that there is a bug. emit AnotherLog(); } } -`,tw=({prev:s,next:a})=>r.jsx(u,{version:nw,title:lw,description:pw,html:cw,prev:s,next:a,codes:ew}),ow="0.8.24",rw="EVM Memory Layout in Solidity",iw="Example of EVM memory in Solidity",gw=[{fileName:"YulMem.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI0OwoKLy8gTWVtb3J5IGxheW91dAovLyBhcnJheSBvZiBsZW5ndGggMioqMjU2ICgzMiBieXRlcyksIGVhY2ggZWxlbWVudCBzdG9yZXMgMSBieXRlICgweDAwIHRvIDB4ZmYpCi8vIG1lbW9yeSB8IDAwIHwgMDAgfCAwMCB8IC4uLiB8IDAwIHwKLy8gaW5kZXggICAgMDAgICAwMSAgIDAyICAgLi4uICAgMHhmZmYuLi5mZmYgKDMyIGJ5dGVzKQoKLy8gUmVzZXJ2ZWQgc2xvdHMKLy8gMHgwMCAtIDB4M2YgKDY0IGJ5dGVzKTogc2NyYXRjaCBzcGFjZSBmb3IgaGFzaGluZyBtZXRob2RzCi8vIDB4NDAgLSAweDVmICgzMiBieXRlcyk6IHBvaW50ZXIgdG8gbmV4dCBhdmFpbGFibGUgbG9jYXRpb24gaW4gbWVtb3J5IHRvIHN0b3JlIGRhdGEgKGZyZWUgbWVtb3J5IHBvaW50ZXIpCi8vIDB4NjAgLSAweDdmICgzMiBieXRlcyk6IHplcm8gc2xvdCAtIHVzZWQgYXMgaW5pdGlhbCB2YWx1ZSBmb3IgZHluYW1pYyBtZW1vcnkgYXJyYXlzIGFuZCBzaG91bGQgbmV2ZXIgYmUgd3JpdHRlbiB0bwoKLy8gRnJlZSBtZW1vcnkgcG9pbnRlciAoMHg0MCkKLy8gMHg4MCA9IEZyZWUgbWVtb3J5IHBvaW50ZXIgaW5pdGlh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pbnQoMSwgMiwgMyk7CgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gbG9hZCAzMiBieXRlcyBzdGFydGluZyBmcm9tIDB4ODAKICAgICAgICAgICAgeCA6PSBtbG9hZCgweDgwKQogICAgICAgICAgICAvLyBsb2FkIDMyIGJ5dGVzIHN0YXJ0aW5nIGZyb20gMHhhMCAoMHg4MCArIDMyID0gMHhhMCkKICAgICAgICAgICAgeSA6PSBtbG9hZCgweGEwKQogICAgICAgICAgICAvLyBsb2FkIDMyIGJ5dGVzIHN0YXJ0aW5nIGZyb20gMHhjMCAoMHhhMCArIDMyID0gMHhjMCkKICAgICAgICAgICAgeiA6PSBtbG9hZCgweGMwKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3dyaXRlKCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMiBmcmVlX21lbV9wdHIsIHVpbnQyNTYgeCwgdWludDI1NiB5LCB1aW50MjU2IHopCiAgICB7CiAgICAgICAgLy8gQWxsb2NhdGVzIG1lbW9yeSAweDgwIHRvIDB4ZGYgdG8gUG9pbnQKICAgICAgICAvLyBGcmVlIG1lbW9yeSBwb2ludGVyID0gMHhkZiArIDEgPSAweGUwCiAgICAgICAgUG9pbnQgbWVtb3J5IHA7CgogICAgICAgIC8vIFdyaXRlCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBzdG9yZSB0byAweDgwCiAgICAgICAgICAgIG1zdG9yZShwLCAxMSkKICAgICAgICAgICAgLy8gc3RvcmUgdG8gMHhhMAogICAgICAgICAgICBtc3RvcmUoYWRkKHAsIDB4MjApLCAyMikKICAgICAgICAgICAgLy8gc3RvcmUgdG8gMHhjMAogICAgICAgICAgICBtc3RvcmUoYWRkKHAsIDB4NDApLCAzMykKICAgICAgICAgICAgLy8gMHhlMAogICAgICAgICAgICBmcmVlX21lbV9wdHIgOj0gbWxvYWQoMHg0MCkKICAgICAgICB9CgogICAgICAgIHggPSBwLng7CiAgICAgICAgeSA9IHAueTsKICAgICAgICB6ID0gcC56OwogICAgfQp9Cgpjb250cmFjdCBNZW1GaXhlZEFycmF5IHsKICAgIGZ1bmN0aW9uIHRlc3RfcmVhZCgpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYTAsIHVpbnQyNTYgYTEsIHVpbnQyNTYgYTIpCiAgICB7CiAgICAgICAgLy8gYXJyIGlzIGxvYWRlZCB0byBtZW1vcnkgc3RhcnRpbmcgYXQgMHg4MAogICAgICAgIC8vIEVhY2ggYXJyYXkgZWxlbWVudCBpcyBzdG9yZWQgYXMgMzIgYnl0ZXMKICAgICAgICB1aW50MzJbM10gbWVtb3J5IGFyciA9IFt1aW50MzIoMSksIHVpbnQzMigyKSwgdWludDMyKDMpXTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBhMCA6PSBtbG9hZCgweDgwKQogICAgICAgICAgICBhMSA6PSBtbG9hZCgweGEwKQogICAgICAgICAgICBhMiA6PSBtbG9hZCgweGMwKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3dyaXRlKCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBhMCwgdWludDI1NiBhMSwgdWludDI1NiBhMikKICAgIHsKICAgICAgICB1aW50MzJbM10gbWVtb3J5IGFycjsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyAweDgwCiAgICAgICAgICAgIG1zdG9yZShhcnIsIDExKQogICAgICAgICAgICAvLyAweGEwCiAgICAgICAgICAgIG1zdG9yZShhZGQoYXJyLCAweDIwKSwgMjIpCiAgICAgICAgICAgIC8vIDB4YzAKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4NDApLCAzMykKICAgICAgICB9CgogICAgICAgIGEwID0gYXJyWzBdOwogICAgICAgIGExID0gYXJyWzFdOwogICAgICAgIGEyID0gYXJyWzJdOwogICAgfQp9Cgpjb250cmFjdCBNZW1EeW5hbWljQXJyYXkgewogICAgZnVuY3Rpb24gdGVzdF9yZWFkKCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBsZW4sIHVpbnQyNTYgYTAsIHVpbnQyNTYgYTEsIHVpbnQyNTYgYTIpCiAgICB7CiAgICAgICAgdWludDI1NltdIG1lbW9yeSBhcnIgPSBuZXcgdWludDI1NltdKDUpOwogICAgICAgIGFyclswXSA9IHVpbnQyNTYoMTEpOwogICAgICAgIGFyclsxXSA9IHVpbnQyNTYoMjIpOwogICAgICAgIGFyclsyXSA9IHVpbnQyNTYoMzMpOwogICAgICAgIGFyclszXSA9IHVpbnQyNTYoNDQpOwogICAgICAgIGFycls0XSA9IHVpbnQyNTYoNTUpOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIDB4ODAKICAgICAgICAgICAgbGVuIDo9IG1sb2FkKGFycikKICAgICAgICAgICAgLy8gMHhhMAogICAgICAgICAgICBhMCA6PSBtbG9hZChhZGQoYXJyLCAweDIwKSkKICAgICAgICAgICAgLy8gMHhjMAogICAgICAgICAgICBhMSA6PSBtbG9hZChhZGQoYXJyLCAweDQwKSkKICAgICAgICAgICAgLy8gMHhlMAogICAgICAgICAgICBhMiA6PSBtbG9hZChhZGQoYXJyLCAweDYwKSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF93cml0ZSgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTZbXSBtZW1vcnkpIHsKICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFycjsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBTdG9yZSBsZW5ndGggb2YgYXJyCiAgICAgICAgICAgIG1zdG9yZShhcnIsIDMpCiAgICAgICAgICAgIC8vIFN0b3JlIDEsIDIsIDMKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4MjApLCAxMSkKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4NDApLCAyMikKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4NjApLCAzMykKICAgICAgICAgICAgLy8gVXBkYXRlIGZyZWUgbWVtb3J5IHBvaW50ZXIKICAgICAgICAgICAgbXN0b3JlKDB4NDAsIGFkZChhcnIsIDB4ODApKQogICAgICAgIH0KCiAgICAgICAgLy8gRGF0YSB3aWxsIGJlIEFCSSBlbmNvZGVkIHdoZW4gYXJyIGlzIHJldHVybmVkIHRvIGNhbGxlcgogICAgICAgIHJldHVybiBhcnI7CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUludGVybmFsRnVuY1JldHVybiB7CiAgICBmdW5jdGlvbiBpbnRlcm5hbF9mdW5jX3JldHVybl92YWwoKSBwcml2YXRlIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB1aW50MjU2KDB4YWJhYmFiKTsKICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3ZhbCgpIHB1YmxpYyBwdXJlIHsKICAgICAgICAvLyAweGFiYWJhYiB3aWxsIGJlIHN0b3JlZCBpbiB0b3Agb2YgdGhlIHN0YWNrCiAgICAgICAgaW50ZXJuYWxfZnVuY19yZXR1cm5fdmFsKCk7CiAgICB9CgogICAgZnVuY3Rpb24gaW50ZXJuYWxfZnVuY19yZXR1cm5fbWVtKCkKICAgICAgICBwcml2YXRlCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzJbXSBtZW1vcnkpCiAgICB7CiAgICAgICAgYnl0ZXMzMltdIG1lbW9yeSBhcnIgPSBuZXcgYnl0ZXMzMltdKDMpOwogICAgICAgIGFyclswXSA9IGJ5dGVzMzIodWludDI1NigweGFhYSkpOwogICAgICAgIGFyclsxXSA9IGJ5dGVzMzIodWludDI1NigweGJiYikpOwogICAgICAgIGFyclsy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wKSwgMCwgcmV0dXJuX2RhdGFfc2l6ZSkKICAgICAgICAgICAgLy8gVXBkYXRlIGZyZWUgbWVtb3J5IHBvaW50ZXIKICAgICAgICAgICAgbXN0b3JlKDB4NDAsIGFkZChvdXQsIGFkZCgweDIwLCByZXR1cm5fZGF0YV9zaXplKSkpCiAgICAgICAgfQogICAgfQp9Cgpjb250cmFjdCBDb3VudGVyIHsKICAgIHVpbnQyNTYgcHVibGljIGNvdW50OwoKICAgIGZ1bmN0aW9uIGluYygpIHB1YmxpYyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgY291bnQgKz0gMTsKICAgICAgICByZXR1cm4gY291bnQ7CiAgICB9Cn0KCmNvbnRyYWN0IFl1bENhbGwgewogICAgZnVuY3Rpb24gdGVzdF9jYWxsKGFkZHJlc3MgYSwgYnl0ZXMgbWVtb3J5IGRhdGEpCiAgICAgICAgcHVibGljCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKGJ5dGVzIG1lbW9yeSBvdXQpCiAgICB7CiAgICAgICAgYnl0ZXMzMiBkYXRhX3B0cjsKICAgICAgICBieXRlczMyIG91dF9wdHI7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyAweDgwCiAgICAgICAgICAgIGRhdGFfcHRyIDo9IGRhdGEKICAgICAgICAgICAgLy8gMHg2MAogICAgICAgICAgICBvdXRfcHRyIDo9IG91dAoKICAgICAgICAgICAgbGV0IGRhdGFfc2l6ZSA6PSBtbG9hZChkYXRhKQogICAgICAgICAgICBsZXQgZGF0YV9zdGFydCA6PSBhZGQoZGF0YSwgMHgyMCkKICAgICAgICAgICAgbGV0IG9rIDo9IGNhbGwoZ2FzKCksIGEsIGNhbGx2YWx1ZSgpLCBkYXRhX3N0YXJ0LCBkYXRhX3NpemUsIDAsIDApCgogICAgICAgICAgICBpZiBpc3plcm8ob2spIHsgcmV2ZXJ0KDAsIDApIH0KCiAgICAgICAgICAgIGxldCByZXR1cm5fZGF0YV9zaXplIDo9IHJldHVybmRhdGFzaXplKCkKICAgICAgICAgICAgLy8gU3RvcmUgbGVuZ3RoIG9mIHJldHVybiBkYXRhIHRvIG91dAogICAgICAgICAgICBtc3RvcmUob3V0LCByZXR1cm5fZGF0YV9zaXplKQogICAgICAgICAgICAvLyBDb3B5IHJldHVybiBkYXRhIHRvIG91dAogICAgICAgICAgICByZXR1cm5kYXRhY29weShhZGQob3V0LCAweDIwKSwgMCwgcmV0dXJuX2RhdGFfc2l6ZSkKICAgICAgICAgICAgLy8gVXBkYXRlIGZyZWUgbWVtb3J5IHBvaW50ZXIKICAgICAgICAgICAgbXN0b3JlKDB4NDAsIGFkZChvdXQsIGFkZCgweDIwLCByZXR1cm5fZGF0YV9zaXplKSkpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfaW5jKGFkZHJlc3MgY291bnRlcikgcHVibGljIHJldHVybnMgKHVpbnQyNTYgY291bnQpIHsKICAgICAgICBieXRlcyBtZW1vcnkgcmVzID0gdGVzdF9jYWxsKGNvdW50ZXIsIGFiaS5lbmNvZGVDYWxsKENvdW50ZXIuaW5jLCAoKSkpOwogICAgICAgIGNvdW50ID0gYWJpLmRlY29kZShyZXMsICh1aW50MjU2KSk7CiAgICB9Cn0KCi8vIE1lbW9yeSBleHBhbnNpb24gZ2FzIGNvc3QKLy8gR2FzIGNvc3QgaXMgcXVhZHJhdGljIHRvIG1lbW9yeSBhbGxvY2F0aW9uLgpjb250cmFjdCBNZW1FeHAgewogICAgZnVuY3Rpb24gYWxsb2NfbWVtKHVpbnQyNTYgbikgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgdWludDI1NiBnYXNfc3RhcnQgPSBnYXNsZWZ0KCk7CiAgICAgICAgdWludDI1NltdIG1lbW9yeSBhcnIgPSBuZXcgdWludDI1NltdKG4pOwogICAgICAgIHVpbnQyNTYgZ2FzX2VuZCA9IGdhc2xlZnQoKTsKICAgICAgICByZXR1c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8vICAgIDE2MDAwIHwgNTk2NDg0Ci8vICAgIDE3MDAwIHwgNjY2OTU3Ci8vICAgIDE4MDAwIHwgNzQxMzM2Ci8vICAgIDE5MDAwIHwgODE5NjIxCi8vICAgIDIwMDAwIHwgOTAxODEyCg=="}],hw=`

                        Examples of

                        +`,tw=({prev:s,next:a})=>r.jsx(A,{version:nw,title:lw,description:pw,html:cw,prev:s,next:a,codes:ew}),ow="0.8.24",rw="EVM Memory Layout in Solidity",iw="Example of EVM memory in Solidity",gw=[{fileName:"YulMem.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI0OwoKLy8gTWVtb3J5IGxheW91dAovLyBhcnJheSBvZiBsZW5ndGggMioqMjU2ICgzMiBieXRlcyksIGVhY2ggZWxlbWVudCBzdG9yZXMgMSBieXRlICgweDAwIHRvIDB4ZmYpCi8vIG1lbW9yeSB8IDAwIHwgMDAgfCAwMCB8IC4uLiB8IDAwIHwKLy8gaW5kZXggICAgMDAgICAwMSAgIDAyICAgLi4uICAgMHhmZmYuLi5mZmYgKDMyIGJ5dGVzKQoKLy8gUmVzZXJ2ZWQgc2xvdHMKLy8gMHgwMCAtIDB4M2YgKDY0IGJ5dGVzKTogc2NyYXRjaCBzcGFjZSBmb3IgaGFzaGluZyBtZXRob2RzCi8vIDB4NDAgLSAweDVmICgzMiBieXRlcyk6IHBvaW50ZXIgdG8gbmV4dCBhdmFpbGFibGUgbG9jYXRpb24gaW4gbWVtb3J5IHRvIHN0b3JlIGRhdGEgKGZyZWUgbWVtb3J5IHBvaW50ZXIpCi8vIDB4NjAgLSAweDdmICgzMiBieXRlcyk6IHplcm8gc2xvdCAtIHVzZWQgYXMgaW5pdGlhbCB2YWx1ZSBmb3IgZHluYW1pYyBtZW1vcnkgYXJyYXlzIGFuZCBzaG91bGQgbmV2ZXIgYmUgd3JpdHRlbiB0bwoKLy8gRnJlZSBtZW1vcnkgcG9pbnRlciA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W5pdGlhbCBmcmVlIG1lbW9yeQogICAgICAgIFBvaW50IG1lbW9yeSBwID0gUG9pbnQoMSwgMiwgMyk7CgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gbG9hZCAzMiBieXRlcyBzdGFydGluZyBmcm9tIDB4ODAKICAgICAgICAgICAgeCA6PSBtbG9hZCgweDgwKQogICAgICAgICAgICAvLyBsb2FkIDMyIGJ5dGVzIHN0YXJ0aW5nIGZyb20gMHhhMCAoMHg4MCArIDMyID0gMHhhMCkKICAgICAgICAgICAgeSA6PSBtbG9hZCgweGEwKQogICAgICAgICAgICAvLyBsb2FkIDMyIGJ5dGVzIHN0YXJ0aW5nIGZyb20gMHhjMCAoMHhhMCArIDMyID0gMHhjMCkKICAgICAgICAgICAgeiA6PSBtbG9hZCgweGMwKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3dyaXRlKCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMiBmcmVlX21lbV9wdHIsIHVpbnQyNTYgeCwgdWludDI1NiB5LCB1aW50MjU2IHopCiAgICB7CiAgICAgICAgLy8gQWxsb2NhdGVzIG1lbW9yeSAweDgwIHRvIDB4ZGYgdG8gUG9pbnQKICAgICAgICAvLyBGcmVlIG1lbW9yeSBwb2ludGVyID0gMHhkZiArIDEgPSAweGUwCiAgICAgICAgUG9pbnQgbWVtb3J5IHA7CgogICAgICAgIC8vIFdyaXRlCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBzdG9yZSB0byAweDgwCiAgICAgICAgICAgIG1zdG9yZShwLCAxMSkKICAgICAgICAgICAgLy8gc3RvcmUgdG8gMHhhMAogICAgICAgICAgICBtc3RvcmUoYWRkKHAsIDB4MjApLCAyMikKICAgICAgICAgICAgLy8gc3RvcmUgdG8gMHhjMAogICAgICAgICAgICBtc3RvcmUoYWRkKHAsIDB4NDApLCAzMykKICAgICAgICAgICAgLy8gMHhlMAogICAgICAgICAgICBmcmVlX21lbV9wdHIgOj0gbWxvYWQoMHg0MCkKICAgICAgICB9CgogICAgICAgIHggPSBwLng7CiAgICAgICAgeSA9IHAueTsKICAgICAgICB6ID0gcC56OwogICAgfQp9Cgpjb250cmFjdCBNZW1GaXhlZEFycmF5IHsKICAgIGZ1bmN0aW9uIHRlc3RfcmVhZCgpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKHVpbnQyNTYgYTAsIHVpbnQyNTYgYTEsIHVpbnQyNTYgYTIpCiAgICB7CiAgICAgICAgLy8gYXJyIGlzIGxvYWRlZCB0byBtZW1vcnkgc3RhcnRpbmcgYXQgMHg4MAogICAgICAgIC8vIEVhY2ggYXJyYXkgZWxlbWVudCBpcyBzdG9yZWQgYXMgMzIgYnl0ZXMKICAgICAgICB1aW50MzJbM10gbWVtb3J5IGFyciA9IFt1aW50MzIoMSksIHVpbnQzMigyKSwgdWludDMyKDMpXTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBhMCA6PSBtbG9hZCgweDgwKQogICAgICAgICAgICBhMSA6PSBtbG9hZCgweGEwKQogICAgICAgICAgICBhMiA6PSBtbG9hZCgweGMwKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3dyaXRlKCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBhMCwgdWludDI1NiBhMSwgdWludDI1NiBhMikKICAgIHsKICAgICAgICB1aW50MzJbM10gbWVtb3J5IGFycjsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyAweDgwCiAgICAgICAgICAgIG1zdG9yZShhcnIsIDExKQogICAgICAgICAgICAvLyAweGEwCiAgICAgICAgICAgIG1zdG9yZShhZGQoYXJyLCAweDIwKSwgMjIpCiAgICAgICAgICAgIC8vIDB4YzAKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4NDApLCAzMykKICAgICAgICB9CgogICAgICAgIGEwID0gYXJyWzBdOwogICAgICAgIGExID0gYXJyWzFdOwogICAgICAgIGEyID0gYXJyWzJdOwogICAgfQp9Cgpjb250cmFjdCBNZW1EeW5hbWljQXJyYXkgewogICAgZnVuY3Rpb24gdGVzdF9yZWFkKCkKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAodWludDI1NiBsZW4sIHVpbnQyNTYgYTAsIHVpbnQyNTYgYTEsIHVpbnQyNTYgYTIpCiAgICB7CiAgICAgICAgdWludDI1NltdIG1lbW9yeSBhcnIgPSBuZXcgdWludDI1NltdKDUpOwogICAgICAgIGFyclswXSA9IHVpbnQyNTYoMTEpOwogICAgICAgIGFyclsxXSA9IHVpbnQyNTYoMjIpOwogICAgICAgIGFyclsyXSA9IHVpbnQyNTYoMzMpOwogICAgICAgIGFyclszXSA9IHVpbnQyNTYoNDQpOwogICAgICAgIGFycls0XSA9IHVpbnQyNTYoNTUpOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIDB4ODAKICAgICAgICAgICAgbGVuIDo9IG1sb2FkKGFycikKICAgICAgICAgICAgLy8gMHhhMAogICAgICAgICAgICBhMCA6PSBtbG9hZChhZGQoYXJyLCAweDIwKSkKICAgICAgICAgICAgLy8gMHhjMAogICAgICAgICAgICBhMSA6PSBtbG9hZChhZGQoYXJyLCAweDQwKSkKICAgICAgICAgICAgLy8gMHhlMAogICAgICAgICAgICBhMiA6PSBtbG9hZChhZGQoYXJyLCAweDYwKSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF93cml0ZSgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQyNTZbXSBtZW1vcnkpIHsKICAgICAgICB1aW50MjU2W10gbWVtb3J5IGFycjsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBTdG9yZSBsZW5ndGggb2YgYXJyCiAgICAgICAgICAgIG1zdG9yZShhcnIsIDMpCiAgICAgICAgICAgIC8vIFN0b3JlIDEsIDIsIDMKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4MjApLCAxMSkKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4NDApLCAyMikKICAgICAgICAgICAgbXN0b3JlKGFkZChhcnIsIDB4NjApLCAzMykKICAgICAgICAgICAgLy8gVXBkYXRlIGZyZWUgbWVtb3J5IHBvaW50ZXIKICAgICAgICAgICAgbXN0b3JlKDB4NDAsIGFkZChhcnIsIDB4ODApKQogICAgICAgIH0KCiAgICAgICAgLy8gRGF0YSB3aWxsIGJlIEFCSSBlbmNvZGVkIHdoZW4gYXJyIGlzIHJldHVybmVkIHRvIGNhbGxlcgogICAgICAgIHJldHVybiBhcnI7CiAgICB9Cn0KCmNvbnRyYWN0IE1lbUludGVybmFsRnVuY1JldHVybiB7CiAgICBmdW5jdGlvbiBpbnRlcm5hbF9mdW5jX3JldHVybl92YWwoKSBwcml2YXRlIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiB1aW50MjU2KDB4YWJhYmFiKTsKICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3ZhbCgpIHB1YmxpYyBwdXJlIHsKICAgICAgICAvLyAweGFiYWJhYiB3aWxsIGJlIHN0b3JlZCBpbiB0b3Agb2YgdGhlIHN0YWNrCiAgICAgICAgaW50ZXJuYWxfZnVuY19yZXR1cm5fdmFsKCk7CiAgICB9CgogICAgZnVuY3Rpb24gaW50ZXJuYWxfZnVuY19yZXR1cm5fbWVtKCkKICAgICAgICBwcml2YXRlCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzJbXSBtZW1vcnkpCiAgICB7CiAgICAgICAgYnl0ZXMzMltdIG1lbW9yeSBhcnIgPSBuZXcgYnl0ZXMzMltdKDMpOwogICAgICAgIGFyclswXSA9IGJ5dGVzMzIodWludDI1NigweGFhYSkpOwogICAg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BkYXRhIHRvIG91dAogICAgICAgICAgICByZXR1cm5kYXRhY29weShhZGQob3V0LCAweDIwKSwgMCwgcmV0dXJuX2RhdGFfc2l6ZSkKICAgICAgICAgICAgLy8gVXBkYXRlIGZyZWUgbWVtb3J5IHBvaW50ZXIKICAgICAgICAgICAgbXN0b3JlKDB4NDAsIGFkZChvdXQsIGFkZCgweDIwLCByZXR1cm5fZGF0YV9zaXplKSkpCiAgICAgICAgfQogICAgfQp9Cgpjb250cmFjdCBDb3VudGVyIHsKICAgIHVpbnQyNTYgcHVibGljIGNvdW50OwoKICAgIGZ1bmN0aW9uIGluYygpIHB1YmxpYyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgY291bnQgKz0gMTsKICAgICAgICByZXR1cm4gY291bnQ7CiAgICB9Cn0KCmNvbnRyYWN0IFl1bENhbGwgewogICAgZnVuY3Rpb24gdGVzdF9jYWxsKGFkZHJlc3MgYSwgYnl0ZXMgbWVtb3J5IGRhdGEpCiAgICAgICAgcHVibGljCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKGJ5dGVzIG1lbW9yeSBvdXQpCiAgICB7CiAgICAgICAgYnl0ZXMzMiBkYXRhX3B0cjsKICAgICAgICBieXRlczMyIG91dF9wdHI7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyAweDgwCiAgICAgICAgICAgIGRhdGFfcHRyIDo9IGRhdGEKICAgICAgICAgICAgLy8gMHg2MAogICAgICAgICAgICBvdXRfcHRyIDo9IG91dAoKICAgICAgICAgICAgbGV0IGRhdGFfc2l6ZSA6PSBtbG9hZChkYXRhKQogICAgICAgICAgICBsZXQgZGF0YV9zdGFydCA6PSBhZGQoZGF0YSwgMHgyMCkKICAgICAgICAgICAgbGV0IG9rIDo9IGNhbGwoZ2FzKCksIGEsIGNhbGx2YWx1ZSgpLCBkYXRhX3N0YXJ0LCBkYXRhX3NpemUsIDAsIDApCgogICAgICAgICAgICBpZiBpc3plcm8ob2spIHsgcmV2ZXJ0KDAsIDApIH0KCiAgICAgICAgICAgIGxldCByZXR1cm5fZGF0YV9zaXplIDo9IHJldHVybmRhdGFzaXplKCkKICAgICAgICAgICAgLy8gU3RvcmUgbGVuZ3RoIG9mIHJldHVybiBkYXRhIHRvIG91dAogICAgICAgICAgICBtc3RvcmUob3V0LCByZXR1cm5fZGF0YV9zaXplKQogICAgICAgICAgICAvLyBDb3B5IHJldHVybiBkYXRhIHRvIG91dAogICAgICAgICAgICByZXR1cm5kYXRhY29weShhZGQob3V0LCAweDIwKSwgMCwgcmV0dXJuX2RhdGFfc2l6ZSkKICAgICAgICAgICAgLy8gVXBkYXRlIGZyZWUgbWVtb3J5IHBvaW50ZXIKICAgICAgICAgICAgbXN0b3JlKDB4NDAsIGFkZChvdXQsIGFkZCgweDIwLCByZXR1cm5fZGF0YV9zaXplKSkpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfaW5jKGFkZHJlc3MgY291bnRlcikgcHVibGljIHJldHVybnMgKHVpbnQyNTYgY291bnQpIHsKICAgICAgICBieXRlcyBtZW1vcnkgcmVzID0gdGVzdF9jYWxsKGNvdW50ZXIsIGFiaS5lbmNvZGVDYWxsKENvdW50ZXIuaW5jLCAoKSkpOwogICAgICAgIGNvdW50ID0gYWJpLmRlY29kZShyZXMsICh1aW50MjU2KSk7CiAgICB9Cn0KCi8vIE1lbW9yeSBleHBhbnNpb24gZ2FzIGNvc3QKLy8gR2FzIGNvc3QgaXMgcXVhZHJhdGljIHRvIG1lbW9yeSBhbGxvY2F0aW9uLgpjb250cmFjdCBNZW1FeHAgewogICAgZnVuY3Rpb24gYWxsb2NfbWVtKHVpbnQyNTYgbikgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgdWludDI1NiBnYXNfc3RhcnQgPSBnYXNsZWZ0KCk7CiAgICAgICAgdWludDI1NltdIG1lbW9yeSBhcnIgPSBuZXcgdWludDI1NltdKG4pOwogICAg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ci8vICAgIDE0MDAwIHwgNDY3MjU3Ci8vICAgIDE1MDAwIHwgNTI5OTE4Ci8vICAgIDE2MDAwIHwgNTk2NDg0Ci8vICAgIDE3MDAwIHwgNjY2OTU3Ci8vICAgIDE4MDAwIHwgNzQxMzM2Ci8vICAgIDE5MDAwIHwgODE5NjIxCi8vICAgIDIwMDAwIHwgOTAxODEyCg=="}],hw=`

                        Examples of

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

                          References

                          Solidity document

                          EVM Codes

                          -`,Iw=({prev:s,next:a})=>r.jsx(u,{version:ow,title:rw,description:iw,html:hw,prev:s,next:a,codes:gw}),dw="0.8.24",Cw="EVM Storage",jw="Example of EVM storage in Solidity",uw=[{fileName:"EVMStorage.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIFl1bCAtIGxhbmd1YWdlIHVzZWQgZm9yIFNvbGlkaXR5IGlubGluZSBhc3NlbWJseQpjb250cmFjdCBZdWxJbnRybyB7CiAgICAvLyBZdWwgYXNzaWdubWVudAogICAgZnVuY3Rpb24gdGVzdF95dWxfdmFyKCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHVpbnQyNTYgcyA9IDA7CgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gRGVjbGFyZSB2YXJpYWJsZQogICAgICAgICAgICBsZXQgeCA6PSAxCiAgICAgICAgICAgIC8vIFJlYXNzaWduCiAgICAgICAgICAgIHggOj0gMgogICAgICAgICAgICAvLyBBc3NpZ24gdG8gU29saWRpdHkgdmFyaWFibGUKICAgICAgICAgICAgcyA6PSAyCiAgICAgICAgfQoKICAgICAgICByZXR1cm4gczsKICAgIH0KCiAgICAvLyBZdWwgdHlwZXMgKGV2ZXJ5dGhpbmcgaXMgYnl0ZXMzMikKICAgIGZ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gICAgICBzc3RvcmUoMiwgMHhhYmFiYWIpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfc3N0b3JlX2FnYWluKCkgcHVibGljIHsKICAgICAgICAvLyBBY2Nlc3Mgc2xvdCB1c2luZyAuc2xvdAogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgc3N0b3JlKHNfeC5zbG90LCAxMjMpCiAgICAgICAgICAgIHNzdG9yZShzX3kuc2xvdCwgNDU2KQogICAgICAgICAgICBzc3RvcmUoc196LnNsb3QsIDB4Y2RjZGNkKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3Nsb2FkKCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB4LCB1aW50MjU2IHksIGJ5dGVzMzIgeikKICAgIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHggOj0gc2xvYWQoMCkKICAgICAgICAgICAgeSA6PSBzbG9hZCgxKQogICAgICAgICAgICB6IDo9IHNsb2FkKDIpCiAgICAgICAgfQoKICAgICAgICByZXR1cm4gKHgsIHksIHopOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfc2xvYWRfYWdhaW4oKQogICAgICAgIHB1YmxpYwogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2IHgsIHVpbnQyNTYgeSwgYnl0ZXMzMiB6KQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgeCA6PSBzbG9hZChzX3guc2xvdCkKICAgICAgICAgICAgeSA6PSBzbG9hZChzX3kuc2xvdCkKICAgICAgICAgICAgeiA6PSBzbG9hZChzX3ouc2xvdCkKICAgICAgICB9CgogICAgICAgIHJldHVybiAoeCwgeSwgeik7CiAgICB9Cn0KCmNvbnRyYWN0IEVWTVN0b3JhdGVQYWNrZWRTbG90Qnl0ZXMgewogICAgLy8gc2xvdCAwIChwYWNrZWQgcmlnaHQgdG8gbGVmdCkKICAgIGJ5dGVzNCBwdWJsaWMgYjQgPSAweGFiYWJhYmFiOwogICAgYnl0ZXMyIHB1YmxpYyBiMiA9IDB4Y2RjZDsKCiAgICBmdW5jdGlvbiBnZXQoKSBwdWJsaWMgdmlldyByZXR1cm5zIChieXRlczMyIGIzMikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgYjMyIDo9IHNsb2FkKDApCiAgICAgICAgfQogICAgfQp9Cgpjb250cmFjdCBCaXRNYXNraW5nIHsKICAgIGZ1bmN0aW9uIHRlc3RfbWFzaygpIHB1YmxpYyBwdXJlIHJldHVybnMgKGJ5dGVzMzIgbWFzaykgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gfCAgICAgICAyNTYgYml0cyAgICAgICAgfAogICAgICAgICAgICAvLyAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExCiAgICAgICAgICAgIC8vICAgICAgICAgICAgIHwgMTYgYml0cwogICAgICAgICAgICAvLyAweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMGZmZmYKICAgICAgICAgICAgbWFzayA6PSBzdWIoc2hsKDE2LCAxKSwgMSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9zaGlmdF9tYXNrKCkgcHVibGljIHB1cmUgcmV0dXJucyAoYnl0ZXMzMiBtYXNrKSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyB8ICAgICAgICAgICAgICAgMjU2IGJpdHMgICAgICAgICAgICAgICAgfAogICAgICAgICAgICAvLyAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExIHwgMDAwIC4uLiAwMDAgfAogICAgICAgICAgICAvLyAgICAgICAgICAgICB8IDE2IGJpdHMgICAgIHwgMzIgYml0cwogICAgICAgICAgICAvLyAweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD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wogICAgdWludDY0IHB1YmxpYyBzX3g7CiAgICB1aW50MzIgcHVibGljIHNfeTsKCiAgICBmdW5jdGlvbiB0ZXN0X3NzdG9yZSgpIHB1YmxpYyB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBMb2FkIDMyIGJ5dGVzIGZyb20gc2xvdDAKICAgICAgICAgICAgbGV0IHYgOj0gc2xvYWQoMCkKCiAgICAgICAgICAgIC8vIHNfZCB8IHNfYyB8IHNfYiB8IHNfYQogICAgICAgICAgICAvLyAzMiAgfCAzMiAgfCA2NCAgfCAxMjggYml0cwoKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDExCiAgICAgICAgICAgIC8vIG1hc2sgPSBhbGwgMXMgYXQgYW5kIHRvIHRoZSBsZWZ0IG9mIDEyOCBiaXQgY291bnRpbmcgZnJvbSByaWdodAogICAgICAgICAgICAvLyAgICAgICAgMTExIC4uLiAxMTEgfCAwMDAgLi4uIDAwMAogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19hIDo9IG5vdChzdWIoc2hsKDEyOCwgMSksIDEpKQogICAgICAgICAgICAvLyBTZXQgbGVmdCBtb3N0IDEyOCBiaXRzIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19hKQogICAgICAgICAgICAvLyBTZXQgc19hID0gMTEKICAgICAgICAgICAgdiA6PSBvcih2LCAxMSkKCiAgICAgICAgICAgIC8vIFNldCBzX2IgPSAyMgogICAgICAgICAgICAvLyBtYXNrID0gMTExLi4uMTExIHwgMDAwIC4uLiAwMDAgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19iIDo9IG5vdChzaGwoMTI4LCBzdWIoc2hsKDY0LCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2IgYnkgc2V0dGluZyBiaXRzICgxMjggdG8gMTkxIGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19iKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobCgxMjgsIDIyKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2MgPSAzMwogICAgICAgICAgICAvLyBtYXNrID0gMTExLi4uMTExIHwgMDAwLi4uMDAwIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19jIDo9IG5vdChzaGwoMTkyLCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2MgYnkgc2V0dGluZyBiaXRzICgxOTIgdG8gMjIzIGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19jKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobCgxOTIsIDMzKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2QgPSA0NAogICAgICAgICAgICAvLyBtYXNrID0gMDAwLi4uMDAwIHwgMTExLi4uMTExIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19kIDo9IG5vdChzaGwoMjI0LCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2QgYnkgc2V0dGluZyBiaXRzICgyMjQgdG8gMjU1IGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19kKQogICAgICA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mZzZXQgPSAwCiAgICAgICAgLy8geF9vZmZzZXQgPSAyMAogICAgICAgIC8vIHlfb2Zmc2V0ID0gMjgKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGFkZHJfb2Zmc2V0IDo9IHNfYWRkci5vZmZzZXQKICAgICAgICAgICAgeF9vZmZzZXQgOj0gc194Lm9mZnNldAogICAgICAgICAgICB5X29mZnNldCA6PSBzX3kub2Zmc2V0CiAgICAgICAgfQogICAgfQoKICAgIC8vIHNsb3QgYW5kIG9mZnNldAogICAgZnVuY3Rpb24gdGVzdF9zc3RvcmVfdXNpbmdfb2Zmc2V0KCkgcHVibGljIHsKICAgICAgICAvLyBhX29mZnNldCA9ICAwID0gIDAgKiA4ID0gICAwIGJpdHMKICAgICAgICAvLyBiX29mZnNldCA9IDE2ID0gMTYgKiA4ID0gMTI4IGJpdHMKICAgICAgICAvLyBjX29mZnNldCA9IDI0ID0gMjQgKiA4ID0gMTkyIGJpdHMKICAgICAgICAvLyBkX29mZnNldCA9IDI4ID0gMjggKiA4ID0gMjI0IGJpdHMKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIExvYWQgMzIgYnl0ZXMgZnJvbSBzbG90MAogICAgICAgICAgICBsZXQgdiA6PSBzbG9hZChzX2Euc2xvdCkKCiAgICAgICAgICAgIC8vIHNfZCB8IHNfYyB8IHNfYiB8IHNfYQogICAgICAgICAgICAvLyAzMiAgfCAzMiAgfCA2NCAgfCAxMjggYml0cwoKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDExMQogICAgICAgICAgICAvLyBtYXNrID0gYWxsIDFzIGF0IGFuZCB0byB0aGUgbGVmdCBvZiAxMjggYml0IGNvdW50aW5nIGZyb20gcmlnaHQKICAgICAgICAgICAgLy8gICAgICAgIDExMSAuLi4gMTExIHwgMDAwIC4uLiAwMDAKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgIHwgICAgMTI4IGJpdHMKICAgICAgICAgICAgbGV0IG1hc2tfYSA6PSBub3Qoc3ViKHNobCgxMjgsIDEpLCAxKSkKICAgICAgICAgICAgLy8gU2V0IGxlZnQgbW9zdCAxMjggYml0cyB0byAwCiAgICAgICAgICAgIHYgOj0gYW5kKHYsIG1hc2tfYSkKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDEKICAgICAgICAgICAgdiA6PSBvcih2LCAxMTEpCgogICAgICAgICAgICAvLyBTZXQgc19iID0gMjIyCiAgICAgICAgICAgIC8vIG1hc2sgPSAxMTEuLi4xMTEgfCAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExCiAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgfCAgICAgNjQgYml0cyB8ICAgIDEyOCBiaXRzCiAgICAgICAgICAgIGxldCBtYXNrX2IgOj0gbm90KHNobChtdWwoc19iLm9mZnNldCwgOCksIHN1YihzaGwoNjQsIDEpLCAxKSkpCiAgICAgICAgICAgIC8vIENsZWFyIHByZXZpb3VzIHZhbHVlIG9mIHNfYiBieSBzZXR0aW5nIGJpdHMgKDEyOCB0byAxOTEgYml0cykgdG8gMAogICAgICAgICAgICB2IDo9IGFuZCh2LCBtYXNrX2IpCiAgICAgICAgICAgIHYgOj0gb3Iodiwgc2hsKG11bChzX2Iub2Zmc2V0LCA4KSwgMjIyKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2MgPSAzMzMKICAgICAgICAgICAgLy8gbWFzayA9IDExMS4uLjExMSB8IDAwMC4uLjAwMCB8IDExMSAuLi4gMTExIHwgMTExIC4uLiAxMTEKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICB8ICAgMzIgYml0cyB8ICAgICA2NCBiaXRzIHwgICAgMTI4IGJpdHMKICAgICAgICAgICAgbGV0IG1hc2tfYyA6PSBub3Qoc2hsKG11bChzX2Mub2Zmc2V0LCA4KSwgc3ViKHNobCgzMiwgMSksIDEpKSkKICAgICAgICAgICAgLy8gQ2xlYXIgcHJldmlvdXMgdmFsdWUgb2Ygc19jIGJ5IHNldHRpbmcgYml0cyAoMTkyIHRvIDIyMyBiaXRzKSB0byAwCiAgICAgICAgICAgIHYgOj0gYW5kKHYsIG1hc2tfYykKICAgICAgICAgICAgdiA6PSBvcih2LCBzaGwobXVsKHNfYy5vZmZzZXQsIDgpLCAzMzMpKQoKICAgICAgICAgICAgLy8gU2V0IHNfZCA9IDQ0NAogICAgICAgICAgICAvLyBtYXNrID0gMDAwLi4uMDAwIHwgMTExLi4uMTExIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19kIDo9IG5vdChzaGwobXVsKHNfZC5vZmZzZXQsIDgpLCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2QgYnkgc2V0dGluZyBiaXRzICgyMjQgdG8gMjU1IGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19kKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobChtdWwoc19kLm9mZnNldCwgOCksIDQ0NCkpCgogICAgICAgICAgICAvLyBTdG9yZSBuZXcgdmFsdWUgdG8gc2xvdDAKICAgICAgICAgICAgc3N0b3JlKHNfYS5zbG90LCB2KQogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgRVZNU3RvcmFnZVN0cnVjdCB7CiAgICBzdHJ1Y3QgU2luZ2xlU2xvdCB7CiAgICAgICAgdWludDEyOCB4OwogICAgICAgIHVpbnQ2NCB5OwogICAgICAgIHVpbnQ2NCB6OwogICAgfQoKICAgIHN0cnVjdCBNdWx0aXBsZVNsb3RzIHsKICAgICAgICB1aW50MjU2IGE7CiAgICAgICAgdWludDI1NiBiOwogICAgICAgIHVpbnQyNTYgYzsKICAgIH0KCiAgICAvLyBzbG90IDAKICAgIFNpbmdsZVNsb3QgcHVibGljIHNpbmdsZSA9IFNpbmdsZVNsb3Qoe3g6IDEsIHk6IDIsIHo6IDN9KTsKICAgIC8vIHNsb3QgMSwgMiwgMwogICAgTXVsdGlwbGVTbG90cyBwdWJsaWMgbXVsdGkgPSBNdWx0aXBsZVNsb3RzKHthOiAxMSwgYjogMjIsIGM6IDMzfSk7CgogICAgZnVuY3Rpb24gdGVzdF9nZXRfc2luZ2xlX3Nsb3Rfc3RydWN0KCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDEyOCB4LCB1aW50NjQgeSwgdWludDY0IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgcyA6PSBzbG9hZCgwKQogICAgICAgICAgICAvLyAgeiB8ICB5IHwgeAogICAgICAgICAgICAvLyA2NCB8IDY0IHwgMTI4IGJpdHMKICAgICAgICAgICAgLy8gQ2FzdGluZyBjdXRzIG9mZiBiaXRzIHRvIHRoZSBsZWZ0CiAgICAgICAgICAgIHggOj0gcwogICAgICAgICAgICB5IDo9IHNocigxMjgsIHMpCiAgICAgICAgICAgIHogOj0gc2hyKDE5MiwgcykKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9nZXRfbXVsdGlwbGVfc2xvdHNfc3RydWN0KCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiBhLCB1aW50MjU2IGIsIHVpbnQyNTYgYykKICAgIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGEgOj0gc2xvYWQoMSkKICAgICAgICAgICAgYiA6PSBzbG9hZCgyKQogICAgICAgICAgICBjIDo9IHNsb2FkKDMpCiAgICAgICAgfQogICAgfQp9Cgpjb250cmFjdCBFVk1TdG9yYWdlQ29uc3RhbnRzIHsKICAgIC8vIHNsb3QgMAogICAgdWludDI1NiBwdWJsaWMgczAgPSAxOwogICAgLy8gQ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QyNTYgdikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gYXJyXzAgc3RhcnRzIGZyb20gc2xvdCAwCiAgICAgICAgICAgIHYgOj0gc2xvYWQoYWRkKDAsIGkpKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X2Fycl8xKHVpbnQyNTYgaSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NiB2KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBhcnJfMSBzdGFydHMgZnJvbSBzbG90IDMKICAgICAgICAgICAgdiA6PSBzbG9hZChhZGQoMywgaSkpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfYXJyXzIodWludDI1NiBpKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MTI4IHYpIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIGFycl8yIHN0YXJ0cyBmcm9tIHNsb3QgNgogICAgICAgICAgICBsZXQgYjMyIDo9IHNsb2FkKGFkZCg2LCBkaXYoaSwgMikpKQogICAgICAgICAgICAvLyBzbG90IDYgPSAxc3QgZWxlbWVudCB8IDB0aCBlbGVtZW50CiAgICAgICAgICAgIC8vIHNsb3QgNyA9IDNyZCBlbGVtZW50IHwgMm5kIGVsZW1lbnQKICAgICAgICAgICAgLy8gc2xvdCA4ID0gMDAwIC4uLiAwMDAgfCA0dGggZWxlbWVudAoKICAgICAgICAgICAgLy8gaSBpcyBldmVuID0+IGdldCByaWdodCAxMjggYml0cyA9PiBjYXN0IGJ5dGVzMzIgdG8gdWludDEyOCAoY3V0IG9mZiBsZWZ0IDEyOCBiaXRzKQogICAgICAgICAgICAvLyBpIGlzIG9kZCAgPT4gZ2V0IGxlZnQgMTI4IGJpdHMgID0+IHNoaWZ0IHJpZ2h0IDEyOCBiaXRzCgogICAgICAgICAgICBzd2l0Y2ggbW9kKGksIDIpCiAgICAgICAgICAgIGNhc2UgMSB7I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yZXNzKDIpOwoKICAgIGNvbnN0cnVjdG9yKCkgewogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMTEpOwogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMjIpOwogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMzMpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNDQpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNTUpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNjYpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfbWFwX2FycihhZGRyZXNzIGFkZHIsIHVpbnQyNTYgaSkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB2LCB1aW50MjU2IGxlbikKICAgIHsKICAgICAgICB1aW50MjU2IG1hcF9zbG90ID0gMDsKICAgICAgICBieXRlczMyIG1hcF9oYXNoID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoYWRkciwgbWFwX3Nsb3QpKTsKICAgICAgICBieXRlczMyIGFycl9oYXNoID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUobWFwX2hhc2gpKTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZW4gOj0gc2xvYWQobWFwX2hhc2gpCiAgICAgICAgICAgIHYgOj0gc2xvYWQoYWRkKGFycl9oYXNoLCBpKSkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IEVWTVN0b3JhZ2VEeW5hbWljQXJyYXlTdHJ1Y3QgewogICAgc3RydWN0IFBvaW50IHsKICAgICAgICB1aW50MjU2IHg7CiAgICAgICAgdWludDEyOCB5OwogICAgICAgIHVpbnQxMjggejsKICAgIH0KCiAgICAvLyBzbG90IG9mIGVsZW1lbnQgPSBrZWNjYWsyNTYoc2xvdCB3aGVyZSB0aGlzIGFycmF5IGlzIGRlY2xhcmVkKSArIGluZGV4IG9mIGVsZW1lbnQKICAgIC8vIGtlY2NhazI1NigwKSArIGluZGV4ICogc2l6ZSBvZiBzdHJ1Y3QKICAgIFBvaW50W10gcHJpdmF0ZSBhcnI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgYXJyLnB1c2goUG9pbnQoMTEsIDIyLCAzMykpOwogICAgICAgIGFyci5wdXNoKFBvaW50KDQ0LCA1NSwgNjYpKTsKICAgICAgICBhcnIucHVzaChQb2ludCg3NywgODgsIDk5KSk7CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9zdHJ1Y3RfYXJyKHVpbnQyNTYgaSkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB4LCB1aW50MTI4IHksIHVpbnQxMjggeiwgdWludDI1NiBsZW4pCiAgICB7CiAgICAgICAgdWludDI1NiBzbG90ID0gMDsKICAgICAgICBieXRlczMyIHN0YXJ0ID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoc2xvdCkpOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxlbiA6PSBzbG9hZChzbG90KQogICAgICAgICAgICAvLyBzMCA9IGtlY2NhazI1NigwKQogICAgICAgICAgICAvLyBpbmRleCB8IHNsb3QgICAgICAgIHwgdmFsdWVzCiAgICAgICAgICAgIC8vICAgICAwIHwgc2xvdCBzMCArIDAgfCBhcnJbMF0ueAogICAgICAgICAgICAvLyAgICAgMCB8IHNsb3QgczAgKyAxIHwgYXJyWzBdLnogfCBhcnJbMF0ueQogICAgICAgICAgICAvLyAgICAgMSB8IHNsb3QgczAgKyAyIHwgYXJyWzFdLngKICAgICAgICAgICAgLy8gICAgIDEgfCBzbG90IHMwICsgMyB8IGFyclsxXS56IHwgYXJyWzFdLnkKICAgICAgICAgICAgLy8gICAgIDIgfCBzbG90IHMwICsgNCB8IGFyclsyXS54CiAgICAgICAgICAgIC8vICAgICAyIHwgc2xvdCBzMCArIDUgfCBhcnJbMl0ueiB8IGFyclsyXS55CiAgICAgICAgICAgIHggOj0gc2xvYWQoYWRkKHN0YXJ0LCBtdWwoaSwgMikpKQogICAgICAgICAgICBsZXQgenkgOj0gc2xvYWQoYWRkKHN0YXJ0LCBhZGQobXVsKGksIDIpLCAxKSkpCiAgICAgICAgICAgIC8vIHVpbnQxMjggY3V0cyBvZmYgbGVmdCBtb3N0IDEyOCBiaXRzIGZyb20gMzIgYnl0ZXMKICAgICAgICAgICAgeSA6PSB6eQogICAgICAgICAgICB6IDo9IHNocigxMjgsIHp5KQogICAgICAgIH0KICAgIH0KfQo="}],Aw=`

                          Examples of

                          +`,Iw=({prev:s,next:a})=>r.jsx(A,{version:ow,title:rw,description:iw,html:hw,prev:s,next:a,codes:gw}),dw="0.8.24",Cw="EVM Storage",jw="Example of EVM storage in Solidity",Aw=[{fileName:"EVMStorage.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIFl1bCAtIGxhbmd1YWdlIHVzZWQgZm9yIFNvbGlkaXR5IGlubGluZSBhc3NlbWJseQpjb250cmFjdCBZdWxJbnRybyB7CiAgICAvLyBZdWwgYXNzaWdubWVudAogICAgZnVuY3Rpb24gdGVzdF95dWxfdmFyKCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHVpbnQyNTYgcyA9IDA7CgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gRGVjbGFyZSB2YXJpYWJsZQogICAgICAgICAgICBsZXQgeCA6PSAxCiAgICAgICAgICAgIC8vIFJlYXNzaWduCiAgICAgICAgICAgIHggOj0gMgogICAgICAgICAgICAvLyBBc3NpZ24gdG8gU29saWRpdHkgdmFyaWFibGUKICAgICAgICAgICAgcyA6PSAyCiAgICAgICAgfQoKICAgICAgICByZXR1cm4gczsKICAgIH0KCiAgICAvLyBZdWwgdHlwZXMgKGV2ZXJ5dGhpbmcgaXMgYnl0ZXMzMikKICAgIGZ1bmN0aW9uIHRlc3RfeXVsX3R5c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iYWIpCiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfc3N0b3JlX2FnYWluKCkgcHVibGljIHsKICAgICAgICAvLyBBY2Nlc3Mgc2xvdCB1c2luZyAuc2xvdAogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgc3N0b3JlKHNfeC5zbG90LCAxMjMpCiAgICAgICAgICAgIHNzdG9yZShzX3kuc2xvdCwgNDU2KQogICAgICAgICAgICBzc3RvcmUoc196LnNsb3QsIDB4Y2RjZGNkKQogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X3Nsb2FkKCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB4LCB1aW50MjU2IHksIGJ5dGVzMzIgeikKICAgIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHggOj0gc2xvYWQoMCkKICAgICAgICAgICAgeSA6PSBzbG9hZCgxKQogICAgICAgICAgICB6IDo9IHNsb2FkKDIpCiAgICAgICAgfQoKICAgICAgICByZXR1cm4gKHgsIHksIHopOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3Rfc2xvYWRfYWdhaW4oKQogICAgICAgIHB1YmxpYwogICAgICAgIHZpZXcKICAgICAgICByZXR1cm5zICh1aW50MjU2IHgsIHVpbnQyNTYgeSwgYnl0ZXMzMiB6KQogICAgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgeCA6PSBzbG9hZChzX3guc2xvdCkKICAgICAgICAgICAgeSA6PSBzbG9hZChzX3kuc2xvdCkKICAgICAgICAgICAgeiA6PSBzbG9hZChzX3ouc2xvdCkKICAgICAgICB9CgogICAgICAgIHJldHVybiAoeCwgeSwgeik7CiAgICB9Cn0KCmNvbnRyYWN0IEVWTVN0b3JhdGVQYWNrZWRTbG90Qnl0ZXMgewogICAgLy8gc2xvdCAwIChwYWNrZWQgcmlnaHQgdG8gbGVmdCkKICAgIGJ5dGVzNCBwdWJsaWMgYjQgPSAweGFiYWJhYmFiOwogICAgYnl0ZXMyIHB1YmxpYyBiMiA9IDB4Y2RjZDsKCiAgICBmdW5jdGlvbiBnZXQoKSBwdWJsaWMgdmlldyByZXR1cm5zIChieXRlczMyIGIzMikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgYjMyIDo9IHNsb2FkKDApCiAgICAgICAgfQogICAgfQp9Cgpjb250cmFjdCBCaXRNYXNraW5nIHsKICAgIGZ1bmN0aW9uIHRlc3RfbWFzaygpIHB1YmxpYyBwdXJlIHJldHVybnMgKGJ5dGVzMzIgbWFzaykgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gfCAgICAgICAyNTYgYml0cyAgICAgICAgfAogICAgICAgICAgICAvLyAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExCiAgICAgICAgICAgIC8vICAgICAgICAgICAgIHwgMTYgYml0cwogICAgICAgICAgICAvLyAweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMGZmZmYKICAgICAgICAgICAgbWFzayA6PSBzdWIoc2hsKDE2LCAxKSwgMSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9zaGlmdF9tYXNrKCkgcHVibGljIHB1cmUgcmV0dXJucyAoYnl0ZXMzMiBtYXNrKSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyB8ICAgICAgICAgICAgICAgMjU2IGJpdHMgICAgICAgICAgICAgICAgfAogICAgICAgICAgICAvLyAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExIHwgMDAwIC4uLiAwMDAgfAogICAgICAgICAgICAvLyAgICAgICAgICAgICB8IDE2IGJpdHMgICAgIHwgMzIgYml0cwogICAgICAgICAgICAvLyAweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBmZmZmMDAwMDAwMDAKICAgICAgICAgICAgbWFzayA6PSBzaGwoMzIsIHN1YihzaGwoMTYsIDEpLCAxKSkKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9ub3RfbWFzaygpIHB1YmxpYyBwdXJlIHJldHVybnMgKGJ5dGVzMzIgbWFzaykgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gfCAgICAgICAgICAgICAgIDI1NiBiaXRzICAgICAgICAgICAgICAgIHwKICAgICAgICAgICAgLy8gMTExIC4uLiAxMTEgfCAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExIHwKICAgICAgICAgICAgLy8gICAgICAgICAgICAgfCAxNiBiaXRzICAgICB8IDMyIGJpdHMKICAgICAgICAgICAgLy8gMHhmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmMDAwMGZmZmZmZmZmCiAgICAgICAgICAgIG1hc2sgOj0gbm90KHNobCgzMiwgc3ViKHNobCgxNiwgMSksIDEpKSkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IEVWTVN0b3JhZ2VQYWNrZWRTbG90IHsKICAgIC8vIERhdGEgPCAzMiBieXRlcyBhcmUgcGFja2VkIGludG8gYSBzbG90CiAgICAvLyBCaXQgbWFza2luZyAoaG93IHRvIGNyZWF0ZSAxMTEuLi4xMTEpCiAgICAvLyBzbG90LCBvZmZzZXQKCiAgICAvLyBzbG90IDAKICAgIHVpbnQxMjggcHVibGljIHNfYTsKICAgIHVpbnQ2NCBwdWJsaWMgc19iOwogICAgdWludDMyIHB1YmxpYyBzX2M7CiAgICB1aW50MzIgcHVibGljIHNfZDsKICAgIC8vIHNsb3QgMQogICAgLy8gMjAgYnl0ZXMgPSAxNjAgYml0cwogICAgYWRkcmVzcyBwdWJsaWMgc19hZGRyOwogICAgLy8gOTYgYml0cwogICAgdWludDY0IHB1YmxpYyBzX3g7CiAgICB1aW50MzIgcHVibGljIHNfeTsKCiAgICBmdW5jdGlvbiB0ZXN0X3NzdG9yZSgpIHB1YmxpYyB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBMb2FkIDMyIGJ5dGVzIGZyb20gc2xvdDAKICAgICAgICAgICAgbGV0IHYgOj0gc2xvYWQoMCkKCiAgICAgICAgICAgIC8vIHNfZCB8IHNfYyB8IHNfYiB8IHNfYQogICAgICAgICAgICAvLyAzMiAgfCAzMiAgfCA2NCAgfCAxMjggYml0cwoKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDExCiAgICAgICAgICAgIC8vIG1hc2sgPSBhbGwgMXMgYXQgYW5kIHRvIHRoZSBsZWZ0IG9mIDEyOCBiaXQgY291bnRpbmcgZnJvbSByaWdodAogICAgICAgICAgICAvLyAgICAgICAgMTExIC4uLiAxMTEgfCAwMDAgLi4uIDAwMAogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19hIDo9IG5vdChzdWIoc2hsKDEyOCwgMSksIDEpKQogICAgICAgICAgICAvLyBTZXQgbGVmdCBtb3N0IDEyOCBiaXRzIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19hKQogICAgICAgICAgICAvLyBTZXQgc19hID0gMTEKICAgICAgICAgICAgdiA6PSBvcih2LCAxMSkKCiAgICAgICAgICAgIC8vIFNldCBzX2IgPSAyMgogICAgICAgICAgICAvLyBtYXNrID0gMTExLi4uMTExIHwgMDAwIC4uLiAwMDAgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19iIDo9IG5vdChzaGwoMTI4LCBzdWIoc2hsKDY0LCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2IgYnkgc2V0dGluZyBiaXRzICgxMjggdG8gMTkxIGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19iKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobCgxMjgsIDIyKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2MgPSAzMwogICAgICAgICAgICAvLyBtYXNrID0gMTExLi4uMTExIHwgMDAwLi4uMDAwIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19jIDo9IG5vdChzaGwoMTkyLCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2MgYnkgc2V0dGluZyBiaXRzICgxOTIgdG8gMjIzIGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19jKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobCgxOTIsIDMzKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2QgPSA0NAogICAgICAgICAgICAvLyBtYXNrID0gMDAwLi4uMDAwIHwgMTExLi4uMTExIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19kIDo9IG5vdChzaGwoMjI0LCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2QgYnkgc2V0dGluZyBiaXRzICgyMjQgdG8gMjU1IGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19kKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobCgy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9vZmZzZXQgPSAyMAogICAgICAgIC8vIHlfb2Zmc2V0ID0gMjgKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGFkZHJfb2Zmc2V0IDo9IHNfYWRkci5vZmZzZXQKICAgICAgICAgICAgeF9vZmZzZXQgOj0gc194Lm9mZnNldAogICAgICAgICAgICB5X29mZnNldCA6PSBzX3kub2Zmc2V0CiAgICAgICAgfQogICAgfQoKICAgIC8vIHNsb3QgYW5kIG9mZnNldAogICAgZnVuY3Rpb24gdGVzdF9zc3RvcmVfdXNpbmdfb2Zmc2V0KCkgcHVibGljIHsKICAgICAgICAvLyBhX29mZnNldCA9ICAwID0gIDAgKiA4ID0gICAwIGJpdHMKICAgICAgICAvLyBiX29mZnNldCA9IDE2ID0gMTYgKiA4ID0gMTI4IGJpdHMKICAgICAgICAvLyBjX29mZnNldCA9IDI0ID0gMjQgKiA4ID0gMTkyIGJpdHMKICAgICAgICAvLyBkX29mZnNldCA9IDI4ID0gMjggKiA4ID0gMjI0IGJpdHMKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIExvYWQgMzIgYnl0ZXMgZnJvbSBzbG90MAogICAgICAgICAgICBsZXQgdiA6PSBzbG9hZChzX2Euc2xvdCkKCiAgICAgICAgICAgIC8vIHNfZCB8IHNfYyB8IHNfYiB8IHNfYQogICAgICAgICAgICAvLyAzMiAgfCAzMiAgfCA2NCAgfCAxMjggYml0cwoKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDExMQogICAgICAgICAgICAvLyBtYXNrID0gYWxsIDFzIGF0IGFuZCB0byB0aGUgbGVmdCBvZiAxMjggYml0IGNvdW50aW5nIGZyb20gcmlnaHQKICAgICAgICAgICAgLy8gICAgICAgIDExMSAuLi4gMTExIHwgMDAwIC4uLiAwMDAKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgIHwgICAgMTI4IGJpdHMKICAgICAgICAgICAgbGV0IG1hc2tfYSA6PSBub3Qoc3ViKHNobCgxMjgsIDEpLCAxKSkKICAgICAgICAgICAgLy8gU2V0IGxlZnQgbW9zdCAxMjggYml0cyB0byAwCiAgICAgICAgICAgIHYgOj0gYW5kKHYsIG1hc2tfYSkKICAgICAgICAgICAgLy8gU2V0IHNfYSA9IDEKICAgICAgICAgICAgdiA6PSBvcih2LCAxMTEpCgogICAgICAgICAgICAvLyBTZXQgc19iID0gMjIyCiAgICAgICAgICAgIC8vIG1hc2sgPSAxMTEuLi4xMTEgfCAwMDAgLi4uIDAwMCB8IDExMSAuLi4gMTExCiAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgfCAgICAgNjQgYml0cyB8ICAgIDEyOCBiaXRzCiAgICAgICAgICAgIGxldCBtYXNrX2IgOj0gbm90KHNobChtdWwoc19iLm9mZnNldCwgOCksIHN1YihzaGwoNjQsIDEpLCAxKSkpCiAgICAgICAgICAgIC8vIENsZWFyIHByZXZpb3VzIHZhbHVlIG9mIHNfYiBieSBzZXR0aW5nIGJpdHMgKDEyOCB0byAxOTEgYml0cykgdG8gMAogICAgICAgICAgICB2IDo9IGFuZCh2LCBtYXNrX2IpCiAgICAgICAgICAgIHYgOj0gb3Iodiwgc2hsKG11bChzX2Iub2Zmc2V0LCA4KSwgMjIyKSkKCiAgICAgICAgICAgIC8vIFNldCBzX2MgPSAzMzMKICAgICAgICAgICAgLy8gbWFzayA9IDExMS4uLjExMSB8IDAwMC4uLjAwMCB8IDExMSAuLi4gMTExIHwgMTExIC4uLiAxMTEKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICB8ICAgMzIgYml0cyB8ICAgICA2NCBiaXRzIHwgICAgMTI4IGJpdHMKICAgICAgICAgICAgbGV0IG1hc2tfYyA6PSBub3Qoc2hsKG11bChzX2Mub2Zmc2V0LCA4KSwgc3ViKHNobCgzMiwgMSksIDEpKSkKICAgICAgICAgICAgLy8gQ2xlYXIgcHJldmlvdXMgdmFsdWUgb2Ygc19jIGJ5IHNldHRpbmcgYml0cyAoMTkyIHRvIDIyMyBiaXRzKSB0byAwCiAgICAgICAgICAgIHYgOj0gYW5kKHYsIG1hc2tfYykKICAgICAgICAgICAgdiA6PSBvcih2LCBzaGwobXVsKHNfYy5vZmZzZXQsIDgpLCAzMzMpKQoKICAgICAgICAgICAgLy8gU2V0IHNfZCA9IDQ0NAogICAgICAgICAgICAvLyBtYXNrID0gMDAwLi4uMDAwIHwgMTExLi4uMTExIHwgMTExIC4uLiAxMTEgfCAxMTEgLi4uIDExMQogICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgIHwgICAzMiBiaXRzIHwgICAgIDY0IGJpdHMgfCAgICAxMjggYml0cwogICAgICAgICAgICBsZXQgbWFza19kIDo9IG5vdChzaGwobXVsKHNfZC5vZmZzZXQsIDgpLCBzdWIoc2hsKDMyLCAxKSwgMSkpKQogICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyB2YWx1ZSBvZiBzX2QgYnkgc2V0dGluZyBiaXRzICgyMjQgdG8gMjU1IGJpdHMpIHRvIDAKICAgICAgICAgICAgdiA6PSBhbmQodiwgbWFza19kKQogICAgICAgICAgICB2IDo9IG9yKHYsIHNobChtdWwoc19kLm9mZnNldCwgOCksIDQ0NCkpCgogICAgICAgICAgICAvLyBTdG9yZSBuZXcgdmFsdWUgdG8gc2xvdDAKICAgICAgICAgICAgc3N0b3JlKHNfYS5zbG90LCB2KQogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgRVZNU3RvcmFnZVN0cnVjdCB7CiAgICBzdHJ1Y3QgU2luZ2xlU2xvdCB7CiAgICAgICAgdWludDEyOCB4OwogICAgICAgIHVpbnQ2NCB5OwogICAgICAgIHVpbnQ2NCB6OwogICAgfQoKICAgIHN0cnVjdCBNdWx0aXBsZVNsb3RzIHsKICAgICAgICB1aW50MjU2IGE7CiAgICAgICAgdWludDI1NiBiOwogICAgICAgIHVpbnQyNTYgYzsKICAgIH0KCiAgICAvLyBzbG90IDAKICAgIFNpbmdsZVNsb3QgcHVibGljIHNpbmdsZSA9IFNpbmdsZVNsb3Qoe3g6IDEsIHk6IDIsIHo6IDN9KTsKICAgIC8vIHNsb3QgMSwgMiwgMwogICAgTXVsdGlwbGVTbG90cyBwdWJsaWMgbXVsdGkgPSBNdWx0aXBsZVNsb3RzKHthOiAxMSwgYjogMjIsIGM6IDMzfSk7CgogICAgZnVuY3Rpb24gdGVzdF9nZXRfc2luZ2xlX3Nsb3Rfc3RydWN0KCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDEyOCB4LCB1aW50NjQgeSwgdWludDY0IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgcyA6PSBzbG9hZCgwKQogICAgICAgICAgICAvLyAgeiB8ICB5IHwgeAogICAgICAgICAgICAvLyA2NCB8IDY0IHwgMTI4IGJpdHMKICAgICAgICAgICAgLy8gQ2FzdGluZyBjdXRzIG9mZiBiaXRzIHRvIHRoZSBsZWZ0CiAgICAgICAgICAgIHggOj0gcwogICAgICAgICAgICB5IDo9IHNocigxMjgsIHMpCiAgICAgICAgICAgIHogOj0gc2hyKDE5MiwgcykKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9nZXRfbXVsdGlwbGVfc2xvdHNfc3RydWN0KCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiBhLCB1aW50MjU2IGIsIHVpbnQyNTYgYykKICAgIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGEgOj0gc2xvYWQoMSkKICAgICAgICAgICAgYiA6PSBzbG9hZCgyKQogICAgICAgICAgICBjIDo9IHNsb2FkKDMpCiAgICAgICAgfQogICAgfQp9Cgpjb250cmFjdCBFVk1TdG9yYWdlQ29uc3RhbnRzIHsKICAgIC8vIHNsb3QgMAogICAgdWludDI1NiBwdWJsaWMgczAgPSAxOwogICAgLy8gQ29uc3RhbnRzIGFuZCBpbW11dGFibG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VjdG9yKCkgewogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMTEpOwogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMjIpOwogICAgICAgIG1hcFtBRERSXzFdLnB1c2goMzMpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNDQpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNTUpOwogICAgICAgIG1hcFtBRERSXzJdLnB1c2goNjYpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RfbWFwX2FycihhZGRyZXNzIGFkZHIsIHVpbnQyNTYgaSkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB2LCB1aW50MjU2IGxlbikKICAgIHsKICAgICAgICB1aW50MjU2IG1hcF9zbG90ID0gMDsKICAgICAgICBieXRlczMyIG1hcF9oYXNoID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoYWRkciwgbWFwX3Nsb3QpKTsKICAgICAgICBieXRlczMyIGFycl9oYXNoID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUobWFwX2hhc2gpKTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZW4gOj0gc2xvYWQobWFwX2hhc2gpCiAgICAgICAgICAgIHYgOj0gc2xvYWQoYWRkKGFycl9oYXNoLCBpKSkKICAgICAgICB9CiAgICB9Cn0KCmNvbnRyYWN0IEVWTVN0b3JhZ2VEeW5hbWljQXJyYXlTdHJ1Y3QgewogICAgc3RydWN0IFBvaW50IHsKICAgICAgICB1aW50MjU2IHg7CiAgICAgICAgdWludDEyOCB5OwogICAgICAgIHVpbnQxMjggejsKICAgIH0KCiAgICAvLyBzbG90IG9mIGVsZW1lbnQgPSBrZWNjYWsyNTYoc2xvdCB3aGVyZSB0aGlzIGFycmF5IGlzIGRlY2xhcmVkKSArIGluZGV4IG9mIGVsZW1lbnQKICAgIC8vIGtlY2NhazI1NigwKSArIGluZGV4ICogc2l6ZSBvZiBzdHJ1Y3QKICAgIFBvaW50W10gcHJpdmF0ZSBhcnI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgYXJyLnB1c2goUG9pbnQoMTEsIDIyLCAzMykpOwogICAgICAgIGFyci5wdXNoKFBvaW50KDQ0LCA1NSwgNjYpKTsKICAgICAgICBhcnIucHVzaChQb2ludCg3NywgODgsIDk5KSk7CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9zdHJ1Y3RfYXJyKHVpbnQyNTYgaSkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1NiB4LCB1aW50MTI4IHksIHVpbnQxMjggeiwgdWludDI1NiBsZW4pCiAgICB7CiAgICAgICAgdWludDI1NiBzbG90ID0gMDsKICAgICAgICBieXRlczMyIHN0YXJ0ID0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoc2xvdCkpOwoKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxlbiA6PSBzbG9hZChzbG90KQogICAgICAgICAgICAvLyBzMCA9IGtlY2NhazI1NigwKQogICAgICAgICAgICAvLyBpbmRleCB8IHNsb3QgICAgICAgIHwgdmFsdWVzCiAgICAgICAgICAgIC8vICAgICAwIHwgc2xvdCBzMCArIDAgfCBhcnJbMF0ueAogICAgICAgICAgICAvLyAgICAgMCB8IHNsb3QgczAgKyAxIHwgYXJyWzBdLnogfCBhcnJbMF0ueQogICAgICAgICAgICAvLyAgICAgMSB8IHNsb3QgczAgKyAyIHwgYXJyWzFdLngKICAgICAgICAgICAgLy8gICAgIDEgfCBzbG90IHMwICsgMyB8IGFyclsxXS56IHwgYXJyWzFdLnkKICAgICAgICAgICAgLy8gICAgIDIgfCBzbG90IHMwICsgNCB8IGFyclsyXS54CiAgICAgICAgICAgIC8vICAgICAyIHwgc2xvdCBzMCArIDUgfCBhcnJbMl0ueiB8IGFyclsyXS55CiAgICAgICAgICAgIHggOj0gc2xvYWQoYWRkKHN0YXJ0LCBtdWwoaSwgMikpKQogICAgICAgICAgICBsZXQgenkgOj0gc2xvYWQoYWRkKHN0YXJ0LCBhZGQobXVsKGksIDIpLCAxKSkpCiAgICAgICAgICAgIC8vIHVpbnQxMjggY3V0cyBvZmYgbGVmdCBtb3N0IDEyOCBiaXRzIGZyb20gMzIgYnl0ZXMKICAgICAgICAgICAgeSA6PSB6eQogICAgICAgICAgICB6IDo9IHNocigxMjgsIHp5KQogICAgICAgIH0KICAgIH0KfQo="}],uw=`

                          Examples of

                          • Reading and writing to storage with assembly
                          • Storage layout of different data types
                          • @@ -8411,7 +8411,7 @@ assertion probably means that there is a bug. } } } -`,yw=({prev:s,next:a})=>r.jsx(u,{version:dw,title:Cw,description:jw,html:Aw,prev:s,next:a,codes:uw}),mw="0.8.24",bw="Fallback",ww="Example of how to use fallback in Solidity",kw=[{fileName:"Fallback.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEZhbGxiYWNrIHsKICAgIGV2ZW50IExvZyhzdHJpbmcgZnVuYywgdWludDI1NiBnYXMpOwoKICAgIC8vIEZhbGxiYWNrIGZ1bmN0aW9uIG11c3QgYmUgZGVjbGFyZWQgYXMgZXh0ZXJuYWwuCiAgICBmYWxsYmFjaygpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIC8vIHNlbmQgLyB0cmFuc2ZlciAoZm9yd2FyZHMgMjMwMCBnYXMgdG8gdGhpcyBmYWxsYmFjayBmdW5jdGlvbikKICAgICAgICAvLyBjYWxsIChmb3J3YXJkcyBhbGwgb2YgdGhlIGdhcykKICAgICAgICBlbWl0IExvZygiZmFsbGJhY2siLCBnYXNsZWZ0KCkpOwogICAgfQoKICAgIC8vIFJlY2VpdmUgaXMgYSB2YXJpYW50IG9mIGZhbGxiYWNrIHRoYXQgaXMgdHJpZ2dlcmVkIHdoZW4gbXNnLmRhdGEgaXMgZW1wdHkKICAgIHJlY2VpdmUoKSB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],Zw=`

                            fallback is a special function that is executed either when

                            +`,yw=({prev:s,next:a})=>r.jsx(A,{version:dw,title:Cw,description:jw,html:uw,prev:s,next:a,codes:Aw}),mw="0.8.24",bw="Fallback",ww="Example of how to use fallback in Solidity",kw=[{fileName:"Fallback.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEZhbGxiYWNrIHsKICAgIGV2ZW50IExvZyhzdHJpbmcgZnVuYywgdWludDI1NiBnYXMpOwoKICAgIC8vIEZhbGxiYWNrIGZ1bmN0aW9uIG11c3QgYmUgZGVjbGFyZWQgYXMgZXh0ZXJuYWwuCiAgICBmYWxsYmFjaygpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIC8vIHNlbmQgLyB0cmFuc2ZlciAoZm9yd2FyZHMgMjMwMCBnYXMgdG8gdGhpcyBmYWxsYmFjayBmdW5jdGlvbikKICAgICAgICAvLyBjYWxsIChmb3J3YXJkcyBhbGwgb2YgdGhlIGdhcykKICAgICAgICBlbWl0IExvZygiZmFsbGJhY2siLCBnYXNsZWZ0KCkpOwogICAgfQoKICAgIC8vIFJlY2VpdmUgaXMgYSB2YXJpYW50IG9mIGZhbGxiYWNrIHRoYXQgaXMgdHJpZ2dlcmVkIHdoZW4gbXNnLmRhdGEgaXMgZW1wdHkKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBlbWl0IExvZygicmVjZWl2ZSIsIGdhc2xlZnQoKSk7CiAgICB9CgogICAgLy8gSGVscGVyIGZ1bmN0aW9uIHRvIGNoZWNrIHRoZSBiYWxhbmNlIG9mIHRoaXMgY29udHJhY3QKICAgIGZ1bmN0aW9uIGdldEJhbGFuY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGFkZHJlc3ModGhpcykuYmFsYW5jZTsKICAgIH0KfQoKY29udHJhY3QgU2VuZFRvRmFsbGJhY2sgewogICAgZnVuY3Rpb24gdHJhbnNmZXJUb0ZhbGxiYWNrKGFkZHJlc3MgcGF5YWJsZSBfdG8pIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICBfdG8udHJhbnNmZXIobXNnLnZhbHVlKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYWxsRmFsbGJhY2soYWRkcmVzcyBwYXlhYmxlIF90bykgcHVibGljIHBheWFibGUgewogICAgICAgIChib29sIHNlbnQsKSA9IF90by5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="},{fileName:"FallbackInputOutput.sol",code:"cHJhZ21hIHNvbGlkaXR5IF4wLjguMjQ7CgovLyBUZXN0RmFsbGJhY2tJbnB1dE91dHB1dCAtPiBGYWxsYmFja0lucHV0T3V0cHV0IC0+IENvdW50ZXIKY29udHJhY3QgRmFsbGJhY2tJbnB1dE91dHB1dCB7CiAgICBhZGRyZXNzIGltbXV0YWJsZSB0YXJnZXQ7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdGFyZ2V0KSB7CiAgICAgICAgdGFyZ2V0ID0gX3RhcmdldDsKICAgIH0KCiAgICBmYWxsYmFjayhieXRlcyBjYWxsZGF0YSBkYXRhKSBleHRlcm5hbCBwYXlhYmxlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIChib29sIG9rLCBieXRlcyBtZW1vcnkgcmVzKSA9IHRhcmdldC5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KGRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgICAgIHJldHVybiByZXM7CiAgICB9Cn0KCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gZ2V0KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQoKICAgIGZ1bmN0aW9uIGluYygpIGV4dGVybmFsIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICBjb3VudCArPSAxOwogICAgICAgIHJldHVybiBjb3VudDsKICAgIH0KfQoKY29udHJhY3QgVGVzdEZhbGxiYWNrSW5wdXRPdXRwdXQgewogICAgZXZlbnQgTG9nKGJ5dGVzIHJlcyk7CgogICAgZnVuY3Rpb24gdGVzdChhZGRyZXNzIF9mYWxsYmFjaywgYnl0ZXMgY2FsbGRhdGEgZGF0YSkgZXh0ZXJuYWwgewogICAgICAgIChib29sIG9rLCBieXRlcyBtZW1vcnkgcmVzKSA9IF9mYWxsYmFjay5jYWxsKGRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgICAgIGVtaXQgTG9nKHJlcyk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0VGVzdERhdGEoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSwgYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIChhYmkuZW5jb2RlQ2FsbChDb3VudGVyLmdldCwgKCkpLCBhYmkuZW5jb2RlQ2FsbChDb3VudGVyLmluYywgKCkpKTsKICAgIH0KfQo="}],Zw=`

                            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
                            • @@ -8496,7 +8496,7 @@ assertion probably means that there is a bug. (abi.encodeCall(Counter.get, ()), abi.encodeCall(Counter.inc, ())); } } -`,Ww=({prev:s,next:a})=>r.jsx(u,{version:mw,title:bw,description:ww,html:Zw,prev:s,next:a,codes:kw}),Bw="0.8.24",Gw="First Application",Vw="Example of smart contract in Solidity",fw=[{fileName:"Counter.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgLy8gRnVuY3Rpb24gdG8gZ2V0IHRoZSBjdXJyZW50IGNvdW50CiAgICBmdW5jdGlvbiBnZXQoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGluY3JlbWVudCBjb3VudCBieSAxCiAgICBmdW5jdGlvbiBpbmMoKSBwdWJsaWMgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9CgogICAgLy8gRnVuY3Rpb24gdG8gZGVjcmVtZW50IGNvdW50IGJ5IDEKICAgIGZ1bmN0aW9uIGRlYygpIHB1YmxpYyB7CiAgICAgICAgLy8gVGhpcyBmdW5jdGlvbiB3aWxsIGZhaWwgaWYgY291bnQgPSAwCiAgICAgICAgY291bnQgLT0gMTsKICAgIH0KfQo="}],Yw=`

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

                              +`,Ww=({prev:s,next:a})=>r.jsx(A,{version:mw,title:bw,description:ww,html:Zw,prev:s,next:a,codes:kw}),Bw="0.8.24",Gw="First Application",Vw="Example of smart contract in Solidity",fw=[{fileName:"Counter.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgLy8gRnVuY3Rpb24gdG8gZ2V0IHRoZSBjdXJyZW50IGNvdW50CiAgICBmdW5jdGlvbiBnZXQoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGluY3JlbWVudCBjb3VudCBieSAxCiAgICBmdW5jdGlvbiBpbmMoKSBwdWJsaWMgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9CgogICAgLy8gRnVuY3Rpb24gdG8gZGVjcmVtZW50IGNvdW50IGJ5IDEKICAgIGZ1bmN0aW9uIGRlYygpIHB1YmxpYyB7CiAgICAgICAgLy8gVGhpcyBmdW5jdGlvbiB3aWxsIGZhaWwgaWYgY291bnQgPSAwCiAgICAgICAgY291bnQgLT0gMTsKICAgIH0KfQo="}],Yw=`

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

                              // SPDX-License-Identifier: MIT
                               pragma solidity ^0.8.24;
                               
                              @@ -8519,7 +8519,7 @@ assertion probably means that there is a bug.
                                       count -= 1;
                                   }
                               }
                              -
                              `,Rw=({prev:s,next:a})=>r.jsx(u,{version:Bw,title:Gw,description:Vw,html:Yw,prev:s,next:a,codes:fw}),Xw="0.8.24",vw="Function",Nw="Example of how to write functions in Solidity",Hw=[{fileName:"Function.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEZ1bmN0aW9uIHsKICAgIC8vIEZ1bmN0aW9ucyBjYW4gcmV0dXJuIG11bHRpcGxlIHZhbHVlcy4KICAgIGZ1bmN0aW9uIHJldHVybk1hbnkoKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2LCBib29sLCB1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuICgxLCB0cnVlLCAyKTsKICAgIH0KCiAgICAvLyBSZXR1cm4gdmFsdWVzIGNhbiBiZSBuYW1lZC4KICAgIGZ1bmN0aW9uIG5hbWVkKCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludDI1NiB4LCBib29sIGIsIHVpbnQyNTYgeSkgewogICAgICAgIHJldHVybiAoMSwgdHJ1ZSwgMik7CiAgICB9CgogICAgLy8gUmV0dXJuIHZhbHVlcyBjYW4gYmUgY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dHB1dCgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQyNTZbXSBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYXJyOwogICAgfQp9CgovLyBDYWxsIGZ1bmN0aW9uIHdpdGgga2V5LXZhbHVlIGlucHV0cwpjb250cmFjdCBYWVogewogICAgZnVuY3Rpb24gc29tZUZ1bmNXaXRoTWFueUlucHV0cygKICAgICAgICB1aW50MjU2IHgsCiAgICAgICAgdWludDI1NiB5LAogICAgICAgIHVpbnQyNTYgeiwKICAgICAgICBhZGRyZXNzIGEsCiAgICAgICAgYm9vbCBiLAogICAgICAgIHN0cmluZyBtZW1vcnkgYwogICAgKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7fQoKICAgIGZ1bmN0aW9uIGNhbGxGdW5jKCkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHNvbWVGdW5jV2l0aE1hbnlJbnB1dHMoMSwgMiwgMywgYWRkcmVzcygwKSwgdHJ1ZSwgImMiKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYWxsRnVuY1dpdGhLZXlWYWx1ZSgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBzb21lRnVuY1dpdGhNYW55SW5wdXRzKHsKICAgICAgICAgICAgYTogYWRkcmVzcygwKSwKICAgICAgICAgICAgYjogdHJ1ZSwKICAgICAgICAgICAgYzogImMiLAogICAgICAgICAgICB4OiAxLAogICAgICAgICAgICB5OiAyLAogICAgICAgICAgICB6OiAzCiAgICAgICAgfSk7CiAgICB9Cn0K"}],Fw=`

                              There are several ways to return outputs from a function.

                              +`,Rw=({prev:s,next:a})=>r.jsx(A,{version:Bw,title:Gw,description:Vw,html:Yw,prev:s,next:a,codes:fw}),Xw="0.8.24",vw="Function",Nw="Example of how to write functions in Solidity",Hw=[{fileName:"Function.sol",code:"Ly8gU1BEWC1MaWNlbnNlL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gdHJ1ZSwgImMiKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYWxsRnVuY1dpdGhLZXlWYWx1ZSgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBzb21lRnVuY1dpdGhNYW55SW5wdXRzKHsKICAgICAgICAgICAgYTogYWRkcmVzcygwKSwKICAgICAgICAgICAgYjogdHJ1ZSwKICAgICAgICAgICAgYzogImMiLAogICAgICAgICAgICB4OiAxLAogICAgICAgICAgICB5OiAyLAogICAgICAgICAgICB6OiAzCiAgICAgICAgfSk7CiAgICB9Cn0K"}],Fw=`

                              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.24;
                              @@ -8597,7 +8597,7 @@ assertion probably means that there is a bug.
                                       });
                                   }
                               }
                              -
                              `,Kw=({prev:s,next:a})=>r.jsx(u,{version:Xw,title:vw,description:Nw,html:Fw,prev:s,next:a,codes:Hw}),Mw="0.8.24",Sw="Function Modifier",xw="Example of how to write function modifier in Solidity",Jw=[{fileName:"FunctionModifier.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEZ1bmN0aW9uTW9kaWZpZXIgewogICAgLy8gV2Ugd2lsbCB1c2UgdGhlc2UgdmFyaWFibGVzIHRvIGRlbW9uc3RyYXRlIGhvdyB0byB1c2UKICAgIC8vIG1vZGlmaWVycy4KICAgIGFkZHJlc3MgcHVibGljIG93bmVyOwogICAgdWludDI1NiBwdWJsaWMgeCA9IDEwOwogICAgYm9vbCBwdWJsaWMgbG9ja2VkOwoKICAgIGNvbnN0cnVjdG9yKCkgewogICAgICAgIC8vIFNldCB0aGUgdHJhbnNhY3Rpb24gc2VuZGVyIGFzIHRoZSBvd25lciBvZiB0aGUgY29udHJhY3QuCiAgICAgICAgb3duZXIgPSBtc2cu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RzIGEgZnVuY3Rpb24gZnJvbSBiZWluZyBjYWxsZWQgd2hpbGUKICAgIC8vIGl0IGlzIHN0aWxsIGV4ZWN1dGluZy4KICAgIG1vZGlmaWVyIG5vUmVlbnRyYW5jeSgpIHsKICAgICAgICByZXF1aXJlKCFsb2NrZWQsICJObyByZWVudHJhbmN5Iik7CgogICAgICAgIGxvY2tlZCA9IHRydWU7CiAgICAgICAgXzsKICAgICAgICBsb2NrZWQgPSBmYWxzZTsKICAgIH0KCiAgICBmdW5jdGlvbiBkZWNyZW1lbnQodWludDI1NiBpKSBwdWJsaWMgbm9SZWVudHJhbmN5IHsKICAgICAgICB4IC09IGk7CgogICAgICAgIGlmIChpID4gMSkgewogICAgICAgICAgICBkZWNyZW1lbnQoaSAtIDEpOwogICAgICAgIH0KICAgIH0KfQo="}],zw=`

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

                              +`,Kw=({prev:s,next:a})=>r.jsx(A,{version:Xw,title:vw,description:Nw,html:Fw,prev:s,next:a,codes:Hw}),Mw="0.8.24",Sw="Function Modifier",xw="Example of how to write function modifier in Solidity",Jw=[{fileName:"FunctionModifier.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEZ1bmN0aW9uTW9kaWZpZXIgewogICAgLy8gV2Ugd2lsbCB1c2UgdGhlc2UgdmFyaWFibGVzIHRvIGRlbW9uc3RyYXRlIGhvdyB0byB1c2UKICAgIC8vIG1vZGlmaWVycy4KICAgIGFkZHJlc3MgcHVibGljIG93bmVyOwogICAgdWludDI1NiBwdWJsaWMgeCA9IDEwOwogICAgYm9vbCBwdWJsaWMgbG9ja2VkOwoKICAgIGNvbnN0cnVjdG9yKCkgewogICAgICAgIC8vIFNldCB0aGUgdHJhbnNhY3Rpb24gc2VuZGVyIGFzIHRoZSBvd25lciBvZiB0aGUgY29udHJhY3QuCiAgICAgICAgb3duZXIgPSBtc2cuc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zIGEgZnVuY3Rpb24gZnJvbSBiZWluZyBjYWxsZWQgd2hpbGUKICAgIC8vIGl0IGlzIHN0aWxsIGV4ZWN1dGluZy4KICAgIG1vZGlmaWVyIG5vUmVlbnRyYW5jeSgpIHsKICAgICAgICByZXF1aXJlKCFsb2NrZWQsICJObyByZWVudHJhbmN5Iik7CgogICAgICAgIGxvY2tlZCA9IHRydWU7CiAgICAgICAgXzsKICAgICAgICBsb2NrZWQgPSBmYWxzZTsKICAgIH0KCiAgICBmdW5jdGlvbiBkZWNyZW1lbnQodWludDI1NiBpKSBwdWJsaWMgbm9SZWVudHJhbmN5IHsKICAgICAgICB4IC09IGk7CgogICAgICAgIGlmIChpID4gMSkgewogICAgICAgICAgICBkZWNyZW1lbnQoaSAtIDEpOwogICAgICAgIH0KICAgIH0KfQo="}],zw=`

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

                              Modifiers can be used to:

                              • Restrict access
                              • @@ -8663,7 +8663,7 @@ assertion probably means that there is a bug. } } } -`,Dw=({prev:s,next:a})=>r.jsx(u,{version:Mw,title:Sw,description:xw,html:zw,prev:s,next:a,codes:Jw}),Ew="0.8.24",Qw="Function Selector",Tw="Example of how function selectors are computed",Uw=[{fileName:"FunctionSelector.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEZ1bmN0aW9uU2VsZWN0b3IgewogICAgLyoKICAgICJ0cmFuc2ZlcihhZGRyZXNzLHVpbnQyNTYpIgogICAgMHhhOTA1OWNiYgogICAgInRyYW5zZmVyRnJvbShhZGRyZXNzLGFkZHJlc3MsdWludDI1NikiCiAgICAweDIzYjg3MmRkCiAgICAqLwogICAgZnVuY3Rpb24gZ2V0U2VsZWN0b3Ioc3RyaW5nIGNhbGxkYXRhIF9mdW5jKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzNCkKICAgIHsKICAgICAgICByZXR1cm4gYnl0ZXM0KGtlY2NhazI1NihieXRlcyhfZnVuYykpKTsKICAgIH0KfQo="}],_w=`

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

                                +`,Dw=({prev:s,next:a})=>r.jsx(A,{version:Mw,title:Sw,description:xw,html:zw,prev:s,next:a,codes:Jw}),Ew="0.8.24",Qw="Function Selector",Tw="Example of how function selectors are computed",Uw=[{fileName:"FunctionSelector.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEZ1bmN0aW9uU2VsZWN0b3IgewogICAgLyoKICAgICJ0cmFuc2ZlcihhZGRyZXNzLHVpbnQyNTYpIgogICAgMHhhOTA1OWNiYgogICAgInRyYW5zZmVyRnJvbShhZGRyZXNzLGFkZHJlc3MsdWludDI1NikiCiAgICAweDIzYjg3MmRkCiAgICAqLwogICAgZnVuY3Rpb24gZ2V0U2VsZWN0b3Ioc3RyaW5nIGNhbGxkYXRhIF9mdW5jKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzNCkKICAgIHsKICAgICAgICByZXR1cm4gYnl0ZXM0KGtlY2NhazI1NihieXRlcyhfZnVuYykpKTsKICAgIH0KfQo="}],_w=`

                                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))
                                @@ -8688,7 +8688,7 @@ assertion probably means that there is a bug.
                                         return bytes4(keccak256(bytes(_func)));
                                     }
                                 }
                                -
                                `,Lw=({prev:s,next:a})=>r.jsx(u,{version:Ew,title:Qw,description:Tw,html:_w,prev:s,next:a,codes:Uw}),Ow="0.8.24",Pw="Gas",$w="Example of gas and gas limit in Solidity",qw=[{fileName:"Gas.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEdhcyB7CiAgICB1aW50MjU2IHB1YmxpYyBpID0gMDsKCiAgICAvLyBVc2luZyB1cCBhbGwgb2YgdGhlIGdhcyB0aGF0IHlvdSBzZW5kIGNhdXNlcyB5b3VyIHRyYW5zYWN0aW9uIHRvIGZhaWwuCiAgICAvLyBTdGF0ZSBjaGFuZ2VzIGFyZSB1bmRvbmUuCiAgICAvLyBHYXMgc3BlbnQgYXJlIG5vdCByZWZ1bmRlZC4KICAgIGZ1bmN0aW9uIGZvcmV2ZXIoKSBwdWJsaWMgewogICAgICAgIC8vIEhlcmUgd2UgcnVuIGEgbG9vcCB1bnRpbCBhbGwgb2YgdGhlIGdhcyBhcmUgc3BlbnQKICAgICAgICAvLyBhbmQgdGhlIHRyYW5zYWN0aW9uIGZhaWxzCiAgICAgICAgd2hpbGUgKHRydWUpIHsKICAgICAgICAgICAgaSArPSAxOwogICAgICAgIH0KICAgIH0KfQo="}],sk=`

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

                                +`,Lw=({prev:s,next:a})=>r.jsx(A,{version:Ew,title:Qw,description:Tw,html:_w,prev:s,next:a,codes:Uw}),Ow="0.8.24",Pw="Gas",$w="Example of gas and gas limit in Solidity",qw=[{fileName:"Gas.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEdhcyB7CiAgICB1aW50MjU2IHB1YmxpYyBpID0gMDsKCiAgICAvLyBVc2luZyB1cCBhbGwgb2YgdGhlIGdhcyB0aGF0IHlvdSBzZW5kIGNhdXNlcyB5b3VyIHRyYW5zYWN0aW9uIHRvIGZhaWwuCiAgICAvLyBTdGF0ZSBjaGFuZ2VzIGFyZSB1bmRvbmUuCiAgICAvLyBHYXMgc3BlbnQgYXJlIG5vdCByZWZ1bmRlZC4KICAgIGZ1bmN0aW9uIGZvcmV2ZXIoKSBwdWJsaWMgewogICAgICAgIC8vIEhlcmUgd2UgcnVuIGEgbG9vcCB1bnRpbCBhbGwgb2YgdGhlIGdhcyBhcmUgc3BlbnQKICAgICAgICAvLyBhbmQgdGhlIHRyYW5zYWN0aW9uIGZhaWxzCiAgICAgICAgd2hpbGUgKHRydWUpIHsKICAgICAgICAgICAgaSArPSAxOwogICAgICAgIH0KICAgIH0KfQo="}],sk=`

                                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
                                • @@ -8720,7 +8720,7 @@ assertion probably means that there is a bug. } } } -`,ak=({prev:s,next:a})=>r.jsx(u,{version:Ow,title:Pw,description:$w,html:sk,prev:s,next:a,codes:qw}),nk="0.8.24",lk="Gas Saving Techniques",pk="Some gas saving techniques",ek=[{fileName:"GasGolf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIGdhcyBnb2xmCmNvbnRyYWN0IEdhc0dvbGYgewogICAgLy8gc3RhcnQgLSA1MDkwOCBnYXMKICAgIC8vIHVzZSBjYWxsZGF0YSAtIDQ5MTYzIGdhcwogICAgLy8gbG9hZCBzdGF0ZSB2YXJpYWJsZXMgdG8gbWVtb3J5IC0gNDg5NTIgZ2FzCiAgICAvLyBzaG9ydCBjaXJjdWl0IC0gNDg2MzQgZ2FzCiAgICAvLyBsb29wIGluY3JlbWVudHMgLSA0ODI0NCBnYXMKICAgIC8vIGNhY2hlIGFycmF5IGxlbmd0aCAtIDQ4MjA5IGdhcwogICAgLy8gbG9hZCBhcnJheSBlbGVtZW50cyB0byBtZW1vcnkgLSA0ODA0NyBnYXMKICAgIC8vIHVuY2hlY2sgaSBvdmVyZmxvdy91bmRlcmZsb3cgLSA0NzMwOSBnYXMKCiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbDsKCiAgICAvLyBzdGFydCAtIG5vdCBnYXMgb3B0aW1pemVkCiAgICAvLyBmdW5jdGlvbiBzdW1JZkV2ZW5BbmRMZXNzVGhhbjk5KHVpbnRbXSBtZW1vcnkgbnVtcykgZXh0ZXJuYWwgewogICAgLy8gICAgIGZvciAodWludCBpID0gMDsgaSA8IG51bXMubGVuZ3RoOyBpICs9IDEpIHsKICAgIC8vICAgICAgICAgYm9vbCBpc0V2ZW4gPSBudW1zW2ldICUgMiA9PSAwOwogICAgLy8gICAgICAgICBib29sIGlzTGVzc1RoYW45OSA9IG51bXNbaV0gPCA5OTsKICAgIC8vICAgICAgICAgaWYgKGlzRXZlbiAmJiBpc0xlc3NUaGFuOTkpIHsKICAgIC8vICAgICAgICAgICAgIHRvdGFsICs9IG51bXNbaV07CiAgICAvLyAgICAgICAgIH0KICAgIC8vICAgICB9CiAgICAvLyB9CgogICAgLy8gZ2FzIG9wdGltaXplZAogICAgLy8gWzEsIDIsIDMsIDQsIDUsIDEwMF0KICAgIGZ1bmN0aW9uIHN1bUlmRXZlbkFuZExlc3NUaGFuOTkodWludDI1NltdIGNhbGxkYXRhIG51bXMpIGV4dGVybmFsIHsKICAgICAgICB1aW50MjU2IF90b3RhbCA9IHRvdGFsOwogICAgICAgIHVpbnQyNTYgbGVuID0gbnVtcy5sZW5ndGg7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IGxlbjspIHsKICAgICAgICAgICAgdWludDI1NiBudW0gPSBudW1zW2ldOwogICAgICAgICAgICBpZiAobnVtICUgMiA9PSAwICYmIG51bSA8IDk5KSB7CiAgICAgICAgICAgICAgICBfdG90YWwgKz0gbnVtOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgICAgICArK2k7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHRvdGFsID0gX3RvdGFsOwogICAgfQp9Cg=="}],ck=`

                                  Some gas saving techniques.

                                  +`,ak=({prev:s,next:a})=>r.jsx(A,{version:Ow,title:Pw,description:$w,html:sk,prev:s,next:a,codes:qw}),nk="0.8.24",lk="Gas Saving Techniques",pk="Some gas saving techniques",ek=[{fileName:"GasGolf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIGdhcyBnb2xmCmNvbnRyYWN0IEdhc0dvbGYgewogICAgLy8gc3RhcnQgLSA1MDkwOCBnYXMKICAgIC8vIHVzZSBjYWxsZGF0YSAtIDQ5MTYzIGdhcwogICAgLy8gbG9hZCBzdGF0ZSB2YXJpYWJsZXMgdG8gbWVtb3J5IC0gNDg5NTIgZ2FzCiAgICAvLyBzaG9ydCBjaXJjdWl0IC0gNDg2MzQgZ2FzCiAgICAvLyBsb29wIGluY3JlbWVudHMgLSA0ODI0NCBnYXMKICAgIC8vIGNhY2hlIGFycmF5IGxlbmd0aCAtIDQ4MjA5IGdhcwogICAgLy8gbG9hZCBhcnJheSBlbGVtZW50cyB0byBtZW1vcnkgLSA0ODA0NyBnYXMKICAgIC8vIHVuY2hlY2sgaSBvdmVyZmxvdy91bmRlcmZsb3cgLSA0NzMwOSBnYXMKCiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbDsKCiAgICAvLyBzdGFydCAtIG5vdCBnYXMgb3B0aW1pemVkCiAgICAvLyBmdW5jdGlvbiBzdW1JZkV2ZW5BbmRMZXNzVGhhbjk5KHVpbnRbXSBtZW1vcnkgbnVtcykgZXh0ZXJuYWwgewogICAgLy8gICAgIGZvciAodWludCBpID0gMDsgaSA8IG51bXMubGVuZ3RoOyBpICs9IDEpIHsKICAgIC8vICAgICAgICAgYm9vbCBpc0V2ZW4gPSBudW1zW2ldICUgMiA9PSAwOwogICAgLy8gICAgICAgICBib29sIGlzTGVzc1RoYW45OSA9IG51bXNbaV0gPCA5OTsKICAgIC8vICAgICAgICAgaWYgKGlzRXZlbiAmJiBpc0xlc3NUaGFuOTkpIHsKICAgIC8vICAgICAgICAgICAgIHRvdGFsICs9IG51bXNbaV07CiAgICAvLyAgICAgICAgIH0KICAgIC8vICAgICB9CiAgICAvLyB9CgogICAgLy8gZ2FzIG9wdGltaXplZAogICAgLy8gWzEsIDIsIDMsIDQsIDUsIDEwMF0KICAgIGZ1bmN0aW9uIHN1bUlmRXZlbkFuZExlc3NUaGFuOTkodWludDI1NltdIGNhbGxkYXRhIG51bXMpIGV4dGVybmFsIHsKICAgICAgICB1aW50MjU2IF90b3RhbCA9IHRvdGFsOwogICAgICAgIHVpbnQyNTYgbGVuID0gbnVtcy5sZW5ndGg7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IGxlbjspIHsKICAgICAgICAgICAgdWludDI1NiBudW0gPSBudW1zW2ldOwogICAgICAgICAgICBpZiAobnVtICUgMiA9PSAwICYmIG51bSA8IDk5KSB7CiAgICAgICAgICAgICAgICBfdG90YWwgKz0gbnVtOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgICAgICArK2k7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHRvdGFsID0gX3RvdGFsOwogICAgfQp9Cg=="}],ck=`

                                  Some gas saving techniques.

                                  • Replacing memory with calldata
                                  • Loading state variable to memory
                                  • @@ -8774,7 +8774,7 @@ assertion probably means that there is a bug. total = _total; } } -`,tk=({prev:s,next:a})=>r.jsx(u,{version:nk,title:lk,description:pk,html:ck,prev:s,next:a,codes:ek}),ok="0.8.24",rk="Accessing Private Data",ik="An example of accessing private data from a Solidity smart contract",gk=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCk5vdGU6IGNhbm5vdCB1c2Ugd2ViMyBvbiBKVk0sIHNvIHVzZSB0aGUgY29udHJhY3QgZGVwbG95ZWQgb24gR29lcmxpCk5vdGU6IGJyb3dzZXIgV2ViMyBpcyB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EpCndlYjMudXRpbHMubnVtYmVyVG9IZXgoIjgxMjIyMTkxOTg2MjI2ODA5MTAzMjc5MTE5OTk0NzA3ODY4MzIyODU1NzQxODE5OTA1OTA0NDE3OTUzMDkyNjY2Njk5MDk2OTYzMTEyIikKTm90ZTogV2UgY2FuIGFsc28gdXNlIHdlYjMgdG8gZ2V0IGRhdGEgbG9jYXRpb24Kd2ViMy51dGlscy5zb2xpZGl0eVNoYTMoeyB0eXBlOiAidWludCIsIHZhbHVlOiAxIH0sIHt0eXBlOiAidWludCIsIHZhbHVlOiA3fSkKdXNlciAxCndlYjMuZXRoLmdldFN0b3JhZ2VBdCgiMHg1MzRFNENlMGZmRjc3OTUxMzc5M2NmZDcwMzA4QUYxOTU4MjdCRDMxIiwgIjB4YjM5MjIxYWNlMDUzNDY1ZWMzNDUzY2UyYjM2NDMwYmQxMzhiOTk3ZWNlYTI1YzEwNDNkYTBjMzY2ODEyYjgyOCIsIGNvbnNvbGUubG9nKQp3ZWIzLmV0aC5nZXRTdG9yYWdlQXQoIjB4NTM0RTRDZTBmZkY3Nzk1MTM3OTNjZmQ3MDMwOEFGMTk1ODI3QkQzMSIsICIweGIzOTIyMWFjZTA1MzQ2NWVjMzQ1M2NlMmIzNjQzMGJkMTM4Yjk5N2VjZWEyNWMxMDQzZGEwYzM2NjgxMmI4MjkiLCBjb25zb2xlLmxvZykKKi8K"}],hk=`

                                    Vulnerability

                                    +`,tk=({prev:s,next:a})=>r.jsx(A,{version:nk,title:lk,description:pk,html:ck,prev:s,next:a,codes:ek}),ok="0.8.24",rk="Accessing Private Data",ik="An example of accessing private data from a Solidity smart contract",gk=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCk5vdGU6IGNhbm5vdCB1c2Ugd2ViMyBvbiBKVk0sIHNvIHVzZSB0aGUgY29udHJhY3QgZGVwbG95ZWQgb24gR29lcmxp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GVtcHR5CmdldE1hcExvY2F0aW9uKDcsIDEpCndlYjMudXRpbHMubnVtYmVyVG9IZXgoIjgxMjIyMTkxOTg2MjI2ODA5MTAzMjc5MTE5OTk0NzA3ODY4MzIyODU1NzQxODE5OTA1OTA0NDE3OTUzMDkyNjY2Njk5MDk2OTYzMTEyIikKTm90ZTogV2UgY2FuIGFsc28gdXNlIHdlYjMgdG8gZ2V0IGRhdGEgbG9jYXRpb24Kd2ViMy51dGlscy5zb2xpZGl0eVNoYTMoeyB0eXBlOiAidWludCIsIHZhbHVlOiAxIH0sIHt0eXBlOiAidWludCIsIHZhbHVlOiA3fSkKdXNlciAxCndlYjMuZXRoLmdldFN0b3JhZ2VBdCgiMHg1MzRFNENlMGZmRjc3OTUxMzc5M2NmZDcwMzA4QUYxOTU4MjdCRDMxIiwgIjB4YjM5MjIxYWNlMDUzNDY1ZWMzNDUzY2UyYjM2NDMwYmQxMzhiOTk3ZWNlYTI1YzEwNDNkYTBjMzY2ODEyYjgyOCIsIGNvbnNvbGUubG9nKQp3ZWIzLmV0aC5nZXRTdG9yYWdlQXQoIjB4NTM0RTRDZTBmZkY3Nzk1MTM3OTNjZmQ3MDMwOEFGMTk1ODI3QkQzMSIsICIweGIzOTIyMWFjZTA1MzQ2NWVjMzQ1M2NlMmIzNjQzMGJkMTM4Yjk5N2VjZWEyNWMxMDQzZGEwYzM2NjgxMmI4MjkiLCBjb25zb2xlLmxvZykKKi8K"}],hk=`

                                    Vulnerability

                                    All data on a smart contract can be read.

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

                                    // SPDX-License-Identifier: MIT
                                    @@ -8892,7 +8892,7 @@ web3.eth.getStorageAt("0x534E4Ce0ffF779513793cfd70308AF195827BD31", "0xb39221ace
                                     
                                    • Don't store sensitive information on the blockchain.
                                    -`,Ik=({prev:s,next:a})=>r.jsx(u,{version:ok,title:rk,description:ik,html:hk,prev:s,next:a,codes:gk}),dk="0.8.24",Ck="Block Timestamp Manipulation",jk="An example of a Solidity contract vulnerable to block timestamp manipulation",uk=[{fileName:"BlockTimestamp.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qClJvdWxldHRlIGlzIGEgZ2FtZSB3aGVyZSB5b3UgY2FuIHdpbiBhbGwgb2YgdGhlIEV0aGVyIGluIHRoZSBjb250cmFjdAppZiB5b3UgY2FuIHN1Ym1pdCBhIHRyYW5zYWN0aW9uIGF0IGEgc3BlY2lmaWMgdGltaW5nLgpBIHBsYXllciBuZWVkcyB0byBzZW5kIDEwIEV0aGVyIGFuZCB3aW5zIGlmIHRoZSBibG9jay50aW1lc3RhbXAgJSAxNSA9PSAwLgoqLwoKLyoKMS4gRGVwbG95IFJvdWxldHRlIHdpdGggMTAgRXRoZXIKMi4gRXZlIHJ1bnMgYSBwb3dlcmZ1bCBtaW5lciB0aGF0IGNhbiBtYW5pcHVsYXRlIHRoZSBibG9jayB0aW1lc3RhbXAuCjMuIEV2ZSBzZXRzIHRoZSBibG9jay50aW1lc3RhbXAgdG8gYSBudW1iZXIgaW4gdGhlIGZ1dHVyZSB0aGF0IGlzIGRpdmlzaWJsZSBieQogICAxNSBhbmQgZmluZHMgdGhlIHRhcmdldCBibG9jayBoYXNoLgo0LiBFdmUncyBibG9jayBpcyBzdWNjZXNzZnVsbHkgaW5jbHVkZWQgaW50byB0aGUgY2hhaW4sIEV2ZSB3aW5zIHRoZQogICBSb3VsZXR0ZSBnYW1lLgoqLwoKY29udHJhY3QgUm91bGV0dGUgewogICAgdWludDI1NiBwdWJsaWMgcGFzdEJsb2NrVGltZTsKCiAgICBjb25zdHJ1Y3RvcigpIHBheWFibGUge30KCiAgICBmdW5jdGlvbiBzcGluKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgcmVxdWlyZShtc2cudmFsdWUgPT0gMTAgZXRoZXIpOyAvLyBtdXN0IHNlbmQgMTAgZXRoZXIgdG8gcGxheQogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wICE9IHBhc3RCbG9ja1RpbWUpOyAvLyBvbmx5IDEgdHJhbnNhY3Rpb24gcGVyIGJsb2NrCgogICAgICAgIHBhc3RCbG9ja1RpbWUgPSBibG9jay50aW1lc3RhbXA7CgogICAgICAgIGlmIChibG9jay50aW1lc3RhbXAgJSAxNSA9PSAwKSB7CiAgICAgICAgICAgIChib29sIHNlbnQsKSA9IG1zZy5zZW5kZXIuY2FsbHt2YWx1ZTogYWRkcmVzcyh0aGlzKS5iYWxhbmNlfSgiIik7CiAgICAgICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICAgICAgfQogICAgfQp9Cg=="}],Ak=`

                                    Vulnerability

                                    +`,Ik=({prev:s,next:a})=>r.jsx(A,{version:ok,title:rk,description:ik,html:hk,prev:s,next:a,codes:gk}),dk="0.8.24",Ck="Block Timestamp Manipulation",jk="An example of a Solidity contract vulnerable to block timestamp manipulation",Ak=[{fileName:"BlockTimestamp.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qClJvdWxldHRlIGlzIGEgZ2FtZSB3aGVyZSB5b3UgY2FuIHdpbiBhbGwgb2YgdGhlIEV0aGVyIGluIHRoZSBjb250cmFjdAppZiB5b3UgY2FuIHN1Ym1pdCBhIHRyYW5zYWN0aW9uIGF0IGEgc3BlY2lmaWMgdGltaW5nLgpBIHBsYXllciBuZWVkcyB0byBzZW5kIDEwIEV0aGVyIGFuZCB3aW5zIGlmIHRoZSBibG9jay50aW1lc3RhbXAgJSAxNSA9PSAwLgoqLwoKLyoKMS4gRGVwbG95IFJvdWxldHRlIHdpdGggMTAgRXRoZXIKMi4gRXZlIHJ1bnMgYSBwb3dlcmZ1bCBtaW5lciB0aGF0IGNhbiBtYW5pcHVsYXRlIHRoZSBibG9jayB0aW1lc3RhbXAuCjMuIEV2ZSBzZXRzIHRoZSBibG9jay50aW1lc3RhbXAgdG8gYSBudW1iZXIgaW4gdGhlIGZ1dHVyZSB0aGF0IGlzIGRpdmlzaWJsZSBieQogICAxNSBhbmQgZmluZHMgdGhlIHRhcmdldCBibG9jayBoYXNoLgo0LiBFdmUncyBibG9jayBpcyBzdWNjZXNzZnVsbHkgaW5jbHVkZWQgaW50byB0aGUgY2hhaW4sIEV2ZSB3aW5zIHRoZQogICBSb3VsZXR0ZSBnYW1lLgoqLwoKY29udHJhY3QgUm91bGV0dGUgewogICAgdWludDI1NiBwdWJsaWMgcGFzdEJsb2NrVGltZTsKCiAgICBjb25zdHJ1Y3RvcigpIHBheWFibGUge30KCiAgICBmdW5jdGlvbiBzcGluKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgcmVxdWlyZShtc2cudmFsdWUgPT0gMTAgZXRoZXIpOyAvLyBtdXN0IHNlbmQgMTAgZXRoZXIgdG8gcGxheQogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wICE9IHBhc3RCbG9ja1RpbWUpOyAvLyBvbmx5IDEgdHJhbnNhY3Rpb24gcGVyIGJsb2NrCgogICAgICAgIHBhc3RCbG9ja1RpbWUgPSBibG9jay50aW1lc3RhbXA7CgogICAgICAgIGlmIChibG9jay50aW1lc3RhbXAgJSAxNSA9PSAwKSB7CiAgICAgICAgICAgIChib29sIHNlbnQsKSA9IG1zZy5zZW5kZXIuY2FsbHt2YWx1ZTogYWRkcmVzcyh0aGlzKS5iYWxhbmNlfSgiIik7CiAgICAgICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICAgICAgfQogICAgfQp9Cg=="}],uk=`

                                    Vulnerability

                                    block.timestamp can be manipulated by miners with the following constraints

                                    • it cannot be stamped with an earlier time than its parent
                                    • @@ -8937,7 +8937,7 @@ A player needs to send 10 Ether and wins if the block.timestamp % 15 == 0.
                                      • Don't use block.timestamp for a source of entropy and random number
                                      -`,yk=({prev:s,next:a})=>r.jsx(u,{version:dk,title:Ck,description:jk,html:Ak,prev:s,next:a,codes:uk}),mk="0.8.24",bk="Bypass Contract Size Check",wk="An example of bypassing contract size check",kk=[{fileName:"ContractSize.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFRhcmdldCB7CiAgICBmdW5jdGlvbiBpc0NvbnRyYWN0KGFkZHJlc3MgYWNjb3VudCkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIC8vIFRoaXMgbWV0aG9kIHJlbGllcyBvbiBleHRjb2Rlc2l6ZSwgd2hpY2ggcmV0dXJucyAwIGZvciBjb250cmFjdHMgaW4KICAgICAgICAvLyBjb25zdHJ1Y3Rpb24sIHNpbmNlIHRoZSBjb2RlIGlzIG9ubHkgc3RvcmVkIGF0IHRoZSBlbmQgb2YgdGhlCiAgICAgICAgLy8gY29uc3RydWN0b3IgZXhlY3V0aW9uLgogICAgICAgIHVpbnQyNTYgc2l6ZTsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHNpemUgOj0gZXh0Y29kZXNpemUoYWNjb3VudCkKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHNpemUgPiAwOwogICAgfQoKICAgIGJvb2wgcHVibGljIHB3bmVkID0gZmFsc2U7CgogICAgZnVuY3Rpb24gcHJvdGVjdGVkKCkgZXh0ZXJuYWwgewogICAgICAgIHJlcXVpcmUoIWlzQ29udHJhY3QobXNnLnNlbmRlciksICJubyBjb250cmFjdCBhbGxvd2VkIik7CiAgICAgICAgcHduZWQgPSB0cnVlOwogICAgfQp9Cgpjb250cmFjdCBGYWlsZWRBdHRhY2sgewogICAgLy8gQXR0ZW1wdGluZyB0byBjYWxsIFRhcmdldC5wcm90ZWN0ZWQgd2lsbCBmYWlsLAogICAgLy8gVGFyZ2V0IGJsb2NrIGNhbGxzIGZyb20gY29udHJhY3QKICAgIGZ1bmN0aW9uIHB3bihhZGRyZXNzIF90YXJnZXQpIGV4dGVybmFsIHsKICAgICAgICAvLyBUaGlzIHdpbGwgZmFpbAogICAgICAgIFRhcmdldChfdGFyZ2V0KS5wcm90ZWN0ZWQoKTsKICAgIH0KfQoKY29udHJhY3QgSGFjayB7CiAgICBib29sIHB1YmxpYyBpc0NvbnRyYWN0OwogICAgYWRkcmVzcyBwdWJsaWMgYWRkcjsKCiAgICAvLyBXaGVuIGNvbnRyYWN0IGlzIGJlaW5nIGNyZWF0ZWQsIGNvZGUgc2l6ZSAoZXh0Y29kZXNpemUpIGlzIDAuCiAgICAvLyBUaGlzIHdpbGwgYnlwYXNzIHRoZSBpc0NvbnRyYWN0KCkgY2hlY2sKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX3RhcmdldCkgewogICAgICAgIGlzQ29udHJhY3QgPSBUYXJnZXQoX3RhcmdldCkuaXNDb250cmFjdChhZGRyZXNzKHRoaXMpKTsKICAgICAgICBhZGRyID0gYWRkcmVzcyh0aGlzKTsKICAgICAgICAvLyBUaGlzIHdpbGwgd29yawogICAgICAgIFRhcmdldChfdGFyZ2V0KS5wcm90ZWN0ZWQoKTsKICAgIH0KfQo="}],Zk=`

                                      Vulnerability

                                      +`,yk=({prev:s,next:a})=>r.jsx(A,{version:dk,title:Ck,description:jk,html:uk,prev:s,next:a,codes:Ak}),mk="0.8.24",bk="Bypass Contract Size Check",wk="An example of bypassing contract size check",kk=[{fileName:"ContractSize.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFRhcmdldCB7CiAgICBmdW5jdGlvbiBpc0NvbnRyYWN0KGFkZHJlc3MgYWNjb3VudCkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIC8vIFRoaXMgbWV0aG9kIHJlbGll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aGlzIHdpbGwgYnlwYXNzIHRoZSBpc0NvbnRyYWN0KCkgY2hlY2sKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX3RhcmdldCkgewogICAgICAgIGlzQ29udHJhY3QgPSBUYXJnZXQoX3RhcmdldCkuaXNDb250cmFjdChhZGRyZXNzKHRoaXMpKTsKICAgICAgICBhZGRyID0gYWRkcmVzcyh0aGlzKTsKICAgICAgICAvLyBUaGlzIHdpbGwgd29yawogICAgICAgIFRhcmdldChfdGFyZ2V0KS5wcm90ZWN0ZWQoKTsKICAgIH0KfQo="}],Zk=`

                                      Vulnerability

                                      If an address is a contract then the size of code stored at the address will be greater than 0 right?

                                      Let's see how we can create a contract with code size returned by extcodesize equal to 0.

                                      // SPDX-License-Identifier: MIT
                                      @@ -8985,7 +8985,7 @@ A player needs to send 10 Ether and wins if the block.timestamp % 15 == 0.
                                               Target(_target).protected();
                                           }
                                       }
                                      -
                                      `,Wk=({prev:s,next:a})=>r.jsx(u,{version:mk,title:bk,description:wk,html:Zk,prev:s,next:a,codes:kk}),Bk="0.8.24",Gk="Delegatecall",Vk="An example of exploits using delegatecall in Solidity",fk=[{fileName:"Delegatecall_1.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkhhY2tNZSBpcyBhIGNvbnRyYWN0IHRoYXQgdXNlcyBkZWxlZ2F0ZWNhbGwgdG8gZXhlY3V0ZSBjb2RlLgpJdCBpcyBub3Qgb2J2aW91cyB0aGF0IHRoZSBvd25lciBvZiBIYWNrTWUgY2FuIGJlIGNoYW5nZWQgc2luY2UgdGhlcmUgaXMgbm8KZnVuY3Rpb24gaW5zaWRlIEhhY2tNZSB0byBkbyBzby4gSG93ZXZlciBhbiBhdHRhY2tlciBjYW4gaGlqYWNrIHRoZQpjb250cmFjdCBieSBleHBsb2l0aW5nIGRlbGVnYXRlY2FsbC4gTGV0J3Mgc2VlIGhvdy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YWxsKGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJkb1NvbWV0aGluZyh1aW50MjU2KSIsIF9udW0pKTsKICAgIH0KfQoKY29udHJhY3QgQXR0YWNrIHsKICAgIC8vIE1ha2Ugc3VyZSB0aGUgc3RvcmFnZSBsYXlvdXQgaXMgdGhlIHNhbWUgYXMgSGFja01lCiAgICAvLyBUaGlzIHdpbGwgYWxsb3cgdXMgdG8gY29ycmVjdGx5IHVwZGF0ZSB0aGUgc3RhdGUgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBsaWI7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIHVpbnQyNTYgcHVibGljIHNvbWVOdW1iZXI7CgogICAgSGFja01lIHB1YmxpYyBoYWNrTWU7CgogICAgY29uc3RydWN0b3IoSGFja01lIF9oYWNrTWUpIHsKICAgICAgICBoYWNrTWUgPSBIYWNrTWUoX2hhY2tNZSk7CiAgICB9CgogICAgZnVuY3Rpb24gYXR0YWNrKCkgcHVibGljIHsKICAgICAgICAvLyBvdmVycmlkZSBhZGRyZXNzIG9mIGxpYgogICAgICAgIGhhY2tNZS5kb1NvbWV0aGluZyh1aW50MjU2KHVpbnQxNjAoYWRkcmVzcyh0aGlzKSkpKTsKICAgICAgICAvLyBwYXNzIGFueSBudW1iZXIgYXMgaW5wdXQsIHRoZSBmdW5jdGlvbiBkb1NvbWV0aGluZygpIGJlbG93IHdpbGwKICAgICAgICAvLyBiZSBjYWxsZWQKICAgICAgICBoYWNrTWUuZG9Tb21ldGhpbmcoMSk7CiAgICB9CgogICAgLy8gZnVuY3Rpb24gc2lnbmF0dXJlIG11c3QgbWF0Y2ggSGFja01lLmRvU29tZXRoaW5nKCkKICAgIGZ1bmN0aW9uIGRvU29tZXRoaW5nKHVpbnQyNTYgX251bSkgcHVibGljIHsKICAgICAgICBvd25lciA9IG1zZy5zZW5kZXI7CiAgICB9Cn0K"}],Yk=`

                                      Vulnerability

                                      +
                                    `,Wk=({prev:s,next:a})=>r.jsx(A,{version:mk,title:bk,description:wk,html:Zk,prev:s,next:a,codes:kk}),Bk="0.8.24",Gk="Delegatecall",Vk="An example of exploits using delegatecall in Solidity",fk=[{fileName:"Delegatecall_1.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkhhY2tNZSBpcyBhIGNvbnRyYWN0IHRoYXQgdXNlcyBkZWxlZ2F0ZWNhbGwgdG8gZXhlY3V0ZSBjb2RlLgpJdCBpcyBub3Qgb2J2aW91cyB0aGF0IHRoZSBvd25lciBvZiBIYWNrTWUgY2FuIGJlIGNoYW5nZWQgc2luY2UgdGhlcmUgaXMgbm8KZnVuY3Rpb24gaW5zaWRlIEhhY2tNZSB0byBkbyBzby4gSG93ZXZlciBhbiBhdHRhY2tlciBjYW4gaGlqYWNrIHRoZQpjb250cmFjdCBieSBleHBsb2l0aW5nIGRlbGVnYXRlY2FsbC4gTGV0J3Mgc2VlIGhvdy4KCjEuIEFsaWNlIGRlcGxveXMgTGliCjIuIEFsaWNlIGRlcGxveXMgSGFja01lIHdpdGggYWRkcmVzcyBvZiBMaWIKMy4gRXZlIGRlcGxveXMgQXR0YWNrIHdpdGggYWRkcmVzcyBvZiBIYWNrTWUKNC4gRXZlIGNhbGxzIEF0dGFjay5hdHRhY2soKQo1LiBBdHRhY2sgaXMgbm93IHRoZSBvd25lciBvZiBIYWNrTWUKCldoYXQgaGFwcGVuZWQ/CkV2ZSBjYWxsZWQgQXR0YWNrLmF0dGFjaygpLgpBdHRhY2sgY2FsbGVkIHRoZSBmYWxsYmFjayBmdW5jdGlvbiBvZiBIYWNrTWUgc2VuZGluZyB0aGUgZnVuY3Rpb24Kc2VsZWN0b3Igb2YgcHduKCkuIEhhY2tNZSBmb3J3YXJkcyB0aGUgY2FsbCB0byBMaWIgdXNpbmcgZGVsZWdhdGVjYWxsLgpIZXJlIG1zZy5kYXRhIGNvb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CiAgICB9CgogICAgZnVuY3Rpb24gYXR0YWNrKCkgcHVibGljIHsKICAgICAgICAvLyBvdmVycmlkZSBhZGRyZXNzIG9mIGxpYgogICAgICAgIGhhY2tNZS5kb1NvbWV0aGluZyh1aW50MjU2KHVpbnQxNjAoYWRkcmVzcyh0aGlzKSkpKTsKICAgICAgICAvLyBwYXNzIGFueSBudW1iZXIgYXMgaW5wdXQsIHRoZSBmdW5jdGlvbiBkb1NvbWV0aGluZygpIGJlbG93IHdpbGwKICAgICAgICAvLyBiZSBjYWxsZWQKICAgICAgICBoYWNrTWUuZG9Tb21ldGhpbmcoMSk7CiAgICB9CgogICAgLy8gZnVuY3Rpb24gc2lnbmF0dXJlIG11c3QgbWF0Y2ggSGFja01lLmRvU29tZXRoaW5nKCkKICAgIGZ1bmN0aW9uIGRvU29tZXRoaW5nKHVpbnQyNTYgX251bSkgcHVibGljIHsKICAgICAgICBvd25lciA9IG1zZy5zZW5kZXI7CiAgICB9Cn0K"}],Yk=`

                                    Vulnerability

                                    delegatecall is tricky to use and wrong usage or incorrect understanding can lead to devastating results.

                                    You must keep 2 things in mind when using delegatecall

                                    @@ -9131,7 +9131,7 @@ change the owner.
                                    • Use stateless Library
                                    -`,Rk=({prev:s,next:a})=>r.jsx(u,{version:Bk,title:Gk,description:Vk,html:Yk,prev:s,next:a,codes:fk}),Xk="0.8.24",vk="Denial of Service",Nk="An example of denial of service hack in Solidity",Hk=[{fileName:"DenialOfService.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qClRoZSBnb2FsIG9mIEtpbmdPZkV0aGVyIGlzIHRvIGJlY29tZSB0aGUga2luZyBieSBzZW5kaW5nIG1vcmUgRXRoZXIgdGhhbgp0aGUgcHJldmlvdXMga2luZy4gUHJldmlvdXMga2luZyB3aWxsIGJlIHJlZnVuZGVkIHdpdGggdGhlIGFtb3VudCBvZiBFdGhlcgpoZSBz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RyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlczsKCiAgICBmdW5jdGlvbiBjbGFpbVRocm9uZSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIHJlcXVpcmUobXNnLnZhbHVlID4gYmFsYW5jZSwgIk5lZWQgdG8gcGF5IG1vcmUgdG8gYmVjb21lIHRoZSBraW5nIik7CgogICAgICAgIGJhbGFuY2VzW2tpbmddICs9IGJhbGFuY2U7CgogICAgICAgIGJhbGFuY2UgPSBtc2cudmFsdWU7CiAgICAgICAga2luZyA9IG1zZy5zZW5kZXI7CiAgICB9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcoKSBwdWJsaWMgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciAhPSBraW5nLCAiQ3VycmVudCBraW5nIGNhbm5vdCB3aXRoZHJhdyIpOwoKICAgICAgICB1aW50MjU2IGFtb3VudCA9IGJhbGFuY2VzW21zZy5zZW5kZXJdOwogICAgICAgIGJhbGFuY2VzW21zZy5zZW5kZXJdID0gMDsKCiAgICAgICAgKGJvb2wgc2VudCwpID0gbXNnLnNlbmRlci5jYWxse3ZhbHVlOiBhbW91bnR9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],Fk=`

                                    Vulnerability

                                    +`,Rk=({prev:s,next:a})=>r.jsx(A,{version:Bk,title:Gk,description:Vk,html:Yk,prev:s,next:a,codes:fk}),Xk="0.8.24",vk="Denial of Service",Nk="An example of denial of service hack in Solidity",Hk=[{fileName:"DenialOfService.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qClRoZSBnb2FsIG9mIEtpbmdPZkV0aGVyIGlzIHRvIGJlY29tZSB0aGUga2luZyBieSBzZW5kaW5nIG1vcmUgRXRoZXIgdGhhbgp0aGUgcHJldmlvdXMga2luZy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FkZHJlc3MgcHVibGljIGtpbmc7CiAgICB1aW50MjU2IHB1YmxpYyBiYWxhbmNlOwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBiYWxhbmNlczsKCiAgICBmdW5jdGlvbiBjbGFpbVRocm9uZSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIHJlcXVpcmUobXNnLnZhbHVlID4gYmFsYW5jZSwgIk5lZWQgdG8gcGF5IG1vcmUgdG8gYmVjb21lIHRoZSBraW5nIik7CgogICAgICAgIGJhbGFuY2VzW2tpbmddICs9IGJhbGFuY2U7CgogICAgICAgIGJhbGFuY2UgPSBtc2cudmFsdWU7CiAgICAgICAga2luZyA9IG1zZy5zZW5kZXI7CiAgICB9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcoKSBwdWJsaWMgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciAhPSBraW5nLCAiQ3VycmVudCBraW5nIGNhbm5vdCB3aXRoZHJhdyIpOwoKICAgICAgICB1aW50MjU2IGFtb3VudCA9IGJhbGFuY2VzW21zZy5zZW5kZXJdOwogICAgICAgIGJhbGFuY2VzW21zZy5zZW5kZXJdID0gMDsKCiAgICAgICAgKGJvb2wgc2VudCwpID0gbXNnLnNlbmRlci5jYWxse3ZhbHVlOiBhbW91bnR9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],Fk=`

                                    Vulnerability

                                    There are many ways to attack a smart contract to make it unusable.

                                    One exploit we introduce here is denial of service by making the function to send Ether fail.

                                    // SPDX-License-Identifier: MIT
                                    @@ -9222,7 +9222,7 @@ Ether sent from KingOfEther before the new king is set.
                                             require(sent, "Failed to send Ether");
                                         }
                                     }
                                    -
                                    `,Kk=({prev:s,next:a})=>r.jsx(u,{version:Xk,title:vk,description:Nk,html:Fk,prev:s,next:a,codes:Hk}),Mk="0.8.24",Sk="Deploy Different Contracts at the Same Address",xk="An example of a Solidity contract vulnerable to deploy different contracts at the same address",Jk=[{fileName:"TornadoHack.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkNhbGxlZCBieSBBbGljZQowLiBEZXBsb3kgREFPCgpDYWxsZWQgYnkgQXR0YWNrZXIKMS4gRGVwbG95IERlcGxveWVyRGVwbG95ZXIKMi4gQ2FsbCBEZXBsb3llckRlcGxveWVyLmRlcGxveSgpCjMuIENhbGwgRGVwbG95ZXIuZGVwbG95UHJvcG9zYWwoKQoKQ2FsbGVkIGJ5IEFsaWNlCjQuIEdldCBEQU8gYXBwcm92YWwgb2YgUHJvcG9zYWwKCkNhbGxlZCBieSBBdHRhY2tlcgo1LiBEZWxldGUgUHJvcG9zYWwgYW5kIERlcGxveWVyCjYuIFJlLWRlcGxveSBEZXBsb3llcgo3LiBDYWxsIERlcGxveWVyLmRlcGxveUF0dGFjaygpCjguIENhbGwgREFPLmV4ZWN1dGUKOS4gQ2hlY2sgREFPLm93bmVyIGlzIGF0dGFja2VyJ3MgYWRkcmVzcwoKREFPIC0tIGFwcHJvdmVkIC0tPiBQcm9wb3NhbApEZXBsb3llckRlcGxveWVyIC0tIGNyZWF0ZTIgLS0+IERlcGxveWVyIC0tIGNyZWF0ZSAtLT4gUHJvcG9zYWwKRGVwbG95ZXJEZXBsb3llciAtLSBjcmVhdGUyIC0tPiBEZXBsb3llciAtLSBjcmVhdGUgLS0+IEF0dGFjawoqLwoKY29udHJhY3QgREFPIHsKICAgIHN0cnVjdCBQcm9wb3NhbCB7CiAgICAgICAgYWRkcmVzcyB0YXJnZXQ7CiAgICAgICAgYm9vbCBhcHByb3ZlZDsKICAgICAgICBib29sIGV4ZWN1dGVkOwogICAgfQoKICAgIGFkZHJlc3MgcHVibGljIG93bmVyID0gbXNnLnNlbmRlcjsKICAgIFByb3Bvc2FsW10gcHVibGljIHByb3Bvc2FsczsKCiAg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KICAgICAgICBlbWl0IExvZyhhZGRyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBraWxsKCkgZXh0ZXJuYWwgewogICAgICAgIHNlbGZkZXN0cnVjdChwYXlhYmxlKGFkZHJlc3MoMCkpKTsKICAgIH0KfQo="}],zk=`

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

                                    +`,Kk=({prev:s,next:a})=>r.jsx(A,{version:Xk,title:vk,description:Nk,html:Fk,prev:s,next:a,codes:Hk}),Mk="0.8.24",Sk="Deploy Different Contracts at the Same Address",xk="An example of a Solidity contract vulnerable to deploy different contracts at the same address",Jk=[{fileName:"TornadoHack.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkNhbGxlZCBieSBBbGljZQowLiBEZXBsb3kgREFPCgpDYWxsZWQgYnkgQXR0YWNrZXIKMS4gRGVwbG95IERlcGxveWVyRGVwbG95ZXIKMi4gQ2FsbCBEZXBsb3llckRlcGxveWVyLmRlcGxveSgpCjMuIENhbGwgRGVwbG95ZXIuZGVwbG95UHJvcG9zYWwoKQoKQ2FsbGVkIGJ5IEFsaWNlCjQuIEdldCBEQU8gYXBwcm92YWwgb2YgUHJvcG9zYWwKCkNhbGxlZCBieSBBdHRhY2tlcgo1LiBEZWxldGUgUHJvcG9zYWwgYW5kIERlcGxveWVyCjYuIFJlLWRlcGxveSBEZXBsb3llcgo3LiBDYWxsIERlcGxveWVyLmRlcGxveUF0dGFjaygpCjguIENhbGwgREFPLmV4ZWN1dGUKOS4gQ2hlY2sgREFPLm93bmVyIGlzIGF0dGFja2VyJ3MgYWRkcmVzcwoKREFPIC0tIGFwcHJvdmVkIC0tPiBQcm9wb3NhbApEZXBsb3llckRlcGxveWVyIC0tIGNyZWF0ZTIgLS0+IERlcGxveWVyIC0tIGNyZWF0ZSAtLT4gUHJvcG9zYWwKRGVwbG95ZXJEZXBsb3llciAtLSBjcmVhdGUyIC0tPiBEZ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ZHJlc3MgYWRkcik7CgogICAgZnVuY3Rpb24gZGVwbG95UHJvcG9zYWwoKSBleHRlcm5hbCB7CiAgICAgICAgYWRkcmVzcyBhZGRyID0gYWRkcmVzcyhuZXcgUHJvcG9zYWwoKSk7CiAgICAgICAgZW1pdCBMb2coYWRkcik7CiAgICB9CgogICAgZnVuY3Rpb24gZGVwbG95QXR0YWNrKCkgZXh0ZXJuYWwgewogICAgICAgIGFkZHJlc3MgYWRkciA9IGFkZHJlc3MobmV3IEF0dGFjaygpKTsKICAgICAgICBlbWl0IExvZyhhZGRyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBraWxsKCkgZXh0ZXJuYWwgewogICAgICAgIHNlbGZkZXN0cnVjdChwYXlhYmxlKGFkZHJlc3MoMCkpKTsKICAgIH0KfQo="}],zk=`

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

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

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

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

                                    @@ -9337,7 +9337,7 @@ DeployerDeployer -- create2 --> Deployer -- create --> Attack selfdestruct(payable(address(0))); } } -`,Dk=({prev:s,next:a})=>r.jsx(u,{version:Mk,title:Sk,description:xk,html:zk,prev:s,next:a,codes:Jk}),Ek="0.8.24",Qk="Front Running",Tk="An example of a Solidity contract vulnerable to front running",Uk=[{fileName:"FrontRunning.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkFsaWNlIGNyZWF0ZXMgYSBndWVzc2luZyBnYW1lLgpZb3Ugd2luIDEwIGV0aGVyIGlmIHlvdSBjYW4gZmluZCB0aGUgY29ycmVjdCBzdHJpbmcgdGhhdCBoYXNoZXMgdG8gdGhlIHRhcmdldApoYXNoLiBMZXQncyBzZWUgaG93IHRoaXMgY29udHJhY3QgaXMgdnVsbmVyYWJsZSB0byB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hhc2ggZG9lc24ndCBtYXRjaCIpOwoKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfc29sdXRpb24pKSA9PSBoYXNoLCAiSW5jb3JyZWN0IGFuc3dlciIKICAgICAgICApOwoKICAgICAgICB3aW5uZXIgPSBtc2cuc2VuZGVyOwogICAgICAgIGVuZGVkID0gdHJ1ZTsKCiAgICAgICAgKGJvb2wgc2VudCwpID0gcGF5YWJsZShtc2cuc2VuZGVyKS5jYWxse3ZhbHVlOiByZXdhcmR9KCIiKTsKICAgICAgICBpZiAoIXNlbnQpIHsKICAgICAgICAgICAgd2lubmVyID0gYWRkcmVzcygwKTsKICAgICAgICAgICAgZW5kZWQgPSBmYWxzZTsKICAgICAgICAgICAgcmV2ZXJ0KCJGYWlsZWQgdG8gc2VuZCBldGhlci4iKTsKICAgICAgICB9CiAgICB9Cn0K"}],_k=`

                                    Vulnerability

                                    +`,Dk=({prev:s,next:a})=>r.jsx(A,{version:Mk,title:Sk,description:xk,html:zk,prev:s,next:a,codes:Jk}),Ek="0.8.24",Qk="Front Running",Tk="An example of a Solidity contract vulnerable to front running",Uk=[{fileName:"FrontRunning.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkFsaWNlIGNyZWF0ZXMgYSBndWVzc2luZyBnYW1lLgpZb3Ugd2luIDEwIGV0aGVyIGlmIHlvdSBjYW4gZmluZCB0aGUgY29ycmVjdCBzdHJpbmcgdGhhdCBoYXNoZXMgdG8gdGhlIHRhcmdldApoYXNoLiBMZXQncyBzZWUgaG93IHRoaXMgY29udHJhY3QgaXMgdnVsbmVyYWJsZSB0byBmcm9udCBydW5uaW5nLgoqLwoKLyoKMS4gQWxpY2UgZGVwbG95cyBGaW5kVGhpc0hhc2ggd2l0aCAxMCBFdGhlci4KMi4gQm9iIGZpbmRzIHRoZSBjb3Jy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XNoLCAiSW5jb3JyZWN0IGFuc3dlciIKICAgICAgICApOwoKICAgICAgICB3aW5uZXIgPSBtc2cuc2VuZGVyOwogICAgICAgIGVuZGVkID0gdHJ1ZTsKCiAgICAgICAgKGJvb2wgc2VudCwpID0gcGF5YWJsZShtc2cuc2VuZGVyKS5jYWxse3ZhbHVlOiByZXdhcmR9KCIiKTsKICAgICAgICBpZiAoIXNlbnQpIHsKICAgICAgICAgICAgd2lubmVyID0gYWRkcmVzcygwKTsKICAgICAgICAgICAgZW5kZWQgPSBmYWxzZTsKICAgICAgICAgICAgcmV2ZXJ0KCJGYWlsZWQgdG8gc2VuZCBldGhlci4iKTsKICAgICAgICB9CiAgICB9Cn0K"}],_k=`

                                    Vulnerability

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

                                    @@ -9522,7 +9522,7 @@ before the original. } } } -`,Lk=({prev:s,next:a})=>r.jsx(u,{version:Ek,title:Qk,description:Tk,html:_k,prev:s,next:a,codes:Uk}),Ok="0.8.24",Pk="Hiding Malicious Code with External Contract",$k="An example of exploit where malicious code is hidden in an external contract in Solidity",qk=[{fileName:"ExternalContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkxldCdzIHNheSBBbGljZSBjYW4gc2VlIHRoZSBjb2RlIG9mIEZvbyBhbmQgQmFyIGJ1dCBub3QgTWFsLgpJdCBpcyBvYnZpb3VzIHRvIEFsaWNlIHRoYXQgRm9vLmNhbGxCYXIoKSBleGVjdXRlcyB0aGUgY29kZSBpbnNpZGUgQmFyLmxvZygpLgpIb3dldmVyIEV2ZSBkZXBsb3lzIEZvbyB3aXRoIHRoZSBhZGRyZXNzIG9mIE1hbCwgc28gdGhhdCBjYWxsaW5nIEZvby5jYWxsQmFyKCkKd2lsbCBhY3R1YWxseSBleGVjdXRlIHR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GxiYWNrCiAgICBmdW5jdGlvbiBsb2coKSBwdWJsaWMgewogICAgICAgIGVtaXQgTG9nKCJNYWwgd2FzIGNhbGxlZCIpOwogICAgfQp9Cg=="}],s0=`

                                    Vulnerability

                                    +`,Lk=({prev:s,next:a})=>r.jsx(A,{version:Ek,title:Qk,description:Tk,html:_k,prev:s,next:a,codes:Uk}),Ok="0.8.24",Pk="Hiding Malicious Code with External Contract",$k="An example of exploit where malicious code is hidden in an external contract in Solidity",qk=[{fileName:"ExternalContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkxldCdzIHNheSBBbGljZSBjYW4gc2VlIHRoZSBjb2RlIG9mIEZvbyBhbmQgQmFyIGJ1dCBub3QgTWFsLgpJdCBpcyBvYnZpb3VzIHRvIEFsaWNlIHRoYXQgRm9vLmNhbGxCYXIoKSBleGVjdXRlcyB0aGUgY29kZSBpbnNpZGUgQmFyLmxvZygpLgpIb3dldmVyIEV2ZSBkZXBsb3lzIEZvbyB3aXRoIHRoZSBhZGRyZXNzIG9mIE1hbCwgc28gdGhhdCBjYWxsaW5nIEZvby5jYWxsQmFyKCkKd2lsbCBhY3R1YWxseSBleGVjdXRlIHRoZSBjb2RlIGF0IE1hbC4KKi8KCi8qCjEuIEV2ZSBkZXBsb3lzIE1hbAoyLiBFdmUgZGVwbG95cyBGb28gd2l0aCB0aGUgYWRkcmVzcyBvZiBNYWwKMy4gQWxpY2UgY2FsbHMgRm9vLmNhbGxCYXIoKSBhZnRlciByZWFkaW5nIHRoZSBjb2RlIGFuZCBqdWRnaW5nIHRoYXQgaXQgaXMKICAgc2FmZSB0byBjYWxsLgo0LiBBbHRob3VnaCBBbGljZSBleHBlY3RlZCBCYXIubG9nKCkgdG8gYmUgZXhlY3V0ZSwgTWFsLmxvZygpIHdhcyBleGVjdXRlZC4KKi8KCmNvbnRyYWN0IEZvbyB7CiAgICBCYXIgYmFyOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX2JhcikgewogICAgICAgIGJhciA9IEJhcihfYmFyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYWxsQmFyKCkgcHVibGljIHsKICAgICAgICBiYXIubG9nKCk7CiAgICB9Cn0KCmNvbnRyYWN0IEJhciB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwoKICAgIGZ1bmN0aW9uIGxvZygpIHB1YmxpYyB7CiAgICAgICAgZW1pdCBMb2coIkJhciB3YXMgY2FsbGVkIik7CiAgICB9Cn0KCi8vIFRoaXMgY29kZSBpcyBoaWRkZW4gaW4gYSBzZXBhcmF0ZSBmaWxlCmNvbnRyYWN0IE1hbCB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwoKICAgIC8vIGZ1bmN0aW9uICgpIGV4dGVybmFsIHsKICAgIC8vICAgICBlbWl0IExvZygiTWFsIHdhcyBjYWxsZWQiKTsKICAgIC8vIH0KCiAgICAvLyBBY3R1YWxseSB3ZSBjYW4gZXhlY3V0ZSB0aGUgc2FtZSBleHBsb2l0IGV2ZW4gaWYgdGhpcyBmdW5jdGlvbiBkb2VzCiAgICAvLyBub3QgZXhpc3QgYnkgdXNpbmcgdGhlIGZhbGxiYWNrCiAgICBmdW5jdGlvbiBsb2coKSBwdWJsaWMgewogICAgICAgIGVtaXQgTG9nKCJNYWwgd2FzIGNhbGxlZCIpOwogICAgfQp9Cg=="}],s0=`

                                    Vulnerability

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

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

                                    @@ -9589,7 +9589,7 @@ external contract can be reviewed constructor() public { bar = new Bar(); } -`,a0=({prev:s,next:a})=>r.jsx(u,{version:Ok,title:Pk,description:$k,html:s0,prev:s,next:a,codes:qk}),n0="0.8.24",l0="Honeypot",p0="An example of honeypot in Solidity",e0=[{fileName:"HoneyPot.sol",code:"Ly8gU1BEWC1MaWNlb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VpbnQyNTYgX2Ftb3VudCwgc3RyaW5nIG1lbW9yeSBfYWN0aW9uKQogICAgICAgIHB1YmxpYwogICAgewogICAgICAgIGlmIChlcXVhbChfYWN0aW9uLCAiV2l0aGRyYXciKSkgewogICAgICAgICAgICByZXZlcnQoIkl0J3MgYSB0cmFwIik7CiAgICAgICAgfQogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGNvbXBhcmUgc3RyaW5ncyB1c2luZyBrZWNjYWsyNTYKICAgIGZ1bmN0aW9uIGVxdWFsKHN0cmluZyBtZW1vcnkgX2EsIHN0cmluZyBtZW1vcnkgX2IpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlKF9hKSkgPT0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoX2IpKTsKICAgIH0KfQo="}],c0=`

                                    A honeypot is a trap to catch hackers.

                                    +`,a0=({prev:s,next:a})=>r.jsx(A,{version:Ok,title:Pk,description:$k,html:s0,prev:s,next:a,codes:qk}),n0="0.8.24",l0="Honeypot",p0="An example of honeypot in Solidity",e0=[{fileName:"HoneyPot.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkJhbmsgaXMgYSBjb250cmFjdCB0aGF0IGNhbGxzIExvZ2dlciB0byBsb2cgZXZlbnRzLgpCYW5rLndpdGhkcmF3KCkgaXMgdnVsbmVyYWJsZSB0byB0aGUgcmVlbnRyYW5jeSBhdHRhY2suClNvIGEgaGFja2VyIHRyaWVzIHRvIGRyYWluIEV0aGVyIGZyb20gQmFuay4KQnV0IGFjdHVhbGx5IHRoZSByZWVudHJhY3kgZXhwbG9pdCBpcyBhIGJhaXQgZm9yIGhhY2tlcnMuCkJ5IGRlcGxveWluZyBCYW5rIHdpdGggSG9uZXlQb3Qga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KGJvb2wpCiAgICB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlKF9hKSkgPT0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoX2IpKTsKICAgIH0KfQo="}],c0=`

                                    A honeypot is a trap to catch hackers.

                                    Vulnerability

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

                                    that will catch malicious users.

                                    @@ -9695,7 +9695,7 @@ Logger.log() calls HoneyPot.log() and reverts. Transaction fails. return keccak256(abi.encode(_a)) == keccak256(abi.encode(_b)); } } -`,t0=({prev:s,next:a})=>r.jsx(u,{version:n0,title:l0,description:p0,html:c0,prev:s,next:a,codes:e0}),o0="0.8.24",r0="Arithmetic Overflow and Underflow",i0="An example of hacking Solidity with arithmetic overflow / underflow",g0=[{fileName:"Overflow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuNy42OwoKLy8gVGhpcyBjb250cmFjdCBpcyBkZXNpZ25lZCB0byBhY3QgYXMgYSB0aW1lIHZhdWx0LgovLyBVc2VyIGNhbiBkZXBvc2l0IGludG8gdGhpcyBjb250cmFjdCBidXQgY2Fubm90IHdpdGhkcmF3IGZvciBhdGxlYXN0IGEgd2Vlay4KLy8gVXNlciBjYW4gYWxzbyBleHRlbmQgdGhlIHdhaXQgdGltZSBiZXlvbmQgdGhlIDEgd2VlayB3YWl0aW5nIHBlcmlvZC4KCi8qCjEuIERlcGxveSBUaW1lTG9jawoyLiBEZXBsb3kgQXR0YWNrIHdpdGggYWRkcmVzcyBvZiBUaW1lTG9jawozLiBDYWxsIEF0dGFjay5hdHRhY2sgc2VuZGluZyAxIGV0aGVyLiBZb3Ugd2lsbCBpbW1lZGlhdGVseSBiZSBhYmxlIHRvCiAgIHdpdGhkcmF3IHlvdXIgZXRoZXIuCgpXaGF0IGhhcHBlbmVkPwpBdHRhY2sgY2F1c2VkIHRoZSBUaW1lTG9jay5sb2NrVGltZS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lZCB0byBzZW5kIEV0aGVyIik7CiAgICB9Cn0KCmNvbnRyYWN0IEF0dGFjayB7CiAgICBUaW1lTG9jayB0aW1lTG9jazsKCiAgICBjb25zdHJ1Y3RvcihUaW1lTG9jayBfdGltZUxvY2spIHsKICAgICAgICB0aW1lTG9jayA9IFRpbWVMb2NrKF90aW1lTG9jayk7CiAgICB9CgogICAgZmFsbGJhY2soKSBleHRlcm5hbCBwYXlhYmxlIHt9CgogICAgZnVuY3Rpb24gYXR0YWNrKCkgcHVibGljIHBheWFibGUgewogICAgICAgIHRpbWVMb2NrLmRlcG9zaXR7dmFsdWU6IG1zZy52YWx1ZX0oKTsKICAgICAgICAvKgogICAgICAgIGlmIHQgPSBjdXJyZW50IGxvY2sgdGltZSB0aGVuIHdlIG5lZWQgdG8gZmluZCB4IHN1Y2ggdGhhdAogICAgICAgIHggKyB0ID0gMioqMjU2ID0gMAogICAgICAgIHNvIHggPSAtdAogICAgICAgIDIqKjI1NiA9IHR5cGUodWludCkubWF4ICsgMQogICAgICAgIHNvIHggPSB0eXBlKHVpbnQpLm1heCArIDEgLSB0CiAgICAgICAgKi8KICAgICAgICB0aW1lTG9jay5pbmNyZWFzZUxvY2tUaW1lKAogICAgICAgICAgICB0eXBlKHVpbnQyNTYpLm1heCArIDEgLSB0aW1lTG9jay5sb2NrVGltZShhZGRyZXNzKHRoaXMpKQogICAgICAgICk7CiAgICAgICAgdGltZUxvY2sud2l0aGRyYXcoKTsKICAgIH0KfQo="}],h0=`

                                    Vulnerability

                                    +`,t0=({prev:s,next:a})=>r.jsx(A,{version:n0,title:l0,description:p0,html:c0,prev:s,next:a,codes:e0}),o0="0.8.24",r0="Arithmetic Overflow and Underflow",i0="An example of hacking Solidity with arithmetic overflow / underflow",g0=[{fileName:"Overflow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuNy42OwoKLy8gVGhpcyBjb250cmFjdCBpcyBkZXNp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ICAgICAgIHNvIHggPSB0eXBlKHVpbnQpLm1heCArIDEgLSB0CiAgICAgICAgKi8KICAgICAgICB0aW1lTG9jay5pbmNyZWFzZUxvY2tUaW1lKAogICAgICAgICAgICB0eXBlKHVpbnQyNTYpLm1heCArIDEgLSB0aW1lTG9jay5sb2NrVGltZShhZGRyZXNzKHRoaXMpKQogICAgICAgICk7CiAgICAgICAgdGltZUxvY2sud2l0aGRyYXcoKTsKICAgIH0KfQo="}],h0=`

                                    Vulnerability

                                    Solidity < 0.8

                                    Integers in Solidity overflow / underflow without any errors

                                    Solidity >= 0.8
                                    @@ -9774,7 +9774,7 @@ before the 1 week waiting period.
                                  • Solidity 0.8 defaults to throwing an error for overflow / underflow

                                  -`,I0=({prev:s,next:a})=>r.jsx(u,{version:o0,title:r0,description:i0,html:h0,prev:s,next:a,codes:g0}),d0="0.8.24",C0="Phishing with tx.origin",j0="An example of phishing with tx.origin in Solidity",u0=[{fileName:"TxOrigin.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCldhbGxldCBpcyBhIHNpbXBsZSBjb250cmFjdCB3aGVyZSBvbmx5IHRoZSBvd25lciBzaG91bGQgYmUgYWJsZSB0byB0cmFuc2ZlcgpFdGhlciB0byBhbm90aGVyIGFkZHJlc3MuIFdhbGxldC50cmFuc2ZlcigpIHVzZXMgdHgub3JpZ2luIHRvIGNoZWNrIHRoYXQgdGhlCmNhbGxlciBpcyB0aGUgb3duZXIuIExldCdzIHNlZSBob3cgd2UgY2FuIGhhY2sgdGhpcyBjb250cmFjdAoqLwoKLyoKMS4gQWxpY2UgZGVwbG95cyBXYWxsZXQgd2l0aCAxMCBFdGhlcgoyLiBFdmUgZGVwbG95cyBBdHRhY2sgd2l0aCB0aGUgYWRkcmVzcyBvZiBBbGljZSdzIFdhbGxldCBjb250cmFjdC4KMy4gRXZlIHRyaWNrcyBBbGljZSB0byBjYWxsI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AgIHdhbGxldCA9IFdhbGxldChfd2FsbGV0KTsKICAgICAgICBvd25lciA9IHBheWFibGUobXNnLnNlbmRlcik7CiAgICB9CgogICAgZnVuY3Rpb24gYXR0YWNrKCkgcHVibGljIHsKICAgICAgICB3YWxsZXQudHJhbnNmZXIob3duZXIsIGFkZHJlc3Mod2FsbGV0KS5iYWxhbmNlKTsKICAgIH0KfQo="}],A0=`

                                  What's the difference between msg.sender and tx.origin?

                                  +`,I0=({prev:s,next:a})=>r.jsx(A,{version:o0,title:r0,description:i0,html:h0,prev:s,next:a,codes:g0}),d0="0.8.24",C0="Phishing with tx.origin",j0="An example of phishing with tx.origin in Solidity",A0=[{fileName:"TxOrigin.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCldhbGxldCBpcyBhIHNpbXBsZSBjb250cmFjdCB3aGVyZSBvbmx5IHRoZSBvd25lciBzaG91bGQgYmUgYWJsZSB0byB0cmFuc2ZlcgpFdGhlciB0byBhbm90aGVyIGFkZHJlc3MuIFdhbGxldC50cmFuc2ZlcigpIHVzZXMgdHgub3JpZ2luIHRvIGNoZWNrIHRoYXQgdGhlCmNhbGxlciBpcyB0aGUgb3duZXIuIExldCdzIHNlZSBob3cgd2UgY2FuIGhhY2sgdGhpcyBjb250cmFjdAoqLwoKLyoKMS4gQWxpY2UgZGVwbG95cyBXYWxsZXQgd2l0aCAxMCBFdGhlcgoyLiBFdmUgZGVwbG95cyBBdHRhY2sgd2l0aCB0aGUgYWRkcmVzcyBvZiBBbGljZSdzIFdhbGxldCBjb250cmFjdC4KMy4gRXZlIHRyaWNrcyBBbGljZSB0byBjYWxsIEF0dGFjay5hdHRhY2soKQo0LiBFdmUgc3VjY2Vzc2Z1bGx5IHN0b2xlIEV0aGVyIGZyb20gQWxpY2UncyB3YWxsZXQKCldoYXQgaGFwcGVuZWQ/CkFsaWNlIHdhcyB0cmlja2VkIGludG8g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HJhbnNmZXIob3duZXIsIGFkZHJlc3Mod2FsbGV0KS5iYWxhbmNlKTsKICAgIH0KfQo="}],u0=`

                                  What's the difference between msg.sender and tx.origin?

                                  If contract A calls B, and B calls C, in C msg.sender is B and tx.origin is A.

                                  Vulnerability

                                  A malicious contract can deceive the owner of a contract into calling a @@ -9837,7 +9837,7 @@ it authorized the transfer. The wallet transferred all Ether to Eve. (bool sent, ) = _to.call{ value: _amount }(""); require(sent, "Failed to send Ether"); } -`,y0=({prev:s,next:a})=>r.jsx(u,{version:d0,title:C0,description:j0,html:A0,prev:s,next:a,codes:u0}),m0="0.8.24",b0="Source of Randomness",w0="Blockchain is not a reliable source of randomness in Solidity",k0=[{fileName:"Randomness.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCk5PVEU6IGNhbm5vdCB1c2UgYmxvY2toYXNoIGluIFJlbWl4IHNvIHVzZSBnYW5hY2hlLWNsaQoKbnBtIGkgLWcgZ2FuYWNoZS1jbGkKZ2FuYWNoZS1jbGkKSW4gcmVtaXggc3dpdGNoIGVudmlyb25tZW50IHRvIFdlYjMgcHJvdmlkZXIKKi8KCi8qCkd1ZXNzVGhlUmFuZG9tTnVtYmVyIGlzIGEgZ2FtZSB3aGVyZSB5b3Ugd2luIDEgRXRoZXIgaWYgeW91IGNhbiBndWVzcyB0aGUKcHNldWRvIHJhbmRvbSBudW1iZXIgZ2VuZXJhdGVkIGZyb20gYmxvY2sgaGFzaCBhbmQgdGltZXN0YW1wLgoKQXQgZmlyc3QgZ2xhbmNlLCBpdCBzZWVtcyBpbXBvc3NpYmxlIHRvIGd1ZXNzIHRoZSBjb3JyZWN0IG51bWJlci4KQnV0IGxldCdzIHNlZSBob3cgZWFzeSBpdCBpcyB3aW4uCgoxLiBBbGljZSBkZXBsb3lzIEd1ZXNzVGhlUmFuZG9tTnVtYmVyIHdpdGggMSBFdGhlcgoyLiBFd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NrLm51bWJlciAtIDEpLCBibG9jay50aW1lc3RhbXApCiAgICAgICAgICAgICkKICAgICAgICApOwoKICAgICAgICBndWVzc1RoZVJhbmRvbU51bWJlci5ndWVzcyhhbnN3ZXIpOwogICAgfQoKICAgIC8vIEhlbHBlciBmdW5jdGlvbiB0byBjaGVjayBiYWxhbmNlCiAgICBmdW5jdGlvbiBnZXRCYWxhbmNlKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],Z0=`

                                  Vulnerability

                                  +`,y0=({prev:s,next:a})=>r.jsx(A,{version:d0,title:C0,description:j0,html:u0,prev:s,next:a,codes:A0}),m0="0.8.24",b0="Source of Randomness",w0="Blockchain is not a reliable source of randomness in Solidity",k0=[{fileName:"Randomness.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCk5PVEU6IGNhbm5vdCB1c2UgYmxvY2toYXNoIGluIFJlbWl4IHNvIHVzZSBnYW5hY2hlLWNsaQoKbnBtIGkgLWcgZ2FuYWNoZS1jbGkKZ2FuYWNoZS1jbGkKSW4gcmVtaXggc3dpdGNoIGVudmlyb25tZW50IHRvIFdlYjMgcHJvdmlkZXIKKi8KCi8qCkd1ZXNzVGhlUmFuZG9tTnVtYmVyIGlzIGEgZ2FtZSB3aGVyZSB5b3Ugd2luIDEgRXRoZXIgaWYgeW91IGNhbiBndWVzcyB0aGUKcHNldWRvIHJhbmRvbSBudW1iZXIgZ2VuZXJhdGVkIGZyb20gYmxvY2sgaGFzaCBhbmQgdGltZXN0YW1wLgoKQXQgZmlyc3QgZ2xhbmNlLCBpdCBzZWVtcyBpbXBvc3NpYmxlIHRvIGd1ZXNzIHRoZSBjb3JyZWN0IG51bWJlci4KQnV0IGxldCdzIHNlZSBob3cgZWFzeSBpdCBpcyB3aW4uCg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gICAgIGtlY2NhazI1NigKICAgICAgICAgICAgICAgIGFiaS5lbmNvZGVQYWNrZWQoYmxvY2toYXNoKGJsb2NrLm51bWJlciAtIDEpLCBibG9jay50aW1lc3RhbXApCiAgICAgICAgICAgICkKICAgICAgICApOwoKICAgICAgICBndWVzc1RoZVJhbmRvbU51bWJlci5ndWVzcyhhbnN3ZXIpOwogICAgfQoKICAgIC8vIEhlbHBlciBmdW5jdGlvbiB0byBjaGVjayBiYWxhbmNlCiAgICBmdW5jdGlvbiBnZXRCYWxhbmNlKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],Z0=`

                                  Vulnerability

                                  blockhash and block.timestamp are not reliable sources for randomness.

                                  // SPDX-License-Identifier: MIT
                                   pragma solidity ^0.8.24;
                                  @@ -9904,7 +9904,7 @@ Attack computed the correct answer by simply copying the code that computes the
                                   
                                  • Don't use blockhash and block.timestamp as source of randomness
                                  -`,W0=({prev:s,next:a})=>r.jsx(u,{version:m0,title:b0,description:w0,html:Z0,prev:s,next:a,codes:k0}),B0="0.8.24",G0="Re-Entrancy",V0="An example of re-entrancy attack in Solidity",f0=[{fileName:"ReEntrancy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkV0aGVyU3RvcmUgaXMgYSBjb250cmFjdCB3aGVyZSB5b3UgY2FuIGRlcG9zaXQgYW5kIHdpdGhkcmF3IEVUSC4KVGhpcyBjb250cmFjdCBpcyB2dWxuZXJhYmxlIHRvIHJlLWVudHJhbmN5IGF0dGFjay4KTGV0J3Mgc2VlIHdoeS4KCjEuIERlcGxveSBFdGhlclN0b3JlCjIuIERlcG9zaXQgMSBFdGhlciBlYWNoIGZyb20gQWNjb3VudCAxIChBbGljZSkgYW5kIEFjY291bnQgMiAoQm9iKSBpbnRvI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AgICAgIHJlcXVpcmUobXNnLnZhbHVlID49IEFNT1VOVCk7CiAgICAgICAgZXRoZXJTdG9yZS5kZXBvc2l0e3ZhbHVlOiBBTU9VTlR9KCk7CiAgICAgICAgZXRoZXJTdG9yZS53aXRoZHJhdygpOwogICAgfQoKICAgIC8vIEhlbHBlciBmdW5jdGlvbiB0byBjaGVjayB0aGUgYmFsYW5jZSBvZiB0aGlzIGNvbnRyYWN0CiAgICBmdW5jdGlvbiBnZXRCYWxhbmNlKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"},{fileName:"ReEntrancyGuard.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFJlRW50cmFuY3lHdWFyZCB7CiAgICBib29sIGludGVybmFsIGxvY2tlZDsKCiAgICBtb2RpZmllciBub1JlZW50cmFudCgpIHsKICAgICAgICByZXF1aXJlKCFsb2NrZWQsICJObyByZS1lbnRyYW5jeSIpOwogICAgICAgIGxvY2tlZCA9IHRydWU7CiAgICAgICAgXzsKICAgICAgICBsb2NrZWQgPSBmYWxzZTsKICAgIH0KfQo="}],Y0=`

                                  Vulnerability

                                  +`,W0=({prev:s,next:a})=>r.jsx(A,{version:m0,title:b0,description:w0,html:Z0,prev:s,next:a,codes:k0}),B0="0.8.24",G0="Re-Entrancy",V0="An example of re-entrancy attack in Solidity",f0=[{fileName:"ReEntrancy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCkV0aGVyU3RvcmUgaXMgYSBjb250cmFjdCB3aGVyZSB5b3UgY2FuIGRlcG9zaXQgYW5kIHdpdGhkcmF3IEVUSC4KVGhpcyBjb250cmFjdCBpcyB2dWxuZXJhYmxl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ICBpZiAoYWRkcmVzcyhldGhlclN0b3JlKS5iYWxhbmNlID49IEFNT1VOVCkgewogICAgICAgICAgICBldGhlclN0b3JlLndpdGhkcmF3KCk7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIGF0dGFjaygpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIHJlcXVpcmUobXNnLnZhbHVlID49IEFNT1VOVCk7CiAgICAgICAgZXRoZXJTdG9yZS5kZXBvc2l0e3ZhbHVlOiBBTU9VTlR9KCk7CiAgICAgICAgZXRoZXJTdG9yZS53aXRoZHJhdygpOwogICAgfQoKICAgIC8vIEhlbHBlciBmdW5jdGlvbiB0byBjaGVjayB0aGUgYmFsYW5jZSBvZiB0aGlzIGNvbnRyYWN0CiAgICBmdW5jdGlvbiBnZXRCYWxhbmNlKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"},{fileName:"ReEntrancyGuard.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFJlRW50cmFuY3lHdWFyZCB7CiAgICBib29sIGludGVybmFsIGxvY2tlZDsKCiAgICBtb2RpZmllciBub1JlZW50cmFudCgpIHsKICAgICAgICByZXF1aXJlKCFsb2NrZWQsICJObyByZS1lbnRyYW5jeSIpOwogICAgICAgIGxvY2tlZCA9IHRydWU7CiAgICAgICAgXzsKICAgICAgICBsb2NrZWQgPSBmYWxzZTsKICAgIH0KfQo="}],Y0=`

                                  Vulnerability

                                  Let's say that contract A calls contract B.

                                  Reentracy exploit allows B to call back into A before A finishes execution.

                                  // SPDX-License-Identifier: MIT
                                  @@ -10005,7 +10005,7 @@ Here is how the functions were called
                                           locked = false;
                                       }
                                   }
                                  -
                                  `,R0=({prev:s,next:a})=>r.jsx(u,{version:B0,title:G0,description:V0,html:Y0,prev:s,next:a,codes:f0}),X0="0.8.24",v0="Self Destruct",N0="An example of how to delete your smart contract by calling seldestruct in Solidity",H0=[{fileName:"ForceEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIFRoZSBnb2FsIG9mIHRoaXMgZ2FtZSBpcyB0byBiZSB0aGUgN3RoIHBsYXllciB0byBkZXBvc2l0IDEgRXRoZXIuCi8vIFBsYXllcnMgY2FuIGRlcG9zaXQgb25seSAxIEV0aGVyIGF0IGEgdGltZS4KLy8gV2lubmVyIHdpbGwgYmUgYWJsZSB0byB3aXRoZHJhdyBhbGwgRXRoZXIuCgovKgoxLiBEZXBsb3kgRXRoZXJHYW1lCjIuIFBsYXllcnMgKHNheSBBbGljZSBhbmQgQm9iKSBkZWNpZGVzIHRvIHBsYXksIGRlcG9zaXRzIDEgRXRoZXIgZWFjaC4KMi4gRGVwbG95IEF0dGFjayB3aXRoIGFkZHJlc3Mgb2YgRXRoZXJHYW1lCjMuIENhbGwgQXR0YWNrLmF0dGFjayBzZW5kaW5nIDUgZXRoZXIuIFRoaXMgd2lsbCBicmVhayB0aGUgZ2FtZQogICBObyBvbmUgY2FuIGJlY29tZSB0aGUgd2lubmVyLgoKV2hhdCBoYXBwZW5lZD8KQXR0YWNrIGZvcmNlZCB0aGUgYmFsYW5jZSBvZiBFdGhlckdhbWUgdG8gZXF1YWwgNyBldGhlci4KTm93IG5vIG9uZSBjYW4gZGVwb3NpdCBhbmQgdGhlIHdpbm5lciBjYW5ub3QgYmUgc2V0LgoqLwoKY29udHJhY3QgRXRoZXJHYW1lIHsKICAgIHVpbnQyNTYgcHVibGljIHRhcmdldEFtb3VudCA9IDcgZXRoZXI7CiAgICBhZGRyZXNzIHB1YmxpYyB3aW5uZXI7CgogICAgZnVuY3Rpb24gZGVwb3NpdCgpIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICByZXF1aXJl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V0aGVyR2FtZSkpOwogICAgICAgIHNlbGZkZXN0cnVjdChhZGRyKTsKICAgIH0KfQo="},{fileName:"PreventForceEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEV0aGVyR2FtZSB7CiAgICB1aW50MjU2IHB1YmxpYyB0YXJnZXRBbW91bnQgPSAzIGV0aGVyOwogICAgdWludDI1NiBwdWJsaWMgYmFsYW5jZTsKICAgIGFkZHJlc3MgcHVibGljIHdpbm5lcjsKCiAgICBmdW5jdGlvbiBkZXBvc2l0KCkgcHVibGljIHBheWFibGUgewogICAgICAgIHJlcXVpcmUobXNnLnZhbHVlID09IDEgZXRoZXIsICJZb3UgY2FuIG9ubHkgc2VuZCAxIEV0aGVyIik7CgogICAgICAgIGJhbGFuY2UgKz0gbXNnLnZhbHVlOwogICAgICAgIHJlcXVpcmUoYmFsYW5jZSA8PSB0YXJnZXRBbW91bnQsICJHYW1lIGlzIG92ZXIiKTsKCiAgICAgICAgaWYgKGJhbGFuY2UgPT0gdGFyZ2V0QW1vdW50KSB7CiAgICAgICAgICAgIHdpbm5lciA9IG1zZy5zZW5kZXI7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIGNsYWltUmV3YXJkKCkgcHVibGljIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gd2lubmVyLCAiTm90IHdpbm5lciIpOwoKICAgICAgICAoYm9vbCBzZW50LCkgPSBtc2cuc2VuZGVyLmNhbGx7dmFsdWU6IGJhbGFuY2V9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],F0=`

                                  Contracts can be deleted from the blockchain by calling selfdestruct.

                                  +
                                  `,R0=({prev:s,next:a})=>r.jsx(A,{version:B0,title:G0,description:V0,html:Y0,prev:s,next:a,codes:f0}),X0="0.8.24",v0="Self Destruct",N0="An example of how to delete your smart contract by calling seldestruct in Solidity",H0=[{fileName:"ForceEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIFRoZSBnb2FsIG9mIHRoaXMgZ2FtZSBpcyB0byBiZSB0aGUgN3RoIHBsYXllciB0byBkZXBvc2l0IDEgRXRoZXIuCi8vIFBsYXllcnMgY2FuIGRlcG9zaXQgb25seSAxIEV0aGVyIGF0IGEgdGltZS4KLy8gV2lubmVyIHdpbGwgYmUgYWJsZSB0byB3aXRoZHJhdyBhbGwgRXRoZXIuCgovKgoxLiBEZXBsb3kgRXRoZXJHYW1lCjIuIFBsYXllcnMgKHNheSBBbGljZSBhbmQgQm9iKSBkZWNpZGVzIHRvIHBsYXksIGRlcG9zaXRzIDEgRXRoZXIgZWFjaC4KMi4gRGVwbG95IEF0dGFjayB3aXRoIGFkZHJlc3Mgb2YgRXRoZXJHYW1lCjMuIENhbGwgQXR0YWNrLmF0dGFjayBzZW5kaW5nIDUgZXRoZXIuIFRoaXMgd2lsbCBicmVhayB0aGUgZ2FtZQogICBObyBvbmUgY2FuIGJlY29tZSB0aGUgd2lubmVyLgoKV2hhdCBoYXBwZW5lZD8KQXR0YWNrIGZvcmNlZCB0aGUgYmFsYW5jZSBvZiBFdGhlckdhbWUgdG8gZXF1YWwgNyBldGhlci4KTm93IG5vIG9uZSBjYW4gZGVwb3NpdCBhbmQgdGhlIHdpbm5lciBjYW5ub3QgYmUgc2V0LgoqLwoKY29udHJhY3QgRXRoZXJHYW1lIHsKICAgIHVpbnQyNTYgcHVibGljIHRhcmdldEFtb3VudCA9IDcgZXRoZXI7CiAgICBhZGRyZXNzIHB1YmxpYyB3aW5uZXI7CgogICAgZnVuY3Rpb24gZGVwb3NpdCgpIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICByZXF1aXJlKG1zZy52YWx1ZSA9PSAxIGV0aGVy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GZkZXN0cnVjdChhZGRyKTsKICAgIH0KfQo="},{fileName:"PreventForceEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEV0aGVyR2FtZSB7CiAgICB1aW50MjU2IHB1YmxpYyB0YXJnZXRBbW91bnQgPSAzIGV0aGVyOwogICAgdWludDI1NiBwdWJsaWMgYmFsYW5jZTsKICAgIGFkZHJlc3MgcHVibGljIHdpbm5lcjsKCiAgICBmdW5jdGlvbiBkZXBvc2l0KCkgcHVibGljIHBheWFibGUgewogICAgICAgIHJlcXVpcmUobXNnLnZhbHVlID09IDEgZXRoZXIsICJZb3UgY2FuIG9ubHkgc2VuZCAxIEV0aGVyIik7CgogICAgICAgIGJhbGFuY2UgKz0gbXNnLnZhbHVlOwogICAgICAgIHJlcXVpcmUoYmFsYW5jZSA8PSB0YXJnZXRBbW91bnQsICJHYW1lIGlzIG92ZXIiKTsKCiAgICAgICAgaWYgKGJhbGFuY2UgPT0gdGFyZ2V0QW1vdW50KSB7CiAgICAgICAgICAgIHdpbm5lciA9IG1zZy5zZW5kZXI7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIGNsYWltUmV3YXJkKCkgcHVibGljIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gd2lubmVyLCAiTm90IHdpbm5lciIpOwoKICAgICAgICAoYm9vbCBzZW50LCkgPSBtc2cuc2VuZGVyLmNhbGx7dmFsdWU6IGJhbGFuY2V9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],F0=`

                                  Contracts can be deleted from the blockchain by calling selfdestruct.

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

                                  Vulnerability

                                  @@ -10097,7 +10097,7 @@ Now no one can deposit and the winner cannot be set. require(sent, "Failed to send Ether"); } } -`,K0=({prev:s,next:a})=>r.jsx(u,{version:X0,title:v0,description:N0,html:F0,prev:s,next:a,codes:H0}),M0="0.8.24",S0="Signature Replay",x0="An example of a contract vulnerable to signature replay attack",J0=[{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDgoKHVpbnQyNTYodnMpID4+IDI1NSkgKyAyNyk7CiAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzMzIgciwgYnl0ZXMzMiB2cykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIF90aHJvd0Vycm9yKGVycm9yKTsKICAgICAgICByZXR1cm4gcmVjb3ZlcmVkOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyeVJlY292ZXIoYnl0ZXMzMiBoYXNoLCB1aW50OCB2LCBieXRlczMyIHIsIGJ5dGVzMzIgcykKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzLCBSZWNvdmVyRXJyb3IpCiA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BpbnN0ZWFkIDI3LzI4LCBhZGQgMjcgdG8gdiB0byBhY2NlcHQKICAgICAgICAvLyB0aGVzZSBtYWxsZWFibGUgc2lnbmF0dXJlcyBhcyB3ZWxsLgogICAgICAgIGlmICgKICAgICAgICAgICAgdWludDI1NihzKQogICAgICAgICAgICAgICAgPiAweDdGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGNUQ1NzZFNzM1N0E0NTAxRERGRTkyRjQ2NjgxQjIwQTAKICAgICAgICApIHsKICAgICAgICAgICAgcmV0dXJuIChhZGRyZXNzKDApLCBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZVMpOwogICAgICAgIH0KICAgICAgICBpZiAodiAhPSAyNyAmJiB2ICE9IDI4KSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVWKTsKICAgICAgICB9CgogICAgICAgIC8vIElmIHRoZSBzaWduYXR1cmUgaXMgdmFsaWQgKGFuZCBub3QgbWFsbGVhYmxlKSwgcmV0dXJuIHRoZSBzaWduZXIgYWRkcmVzcwogICAgICAgIGFkZHJlc3Mgc2lnbmVyID0gZWNyZWNvdmVyKGhhc2gsIHYsIHIsIHMpOwogICAgICAgIGlmIChzaWduZXIgPT0gYWRkcmVzcygwKSkgewogICAgICAgICAgICByZXR1cm4gKGFkZHJlc3MoMCksIFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKTsKICAgICAgICB9CgogICAgICAgIHJldHVybiAoc2lnbmVyLCBSZWNvdmVyRXJyb3IuTm9FcnJvcik7CiAgICB9CgogICAgZnVuY3Rpb24gcmVjb3ZlcihieXRlczMyIGhhc2gsIHVpbnQ4IHYsIGJ5dGVzMzIgciwgYnl0ZXMzMiBzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MpCiAgICB7CiAgICAgICAgKGFkZHJlc3M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y2IxYgoqLwo="},{fileName:"SigReplay.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG9ydCAiLi9FQ0RTQS5zb2wiOwoKY29udHJhY3QgTXVsdGlTaWdXYWxsZXQgewogICAgdXNpbmcgRUNEU0EgZm9yIGJ5dGVzMzI7CgogICAgYWRkcmVzc1syXSBwdWJsaWMgb3duZXJzOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3NbMl0gbWVtb3J5IF9vd25lcnMpIHBheWFibGUgewogICAgICAgIG93bmVycyA9IF9vd25lcnM7CiAgICB9CgogICAgZnVuY3Rpb24gZGVwb3NpdCgpIGV4dGVybmFsIHBheWFibGUge30KCiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIF90bywgdWludDI1NiBfYW1vdW50LCBieXRlc1syXSBtZW1vcnkgX3NpZ3MpCiAgICAgICAgZXh0ZXJuYWwKICAgIHsKICAgICAgICBieXRlczMyIHR4SGFzaCA9IGdldFR4SGFzaChfdG8sIF9hbW91bnQpOwogICAgICAgIHJlcXVpcmUoX2NoZWNrU2lncyhfc2lncywgdHhIYXNoKSwgImludmFsaWQgc2lnIik7CgogICAgICAgIChib29sIHNlbnQsKSA9IF90by5jYWxse3ZhbHVlOiBfYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRUeEhhc2goYWRkcmVzcyBfdG8sIHVpbnQyNTYgX2Ftb3VudCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQoX3RvLCBfYW1vdW50KSk7CiAgICB9CgogICAgZnVuY3Rpb24gX2NoZWNrU2lncyhieXRlc1syXSBtZW1vcnkgX3NpZ3MsIGJ5dGVzMzIgX3R4SGFzaCkKICAgICAgICBwcml2YXRlCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYnl0ZXMzMiBldGhTaWduZWRIYXNoID0gX3R4SGFzaC50b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKCk7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IF9zaWdzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGFkZHJlc3Mgc2lnbmVyID0gZXRoU2lnbmVkSGFzaC5yZWNvdmVyKF9zaWdzW2ldKTsKICAgICAgICAgICAgYm9vbCB2YWxpZCA9IHNpZ25lciA9PSBvd25lcnNbaV07CgogICAgICAgICAgICBpZiAoIXZhbGlkKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHJldHVybiB0cnVlOwogICAgfQp9Cg=="}],z0=`

                                  Signing messages off-chain and having a contract that requires that signature before executing +`,K0=({prev:s,next:a})=>r.jsx(A,{version:X0,title:v0,description:N0,html:F0,prev:s,next:a,codes:H0}),M0="0.8.24",S0="Signature Replay",x0="An example of a contract vulnerable to signature replay attack",J0=[{fileName:"ECDSA.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIE9wZW5aZXBwZWxpbiBDb250cmFjdHMgKGxhc3QgdXBkYXRlZCB2NC41LjApICh1dGlscy9jcnlwdG9ncmFwaHkvRUNEU0Euc29sKQoKbGlicmFyeSBFQ0RTQSB7CiAgICBlbnVtIFJlY292ZXJFcnJvciB7CiAgICAgICAgTm9FcnJvciwKICAgICAgICBJbnZhbGlkU2lnbmF0dXJlLAogICAgICAgIEludmFsaWRTaWduYXR1cmVMZW5ndGgsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVMsCiAgICAgICAgSW52YWxpZFNpZ25hdHVyZVYKICAgIH0KCiAgICBmdW5jdGlvbiBfdGhyb3dFcnJvcihSZWNvdmVyRXJyb3IgZXJyb3IpIHByaXZhdGUgcHVyZSB7CiAgICAgICAgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5Ob0Vycm9yKSB7CiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gZXJyb3I6IGRvIG5vdGhpbmcKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlKSB7CiAgICAgICAgICAgIHJldmVydCgiRUNEU0E6IGludmFsaWQgc2lnbmF0dXJlIik7CiAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBSZWNvdmVyRXJyb3IuSW52YWxpZFNpZ25hdHVyZUxlbmd0aCkgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlUykgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAncycgdmFsdWUiKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFJlY292ZXJFcnJvci5JbnZhbGlkU2lnbmF0dXJlVikgewogICAgICAgICAgICByZXZlcnQoIkVDRFNBOiBpbnZhbGlkIHNpZ25hdHVyZSAndicgdmFsdWUiKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdHJ5UmVjb3ZlcihieXRlczMyIGhhc2gsIGJ5dGVzIG1lbW9yeSBzaWduYXR1cmUpCiAgICAgICAgaW50ZXJuYWwKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYWRkcmVzcywgUmVjb3ZlckVycm9yKQogICAgewogICAgICAgIC8vIENoZWNrIHRoZSBzaWduYXR1cmUgbGVuZ3RoCiAgICAgICAgLy8gLSBjYXNlIDY1OiByLHMsdiBzaWduYXR1cmUgKHN0YW5kYXJkKQogICAgICAgIC8vIC0gY2FzZSA2NDogcix2cyBzaWduYXR1cmUgKGNmIGh0dHBzOi8vZWlwcy5ldGhlcmV1bS5vcmcvRUlQUy9laXAtMjA5OCkgX0F2YWlsYWJsZSBzaW5jZSB2NC4xLl8KICAgICAgICBpZiAoc2lnbmF0dXJlLmxlbmd0aCA9PSA2NSkgewogICAgICAgICAgICBieXRlczMyIHI7CiAgICAgICAgICAgIGJ5dGVzMzIgczsKICAgICAgICAgICAgdWludDggdjsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgcyA6PSBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDQwKSkKICAgICAgICAgICAgICAgIHYgOj0gYnl0ZSgwLCBtbG9hZChhZGQoc2lnbmF0dXJlLCAweDYwKSkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgdiwgciwgcyk7CiAgICAgICAgfSBlbHNlIGlmIChzaWduYXR1cmUubGVuZ3RoID09IDY0KSB7CiAgICAgICAgICAgIGJ5dGVzMzIgcjsKICAgICAgICAgICAgYnl0ZXMzMiB2czsKICAgICAgICAgICAgLy8gZWNyZWNvdmVyIHRha2VzIHRoZSBzaWduYXR1cmUgcGFyYW1ldGVycywgYW5kIHRoZSBvbmx5IHdheSB0byBnZXQgdGhlbQogICAgICAgICAgICAvLyBjdXJyZW50bHkgaXMgdG8gdXNlIGFzc2VtYmx5LgogICAgICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWduYXR1cmUsIDB4MjApKQogICAgICAgICAgICAgICAgdnMgOj0gbWxvYWQoYWRkKHNpZ25hdHVyZSwgMHg0MCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRyeVJlY292ZXIoaGFzaCwgciwgdnMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiAoYWRkcmVzcygwKSwgUmVjb3ZlckVycm9yLkludmFsaWRTaWduYXR1cmVMZW5ndGgpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiByZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMgbWVtb3J5IHNpZ25hdHVyZSkKICAgICAgICBpbnRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zIChhZGRyZXNzKQogICAgewogICAgICAgIChhZGRyZXNzIHJlY292ZXJlZCwgUmVjb3ZlckVycm9yIGVycm9yKSA9IHRyeVJlY292ZXIoaGFzaCwgc2lnbmF0dXJlKTsKICAgICAgICBfdGhyb3dFcnJvcihlcnJvcik7CiAgICAgICAgcmV0dXJuIHJlY292ZXJlZDsKICAgIH0KCiAgICBmdW5jdGlvbiB0cnlSZWNvdmVyKGJ5dGVzMzIgaGFzaCwgYnl0ZXMzMiByLCBieXRlczMyIHZzKQogICAgICAgIGludGVybmFsCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGFkZHJlc3MsIFJlY292ZXJFcnJvcikKICAgIHsKICAgICAgICBieXRlczMyIHMgPSB2cwogICAgICAgICAgICAmIGJ5dGVzMzIoCiAgICAgICAgICAgICAgICAweDdmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmYKICAgICAgICAgICAgKTsKICAgICAgICB1aW50OCB2ID0gdWludDgoKHVpbn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W50LCBieXRlc1syXSBtZW1vcnkgX3NpZ3MpCiAgICAgICAgZXh0ZXJuYWwKICAgIHsKICAgICAgICBieXRlczMyIHR4SGFzaCA9IGdldFR4SGFzaChfdG8sIF9hbW91bnQpOwogICAgICAgIHJlcXVpcmUoX2NoZWNrU2lncyhfc2lncywgdHhIYXNoKSwgImludmFsaWQgc2lnIik7CgogICAgICAgIChib29sIHNlbnQsKSA9IF90by5jYWxse3ZhbHVlOiBfYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRUeEhhc2goYWRkcmVzcyBfdG8sIHVpbnQyNTYgX2Ftb3VudCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQoX3RvLCBfYW1vdW50KSk7CiAgICB9CgogICAgZnVuY3Rpb24gX2NoZWNrU2lncyhieXRlc1syXSBtZW1vcnkgX3NpZ3MsIGJ5dGVzMzIgX3R4SGFzaCkKICAgICAgICBwcml2YXRlCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgYnl0ZXMzMiBldGhTaWduZWRIYXNoID0gX3R4SGFzaC50b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKCk7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IF9zaWdzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGFkZHJlc3Mgc2lnbmVyID0gZXRoU2lnbmVkSGFzaC5yZWNvdmVyKF9zaWdzW2ldKTsKICAgICAgICAgICAgYm9vbCB2YWxpZCA9IHNpZ25lciA9PSBvd25lcnNbaV07CgogICAgICAgICAgICBpZiAoIXZhbGlkKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHJldHVybiB0cnVlOwogICAgfQp9Cg=="}],z0=`

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

                                  For example this technique is used to:

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

                                    ); } } -`,D0=({prev:s,next:a})=>r.jsx(u,{version:M0,title:S0,description:x0,html:z0,prev:s,next:a,codes:J0}),E0="0.8.24",Q0="Vault Inflation",T0="An example of vault inflation",U0=[{fileName:"VaultInflation.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI0OwoKaW1wb3J0IHtUZXN0LCBjb25zb2xlMn0gZnJvbSAiZm9yZ2Utc3RkL1Rlc3Quc29sIjsKaW1wb3J0IHsKICAgIElFUkMyMCwKICAgIFZhdWx0LAogICAgVG9rZW4KfSBmcm9tICIuLi8uLi8uLi9zcmMvaGFja3MvdmF1bHQtaW5mbGF0aW9uL1ZhdWx0SW5mbGF0aW9uLnNvbCI7Cgp1aW50OCBjb25zdGFudCBERUNJTUFMUyA9IDE4OwoKY29udHJhY3QgVmF1bHRUZXN0IGlzIFRlc3QgewogICAgVmF1bHQgcHJpdmF0ZSB2YXVsdDsKICAgIFRva2VuIHByaXZhdGUgdG9rZW47CgogICAgYWRkcmVzc1tdIHByaXZhdGUgdXNlcnMgPSBbYWRkcmVzcygxMSksIGFkZHJlc3MoMTIpXTsKCiAgICBmdW5jdGlvbiBzZXRVcCgpIHB1YmxpYyB7CiAgICAgICAgdG9rZW4gPSBuZXcgVG9rZW4oKTsKICAgICAgICB2YXVsdCA9IG5ldyBWYXVsdChhZGRyZXNzKHRva2VuKSk7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IHVzZXJzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIHRva2VuLm1pbnQodXNlcnNbaV0sIDEwMDAwICogKDEwIC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gogICAgICAgIC8vIHVzZXJzWzBdIGRvbmF0ZSAxMDAKICAgICAgICBjb25zb2xlMi5sb2coIi0tLSB1c2Vyc1swXSBkb25hdGUgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMF0pOwogICAgICAgIHRva2VuLnRyYW5zZmVyKGFkZHJlc3ModmF1bHQpLCAxMDAgKiAoMTAgKiogREVDSU1BTFMpKTsKICAgICAgICBwcmludCgpOwoKICAgICAgICAvLyB1c2Vyc1sxXSBkZXBvc2l0IDEwMAogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIHVzZXJzWzFdIGRlcG9zaXQgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMV0pOwogICAgICAgIHZhdWx0LmRlcG9zaXQoMTAwICogKDEwICoqIERFQ0lNQUxTKSk7CiAgICAgICAgcHJpbnQoKTsKICAgIH0KfQo="}],_0=`

                                    Vulnerability

                                    +`,D0=({prev:s,next:a})=>r.jsx(A,{version:M0,title:S0,description:x0,html:z0,prev:s,next:a,codes:J0}),E0="0.8.24",Q0="Vault Inflation",T0="An example of vault inflation",U0=[{fileName:"VaultInflation.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjI0OwoKaW1wb3J0IHtUZXN0LCBjb25zb2xlMn0gZnJvbSAiZm9yZ2Utc3RkL1Rlc3Quc29sIjsKaW1wb3J0IHsKICAgIElFUkMyMCwKICAgIFZhdWx0LAogICAgVG9rZW4KfSBmcm9tICIuLi8uLi8uLi9zcmMvaGFja3MvdmF1bHQtaW5mbGF0aW9uL1ZhdWx0SW5mbGF0aW9uLnNvbCI7Cgp1aW50OCBjb25zdGFudCBERUNJTUFMUyA9IDE4OwoKY29udHJhY3QgVmF1bHRUZXN0IGlzIFRlc3QgewogICAgVmF1bHQgcHJpdmF0ZSB2YXVsdDsKICAgIFRva2VuIHByaXZhdGUgdG9rZW47CgogICAgYWRkcmVzc1td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lMi5sb2coInVzZXJzWzFdIHJlZGVlbWFibGUiLCB2YXVsdC5wcmV2aWV3UmVkZWVtKHNoYXJlczEpKTsKICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0KCkgcHVibGljIHsKICAgICAgICAvLyB1c2Vyc1swXSBkZXBvc2l0IDEKICAgICAgICBjb25zb2xlMi5sb2coIi0tLSB1c2Vyc1swXSBkZXBvc2l0IC0tLSIpOwogICAgICAgIHZtLnByYW5rKHVzZXJzWzBdKTsKICAgICAgICB2YXVsdC5kZXBvc2l0KDEpOwogICAgICAgIHByaW50KCk7CgogICAgICAgIC8vIHVzZXJzWzBdIGRvbmF0ZSAxMDAKICAgICAgICBjb25zb2xlMi5sb2coIi0tLSB1c2Vyc1swXSBkb25hdGUgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMF0pOwogICAgICAgIHRva2VuLnRyYW5zZmVyKGFkZHJlc3ModmF1bHQpLCAxMDAgKiAoMTAgKiogREVDSU1BTFMpKTsKICAgICAgICBwcmludCgpOwoKICAgICAgICAvLyB1c2Vyc1sxXSBkZXBvc2l0IDEwMAogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIHVzZXJzWzFdIGRlcG9zaXQgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMV0pOwogICAgICAgIHZhdWx0LmRlcG9zaXQoMTAwICogKDEwICoqIERFQ0lNQUxTKSk7CiAgICAgICAgcHJpbnQoKTsKICAgIH0KfQo="}],_0=`

                                    Vulnerability

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

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

                                    Example

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

                                    print(); } } -`,L0=({prev:s,next:a})=>r.jsx(u,{version:E0,title:Q0,description:T0,html:_0,prev:s,next:a,codes:U0}),O0="0.8.24",P0="WETH Permit",$0="An example of WETH permit hack",q0=[{fileName:"ERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLU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dCBBcHByb3ZhbChtc2cuc2VuZGVyLCBzcGVuZGVyLCBhbW91bnQpOwogICAgICAgIHJldHVybiB0cnVlOwogICAgfQoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KQogICAgICAgIHB1YmxpYwogICAgICAgIHZpcnR1YWwKICAgICAgICByZXR1cm5zIChib29sKQogICAgewogICAgICAgIGJhbGFuY2VPZlttc2cuc2VuZGVyXSAtPSBhbW91bnQ7CiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQogICAgICAgIGVtaXQgVHJhbnNmZXIobXNnLnNlbmRlciwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKGFkZHJlc3MgZnJvbSwgYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpCiAgICAgICAgcHVibGljCiAgICAgICAgdmlydHVhbAogICAgICAgIHJldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgdWludDI1NiBhbGxvd2VkID0gYWxsb3dhbmNlW2Zyb21dW21zZy5zZW5kZXJdOwogICAgICAgIGlmIChhbGxvd2VkICE9IHR5cGUodWludDI1NikubWF4KSB7CiAgICAgICAgICAgIGFsbG93YW5jZVtmcm9tXVttc2cuc2VuZGVyXSA9IGFsbG93ZWQgLSBhbW91bnQ7CiAgICAgICAgfQogICAgICAgIGJhbGFuY2VPZltmcm9tXSAtPSBhbW91bnQ7CiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbnQoYWRkcmVzc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AogICAgICAgICAgICB3ZXRoLmJhbGFuY2VPZihhZGRyZXNzKGF0dGFja2VyKSksCiAgICAgICAgICAgIDk5ICogMWUxOCwKICAgICAgICAgICAgIldFVEggYmFsYW5jZSBvZiBhdHRhY2tlciIKICAgICAgICApOwogICAgfQp9Cg=="},{fileName:"IERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFsbG93YW5jZShhZGRyZXNzIG93bmVyLCBhZGRyZXNzIHNwZW5kZXIpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyBkc3QsIHVpbnQyNTYgYW1vdW50KSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIHNyYywgYWRkcmVzcyBkc3QsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7CgogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVzcyBpbmRleGVkIHNyYywgYWRkcmVzcyBpbmRleGVkIGRzdCwgdWludDI1NiBhbW91bnQpOwogICAgZXZlbnQgQXBwcm92YWwoCiAgICAgICA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gbXNnLnZhbHVlKTsKICAgICAgICBlbWl0IERlcG9zaXQobXNnLnNlbmRlciwgbXNnLnZhbHVlKTsKICAgIH0KCiAgICBmdW5jdGlvbiB3aXRoZHJhdyh1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgewogICAgICAgIF9idXJuKG1zZy5zZW5kZXIsIGFtb3VudCk7CiAgICAgICAgcGF5YWJsZShtc2cuc2VuZGVyKS50cmFuc2ZlcihhbW91bnQpOwogICAgICAgIGVtaXQgV2l0aGRyYXcobXNnLnNlbmRlciwgYW1vdW50KTsKICAgIH0KfQo="}],sZ=`

                                    Vulnerability

                                    +`,L0=({prev:s,next:a})=>r.jsx(A,{version:E0,title:Q0,description:T0,html:_0,prev:s,next:a,codes:U0}),O0="0.8.24",P0="WETH Permit",$0="An example of WETH permit hack",q0=[{fileName:"ERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmFic3RyYWN0IGNvbnRyYWN0IEVSQzIwIHsKICAgIGV2ZW50IFRyYW5zZmVyKGFkZHJlc3MgaW5kZXhlZCBmcm9tLCBhZGRyZXNzIGluZGV4ZWQgdG8sIHVpbnQyNTYgYW1vdW50KTsKICAgIGV2ZW50IEFwcHJvdmFsKAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCBvd25lciwgYWRkcmVzcyBpbmRleGVkIHNwZW5kZXIsIHVpbnQyNTYgYW1vdW50CiAgICApOwoKICAgIHN0cmluZyBwdWJsaWMgbmFtZTsKICAgIHN0cmluZyBwdWJsaWMgc3ltYm9sOwogICAgdWludDggcHVibGljIGltbXV0YWJsZSBkZWNpbWFsczsKCiAgICB1aW50MjU2IHB1YmxpYyB0b3RhbFN1cHBseTsKICAgIG1hcHBpbmcoYWRkcmVzcyA9PiB1aW50MjU2KSBwdWJsaWMgYmFsYW5jZU9mOwogICAgbWFwcGluZyhhZGRyZXNzID0+IG1hcHBpbmcoYWRkc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JldHVybnMgKGJvb2wpCiAgICB7CiAgICAgICAgdWludDI1NiBhbGxvd2VkID0gYWxsb3dhbmNlW2Zyb21dW21zZy5zZW5kZXJdOwogICAgICAgIGlmIChhbGxvd2VkICE9IHR5cGUodWludDI1NikubWF4KSB7CiAgICAgICAgICAgIGFsbG93YW5jZVtmcm9tXVttc2cuc2VuZGVyXSA9IGFsbG93ZWQgLSBhbW91bnQ7CiAgICAgICAgfQogICAgICAgIGJhbGFuY2VPZltmcm9tXSAtPSBhbW91bnQ7CiAgICAgICAgdW5jaGVja2VkIHsKICAgICAgICAgICAgYmFsYW5jZU9mW3RvXSArPSBhbW91bnQ7CiAgICAgICAgfQogICAgICAgIGVtaXQgVHJhbnNmZXIoZnJvbSwgdG8sIGFtb3VudCk7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9CgogICAgZnVuY3Rpb24gX21pbnQoYWRkcmVzcyB0bywgdWludDI1NiBhbW91bnQpIGludGVybmFsIHZpcnR1YWwgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IGFtb3VudDsKICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICBiYWxhbmNlT2ZbdG9dICs9IGFtb3VudDsKICAgICAgICB9CiAgICAgICAgZW1pdCBUcmFuc2ZlcihhZGRyZXNzKDApLCB0bywgYW1vdW50KTsKICAgIH0KCiAgICBmdW5jdGlvbiBfYnVybihhZGRyZXNzIGZyb20sIHVpbnQyNTYgYW1vdW50KSBpbnRlcm5hbCB2aXJ0dWFsIHsKICAgICAgICBiYWxhbmNlT2ZbZnJvbV0gLT0gYW1vdW50OwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHRvdGFsU3VwcGx5IC09IGFtb3VudDsKICAgICAgICB9CiAgICAgICAgZW1pdCBUcmFuc2Zlcihmcm9tLCBhZGRyZXNzKDApLCBhbW91bnQpOwogICAgfQp9Cg=="},{fileName:"ERC20Bank.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZX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yNTYpLm1heCk7CiAgICAgICAgYmFuay5kZXBvc2l0KDFlMTgpOwogICAgICAgIHZtLnN0b3BQcmFuaygpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3QoKSBwdWJsaWMgewogICAgICAgIHVpbnQyNTYgYmFsID0gd2V0aC5iYWxhbmNlT2YodXNlcik7CiAgICAgICAgdm0uc3RhcnRQcmFuayhhdHRhY2tlcik7CiAgICAgICAgYmFuay5kZXBvc2l0V2l0aFBlcm1pdCh1c2VyLCBhdHRhY2tlciwgYmFsLCAwLCAwLCAiIiwgIiIpOwogICAgICAgIGJhbmsud2l0aGRyYXcoYmFsKTsKICAgICAgICB2bS5zdG9wUHJhbmsoKTsKCiAgICAgICAgYXNzZXJ0RXEod2V0aC5iYWxhbmNlT2YodXNlciksIDAsICJXRVRIIGJhbGFuY2Ugb2YgdXNlciIpOwogICAgICAgIGFzc2VydEVxKAogICAgICAgICAgICB3ZXRoLmJhbGFuY2VPZihhZGRyZXNzKGF0dGFja2VyKSksCiAgICAgICAgICAgIDk5ICogMWUxOCwKICAgICAgICAgICAgIldFVEggYmFsYW5jZSBvZiBhdHRhY2tlciIKICAgICAgICApOwogICAgfQp9Cg=="},{fileName:"IERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQyNTYpOwogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKICAgIGZ1bmN0aW9uIGFsbG93YW5jZShhZGRyZXNzIG93bmVyLCBhZGRyZXNzIHNwZW5kZXIpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludDI1NiBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyBkc3QsIHVpbnQyNTYgYW1vdW50KSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIHNyYywgYWRkcmVzcyBkc3QsIHVpbnQyNTYgYW1vdW50KQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcmV0dXJucyAoYm9vbCk7CgogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVzcyBpbmRleGVkIHNyYywgYWRkcmVzcyBpbmRleGVkIGRzdCwgdWludDI1NiBhbW91bnQpOwogICAgZXZlbnQgQXBwcm92YWwoCiAgICAgICAgYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgc3BlbmRlciwgdWludDI1NiBhbW91bnQKICAgICk7Cn0K"},{fileName:"IERC20Permit.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG9ydCAiLi9JRVJDMjAuc29sIjsKCmludGVyZmFjZSBJRVJDMjBQZXJtaXQgaXMgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHBlcm1pdCgKICAgICAgICBhZGRyZXNzIG93bmVyLAogICAgICAgIGFkZHJlc3Mgc3BlbmRlciwKICAgICAgICB1aW50MjU2IHZhbHVlLAogICAgICAgIHVpbnQyNTYgZGVhZGxpbmUsCiAgICAgICAgdWludDggdiwKICAgICAgICBieXRlczMyIHIsCiAgICAgICAgYnl0ZXMzMiBzCiAgICApIGV4dGVybmFsOwp9Cg=="},{fileName:"WETH.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG9ydCAiLi9FUkMyMC5zb2wiOwoKY29udHJhY3QgV0VUSCBpcyBFUkMyMCB7CiAgICBldmVudCBEZXBvc2l0KGFkZHJlc3MgaW5kZXhlZCBhY2NvdW50LCB1aW50MjU2IGFtb3VudCk7CiAgICBldmVudCBXaXRoZHJhdyhhZGRyZXNzIGluZGV4ZWQgYWNjb3VudCwgdWludDI1NiBhbW91bnQpOwoKICAgIGNvbnN0cnVjdG9yKCkgRVJDMjAoIldyYXBwZWQgRXRoZXIiLCAiV0VUSCIsIDE4KSB7fQoKICAgIGZhbGxiYWNrKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgZGVwb3NpdCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlcG9zaXQoKSBwdWJsaWMgcGF5YWJsZSB7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgbXNnLnZhbHVlKTsKICAgICAgICBlbWl0IERlcG9zaXQobXNnLnNlbmRlciwgbXNnLnZhbHVlKTsKICAgIH0KCiAgICBmdW5jdGlvbiB3aXRoZHJhdyh1aW50MjU2IGFtb3VudCkgZXh0ZXJuYWwgewogICAgICAgIF9idXJuKG1zZy5zZW5kZXIsIGFtb3VudCk7CiAgICAgICAgcGF5YWJsZShtc2cuc2VuZGVyKS50cmFuc2ZlcihhbW91bnQpOwogICAgICAgIGVtaXQgV2l0aGRyYXcobXNnLnNlbmRlciwgYW1vdW50KTsKICAgIH0KfQo="}],sZ=`

                                    Vulnerability

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

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

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

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

                                    emit Withdraw(msg.sender, amount); } } -`,aZ=({prev:s,next:a})=>r.jsx(u,{version:O0,title:P0,description:$0,html:sZ,prev:s,next:a,codes:q0}),nZ="0.8.24",lZ="Hashing with Keccak256",pZ="Example of hashing using Keccak256 in Solidity",eZ=[{fileName:"Keccak256.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEhhc2hGdW5jdGlvbiB7CiAgICBmdW5jdGlvbiBoYXNoKHN0cmluZyBtZW1vcnkgX3RleHQsIHVpbnQyNTYgX251bSwgYWRkcmVzcyBfYWRkcikKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQoX3RleHQsIF9udW0sIF9hZGRyKSk7CiAgICB9CgogICAgLy8gRXhhbXBsZSBvZiBoYXNoIGNvbGxpc2lvbgogICAgLy8gSGFzaCBjb2xsaXNpb24gY2FuIG9jY3VyIHdoZW4geW91IHBhc3MgbW9yZSB0aGFuIG9uZSBkeW5hbWljIGRhdGEgdHlwZQogICAgLy8gdG8gYWJpLmVuY29kZVBhY2tlZC4gSW4gc3VjaCBjYXNlLCB5b3Ugc2hvdWxkIHVzZSBhYmkuZW5jb2RlIGluc3RlYWQuCiAgICBmdW5jdGlvbiBjb2xsaXNpb24oc3RyaW5nIG1lbW9yeSBfdGV4dCwgc3RyaW5nIG1lbW9yeSBfYW5vdGhlclRleHQpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzIpCiAgICB7CiAgICAgICAgLy8gZW5jb2RlUGFja2VkKEFBQSwgQkJCKSAtPiBBQUFCQkIKICAgICAgICAvLyBlbmNvZGVQYWNrZWQoQUEsIEFCQkIpIC0+IEFBQUJCQgogICAgICAgIHJldHVybiBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfdGV4dCwgX2Fub3RoZXJUZXh0KSk7CiAgICB9Cn0KCmNvbnRyYWN0IEd1ZXNzVGhlTWFnaWNXb3JkIHsKICAgIGJ5dGVzMzIgcHVibGljIGFuc3dlciA9CiAgICAgICAgMHg2MDI5OGY3OGNjMGI0NzE3MGJhNzljMTBhYTM4NTFkNzY0OGJkOTZmMmY4ZTQ2YTE5ZGJjNzc3YzM2ZmIwYzAwOwoKICAgIC8vIE1hZ2ljIHdvcmQgaXMgIlNvbGlkaXR5IgogICAgZnVuY3Rpb24gZ3Vlc3Moc3RyaW5nIG1lbW9yeSBfd29yZCkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIHJldHVybiBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfd29yZCkpID09IGFuc3dlcjsKICAgIH0KfQo="}],cZ=`

                                    keccak256 computes the Keccak-256 hash of the input.

                                    +`,aZ=({prev:s,next:a})=>r.jsx(A,{version:O0,title:P0,description:$0,html:sZ,prev:s,next:a,codes:q0}),nZ="0.8.24",lZ="Hashing with Keccak256",pZ="Example of hashing using Keccak256 in Solidity",eZ=[{fileName:"Keccak256.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEhhc2hGdW5jdGlvbiB7CiAgICBmdW5jdGlvbiBoYXNoKHN0cmluZyBtZW1vcnkgX3RleHQsIHVpbnQyNTYgX251bSwgYWRkcmVzcyBfYWRkcikKICAgICAgICBwdWJsaWMKICAgICAgICBwdXJlCiAgICAgICAgcmV0dXJucyAoYnl0ZXMzMikKICAgIHsKICAgICAgICByZXR1cm4ga2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQoX3RleHQsIF9udW0sIF9hZGRyKSk7CiAgICB9CgogICAgLy8gRXhhbXBsZSBvZiBoYXNoIGNvbGxpc2lvbgogICAgLy8gSGFzaCBjb2xsaXNpb24gY2FuIG9jY3VyIHdoZW4geW91IHBhc3MgbW9yZSB0aGFuIG9uZSBkeW5hbWljIGRhdGEgdHlwZQogICAgLy8gdG8gYWJpLmVuY29kZVBhY2tlZC4gSW4gc3VjaCBjYXNlLCB5b3Ugc2hvdWxkIHVzZSBhYmkuZW5jb2RlIGluc3RlYWQuCiAgICBmdW5jdGlvbiBjb2xsaXNpb24oc3RyaW5nIG1lbW9yeSBfdGV4dCwgc3RyaW5nIG1lbW9yeSBfYW5vdGhlclRleHQpCiAgICAgICAgcHVibGljCiAgICAgICAgcHVyZQogICAgICAgIHJldHVybnMgKGJ5dGVzMzIpCiAgICB7CiAgICAgICAgLy8gZW5jb2RlUGFja2VkKEFBQSwgQkJCKSAtPiBBQUFCQkIKICAgICAgICAvLyBlbmNvZGVQYWNrZWQoQUEsIEFCQkIpIC0+IEFBQUJCQgogICAgICAgIHJldHVybiBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfdGV4dCwgX2Fub3RoZXJUZXh0KSk7CiAgICB9Cn0KCmNvbnRyYWN0IEd1ZXNzVGhlTWFnaWNXb3JkIHsKICAgIGJ5dGVzMzIgcHVibGljIGFuc3dlciA9CiAgICAgICAgMHg2MDI5OGY3OGNjMGI0NzE3MGJhNzljMTBhYTM4NTFkNzY0OGJkOTZmMmY4ZTQ2YTE5ZGJjNzc3YzM2ZmIwYzAwOwoKICAgIC8vIE1hZ2ljIHdvcmQgaXMgIlNvbGlkaXR5IgogICAgZnVuY3Rpb24gZ3Vlc3Moc3RyaW5nIG1lbW9yeSBfd29yZCkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIHJldHVybiBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfd29yZCkpID09IGFuc3dlcjsKICAgIH0KfQo="}],cZ=`

                                    keccak256 computes the Keccak-256 hash of the input.

                                    Some use cases are:

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

                                      return keccak256(abi.encodePacked(_word)) == answer; } } -`,tZ=({prev:s,next:a})=>r.jsx(u,{version:nZ,title:lZ,description:pZ,html:cZ,prev:s,next:a,codes:eZ}),oZ="0.8.24",rZ="Hello World",iZ="Hello world in Solidity",gZ=[{fileName:"HelloWorld.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVAovLyBjb21waWxlciB2ZXJzaW9uIG11c3QgYmUgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvIDAuOC4yNCBhbmQgbGVzcyB0aGFuIDAuOS4wCnByYWdtYSBzb2xpZGl0eSBeMC44LjI0OwoKY29udHJhY3QgSGVsbG9Xb3JsZCB7CiAgICBzdHJpbmcgcHVibGljIGdyZWV0ID0gIkhlbGxvIFdvcmxkISI7Cn0K"}],hZ=`

                                      pragma specifies the compiler version of Solidity.

                                      +`,tZ=({prev:s,next:a})=>r.jsx(A,{version:nZ,title:lZ,description:pZ,html:cZ,prev:s,next:a,codes:eZ}),oZ="0.8.24",rZ="Hello World",iZ="Hello world in Solidity",gZ=[{fileName:"HelloWorld.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVAovLyBjb21waWxlciB2ZXJzaW9uIG11c3QgYmUgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvIDAuOC4yNCBhbmQgbGVzcyB0aGFuIDAuOS4wCnByYWdtYSBzb2xpZGl0eSBeMC44LjI0OwoKY29udHJhY3QgSGVsbG9Xb3JsZCB7CiAgICBzdHJpbmcgcHVibGljIGdyZWV0ID0gIkhlbGxvIFdvcmxkISI7Cn0K"}],hZ=`

                                      pragma specifies the compiler version of Solidity.

                                      // SPDX-License-Identifier: MIT
                                       // compiler version must be greater than or equal to 0.8.24 and less than 0.9.0
                                       pragma solidity ^0.8.24;
                                      @@ -10753,7 +10753,7 @@ if the signer's intention was to approve a transaction once.

                                      contract HelloWorld { string public greet = "Hello World!"; } -
                                      `,IZ=({prev:s,next:a})=>r.jsx(u,{version:oZ,title:rZ,description:iZ,html:hZ,prev:s,next:a,codes:gZ}),dZ="0.8.24",CZ="If / Else",jZ="If / Else conditional statement in Solidity",uZ=[{fileName:"IfElse.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IElmRWxzZSB7CiAgICBmdW5jdGlvbiBmb28odWludDI1NiB4KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgaWYgKHggPCAxMCkgewogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9IGVsc2UgaWYgKHggPCAyMCkgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICByZXR1cm4gMjsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVybmFyeSh1aW50MjU2IF94KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgLy8gaWYgKF94IDwgMTApIHsKICAgICAgICAvLyAgICAgcmV0dXJuIDE7CiAgICAgICAgLy8gfQogICAgICAgIC8vIHJldHVybiAyOwoKICAgICAgICAvLyBzaG9ydGhhbmQgd2F5IHRvIHdyaXRlIGlmIC8gZWxzZSBzdGF0ZW1lbnQKICAgICAgICAvLyB0aGUgIj8iIG9wZXJhdG9yIGlzIGNhbGxlZCB0aGUgdGVybmFyeSBvcGVyYXRvcgogICAgICAgIHJldHVybiBfeCA8IDEwID8gMSA6IDI7CiAgICB9Cn0K"}],AZ=`

                                      Solidity supports conditional statements if, else if and else.

                                      +`,IZ=({prev:s,next:a})=>r.jsx(A,{version:oZ,title:rZ,description:iZ,html:hZ,prev:s,next:a,codes:gZ}),dZ="0.8.24",CZ="If / Else",jZ="If / Else conditional statement in Solidity",AZ=[{fileName:"IfElse.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IElmRWxzZSB7CiAgICBmdW5jdGlvbiBmb28odWludDI1NiB4KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgaWYgKHggPCAxMCkgewogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9IGVsc2UgaWYgKHggPCAyMCkgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICByZXR1cm4gMjsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVybmFyeSh1aW50MjU2IF94KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgLy8gaWYgKF94IDwgMTApIHsKICAgICAgICAvLyAgICAgcmV0dXJuIDE7CiAgICAgICAgLy8gfQogICAgICAgIC8vIHJldHVybiAyOwoKICAgICAgICAvLyBzaG9ydGhhbmQgd2F5IHRvIHdyaXRlIGlmIC8gZWxzZSBzdGF0ZW1lbnQKICAgICAgICAvLyB0aGUgIj8iIG9wZXJhdG9yIGlzIGNhbGxlZCB0aGUgdGVybmFyeSBvcGVyYXRvcgogICAgICAgIHJldHVybiBfeCA8IDEwID8gMSA6IDI7CiAgICB9Cn0K"}],uZ=`

                                      Solidity supports conditional statements if, else if and else.

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

                                      return _x < 10 ? 1 : 2; } } -
                                      `,yZ=({prev:s,next:a})=>r.jsx(u,{version:dZ,title:CZ,description:jZ,html:AZ,prev:s,next:a,codes:uZ}),mZ="0.8.24",bZ="Immutable",wZ="Immutable variables",kZ=[{fileName:"Immutable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEltbXV0YWJsZSB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBpbW11dGFibGUgTVlfQUREUkVTUzsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBNWV9VSU5UOwoKICAgIGNvbnN0cnVjdG9yKHVpbnQyNTYgX215VWludCkgewogICAgICAgIE1ZX0FERFJFU1MgPSBtc2cuc2VuZGVyOwogICAgICAgIE1ZX1VJTlQgPSBfbXlVaW50OwogICAgfQp9Cg=="}],ZZ=`

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

                                      +`,yZ=({prev:s,next:a})=>r.jsx(A,{version:dZ,title:CZ,description:jZ,html:uZ,prev:s,next:a,codes:AZ}),mZ="0.8.24",bZ="Immutable",wZ="Immutable variables",kZ=[{fileName:"Immutable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEltbXV0YWJsZSB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBpbW11dGFibGUgTVlfQUREUkVTUzsKICAgIHVpbnQyNTYgcHVibGljIGltbXV0YWJsZSBNWV9VSU5UOwoKICAgIGNvbnN0cnVjdG9yKHVpbnQyNTYgX215VWludCkgewogICAgICAgIE1ZX0FERFJFU1MgPSBtc2cuc2VuZGVyOwogICAgICAgIE1ZX1VJTlQgPSBfbXlVaW50OwogICAgfQp9Cg=="}],ZZ=`

                                      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.24;
                                       
                                      @@ -10793,7 +10793,7 @@ if the signer's intention was to approve a transaction once.

                                      MY_UINT = _myUint; } } -
                                      `,WZ=({prev:s,next:a})=>r.jsx(u,{version:mZ,title:bZ,description:wZ,html:ZZ,prev:s,next:a,codes:kZ}),BZ="0.8.24",GZ="Import",VZ="Learn how to import other Solidity files",fZ=[{fileName:"Foo.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCnN0cnVjdCBQb2ludCB7CiAgICB1aW50MjU2IHg7CiAgICB1aW50MjU2IHk7Cn0KCmVycm9yIFVuYXV0aG9yaXplZChhZGRyZXNzIGNhbGxlcik7CgpmdW5jdGlvbiBhZGQodWludDI1NiB4LCB1aW50MjU2IHkpIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgcmV0dXJuIHggKyB5Owp9Cgpjb250cmFjdCBGb28gewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkZvbyI7Cn0K"},{fileName:"Import.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIGltcG9ydCBGb28uc29sIGZyb20gY3VycmVudCBkaXJlY3RvcnkKaW1wb3J0ICIuL0Zvby5zb2wiOwoKLy8gaW1wb3J0IHtzeW1ib2wxIGFzIGFsaWFzLCBzeW1ib2wyfSBmcm9tICJmaWxlbmFtZSI7CmltcG9ydCB7VW5hdXRob3JpemVkLCBhZGQgYXMgZnVuYywgUG9pbnR9IGZyb20gIi4vRm9vLnNvbCI7Cgpjb250cmFjdCBJbXBvcnQgewogICAgLy8gSW5pdGlhbGl6ZSBGb28uc29sCiAgICBGb28gcHVibGljIGZvbyA9IG5ldyBGb28oKTsKCiAgICAvLyBUZXN0IEZvby5zb2wgYnkgZ2V0dGluZyBpdCdzIG5hbWUuCiAgICBmdW5jdGlvbiBnZXRGb29OYW1lKCkgcHVibGljIHZpZXcgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiBmb28ubmFtZSgpOwogICAgfQp9Cg=="}],YZ=`

                                      You can import local and external files in Solidity.

                                      +`,WZ=({prev:s,next:a})=>r.jsx(A,{version:mZ,title:bZ,description:wZ,html:ZZ,prev:s,next:a,codes:kZ}),BZ="0.8.24",GZ="Import",VZ="Learn how to import other Solidity files",fZ=[{fileName:"Foo.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCnN0cnVjdCBQb2ludCB7CiAgICB1aW50MjU2IHg7CiAgICB1aW50MjU2IHk7Cn0KCmVycm9yIFVuYXV0aG9yaXplZChhZGRyZXNzIGNhbGxlcik7CgpmdW5jdGlvbiBhZGQodWludDI1NiB4LCB1aW50MjU2IHkpIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgcmV0dXJuIHggKyB5Owp9Cgpjb250cmFjdCBGb28gewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkZvbyI7Cn0K"},{fileName:"Import.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIGltcG9ydCBGb28uc29sIGZyb20gY3VycmVudCBkaXJlY3RvcnkKaW1wb3J0ICIuL0Zvby5zb2wiOwoKLy8gaW1wb3J0IHtzeW1ib2wxIGFzIGFsaWFzLCBzeW1ib2wyfSBmcm9tICJmaWxlbmFtZSI7CmltcG9ydCB7VW5hdXRob3JpemVkLCBhZGQgYXMgZnVuYywgUG9pbnR9IGZyb20gIi4vRm9vLnNvbCI7Cgpjb250cmFjdCBJbXBvcnQgewogICAgLy8gSW5pdGlhbGl6ZSBGb28uc29sCiAgICBGb28gcHVibGljIGZvbyA9IG5ldyBGb28oKTsKCiAgICAvLyBUZXN0IEZvby5zb2wgYnkgZ2V0dGluZyBpdCdzIG5hbWUuCiAgICBmdW5jdGlvbiBnZXRGb29OYW1lKCkgcHVibGljIHZpZXcgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiBmb28ubmFtZSgpOwogICAgfQp9Cg=="}],YZ=`

                                      You can import local and external files in Solidity.

                                      Local

                                      Here is our folder structure.

                                      ├── Import.sol
                                      @@ -10843,7 +10843,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"; -
                                      `,RZ=({prev:s,next:a})=>r.jsx(u,{version:BZ,title:GZ,description:VZ,html:YZ,prev:s,next:a,codes:fZ}),XZ="0.8.24",vZ="Inheritance",NZ="Example of inheritance in Solidity",HZ=[{fileName:"Inheritance.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qIEdyYXBoIG9mIGluaGVyaXRhbmNlCiAgICBBCiAgIC8gXAogIEIgICBDCiAvIFwgLwpGICBELEUKCiovCgpjb250cmFjdCBBIHsKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQSI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBpbmhlcml0IG90aGVyIGNvbnRyYWN0cyBieSB1c2luZyB0aGUga2V5d29yZCAnaXMnLgpjb250cmFjdCBCIGlzIEEgewogICAgLy8gT3ZlcnJpZGUgQS5mb28oKQogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIHB1cmUgdmlydHVhbCBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuICJCIjsKICAgIH0KfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIE92ZXJyaWRlIEEuZm9vKCkKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlI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mVk4oCdLgovLyBTd2FwcGluZyB0aGUgb3JkZXIgb2YgQSBhbmQgQiB3aWxsIHRocm93IGEgY29tcGlsYXRpb24gZXJyb3IuCmNvbnRyYWN0IEYgaXMgQSwgQiB7CiAgICBmdW5jdGlvbiBmb28oKSBwdWJsaWMgcHVyZSBvdmVycmlkZShBLCBCKSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIHN1cGVyLmZvbygpOwogICAgfQp9Cg=="}],FZ=`

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

                                      +`,RZ=({prev:s,next:a})=>r.jsx(A,{version:BZ,title:GZ,description:VZ,html:YZ,prev:s,next:a,codes:fZ}),XZ="0.8.24",vZ="Inheritance",NZ="Example of inheritance in Solidity",HZ=[{fileName:"Inheritance.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qIEdyYXBoIG9mIGluaGVyaXRhbmNlCiAgICBBCiAgIC8gXAogIEIgICBDCiAvIFwgLwpGICBELEUKCiovCgpjb250cmFjdCBBIHsKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQSI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBpbmhlcml0IG90aGVyIGNvbnRyYWN0cyBieSB1c2luZyB0aGUga2V5d29yZCAnaXMnLgpjb250cmFjdCBCIGlzIEEgewogICAgLy8gT3ZlcnJpZGUgQS5mb28oKQogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIHB1cmUgdmlydHVhbCBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuICJCIjsKICAgIH0KfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIE92ZXJyaWRlIEEuZm9vKCk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dCBiYXNlLWxpa2XigJ0gdG8g4oCcbW9zdCBkZXJpdmVk4oCdLgovLyBTd2FwcGluZyB0aGUgb3JkZXIgb2YgQSBhbmQgQiB3aWxsIHRocm93IGEgY29tcGlsYXRpb24gZXJyb3IuCmNvbnRyYWN0IEYgaXMgQSwgQiB7CiAgICBmdW5jdGlvbiBmb28oKSBwdWJsaWMgcHVyZSBvdmVycmlkZShBLCBCKSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIHN1cGVyLmZvbygpOwogICAgfQp9Cg=="}],FZ=`

                                      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.

                                      @@ -10909,7 +10909,7 @@ F D,E return super.foo(); } } -`,KZ=({prev:s,next:a})=>r.jsx(u,{version:XZ,title:vZ,description:NZ,html:FZ,prev:s,next:a,codes:HZ}),MZ="0.8.24",SZ="Interface",xZ="An example of interface in Solidity",JZ=[{fileName:"Interface.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWwgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9Cn0KCmludGVyZmFjZSBJQ291bnRlciB7CiAgICBmdW5jdGlvbiBjb3VudCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IE15Q29udHJhY3QgewogICAgZnVuY3Rpb24gaW5jcmVtZW50Q291bnRlcihhZGRyZXNzIF9jb3VudGVyKSBleHRlcm5hbCB7CiAgICAgICAgSUNvdW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BWMkZhY3RvcnkoZmFjdG9yeSkuZ2V0UGFpcihkYWksIHdldGgpOwogICAgICAgICh1aW50MjU2IHJlc2VydmUwLCB1aW50MjU2IHJlc2VydmUxLCkgPQogICAgICAgICAgICBVbmlzd2FwVjJQYWlyKHBhaXIpLmdldFJlc2VydmVzKCk7CiAgICAgICAgcmV0dXJuIChyZXNlcnZlMCwgcmVzZXJ2ZTEpOwogICAgfQp9Cg=="}],zZ=`

                                      You can interact with other contracts by declaring an Interface.

                                      +`,KZ=({prev:s,next:a})=>r.jsx(A,{version:XZ,title:vZ,description:NZ,html:FZ,prev:s,next:a,codes:HZ}),MZ="0.8.24",SZ="Interface",xZ="An example of interface in Solidity",JZ=[{fileName:"Interface.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludDI1NiBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWwgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9Cn0KCmludGVyZmFjZSBJQ291bnRlciB7CiAgICBmdW5jdGlvbiBjb3VudCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IE15Q29udHJhY3QgewogICAgZnVuY3Rpb24gaW5jcmVtZW50Q291bnRlcihhZGRyZXNzIF9jb3VudGVyKSBleHRlcm5hbCB7CiAgICAgICAgSUNvdW50ZXIoX2NvdW50ZXIpLmluY3JlbWVudCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldENvdW50KGFkZHJlc3MgX2NvdW50ZXIpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBJQ291bnRlcihfY291bnRlcikuY291bnQoKTsKICAgIH0Kf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NlcnZlMCwgcmVzZXJ2ZTEpOwogICAgfQp9Cg=="}],zZ=`

                                      You can interact with other contracts by declaring an Interface.

                                      Interface

                                      • cannot have any functions implemented
                                      • @@ -10972,7 +10972,7 @@ F D,E return (reserve0, reserve1); } } -`,DZ=({prev:s,next:a})=>r.jsx(u,{version:MZ,title:SZ,description:xZ,html:zZ,prev:s,next:a,codes:JZ}),EZ="0.8.24",QZ="Library",TZ="Example of how to write and use libraries in your Solidity code",UZ=[{fileName:"Library.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmxpYnJhcnkgTWF0aCB7CiAgICBmdW5jdGlvbiBzcXJ0KHVpbnQyNTYgeSkgaW50ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2IHopIHsKICAgICAgICBpZiAoeSA+IDMpIHsKICAgICAgICAgICAgeiA9IHk7CiAgICAgICAgICAgIHVpbnQyNTYgeCA9IHkgLyAyICsgMTsKICAgICAgICAgICAgd2hpbGUgKHggPCB6KSB7CiAgICAgICAgICAgICAgICB6ID0geDsKICAgICAgICAgICAgICAgIHggPSAoeSAvIHggKyB4KSAvIDI7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgaWYgKHkgIT0gMCkgewogICAgICAgICAgICB6ID0gMTsKICAgICAgICB9CiAgICAgICAgLy8gZWxzZSB6ID0gMCAoZGVmYXVsdCB2YWx1ZSkKICAgIH0KfQoKY29udHJhY3QgVGVzdE1hdGggewogICAgZnVuY3Rpb24gdGVzdFNxdWFyZVJvb3QodWludDI1NiB4KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIE1hdGguc3FydCh4KTsKICAgIH0KfQoKLy8gQXJyYXkgZnVuY3Rpb24gdG8gZGVsZXRlIGVsZW1lbnQgYXQgaW5kZXggYW5kIHJlLW9yZ2FuaXplIHRoZSBhcnJheQovLyBzbyB0aGF0IHRoZXJlIGFyZSBubyBnYXBzIGJldHdlZW4gdGhlIGVsZW1lbnRzLgpsaWJyYXJ5IEFycmF5IHsKICAgIGZ1bmN0aW9uIHJlbW92ZSh1aW50MjU2W10gc3RvcmFnZSBhcnIsIHVpbnQyNTYgaW5kZXgpIHB1YmxpYyB7CiAgICAgICAgLy8gTW92ZSB0aGUgbGFzdCBlbGVtZW50IGludG8gdGhlIHBsYWNlIHRvIGRlbGV0ZQogICAgICAgIHJlcXVpcmUoYXJyLmxlbmd0aCA+IDAsICJDYW4ndCByZW1vdmUgZnJvbSBlbXB0eSBhcnJheSIpOwogICAgICAgIGFycltpbmRleF0gPSBhcnJbYXJyLmxlbmd0aCAtIDFdOwogICAgICAgIGFyci5wb3AoKTsKICAgIH0KfQoKY29udHJhY3QgVGVzdEFycmF5IHsKICAgIHVzaW5nIEFycmF5IGZvciB1aW50MjU2W107CgogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CgogICAgZnVuY3Rpb24gdGVzdEFycmF5UmVtb3ZlKCkgcHVibGljIHsKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCAzOyBpKyspIHsKICAgICAgICAgICAgYXJyLnB1c2goaSk7CiAgICAgICAgfQoKICAgICAgICBhcnIucmVtb3ZlKDEpOwoKICAgICAgICBhc3NlcnQoYXJyLmxlbmd0aCA9PSAyKTsKICAgICAgICBhc3NlcnQoYXJyWzBdID09IDApOwogICAgICAgIGFzc2VydChhcnJbMV0gPT0gMik7CiAgICB9Cn0K"}],_Z=`

                                        Libraries are similar to contracts, but you can't declare any state variable and +`,DZ=({prev:s,next:a})=>r.jsx(A,{version:MZ,title:SZ,description:xZ,html:zZ,prev:s,next:a,codes:JZ}),EZ="0.8.24",QZ="Library",TZ="Example of how to write and use libraries in your Solidity code",UZ=[{fileName:"Library.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmxp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0gPSBhcnJbYXJyLmxlbmd0aCAtIDFdOwogICAgICAgIGFyci5wb3AoKTsKICAgIH0KfQoKY29udHJhY3QgVGVzdEFycmF5IHsKICAgIHVzaW5nIEFycmF5IGZvciB1aW50MjU2W107CgogICAgdWludDI1NltdIHB1YmxpYyBhcnI7CgogICAgZnVuY3Rpb24gdGVzdEFycmF5UmVtb3ZlKCkgcHVibGljIHsKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCAzOyBpKyspIHsKICAgICAgICAgICAgYXJyLnB1c2goaSk7CiAgICAgICAgfQoKICAgICAgICBhcnIucmVtb3ZlKDEpOwoKICAgICAgICBhc3NlcnQoYXJyLmxlbmd0aCA9PSAyKTsKICAgICAgICBhc3NlcnQoYXJyWzBdID09IDApOwogICAgICAgIGFzc2VydChhcnJbMV0gPT0gMik7CiAgICB9Cn0K"}],_Z=`

                                        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.

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

                                        assert(arr[1] == 2); } } -`,LZ=({prev:s,next:a})=>r.jsx(u,{version:EZ,title:QZ,description:TZ,html:_Z,prev:s,next:a,codes:UZ}),OZ="0.8.24",PZ="For and While Loop",$Z="Example of for and while loop in Solidity",qZ=[{fileName:"Loop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IExvb3AgewogICAgZnVuY3Rpb24gbG9vcCgpIHB1YmxpYyB7CiAgICAgICAgLy8gZm9yIGxvb3AKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCAxMDsgaSsrKSB7CiAgICAgICAgICAgIGlmIChpID09IDMpIHsKICAgICAgICAgICAgICAgIC8vIFNraXAgdG8gbmV4dCBpdGVyYXRpb24gd2l0aCBjb250aW51ZQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGkgPT0gNSkgewogICAgICAgICAgICAgICAgLy8gRXhpdCBsb29wIHdpdGggYnJlYWsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICAvLyB3aGlsZSBsb29wCiAgICAgICAgdWludDI1NiBqOwogICAgICAgIHdoaWxlIChqIDwgMTApIHsKICAgICAgICAgICAgaisrOwogICAgICAgIH0KICAgIH0KfQo="}],sW=`

                                        Solidity supports for, while, and do while loops.

                                        +`,LZ=({prev:s,next:a})=>r.jsx(A,{version:EZ,title:QZ,description:TZ,html:_Z,prev:s,next:a,codes:UZ}),OZ="0.8.24",PZ="For and While Loop",$Z="Example of for and while loop in Solidity",qZ=[{fileName:"Loop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IExvb3AgewogICAgZnVuY3Rpb24gbG9vcCgpIHB1YmxpYyB7CiAgICAgICAgLy8gZm9yIGxvb3AKICAgICAgICBmb3IgKHVpbnQyNTYgaSA9IDA7IGkgPCAxMDsgaSsrKSB7CiAgICAgICAgICAgIGlmIChpID09IDMpIHsKICAgICAgICAgICAgICAgIC8vIFNraXAgdG8gbmV4dCBpdGVyYXRpb24gd2l0aCBjb250aW51ZQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGkgPT0gNSkgewogICAgICAgICAgICAgICAgLy8gRXhpdCBsb29wIHdpdGggYnJlYWsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICAvLyB3aGlsZSBsb29wCiAgICAgICAgdWludDI1NiBqOwogICAgICAgIHdoaWxlIChqIDwgMTApIHsKICAgICAgICAgICAgaisrOwogICAgICAgIH0KICAgIH0KfQo="}],sW=`

                                        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
                                        @@ -11056,7 +11056,7 @@ you can't send ether.

                                        } } } -
                                        `,aW=({prev:s,next:a})=>r.jsx(u,{version:OZ,title:PZ,description:$Z,html:sW,prev:s,next:a,codes:qZ}),nW="0.8.24",lW="Mapping",pW="Example of using mapping in Solidity",eW=[{fileName:"Mapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE1hcHBpbmcgewogICAgLy8gTWFwcGluZyBmcm9tIGFkZHJlc3MgdG8gdWludAogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQyNTYpIHB1YmxpYyBteU1hcDsKCiAgICBmdW5jdGlvbiBnZXQoYWRkcmVzcyBfYWRkcikgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIC8vIE1hcHBpbmcgYWx3YXlzIHJldHVybnMgYSB2YWx1ZS4KICAgICAgICAvLyBJZiB0aGUgdmFsdWUgd2FzIG5ldmVyIHNldCwgaXQgd2lsbCByZXR1cm4gdGhlIGRlZmF1bHQgdmFsdWUuCiAgICAgICAgcmV0dXJuIG15TWFwW19hZGRyXTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoYWRkcmVzcyBfYWRkciwgdWludDI1NiBfaSkgcHVibGljIHsKICAgICAgICAvLyBVcGRhdGUgdGhlIHZhbHVlIGF0IHRoaXMgYWRkcmVzcwogICAgICAgIG15TWFwW19hZGRyXSA9IF9pOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyKSBwdWJsaWMgewogICAgICAgIC8vIFJlc2V0IHRoZSB2YWx1ZSB0byB0aGUgZGVmYXVsdCB2YWx1ZS4KICAgICAgICBkZWxldGUgbXlNYXBbX2FkZHJdOwogICAgfQp9Cgpjb250cmFjdCBOZXN0ZWRNYXBwaW5nIHsKICAgIC8vIE5lc3RlZCBtYXBwaW5nIChtYXBwaW5nIGZyb20gYWRkcmVzcyB0byBhbm90aGVyIG1hcHBpbmcpCiAgICBtYXBwaW5nKGFkZHJlc3MgPT4gbWFwcGluZyh1aW50MjU2ID0+IGJvb2wpKSBwdWJsaWMgbmVzdGVkOwoKICAgIGZ1bmN0aW9uIGdldChhZGRyZXNzIF9hZGRyMSwgdWludDI1NiBfaSkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIC8vIFlvdSBjYW4gZ2V0IHZhbHVlcyBmcm9tIGEgbmVzdGVkIG1hcHBpbmcKICAgICAgICAvLyBldmVuIHdoZW4gaXQgaXMgbm90IGluaXRpYWxpemVkCiAgICAgICAgcmV0dXJuIG5lc3RlZFtfYWRkcjFdW19pXTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoYWRkcmVzcyBfYWRkcjEsIHVpbnQyNTYgX2ksIGJvb2wgX2JvbykgcHVibGljIHsKICAgICAgICBuZXN0ZWRbX2FkZHIxXVtfaV0gPSBfYm9vOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyMSwgdWludDI1NiBfaSkgcHVibGljIHsKICAgICAgICBkZWxldGUgbmVzdGVkW19hZGRyMV1bX2ldOwogICAgfQp9Cg=="}],cW=`

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

                                        +`,aW=({prev:s,next:a})=>r.jsx(A,{version:OZ,title:PZ,description:$Z,html:sW,prev:s,next:a,codes:qZ}),nW="0.8.24",lW="Mapping",pW="Example of using mapping in Solidity",eW=[{fileName:"Mapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IE1hcHBpbmcgewogICAgLy8gTWFwcGluZyBmcm9tIGF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ICAvLyBldmVuIHdoZW4gaXQgaXMgbm90IGluaXRpYWxpemVkCiAgICAgICAgcmV0dXJuIG5lc3RlZFtfYWRkcjFdW19pXTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoYWRkcmVzcyBfYWRkcjEsIHVpbnQyNTYgX2ksIGJvb2wgX2JvbykgcHVibGljIHsKICAgICAgICBuZXN0ZWRbX2FkZHIxXVtfaV0gPSBfYm9vOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyMSwgdWludDI1NiBfaSkgcHVibGljIHsKICAgICAgICBkZWxldGUgbmVzdGVkW19hZGRyMV1bX2ldOwogICAgfQp9Cg=="}],cW=`

                                        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.

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

                                        delete nested[_addr1][_i]; } } -`,tW=({prev:s,next:a})=>r.jsx(u,{version:nW,title:lW,description:pW,html:cW,prev:s,next:a,codes:eW}),oW="0.8.24",rW="Contract that Creates other Contracts",iW="Learn how to create new contracts from inside of a contract with Solidity",gW=[{fileName:"NewContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENhciB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIHN0cmluZyBwdWJsaWMgbW9kZWw7CiAgICBhZGRyZXNzIHB1YmxpYyBjYXJBZGRyOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX293bmVyLCBzdHJpbmcgbWVtb3J5IF9tb2RlbCkgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICAgICAgbW9kZWwgPSBfbW9kZWw7CiAgICAgICAgY2FyQWRkciA9IGFkZHJlc3ModGhpcyk7CiAgICB9Cn0KCmNvb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W50MjU2IF9pbmRleCkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoCiAgICAgICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgICAgIHN0cmluZyBtZW1vcnkgbW9kZWwsCiAgICAgICAgICAgIGFkZHJlc3MgY2FyQWRkciwKICAgICAgICAgICAgdWludDI1NiBiYWxhbmNlCiAgICAgICAgKQogICAgewogICAgICAgIENhciBjYXIgPSBjYXJzW19pbmRleF07CgogICAgICAgIHJldHVybiAoY2FyLm93bmVyKCksIGNhci5tb2RlbCgpLCBjYXIuY2FyQWRkcigpLCBhZGRyZXNzKGNhcikuYmFsYW5jZSk7CiAgICB9Cn0K"}],hW=`

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

                                        +`,tW=({prev:s,next:a})=>r.jsx(A,{version:nW,title:lW,description:pW,html:cW,prev:s,next:a,codes:eW}),oW="0.8.24",rW="Contract that Creates other Contracts",iW="Learn how to create new contracts from inside of a contract with Solidity",gW=[{fileName:"NewContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IENhciB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIHN0cmluZyBwdWJsaWMgbW9kZWw7CiAgICBhZGRyZXNzIHB1YmxpYyBjYXJBZGRyOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX293bmVyLCBzdHJpbmcgbWVtb3J5IF9tb2RlbCkgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICAgICAgbW9kZWwgPSBfbW9kZWw7CiAgICAgICAgY2FyQWRkciA9IGFkZHJlc3ModGhpcyk7CiAgICB9Cn0KCmNvbnRyYWN0IENhckZhY3RvcnkgewogICAgQ2FyW10gcHVibGljIGNhcnM7CgogICAgZnVuY3Rpb24gY3J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iAgICAgICAgICAgIGFkZHJlc3Mgb3duZXIsCiAgICAgICAgICAgIHN0cmluZyBtZW1vcnkgbW9kZWwsCiAgICAgICAgICAgIGFkZHJlc3MgY2FyQWRkciwKICAgICAgICAgICAgdWludDI1NiBiYWxhbmNlCiAgICAgICAgKQogICAgewogICAgICAgIENhciBjYXIgPSBjYXJzW19pbmRleF07CgogICAgICAgIHJldHVybiAoY2FyLm93bmVyKCksIGNhci5tb2RlbCgpLCBjYXIuY2FyQWRkcigpLCBhZGRyZXNzKGNhcikuYmFsYW5jZSk7CiAgICB9Cn0K"}],hW=`

                                        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.24;
                                         
                                        @@ -11165,7 +11165,7 @@ you can't send ether.

                                        return (car.owner(), car.model(), car.carAddr(), address(car).balance); } } -
                                        `,IW=({prev:s,next:a})=>r.jsx(u,{version:oW,title:rW,description:iW,html:hW,prev:s,next:a,codes:gW}),dW="0.8.24",CW="Payable",jW="An example of how to use the keyword payable in Solidity",uW=[{fileName:"Payable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFBheWFibGUgewogICAgLy8gUGF5YWJsZSBhZGRyZXNzIGNhbiBzZW5kIEV0aGVyIHZpYSB0cmFuc2ZlciBvciBzZW5kCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIG93bmVyOwoKICAgIC8vIFBheWFibGUgY29uc3RydWN0b3IgY2FuIHJlY2VpdmUgRXRoZXIKICAgIGNvbnN0cnVjdG9yKCkgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGRlcG9zaXQgRXRoZXIgaW50byB0aGlzIGNvbnRyYWN0LgogICAgLy8gQ2F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90ZSB0aGF0ICJ0byIgaXMgZGVjbGFyZWQgYXMgcGF5YWJsZQogICAgICAgIChib29sIHN1Y2Nlc3MsKSA9IF90by5jYWxse3ZhbHVlOiBfYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzdWNjZXNzLCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KfQo="}],AW=`

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

                                        +`,IW=({prev:s,next:a})=>r.jsx(A,{version:oW,title:rW,description:iW,html:hW,prev:s,next:a,codes:gW}),dW="0.8.24",CW="Payable",jW="An example of how to use the keyword payable in Solidity",AW=[{fileName:"Payable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFBheWFibGUgewogICAgLy8gUGF5YWJsZSBhZGRyZXNzIGNhbiBzZW5kIEV0aGVyIHZpYSB0cmFuc2ZlciBvciBzZW5kCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIG93bmVyOwoKICAgIC8vIFBheWFibGUgY29uc3RydWN0b3IgY2FuIHJlY2VpdmUgRXRoZXIKICAgIGNvbnN0cnVjdG9yKCkgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGRlcG9zaXQgRXRoZXIgaW50byB0aGlzIGNvbnRyYWN0LgogICAgLy8gQ2FsbCB0aGlzIGZ1bmN0aW9uIGFsb25nIHdpdGggc29tZSBFdGhlci4KICAgIC8vIFRoZSBiYWxhbmNlIG9mIHRoaXMgY29udHJhY3Qgd2lsbCBiZSBhdXRvbWF0aWNhbGx5IHVwZGF0ZWQuCiAgICBmdW5jdGlvbiBkZXBvc2l0KCkgcHVibGljIHBheWFibGUge30KCiAgICAvLyBDYWxsIHRoaXMgZnVuY3Rpb24gYWxvbmcgd2l0aCBzb21lIEV0aGVyLgogICAgLy8gVGhlIGZ1bmN0aW9uIHdpbGwgdGhyb3cgYW4gZXJyb3Igc2luY2UgdGhpcyBmdW5jdGlvbiBpcyBub3QgcGF5YWJsZS4KICAgIGZ1bmN0aW9uIG5vdFBheWFibGUoKSBwdWJsaWMge30KCiAgICAvLyBGdW5jdGlvbiB0byB3aXRoZHJhdyBhbGwgRXRoZXIgZnJvbSB0aGlzIGNvbnRyYWN0LgogICAgZnVuY3Rpb24gd2l0aGRyYXcoKSBwdWJsaWMgewogICAgICAgIC8vIGdldCB0aGUgYW1vdW50IG9mIEV0aGVyIHN0b3JlZCBpbiB0aGlzIGNvbnRyYWN0CiAgICAgICAgdWludDI1NiBhbW91bnQgPSBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CgogICAgICAgIC8vIHNlbmQgYWxsIEV0aGVyIHRvIG93bmVyCiAgICAgICAgKGJvb2wgc3VjY2VzcywpID0gb3duZXIuY2FsbHt2YWx1ZTogYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzdWNjZXNzLCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KCiAgICAvLyBGdW5jdGlvbiB0byB0cmFuc2ZlciBFdGhlciBmcm9tIHRoaXMgY29udHJhY3QgdG8gYWRkcmVzcyBmcm9tIGlucHV0CiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIHBheWFibGUgX3RvLCB1aW50MjU2IF9hbW91bnQpIHB1YmxpYyB7CiAgICAgICAgLy8gTm90ZSB0aGF0ICJ0byIgaXMgZGVjbGFyZWQgYXMgcGF5YWJsZQogICAgICAgIChib29sIHN1Y2Nlc3MsKSA9IF90by5jYWxse3ZhbHVlOiBfYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzdWNjZXNzLCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KfQo="}],uW=`

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

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

                                        require(success, "Failed to send Ether"); } } -
                                        `,yW=({prev:s,next:a})=>r.jsx(u,{version:dW,title:CW,description:jW,html:AW,prev:s,next:a,codes:uW}),mW="0.8.24",bW="Primitive Data Types",wW="Primitive data types",kW=[{fileName:"Primitives.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFByaW1pdGl2ZXMgewogICAgYm9vbCBwdWJsaWMgYm9vID0gdHJ1ZTsKCiAgICAvKgogICAgdWludCBzdGFuZHMgZm9yIHVuc2lnbmVkIGludGVnZXIsIG1lYW5pbmcgbm9uIG5lZ2F0aXZlIGludGVnZXJzCiAgICBkaWZmZXJlbnQgc2l6ZXMgYXJlIGF2YWlsYWJsZQogICAgICAgIHVpbnQ4ICAgcmFuZ2VzIGZyb20gMCB0byAyICoqIDggLSAxCiAgICAgICAgdWludDE2ICByYW5nZXMgZnJvbSAwIHRvIDIgKiogMTYgLSAxCiAgICAgICAgLi4uCiAgICAgICAgdWludDI1NiByYW5nZXMgZnJvbSAwIHRvIDIgKiogMjU2IC0gMQogICAgKi8KICAgIHVpbnQ4IHB1YmxpYyB1OCA9IDE7CiAgICB1aW50MjU2IHB1YmxpYyB1MjU2ID0gNDU2OwogICAgdWludDI1NiBwdWJsaWMgdSA9IDEyMzsgLy8gdWludCBpcyBhbiBhbGlhcyBmb3IgdWludDI1NgoKICAgIC8qCiAgICBOZWdhdGl2ZSBudW1iZXJzIGFyZSBhbGxvd2VkIGZvciBpbnQgdHlwZXMuCiAgICBMaWtlIHVpbnQsIGRpZmZlcmVudCByYW5nZXMgYXJlIGF2YWlsYWJsZSBmcm9tIGludDggdG8gaW50MjU2CiAgICAKICAgIGludDI1NiByYW5nZXMgZnJvbSAtMiAqKiAyNTUgdG8gMiAqKiAyNTUgLSAxCiAgICBpb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mF1bHRCb287IC8vIGZhbHNlCiAgICB1aW50MjU2IHB1YmxpYyBkZWZhdWx0VWludDsgLy8gMAogICAgaW50MjU2IHB1YmxpYyBkZWZhdWx0SW50OyAvLyAwCiAgICBhZGRyZXNzIHB1YmxpYyBkZWZhdWx0QWRkcjsgLy8gMHgwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCn0K"}],ZW=`

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

                                        +`,yW=({prev:s,next:a})=>r.jsx(A,{version:dW,title:CW,description:jW,html:uW,prev:s,next:a,codes:AW}),mW="0.8.24",bW="Primitive Data Types",wW="Primitive data types",kW=[{fileName:"Primitives.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFByaW1pdGl2ZXMgewogICAgYm9vbCBwdWJsaWMgYm9vID0gdHJ1ZTsKCiAgICAvKgogICAgdWludCBzdGFuZHMgZm9yIHVuc2lnbmVkIGludGVnZXIsIG1lYW5pbmcgbm9uIG5lZ2F0aXZlIGludGVnZXJzCiAgICBkaWZmZXJlbnQgc2l6ZXMgYXJlIGF2YWlsYWJsZQogICAgICAgIHVpbnQ4ICAgcmFuZ2VzIGZyb20gMCB0byAyICoqIDggLSAxCiAgICAgICAgdWludDE2ICByYW5nZXMgZnJvbSAwIHRvIDIgKiogMTYgLSAxCiAgICAgICAgLi4uCiAgICAgICAgdWludDI1NiByYW5nZXMgZnJvbSAwIHRvIDIgKiogMjU2IC0gMQogICAgKi8KICAgIHVpbnQ4IHB1YmxpYyB1OCA9IDE7CiAgICB1aW50MjU2IHB1YmxpYyB1MjU2ID0gNDU2OwogICAgdWludDI1NiBwdWJsaWMgdSA9IDEyMzsgLy8gdWludCBpcyBhbiBhbGlhcyBmb3IgdWludDI1NgoKICAgIC8qCiAgICBOZWdhdGl2ZSBudW1iZXJzIGFyZSBhbGxvd2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gIFsxMDExMDEwMV0KICAgIGJ5dGVzMSBiID0gMHg1NjsgLy8gIFswMTAxMDExMF0KCiAgICAvLyBEZWZhdWx0IHZhbHVlcwogICAgLy8gVW5hc3NpZ25lZCB2YXJpYWJsZXMgaGF2ZSBhIGRlZmF1bHQgdmFsdWUKICAgIGJvb2wgcHVibGljIGRlZmF1bHRCb287IC8vIGZhbHNlCiAgICB1aW50MjU2IHB1YmxpYyBkZWZhdWx0VWludDsgLy8gMAogICAgaW50MjU2IHB1YmxpYyBkZWZhdWx0SW50OyAvLyAwCiAgICBhZGRyZXNzIHB1YmxpYyBkZWZhdWx0QWRkcjsgLy8gMHgwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCn0K"}],ZW=`

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

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

                                          int256 public defaultInt; // 0 address public defaultAddr; // 0x0000000000000000000000000000000000000000 } -`,WW=({prev:s,next:a})=>r.jsx(u,{version:mW,title:bW,description:wW,html:ZW,prev:s,next:a,codes:kW}),BW="0.8.24",GW="Sending Ether (transfer, send, call)",VW="An example of sending Ether in Solidity",fW=[{fileName:"SendingEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFJlY2VpdmVFdGhlciB7CiAgICAvKgogICAgV2hpY2ggZnVuY3Rpb24gaXMgY2FsbGVkLCBmYWxsYmFjaygpIG9yIHJlY2VpdmUoKT8KCiAgICAgICAgICAgc2VuZCBFdGhlcgogICAgICAgICAgICAgICB8CiAgICAgICAgIG1zZy5kYXRhIGlzIGVtcHR5PwogICAgICAgICAgICAgIC8gXAogICAgICAgICAgICB5ZXMgIG5vCiAgICAgICAgICAgIC8gICAgIFwKICAgIHJlY2VpdmUoKSBleGlzdHM/ICBmYWxsYmFjaygpCiAgIC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IHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICB9CgogICAgZnVuY3Rpb24gc2VuZFZpYUNhbGwoYWRkcmVzcyBwYXlhYmxlIF90bykgcHVibGljIHBheWFibGUgewogICAgICAgIC8vIENhbGwgcmV0dXJucyBhIGJvb2xlYW4gdmFsdWUgaW5kaWNhdGluZyBzdWNjZXNzIG9yIGZhaWx1cmUuCiAgICAgICAgLy8gVGhpcyBpcyB0aGUgY3VycmVudCByZWNvbW1lbmRlZCBtZXRob2QgdG8gdXNlLgogICAgICAgIChib29sIHNlbnQsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF90by5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],YW=`

                                          How to send Ether?

                                          +`,WW=({prev:s,next:a})=>r.jsx(A,{version:mW,title:bW,description:wW,html:ZW,prev:s,next:a,codes:kW}),BW="0.8.24",GW="Sending Ether (transfer, send, call)",VW="An example of sending Ether in Solidity",fW=[{fileName:"SendingEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFJlY2VpdmVFdGhlciB7CiAgICAvKgogICAgV2hpY2ggZnVuY3Rpb24gaXMgY2FsbGVkLCBmYWxsYmFjaygpIG9yIHJlY2VpdmUoKT8KCiAgICAgICAgICAgc2VuZCBFdGhlcgogICAgICAgICAgICAgICB8CiAgICAgICAgIG1zZy5kYXRhIGlzIGVtcHR5PwogICAgICAgICAgICAgIC8gXAogICAgICAgICAgICB5ZXMgIG5vCiAgICAgICAgICAgIC8gICAgIFwKICAgIHJlY2VpdmUoKSBleGlzdHM/ICBmYWxsYmFjaygpCiAgICAgICAgIC8gICBcCiAgICAgICAgeWVzICAgbm8KICAgICAgICAvICAgIC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Iik7CiAgICB9CgogICAgZnVuY3Rpb24gc2VuZFZpYUNhbGwoYWRkcmVzcyBwYXlhYmxlIF90bykgcHVibGljIHBheWFibGUgewogICAgICAgIC8vIENhbGwgcmV0dXJucyBhIGJvb2xlYW4gdmFsdWUgaW5kaWNhdGluZyBzdWNjZXNzIG9yIGZhaWx1cmUuCiAgICAgICAgLy8gVGhpcyBpcyB0aGUgY3VycmVudCByZWNvbW1lbmRlZCBtZXRob2QgdG8gdXNlLgogICAgICAgIChib29sIHNlbnQsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF90by5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],YW=`

                                          How to send Ether?

                                          You can send Ether to other contracts by

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

                                            require(sent, "Failed to send Ether"); } } -`,RW=({prev:s,next:a})=>r.jsx(u,{version:BW,title:GW,description:VW,html:YW,prev:s,next:a,codes:fW}),XW="0.8.24",vW="Shadowing Inherited State Variables",NW="An example of shadowing state variables by inheritance",HW=[{fileName:"Shadow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEEgewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkNvbnRyYWN0IEEiOwoKICAgIGZ1bmN0aW9uIGdldE5hbWUoKSBwdWJsaWMgdmlldyByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIG5hbWU7CiAgICB9Cn0KCi8vIFNoYWRvd2luZyBpcyBkaXNhbGxvd2VkIGluIFNvbGlkaXR5IDAuNgovLyBUaGlzIHdpbGwgbm90IGNvbXBpbGUKLy8gY29udHJhY3QgQiBpcyBBIHsKLy8gICAgIHN0cmluZyBwdWJsaWMgbmFtZSA9ICJDb250cmFjdCBCIjsKLy8gfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIFRoaXMgaXMgdGhlIGNvcnJlY3Qgd2F5IHRvIG92ZXJyaWRlIGluaGVyaXRlZCBzdGF0ZSB2YXJpYWJsZXMuCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBuYW1lID0gIkNvbnRyYWN0IEMiOwogICAgfQoKICAgIC8vIEMuZ2V0TmFtZSByZXR1cm5zICJDb250cmFjdCBDIgp9Cg=="}],FW=`

                                            Unlike functions, state variables cannot be overridden by re-declaring it +`,RW=({prev:s,next:a})=>r.jsx(A,{version:BW,title:GW,description:VW,html:YW,prev:s,next:a,codes:fW}),XW="0.8.24",vW="Shadowing Inherited State Variables",NW="An example of shadowing state variables by inheritance",HW=[{fileName:"Shadow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEEgewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkNvbnRyYWN0IEEiOwoKICAgIGZ1bmN0aW9uIGdldE5hbWUoKSBwdWJsaWMgdmlldyByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIG5hbWU7CiAgICB9Cn0KCi8vIFNoYWRvd2luZyBpcyBkaXNhbGxvd2VkIGluIFNvbGlkaXR5IDAuNgovLyBUaGlzIHdpbGwgbm90IGNvbXBpbGUKLy8gY29udHJhY3QgQiBpcyBBIHsKLy8gICAgIHN0cmluZyBwdWJsaWMgbmFtZSA9ICJDb250cmFjdCBCIjsKLy8gfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIFRoaXMgaXMgdGhlIGNvcnJlY3Qgd2F5IHRvIG92ZXJyaWRlIGluaGVyaXRlZCBzdGF0ZSB2YXJpYWJsZXMuCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBuYW1lID0gIkNvbnRyYWN0IEMiOwogICAgfQoKICAgIC8vIEMuZ2V0TmFtZSByZXR1cm5zICJDb250cmFjdCBDIgp9Cg=="}],FW=`

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

                                            // C.getName returns "Contract C" } -
                                            `,KW=({prev:s,next:a})=>r.jsx(u,{version:XW,title:vW,description:NW,html:FW,prev:s,next:a,codes:HW}),MW="0.8.24",SW="Verifying Signature",xW="An example of how to verify signatures in Solidity",JW=[{fileName:"Signature.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qIFNpZ25hdHVyZSBWZXJpZmljYXRpb24KCkhvdyB0byBTaWduIGFuZCBWZXJpZnkKIyBTaWduaW5nCjEuIENyZWF0ZSBtZXNzYWdlIHRvIHNpZ24KMi4gSGFzaCB0aGUgbWVzc2FnZQozLiBTaWduIHRoZSBoYXNoIChvZmYgY2hhaW4sIGtlZXAgeW91ciBwcml2YXRlIGtleSBzZWNyZXQpCgojIFZlcmlmeQoxLiBSZWNyZWF0ZSBoYXNoIGZyb20gdGhlIG9yaWdpbmFsIG1lc3NhZ2UKMi4gUmVjb3ZlciBzaWduZXIgZnJvbSBzaWduYXR1cmUgYW5kIGhhc2gKMy4gQ29tcGFyZSByZWNvdmVyZWQgc2lnbmVyIHRvIGNsYWltZWQgc2lnbmVyCiovCgpjb250cmFjdCBWZXJpZnlTaWduYXR1cmUgewogICAgLyogMS4gVW5sb2NrIE1ldGFNYXNrIGFjY291bnQKICAgIGV0aGVyZXVtLmVuYWJsZSgpCiAgICAqLwoKICAgIC8qIDIuIEdldCBtZXNzYWdlIGhhc2ggdG8gc2lnbgogICAgZ2V0TWVzc2FnZUhhc2goCiAgICAgICAgMHgxNDcyM0EwOUFDZmY2RDJBNj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cmUKICAgICAgICByZXR1cm5zIChieXRlczMyIHIsIGJ5dGVzMzIgcywgdWludDggdikKICAgIHsKICAgICAgICByZXF1aXJlKHNpZy5sZW5ndGggPT0gNjUsICJpbnZhbGlkIHNpZ25hdHVyZSBsZW5ndGgiKTsKCiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvKgogICAgICAgICAgICBGaXJzdCAzMiBieXRlcyBzdG9yZXMgdGhlIGxlbmd0aCBvZiB0aGUgc2lnbmF0dXJlCgogICAgICAgICAgICBhZGQoc2lnLCAzMikgPSBwb2ludGVyIG9mIHNpZyArIDMyCiAgICAgICAgICAgIGVmZmVjdGl2ZWx5LCBza2lwcyBmaXJzdCAzMiBieXRlcyBvZiBzaWduYXR1cmUKCiAgICAgICAgICAgIG1sb2FkKHApIGxvYWRzIG5leHQgMzIgYnl0ZXMgc3RhcnRpbmcgYXQgdGhlIG1lbW9yeSBhZGRyZXNzIHAgaW50byBtZW1vcnkKICAgICAgICAgICAgKi8KCiAgICAgICAgICAgIC8vIGZpcnN0IDMyIGJ5dGVzLCBhZnRlciB0aGUgbGVuZ3RoIHByZWZpeAogICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWcsIDMyKSkKICAgICAgICAgICAgLy8gc2Vjb25kIDMyIGJ5dGVzCiAgICAgICAgICAgIHMgOj0gbWxvYWQoYWRkKHNpZywgNjQpKQogICAgICAgICAgICAvLyBmaW5hbCBieXRlIChmaXJzdCBieXRlIG9mIHRoZSBuZXh0IDMyIGJ5dGVzKQogICAgICAgICAgICB2IDo9IGJ5dGUoMCwgbWxvYWQoYWRkKHNpZywgOTYpKSkKICAgICAgICB9CgogICAgICAgIC8vIGltcGxpY2l0bHkgcmV0dXJuIChyLCBzLCB2KQogICAgfQp9Cg=="}],zW=`

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

                                            +`,KW=({prev:s,next:a})=>r.jsx(A,{version:XW,title:vW,description:NW,html:FW,prev:s,next:a,codes:HW}),MW="0.8.24",SW="Verifying Signature",xW="An example of how to verify signatures in Solidity",JW=[{fileName:"Signature.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qIFNpZ25hdHVyZSBWZXJpZmljYXRpb24KCkhvdyB0byBTaWduIGFuZCBWZXJpZnkKIyBTaWduaW5nCjEuIENyZWF0ZSBtZXNzYWdlIHRvIHNpZ24KMi4gSGFzaCB0aGUgbWVzc2FnZQozLiBTaWduIHRoZSBoYXNoIChvZmYgY2hhaW4sIGtlZXAgeW91ciBwcml2YXRlIGtleSBzZWNyZXQpCgojIFZlcmlmeQoxLiBSZWNyZWF0ZSBoYXNoIGZyb20gdGhlIG9yaWdpbmFsIG1lc3NhZ2UKMi4gUmVjb3ZlciBzaWduZXIgZnJvbSBzaWduYXR1cmUgYW5kIGhhc2gKMy4gQ29tcGFyZSByZWNvdmVyZWQgc2lnbmVyIHRvIGNsYWltZWQgc2lnbmVyCiovCgpjb250cmFjdCBWZXJpZnlTaWduYXR1cmUgewogICAgLyogMS4gVW5sb2NrIE1ldGFNYXNrIGFjY291bnQKICAgIGV0aGVyZXVtLmVuYWJsZSgpCiAgICAqLwoKICAgIC8qIDIuIEdldCBtZXNzYWdlIGhhc2ggdG8gc2lnbgogICAgZ2V0TWVzc2FnZUhhc2goCiAgICAgICAgMHgxNDcyM0EwOUFDZmY2RDJBNjBEY2RGN2FBNEFGZjMwOEZEREMxNjBDLAogICAgICAgIDEyMywKICAgICAgICAiY29mZmVlIGFuZCBkb251dHMiLAogICAgICAgIDEKICAgICkKCiAgICBoYXNoID0gIjB4Y2YzNmFjNGY5N2RjMTBkOTFmYzJjYmIyMGQ3MThlOTRhOGNiZmUwZjgyZWFlZGM2YTRhYTM4OTQ2ZmI3OTdjZCIKICAgICovCiAgICBmdW5jdGlvbiBnZXRNZXNzYWdlSGFzaCgKICAgICAgICBhZGRyZXNzIF90bywKICAgICAgICB1aW50MjU2IF9hb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2ludGVyIG9mIHNpZyArIDMyCiAgICAgICAgICAgIGVmZmVjdGl2ZWx5LCBza2lwcyBmaXJzdCAzMiBieXRlcyBvZiBzaWduYXR1cmUKCiAgICAgICAgICAgIG1sb2FkKHApIGxvYWRzIG5leHQgMzIgYnl0ZXMgc3RhcnRpbmcgYXQgdGhlIG1lbW9yeSBhZGRyZXNzIHAgaW50byBtZW1vcnkKICAgICAgICAgICAgKi8KCiAgICAgICAgICAgIC8vIGZpcnN0IDMyIGJ5dGVzLCBhZnRlciB0aGUgbGVuZ3RoIHByZWZpeAogICAgICAgICAgICByIDo9IG1sb2FkKGFkZChzaWcsIDMyKSkKICAgICAgICAgICAgLy8gc2Vjb25kIDMyIGJ5dGVzCiAgICAgICAgICAgIHMgOj0gbWxvYWQoYWRkKHNpZywgNjQpKQogICAgICAgICAgICAvLyBmaW5hbCBieXRlIChmaXJzdCBieXRlIG9mIHRoZSBuZXh0IDMyIGJ5dGVzKQogICAgICAgICAgICB2IDo9IGJ5dGUoMCwgbWxvYWQoYWRkKHNpZywgOTYpKSkKICAgICAgICB9CgogICAgICAgIC8vIGltcGxpY2l0bHkgcmV0dXJuIChyLCBzLCB2KQogICAgfQp9Cg=="}],zW=`

                                            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.24;
                                            @@ -11494,7 +11494,7 @@ How to Sign and Verify
                                                     // implicitly return (r, s, v)
                                                 }
                                             }
                                            -
                                            `,DW=({prev:s,next:a})=>r.jsx(u,{version:MW,title:SW,description:xW,html:zW,prev:s,next:a,codes:JW}),EW="0.8.24",QW="Reading and Writing to a State Variable",TW="Reading and Writing to a State Variable",UW=[{fileName:"SimpleStorage.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFNpbXBsZVN0b3JhZ2UgewogICAgLy8gU3RhdGUgdmFyaWFibGUgdG8gc3RvcmUgYSBudW1iZXIKICAgIHVpbnQyNTYgcHVibGljIG51bTsKCiAgICAvLyBZb3UgbmVlZCB0byBzZW5kIGEgdHJhbnNhY3Rpb24gdG8gd3JpdGUgdG8gYSBzdGF0ZSB2YXJpYWJsZS4KICAgIGZ1bmN0aW9uIHNldCh1aW50MjU2IF9udW0pIHB1YmxpYyB7CiAgICAgICAgbnVtID0gX251bTsKICAgIH0KCiAgICAvLyBZb3UgY2FuIHJlYWQgZnJvbSBhIHN0YXRlIHZhcmlhYmxlIHdpdGhvdXQgc2VuZGluZyBhIHRyYW5zYWN0aW9uLgogICAgZnVuY3Rpb24gZ2V0KCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBudW07CiAgICB9Cn0K"}],_W=`

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

                                            +`,DW=({prev:s,next:a})=>r.jsx(A,{version:MW,title:SW,description:xW,html:zW,prev:s,next:a,codes:JW}),EW="0.8.24",QW="Reading and Writing to a State Variable",TW="Reading and Writing to a State Variable",UW=[{fileName:"SimpleStorage.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFNpbXBsZVN0b3JhZ2UgewogICAgLy8gU3RhdGUgdmFyaWFibGUgdG8gc3RvcmUgYSBudW1iZXIKICAgIHVpbnQyNTYgcHVibGljIG51bTsKCiAgICAvLyBZb3UgbmVlZCB0byBzZW5kIGEgdHJhbnNhY3Rpb24gdG8gd3JpdGUgdG8gYSBzdGF0ZSB2YXJpYWJsZS4KICAgIGZ1bmN0aW9uIHNldCh1aW50MjU2IF9udW0pIHB1YmxpYyB7CiAgICAgICAgbnVtID0gX251bTsKICAgIH0KCiAgICAvLyBZb3UgY2FuIHJlYWQgZnJvbSBhIHN0YXRlIHZhcmlhYmxlIHdpdGhvdXQgc2VuZGluZyBhIHRyYW5zYWN0aW9uLgogICAgZnVuY3Rpb24gZ2V0KCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludDI1NikgewogICAgICAgIHJldHVybiBudW07CiAgICB9Cn0K"}],_W=`

                                            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.24;
                                            @@ -11513,7 +11513,7 @@ How to Sign and Verify
                                                     return num;
                                                 }
                                             }
                                            -
                                            `,LW=({prev:s,next:a})=>r.jsx(u,{version:EW,title:QW,description:TW,html:_W,prev:s,next:a,codes:UW}),OW="0.8.24",PW="Structs",$W="An example of how to use structs in Solidity",qW=[{fileName:"StructDeclaration.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKLy8gVGhpcyBpcyBzYXZlZCAnU3RydWN0RGVjbGFyYXRpb24uc29sJwoKc3RydWN0IFRvZG8gewogICAgc3RyaW5nIHRleHQ7CiAgICBib29sIGNvbXBsZXRlZDsKfQo="},{fileName:"StructImport.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG9ydCAiLi9TdHJ1Y3REZWNsYXJhdGlvbi5zb2wiOwoKY29udHJhY3QgVG9kb3MgewogICAgLy8gQW4gYXJyYXkgb2YgJ1RvZG8nIHN0cnVjdHMKICAgIFRvZG9bXSBwdWJsaWMgdG9kb3M7Cn0K"},{fileName:"Structs.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFRvZG9zIHsKICAgIHN0cnVjdCBUb2RvIHsKICAgICAgICBzdHJpbmcgdGV4dDsKICAgICAgICBib29sIGNvbXBsZXRlZDsKICAgIH0KCiAgICAvLyBBbiBhcnJheSBvZiAnV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0CiAgICBmdW5jdGlvbiB1cGRhdGVUZXh0KHVpbnQyNTYgX2luZGV4LCBzdHJpbmcgY2FsbGRhdGEgX3RleHQpIHB1YmxpYyB7CiAgICAgICAgVG9kbyBzdG9yYWdlIHRvZG8gPSB0b2Rvc1tfaW5kZXhdOwogICAgICAgIHRvZG8udGV4dCA9IF90ZXh0OwogICAgfQoKICAgIC8vIHVwZGF0ZSBjb21wbGV0ZWQKICAgIGZ1bmN0aW9uIHRvZ2dsZUNvbXBsZXRlZCh1aW50MjU2IF9pbmRleCkgcHVibGljIHsKICAgICAgICBUb2RvIHN0b3JhZ2UgdG9kbyA9IHRvZG9zW19pbmRleF07CiAgICAgICAgdG9kby5jb21wbGV0ZWQgPSAhdG9kby5jb21wbGV0ZWQ7CiAgICB9Cn0K"}],s2=`

                                            You can define your own type by creating a struct.

                                            +`,LW=({prev:s,next:a})=>r.jsx(A,{version:EW,title:QW,description:TW,html:_W,prev:s,next:a,codes:UW}),OW="0.8.24",PW="Structs",$W="An example of how to use structs in Solidity",qW=[{fileName:"StructDeclaration.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKLy8gVGhpcyBpcyBzYXZlZCAnU3RydWN0RGVjbGFyYXRpb24uc29sJwoKc3RydWN0IFRvZG8gewogICAgc3RyaW5nIHRleHQ7CiAgICBib29sIGNvbXBsZXRlZDsKfQo="},{fileName:"StructImport.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmltcG9ydCAiLi9TdHJ1Y3REZWNsYXJhdGlvbi5zb2wiOwoKY29udHJhY3QgVG9kb3MgewogICAgLy8gQW4gYXJyYXkgb2YgJ1RvZG8nIHN0cnVjdHMKICAgIFRvZG9bXSBwdWJsaWMgdG9kb3M7Cn0K"},{fileName:"Structs.sol",code:"Ly8gU1BEWC1MaWNlbnN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zdHJpbmcgbWVtb3J5IHRleHQsIGJvb2wgY29tcGxldGVkKQogICAgewogICAgICAgIFRvZG8gc3RvcmFnZSB0b2RvID0gdG9kb3NbX2luZGV4XTsKICAgICAgICByZXR1cm4gKHRvZG8udGV4dCwgdG9kby5jb21wbGV0ZWQpOwogICAgfQoKICAgIC8vIHVwZGF0ZSB0ZXh0CiAgICBmdW5jdGlvbiB1cGRhdGVUZXh0KHVpbnQyNTYgX2luZGV4LCBzdHJpbmcgY2FsbGRhdGEgX3RleHQpIHB1YmxpYyB7CiAgICAgICAgVG9kbyBzdG9yYWdlIHRvZG8gPSB0b2Rvc1tfaW5kZXhdOwogICAgICAgIHRvZG8udGV4dCA9IF90ZXh0OwogICAgfQoKICAgIC8vIHVwZGF0ZSBjb21wbGV0ZWQKICAgIGZ1bmN0aW9uIHRvZ2dsZUNvbXBsZXRlZCh1aW50MjU2IF9pbmRleCkgcHVibGljIHsKICAgICAgICBUb2RvIHN0b3JhZ2UgdG9kbyA9IHRvZG9zW19pbmRleF07CiAgICAgICAgdG9kby5jb21wbGV0ZWQgPSAhdG9kby5jb21wbGV0ZWQ7CiAgICB9Cn0K"}],s2=`

                                            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
                                            @@ -11587,7 +11587,7 @@ How to Sign and Verify
                                                 // An array of 'Todo' structs
                                                 Todo[] public todos;
                                             }
                                            -
                                            `,a2=({prev:s,next:a})=>r.jsx(u,{version:OW,title:PW,description:$W,html:s2,prev:s,next:a,codes:qW}),n2="0.8.24",l2="Calling Parent Contracts",p2="An example of calling parent contracts in Solidity",e2=[{fileName:"Super.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qIEluaGVyaXRhbmNlIHRyZWUKICAgQQogLyAgXApCICAgQwogXCAvCiAgRAoqLwoKY29udHJhY3QgQ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uYmFyKCk7CiAgICB9Cn0KCmNvbnRyYWN0IEQgaXMgQiwgQyB7CiAgICAvLyBUcnk6CiAgICAvLyAtIENhbGwgRC5mb28gYW5kIGNoZWNrIHRoZSB0cmFuc2FjdGlvbiBsb2dzLgogICAgLy8gICBBbHRob3VnaCBEIGluaGVyaXRzIEEsIEIgYW5kIEMsIGl0IG9ubHkgY2FsbGVkIEMgYW5kIHRoZW4gQS4KICAgIC8vIC0gQ2FsbCBELmJhciBhbmQgY2hlY2sgdGhlIHRyYW5zYWN0aW9uIGxvZ3MKICAgIC8vICAgRCBjYWxsZWQgQywgdGhlbiBCLCBhbmQgZmluYWxseSBBLgogICAgLy8gICBBbHRob3VnaCBzdXBlciB3YXMgY2FsbGVkIHR3aWNlIChieSBCIGFuZCBDKSBpdCBvbmx5IGNhbGxlZCBBIG9uY2UuCgogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIG92ZXJyaWRlKEIsIEMpIHsKICAgICAgICBzdXBlci5mb28oKTsKICAgIH0KCiAgICBmdW5jdGlvbiBiYXIoKSBwdWJsaWMgb3ZlcnJpZGUoQiwgQykgewogICAgICAgIHN1cGVyLmJhcigpOwogICAgfQp9Cg=="}],c2=`

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

                                            +`,a2=({prev:s,next:a})=>r.jsx(A,{version:OW,title:PW,description:$W,html:s2,prev:s,next:a,codes:qW}),n2="0.8.24",l2="Calling Parent Contracts",p2="An example of calling parent contracts in Solidity",e2=[{fileName:"Super.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qIEluaGVyaXRhbmNlIHRyZWUKICAgQQogLyAgXApCICAgQwogXCAvCiAgRAoqLwoKY29udHJhY3QgQSB7CiAgICAvLyBUaGlzIGlzIGNhbGxlZCBhbiBldmVudC4gWW91IGNhbiBlbWl0IGV2ZW50cyBmcm9tIHlvdXIgZnVuY3Rpb24KICAgIC8vIGF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ZSB0cmFuc2FjdGlvbiBsb2dzLgogICAgLy8gICBBbHRob3VnaCBEIGluaGVyaXRzIEEsIEIgYW5kIEMsIGl0IG9ubHkgY2FsbGVkIEMgYW5kIHRoZW4gQS4KICAgIC8vIC0gQ2FsbCBELmJhciBhbmQgY2hlY2sgdGhlIHRyYW5zYWN0aW9uIGxvZ3MKICAgIC8vICAgRCBjYWxsZWQgQywgdGhlbiBCLCBhbmQgZmluYWxseSBBLgogICAgLy8gICBBbHRob3VnaCBzdXBlciB3YXMgY2FsbGVkIHR3aWNlIChieSBCIGFuZCBDKSBpdCBvbmx5IGNhbGxlZCBBIG9uY2UuCgogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIG92ZXJyaWRlKEIsIEMpIHsKICAgICAgICBzdXBlci5mb28oKTsKICAgIH0KCiAgICBmdW5jdGlvbiBiYXIoKSBwdWJsaWMgb3ZlcnJpZGUoQiwgQykgewogICAgICAgIHN1cGVyLmJhcigpOwogICAgfQp9Cg=="}],c2=`

                                            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.24;
                                            @@ -11655,7 +11655,7 @@ B   C
                                                     super.bar();
                                                 }
                                             }
                                            -
                                            `,t2=({prev:s,next:a})=>r.jsx(u,{version:n2,title:l2,description:p2,html:c2,prev:s,next:a,codes:e2}),o2="0.8.24",r2="Echidna",i2="An example of testing contracts with Echidna",g2=[{fileName:"EchidnaTestTimeAndCaller.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCmRvY2tlciBydW4gLWl0IC0tcm0gLXYgJFBXRDovY29kZSB0cmFpbG9mYml0cy9ldGgtc2VjdXJpdHktdG9vbGJveAplY2hpZG5hIEVjaGlkbmFUZXN0VGltZUFuZENhbGxlci5zb2wgLS1jb250cmFjdCBFY2hpZG5hVGVzdFRp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ludDI1NiB5KSBwcml2YXRlIHB1cmUgcmV0dXJucyAodWludDI1NikgewogICAgICAgIGlmICh4ID49IHkpIHsKICAgICAgICAgICAgcmV0dXJuIHggLSB5OwogICAgICAgIH0KICAgICAgICByZXR1cm4geSAtIHg7CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9hYnModWludDI1NiB4LCB1aW50MjU2IHkpIGV4dGVybmFsIHsKICAgICAgICB1aW50MjU2IHogPSBhYnMoeCwgeSk7CiAgICAgICAgaWYgKHggPj0geSkgewogICAgICAgICAgICBhc3NlcnQoeiA8PSB4KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBhc3NlcnQoeiA8PSB5KTsKICAgICAgICB9CiAgICB9Cn0K"}],h2=`

                                            Examples of fuzzing with Echidna.

                                            +`,t2=({prev:s,next:a})=>r.jsx(A,{version:n2,title:l2,description:p2,html:c2,prev:s,next:a,codes:e2}),o2="0.8.24",r2="Echidna",i2="An example of testing contracts with Echidna",g2=[{fileName:"EchidnaTestTimeAndCaller.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCmRvY2tlciBydW4gLWl0IC0tcm0gLXYgJFBXRDovY29kZSB0cmFpbG9mYml0cy9ldGgtc2VjdXJpdHktdG9vbGJveAplY2hpZG5hIEVjaGlkbmFUZXN0VGltZUFuZENhbGxlci5zb2wgLS1jb250cmFjdCBFY2hpZG5hVGVzdFRpbWVBbmRDYWxsZXIKKi8KY29udHJhY3QgRWNoaWRuYVRlc3RUaW1lQW5kQ2FsbGVyIHsKICAgIGJvb2wgcHJpdmF0ZSBwYXNzID0gdHJ1ZTsKICAgIHVpbnQyNTYgcHJpdmF0ZSBjcmVhdGVkQXQgPSBibG9jay50aW1lc3RhbXA7CgogICAgLyoKICAgIHRlc3Qgd2lsbCBmYWlsIGlmIEVjaGlkbmEgY2FuIGNhbGwgc2V0RmFpbCgpCiAgICB0ZXN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bGUKICAgIGZ1bmN0aW9uIHNldFNlbmRlcihhZGRyZXNzIF9zZW5kZXIpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKF9zZW5kZXIgPT0gbXNnLnNlbmRlcik7CiAgICAgICAgc2VuZGVyID0gbXNnLnNlbmRlcjsKICAgIH0KCiAgICAvLyBDaGVjayBkZWZhdWx0IHNlbmRlcnMuIFNlbmRlciBzaG91bGQgYmUgb25lIG9mIHRoZSAzIGRlZmF1bHQgYWNjb3VudHMuCiAgICBmdW5jdGlvbiBlY2hpZG5hX3Rlc3Rfc2VuZGVyKCkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIGZvciAodWludDI1NiBpOyBpIDwgMzsgaSsrKSB7CiAgICAgICAgICAgIGlmIChzZW5kZXIgPT0gc2VuZGVyc1tpXSkgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfQp9Cg=="},{fileName:"TestEchidna.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8qCmVjaGlkbmEgVGVzdEVjaGlkbmEuc29sIC0tY29udHJhY3QgVGVzdENvdW50ZXIKKi8KY29udHJhY3QgQ291bnRlciB7CiAgICB1aW50MjU2IHB1YmxpYyBjb3VudDsKCiAgICBmdW5jdGlvbiBpbmMoKSBleHRlcm5hbCB7CiAgICAgICAgY291bnQgKz0gMTsKICAgIH0KCiAgICBmdW5jdGlvbiBkZWMoKSBleHRlcm5hbCB7CiAgICAgICAgY291bnQgLT0gMTsKICAgIH0KfQoKY29udHJhY3QgVGVzdENvdW50ZXIgaXMgQ291bnRlciB7CiAgICBmdW5jdGlvbiBlY2hpZG5hX3Rlc3RfdHJ1ZSgpIHB1YmxpYyB2aWV3IHJldHVybnMgKGJvb2wpIHsKICAgICAgICByZXR1cm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gaWYgKHggPj0geSkgewogICAgICAgICAgICBhc3NlcnQoeiA8PSB4KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBhc3NlcnQoeiA8PSB5KTsKICAgICAgICB9CiAgICB9Cn0K"}],h2=`

                                            Examples of fuzzing with Echidna.

                                            1. Save the solidity contract as TestEchidna.sol
                                            2. In the folder where your contract is stored execute the following command.
                                            3. @@ -11787,7 +11787,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller return false; } } -`,I2=({prev:s,next:a})=>r.jsx(u,{version:o2,title:r2,description:i2,html:h2,prev:s,next:a,codes:g2}),d2="0.8.24",C2="Transient Storage",j2="transient storage",u2=[{fileName:"TransientStorage.sol",code:"cHJhZ21hIHNvbGlkaXR5IF4wLjguMjQ7CgovLyBNYWtlIHN1cmUgRVZNIHZlcnNpb24gYW5kIFZNIHNldCB0byBDYW5jdW4KCi8vIFN0b3JhZ2UgLSBkYXRhIGlzIHN0b3JlZCBvbiB0aGUgYmxvY2tjaGFpbgovLyBNZW1vcnkgLSBkYXRhIGlzIGNsZWFyZWQgb3V0IGFmdGVyIGEgZnVuY3Rpb24gY2FsbAovLyBUcmFuc2llbnQgc3RvcmFnZSAtIGRhdGEgaXMgY2xlYXJlZCBvdXQgYWZ0ZXIgYSB0cmFuc2FjdGlvbgoKaW50ZXJmYWNlIElUZXN0IHsKICAgIGZ1bmN0aW9uIHZhbCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludDI1Nik7CiAgICBmdW5jdGlvbiB0ZXN0KCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IENhbGxiYWNrIHsKICAgIHVpbnQyNTYgcHVibGljIHZhbDsKCiAgICBmYWxsYmFjaygpIGV4dGVybmFsIHsKICAgICAgICB2YWwgPSBJVGVzdChtc2cuc2VuZGVyKS52YWwoKTsKICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0KGFkZHJlc3MgdGFyZ2V0KSBleHRlcm5hbCB7Ci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woYik7CiAgICB9Cn0KCmNvbnRyYWN0IFJlZW50cmFuY3lHdWFyZFRyYW5zaWVudCB7CiAgICBieXRlczMyIGNvbnN0YW50IFNMT1QgPSAwOwoKICAgIG1vZGlmaWVyIGxvY2soKSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBpZiB0bG9hZChTTE9UKSB7IHJldmVydCgwLCAwKSB9CiAgICAgICAgICAgIHRzdG9yZShTTE9ULCAxKQogICAgICAgIH0KICAgICAgICBfOwogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgdHN0b3JlKFNMT1QsIDApCiAgICAgICAgfQogICAgfQoKICAgIC8vIDIxODg3IGdhcwogICAgZnVuY3Rpb24gdGVzdCgpIGV4dGVybmFsIGxvY2sgewogICAgICAgIC8vIElnbm9yZSBjYWxsIGVycm9yCiAgICAgICAgYnl0ZXMgbWVtb3J5IGIgPSAiIjsKICAgICAgICBtc2cuc2VuZGVyLmNhbGwoYik7CiAgICB9Cn0K"}],A2=`

                                              Data stored in transient storage is cleared out after transaction.

                                              +`,I2=({prev:s,next:a})=>r.jsx(A,{version:o2,title:r2,description:i2,html:h2,prev:s,next:a,codes:g2}),d2="0.8.24",C2="Transient Storage",j2="transient storage",A2=[{fileName:"TransientStorage.sol",code:"cHJhZ21hIHNvbGlkaXR5IF4wLjguMjQ7CgovLyBNYWtlIHN1cmUgRVZNIHZlcnNpb24gYW5kIFZNIHNldCB0byBDYW5jdW4KCi8vIFN0b3JhZ2UgLSBkYXRhIGlzIHN0b3JlZCBvbiB0aGUgYmxvY2tjaGFpbgovLyBNZW1vcnkgLSBkYXRhIGlzIGNsZWFyZWQgb3V0IGFmdGVyIGEgZnVuY3Rpb24gY2FsbAovLyBUcmFuc2llbnQgc3RvcmFnZSAtIGRhdGEgaXMgY2xlYXJlZCBvdXQgYWZ0ZXIgYSB0cmFuc2FjdGlvbgoKaW50ZXJmYWNlIElUZXN0IHsKICAgIGZ1bmN0aW9uIHZhbCgpIGV4dG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VyIGxvY2soKSB7CiAgICAgICAgcmVxdWlyZSghbG9ja2VkKTsKICAgICAgICBsb2NrZWQgPSB0cnVlOwogICAgICAgIF87CiAgICAgICAgbG9ja2VkID0gZmFsc2U7CiAgICB9CgogICAgLy8gMzUzMTMgZ2FzCiAgICBmdW5jdGlvbiB0ZXN0KCkgcHVibGljIGxvY2sgewogICAgICAgIC8vIElnbm9yZSBjYWxsIGVycm9yCiAgICAgICAgYnl0ZXMgbWVtb3J5IGIgPSAiIjsKICAgICAgICBtc2cuc2VuZGVyLmNhbGwoYik7CiAgICB9Cn0KCmNvbnRyYWN0IFJlZW50cmFuY3lHdWFyZFRyYW5zaWVudCB7CiAgICBieXRlczMyIGNvbnN0YW50IFNMT1QgPSAwOwoKICAgIG1vZGlmaWVyIGxvY2soKSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBpZiB0bG9hZChTTE9UKSB7IHJldmVydCgwLCAwKSB9CiAgICAgICAgICAgIHRzdG9yZShTTE9ULCAxKQogICAgICAgIH0KICAgICAgICBfOwogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgdHN0b3JlKFNMT1QsIDApCiAgICAgICAgfQogICAgfQoKICAgIC8vIDIxODg3IGdhcwogICAgZnVuY3Rpb24gdGVzdCgpIGV4dGVybmFsIGxvY2sgewogICAgICAgIC8vIElnbm9yZSBjYWxsIGVycm9yCiAgICAgICAgYnl0ZXMgbWVtb3J5IGIgPSAiIjsKICAgICAgICBtc2cuc2VuZGVyLmNhbGwoYik7CiAgICB9Cn0K"}],u2=`

                                              Data stored in transient storage is cleared out after transaction.

                                              pragma solidity ^0.8.24;
                                               
                                               // Make sure EVM version and VM set to Cancun
                                              @@ -11880,7 +11880,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                       msg.sender.call(b);
                                                   }
                                               }
                                              -
                                              `,y2=({prev:s,next:a})=>r.jsx(u,{version:d2,title:C2,description:j2,html:A2,prev:s,next:a,codes:u2}),m2="0.8.24",b2="Try Catch",w2="An example of try / catch in Solidity",k2=[{fileName:"TryCatch.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIEV4dGVybmFsIGNvbnRyYWN0IHVzZWQgZm9yIHRyeSAvIGNhdGNoIGV4YW1wbGVzCmNvbnRyYWN0IEZvbyB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICBjb25zdHJ1Y3RvcihhZGRyZXNzIF9vd25lcikgewogICAgICAgIHJlcXVpcmUoX293bmVyICE9IGFkZHJlc3MoMCksICJpbnZhbGlkIGFkZHJlc3MiKTsKICAgICAgICBhc3NlcnQoX293bmVyICE9IDB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMSk7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICB9CgogICAgZnVuY3Rpb24gbXlGdW5jKHVpbnQyNTYgeCkgcHVibGljIHB1cmUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJlcXVpcmUoeCAhPSAwLCAicmVxdWlyZSBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gIm15IGZ1bmMgd2FzIGNhbGxlZCI7CiAgICB9Cn0KCmNvbnRyYWN0IEJhciB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwogICAgZXZlbnQgTG9nQnl0ZXMoYnl0ZXMgZGF0YSk7CgogICAgRm9vIHB1YmxpYyBmb287CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgLy8gVGhpcyBGb28gY29udHJhY3QgaXMgdXNlZCBmb3IgZXhhbXBsZSBvZiB0cnkgY2F0Y2ggd2l0aCBleHRlcm5hbCBjYWxsCiAgICAgICAgZm9vID0gbmV3IEZvbyhtc2cuc2VuZGVyKTsKICAgIH0KCiAgICAvLyBFeGFtcGxlIG9mIHRyeSAvIGNhd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AgICAgICAgLy8geW91IGNhbiB1c2UgdmFyaWFibGUgZm9vIGhlcmUKICAgICAgICAgICAgZW1pdCBMb2coIkZvbyBjcmVhdGVkIik7CiAgICAgICAgfSBjYXRjaCBFcnJvcihzdHJpbmcgbWVtb3J5IHJlYXNvbikgewogICAgICAgICAgICAvLyBjYXRjaCBmYWlsaW5nIHJldmVydCgpIGFuZCByZXF1aXJlKCkKICAgICAgICAgICAgZW1pdCBMb2cocmVhc29uKTsKICAgICAgICB9IGNhdGNoIChieXRlcyBtZW1vcnkgcmVhc29uKSB7CiAgICAgICAgICAgIC8vIGNhdGNoIGZhaWxpbmcgYXNzZXJ0KCkKICAgICAgICAgICAgZW1pdCBMb2dCeXRlcyhyZWFzb24pOwogICAgICAgIH0KICAgIH0KfQo="}],Z2=`

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

                                              +`,y2=({prev:s,next:a})=>r.jsx(A,{version:d2,title:C2,description:j2,html:u2,prev:s,next:a,codes:A2}),m2="0.8.24",b2="Try Catch",w2="An example of try / catch in Solidity",k2=[{fileName:"TryCatch.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCi8vIEV4dGVybmFsIGNvbnRyYWN0IHVzZWQgZm9yIHRyeSAvIGNhdGNoIGV4YW1wbGVzCmNvbnRyYWN0IEZvbyB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICBjb25zdHJ1Y3RvcihhZGRyZXNzIF9vd25lcikgewogICAgICAgIHJlcXVpcmUoX293bmVyICE9IGFkZHJlc3MoMCksICJpbnZhbGlkIGFkZHJlc3MiKTsKICAgICAgICBhc3NlcnQoX293bmVyICE9IDB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMSk7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICB9CgogICAgZnVuY3Rpb24gbXlGdW5jKHVpbnQyNTYge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W9uCiAgICAvLyB0cnlDYXRjaE5ld0NvbnRyYWN0KDB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMCkgPT4gTG9nKCJpbnZhbGlkIGFkZHJlc3MiKQogICAgLy8gdHJ5Q2F0Y2hOZXdDb250cmFjdCgweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDEpID0+IExvZ0J5dGVzKCIiKQogICAgLy8gdHJ5Q2F0Y2hOZXdDb250cmFjdCgweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDIpID0+IExvZygiRm9vIGNyZWF0ZWQiKQogICAgZnVuY3Rpb24gdHJ5Q2F0Y2hOZXdDb250cmFjdChhZGRyZXNzIF9vd25lcikgcHVibGljIHsKICAgICAgICB0cnkgbmV3IEZvbyhfb3duZXIpIHJldHVybnMgKEZvbyBmb28pIHsKICAgICAgICAgICAgLy8geW91IGNhbiB1c2UgdmFyaWFibGUgZm9vIGhlcmUKICAgICAgICAgICAgZW1pdCBMb2coIkZvbyBjcmVhdGVkIik7CiAgICAgICAgfSBjYXRjaCBFcnJvcihzdHJpbmcgbWVtb3J5IHJlYXNvbikgewogICAgICAgICAgICAvLyBjYXRjaCBmYWlsaW5nIHJldmVydCgpIGFuZCByZXF1aXJlKCkKICAgICAgICAgICAgZW1pdCBMb2cocmVhc29uKTsKICAgICAgICB9IGNhdGNoIChieXRlcyBtZW1vcnkgcmVhc29uKSB7CiAgICAgICAgICAgIC8vIGNhdGNoIGZhaWxpbmcgYXNzZXJ0KCkKICAgICAgICAgICAgZW1pdCBMb2dCeXRlcyhyZWFzb24pOwogICAgICAgIH0KICAgIH0KfQo="}],Z2=`

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

                                              // SPDX-License-Identifier: MIT
                                               pragma solidity ^0.8.24;
                                               
                                              @@ -11939,7 +11939,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                       }
                                                   }
                                               }
                                              -
                                              `,W2=({prev:s,next:a})=>r.jsx(u,{version:m2,title:b2,description:w2,html:Z2,prev:s,next:a,codes:k2}),B2="0.8.24",G2="Unchecked Math",V2="An example of unchecked math in Solidity",f2=[{fileName:"UncheckedMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFVuY2hlY2tlZE1hdGggewogICAgZnVuY3Rpb24gYWRkKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjI5MSBnYXMKICAgICAgICAvLyByZXR1cm4geCArIHk7CgogICAgICAgIC8vIDIyMTAzIGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4ICsgeTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3ViKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjMyOSBnYXMKICAgICAgICAvLyByZXR1cm4geCAtIHk7CgogICAgICAgIC8vIDIyMTQ3IGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4IC0geTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3VtT2ZDdWJlcyh1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgLy8gV3JhcCBjb21wbGV4IG1hdGggbG9naWMgaW5zaWRlIHVuY2hlY2tlZAogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHVpbnQyNTYgeDMgPSB4ICogeCAqIHg7CiAgICAgICAgICAgIHVpbnQyNTYgeTMgPSB5ICogeSAqIHk7CgogICAgICAgICAgICByZXR1cm4geDMgKyB5MzsKICAgICAgICB9CiAgICB9Cn0K"}],Y2=`

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

                                              +`,W2=({prev:s,next:a})=>r.jsx(A,{version:m2,title:b2,description:w2,html:Z2,prev:s,next:a,codes:k2}),B2="0.8.24",G2="Unchecked Math",V2="An example of unchecked math in Solidity",f2=[{fileName:"UncheckedMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFVuY2hlY2tlZE1hdGggewogICAgZnVuY3Rpb24gYWRkKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjI5MSBnYXMKICAgICAgICAvLyByZXR1cm4geCArIHk7CgogICAgICAgIC8vIDIyMTAzIGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4ICsgeTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3ViKHVpbnQyNTYgeCwgdWludDI1NiB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQyNTYpIHsKICAgICAgICAvLyAyMjMyOSBnYXMKICAgICAgICAvLyByZXR1cm4geCAtIHk7CgogICAgICAgIC8vIDIyMTQ3IGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4IC0geTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3VtT2ZDdWJlcyh1aW50MjU2IHgsIHVpbnQyNTYgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgLy8gV3JhcCBjb21wbGV4IG1hdGggbG9naWMgaW5zaWRlIHVuY2hlY2tlZAogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHVpbnQyNTYgeDMgPSB4ICogeCAqIHg7CiAgICAgICAgICAgIHVpbnQyNTYgeTMgPSB5ICogeSAqIHk7CgogICAgICAgICAgICByZXR1cm4geDMgKyB5MzsKICAgICAgICB9CiAgICB9Cn0K"}],Y2=`

                                              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.24;
                                              @@ -11975,7 +11975,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                       }
                                                   }
                                               }
                                              -
                                              `,R2=({prev:s,next:a})=>r.jsx(u,{version:B2,title:G2,description:V2,html:Y2,prev:s,next:a,codes:f2}),X2="0.8.24",v2="Variables",N2="Local, state and global variables",H2=[{fileName:"Variables.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFZhcmlhYmxlcyB7CiAgICAvLyBTdGF0ZSB2YXJpYWJsZXMgYXJlIHN0b3JlZCBvbiB0aGUgYmxvY2tjaGFpbi4KICAgIHN0cmluZyBwdWJsaWMgdGV4dCA9ICJIZWxsbyI7CiAgICB1aW50MjU2IHB1YmxpYyBudW0gPSAxMjM7CgogICAgZnVuY3Rpb24gZG9Tb21ldGhpbmcoKSBwdWJsaWMgewogICAgICAgIC8vIExvY2FsIHZhcmlhYmxlcyBhcmUgbm90IHNhdmVkIHRvIHRoZSBibG9ja2NoYWluLgogICAgICAgIHVpbnQyNTYgaSA9IDQ1NjsKCiAgICAgICAgLy8gSGVyZSBhcmUgc29tZSBnbG9iYWwgdmFyaWFibGVzCiAgICAgICAgdWludDI1NiB0aW1lc3RhbXAgPSBibG9jay50aW1lc3RhbXA7IC8vIEN1cnJlbnQgYmxvY2sgdGltZXN0YW1wCiAgICAgICAgYWRkcmVzcyBzZW5kZXIgPSBtc2cuc2VuZGVyOyAvLyBhZGRyZXNzIG9mIHRoZSBjYWxsZXIKICAgIH0KfQo="}],F2=`

                                              There are 3 types of variables in Solidity

                                              +`,R2=({prev:s,next:a})=>r.jsx(A,{version:B2,title:G2,description:V2,html:Y2,prev:s,next:a,codes:f2}),X2="0.8.24",v2="Variables",N2="Local, state and global variables",H2=[{fileName:"Variables.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFZhcmlhYmxlcyB7CiAgICAvLyBTdGF0ZSB2YXJpYWJsZXMgYXJlIHN0b3JlZCBvbiB0aGUgYmxvY2tjaGFpbi4KICAgIHN0cmluZyBwdWJsaWMgdGV4dCA9ICJIZWxsbyI7CiAgICB1aW50MjU2IHB1YmxpYyBudW0gPSAxMjM7CgogICAgZnVuY3Rpb24gZG9Tb21ldGhpbmcoKSBwdWJsaWMgewogICAgICAgIC8vIExvY2FsIHZhcmlhYmxlcyBhcmUgbm90IHNhdmVkIHRvIHRoZSBibG9ja2NoYWluLgogICAgICAgIHVpbnQyNTYgaSA9IDQ1NjsKCiAgICAgICAgLy8gSGVyZSBhcmUgc29tZSBnbG9iYWwgdmFyaWFibGVzCiAgICAgICAgdWludDI1NiB0aW1lc3RhbXAgPSBibG9jay50aW1lc3RhbXA7IC8vIEN1cnJlbnQgYmxvY2sgdGltZXN0YW1wCiAgICAgICAgYWRkcmVzcyBzZW5kZXIgPSBtc2cuc2VuZGVyOyAvLyBhZGRyZXNzIG9mIHRoZSBjYWxsZXIKICAgIH0KfQo="}],F2=`

                                              There are 3 types of variables in Solidity

                                              • local
                                                • declared inside a function
                                                • @@ -12006,7 +12006,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller address sender = msg.sender; // address of the caller } } -`,K2=({prev:s,next:a})=>r.jsx(u,{version:X2,title:v2,description:N2,html:F2,prev:s,next:a,codes:H2}),M2="0.8.24",S2="View and Pure Functions",x2="An example of view and pure functions in Solidity",J2=[{fileName:"ViewAndPureFunctions.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFZpZXdBbmRQdXJlIHsKICAgIHVpbnQyNTYgcHVibGljIHggPSAxOwoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSB0aGUgc3RhdGUuCiAgICBmdW5jdGlvbiBhZGRUb1godWludDI1NiB5KSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHggKyB5OwogICAgfQoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSBvciByZWFkIGZyb20gdGhlIHN0YXRlLgogICAgZnVuY3Rpb24gYWRkKHVpbnQyNTYgaSwgdWludDI1NiBqKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGkgKyBqOwogICAgfQp9Cg=="}],z2=`

                                                  Getter functions can be declared view or pure.

                                                  +`,K2=({prev:s,next:a})=>r.jsx(A,{version:X2,title:v2,description:N2,html:F2,prev:s,next:a,codes:H2}),M2="0.8.24",S2="View and Pure Functions",x2="An example of view and pure functions in Solidity",J2=[{fileName:"ViewAndPureFunctions.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IFZpZXdBbmRQdXJlIHsKICAgIHVpbnQyNTYgcHVibGljIHggPSAxOwoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSB0aGUgc3RhdGUuCiAgICBmdW5jdGlvbiBhZGRUb1godWludDI1NiB5KSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIHggKyB5OwogICAgfQoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSBvciByZWFkIGZyb20gdGhlIHN0YXRlLgogICAgZnVuY3Rpb24gYWRkKHVpbnQyNTYgaSwgdWludDI1NiBqKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50MjU2KSB7CiAgICAgICAgcmV0dXJuIGkgKyBqOwogICAgfQp9Cg=="}],z2=`

                                                  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
                                                  @@ -12025,7 +12025,7 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                           return i + j;
                                                       }
                                                   }
                                                  -
                                                  `,D2=({prev:s,next:a})=>r.jsx(u,{version:M2,title:S2,description:x2,html:z2,prev:s,next:a,codes:J2}),E2="0.8.24",Q2="Visibility",T2="An example of external, internal, private and public functions in Solidity",U2=[{fileName:"Visibility.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEJhc2UgewogICAgLy8gUHJpdmF0ZSBmdW5jdGlvbiBjYW4gb25seSBiZSBjYWxsZWQKICAgIC8vIC0gaW5zaWRlIHRoaXMgY29udHJhY3QKICAgIC8vIENvbnRyYWN0cyB0aGF0IGluaGVyaXQgdGhpcyBjb250cmFjdCBjYW5ub3QgY2FsbCB0aGlzIGZ1bmN0aW9uLgogICAgZnVuY3Rpb24gcHJpdmF0ZUZ1bmMoKSBwcml2YXRlIHB1cmUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAicHJpdmF0ZSBmdW5jdGlvbiBjYWxsZWQiOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RQcml2YXRlRnVuYygpIHB1YmxpYyBwdXJlIHJldHVybnMgKHN0cmluZyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gcHJpdmF0ZUZ1bmMoKTsKICA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IGZ1bmN0aW9uIGNhbiBiZSBjYWxsZWQgaW5zaWRlIGNoaWxkIGNvbnRyYWN0cy4KICAgIGZ1bmN0aW9uIHRlc3RJbnRlcm5hbEZ1bmMoKSBwdWJsaWMgcHVyZSBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGludGVybmFsRnVuYygpOwogICAgfQp9Cg=="}],_2=`

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

                                                  +`,D2=({prev:s,next:a})=>r.jsx(A,{version:M2,title:S2,description:x2,html:z2,prev:s,next:a,codes:J2}),E2="0.8.24",Q2="Visibility",T2="An example of external, internal, private and public functions in Solidity",U2=[{fileName:"Visibility.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yNDsKCmNvbnRyYWN0IEJhc2UgewogICAgLy8gUHJpdmF0ZSBmdW5jdGlvbiBjYW4gb25seSBiZSBjYWxsZWQKICAgIC8vIC0gaW5zaWRlIHRoaXMgY29udHJhY3QKICAgIC8vIENvbnRyYWN0cyB0aGF0IGluaGVyaXQgdGhpcyBjb250cmFjdCBjYW5ub3QgY2FsbCB0aGlzIGZ1bmN0aW9uLgogICAgZnVuY3Rpb24gcHJpdmF0ZUZ1bmMoKSBwcml2YXRlIHB1cmUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAicHJpdmF0ZSBmdW5jdGlvbiBjYWxsZWQiOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RQcml2YXRlRnVuYygpIHB1YmxpYyBwdXJlIHJldHVybnMgKHN0cmluZyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gcHJpdmF0ZUZ1bmMoKTsKICAgIH0KCiAgICAvLyBJbnRlcm5hbCBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkCiAgICAvLyAtIGluc2lkZSB0aGlzIGNvbnRyYWN0CiA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bEZ1bmMoKSBwdWJsaWMgcHVyZSBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGludGVybmFsRnVuYygpOwogICAgfQp9Cg=="}],_2=`

                                                  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
                                                  • @@ -12100,4 +12100,4 @@ echidna EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller return internalFunc(); } } -`,L2=({prev:s,next:a})=>r.jsx(u,{version:E2,title:Q2,description:T2,html:_2,prev:s,next:a,codes:U2}),O2=({size:s,className:a=""})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",width:s,height:s,className:a,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})}),P2="_component_efeb7_1",$2="_icon_efeb7_8",q2="_input_efeb7_12",Ie={component:P2,icon:$2,input:q2},sB=({value:s,onChange:a})=>{function n(l){a(l.target.value)}return r.jsxs("div",{className:Ie.component,children:[r.jsx(O2,{size:18,className:Ie.icon}),r.jsx("input",{className:Ie.input,placeholder:"Search",value:s,onChange:n})]})},aB=({size:s,className:a=""})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 113 113",xmlSpace:"preserve",width:s,height:s,className:a,children:[r.jsx("circle",{cx:56.5,cy:56.5,r:56.5,fill:"#453dff",stroke:"none"}),r.jsx("path",{fill:"#fff",stroke:"none",d:"M68.476 46.383c.454.796 1.36 1.82 2.155 1.82 4.31.227 8.62.113 13.157.113-.567-3.98-2.042-7.392-4.31-10.462-1.361-1.706-1.701-2.957-.34-4.89 1.36-1.82 2.381-4.094 3.63-6.255-3.97-2.274-7.827-4.435-11.797-6.709-1.36 2.274-2.609 4.321-3.743 6.482-.68 1.365-1.36 1.706-2.949 1.478-3.63-.455-7.259-.91-10.888-.682-10.889.682-19.85 7.96-22.798 18.423-3.29 11.94-1.702 22.97 6.805 32.523-1.588 2.843-3.29 5.8-4.99 8.87 4.083 2.275 7.826 4.55 11.795 6.824 1.588-2.73 3.063-5.231 4.424-7.733.68-1.251 1.588-1.365 2.949-1.479 4.65 0 9.3.228 13.724-.682 9.3-1.82 17.354-10.803 18.375-20.128-4.084 0-7.94.113-11.91 0-1.588 0-2.609.455-3.403 1.933-4.537 7.62-15.312 8.87-21.21 2.502-5.557-5.914-5.557-18.764.114-24.677 6.011-6.141 16.56-4.777 21.21 2.729z"})]});var nB="Expected a function",Ro=NaN,lB="[object Symbol]",pB=/^\s+|\s+$/g,eB=/^[-+]0x[0-9a-f]+$/i,cB=/^0b[01]+$/i,tB=/^0o[0-7]+$/i,oB=parseInt,rB=typeof Il=="object"&&Il&&Il.Object===Object&&Il,iB=typeof self=="object"&&self&&self.Object===Object&&self,gB=rB||iB||Function("return this")(),hB=Object.prototype,IB=hB.toString,dB=Math.max,CB=Math.min,de=function(){return gB.Date.now()};function jB(s,a,n){var l,p,e,c,t,o,i=0,I=!1,d=!1,j=!0;if(typeof s!="function")throw new TypeError(nB);a=Xo(a)||0,ic(n)&&(I=!!n.leading,d="maxWait"in n,e=d?dB(Xo(n.maxWait)||0,a):e,j="trailing"in n?!!n.trailing:j);function A(k){var G=l,Y=p;return l=p=void 0,i=k,c=s.apply(Y,G),c}function m(k){return i=k,t=setTimeout(h,a),I?A(k):c}function b(k){var G=k-o,Y=k-i,x=a-G;return d?CB(x,e-Y):x}function B(k){var G=k-o,Y=k-i;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?A(k):(l=p=void 0,c)}function C(){t!==void 0&&clearTimeout(t),i=0,l=o=p=t=void 0}function y(){return t===void 0?c:g(de())}function Z(){var k=de(),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),A(o)}return t===void 0&&(t=setTimeout(h,a)),c}return Z.cancel=C,Z.flush=y,Z}function ic(s){var a=typeof s;return!!s&&(a=="object"||a=="function")}function uB(s){return!!s&&typeof s=="object"}function AB(s){return typeof s=="symbol"||uB(s)&&IB.call(s)==lB}function Xo(s){if(typeof s=="number")return s;if(AB(s))return Ro;if(ic(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=ic(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=s.replace(pB,"");var n=cB.test(s);return n||tB.test(s)?oB(s.slice(2),n?2:8):eB.test(s)?Ro:+s}var yB=jB;const mB=Ko(yB),bB={leading:!1,trailing:!0};function wB(s,a,n){return W.useCallback(mB(s,a,bB),n)}function kB(s,a){let n=s;for(let l=0;l0;){const[e,c,t]=a.pop();p&&(l=l.slice(0,c-1),p=!1),l+=e;const o=Object.keys(t);if(o.length>0)for(let i=0;ia+p)}const BB=["/visibility"],GB=["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],VB=["/visibility"],fB=["/visibility","/hacks/hiding-malicious-code-with-external-contract"],YB=["/view-and-pure-functions"],RB=["/view-and-pure-functions"],XB=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/evm/storage","/ether-units","/enum","/constants","/assembly-variable","/array"],vB=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/ether-units","/enum","/constants","/array"],NB=["/variables"],HB=["/variables"],FB=["/variables","/state-variables","/shadowing-inherited-state-variables","/evm/storage"],KB=["/variables","/structs","/primitives","/mapping","/immutable","/hacks/accessing-private-data","/evm/storage","/evm/memory","/ether-units","/enum","/data-locations","/constants","/array","/app/iterable-mapping"],MB=["/unchecked-math","/gas-golf","/gas"],SB=["/unchecked-math"],xB=["/unchecked-math","/assembly-math","/app/assembly-bin-exp"],JB=["/unchecked-math","/hacks/overflow"],zB=["/unchecked-math","/hacks/overflow"],DB=["/try-catch","/error","/assembly-error"],EB=["/try-catch","/error"],QB=["/transient-storage"],TB=["/transient-storage","/hacks/accessing-private-data","/evm/storage","/data-locations","/app/write-to-any-slot"],UB=["/tests/echidna"],_B=["/tests/echidna"],LB=["/super","/calling-contract"],OB=["/super"],PB=["/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"],$B=["/super","/new-contract","/interface","/inheritance","/first-app","/delegatecall","/calling-contract","/call"],qB=["/super","/shadowing-inherited-state-variables","/inheritance","/constructor"],sG=["/structs"],aG=["/structs"],nG=["/structs","/primitives"],lG=["/structs","/primitives"],pG=["/state-variables"],eG=["/state-variables"],cG=["/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"],tG=["/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"],oG=["/signature","/hashing","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/merkle-tree","/app/bi-directional-payment-channel"],rG=["/signature"],iG=["/signature"],gG=["/signature","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/multi-sig-wallet","/app/bi-directional-payment-channel"],hG=["/signature"],IG=["/signature"],dG=["/shadowing-inherited-state-variables"],CG=["/shadowing-inherited-state-variables"],jG=["/sending-ether"],uG=["/sending-ether","/sending-ether","/payable","/fallback"],AG=["/sending-ether","/payable","/fallback","/ether-units","/app/ether-wallet"],yG=["/sending-ether","/payable","/fallback","/app/ether-wallet"],mG=["/sending-ether","/fallback","/app/gasless-token-transfer"],bG=["/sending-ether","/delegatecall","/calling-contract","/call","/app/multi-call"],wG=["/sending-ether","/fallback"],kG=["/sending-ether","/fallback"],ZG=["/sending-ether","/payable","/fallback"],WG=["/primitives"],BG=["/primitives"],GG=["/primitives"],VG=["/primitives"],fG=["/primitives"],YG=["/primitives","/hacks/deploy-different-contracts-same-address","/app/create2"],RG=["/primitives"],XG=["/primitives"],vG=["/new-contract","/hacks/deploy-different-contracts-same-address"],NG=["/new-contract"],HG=["/new-contract","/hacks/deploy-different-contracts-same-address","/app/create2"],FG=["/new-contract","/hacks/deploy-different-contracts-same-address"],KG=["/mapping","/app/iterable-mapping"],MG=["/loop","/assembly-loop"],SG=["/loop"],xG=["/library"],JG=["/interface"],zG=["/inheritance"],DG=["/inheritance"],EG=["/inheritance"],QG=["/immutable","/defi/constant-sum-amm","/defi/constant-product-amm","/constants"],TG=["/immutable","/constants"],UG=["/immutable"],_G=["/immutable"],LG=["/if-else"],OG=["/if-else"],PG=["/if-else"],$G=["/hello-world"],qG=["/hello-world"],sV=["/hashing"],aV=["/hashing"],nV=["/hashing"],lV=["/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"],pV=["/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"],eV=["/hacks/weth-permit"],cV=["/hacks/weth-permit","/app/gasless-token-transfer"],tV=["/hacks/vault-inflation"],oV=["/hacks/vault-inflation"],rV=["/hacks/vault-inflation","/defi/vault"],iV=["/hacks/signature-replay"],gV=["/hacks/self-destruct"],hV=["/hacks/randomness"],IV=["/hacks/randomness"],dV=["/hacks/randomness"],CV=["/hacks/randomness"],jV=["/hacks/randomness","/hacks/block-timestamp-manipulation"],uV=["/hacks/randomness","/hacks/block-timestamp-manipulation"],AV=["/hacks/phishing-with-tx-origin"],yV=["/hacks/overflow"],mV=["/hacks/honeypot"],bV=["/hacks/hiding-malicious-code-with-external-contract"],wV=["/hacks/hiding-malicious-code-with-external-contract"],kV=["/hacks/hiding-malicious-code-with-external-contract"],ZV=["/hacks/hiding-malicious-code-with-external-contract"],WV=["/hacks/front-running"],BV=["/hacks/front-running"],GV=["/hacks/deploy-different-contracts-same-address","/app/deploy-any-contract"],VV=["/hacks/deploy-different-contracts-same-address"],fV=["/hacks/deploy-different-contracts-same-address"],YV=["/hacks/denial-of-service"],RV=["/hacks/denial-of-service"],XV=["/hacks/delegatecall","/delegatecall","/app/upgradeable-proxy","/app/multi-delegatecall"],vV=["/hacks/contract-size"],NV=["/hacks/contract-size"],HV=["/hacks/contract-size"],FV=["/hacks/contract-size"],KV=["/hacks/block-timestamp-manipulation"],MV=["/hacks/accessing-private-data"],SV=["/hacks/accessing-private-data"],xV=["/gas-golf"],JV=["/function-selector"],zV=["/function-selector"],DV=["/function-modifier"],EV=["/function-modifier"],QV=["/function-modifier"],TV=["/first-app"],UV=["/first-app"],_V=["/evm/storage","/evm/memory"],LV=["/evm/storage","/evm/memory","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],OV=["/evm/storage","/evm/memory","/bitwise","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],PV=["/evm/memory","/data-locations"],$V=["/events"],qV=["/events"],sf=["/ether-units"],af=["/ether-units"],nf=["/error"],lf=["/error","/assembly-error"],pf=["/error"],ef=["/enum"],cf=["/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"],tf=["/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"],of=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash"],rf=["/defi/uniswap-v3-swap","/defi/uniswap-v3-flash-swap","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2","/defi/stable-swap-amm"],gf=["/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"],hf=["/defi/uniswap-v3-liquidity","/defi/uniswap-v2-add-remove-liquidity"],If=["/defi/uniswap-v3-flash-swap"],df=["/defi/uniswap-v3-flash","/defi/uniswap-v2-flash-swap"],Cf=["/defi/uniswap-v3-flash"],jf=["/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2"],uf=["/defi/uniswap-v2-optimal-one-sided-supply"],Af=["/defi/uniswap-v2-optimal-one-sided-supply"],yf=["/defi/uniswap-v2-optimal-one-sided-supply"],mf=["/defi/uniswap-v2-optimal-one-sided-supply"],bf=["/defi/uniswap-v2-add-remove-liquidity","/assembly-math"],wf=["/defi/uniswap-v2-add-remove-liquidity"],kf=["/defi/staking-rewards","/defi/discrete-staking-rewards"],Zf=["/defi/staking-rewards","/defi/discrete-staking-rewards"],Wf=["/defi/staking-rewards","/defi/discrete-staking-rewards"],Bf=["/defi/stable-swap-amm"],Gf=["/defi/stable-swap-amm"],Vf=["/defi/discrete-staking-rewards"],ff=["/defi/dai-proxy"],Yf=["/defi/dai-proxy","/app/upgradeable-proxy","/app/minimal-proxy"],Rf=["/defi/constant-sum-amm"],Xf=["/defi/constant-product-amm"],vf=["/defi/chainlink-price-oracle"],Nf=["/defi/chainlink-price-oracle"],Hf=["/defi/chainlink-price-oracle"],Ff=["/defi/chainlink-price-oracle"],Kf=["/data-locations"],Mf=["/data-locations"],Sf=["/data-locations"],xf=["/constructor"],Jf=["/constructor"],zf=["/calling-contract"],Df=["/bitwise"],Ef=["/bitwise"],Qf=["/bitwise"],Tf=["/bitwise"],Uf=["/assembly-math"],_f=["/array"],Lf=["/array"],Of=["/app/write-to-any-slot"],Pf=["/app/write-to-any-slot","/app/deploy-any-contract"],$f=["/app/write-to-any-slot"],qf=["/app/upgradeable-proxy"],s1=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],a1=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],n1=["/app/time-lock"],l1=["/app/time-lock"],p1=["/app/simple-bytecode-contract"],e1=["/app/simple-bytecode-contract"],c1=["/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call"],t1=["/app/multi-sig-wallet"],o1=["/app/multi-sig-wallet","/app/ether-wallet"],r1=["/app/multi-call"],i1=["/app/minimal-proxy"],g1=["/app/merkle-tree"],h1=["/app/merkle-tree"],I1=["/app/iterable-mapping"],d1=["/app/gasless-token-transfer"],C1=["/app/gasless-token-transfer","/app/erc20"],j1=["/app/gasless-token-transfer"],u1=["/app/erc721"],A1=["/app/erc721"],y1=["/app/erc721","/app/erc1155"],m1=["/app/erc20"],b1=["/app/erc20"],w1=["/app/erc1155"],k1=["/app/erc1155"],Z1=["/app/english-auction"],W1=["/app/english-auction","/app/dutch-auction"],B1=["/app/english-auction","/app/dutch-auction"],G1=["/app/dutch-auction"],V1=["/app/crowd-fund"],f1=["/app/crowd-fund"],Y1=["/app/crowd-fund"],R1=["/app/create2"],X1=["/app/assembly-bin-exp"],v1=["/app/assembly-bin-exp"],N1=["/abi-encode","/abi-decode"],H1=["/abi-encode"],F1=["/abi-encode","/abi-decode"],K1=["/abi-encode"],M1=["/abi-encode"],S1=["/abi-encode"],x1=["/abi-decode"],vo={visibility:BB,function:["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],functions:GB,internal:VB,private:["/visibility","/hacks/accessing-private-data"],public:["/visibility"],external:fB,view:YB,pure:RB,variable:XB,variables:vB,local:NB,global:HB,state:FB,data:KB,gas:MB,unchecked:SB,math:xB,overflow:JB,underflow:zB,try:["/try-catch"],catch:["/try-catch"],error:DB,errors:EB,transient:QB,storage:TB,test:UB,echidna:_B,calling:LB,parent:OB,contract:PB,contracts:$B,inheritance:qB,super:["/super","/inheritance"],struct:sG,structs:aG,type:nG,types:lG,reading:pG,writing:eG,app:cG,application:tG,cryptography:oG,verify:rG,verifying:iG,signature:gG,signatures:hG,ecrecover:IG,shadow:dG,shadowing:CG,sending:jG,send:uG,ether:AG,eth:yG,transfer:mG,call:bG,fallback:wG,receive:kG,payable:ZG,primitive:WG,primitives:BG,boolean:GG,uint256:VG,int256:fG,address:YG,uint:RG,int:XG,new:["/new-contract","/new-contract"],create:vG,creates:NG,create2:HG,salt:FG,mapping:KG,for:["/loop","/assembly-loop"],loop:MG,loops:SG,while:["/loop","/assembly-loop"],do:["/loop"],library:xG,interface:["/interface"],interfaces:JG,override:zG,virtual:DG,is:EG,import:["/import","/enum"],constant:QG,constants:TG,immutable:UG,immutables:_G,if:["/if-else","/assembly-if"],else:["/if-else"],conditional:LG,statement:OG,statements:PG,hello:$G,world:qG,hash:sV,hashing:aV,keccak256:nV,hack:lV,security:pV,weth:eV,permit:cV,inflation:tV,erc4626:oV,vault:rV,replay:iV,selfdestruct:gV,"re-entrancy":["/hacks/re-entrancy"],source:hV,random:IV,randomness:dV,blockhash:CV,block:jV,timestamp:uV,phishing:AV,"tx.origin":["/hacks/phishing-with-tx-origin"],arithmetic:yV,honeypot:mV,hide:bV,hiding:wV,malicious:kV,code:ZV,front:WV,running:BV,deploy:GV,different:VV,same:fV,denial:YV,service:RV,delegatecall:XV,bypass:vV,size:NV,check:HV,extcodesize:FV,manipulation:KV,access:MV,accessing:SV,golf:xV,selector:JV,selectors:zV,modifier:DV,modifiers:EV,_:QV,first:TV,counter:UV,evm:_V,yul:LV,assembly:OV,memory:PV,event:$V,events:qV,wei:sf,units:af,require:nf,revert:lf,assert:pf,enum:["/enum"],imports:ef,defi:cf,uniswap:tf,v3:of,swap:rf,amm:gf,liquidity:hf,arbitrage:If,flash:df,loan:Cf,v2:jf,optimal:uf,one:Af,sided:yf,supply:mf,add:bf,remove:wf,staking:kf,reward:Zf,rewards:Wf,curve:Bf,stable:Gf,discrete:Vf,dai:ff,proxy:Yf,sum:Rf,product:Xf,chainlink:vf,price:Nf,oracle:Hf,oracles:Ff,location:Kf,locations:Mf,calldata:Sf,constructor:xf,constructors:Jf,other:zf,bitwise:Df,most:Ef,significant:Qf,bit:Tf,mul:Uf,switch:["/assembly-if"],array:_f,arrays:Lf,write:Of,any:Pf,slot:$f,upgradeable:qf,"uni-directional":["/app/uni-directional-payment-channel"],payment:s1,channel:a1,time:n1,lock:l1,simple:p1,bytecode:e1,multi:c1,sig:t1,wallet:o1,staticcall:r1,minimal:i1,merkle:g1,tree:h1,iterable:I1,gasless:d1,token:C1,ERC20:j1,erc721:u1,ierc721:A1,nft:y1,erc20:m1,ierc20:b1,erc1155:w1,ierc1155:k1,english:Z1,auction:W1,auctions:B1,dutch:G1,crowd:V1,fund:f1,funding:Y1,precompute:R1,"bi-directional":["/app/bi-directional-payment-channel"],binary:X1,exponentiation:v1,abi:N1,encode:H1,bytes:F1,encodeWithSelector:K1,encodeWithSignature:M1,encodeCall:S1,decode:x1},No={"/visibility":["visibility","function","functions","internal","private","public","external"],"/view-and-pure-functions":["view","pure","function","functions"],"/variables":["variable","variables","local","global","state","data"],"/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":["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"],"/abi-encode":["abi","encode","bytes","encodeWithSelector","encodeWithSignature","encodeCall"],"/abi-decode":["abi","decode","bytes"]},jg=[];for(const s of Object.keys(No))jg.push(...No[s]);const ug={};for(const s of jg)kB(ug,s);function J1(s){return Array.from(new Set(s))}function z1(s){const a=[],n=WB(ug,s.toLowerCase());for(const l of n)vo[l]&&a.push(...vo[l]);return a}const D1="_component_ri31z_1",E1="_updates_ri31z_8",Q1="_category_ri31z_13",T1="_search_ri31z_16",U1="_listItem_ri31z_20",_1="_label_ri31z_28",L1="_header_ri31z_31",O1="_youTube_ri31z_34",P1="_youTubeLogo_ri31z_40",$1="_cryptoJobsList_ri31z_44",q1="_cryptoJobsListLogo_ri31z_50",as={component:D1,updates:E1,category:Q1,search:T1,listItem:U1,label:_1,header:L1,youTube:O1,youTubeLogo:P1,cryptoJobsList:$1,cryptoJobsListLogo:q1},sY=["2024/04/19 - EVM memory","2024/04/07 - Fix WETH permit hack","2024/04/06 - EVM storage"];function aY(){const[s,a]=W.useState(""),[n,l]=xd(),[p,e]=W.useState(null);W.useEffect(()=>{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 A=J1(j.split(" ")),m={};for(const b of A){const B=z1(b);for(const h of B)m[h]=!0}e(m),d&&l({q:j})}const t=wB(I=>c(I,!0),500,[]);function o(I){a(I),t(I)}function i(){return p?Object.keys(p).length==0?r.jsx("div",{children:"No results"}):r.jsx("ul",{className:as.list,children:Cp.filter(({path:I})=>p[I]).map(({path:I,title:d})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:I,children:d})},I))}):r.jsxs(r.Fragment,{children:[ot.map(({routes:I,title:d},j)=>r.jsxs("div",{children:[d&&r.jsx("h3",{className:as.category,children:d}),r.jsx("ul",{className:as.list,children:I.map(({path:A,title:m})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:A,children:m})},A))})]},j)),r.jsxs("div",{children:[r.jsx("h3",{className:as.category,children:"Translations"}),Od.map(({lang:I,url:d})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:d,target:"__blank",children:I})},d))]})]})}return r.jsxs("div",{className:as.component,children:[r.jsx(Cg,{title:"Solidity by Example | 0.8.24",description:"Learn smart contract programming using Solidity"}),r.jsx("h1",{className:as.header,children:r.jsx("a",{href:"/",children:"Solidity by Example"})}),r.jsx("div",{className:as.subHeader,children:"v 0.8.24"}),r.jsxs("div",{className:as.main,children:[r.jsxs("p",{children:["Introduction to ",r.jsx("a",{href:"https://solidity.readthedocs.io",children:"Solidity"})," with simple examples"]}),r.jsxs("div",{className:as.youTube,children:[r.jsx("img",{src:dg,alt:"logo",className:as.youTubeLogo}),r.jsx("a",{href:"https://www.youtube.com/@smartcontractprogrammer",target:"__blank",children:"Most code are explained here"})]}),r.jsxs("div",{className:as.cryptoJobsList,children:[r.jsx(aB,{size:24,className:as.cryptoJobsListLogo}),r.jsx("a",{href:Ig,target:"__blank",children:"Looking for Solidity jobs?"})]}),r.jsx("div",{className:as.updates,children:sY.map((I,d)=>r.jsx("div",{children:I},d))}),r.jsx("div",{className:as.search,children:r.jsx(sB,{value:s,onChange:o})}),i()]})]})}const nY=[{path:"/abi-decode",component:DC},{path:"/abi-encode",component:LC},{path:"/app/assembly-bin-exp",component:aj},{path:"/app/bi-directional-payment-channel",component:tj},{path:"/app/create2",component:Ij},{path:"/app/crowd-fund",component:yj},{path:"/app/deploy-any-contract",component:Wj},{path:"/app/dutch-auction",component:Rj},{path:"/app/english-auction",component:Kj},{path:"/app/erc1155",component:Dj},{path:"/app/erc20",component:Lj},{path:"/app/erc721",component:au},{path:"/app/ether-wallet",component:tu},{path:"/app/gasless-token-transfer",component:Iu},{path:"/app/iterable-mapping",component:yu},{path:"/app/merkle-tree",component:Wu},{path:"/app/minimal-proxy",component:Ru},{path:"/app/multi-call",component:Ku},{path:"/app/multi-delegatecall",component:Du},{path:"/app/multi-sig-wallet",component:Lu},{path:"/app/simple-bytecode-contract",component:aA},{path:"/app/time-lock",component:tA},{path:"/app/uni-directional-payment-channel",component:IA},{path:"/app/upgradeable-proxy",component:yA},{path:"/app/write-to-any-slot",component:WA},{path:"/array",component:RA},{path:"/assembly-error",component:KA},{path:"/assembly-if",component:DA},{path:"/assembly-loop",component:LA},{path:"/assembly-math",component:ay},{path:"/assembly-variable",component:ty},{path:"/bitwise",component:Iy},{path:"/call",component:yy},{path:"/calling-contract",component:Wy},{path:"/constants",component:Ry},{path:"/constructor",component:Ky},{path:"/data-locations",component:Dy},{path:"/defi/chainlink-price-oracle",component:Ly},{path:"/defi/constant-product-amm",component:am},{path:"/defi/constant-sum-amm",component:tm},{path:"/defi/dai-proxy",component:Im},{path:"/defi/discrete-staking-rewards",component:ym},{path:"/defi/stable-swap-amm",component:Wm},{path:"/defi/staking-rewards",component:Rm},{path:"/defi/uniswap-v2",component:Km},{path:"/defi/uniswap-v2-add-remove-liquidity",component:Dm},{path:"/defi/uniswap-v2-flash-swap",component:Lm},{path:"/defi/uniswap-v2-optimal-one-sided-supply",component:ab},{path:"/defi/uniswap-v3-flash",component:tb},{path:"/defi/uniswap-v3-flash-swap",component:Ib},{path:"/defi/uniswap-v3-liquidity",component:yb},{path:"/defi/uniswap-v3-swap",component:Wb},{path:"/defi/vault",component:Rb},{path:"/delegatecall",component:Kb},{path:"/enum",component:Db},{path:"/error",component:Lb},{path:"/ether-units",component:aw},{path:"/events",component:tw},{path:"/evm/memory",component:Iw},{path:"/evm/storage",component:yw},{path:"/fallback",component:Ww},{path:"/first-app",component:Rw},{path:"/function",component:Kw},{path:"/function-modifier",component:Dw},{path:"/function-selector",component:Lw},{path:"/gas",component:ak},{path:"/gas-golf",component:tk},{path:"/hacks/accessing-private-data",component:Ik},{path:"/hacks/block-timestamp-manipulation",component:yk},{path:"/hacks/contract-size",component:Wk},{path:"/hacks/delegatecall",component:Rk},{path:"/hacks/denial-of-service",component:Kk},{path:"/hacks/deploy-different-contracts-same-address",component:Dk},{path:"/hacks/front-running",component:Lk},{path:"/hacks/hiding-malicious-code-with-external-contract",component:a0},{path:"/hacks/honeypot",component:t0},{path:"/hacks/overflow",component:I0},{path:"/hacks/phishing-with-tx-origin",component:y0},{path:"/hacks/randomness",component:W0},{path:"/hacks/re-entrancy",component:R0},{path:"/hacks/self-destruct",component:K0},{path:"/hacks/signature-replay",component:D0},{path:"/hacks/vault-inflation",component:L0},{path:"/hacks/weth-permit",component:aZ},{path:"/hashing",component:tZ},{path:"/hello-world",component:IZ},{path:"/if-else",component:yZ},{path:"/immutable",component:WZ},{path:"/import",component:RZ},{path:"/inheritance",component:KZ},{path:"/interface",component:DZ},{path:"/library",component:LZ},{path:"/loop",component:aW},{path:"/mapping",component:tW},{path:"/new-contract",component:IW},{path:"/payable",component:yW},{path:"/primitives",component:WW},{path:"/sending-ether",component:RW},{path:"/shadowing-inherited-state-variables",component:KW},{path:"/signature",component:DW},{path:"/state-variables",component:LW},{path:"/structs",component:a2},{path:"/super",component:t2},{path:"/tests/echidna",component:I2},{path:"/transient-storage",component:y2},{path:"/try-catch",component:W2},{path:"/unchecked-math",component:R2},{path:"/variables",component:K2},{path:"/view-and-pure-functions",component:D2},{path:"/visibility",component:L2},{path:"",component:aY}];function Ho(){const{state:s,init:a}=et();return W.useLayoutEffect(()=>{a({width:window.document.body.clientWidth})},[]),s.initialized?r.jsx(Sd,{basename:"",children:r.jsx(RC,{children:r.jsx(Fd,{children:nY.map(n=>{const{prev:l,next:p}=pC(n.path);return r.jsx(hg,{path:n.path,element:Uo.createElement(n.component,{prev:l,next:p})},n.path)})})})}):null}const lY=document.getElementById("root"),pY=qi(lY),Fo=document.getElementById("root");Fo.hasChildNodes()?$i(Fo,r.jsx(bo,{children:r.jsx(Ho,{})})):pY.render(r.jsx(bo,{children:r.jsx(Ho,{})})); +`,L2=({prev:s,next:a})=>r.jsx(A,{version:E2,title:Q2,description:T2,html:_2,prev:s,next:a,codes:U2}),O2=({size:s,className:a=""})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",width:s,height:s,className:a,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})}),P2="_component_efeb7_1",$2="_icon_efeb7_8",q2="_input_efeb7_12",Ie={component:P2,icon:$2,input:q2},sB=({value:s,onChange:a})=>{function n(l){a(l.target.value)}return r.jsxs("div",{className:Ie.component,children:[r.jsx(O2,{size:18,className:Ie.icon}),r.jsx("input",{className:Ie.input,placeholder:"Search",value:s,onChange:n})]})},aB=({size:s,className:a=""})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 113 113",xmlSpace:"preserve",width:s,height:s,className:a,children:[r.jsx("circle",{cx:56.5,cy:56.5,r:56.5,fill:"#453dff",stroke:"none"}),r.jsx("path",{fill:"#fff",stroke:"none",d:"M68.476 46.383c.454.796 1.36 1.82 2.155 1.82 4.31.227 8.62.113 13.157.113-.567-3.98-2.042-7.392-4.31-10.462-1.361-1.706-1.701-2.957-.34-4.89 1.36-1.82 2.381-4.094 3.63-6.255-3.97-2.274-7.827-4.435-11.797-6.709-1.36 2.274-2.609 4.321-3.743 6.482-.68 1.365-1.36 1.706-2.949 1.478-3.63-.455-7.259-.91-10.888-.682-10.889.682-19.85 7.96-22.798 18.423-3.29 11.94-1.702 22.97 6.805 32.523-1.588 2.843-3.29 5.8-4.99 8.87 4.083 2.275 7.826 4.55 11.795 6.824 1.588-2.73 3.063-5.231 4.424-7.733.68-1.251 1.588-1.365 2.949-1.479 4.65 0 9.3.228 13.724-.682 9.3-1.82 17.354-10.803 18.375-20.128-4.084 0-7.94.113-11.91 0-1.588 0-2.609.455-3.403 1.933-4.537 7.62-15.312 8.87-21.21 2.502-5.557-5.914-5.557-18.764.114-24.677 6.011-6.141 16.56-4.777 21.21 2.729z"})]});var nB="Expected a function",Yo=NaN,lB="[object Symbol]",pB=/^\s+|\s+$/g,eB=/^[-+]0x[0-9a-f]+$/i,cB=/^0b[01]+$/i,tB=/^0o[0-7]+$/i,oB=parseInt,rB=typeof Il=="object"&&Il&&Il.Object===Object&&Il,iB=typeof self=="object"&&self&&self.Object===Object&&self,gB=rB||iB||Function("return this")(),hB=Object.prototype,IB=hB.toString,dB=Math.max,CB=Math.min,de=function(){return gB.Date.now()};function jB(s,a,n){var l,p,e,c,t,o,i=0,I=!1,d=!1,j=!0;if(typeof s!="function")throw new TypeError(nB);a=Ro(a)||0,ic(n)&&(I=!!n.leading,d="maxWait"in n,e=d?dB(Ro(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,i=k,c=s.apply(Y,G),c}function m(k){return i=k,t=setTimeout(h,a),I?u(k):c}function b(k){var G=k-o,Y=k-i,x=a-G;return d?CB(x,e-Y):x}function Z(k){var G=k-o,Y=k-i;return o===void 0||G>=a||G<0||d&&Y>=e}function h(){var k=de();if(Z(k))return g(k);t=setTimeout(h,b(k))}function g(k){return t=void 0,j&&l?u(k):(l=p=void 0,c)}function C(){t!==void 0&&clearTimeout(t),i=0,l=o=p=t=void 0}function y(){return t===void 0?c:g(de())}function W(){var k=de(),G=Z(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 W.cancel=C,W.flush=y,W}function ic(s){var a=typeof s;return!!s&&(a=="object"||a=="function")}function AB(s){return!!s&&typeof s=="object"}function uB(s){return typeof s=="symbol"||AB(s)&&IB.call(s)==lB}function Ro(s){if(typeof s=="number")return s;if(uB(s))return Yo;if(ic(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=ic(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=s.replace(pB,"");var n=cB.test(s);return n||tB.test(s)?oB(s.slice(2),n?2:8):eB.test(s)?Yo:+s}var yB=jB;const mB=Fo(yB),bB={leading:!1,trailing:!0};function wB(s,a,n){return B.useCallback(mB(s,a,bB),n)}function kB(s,a){let n=s;for(let l=0;l0;){const[e,c,t]=a.pop();p&&(l=l.slice(0,c-1),p=!1),l+=e;const o=Object.keys(t);if(o.length>0)for(let i=0;ia+p)}const BB=["/visibility"],GB=["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],VB=["/visibility"],fB=["/visibility","/hacks/hiding-malicious-code-with-external-contract"],YB=["/view-and-pure-functions"],RB=["/view-and-pure-functions"],XB=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/evm/storage","/ether-units","/enum","/constants","/assembly-variable","/array"],vB=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/ether-units","/enum","/constants","/array"],NB=["/variables"],HB=["/variables"],FB=["/variables","/state-variables","/shadowing-inherited-state-variables","/evm/storage"],KB=["/variables","/structs","/primitives","/mapping","/immutable","/hacks/accessing-private-data","/evm/storage","/evm/memory","/ether-units","/enum","/data-locations","/constants","/array","/app/iterable-mapping"],MB=["/unchecked-math","/gas-golf","/gas"],SB=["/unchecked-math"],xB=["/unchecked-math","/assembly-math","/app/assembly-bin-exp"],JB=["/unchecked-math","/hacks/overflow"],zB=["/unchecked-math","/hacks/overflow"],DB=["/try-catch","/error","/assembly-error"],EB=["/try-catch","/error"],QB=["/transient-storage"],TB=["/transient-storage","/hacks/accessing-private-data","/evm/storage","/data-locations","/app/write-to-any-slot"],UB=["/tests/echidna"],_B=["/tests/echidna"],LB=["/super","/calling-contract"],OB=["/super"],PB=["/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"],$B=["/super","/new-contract","/interface","/inheritance","/first-app","/delegatecall","/calling-contract","/call"],qB=["/super","/shadowing-inherited-state-variables","/inheritance","/constructor"],sG=["/structs"],aG=["/structs"],nG=["/structs","/primitives"],lG=["/structs","/primitives"],pG=["/state-variables"],eG=["/state-variables"],cG=["/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"],tG=["/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"],oG=["/signature","/hashing","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/merkle-tree","/app/bi-directional-payment-channel"],rG=["/signature"],iG=["/signature"],gG=["/signature","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/multi-sig-wallet","/app/bi-directional-payment-channel"],hG=["/signature"],IG=["/signature"],dG=["/shadowing-inherited-state-variables"],CG=["/shadowing-inherited-state-variables"],jG=["/sending-ether"],AG=["/sending-ether","/sending-ether","/payable","/fallback"],uG=["/sending-ether","/payable","/fallback","/ether-units","/app/ether-wallet"],yG=["/sending-ether","/payable","/fallback","/app/ether-wallet"],mG=["/sending-ether","/fallback","/app/gasless-token-transfer"],bG=["/sending-ether","/delegatecall","/calling-contract","/call","/app/multi-call"],wG=["/sending-ether","/fallback"],kG=["/sending-ether","/fallback"],ZG=["/sending-ether","/payable","/fallback"],WG=["/primitives"],BG=["/primitives"],GG=["/primitives"],VG=["/primitives"],fG=["/primitives"],YG=["/primitives","/hacks/deploy-different-contracts-same-address","/app/create2"],RG=["/primitives"],XG=["/primitives"],vG=["/new-contract","/hacks/deploy-different-contracts-same-address"],NG=["/new-contract"],HG=["/new-contract","/hacks/deploy-different-contracts-same-address","/app/create2"],FG=["/new-contract","/hacks/deploy-different-contracts-same-address"],KG=["/mapping","/app/iterable-mapping"],MG=["/loop","/assembly-loop"],SG=["/loop"],xG=["/library"],JG=["/interface"],zG=["/inheritance"],DG=["/inheritance"],EG=["/inheritance"],QG=["/immutable","/defi/constant-sum-amm","/defi/constant-product-amm","/constants"],TG=["/immutable","/constants"],UG=["/immutable"],_G=["/immutable"],LG=["/if-else"],OG=["/if-else"],PG=["/if-else"],$G=["/hello-world"],qG=["/hello-world"],sV=["/hashing"],aV=["/hashing"],nV=["/hashing"],lV=["/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"],pV=["/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"],eV=["/hacks/weth-permit"],cV=["/hacks/weth-permit","/app/gasless-token-transfer"],tV=["/hacks/vault-inflation"],oV=["/hacks/vault-inflation"],rV=["/hacks/vault-inflation","/defi/vault"],iV=["/hacks/signature-replay"],gV=["/hacks/self-destruct"],hV=["/hacks/randomness"],IV=["/hacks/randomness"],dV=["/hacks/randomness"],CV=["/hacks/randomness"],jV=["/hacks/randomness","/hacks/block-timestamp-manipulation"],AV=["/hacks/randomness","/hacks/block-timestamp-manipulation"],uV=["/hacks/phishing-with-tx-origin"],yV=["/hacks/overflow"],mV=["/hacks/honeypot"],bV=["/hacks/hiding-malicious-code-with-external-contract"],wV=["/hacks/hiding-malicious-code-with-external-contract"],kV=["/hacks/hiding-malicious-code-with-external-contract"],ZV=["/hacks/hiding-malicious-code-with-external-contract"],WV=["/hacks/front-running"],BV=["/hacks/front-running"],GV=["/hacks/deploy-different-contracts-same-address","/app/deploy-any-contract"],VV=["/hacks/deploy-different-contracts-same-address"],fV=["/hacks/deploy-different-contracts-same-address"],YV=["/hacks/denial-of-service"],RV=["/hacks/denial-of-service"],XV=["/hacks/delegatecall","/delegatecall","/app/upgradeable-proxy","/app/multi-delegatecall"],vV=["/hacks/contract-size"],NV=["/hacks/contract-size"],HV=["/hacks/contract-size"],FV=["/hacks/contract-size"],KV=["/hacks/block-timestamp-manipulation"],MV=["/hacks/accessing-private-data"],SV=["/hacks/accessing-private-data"],xV=["/gas-golf"],JV=["/function-selector"],zV=["/function-selector"],DV=["/function-modifier"],EV=["/function-modifier"],QV=["/function-modifier"],TV=["/first-app"],UV=["/first-app"],_V=["/evm/storage","/evm/memory"],LV=["/evm/storage","/evm/memory","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],OV=["/evm/storage","/evm/memory","/bitwise","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],PV=["/evm/memory","/data-locations"],$V=["/events"],qV=["/events"],sf=["/ether-units"],af=["/ether-units"],nf=["/error"],lf=["/error","/assembly-error"],pf=["/error"],ef=["/enum"],cf=["/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"],tf=["/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"],of=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash"],rf=["/defi/uniswap-v3-swap","/defi/uniswap-v3-flash-swap","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2","/defi/stable-swap-amm"],gf=["/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"],hf=["/defi/uniswap-v3-liquidity","/defi/uniswap-v2-add-remove-liquidity"],If=["/defi/uniswap-v3-flash-swap"],df=["/defi/uniswap-v3-flash","/defi/uniswap-v2-flash-swap"],Cf=["/defi/uniswap-v3-flash"],jf=["/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2"],Af=["/defi/uniswap-v2-optimal-one-sided-supply"],uf=["/defi/uniswap-v2-optimal-one-sided-supply"],yf=["/defi/uniswap-v2-optimal-one-sided-supply"],mf=["/defi/uniswap-v2-optimal-one-sided-supply"],bf=["/defi/uniswap-v2-add-remove-liquidity","/assembly-math"],wf=["/defi/uniswap-v2-add-remove-liquidity"],kf=["/defi/staking-rewards","/defi/discrete-staking-rewards"],Zf=["/defi/staking-rewards","/defi/discrete-staking-rewards"],Wf=["/defi/staking-rewards","/defi/discrete-staking-rewards"],Bf=["/defi/stable-swap-amm"],Gf=["/defi/stable-swap-amm"],Vf=["/defi/discrete-staking-rewards"],ff=["/defi/dai-proxy"],Yf=["/defi/dai-proxy","/app/upgradeable-proxy","/app/minimal-proxy"],Rf=["/defi/constant-sum-amm"],Xf=["/defi/constant-product-amm"],vf=["/defi/chainlink-price-oracle"],Nf=["/defi/chainlink-price-oracle"],Hf=["/defi/chainlink-price-oracle"],Ff=["/defi/chainlink-price-oracle"],Kf=["/data-locations"],Mf=["/data-locations"],Sf=["/data-locations"],xf=["/constructor"],Jf=["/constructor"],zf=["/calling-contract"],Df=["/bitwise"],Ef=["/bitwise"],Qf=["/bitwise"],Tf=["/bitwise"],Uf=["/assembly-math"],_f=["/array"],Lf=["/array"],Of=["/app/write-to-any-slot"],Pf=["/app/write-to-any-slot","/app/deploy-any-contract"],$f=["/app/write-to-any-slot"],qf=["/app/upgradeable-proxy"],s1=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],a1=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],n1=["/app/time-lock"],l1=["/app/time-lock"],p1=["/app/simple-bytecode-contract"],e1=["/app/simple-bytecode-contract"],c1=["/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call"],t1=["/app/multi-sig-wallet"],o1=["/app/multi-sig-wallet","/app/ether-wallet"],r1=["/app/multi-call"],i1=["/app/minimal-proxy"],g1=["/app/merkle-tree"],h1=["/app/merkle-tree"],I1=["/app/iterable-mapping"],d1=["/app/gasless-token-transfer"],C1=["/app/gasless-token-transfer","/app/erc20"],j1=["/app/gasless-token-transfer"],A1=["/app/erc721"],u1=["/app/erc721"],y1=["/app/erc721","/app/erc1155"],m1=["/app/erc20"],b1=["/app/erc20"],w1=["/app/erc1155"],k1=["/app/erc1155"],Z1=["/app/english-auction"],W1=["/app/english-auction","/app/dutch-auction"],B1=["/app/english-auction","/app/dutch-auction"],G1=["/app/dutch-auction"],V1=["/app/crowd-fund"],f1=["/app/crowd-fund"],Y1=["/app/crowd-fund"],R1=["/app/create2"],X1=["/app/assembly-bin-exp"],v1=["/app/assembly-bin-exp"],N1=["/abi-encode","/abi-decode"],H1=["/abi-encode"],F1=["/abi-encode","/abi-decode"],K1=["/abi-encode"],M1=["/abi-encode"],S1=["/abi-encode"],x1=["/abi-decode"],Xo={visibility:BB,function:["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],functions:GB,internal:VB,private:["/visibility","/hacks/accessing-private-data"],public:["/visibility"],external:fB,view:YB,pure:RB,variable:XB,variables:vB,local:NB,global:HB,state:FB,data:KB,gas:MB,unchecked:SB,math:xB,overflow:JB,underflow:zB,try:["/try-catch"],catch:["/try-catch"],error:DB,errors:EB,transient:QB,storage:TB,test:UB,echidna:_B,calling:LB,parent:OB,contract:PB,contracts:$B,inheritance:qB,super:["/super","/inheritance"],struct:sG,structs:aG,type:nG,types:lG,reading:pG,writing:eG,app:cG,application:tG,cryptography:oG,verify:rG,verifying:iG,signature:gG,signatures:hG,ecrecover:IG,shadow:dG,shadowing:CG,sending:jG,send:AG,ether:uG,eth:yG,transfer:mG,call:bG,fallback:wG,receive:kG,payable:ZG,primitive:WG,primitives:BG,boolean:GG,uint256:VG,int256:fG,address:YG,uint:RG,int:XG,new:["/new-contract","/new-contract"],create:vG,creates:NG,create2:HG,salt:FG,mapping:KG,for:["/loop","/assembly-loop"],loop:MG,loops:SG,while:["/loop","/assembly-loop"],do:["/loop"],library:xG,interface:["/interface"],interfaces:JG,override:zG,virtual:DG,is:EG,import:["/import","/enum"],constant:QG,constants:TG,immutable:UG,immutables:_G,if:["/if-else","/assembly-if"],else:["/if-else"],conditional:LG,statement:OG,statements:PG,hello:$G,world:qG,hash:sV,hashing:aV,keccak256:nV,hack:lV,security:pV,weth:eV,permit:cV,inflation:tV,erc4626:oV,vault:rV,replay:iV,selfdestruct:gV,"re-entrancy":["/hacks/re-entrancy"],source:hV,random:IV,randomness:dV,blockhash:CV,block:jV,timestamp:AV,phishing:uV,"tx.origin":["/hacks/phishing-with-tx-origin"],arithmetic:yV,honeypot:mV,hide:bV,hiding:wV,malicious:kV,code:ZV,front:WV,running:BV,deploy:GV,different:VV,same:fV,denial:YV,service:RV,delegatecall:XV,bypass:vV,size:NV,check:HV,extcodesize:FV,manipulation:KV,access:MV,accessing:SV,golf:xV,selector:JV,selectors:zV,modifier:DV,modifiers:EV,_:QV,first:TV,counter:UV,evm:_V,yul:LV,assembly:OV,memory:PV,event:$V,events:qV,wei:sf,units:af,require:nf,revert:lf,assert:pf,enum:["/enum"],imports:ef,defi:cf,uniswap:tf,v3:of,swap:rf,amm:gf,liquidity:hf,arbitrage:If,flash:df,loan:Cf,v2:jf,optimal:Af,one:uf,sided:yf,supply:mf,add:bf,remove:wf,staking:kf,reward:Zf,rewards:Wf,curve:Bf,stable:Gf,discrete:Vf,dai:ff,proxy:Yf,sum:Rf,product:Xf,chainlink:vf,price:Nf,oracle:Hf,oracles:Ff,location:Kf,locations:Mf,calldata:Sf,constructor:xf,constructors:Jf,other:zf,bitwise:Df,most:Ef,significant:Qf,bit:Tf,mul:Uf,switch:["/assembly-if"],array:_f,arrays:Lf,write:Of,any:Pf,slot:$f,upgradeable:qf,"uni-directional":["/app/uni-directional-payment-channel"],payment:s1,channel:a1,time:n1,lock:l1,simple:p1,bytecode:e1,multi:c1,sig:t1,wallet:o1,staticcall:r1,minimal:i1,merkle:g1,tree:h1,iterable:I1,gasless:d1,token:C1,ERC20:j1,erc721:A1,ierc721:u1,nft:y1,erc20:m1,ierc20:b1,erc1155:w1,ierc1155:k1,english:Z1,auction:W1,auctions:B1,dutch:G1,crowd:V1,fund:f1,funding:Y1,precompute:R1,"bi-directional":["/app/bi-directional-payment-channel"],binary:X1,exponentiation:v1,abi:N1,encode:H1,bytes:F1,encodeWithSelector:K1,encodeWithSignature:M1,encodeCall:S1,decode:x1},vo={"/visibility":["visibility","function","functions","internal","private","public","external"],"/view-and-pure-functions":["view","pure","function","functions"],"/variables":["variable","variables","local","global","state","data"],"/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":["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"],"/abi-encode":["abi","encode","bytes","encodeWithSelector","encodeWithSignature","encodeCall"],"/abi-decode":["abi","decode","bytes"]},jg=[];for(const s of Object.keys(vo))jg.push(...vo[s]);const Ag={};for(const s of jg)kB(Ag,s);function J1(s){return Array.from(new Set(s))}function z1(s){const a=[],n=WB(Ag,s.toLowerCase());for(const l of n)Xo[l]&&a.push(...Xo[l]);return a}const D1="_component_ri31z_1",E1="_updates_ri31z_8",Q1="_category_ri31z_13",T1="_search_ri31z_16",U1="_listItem_ri31z_20",_1="_label_ri31z_28",L1="_header_ri31z_31",O1="_youTube_ri31z_34",P1="_youTubeLogo_ri31z_40",$1="_cryptoJobsList_ri31z_44",q1="_cryptoJobsListLogo_ri31z_50",as={component:D1,updates:E1,category:Q1,search:T1,listItem:U1,label:_1,header:L1,youTube:O1,youTubeLogo:P1,cryptoJobsList:$1,cryptoJobsListLogo:q1},sY=["2024/04/19 - EVM memory","2024/04/07 - Fix WETH permit hack","2024/04/06 - EVM storage"];function aY(){const[s,a]=B.useState(""),[n,l]=xd(),[p,e]=B.useState(null);B.useEffect(()=>{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=J1(j.split(" ")),m={};for(const b of u){const Z=z1(b);for(const h of Z)m[h]=!0}e(m),d&&l({q:j})}const t=wB(I=>c(I,!0),500,[]);function o(I){a(I),t(I)}function i(){return p?Object.keys(p).length==0?r.jsx("div",{children:"No results"}):r.jsx("ul",{className:as.list,children:Cp.filter(({path:I})=>p[I]).map(({path:I,title:d})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:I,children:d})},I))}):r.jsxs(r.Fragment,{children:[tt.map(({routes:I,title:d},j)=>r.jsxs("div",{children:[d&&r.jsx("h3",{className:as.category,children:d}),r.jsx("ul",{className:as.list,children:I.map(({path:u,title:m})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:u,children:m})},u))})]},j)),r.jsxs("div",{children:[r.jsx("h3",{className:as.category,children:"Translations"}),Od.map(({lang:I,url:d})=>r.jsx("li",{className:as.listItem,children:r.jsx("a",{href:d,target:"__blank",children:I})},d))]})]})}return r.jsxs("div",{className:as.component,children:[r.jsx(Cg,{title:"Solidity by Example | 0.8.24",description:"Learn smart contract programming using Solidity"}),r.jsx("h1",{className:as.header,children:r.jsx("a",{href:"/",children:"Solidity by Example"})}),r.jsx("div",{className:as.subHeader,children:"v 0.8.24"}),r.jsxs("div",{className:as.main,children:[r.jsxs("p",{children:["Introduction to ",r.jsx("a",{href:"https://solidity.readthedocs.io",children:"Solidity"})," with simple examples"]}),r.jsxs("div",{className:as.youTube,children:[r.jsx("img",{src:dg,alt:"logo",className:as.youTubeLogo}),r.jsx("a",{href:"https://www.youtube.com/@smartcontractprogrammer",target:"__blank",children:"Most code are explained here"})]}),r.jsxs("div",{className:as.cryptoJobsList,children:[r.jsx(aB,{size:24,className:as.cryptoJobsListLogo}),r.jsx("a",{href:Ig,target:"__blank",children:"Looking for Solidity jobs?"})]}),r.jsx("div",{className:as.updates,children:sY.map((I,d)=>r.jsx("div",{children:I},d))}),r.jsx("div",{className:as.search,children:r.jsx(sB,{value:s,onChange:o})}),i()]})]})}const nY=[{path:"/abi-decode",component:DC},{path:"/abi-encode",component:LC},{path:"/app/assembly-bin-exp",component:aj},{path:"/app/bi-directional-payment-channel",component:tj},{path:"/app/create2",component:Ij},{path:"/app/crowd-fund",component:yj},{path:"/app/deploy-any-contract",component:Wj},{path:"/app/dutch-auction",component:Rj},{path:"/app/english-auction",component:Kj},{path:"/app/erc1155",component:Dj},{path:"/app/erc20",component:Lj},{path:"/app/erc721",component:aA},{path:"/app/ether-wallet",component:tA},{path:"/app/gasless-token-transfer",component:IA},{path:"/app/iterable-mapping",component:yA},{path:"/app/merkle-tree",component:WA},{path:"/app/minimal-proxy",component:RA},{path:"/app/multi-call",component:KA},{path:"/app/multi-delegatecall",component:DA},{path:"/app/multi-sig-wallet",component:LA},{path:"/app/simple-bytecode-contract",component:au},{path:"/app/time-lock",component:tu},{path:"/app/uni-directional-payment-channel",component:Iu},{path:"/app/upgradeable-proxy",component:yu},{path:"/app/write-to-any-slot",component:Wu},{path:"/array",component:Ru},{path:"/assembly-error",component:Ku},{path:"/assembly-if",component:Du},{path:"/assembly-loop",component:Lu},{path:"/assembly-math",component:ay},{path:"/assembly-variable",component:ty},{path:"/bitwise",component:Iy},{path:"/call",component:yy},{path:"/calling-contract",component:Wy},{path:"/constants",component:Ry},{path:"/constructor",component:Ky},{path:"/data-locations",component:Dy},{path:"/defi/chainlink-price-oracle",component:Ly},{path:"/defi/constant-product-amm",component:am},{path:"/defi/constant-sum-amm",component:tm},{path:"/defi/dai-proxy",component:Im},{path:"/defi/discrete-staking-rewards",component:ym},{path:"/defi/stable-swap-amm",component:Wm},{path:"/defi/staking-rewards",component:Rm},{path:"/defi/uniswap-v2",component:Km},{path:"/defi/uniswap-v2-add-remove-liquidity",component:Dm},{path:"/defi/uniswap-v2-flash-swap",component:Lm},{path:"/defi/uniswap-v2-optimal-one-sided-supply",component:ab},{path:"/defi/uniswap-v3-flash",component:tb},{path:"/defi/uniswap-v3-flash-swap",component:Ib},{path:"/defi/uniswap-v3-liquidity",component:yb},{path:"/defi/uniswap-v3-swap",component:Wb},{path:"/defi/vault",component:Rb},{path:"/delegatecall",component:Kb},{path:"/enum",component:Db},{path:"/error",component:Lb},{path:"/ether-units",component:aw},{path:"/events",component:tw},{path:"/evm/memory",component:Iw},{path:"/evm/storage",component:yw},{path:"/fallback",component:Ww},{path:"/first-app",component:Rw},{path:"/function",component:Kw},{path:"/function-modifier",component:Dw},{path:"/function-selector",component:Lw},{path:"/gas",component:ak},{path:"/gas-golf",component:tk},{path:"/hacks/accessing-private-data",component:Ik},{path:"/hacks/block-timestamp-manipulation",component:yk},{path:"/hacks/contract-size",component:Wk},{path:"/hacks/delegatecall",component:Rk},{path:"/hacks/denial-of-service",component:Kk},{path:"/hacks/deploy-different-contracts-same-address",component:Dk},{path:"/hacks/front-running",component:Lk},{path:"/hacks/hiding-malicious-code-with-external-contract",component:a0},{path:"/hacks/honeypot",component:t0},{path:"/hacks/overflow",component:I0},{path:"/hacks/phishing-with-tx-origin",component:y0},{path:"/hacks/randomness",component:W0},{path:"/hacks/re-entrancy",component:R0},{path:"/hacks/self-destruct",component:K0},{path:"/hacks/signature-replay",component:D0},{path:"/hacks/vault-inflation",component:L0},{path:"/hacks/weth-permit",component:aZ},{path:"/hashing",component:tZ},{path:"/hello-world",component:IZ},{path:"/if-else",component:yZ},{path:"/immutable",component:WZ},{path:"/import",component:RZ},{path:"/inheritance",component:KZ},{path:"/interface",component:DZ},{path:"/library",component:LZ},{path:"/loop",component:aW},{path:"/mapping",component:tW},{path:"/new-contract",component:IW},{path:"/payable",component:yW},{path:"/primitives",component:WW},{path:"/sending-ether",component:RW},{path:"/shadowing-inherited-state-variables",component:KW},{path:"/signature",component:DW},{path:"/state-variables",component:LW},{path:"/structs",component:a2},{path:"/super",component:t2},{path:"/tests/echidna",component:I2},{path:"/transient-storage",component:y2},{path:"/try-catch",component:W2},{path:"/unchecked-math",component:R2},{path:"/variables",component:K2},{path:"/view-and-pure-functions",component:D2},{path:"/visibility",component:L2},{path:"",component:aY}];var lY={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function No(){const{state:s,init:a}=et();return B.useLayoutEffect(()=>{a({width:window.document.body.clientWidth})},[]),s.initialized?r.jsx(Sd,{basename:lY.VITE_PUBLIC_URL,children:r.jsx(RC,{children:r.jsx(Hd,{children:nY.map(n=>{const{prev:l,next:p}=pC(n.path);return r.jsx(hg,{path:n.path,element:To.createElement(n.component,{prev:l,next:p})},n.path)})})})}):null}const pY=document.getElementById("root"),eY=$i(pY),Ho=document.getElementById("root");Ho.hasChildNodes()?Pi(Ho,r.jsx(mo,{children:r.jsx(No,{})})):eY.render(r.jsx(mo,{children:r.jsx(No,{})})); diff --git a/assets/telegram-zGrx4xca.png b/assets/telegram-DMavHjFx.png similarity index 100% rename from assets/telegram-zGrx4xca.png rename to assets/telegram-DMavHjFx.png diff --git a/bitwise/index.html b/bitwise/index.html index e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 100644 --- a/ether-units/index.html +++ b/ether-units/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/events/index.html b/events/index.html index e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 100644 --- a/unchecked-math/index.html +++ b/unchecked-math/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/variables/index.html b/variables/index.html index e22950008..addbfd057 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 e22950008..addbfd057 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 e22950008..addbfd057 100644 --- a/visibility/index.html +++ b/visibility/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + +