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

fix currency.wrap syntax #5

Merged
merged 1 commit into from
Oct 20, 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
4 changes: 2 additions & 2 deletions src/pages/create-liquidity/CreateLiquidityExampleInputs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ contract CreateLiquidityExampleInputs {

// Using a hookless pool
PoolKey memory pool = PoolKey({
currency0: Currency(token0),
currency1: Currency(token1),
currency0: Currency.wrap(token0),
currency1: Currency.wrap(token1),
fee: 3000,
tickSpacing: 60,
hooks: IHooks(address(0x0))
Expand Down
6 changes: 3 additions & 3 deletions src/pages/create-liquidity/index.html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const codes = [
},
{
fileName: "CreateLiquidityExampleInputs.sol",
code: "Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCB7SUVSQzIwfSBmcm9tICJmb3JnZS1zdGQvaW50ZXJmYWNlcy9JRVJDMjAuc29sIjsKaW1wb3J0IHtJUG9vbE1hbmFnZXJ9IGZyb20gIkB1bmlzd2FwL3Y0LWNvcmUvY29udHJhY3RzL2ludGVyZmFjZXMvSVBvb2xNYW5hZ2VyLnNvbCI7CmltcG9ydCB7UG9vbEtleX0gZnJvbSAiQHVuaXN3YXAvdjQtY29yZS9jb250cmFjdHMvdHlwZXMvUG9vbEtleS5zb2wiOwppbXBvcnQge1Bvb2xNb2RpZnlQb3NpdGlvblRlc3R9IGZyb20gIkB1bmlzd2FwL3Y0LWNvcmUvY29udHJhY3RzL3Rlc3QvUG9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bGlxdWlkaXR5IG9uIHRoZSByYW5nZSBvZiBbLTYwMCwgNjAwXQogICAgICAgIGludDI0IHRpY2tMb3dlciA9IC02MDA7CiAgICAgICAgaW50MjQgdGlja1VwcGVyID0gNjAwOwogICAgICAgIGludDI1NiBsaXF1aWRpdHkgPSAxMGUxODsKICAgICAgICBscFJvdXRlci5tb2RpZnlQb3NpdGlvbigKICAgICAgICAgICAgcG9vbEtleSwKICAgICAgICAgICAgSVBvb2xNYW5hZ2VyLk1vZGlmeVBvc2l0aW9uUGFyYW1zKHt0aWNrTG93ZXI6IHRpY2tMb3dlciwgdGlja1VwcGVyOiB0aWNrVXBwZXIsIGxpcXVpZGl0eURlbHRhOiBsaXF1aWRpdHl9KSwKICAgICAgICAgICAgbmV3IGJ5dGVzKDApCiAgICAgICAgKTsKICAgIH0KfQo=",
},
]

Expand Down Expand Up @@ -85,8 +85,8 @@ const html = `<ul>

<span class="hljs-comment">// Using a hookless pool</span>
PoolKey <span class="hljs-keyword">memory</span> pool <span class="hljs-operator">=</span> PoolKey({
currency0: Currency(token0),
currency1: Currency(token1),
currency0: Currency.<span class="hljs-built_in">wrap</span>(token0),
currency1: Currency.<span class="hljs-built_in">wrap</span>(token1),
fee: <span class="hljs-number">3000</span>,
tickSpacing: <span class="hljs-number">60</span>,
hooks: IHooks(<span class="hljs-keyword">address</span>(<span class="hljs-number">0x0</span>))
Expand Down
4 changes: 2 additions & 2 deletions src/pages/initialize/PoolInitialize.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ contract PoolInitialize {
}

PoolKey memory pool = PoolKey({
currency0: Currency(token0),
currency1: Currency(token1),
currency0: Currency.wrap(token0),
currency1: Currency.wrap(token1),
fee: swapFee,
tickSpacing: tickSpacing,
hooks: IHooks(hook)
Expand Down
8 changes: 4 additions & 4 deletions src/pages/initialize/PoolInitializeExampleInputs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ contract PoolInitializeExampleInputs {
bytes memory hookData = new bytes(0);

PoolKey memory pool = PoolKey({
currency0: Currency(token0),
currency1: Currency(token1),
currency0: Currency.wrap(token0),
currency1: Currency.wrap(token1),
fee: swapFee,
tickSpacing: tickSpacing,
hooks: IHooks(address(0x0))
Expand All @@ -57,8 +57,8 @@ contract PoolInitializeExampleInputs {
bytes memory hookData = abi.encode(block.timestamp);

PoolKey memory pool = PoolKey({
currency0: Currency(token0),
currency1: Currency(token1),
currency0: Currency.wrap(token0),
currency1: Currency.wrap(token1),
fee: swapFee,
tickSpacing: tickSpacing,
hooks: IHooks(hook)
Expand Down
16 changes: 8 additions & 8 deletions src/pages/initialize/index.html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export const keywords = [
export const codes = [
{
fileName: "PoolInitialize.sol",
code: "Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC4yMDsKCmltcG9ydCB7SVBvb2xNYW5hZ2VyfSBmcm9tICJAdW5pc3dhcC92NC1jb3JlL2NvbnRyYWN0cy9pbnRlcmZhY2VzL0lQb29sTWFuYWdlci5zb2wiOwppbXBvcnQge0lIb29rc30gZnJvbSAiQHVuaXN3YXAvdjQtY29yZS9jb250cmFjdHMvaW50ZXJmYWNlcy9JSG9va3Muc29sIjsKaW1wb3J0IHtQb29sS2V5fSBmcm9tICJAdW5pc3dhcC92NC1jb3JlL2NvbnRyYWN0cy90eXBlcy9Qb29sS2V5LnNvbCI7CmltcG9ydCB7Q3VycmVuY3lMaWJyYXJ5LCBDdXJyZW5jeX0gZnJvbSAiQHVuaXN3YXAvdjQtY29yZS9jb250cmFjdHMvdHlwZXMvQ3VycmVuY3kuc29sIjsKCmNvbnRyYWN0IFBvb2xJbml0aWFsaXplIHsKICAgIHVzaW5nIEN1cnJlbmN5TGlicmFyeSBmb3IgQ3VycmVuY3k7CgogICAgLy8gc2V0IHRoZSBwb29sIG1hbmFnZXIgYWRkcmVzcwogICAgSVBvb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WxpemUgYSBob29rbGVzcyBwb29sOgogICAgLy8vICAgICAwLjA1JSBzd2FwIGZlZQogICAgLy8vICAgICB0aWNrIHNwYWNpbmcgb2YgMTAKICAgIC8vLyAgICAgc3RhcnRpbmcgcHJpY2Ugb2YgMToxCiAgICBmdW5jdGlvbiBleGFtcGxlQSgpIGV4dGVybmFsIHsKICAgICAgICBhZGRyZXNzIHRva2VuMCA9IGFkZHJlc3MoMHgxMSk7CiAgICAgICAgYWRkcmVzcyB0b2tlbjEgPSBhZGRyZXNzKDB4MjIpOwogICAgICAgIHVpbnQyNCBzd2FwRmVlID0gNTAwOwogICAgICAgIGludDI0IHRpY2tTcGFjaW5nID0gMTA7CgogICAgICAgIC8vIGZsb29yKHNxcnQoMSkgKiAyXjk2KQogICAgICAgIHVpbnQxNjAgc3RhcnRpbmdQcmljZSA9IDc5MjI4MTYyNTE0MjY0MzM3NTkzNTQzOTUwMzM2OwoKICAgICAgICAvLyBob29rbGVzcyBwb29sIGRvZXNudCBleHBlY3QgYW55IGluaXRpYWxpemF0aW9uIGRhdGEKICAgICAgICBieXRlcyBtZW1vcnkgaG9va0RhdGEgPSBuZXcgYnl0ZXMoMCk7CgogICAgICAgIFBvb2xLZXkgbWVtb3J5IHBvb2wgPSBQb29sS2V5KHsKICAgICAgICAgICAgY3VycmVuY3kwOiBDdXJyZW5jeSh0b2tlbjApLAogICAgICAgICAgICBjdXJyZW5jeTE6IEN1cnJlbmN5KHRva2VuMSksCiAgICAgICAgICAgIGZlZTogc3dhcEZlZSwKICAgICAgICAgICAgdGlja1NwYWNpbmc6IHRpY2tTcGFjaW5nLAogICAgICAgICAgICBob29rczogSUhvb2tzKGFkZHJlc3MoMHgwKSkKICAgICAgICB9KTsKICAgICAgICBtYW5hZ2VyLmluaXRpYWxpemUocG9vbCwgc3RhcnRpbmdQcmljZSwgaG9va0RhdGEpOwogICAgfQoKICAgIC8vLyBAbm90aWNlIEluaXRpYWxpemUgYSBwb29sIHdpdGggYSBjdXN0b20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AgbWFuYWdlci5pbml0aWFsaXplKHBvb2wsIHN0YXJ0aW5nUHJpY2UsIGhvb2tEYXRhKTsKICAgIH0KfQo=",
},
]

Expand Down Expand Up @@ -66,8 +66,8 @@ const html = `<ul>
}

PoolKey <span class="hljs-keyword">memory</span> pool <span class="hljs-operator">=</span> PoolKey({
currency0: Currency(token0),
currency1: Currency(token1),
currency0: Currency.<span class="hljs-built_in">wrap</span>(token0),
currency1: Currency.<span class="hljs-built_in">wrap</span>(token1),
fee: swapFee,
tickSpacing: tickSpacing,
hooks: IHooks(hook)
Expand Down Expand Up @@ -108,8 +108,8 @@ const html = `<ul>
<span class="hljs-keyword">bytes</span> <span class="hljs-keyword">memory</span> hookData <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-keyword">bytes</span>(<span class="hljs-number">0</span>);

PoolKey <span class="hljs-keyword">memory</span> pool <span class="hljs-operator">=</span> PoolKey({
currency0: Currency(token0),
currency1: Currency(token1),
currency0: Currency.<span class="hljs-built_in">wrap</span>(token0),
currency1: Currency.<span class="hljs-built_in">wrap</span>(token1),
fee: swapFee,
tickSpacing: tickSpacing,
hooks: IHooks(<span class="hljs-keyword">address</span>(<span class="hljs-number">0x0</span>))
Expand All @@ -136,8 +136,8 @@ const html = `<ul>
<span class="hljs-keyword">bytes</span> <span class="hljs-keyword">memory</span> hookData <span class="hljs-operator">=</span> <span class="hljs-built_in">abi</span>.<span class="hljs-built_in">encode</span>(<span class="hljs-built_in">block</span>.<span class="hljs-built_in">timestamp</span>);

PoolKey <span class="hljs-keyword">memory</span> pool <span class="hljs-operator">=</span> PoolKey({
currency0: Currency(token0),
currency1: Currency(token1),
currency0: Currency.<span class="hljs-built_in">wrap</span>(token0),
currency1: Currency.<span class="hljs-built_in">wrap</span>(token1),
fee: swapFee,
tickSpacing: tickSpacing,
hooks: IHooks(hook)
Expand Down
4 changes: 2 additions & 2 deletions src/pages/swap/SwapExampleInputs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ contract SwapExampleInputs {

// Using a hookless pool
PoolKey memory pool = PoolKey({
currency0: Currency(token0),
currency1: Currency(token1),
currency0: Currency.wrap(token0),
currency1: Currency.wrap(token1),
fee: 3000,
tickSpacing: 60,
hooks: IHooks(address(0x0))
Expand Down
Loading
Loading