Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor copy updates #6

Merged
merged 6 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/md-to-react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ hljs.registerLanguage("solidity", solidity)

async function findSolidityFiles(dir: string): Promise<string[]> {
const files = await readdir(dir)
return files.filter((file) => file.split(".").pop() == "sol")
return files.filter((file) => file.split(".").pop() == "sol" || file.split(".").pop() == "solsnippet")
}

async function mdToHtml(filePath: string) {
Expand Down
39 changes: 11 additions & 28 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ import youTube from "./youtube.png"
import telegram from "./telegram.png"
import discord from "./discord.png"

// Khan Academy
const ADDRESS = "0x95a647B3d8a3F11176BAdB799b9499C671fa243a"

function Footer() {
return (
<div className={styles.component}>
<div className={styles.row}>
{/* <img src={sce} alt="smart contract engineer" className={styles.sce} /> */}
<span>👽&nbsp;</span>
<a href="http://saucepoint.wtf" target="__blank">
saucepoint
<span>🦄&nbsp;</span>
<a href="https://uniswapfoundation.org" target="__blank">
Uniswap Foundation
</a>
</div>
{/* <div className={styles.social}>
Expand All @@ -42,36 +38,23 @@ function Footer() {
</div>
</div> */}
<div className={styles.row}>
Donate
<span>🙂</span>
<a href={`https://etherscan.io/address/${ADDRESS}`} target="__blank">
{ADDRESS.slice(0, 6)}...{ADDRESS.slice(-6, -1)}
</a>
<span className={styles.to}>to</span>
<a href="https://khanacademy.org" target="__blank" className={styles.khan}>
Khan Academy
</a>
</div>
{/* <div className={styles.row}>
<a href="mailto:[email protected]">
[email protected]
</a>
</div> */}
<div className={styles.row}>
<a
href="https://github.com/saucepoint/v4-by-example"
target="__blank"
>
<a href="https://github.com/uniswapfoundation/v4-by-example" target="__blank">
source
</a>
<div className={styles.bar}>|</div>
<a
href="https://github.com/saucepoint/v4-by-example/blob/gh-pages/LICENSE"
href="https://github.com/uniswapfoundation/v4-by-example/blob/gh-pages/LICENSE"
target="__blank"
>
license
</a>
</div>
<div className={styles.row}>
(fork of&nbsp;
<a href="https://solidity-by-example.org" target="__blank">
solidity-by-example)
</a>
</div>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const SideNav: React.FC<Props> = ({ onClick }) => {

return (
<>
<h3 className={styles.category}>Basic</h3>
<h3 className={styles.category}>Lifecycle</h3>
{ROUTES_BY_CATEGORY.map(({ routes, title }, i) => (
<div key={i}>
{title && <h3 className={styles.title}>{title}</h3>}
Expand Down
26 changes: 4 additions & 22 deletions src/keywords.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
{
"/swap": [
"swap",
"trade",
"swapping"
],
"/initialize": [
"pool",
"initialize",
"init",
"create",
"pair",
"factory"
],
"/create-liquidity": [
"liquidity",
"LP",
"lp",
"provide",
"provision",
"supply"
]
}
"/swap": ["swap", "trade", "swapping"],
"/initialize": ["pool", "initialize", "init", "create", "pair", "factory"],
"/create-liquidity": ["liquidity", "LP", "lp", "provide", "provision", "supply"]
}
22 changes: 8 additions & 14 deletions src/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,30 @@ export interface Translation {
url: string
}

export const TRANSLATIONS: Translation[] = [

]
export const TRANSLATIONS: Translation[] = []

export const SOL_ROUTES: Route[] = [
{
path: "initialize",
title: "Initialize Pool"
title: "Initialize Pool",
},
{
path: "create-liquidity",
title: "Create Liquidity"
title: "Create Liquidity",
},
{
path: "swap",
title: "Swap"
title: "Swap",
},
]

export const APP_ROUTES: Route[] = [
]
export const APP_ROUTES: Route[] = []

const HACK_ROUTES: Route[] = [
]
const HACK_ROUTES: Route[] = []

export const TEST_ROUTES: Route[] = [
]
export const TEST_ROUTES: Route[] = []

export const DEFI_ROUTES = [
]
export const DEFI_ROUTES = []

export const ROUTES_BY_CATEGORY = [
{
Expand Down
43 changes: 0 additions & 43 deletions src/pages/create-liquidity/CreateLiquidityExampleInputs.sol

This file was deleted.

29 changes: 29 additions & 0 deletions src/pages/create-liquidity/CreateLiquidityExampleInputs.solsnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {PoolModifyPositionTest} from "@uniswap/v4-core/contracts/test/PoolModifyPositionTest.sol";

PoolModifyPositionTest lpRouter = PoolModifyPositionTest(0x01);
address token0 = address(0x11);
address token1 = address(0x22);
address hookAddress = address(0x80);

// Pool that will receieve liquidity
PoolKey memory pool = PoolKey({
currency0: Currency.wrap(token0),
currency1: Currency.wrap(token1),
fee: 3000,
tickSpacing: 60,
hooks: IHooks(hookAddress)
});

// approve tokens to the LP Router
IERC20(token0).approve(address(lpRouter), type(uint256).max);
IERC20(token1).approve(address(lpRouter), type(uint256).max);

// Provide 10e18 worth of liquidity on the range of [-600, 600]
int24 tickLower = -600;
int24 tickUpper = 600;
int256 liquidity = 10e18;
lpRouter.modifyPosition(
poolKey,
IPoolManager.ModifyPositionParams({tickLower: tickLower, tickUpper: tickUpper, liquidityDelta: liquidity}),
new bytes(0)
);
Loading
Loading