diff --git a/src/keywords.json b/src/keywords.json
index 95a864b6a..9847884e3 100644
--- a/src/keywords.json
+++ b/src/keywords.json
@@ -8,13 +8,54 @@
"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"],
+ "/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",
@@ -69,7 +110,12 @@
"uint",
"int"
],
- "/payable": ["payable", "eth", "send", "ether"],
+ "/payable": [
+ "payable",
+ "eth",
+ "send",
+ "ether"
+ ],
"/new-contract": [
"new",
"contract",
@@ -80,10 +126,36 @@
"create2",
"salt"
],
- "/mapping": ["data", "variable", "variables", "mapping"],
- "/loop": ["for", "loop", "loops", "while", "do"],
- "/library": ["library"],
- "/interface": ["interface", "interfaces", "contract", "contracts"],
+ "/mapping": [
+ "data",
+ "variable",
+ "variables",
+ "mapping"
+ ],
+ "/loop": [
+ "for",
+ "loop",
+ "loops",
+ "while",
+ "do"
+ ],
+ "/library": [
+ "library"
+ ],
+ "/interface": [
+ "interface",
+ "interfaces",
+ "contract",
+ "contracts"
+ ],
+ "/initialize": [
+ "pool",
+ "initialize",
+ "init",
+ "create",
+ "pair",
+ "factory"
+ ],
"/inheritance": [
"inheritance",
"super",
@@ -93,7 +165,9 @@
"contract",
"contracts"
],
- "/import": ["import"],
+ "/import": [
+ "import"
+ ],
"/immutable": [
"constant",
"constants",
@@ -103,9 +177,28 @@
"variable",
"variables"
],
- "/if-else": ["if", "else", "conditional", "statement", "statements"],
- "/hello-world": ["contract", "app", "application", "hello", "world"],
- "/hashing": ["hash", "hashing", "function", "functions", "keccak256", "cryptography"],
+ "/if-else": [
+ "if",
+ "else",
+ "conditional",
+ "statement",
+ "statements"
+ ],
+ "/hello-world": [
+ "contract",
+ "app",
+ "application",
+ "hello",
+ "world"
+ ],
+ "/hashing": [
+ "hash",
+ "hashing",
+ "function",
+ "functions",
+ "keccak256",
+ "cryptography"
+ ],
"/hacks/signature-replay": [
"hack",
"security",
@@ -113,8 +206,16 @@
"signature",
"replay"
],
- "/hacks/self-destruct": ["hack", "security", "selfdestruct"],
- "/hacks/re-entrancy": ["hack", "security", "re-entrancy"],
+ "/hacks/self-destruct": [
+ "hack",
+ "security",
+ "selfdestruct"
+ ],
+ "/hacks/re-entrancy": [
+ "hack",
+ "security",
+ "re-entrancy"
+ ],
"/hacks/randomness": [
"hack",
"security",
@@ -125,9 +226,24 @@
"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/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",
@@ -138,7 +254,12 @@
"external",
"contract"
],
- "/hacks/front-running": ["hack", "security", "front", "running"],
+ "/hacks/front-running": [
+ "hack",
+ "security",
+ "front",
+ "running"
+ ],
"/hacks/deploy-different-contracts-same-address": [
"hack",
"security",
@@ -151,8 +272,17 @@
"same",
"address"
],
- "/hacks/denial-of-service": ["hack", "security", "denial", "service"],
- "/hacks/delegatecall": ["hack", "security", "delegatecall"],
+ "/hacks/denial-of-service": [
+ "hack",
+ "security",
+ "denial",
+ "service"
+ ],
+ "/hacks/delegatecall": [
+ "hack",
+ "security",
+ "delegatecall"
+ ],
"/hacks/contract-size": [
"hack",
"security",
@@ -178,12 +308,38 @@
"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"],
+ "/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",
@@ -195,10 +351,33 @@
"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"],
+ "/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",
@@ -207,11 +386,40 @@
"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/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",
@@ -222,7 +430,14 @@
"supply",
"amm"
],
- "/defi/uniswap-v2-flash-swap": ["defi", "uniswap", "v2", "flash", "swap", "amm"],
+ "/defi/uniswap-v2-flash-swap": [
+ "defi",
+ "uniswap",
+ "v2",
+ "flash",
+ "swap",
+ "amm"
+ ],
"/defi/uniswap-v2-add-remove-liquidity": [
"defi",
"uniswap",
@@ -232,9 +447,26 @@
"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/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",
@@ -242,12 +474,46 @@
"reward",
"rewards"
],
- "/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"],
+ "/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",
@@ -257,15 +523,66 @@
"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"],
+ "/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",
@@ -282,7 +599,12 @@
"signature",
"cryptography"
],
- "/app/time-lock": ["app", "application", "time", "lock"],
+ "/app/time-lock": [
+ "app",
+ "application",
+ "time",
+ "lock"
+ ],
"/app/simple-bytecode-contract": [
"app",
"application",
@@ -298,11 +620,40 @@
"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/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",
@@ -312,14 +663,62 @@
"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/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",
@@ -337,7 +736,13 @@
"signature",
"cryptography"
],
- "/app/assembly-bin-exp": ["assembly", "yul", "binary", "exponentiation", "math"],
+ "/app/assembly-bin-exp": [
+ "assembly",
+ "yul",
+ "binary",
+ "exponentiation",
+ "math"
+ ],
"/abi-encode": [
"abi",
"encode",
@@ -346,5 +751,9 @@
"encodeWithSignature",
"encodeCall"
],
- "/abi-decode": ["abi", "decode", "bytes"]
-}
+ "/abi-decode": [
+ "abi",
+ "decode",
+ "bytes"
+ ]
+}
\ No newline at end of file
diff --git a/src/nav.ts b/src/nav.ts
index 7cd60d0cf..d4ba04a1f 100644
--- a/src/nav.ts
+++ b/src/nav.ts
@@ -24,6 +24,10 @@ export const TRANSLATIONS: Translation[] = [
]
export const SOL_ROUTES: Route[] = [
+ {
+ path: "initialize",
+ title: "Pool Initialize"
+ },
{
path: "hello-world",
title: "Hello World",
diff --git a/src/pages/initialize/PoolInitialize.sol b/src/pages/initialize/PoolInitialize.sol
new file mode 100644
index 000000000..52e59cc9a
--- /dev/null
+++ b/src/pages/initialize/PoolInitialize.sol
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: MIT
+pragma solidity ^0.8.20;
+
+import {IPoolManager} from "@uniswap/v4-core/contracts/interfaces/IPoolManager.sol";
+import {IHooks} from "@uniswap/v4-core/contracts/interfaces/IHooks.sol";
+import {PoolKey} from "@uniswap/v4-core/contracts/types/PoolKey.sol";
+import {CurrencyLibrary, Currency} from "@uniswap/v4-core/contracts/types/Currency.sol";
+
+contract PoolInitialize {
+ using CurrencyLibrary for Currency;
+
+ // set the pool manager address
+ IPoolManager manager = IPoolManager(0x01);
+
+ function init(
+ address token0,
+ address token1,
+ uint24 swapFee,
+ int24 tickSpacing,
+ address hook,
+ uint160 sqrtPriceX96,
+ bytes calldata hookData
+ ) external {
+ // sort your tokens! v4 expects: token0 < token1
+ if (token0 > token1) {
+ (token0, token1) = (token1, token0);
+ }
+
+ PoolKey memory pool = PoolKey({
+ currency0: Currency(token0),
+ currency1: Currency(token1),
+ fee: swapFee,
+ tickSpacing: tickSpacing,
+ hooks: IHooks(hook)
+ });
+ manager.initialize(pool, sqrtPriceX96, hookData);
+ }
+}
diff --git a/src/pages/initialize/PoolInitializeExampleInputs.sol b/src/pages/initialize/PoolInitializeExampleInputs.sol
new file mode 100644
index 000000000..da602622b
--- /dev/null
+++ b/src/pages/initialize/PoolInitializeExampleInputs.sol
@@ -0,0 +1,68 @@
+// SPDX-License-Identifier: MIT
+pragma solidity ^0.8.20;
+
+import {IPoolManager} from "@uniswap/v4-core/contracts/interfaces/IPoolManager.sol";
+import {IHooks} from "@uniswap/v4-core/contracts/interfaces/IHooks.sol";
+import {PoolKey} from "@uniswap/v4-core/contracts/types/PoolKey.sol";
+import {CurrencyLibrary, Currency} from "@uniswap/v4-core/contracts/types/Currency.sol";
+
+contract PoolInitializeExampleInputs {
+ using CurrencyLibrary for Currency;
+
+ // set the pool manager address
+ IPoolManager manager = IPoolManager(0x01);
+
+ /// @notice Initialize a hookless pool:
+ /// 0.05% swap fee
+ /// tick spacing of 10
+ /// starting price of 1:1
+ function exampleA() external {
+ address token0 = address(0x11);
+ address token1 = address(0x22);
+ uint24 swapFee = 500;
+ int24 tickSpacing = 10;
+
+ // floor(sqrt(1) * 2^96)
+ uint160 startingPrice = 79228162514264337593543950336;
+
+ // hookless pool doesnt expect any initialization data
+ bytes memory hookData = new bytes(0);
+
+ PoolKey memory pool = PoolKey({
+ currency0: Currency(token0),
+ currency1: Currency(token1),
+ fee: swapFee,
+ tickSpacing: tickSpacing,
+ hooks: IHooks(address(0x0))
+ });
+ manager.initialize(pool, startingPrice, hookData);
+ }
+
+ /// @notice Initialize a pool with a custom hook:
+ /// 0.30% swap fee
+ /// tick spacing of 60
+ /// starting price of 1:1
+ /// hook's beforeInitialize() requires providing a timestamp
+ function exampleB() external {
+ address hook = address(0x80); // prefix indicates the hook only has a beforeInitialize() function
+ address token0 = address(0x11);
+ address token1 = address(0x22);
+ uint24 swapFee = 3000;
+ int24 tickSpacing = 60;
+
+ // floor(sqrt(1) * 2^96)
+ uint160 startingPrice = 79228162514264337593543950336;
+
+ // Custom hook requires a timestamp when initializing it
+ bytes memory hookData = abi.encode(block.timestamp);
+
+ PoolKey memory pool = PoolKey({
+ currency0: Currency(token0),
+ currency1: Currency(token1),
+ fee: swapFee,
+ tickSpacing: tickSpacing,
+ hooks: IHooks(hook)
+ });
+ manager.initialize(pool, startingPrice, hookData);
+ }
+}
diff --git a/src/pages/initialize/index.html.ts b/src/pages/initialize/index.html.ts
new file mode 100644
index 000000000..0de73daf9
--- /dev/null
+++ b/src/pages/initialize/index.html.ts
@@ -0,0 +1,138 @@
+// metadata
+export const version = "0.8.20"
+export const title = "Pool Initialization"
+export const description = "Initializing a pool in Uniswap v4"
+
+export const keywords = [
+ "pool",
+ "initialize",
+ "init",
+ "create",
+ "pair",
+ "factory",
+]
+
+export const codes = [
+ {
+ fileName: "PoolInitialize.sol",
+ code: "Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCB7SVBvb2xNYW5hZ2VyfSBmcm9tICJAdW5pc3dhcC92NC1jb3JlL2NvbnRyYWN0cy9pbnRlcmZhY2VzL0lQb29sTWFuYWdlci5zb2wiOwppbXBvcnQge0lIb29rc30gZnJvbSAiQHVuaXN3YXAvdjQtY29yZS9jb250cmFjdHMvaW50ZXJmYWNlcy9JSG9va3Muc29sIjsKaW1wb3J0IHtQb29sS2V5fSBmcm9tICJAdW5pc3dhcC92NC1jb3JlL2NvbnRyYWN0cy90eXBlcy9Qb29sS2V5LnNvbCI7CmltcG9ydCB7Q3VycmVuY3lMaWJyYXJ5LCBDdXJyZW5jeX0gZnJvbSAiQHVuaXN3YXAvdjQtY29yZS9jb250cmFjdHMvdHlwZXMvQ3VycmVuY3kuc29sIjsKCmNvbnRyYWN0IFBvb2xJbml0aWFsaXplIHsKICAgIHVzaW5nIEN1cnJlbmN5TGlicmFyeSBmb3IgQ3VycmVuY3k7CgogICAgLy8gc2V0IHRoZSBwb29sIG1hbmFnZXIgYWRkcmVzcwogICAgSVBvb2xNYW5hZ2VyIG1hbmFnZXIgPSBJUG9vbE1hbmFnZXIoMHgwMSk7CgogICAgZnVuY3Rpb24gaW5pdCgKICAgICAgICBhZGRyZXNzIHRva2VuMCwKICAgICAgICBhZGRyZXNzIHRva2VuMSwKICAgICAgICB1aW50MjQgc3dhcEZlZSwKICAgICAgICBpbnQyNCB0aWNrU3BhY2luZywKICAgICAgICBhZGRyZXNzIGhvb2ssCiAgICAgICAgdWludDE2MCBzcXJ0UHJpY2VYOTYsCiAgICAgICAgYnl0ZXMgY2FsbGRhdGEgaG9va0RhdGEKICAgICkgZXh0ZXJuYWwgewogICAgICAgIC8vIHNvcnQgeW91ciB0b2tlbnMhIHY0IGV4cGVjdHM6IHRva2VuMCA8IHRva2VuMQogICAgICAgIGlmICh0b2tlbjAgPiB0b2tlbjEpIHsKICAgICAgICAgICAgKHRva2VuMCwgdG9rZW4xKSA9ICh0b2tlbjEsIHRva2VuMCk7CiAgICAgICAgfQoKICAgICAgICBQb29sS2V5IG1lbW9yeSBwb29sID0gUG9vbEtleSh7CiAgICAgICAgICAgIGN1cnJlbmN5MDogQ3VycmVuY3kodG9rZW4wKSwKICAgICAgICAgICAgY3VycmVuY3kxOiBDdXJyZW5jeSh0b2tlbjEpLAogICAgICAgICAgICBmZWU6IHN3YXBGZWUsCiAgICAgICAgICAgIHRpY2tTcGFjaW5nOiB0aWNrU3BhY2luZywKICAgICAgICAgICAgaG9va3M6IElIb29rcyhob29rKQogICAgICAgIH0pOwogICAgICAgIG1hbmFnZXIuaW5pdGlhbGl6ZShwb29sLCBzcXJ0UHJpY2VYOTYsIGhvb2tEYXRhKTsKICAgIH0KfQo=",
+ },
+ {
+ fileName: "PoolInitializeExampleInputs.sol",
+ code: "Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCB7SVBvb2xNYW5hZ2VyfSBmcm9tICJAdW5pc3dhcC92NC1jb3JlL2NvbnRyYWN0cy9pbnRlcmZhY2VzL0lQb29sTWFuYWdlci5zb2wiOwppbXBvcnQge0lIb29rc30gZnJvbSAiQHVuaXN3YXAvdjQtY29yZS9jb250cmFjdHMvaW50ZXJmYWNlcy9JSG9va3Muc29sIjsKaW1wb3J0IHtQb29sS2V5fSBmcm9tICJAdW5pc3dhcC92NC1jb3JlL2NvbnRyYWN0cy90eXBlcy9Qb29sS2V5LnNvbCI7CmltcG9ydCB7Q3VycmVuY3lMaWJyYXJ5LCBDdXJyZW5jeX0gZnJvbSAiQHVuaXN3YXAvdjQtY29yZS9jb250cmFjdHMvdHlwZXMvQ3VycmVuY3kuc29sIjsKCmNvbnRyYWN0IFBvb2xJbml0aWFsaXplRXhhbXBsZUlucHV0cyB7CiAgICB1c2luZyBDdXJyZW5jeUxpYnJhcnkgZm9yIEN1cnJlbmN5OwoKICAgIC8vIHNldCB0aGUgcG9vbCBtYW5hZ2VyIGFkZHJlc3MKICAgIElQb29sTWFuYWdlciBtYW5hZ2VyID0gSVBvb2xNYW5hZ2VyKDB4MDEpOwoKICAgIC8vLyBAbm90aWNlIEluaXRpYWxpemUgYSBob29rbGVzcyBwb29sOgogICAgLy8vICAgICAwLjA1JSBzd2FwIGZlZQogICAgLy8vICAgICB0aWNrIHNwYWNpbmcgb2YgMTAKICAgIC8vLyAgICAgc3RhcnRpbmcgcHJpY2Ugb2YgMToxCiAgICBmdW5jdGlvbiBleGFtcGxlQSgpIGV4dGVybmFsIHsKICAgICAgICBhZGRyZXNzIHRva2VuMCA9IGFkZHJlc3MoMHgxMSk7CiAgICAgICAgYWRkcmVzcyB0b2tlbjEgPSBhZGRyZXNzKDB4MjIpOwogICAgICAgIHVpbnQyNCBzd2FwRmVlID0gNTAwOwogICAgICAgIGludDI0IHRpY2tTcGFjaW5nID0gMTA7CgogICAgICAgIC8vIGZsb29yKHNxcnQoMSkgKiAyXjk2KQogICAgICAgIHVpbnQxNjAgc3RhcnRpbmdQcmljZSA9IDc5MjI4MTYyNTE0MjY0MzM3NTkzNTQzOTUwMzM2OwoKICAgICAgICAvLyBob29rbGVzcyBwb29sIGRvZXNudCBleHBlY3QgYW55IGluaXRpYWxpemF0aW9uIGRhdGEKICAgICAgICBieXRlcyBtZW1vcnkgaG9va0RhdGEgPSBuZXcgYnl0ZXMoMCk7CgogICAgICAgIFBvb2xLZXkgbWVtb3J5IHBvb2wgPSBQb29sS2V5KHsKICAgICAgICAgICAgY3VycmVuY3kwOiBDdXJyZW5jeSh0b2tlbjApLAogICAgICAgICAgICBjdXJyZW5jeTE6IEN1cnJlbmN5KHRva2VuMSksCiAgICAgICAgICAgIGZlZTogc3dhcEZlZSwKICAgICAgICAgICAgdGlja1NwYWNpbmc6IHRpY2tTcGFjaW5nLAogICAgICAgICAgICBob29rczogSUhvb2tzKGFkZHJlc3MoMHgwKSkKICAgICAgICB9KTsKICAgICAgICBtYW5hZ2VyLmluaXRpYWxpemUocG9vbCwgc3RhcnRpbmdQcmljZSwgaG9va0RhdGEpOwogICAgfQoKICAgIC8vLyBAbm90aWNlIEluaXRpYWxpemUgYSBwb29sIHdpdGggYSBjdXN0b20gaG9vazoKICAgIC8vLyAgICAgMC4zMCUgc3dhcCBmZWUKICAgIC8vLyAgICAgdGljayBzcGFjaW5nIG9mIDYwCiAgICAvLy8gICAgIHN0YXJ0aW5nIHByaWNlIG9mIDE6MQogICAgLy8vICAgICBob29rJ3MgYmVmb3JlSW5pdGlhbGl6ZSgpIHJlcXVpcmVzIHByb3ZpZGluZyBhIHRpbWVzdGFtcAogICAgZnVuY3Rpb24gZXhhbXBsZUIoKSBleHRlcm5hbCB7CiAgICAgICAgYWRkcmVzcyBob29rID0gYWRkcmVzcygweDgwKTsgLy8gcHJlZml4IGluZGljYXRlcyB0aGUgaG9vayBvbmx5IGhhcyBhIGJlZm9yZUluaXRpYWxpemUoKSBmdW5jdGlvbgogICAgICAgIGFkZHJlc3MgdG9rZW4wID0gYWRkcmVzcygweDExKTsKICAgICAgICBhZGRyZXNzIHRva2VuMSA9IGFkZHJlc3MoMHgyMik7CiAgICAgICAgdWludDI0IHN3YXBGZWUgPSAzMDAwOwogICAgICAgIGludDI0IHRpY2tTcGFjaW5nID0gNjA7CgogICAgICAgIC8vIGZsb29yKHNxcnQoMSkgKiAyXjk2KQogICAgICAgIHVpbnQxNjAgc3RhcnRpbmdQcmljZSA9IDc5MjI4MTYyNTE0MjY0MzM3NTkzNTQzOTUwMzM2OwoKICAgICAgICAvLyBDdXN0b20gaG9vayByZXF1aXJlcyBhIHRpbWVzdGFtcCB3aGVuIGluaXRpYWxpemluZyBpdAogICAgICAgIGJ5dGVzIG1lbW9yeSBob29rRGF0YSA9IGFiaS5lbmNvZGUoYmxvY2sudGltZXN0YW1wKTsKCiAgICAgICAgUG9vbEtleSBtZW1vcnkgcG9vbCA9IFBvb2xLZXkoewogICAgICAgICAgICBjdXJyZW5jeTA6IEN1cnJlbmN5KHRva2VuMCksCiAgICAgICAgICAgIGN1cnJlbmN5MTogQ3VycmVuY3kodG9rZW4xKSwKICAgICAgICAgICAgZmVlOiBzd2FwRmVlLAogICAgICAgICAgICB0aWNrU3BhY2luZzogdGlja1NwYWNpbmcsCiAgICAgICAgICAgIGhvb2tzOiBJSG9va3MoaG9vaykKICAgICAgICB9KTsKICAgICAgICBtYW5hZ2VyLmluaXRpYWxpemUocG9vbCwgc3RhcnRpbmdQcmljZSwgaG9va0RhdGEpOwogICAgfQp9Cg==",
+ },
+]
+
+const html = `
A single trading pair (ETH/USDC), can exist as an infinite number of pools in v4. Uniswap v4 does not restrict fee tiers to 1%, 0.30%, or 0.05%. The same trading pair can also have an infinite number of hooks.
+Initializing a V3 Pair involved deploying a contract via the factory. In V4, pools are initialized and managed by a single contract: PoolManager
+
+pragma solidity ^0.8.20;
+
+import {IPoolManager} from "@uniswap/v4-core/contracts/interfaces/IPoolManager.sol";
+import {IHooks} from "@uniswap/v4-core/contracts/interfaces/IHooks.sol";
+import {PoolKey} from "@uniswap/v4-core/contracts/types/PoolKey.sol";
+import {CurrencyLibrary, Currency} from "@uniswap/v4-core/contracts/types/Currency.sol";
+
+contract PoolInitialize {
+ using CurrencyLibrary for Currency;
+
+
+ IPoolManager manager = IPoolManager(0x01);
+
+ function init(
+ address token0,
+ address token1,
+ uint24 swapFee,
+ int24 tickSpacing,
+ address hook,
+ uint160 sqrtPriceX96,
+ bytes calldata hookData
+ ) external {
+
+ if (token0 > token1) {
+ (token0, token1) = (token1, token0);
+ }
+
+ PoolKey memory pool = PoolKey({
+ currency0: Currency(token0),
+ currency1: Currency(token1),
+ fee: swapFee,
+ tickSpacing: tickSpacing,
+ hooks: IHooks(hook)
+ });
+ manager.initialize(pool, sqrtPriceX96, hookData);
+ }
+}
+
Examples of Initializing a V4 Pool
+Remove array element by shifting elements from right to left
+
+pragma solidity ^0.8.20;
+
+import {IPoolManager} from "@uniswap/v4-core/contracts/interfaces/IPoolManager.sol";
+import {IHooks} from "@uniswap/v4-core/contracts/interfaces/IHooks.sol";
+import {PoolKey} from "@uniswap/v4-core/contracts/types/PoolKey.sol";
+import {CurrencyLibrary, Currency} from "@uniswap/v4-core/contracts/types/Currency.sol";
+
+contract PoolInitializeExampleInputs {
+ using CurrencyLibrary for Currency;
+
+
+ IPoolManager manager = IPoolManager(0x01);
+
+
+
+
+
+ function exampleA() external {
+ address token0 = address(0x11);
+ address token1 = address(0x22);
+ uint24 swapFee = 500;
+ int24 tickSpacing = 10;
+
+
+ uint160 startingPrice = 79228162514264337593543950336;
+
+
+ bytes memory hookData = new bytes(0);
+
+ PoolKey memory pool = PoolKey({
+ currency0: Currency(token0),
+ currency1: Currency(token1),
+ fee: swapFee,
+ tickSpacing: tickSpacing,
+ hooks: IHooks(address(0x0))
+ });
+ manager.initialize(pool, startingPrice, hookData);
+ }
+
+
+
+
+
+
+ function exampleB() external {
+ address hook = address(0x80);
+ address token0 = address(0x11);
+ address token1 = address(0x22);
+ uint24 swapFee = 3000;
+ int24 tickSpacing = 60;
+
+
+ uint160 startingPrice = 79228162514264337593543950336;
+
+
+ bytes memory hookData = abi.encode(block.timestamp);
+
+ PoolKey memory pool = PoolKey({
+ currency0: Currency(token0),
+ currency1: Currency(token1),
+ fee: swapFee,
+ tickSpacing: tickSpacing,
+ hooks: IHooks(hook)
+ });
+ manager.initialize(pool, startingPrice, hookData);
+ }
+}
+
`
+
+export default html
diff --git a/src/pages/initialize/index.md b/src/pages/initialize/index.md
new file mode 100644
index 000000000..a3a6095db
--- /dev/null
+++ b/src/pages/initialize/index.md
@@ -0,0 +1,20 @@
+---
+title: Pool Initialization
+version: 0.8.20
+description: Initializing a pool in Uniswap v4
+keywords: [pool, initialize, init, create, pair, factory]
+---
+
+A single trading pair (ETH/USDC), can exist as an infinite number of pools in v4. Uniswap v4 does **not** restrict fee tiers to 1%, 0.30%, or 0.05%. The same trading pair can also have an infinite number of hooks.
+
+Initializing a V3 Pair involved deploying a contract via the factory. In V4, pools are initialized and managed by a single contract: `PoolManager`
+
+```solidity
+{{{PoolInitialize}}}
+```
+
+### Examples of Initializing a V4 Pool
+
+```solidity
+{{{PoolInitializeExampleInputs}}}
+```
diff --git a/src/pages/initialize/index.tsx b/src/pages/initialize/index.tsx
new file mode 100644
index 000000000..e44c294e3
--- /dev/null
+++ b/src/pages/initialize/index.tsx
@@ -0,0 +1,29 @@
+import React from "react"
+import Example from "../../components/Example"
+import html, { version, title, description, codes } from "./index.html"
+
+interface Path {
+ path: string
+ title: string
+}
+
+interface Props {
+ prev: Path | null
+ next: Path | null
+}
+
+const ExamplePage: React.FC = ({ prev, next }) => {
+ return (
+
+ )
+}
+
+export default ExamplePage
diff --git a/src/routes.tsx b/src/routes.tsx
index 54346092c..bf049794c 100644
--- a/src/routes.tsx
+++ b/src/routes.tsx
@@ -83,6 +83,7 @@ import component_if_else from "./pages/if-else"
import component_immutable from "./pages/immutable"
import component_import from "./pages/import"
import component_inheritance from "./pages/inheritance"
+import component_initialize from "./pages/initialize"
import component_interface from "./pages/interface"
import component_library from "./pages/library"
import component_loop from "./pages/loop"
@@ -121,426 +122,430 @@ interface Route {
}
const routes: Route[] = [
- {
- path: "/abi-decode",
- component: component_abi_decode,
- },
- {
- path: "/abi-encode",
- component: component_abi_encode,
- },
- {
- path: "/app/assembly-bin-exp",
- component: component_app_assembly_bin_exp,
- },
- {
- path: "/app/bi-directional-payment-channel",
- component: component_app_bi_directional_payment_channel,
- },
- {
- path: "/app/create2",
- component: component_app_create2,
- },
- {
- path: "/app/crowd-fund",
- component: component_app_crowd_fund,
- },
- {
- path: "/app/deploy-any-contract",
- component: component_app_deploy_any_contract,
- },
- {
- path: "/app/dutch-auction",
- component: component_app_dutch_auction,
- },
- {
- path: "/app/english-auction",
- component: component_app_english_auction,
- },
- {
- path: "/app/erc1155",
- component: component_app_erc1155,
- },
- {
- path: "/app/erc20",
- component: component_app_erc20,
- },
- {
- path: "/app/erc721",
- component: component_app_erc721,
- },
- {
- path: "/app/ether-wallet",
- component: component_app_ether_wallet,
- },
- {
- path: "/app/gasless-token-transfer",
- component: component_app_gasless_token_transfer,
- },
- {
- path: "/app/iterable-mapping",
- component: component_app_iterable_mapping,
- },
- {
- path: "/app/merkle-tree",
- component: component_app_merkle_tree,
- },
- {
- path: "/app/minimal-proxy",
- component: component_app_minimal_proxy,
- },
- {
- path: "/app/multi-call",
- component: component_app_multi_call,
- },
- {
- path: "/app/multi-delegatecall",
- component: component_app_multi_delegatecall,
- },
- {
- path: "/app/multi-sig-wallet",
- component: component_app_multi_sig_wallet,
- },
- {
- path: "/app/simple-bytecode-contract",
- component: component_app_simple_bytecode_contract,
- },
- {
- path: "/app/time-lock",
- component: component_app_time_lock,
- },
- {
- path: "/app/uni-directional-payment-channel",
- component: component_app_uni_directional_payment_channel,
- },
- {
- path: "/app/upgradeable-proxy",
- component: component_app_upgradeable_proxy,
- },
- {
- path: "/app/write-to-any-slot",
- component: component_app_write_to_any_slot,
- },
- {
- path: "/array",
- component: component_array,
- },
- {
- path: "/assembly-error",
- component: component_assembly_error,
- },
- {
- path: "/assembly-if",
- component: component_assembly_if,
- },
- {
- path: "/assembly-loop",
- component: component_assembly_loop,
- },
- {
- path: "/assembly-math",
- component: component_assembly_math,
- },
- {
- path: "/assembly-variable",
- component: component_assembly_variable,
- },
- {
- path: "/bitwise",
- component: component_bitwise,
- },
- {
- path: "/call",
- component: component_call,
- },
- {
- path: "/calling-contract",
- component: component_calling_contract,
- },
- {
- path: "/constants",
- component: component_constants,
- },
- {
- path: "/constructor",
- component: component_constructor,
- },
- {
- path: "/data-locations",
- component: component_data_locations,
- },
- {
- path: "/defi/chainlink-price-oracle",
- component: component_defi_chainlink_price_oracle,
- },
- {
- path: "/defi/constant-product-amm",
- component: component_defi_constant_product_amm,
- },
- {
- path: "/defi/constant-sum-amm",
- component: component_defi_constant_sum_amm,
- },
- {
- path: "/defi/discrete-staking-rewards",
- component: component_defi_discrete_staking_rewards,
- },
- {
- path: "/defi/stable-swap-amm",
- component: component_defi_stable_swap_amm,
- },
- {
- path: "/defi/staking-rewards",
- component: component_defi_staking_rewards,
- },
- {
- path: "/defi/uniswap-v2",
- component: component_defi_uniswap_v2,
- },
- {
- path: "/defi/uniswap-v2-add-remove-liquidity",
- component: component_defi_uniswap_v2_add_remove_liquidity,
- },
- {
- path: "/defi/uniswap-v2-flash-swap",
- component: component_defi_uniswap_v2_flash_swap,
- },
- {
- path: "/defi/uniswap-v2-optimal-one-sided-supply",
- component: component_defi_uniswap_v2_optimal_one_sided_supply,
- },
- {
- path: "/defi/uniswap-v3-flash",
- component: component_defi_uniswap_v3_flash,
- },
- {
- path: "/defi/uniswap-v3-flash-swap",
- component: component_defi_uniswap_v3_flash_swap,
- },
- {
- path: "/defi/uniswap-v3-liquidity",
- component: component_defi_uniswap_v3_liquidity,
- },
- {
- path: "/defi/uniswap-v3-swap",
- component: component_defi_uniswap_v3_swap,
- },
- {
- path: "/defi/vault",
- component: component_defi_vault,
- },
- {
- path: "/delegatecall",
- component: component_delegatecall,
- },
- {
- path: "/enum",
- component: component_enum,
- },
- {
- path: "/error",
- component: component_error,
- },
- {
- path: "/ether-units",
- component: component_ether_units,
- },
- {
- path: "/events",
- component: component_events,
- },
- {
- path: "/fallback",
- component: component_fallback,
- },
- {
- path: "/first-app",
- component: component_first_app,
- },
- {
- path: "/function",
- component: component_function,
- },
- {
- path: "/function-modifier",
- component: component_function_modifier,
- },
- {
- path: "/function-selector",
- component: component_function_selector,
- },
- {
- path: "/gas",
- component: component_gas,
- },
- {
- path: "/gas-golf",
- component: component_gas_golf,
- },
- {
- path: "/hacks/accessing-private-data",
- component: component_hacks_accessing_private_data,
- },
- {
- path: "/hacks/block-timestamp-manipulation",
- component: component_hacks_block_timestamp_manipulation,
- },
- {
- path: "/hacks/contract-size",
- component: component_hacks_contract_size,
- },
- {
- path: "/hacks/delegatecall",
- component: component_hacks_delegatecall,
- },
- {
- path: "/hacks/denial-of-service",
- component: component_hacks_denial_of_service,
- },
- {
- path: "/hacks/deploy-different-contracts-same-address",
- component: component_hacks_deploy_different_contracts_same_address,
- },
- {
- path: "/hacks/front-running",
- component: component_hacks_front_running,
- },
- {
- path: "/hacks/hiding-malicious-code-with-external-contract",
- component: component_hacks_hiding_malicious_code_with_external_contract,
- },
- {
- path: "/hacks/honeypot",
- component: component_hacks_honeypot,
- },
- {
- path: "/hacks/overflow",
- component: component_hacks_overflow,
- },
- {
- path: "/hacks/phishing-with-tx-origin",
- component: component_hacks_phishing_with_tx_origin,
- },
- {
- path: "/hacks/randomness",
- component: component_hacks_randomness,
- },
- {
- path: "/hacks/re-entrancy",
- component: component_hacks_re_entrancy,
- },
- {
- path: "/hacks/self-destruct",
- component: component_hacks_self_destruct,
- },
- {
- path: "/hacks/signature-replay",
- component: component_hacks_signature_replay,
- },
- {
- path: "/hashing",
- component: component_hashing,
- },
- {
- path: "/hello-world",
- component: component_hello_world,
- },
- {
- path: "/if-else",
- component: component_if_else,
- },
- {
- path: "/immutable",
- component: component_immutable,
- },
- {
- path: "/import",
- component: component_import,
- },
- {
- path: "/inheritance",
- component: component_inheritance,
- },
- {
- path: "/interface",
- component: component_interface,
- },
- {
- path: "/library",
- component: component_library,
- },
- {
- path: "/loop",
- component: component_loop,
- },
- {
- path: "/mapping",
- component: component_mapping,
- },
- {
- path: "/new-contract",
- component: component_new_contract,
- },
- {
- path: "/payable",
- component: component_payable,
- },
- {
- path: "/primitives",
- component: component_primitives,
- },
- {
- path: "/sending-ether",
- component: component_sending_ether,
- },
- {
- path: "/shadowing-inherited-state-variables",
- component: component_shadowing_inherited_state_variables,
- },
- {
- path: "/signature",
- component: component_signature,
- },
- {
- path: "/state-variables",
- component: component_state_variables,
- },
- {
- path: "/structs",
- component: component_structs,
- },
- {
- path: "/super",
- component: component_super,
- },
- {
- path: "/tests/echidna",
- component: component_tests_echidna,
- },
- {
- path: "/try-catch",
- component: component_try_catch,
- },
- {
- path: "/unchecked-math",
- component: component_unchecked_math,
- },
- {
- path: "/variables",
- component: component_variables,
- },
- {
- path: "/view-and-pure-functions",
- component: component_view_and_pure_functions,
- },
- {
- path: "/visibility",
- component: component_visibility,
- },
- {
- path: "",
- component: component_,
- },
+ {
+ path: "/abi-decode",
+ component: component_abi_decode
+ },
+ {
+ path: "/abi-encode",
+ component: component_abi_encode
+ },
+ {
+ path: "/app/assembly-bin-exp",
+ component: component_app_assembly_bin_exp
+ },
+ {
+ path: "/app/bi-directional-payment-channel",
+ component: component_app_bi_directional_payment_channel
+ },
+ {
+ path: "/app/create2",
+ component: component_app_create2
+ },
+ {
+ path: "/app/crowd-fund",
+ component: component_app_crowd_fund
+ },
+ {
+ path: "/app/deploy-any-contract",
+ component: component_app_deploy_any_contract
+ },
+ {
+ path: "/app/dutch-auction",
+ component: component_app_dutch_auction
+ },
+ {
+ path: "/app/english-auction",
+ component: component_app_english_auction
+ },
+ {
+ path: "/app/erc1155",
+ component: component_app_erc1155
+ },
+ {
+ path: "/app/erc20",
+ component: component_app_erc20
+ },
+ {
+ path: "/app/erc721",
+ component: component_app_erc721
+ },
+ {
+ path: "/app/ether-wallet",
+ component: component_app_ether_wallet
+ },
+ {
+ path: "/app/gasless-token-transfer",
+ component: component_app_gasless_token_transfer
+ },
+ {
+ path: "/app/iterable-mapping",
+ component: component_app_iterable_mapping
+ },
+ {
+ path: "/app/merkle-tree",
+ component: component_app_merkle_tree
+ },
+ {
+ path: "/app/minimal-proxy",
+ component: component_app_minimal_proxy
+ },
+ {
+ path: "/app/multi-call",
+ component: component_app_multi_call
+ },
+ {
+ path: "/app/multi-delegatecall",
+ component: component_app_multi_delegatecall
+ },
+ {
+ path: "/app/multi-sig-wallet",
+ component: component_app_multi_sig_wallet
+ },
+ {
+ path: "/app/simple-bytecode-contract",
+ component: component_app_simple_bytecode_contract
+ },
+ {
+ path: "/app/time-lock",
+ component: component_app_time_lock
+ },
+ {
+ path: "/app/uni-directional-payment-channel",
+ component: component_app_uni_directional_payment_channel
+ },
+ {
+ path: "/app/upgradeable-proxy",
+ component: component_app_upgradeable_proxy
+ },
+ {
+ path: "/app/write-to-any-slot",
+ component: component_app_write_to_any_slot
+ },
+ {
+ path: "/array",
+ component: component_array
+ },
+ {
+ path: "/assembly-error",
+ component: component_assembly_error
+ },
+ {
+ path: "/assembly-if",
+ component: component_assembly_if
+ },
+ {
+ path: "/assembly-loop",
+ component: component_assembly_loop
+ },
+ {
+ path: "/assembly-math",
+ component: component_assembly_math
+ },
+ {
+ path: "/assembly-variable",
+ component: component_assembly_variable
+ },
+ {
+ path: "/bitwise",
+ component: component_bitwise
+ },
+ {
+ path: "/call",
+ component: component_call
+ },
+ {
+ path: "/calling-contract",
+ component: component_calling_contract
+ },
+ {
+ path: "/constants",
+ component: component_constants
+ },
+ {
+ path: "/constructor",
+ component: component_constructor
+ },
+ {
+ path: "/data-locations",
+ component: component_data_locations
+ },
+ {
+ path: "/defi/chainlink-price-oracle",
+ component: component_defi_chainlink_price_oracle
+ },
+ {
+ path: "/defi/constant-product-amm",
+ component: component_defi_constant_product_amm
+ },
+ {
+ path: "/defi/constant-sum-amm",
+ component: component_defi_constant_sum_amm
+ },
+ {
+ path: "/defi/discrete-staking-rewards",
+ component: component_defi_discrete_staking_rewards
+ },
+ {
+ path: "/defi/stable-swap-amm",
+ component: component_defi_stable_swap_amm
+ },
+ {
+ path: "/defi/staking-rewards",
+ component: component_defi_staking_rewards
+ },
+ {
+ path: "/defi/uniswap-v2",
+ component: component_defi_uniswap_v2
+ },
+ {
+ path: "/defi/uniswap-v2-add-remove-liquidity",
+ component: component_defi_uniswap_v2_add_remove_liquidity
+ },
+ {
+ path: "/defi/uniswap-v2-flash-swap",
+ component: component_defi_uniswap_v2_flash_swap
+ },
+ {
+ path: "/defi/uniswap-v2-optimal-one-sided-supply",
+ component: component_defi_uniswap_v2_optimal_one_sided_supply
+ },
+ {
+ path: "/defi/uniswap-v3-flash",
+ component: component_defi_uniswap_v3_flash
+ },
+ {
+ path: "/defi/uniswap-v3-flash-swap",
+ component: component_defi_uniswap_v3_flash_swap
+ },
+ {
+ path: "/defi/uniswap-v3-liquidity",
+ component: component_defi_uniswap_v3_liquidity
+ },
+ {
+ path: "/defi/uniswap-v3-swap",
+ component: component_defi_uniswap_v3_swap
+ },
+ {
+ path: "/defi/vault",
+ component: component_defi_vault
+ },
+ {
+ path: "/delegatecall",
+ component: component_delegatecall
+ },
+ {
+ path: "/enum",
+ component: component_enum
+ },
+ {
+ path: "/error",
+ component: component_error
+ },
+ {
+ path: "/ether-units",
+ component: component_ether_units
+ },
+ {
+ path: "/events",
+ component: component_events
+ },
+ {
+ path: "/fallback",
+ component: component_fallback
+ },
+ {
+ path: "/first-app",
+ component: component_first_app
+ },
+ {
+ path: "/function",
+ component: component_function
+ },
+ {
+ path: "/function-modifier",
+ component: component_function_modifier
+ },
+ {
+ path: "/function-selector",
+ component: component_function_selector
+ },
+ {
+ path: "/gas",
+ component: component_gas
+ },
+ {
+ path: "/gas-golf",
+ component: component_gas_golf
+ },
+ {
+ path: "/hacks/accessing-private-data",
+ component: component_hacks_accessing_private_data
+ },
+ {
+ path: "/hacks/block-timestamp-manipulation",
+ component: component_hacks_block_timestamp_manipulation
+ },
+ {
+ path: "/hacks/contract-size",
+ component: component_hacks_contract_size
+ },
+ {
+ path: "/hacks/delegatecall",
+ component: component_hacks_delegatecall
+ },
+ {
+ path: "/hacks/denial-of-service",
+ component: component_hacks_denial_of_service
+ },
+ {
+ path: "/hacks/deploy-different-contracts-same-address",
+ component: component_hacks_deploy_different_contracts_same_address
+ },
+ {
+ path: "/hacks/front-running",
+ component: component_hacks_front_running
+ },
+ {
+ path: "/hacks/hiding-malicious-code-with-external-contract",
+ component: component_hacks_hiding_malicious_code_with_external_contract
+ },
+ {
+ path: "/hacks/honeypot",
+ component: component_hacks_honeypot
+ },
+ {
+ path: "/hacks/overflow",
+ component: component_hacks_overflow
+ },
+ {
+ path: "/hacks/phishing-with-tx-origin",
+ component: component_hacks_phishing_with_tx_origin
+ },
+ {
+ path: "/hacks/randomness",
+ component: component_hacks_randomness
+ },
+ {
+ path: "/hacks/re-entrancy",
+ component: component_hacks_re_entrancy
+ },
+ {
+ path: "/hacks/self-destruct",
+ component: component_hacks_self_destruct
+ },
+ {
+ path: "/hacks/signature-replay",
+ component: component_hacks_signature_replay
+ },
+ {
+ path: "/hashing",
+ component: component_hashing
+ },
+ {
+ path: "/hello-world",
+ component: component_hello_world
+ },
+ {
+ path: "/if-else",
+ component: component_if_else
+ },
+ {
+ path: "/immutable",
+ component: component_immutable
+ },
+ {
+ path: "/import",
+ component: component_import
+ },
+ {
+ path: "/inheritance",
+ component: component_inheritance
+ },
+ {
+ path: "/initialize",
+ component: component_initialize
+ },
+ {
+ path: "/interface",
+ component: component_interface
+ },
+ {
+ path: "/library",
+ component: component_library
+ },
+ {
+ path: "/loop",
+ component: component_loop
+ },
+ {
+ path: "/mapping",
+ component: component_mapping
+ },
+ {
+ path: "/new-contract",
+ component: component_new_contract
+ },
+ {
+ path: "/payable",
+ component: component_payable
+ },
+ {
+ path: "/primitives",
+ component: component_primitives
+ },
+ {
+ path: "/sending-ether",
+ component: component_sending_ether
+ },
+ {
+ path: "/shadowing-inherited-state-variables",
+ component: component_shadowing_inherited_state_variables
+ },
+ {
+ path: "/signature",
+ component: component_signature
+ },
+ {
+ path: "/state-variables",
+ component: component_state_variables
+ },
+ {
+ path: "/structs",
+ component: component_structs
+ },
+ {
+ path: "/super",
+ component: component_super
+ },
+ {
+ path: "/tests/echidna",
+ component: component_tests_echidna
+ },
+ {
+ path: "/try-catch",
+ component: component_try_catch
+ },
+ {
+ path: "/unchecked-math",
+ component: component_unchecked_math
+ },
+ {
+ path: "/variables",
+ component: component_variables
+ },
+ {
+ path: "/view-and-pure-functions",
+ component: component_view_and_pure_functions
+ },
+ {
+ path: "/visibility",
+ component: component_visibility
+ },
+ {
+ path: "",
+ component: component_
+ },
]
-export default routes
+export default routes
\ No newline at end of file
diff --git a/src/search.json b/src/search.json
index 9be05ae66..6e6493b22 100644
--- a/src/search.json
+++ b/src/search.json
@@ -1,5 +1,7 @@
{
- "visibility": ["/visibility"],
+ "visibility": [
+ "/visibility"
+ ],
"function": [
"/visibility",
"/view-and-pure-functions",
@@ -26,12 +28,26 @@
"/calling-contract",
"/call"
],
- "internal": ["/visibility"],
- "private": ["/visibility", "/hacks/accessing-private-data"],
- "public": ["/visibility"],
- "external": ["/visibility", "/hacks/hiding-malicious-code-with-external-contract"],
- "view": ["/view-and-pure-functions"],
- "pure": ["/view-and-pure-functions"],
+ "internal": [
+ "/visibility"
+ ],
+ "private": [
+ "/visibility",
+ "/hacks/accessing-private-data"
+ ],
+ "public": [
+ "/visibility"
+ ],
+ "external": [
+ "/visibility",
+ "/hacks/hiding-malicious-code-with-external-contract"
+ ],
+ "view": [
+ "/view-and-pure-functions"
+ ],
+ "pure": [
+ "/view-and-pure-functions"
+ ],
"variable": [
"/variables",
"/structs",
@@ -59,9 +75,17 @@
"/constants",
"/array"
],
- "local": ["/variables"],
- "global": ["/variables"],
- "state": ["/variables", "/state-variables", "/shadowing-inherited-state-variables"],
+ "local": [
+ "/variables"
+ ],
+ "global": [
+ "/variables"
+ ],
+ "state": [
+ "/variables",
+ "/state-variables",
+ "/shadowing-inherited-state-variables"
+ ],
"data": [
"/variables",
"/structs",
@@ -76,19 +100,55 @@
"/array",
"/app/iterable-mapping"
],
- "gas": ["/unchecked-math", "/gas-golf", "/gas"],
- "unchecked": ["/unchecked-math"],
- "math": ["/unchecked-math", "/assembly-math", "/app/assembly-bin-exp"],
- "overflow": ["/unchecked-math", "/hacks/overflow"],
- "underflow": ["/unchecked-math", "/hacks/overflow"],
- "try": ["/try-catch"],
- "catch": ["/try-catch"],
- "error": ["/try-catch", "/error", "/assembly-error"],
- "errors": ["/try-catch", "/error"],
- "test": ["/tests/echidna"],
- "echidna": ["/tests/echidna"],
- "calling": ["/super", "/calling-contract"],
- "parent": ["/super"],
+ "gas": [
+ "/unchecked-math",
+ "/gas-golf",
+ "/gas"
+ ],
+ "unchecked": [
+ "/unchecked-math"
+ ],
+ "math": [
+ "/unchecked-math",
+ "/assembly-math",
+ "/app/assembly-bin-exp"
+ ],
+ "overflow": [
+ "/unchecked-math",
+ "/hacks/overflow"
+ ],
+ "underflow": [
+ "/unchecked-math",
+ "/hacks/overflow"
+ ],
+ "try": [
+ "/try-catch"
+ ],
+ "catch": [
+ "/try-catch"
+ ],
+ "error": [
+ "/try-catch",
+ "/error",
+ "/assembly-error"
+ ],
+ "errors": [
+ "/try-catch",
+ "/error"
+ ],
+ "test": [
+ "/tests/echidna"
+ ],
+ "echidna": [
+ "/tests/echidna"
+ ],
+ "calling": [
+ "/super",
+ "/calling-contract"
+ ],
+ "parent": [
+ "/super"
+ ],
"contract": [
"/super",
"/new-contract",
@@ -124,13 +184,30 @@
"/inheritance",
"/constructor"
],
- "super": ["/super", "/inheritance"],
- "struct": ["/structs"],
- "structs": ["/structs"],
- "type": ["/structs", "/primitives"],
- "types": ["/structs", "/primitives"],
- "reading": ["/state-variables"],
- "writing": ["/state-variables"],
+ "super": [
+ "/super",
+ "/inheritance"
+ ],
+ "struct": [
+ "/structs"
+ ],
+ "structs": [
+ "/structs"
+ ],
+ "type": [
+ "/structs",
+ "/primitives"
+ ],
+ "types": [
+ "/structs",
+ "/primitives"
+ ],
+ "reading": [
+ "/state-variables"
+ ],
+ "writing": [
+ "/state-variables"
+ ],
"app": [
"/state-variables",
"/hello-world",
@@ -193,8 +270,12 @@
"/app/merkle-tree",
"/app/bi-directional-payment-channel"
],
- "verify": ["/signature"],
- "verifying": ["/signature"],
+ "verify": [
+ "/signature"
+ ],
+ "verifying": [
+ "/signature"
+ ],
"signature": [
"/signature",
"/hacks/signature-replay",
@@ -202,12 +283,27 @@
"/app/multi-sig-wallet",
"/app/bi-directional-payment-channel"
],
- "signatures": ["/signature"],
- "ecrecover": ["/signature"],
- "shadow": ["/shadowing-inherited-state-variables"],
- "shadowing": ["/shadowing-inherited-state-variables"],
- "sending": ["/sending-ether"],
- "send": ["/sending-ether", "/sending-ether", "/payable", "/fallback"],
+ "signatures": [
+ "/signature"
+ ],
+ "ecrecover": [
+ "/signature"
+ ],
+ "shadow": [
+ "/shadowing-inherited-state-variables"
+ ],
+ "shadowing": [
+ "/shadowing-inherited-state-variables"
+ ],
+ "sending": [
+ "/sending-ether"
+ ],
+ "send": [
+ "/sending-ether",
+ "/sending-ether",
+ "/payable",
+ "/fallback"
+ ],
"ether": [
"/sending-ether",
"/payable",
@@ -215,8 +311,17 @@
"/ether-units",
"/app/ether-wallet"
],
- "eth": ["/sending-ether", "/payable", "/fallback", "/app/ether-wallet"],
- "transfer": ["/sending-ether", "/fallback", "/app/gasless-token-transfer"],
+ "eth": [
+ "/sending-ether",
+ "/payable",
+ "/fallback",
+ "/app/ether-wallet"
+ ],
+ "transfer": [
+ "/sending-ether",
+ "/fallback",
+ "/app/gasless-token-transfer"
+ ],
"call": [
"/sending-ether",
"/delegatecall",
@@ -224,62 +329,172 @@
"/call",
"/app/multi-call"
],
- "fallback": ["/sending-ether", "/fallback"],
- "receive": ["/sending-ether", "/fallback"],
- "payable": ["/sending-ether", "/payable", "/fallback"],
- "primitive": ["/primitives"],
- "primitives": ["/primitives"],
- "boolean": ["/primitives"],
- "uint256": ["/primitives"],
- "int256": ["/primitives"],
+ "fallback": [
+ "/sending-ether",
+ "/fallback"
+ ],
+ "receive": [
+ "/sending-ether",
+ "/fallback"
+ ],
+ "payable": [
+ "/sending-ether",
+ "/payable",
+ "/fallback"
+ ],
+ "primitive": [
+ "/primitives"
+ ],
+ "primitives": [
+ "/primitives"
+ ],
+ "boolean": [
+ "/primitives"
+ ],
+ "uint256": [
+ "/primitives"
+ ],
+ "int256": [
+ "/primitives"
+ ],
"address": [
"/primitives",
"/hacks/deploy-different-contracts-same-address",
"/app/create2"
],
- "uint": ["/primitives"],
- "int": ["/primitives"],
- "new": ["/new-contract", "/new-contract"],
- "create": ["/new-contract", "/hacks/deploy-different-contracts-same-address"],
- "creates": ["/new-contract"],
+ "uint": [
+ "/primitives"
+ ],
+ "int": [
+ "/primitives"
+ ],
+ "new": [
+ "/new-contract",
+ "/new-contract"
+ ],
+ "create": [
+ "/new-contract",
+ "/initialize",
+ "/hacks/deploy-different-contracts-same-address"
+ ],
+ "creates": [
+ "/new-contract"
+ ],
"create2": [
"/new-contract",
"/hacks/deploy-different-contracts-same-address",
"/app/create2"
],
- "salt": ["/new-contract", "/hacks/deploy-different-contracts-same-address"],
- "mapping": ["/mapping", "/app/iterable-mapping"],
- "for": ["/loop", "/assembly-loop"],
- "loop": ["/loop", "/assembly-loop"],
- "loops": ["/loop"],
- "while": ["/loop", "/assembly-loop"],
- "do": ["/loop"],
- "library": ["/library"],
- "interface": ["/interface"],
- "interfaces": ["/interface"],
- "override": ["/inheritance"],
- "virtual": ["/inheritance"],
- "is": ["/inheritance"],
- "import": ["/import", "/enum"],
+ "salt": [
+ "/new-contract",
+ "/hacks/deploy-different-contracts-same-address"
+ ],
+ "mapping": [
+ "/mapping",
+ "/app/iterable-mapping"
+ ],
+ "for": [
+ "/loop",
+ "/assembly-loop"
+ ],
+ "loop": [
+ "/loop",
+ "/assembly-loop"
+ ],
+ "loops": [
+ "/loop"
+ ],
+ "while": [
+ "/loop",
+ "/assembly-loop"
+ ],
+ "do": [
+ "/loop"
+ ],
+ "library": [
+ "/library"
+ ],
+ "interface": [
+ "/interface"
+ ],
+ "interfaces": [
+ "/interface"
+ ],
+ "pool": [
+ "/initialize"
+ ],
+ "initialize": [
+ "/initialize"
+ ],
+ "init": [
+ "/initialize"
+ ],
+ "pair": [
+ "/initialize"
+ ],
+ "factory": [
+ "/initialize"
+ ],
+ "override": [
+ "/inheritance"
+ ],
+ "virtual": [
+ "/inheritance"
+ ],
+ "is": [
+ "/inheritance"
+ ],
+ "import": [
+ "/import",
+ "/enum"
+ ],
"constant": [
"/immutable",
"/defi/constant-sum-amm",
"/defi/constant-product-amm",
"/constants"
],
- "constants": ["/immutable", "/constants"],
- "immutable": ["/immutable"],
- "immutables": ["/immutable"],
- "if": ["/if-else", "/assembly-if"],
- "else": ["/if-else"],
- "conditional": ["/if-else"],
- "statement": ["/if-else"],
- "statements": ["/if-else"],
- "hello": ["/hello-world"],
- "world": ["/hello-world"],
- "hash": ["/hashing"],
- "hashing": ["/hashing"],
- "keccak256": ["/hashing"],
+ "constants": [
+ "/immutable",
+ "/constants"
+ ],
+ "immutable": [
+ "/immutable"
+ ],
+ "immutables": [
+ "/immutable"
+ ],
+ "if": [
+ "/if-else",
+ "/assembly-if"
+ ],
+ "else": [
+ "/if-else"
+ ],
+ "conditional": [
+ "/if-else"
+ ],
+ "statement": [
+ "/if-else"
+ ],
+ "statements": [
+ "/if-else"
+ ],
+ "hello": [
+ "/hello-world"
+ ],
+ "world": [
+ "/hello-world"
+ ],
+ "hash": [
+ "/hashing"
+ ],
+ "hashing": [
+ "/hashing"
+ ],
+ "keccak256": [
+ "/hashing"
+ ],
"hack": [
"/hacks/signature-replay",
"/hacks/self-destruct",
@@ -314,68 +529,165 @@
"/hacks/block-timestamp-manipulation",
"/hacks/accessing-private-data"
],
- "replay": ["/hacks/signature-replay"],
- "selfdestruct": ["/hacks/self-destruct"],
- "re-entrancy": ["/hacks/re-entrancy"],
- "source": ["/hacks/randomness"],
- "random": ["/hacks/randomness"],
- "randomness": ["/hacks/randomness"],
- "blockhash": ["/hacks/randomness"],
- "block": ["/hacks/randomness", "/hacks/block-timestamp-manipulation"],
- "timestamp": ["/hacks/randomness", "/hacks/block-timestamp-manipulation"],
- "phishing": ["/hacks/phishing-with-tx-origin"],
- "tx.origin": ["/hacks/phishing-with-tx-origin"],
- "arithmetic": ["/hacks/overflow"],
- "honeypot": ["/hacks/honeypot"],
- "hide": ["/hacks/hiding-malicious-code-with-external-contract"],
- "hiding": ["/hacks/hiding-malicious-code-with-external-contract"],
- "malicious": ["/hacks/hiding-malicious-code-with-external-contract"],
- "code": ["/hacks/hiding-malicious-code-with-external-contract"],
- "front": ["/hacks/front-running"],
- "running": ["/hacks/front-running"],
+ "replay": [
+ "/hacks/signature-replay"
+ ],
+ "selfdestruct": [
+ "/hacks/self-destruct"
+ ],
+ "re-entrancy": [
+ "/hacks/re-entrancy"
+ ],
+ "source": [
+ "/hacks/randomness"
+ ],
+ "random": [
+ "/hacks/randomness"
+ ],
+ "randomness": [
+ "/hacks/randomness"
+ ],
+ "blockhash": [
+ "/hacks/randomness"
+ ],
+ "block": [
+ "/hacks/randomness",
+ "/hacks/block-timestamp-manipulation"
+ ],
+ "timestamp": [
+ "/hacks/randomness",
+ "/hacks/block-timestamp-manipulation"
+ ],
+ "phishing": [
+ "/hacks/phishing-with-tx-origin"
+ ],
+ "tx.origin": [
+ "/hacks/phishing-with-tx-origin"
+ ],
+ "arithmetic": [
+ "/hacks/overflow"
+ ],
+ "honeypot": [
+ "/hacks/honeypot"
+ ],
+ "hide": [
+ "/hacks/hiding-malicious-code-with-external-contract"
+ ],
+ "hiding": [
+ "/hacks/hiding-malicious-code-with-external-contract"
+ ],
+ "malicious": [
+ "/hacks/hiding-malicious-code-with-external-contract"
+ ],
+ "code": [
+ "/hacks/hiding-malicious-code-with-external-contract"
+ ],
+ "front": [
+ "/hacks/front-running"
+ ],
+ "running": [
+ "/hacks/front-running"
+ ],
"deploy": [
"/hacks/deploy-different-contracts-same-address",
"/app/deploy-any-contract"
],
- "different": ["/hacks/deploy-different-contracts-same-address"],
- "same": ["/hacks/deploy-different-contracts-same-address"],
- "denial": ["/hacks/denial-of-service"],
- "service": ["/hacks/denial-of-service"],
+ "different": [
+ "/hacks/deploy-different-contracts-same-address"
+ ],
+ "same": [
+ "/hacks/deploy-different-contracts-same-address"
+ ],
+ "denial": [
+ "/hacks/denial-of-service"
+ ],
+ "service": [
+ "/hacks/denial-of-service"
+ ],
"delegatecall": [
"/hacks/delegatecall",
"/delegatecall",
"/app/upgradeable-proxy",
"/app/multi-delegatecall"
],
- "bypass": ["/hacks/contract-size"],
- "size": ["/hacks/contract-size"],
- "check": ["/hacks/contract-size"],
- "extcodesize": ["/hacks/contract-size"],
- "manipulation": ["/hacks/block-timestamp-manipulation"],
- "access": ["/hacks/accessing-private-data"],
- "accessing": ["/hacks/accessing-private-data"],
+ "bypass": [
+ "/hacks/contract-size"
+ ],
+ "size": [
+ "/hacks/contract-size"
+ ],
+ "check": [
+ "/hacks/contract-size"
+ ],
+ "extcodesize": [
+ "/hacks/contract-size"
+ ],
+ "manipulation": [
+ "/hacks/block-timestamp-manipulation"
+ ],
+ "access": [
+ "/hacks/accessing-private-data"
+ ],
+ "accessing": [
+ "/hacks/accessing-private-data"
+ ],
"storage": [
"/hacks/accessing-private-data",
"/data-locations",
"/app/write-to-any-slot"
],
- "golf": ["/gas-golf"],
- "selector": ["/function-selector"],
- "selectors": ["/function-selector"],
- "modifier": ["/function-modifier"],
- "modifiers": ["/function-modifier"],
- "_": ["/function-modifier"],
- "first": ["/first-app"],
- "counter": ["/first-app"],
- "event": ["/events"],
- "events": ["/events"],
- "wei": ["/ether-units"],
- "units": ["/ether-units"],
- "require": ["/error"],
- "revert": ["/error", "/assembly-error"],
- "assert": ["/error"],
- "enum": ["/enum"],
- "imports": ["/enum"],
+ "golf": [
+ "/gas-golf"
+ ],
+ "selector": [
+ "/function-selector"
+ ],
+ "selectors": [
+ "/function-selector"
+ ],
+ "modifier": [
+ "/function-modifier"
+ ],
+ "modifiers": [
+ "/function-modifier"
+ ],
+ "_": [
+ "/function-modifier"
+ ],
+ "first": [
+ "/first-app"
+ ],
+ "counter": [
+ "/first-app"
+ ],
+ "event": [
+ "/events"
+ ],
+ "events": [
+ "/events"
+ ],
+ "wei": [
+ "/ether-units"
+ ],
+ "units": [
+ "/ether-units"
+ ],
+ "require": [
+ "/error"
+ ],
+ "revert": [
+ "/error",
+ "/assembly-error"
+ ],
+ "assert": [
+ "/error"
+ ],
+ "enum": [
+ "/enum"
+ ],
+ "imports": [
+ "/enum"
+ ],
"defi": [
"/defi/vault",
"/defi/uniswap-v3-swap",
@@ -393,7 +705,9 @@
"/defi/constant-product-amm",
"/defi/chainlink-price-oracle"
],
- "vault": ["/defi/vault"],
+ "vault": [
+ "/defi/vault"
+ ],
"uniswap": [
"/defi/uniswap-v3-swap",
"/defi/uniswap-v3-liquidity",
@@ -430,45 +744,117 @@
"/defi/constant-sum-amm",
"/defi/constant-product-amm"
],
- "liquidity": ["/defi/uniswap-v3-liquidity", "/defi/uniswap-v2-add-remove-liquidity"],
- "arbitrage": ["/defi/uniswap-v3-flash-swap"],
- "flash": ["/defi/uniswap-v3-flash", "/defi/uniswap-v2-flash-swap"],
- "loan": ["/defi/uniswap-v3-flash"],
+ "liquidity": [
+ "/defi/uniswap-v3-liquidity",
+ "/defi/uniswap-v2-add-remove-liquidity"
+ ],
+ "arbitrage": [
+ "/defi/uniswap-v3-flash-swap"
+ ],
+ "flash": [
+ "/defi/uniswap-v3-flash",
+ "/defi/uniswap-v2-flash-swap"
+ ],
+ "loan": [
+ "/defi/uniswap-v3-flash"
+ ],
"v2": [
"/defi/uniswap-v2-optimal-one-sided-supply",
"/defi/uniswap-v2-flash-swap",
"/defi/uniswap-v2-add-remove-liquidity",
"/defi/uniswap-v2"
],
- "optimal": ["/defi/uniswap-v2-optimal-one-sided-supply"],
- "one": ["/defi/uniswap-v2-optimal-one-sided-supply"],
- "sided": ["/defi/uniswap-v2-optimal-one-sided-supply"],
- "supply": ["/defi/uniswap-v2-optimal-one-sided-supply"],
- "add": ["/defi/uniswap-v2-add-remove-liquidity", "/assembly-math"],
- "remove": ["/defi/uniswap-v2-add-remove-liquidity"],
- "staking": ["/defi/staking-rewards", "/defi/discrete-staking-rewards"],
- "reward": ["/defi/staking-rewards", "/defi/discrete-staking-rewards"],
- "rewards": ["/defi/staking-rewards", "/defi/discrete-staking-rewards"],
- "curve": ["/defi/stable-swap-amm"],
- "stable": ["/defi/stable-swap-amm"],
- "discrete": ["/defi/discrete-staking-rewards"],
- "sum": ["/defi/constant-sum-amm"],
- "product": ["/defi/constant-product-amm"],
- "chainlink": ["/defi/chainlink-price-oracle"],
- "price": ["/defi/chainlink-price-oracle"],
- "oracle": ["/defi/chainlink-price-oracle"],
- "oracles": ["/defi/chainlink-price-oracle"],
- "location": ["/data-locations"],
- "locations": ["/data-locations"],
- "memory": ["/data-locations"],
- "calldata": ["/data-locations"],
- "constructor": ["/constructor"],
- "constructors": ["/constructor"],
- "other": ["/calling-contract"],
- "bitwise": ["/bitwise"],
- "most": ["/bitwise"],
- "significant": ["/bitwise"],
- "bit": ["/bitwise"],
+ "optimal": [
+ "/defi/uniswap-v2-optimal-one-sided-supply"
+ ],
+ "one": [
+ "/defi/uniswap-v2-optimal-one-sided-supply"
+ ],
+ "sided": [
+ "/defi/uniswap-v2-optimal-one-sided-supply"
+ ],
+ "supply": [
+ "/defi/uniswap-v2-optimal-one-sided-supply"
+ ],
+ "add": [
+ "/defi/uniswap-v2-add-remove-liquidity",
+ "/assembly-math"
+ ],
+ "remove": [
+ "/defi/uniswap-v2-add-remove-liquidity"
+ ],
+ "staking": [
+ "/defi/staking-rewards",
+ "/defi/discrete-staking-rewards"
+ ],
+ "reward": [
+ "/defi/staking-rewards",
+ "/defi/discrete-staking-rewards"
+ ],
+ "rewards": [
+ "/defi/staking-rewards",
+ "/defi/discrete-staking-rewards"
+ ],
+ "curve": [
+ "/defi/stable-swap-amm"
+ ],
+ "stable": [
+ "/defi/stable-swap-amm"
+ ],
+ "discrete": [
+ "/defi/discrete-staking-rewards"
+ ],
+ "sum": [
+ "/defi/constant-sum-amm"
+ ],
+ "product": [
+ "/defi/constant-product-amm"
+ ],
+ "chainlink": [
+ "/defi/chainlink-price-oracle"
+ ],
+ "price": [
+ "/defi/chainlink-price-oracle"
+ ],
+ "oracle": [
+ "/defi/chainlink-price-oracle"
+ ],
+ "oracles": [
+ "/defi/chainlink-price-oracle"
+ ],
+ "location": [
+ "/data-locations"
+ ],
+ "locations": [
+ "/data-locations"
+ ],
+ "memory": [
+ "/data-locations"
+ ],
+ "calldata": [
+ "/data-locations"
+ ],
+ "constructor": [
+ "/constructor"
+ ],
+ "constructors": [
+ "/constructor"
+ ],
+ "other": [
+ "/calling-contract"
+ ],
+ "bitwise": [
+ "/bitwise"
+ ],
+ "most": [
+ "/bitwise"
+ ],
+ "significant": [
+ "/bitwise"
+ ],
+ "bit": [
+ "/bitwise"
+ ],
"assembly": [
"/bitwise",
"/assembly-variable",
@@ -486,16 +872,38 @@
"/assembly-error",
"/app/assembly-bin-exp"
],
- "mul": ["/assembly-math"],
- "switch": ["/assembly-if"],
- "array": ["/array"],
- "arrays": ["/array"],
- "write": ["/app/write-to-any-slot"],
- "any": ["/app/write-to-any-slot", "/app/deploy-any-contract"],
- "slot": ["/app/write-to-any-slot"],
- "upgradeable": ["/app/upgradeable-proxy"],
- "proxy": ["/app/upgradeable-proxy", "/app/minimal-proxy"],
- "uni-directional": ["/app/uni-directional-payment-channel"],
+ "mul": [
+ "/assembly-math"
+ ],
+ "switch": [
+ "/assembly-if"
+ ],
+ "array": [
+ "/array"
+ ],
+ "arrays": [
+ "/array"
+ ],
+ "write": [
+ "/app/write-to-any-slot"
+ ],
+ "any": [
+ "/app/write-to-any-slot",
+ "/app/deploy-any-contract"
+ ],
+ "slot": [
+ "/app/write-to-any-slot"
+ ],
+ "upgradeable": [
+ "/app/upgradeable-proxy"
+ ],
+ "proxy": [
+ "/app/upgradeable-proxy",
+ "/app/minimal-proxy"
+ ],
+ "uni-directional": [
+ "/app/uni-directional-payment-channel"
+ ],
"payment": [
"/app/uni-directional-payment-channel",
"/app/bi-directional-payment-channel"
@@ -504,45 +912,136 @@
"/app/uni-directional-payment-channel",
"/app/bi-directional-payment-channel"
],
- "time": ["/app/time-lock"],
- "lock": ["/app/time-lock"],
- "simple": ["/app/simple-bytecode-contract"],
- "bytecode": ["/app/simple-bytecode-contract"],
- "multi": ["/app/multi-sig-wallet", "/app/multi-delegatecall", "/app/multi-call"],
- "sig": ["/app/multi-sig-wallet"],
- "wallet": ["/app/multi-sig-wallet", "/app/ether-wallet"],
- "staticcall": ["/app/multi-call"],
- "minimal": ["/app/minimal-proxy"],
- "merkle": ["/app/merkle-tree"],
- "tree": ["/app/merkle-tree"],
- "iterable": ["/app/iterable-mapping"],
- "gasless": ["/app/gasless-token-transfer"],
- "token": ["/app/gasless-token-transfer", "/app/erc20"],
- "ERC20": ["/app/gasless-token-transfer"],
- "permit": ["/app/gasless-token-transfer"],
- "erc721": ["/app/erc721"],
- "ierc721": ["/app/erc721"],
- "nft": ["/app/erc721", "/app/erc1155"],
- "erc20": ["/app/erc20"],
- "ierc20": ["/app/erc20"],
- "erc1155": ["/app/erc1155"],
- "ierc1155": ["/app/erc1155"],
- "english": ["/app/english-auction"],
- "auction": ["/app/english-auction", "/app/dutch-auction"],
- "auctions": ["/app/english-auction", "/app/dutch-auction"],
- "dutch": ["/app/dutch-auction"],
- "crowd": ["/app/crowd-fund"],
- "fund": ["/app/crowd-fund"],
- "funding": ["/app/crowd-fund"],
- "precompute": ["/app/create2"],
- "bi-directional": ["/app/bi-directional-payment-channel"],
- "binary": ["/app/assembly-bin-exp"],
- "exponentiation": ["/app/assembly-bin-exp"],
- "abi": ["/abi-encode", "/abi-decode"],
- "encode": ["/abi-encode"],
- "bytes": ["/abi-encode", "/abi-decode"],
- "encodeWithSelector": ["/abi-encode"],
- "encodeWithSignature": ["/abi-encode"],
- "encodeCall": ["/abi-encode"],
- "decode": ["/abi-decode"]
-}
+ "time": [
+ "/app/time-lock"
+ ],
+ "lock": [
+ "/app/time-lock"
+ ],
+ "simple": [
+ "/app/simple-bytecode-contract"
+ ],
+ "bytecode": [
+ "/app/simple-bytecode-contract"
+ ],
+ "multi": [
+ "/app/multi-sig-wallet",
+ "/app/multi-delegatecall",
+ "/app/multi-call"
+ ],
+ "sig": [
+ "/app/multi-sig-wallet"
+ ],
+ "wallet": [
+ "/app/multi-sig-wallet",
+ "/app/ether-wallet"
+ ],
+ "staticcall": [
+ "/app/multi-call"
+ ],
+ "minimal": [
+ "/app/minimal-proxy"
+ ],
+ "merkle": [
+ "/app/merkle-tree"
+ ],
+ "tree": [
+ "/app/merkle-tree"
+ ],
+ "iterable": [
+ "/app/iterable-mapping"
+ ],
+ "gasless": [
+ "/app/gasless-token-transfer"
+ ],
+ "token": [
+ "/app/gasless-token-transfer",
+ "/app/erc20"
+ ],
+ "ERC20": [
+ "/app/gasless-token-transfer"
+ ],
+ "permit": [
+ "/app/gasless-token-transfer"
+ ],
+ "erc721": [
+ "/app/erc721"
+ ],
+ "ierc721": [
+ "/app/erc721"
+ ],
+ "nft": [
+ "/app/erc721",
+ "/app/erc1155"
+ ],
+ "erc20": [
+ "/app/erc20"
+ ],
+ "ierc20": [
+ "/app/erc20"
+ ],
+ "erc1155": [
+ "/app/erc1155"
+ ],
+ "ierc1155": [
+ "/app/erc1155"
+ ],
+ "english": [
+ "/app/english-auction"
+ ],
+ "auction": [
+ "/app/english-auction",
+ "/app/dutch-auction"
+ ],
+ "auctions": [
+ "/app/english-auction",
+ "/app/dutch-auction"
+ ],
+ "dutch": [
+ "/app/dutch-auction"
+ ],
+ "crowd": [
+ "/app/crowd-fund"
+ ],
+ "fund": [
+ "/app/crowd-fund"
+ ],
+ "funding": [
+ "/app/crowd-fund"
+ ],
+ "precompute": [
+ "/app/create2"
+ ],
+ "bi-directional": [
+ "/app/bi-directional-payment-channel"
+ ],
+ "binary": [
+ "/app/assembly-bin-exp"
+ ],
+ "exponentiation": [
+ "/app/assembly-bin-exp"
+ ],
+ "abi": [
+ "/abi-encode",
+ "/abi-decode"
+ ],
+ "encode": [
+ "/abi-encode"
+ ],
+ "bytes": [
+ "/abi-encode",
+ "/abi-decode"
+ ],
+ "encodeWithSelector": [
+ "/abi-encode"
+ ],
+ "encodeWithSignature": [
+ "/abi-encode"
+ ],
+ "encodeCall": [
+ "/abi-encode"
+ ],
+ "decode": [
+ "/abi-decode"
+ ]
+}
\ No newline at end of file