Skip to content

Commit 0ce0af9

Browse files
committed
Add Templates section with x402 and EncryptedERC starter kits
1 parent 0647171 commit 0ce0af9

File tree

24 files changed

+1029
-283
lines changed

24 files changed

+1029
-283
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ package-lock.json
143143

144144

145145

146-
147146
# Remote content output paths
148147
content/docs/acps/103-dynamic-fees.mdx
149148
content/docs/acps/108-evm-event-importing.mdx
@@ -163,7 +162,6 @@ content/docs/acps/209-eip7702-style-account-abstraction.mdx
163162
content/docs/acps/224-dynamic-gas-limit-in-subnet-evm.mdx
164163
content/docs/acps/226-dynamic-minimum-block-times.mdx
165164
content/docs/acps/23-p-chain-native-transfers.mdx
166-
content/docs/acps/236-continuous-staking.mdx
167165
content/docs/acps/24-shanghai-eips.mdx
168166
content/docs/acps/25-vm-application-errors.mdx
169167
content/docs/acps/30-avalanche-warp-x-evm.mdx

app/docs/docs-layout-wrapper.tsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { DocsSubNav } from '@/components/navigation/docs-subnav';
88
import { DocsNavbarToggle } from '@/components/navigation/docs-navbar-toggle';
99
import { ForceMobileSidebar } from '@/components/navigation/force-mobile-sidebar';
1010
import { NavbarDropdownInjector } from '@/components/navigation/navbar-dropdown-injector';
11-
import {
11+
import {
1212
BookOpen,
1313
Code,
1414
Layers,
@@ -22,7 +22,8 @@ import {
2222
CircleDollarSign,
2323
Terminal,
2424
Package,
25-
Milestone
25+
Milestone,
26+
LayoutTemplate
2627
} from 'lucide-react';
2728

2829
interface DocsLayoutWrapperProps {
@@ -32,6 +33,7 @@ interface DocsLayoutWrapperProps {
3233
rpcsTree: any;
3334
toolingTree: any;
3435
acpsTree: any;
36+
templatesTree: any;
3537
}
3638

3739
export function DocsLayoutWrapper({
@@ -41,6 +43,7 @@ export function DocsLayoutWrapper({
4143
rpcsTree,
4244
toolingTree,
4345
acpsTree,
46+
templatesTree,
4447
}: DocsLayoutWrapperProps) {
4548
const pathname = usePathname();
4649

@@ -61,6 +64,8 @@ export function DocsLayoutWrapper({
6164
document.body.setAttribute('data-docs-section', 'api-reference');
6265
} else if (pathname.startsWith('/docs/rpcs')) {
6366
document.body.setAttribute('data-docs-section', 'rpcs');
67+
} else if (pathname.startsWith('/docs/templates')) {
68+
document.body.setAttribute('data-docs-section', 'templates');
6469
} else if (pathname.startsWith('/docs')) {
6570
document.body.setAttribute('data-docs-section', 'documentation');
6671
}
@@ -228,6 +233,22 @@ export function DocsLayoutWrapper({
228233
},
229234
];
230235

236+
// Templates hamburger menu options
237+
const templatesOptions = [
238+
{
239+
title: 'x402 Starter Kit',
240+
description: 'Payment-gated APIs with micropayments',
241+
icon: <CircleDollarSign className="w-5 h-5" />,
242+
url: '/docs/templates/x402-starter-kit',
243+
},
244+
{
245+
title: 'EncryptedERC',
246+
description: 'Private transactions with zero-knowledge proofs',
247+
icon: <Code className="w-5 h-5" />,
248+
url: '/docs/templates/encrypted-erc',
249+
},
250+
];
251+
231252
// Determine which section we're in and get the appropriate tree
232253
let pageTree;
233254
let sidebarOptions: any = {};
@@ -247,6 +268,11 @@ export function DocsLayoutWrapper({
247268
sidebarOptions = {
248269
tabs: toolingOptions,
249270
};
271+
} else if (pathname.startsWith('/docs/templates')) {
272+
pageTree = templatesTree;
273+
sidebarOptions = {
274+
tabs: templatesOptions,
275+
};
250276
} else if (pathname.startsWith('/docs/acps')) {
251277
pageTree = acpsTree;
252278
// No hamburger menu for ACPs - explicitly disable tabs

app/docs/layout.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import type { ReactNode } from 'react';
22
import { baseOptions } from '@/app/layout.config';
3-
import {
3+
import {
44
getDocumentationTree,
55
getApiReferenceTree,
66
getRpcsTree,
77
getToolingTree,
8-
getAcpsTree
8+
getAcpsTree,
9+
getTemplatesTree
910
} from '@/lib/source';
1011
import { DocsLayoutWrapper } from './docs-layout-wrapper';
1112
import { LayoutWrapper } from '@/app/layout-wrapper.client';
@@ -19,6 +20,7 @@ export default function Layout({ children }: { children: ReactNode }) {
1920
const rpcsTree = getRpcsTree();
2021
const toolingTree = getToolingTree();
2122
const acpsTree = getAcpsTree();
23+
const templatesTree = getTemplatesTree();
2224

2325
return (
2426
<LayoutWrapper baseOptions={baseOptions}>
@@ -28,6 +30,7 @@ export default function Layout({ children }: { children: ReactNode }) {
2830
rpcsTree={rpcsTree}
2931
toolingTree={toolingTree}
3032
acpsTree={acpsTree}
33+
templatesTree={templatesTree}
3134
>
3235
{children}
3336
</DocsLayoutWrapper>

components/landing/student-callout.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ export default function StudentCallout() {
88
<section className="p-4">
99
<div className="max-w-7xl w-full mx-auto ">
1010

11-
<div className="bg-white dark:bg-zinc-900/50 rounded-2xl shadow-lg border border-zinc-200/80 dark:border-zinc-800/80 p-4 md:p-8">
11+
<div className="bg-white rounded-2xl shadow-lg border border-gray-100 p-4 md:p-8">
1212
<div className="flex flex-col md:flex-row items-center gap-8">
1313
{/* Left side - Content */}
1414
<div className="flex-1 text-center md:text-left">
1515
<div className="flex items-center justify-center md:justify-start gap-3 mb-4">
16-
<div className="p-2 bg-blue-100 dark:bg-blue-900/30 rounded-lg">
17-
<GraduationCap className="h-6 w-6 text-blue-600 dark:text-blue-400" />
16+
<div className="p-2 bg-blue-100 rounded-lg">
17+
<GraduationCap className="h-6 w-6 text-blue-600" />
1818
</div>
19-
<span className="text-sm font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wide">
19+
<span className="text-sm font-medium text-blue-600 uppercase tracking-wide">
2020
For Students
2121
</span>
2222
</div>
2323

24-
<h2 className="text-3xl md:text-4xl font-bold text-zinc-900 dark:text-white mb-4">
24+
<h2 className="text-3xl md:text-4xl font-bold text-gray-900 mb-4">
2525
Build the Future with Us
2626
</h2>
2727

28-
<p className="text-lg text-zinc-600 dark:text-zinc-400 mb-6 leading-relaxed">
28+
<p className="text-lg text-gray-600 mb-6 leading-relaxed">
2929
Join thousands of students learning to build on blockchain. Get exclusive access to
3030
student resources, workshops, and opportunities to connect with the Avalanche Builder community.
3131
</p>

components/navigation/docs-subnav.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const tabs = [
1414
!path.startsWith("/docs/api-reference") &&
1515
!path.startsWith("/docs/rpcs") &&
1616
!path.startsWith("/docs/tooling") &&
17-
!path.startsWith("/docs/acps")),
17+
!path.startsWith("/docs/acps") &&
18+
!path.startsWith("/docs/templates")),
1819
},
1920
{
2021
label: "Node RPCs",
@@ -27,10 +28,15 @@ const tabs = [
2728
pathMatch: (path: string) => path.startsWith("/docs/api-reference"),
2829
},
2930
{
30-
label: "Developer Tools",
31+
label: "SDKs",
3132
href: "/docs/tooling/avalanche-sdk",
3233
pathMatch: (path: string) => path.startsWith("/docs/tooling"),
3334
},
35+
{
36+
label: "Templates",
37+
href: "/docs/templates",
38+
pathMatch: (path: string) => path.startsWith("/docs/templates"),
39+
},
3440
{
3541
label: "ACPs",
3642
href: "/docs/acps",

components/toolbox/hooks/useWrappedNativeToken.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ export function useWrappedNativeToken(): WrappedNativeTokenHook {
3333
abi: WrappedNativeToken.abi,
3434
functionName: 'deposit',
3535
value: parseEther(amount),
36-
account: walletEVMAddress as `0x${string}`,
37-
chain: viemChain
36+
account: walletEVMAddress as `0x${string}`
3837
});
3938

4039
notify({
@@ -55,8 +54,7 @@ export function useWrappedNativeToken(): WrappedNativeTokenHook {
5554
abi: WrappedNativeToken.abi,
5655
functionName: 'withdraw',
5756
args: [parseEther(amount)],
58-
account: walletEVMAddress as `0x${string}`,
59-
chain: viemChain
57+
account: walletEVMAddress as `0x${string}`
6058
});
6159

6260
notify({

components/toolbox/stores/l1ListStore.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -110,32 +110,6 @@ const l1ListInitialStateFuji = {
110110
"EVM-compatible L1 chain",
111111
"Deploy dApps & test interoperability with Dispatch"
112112
]
113-
},
114-
{
115-
id: "2TTSLdR6uEM3R5Ukej3YThHSyPf6XCfppAsh5vAuzFA1rY5w7e",
116-
name: "Dexalot",
117-
description: "Dexalot is a decentralized exchange (DEX) that operates on its own Avalanche L1, offering a central limit order book (CLOB) experience",
118-
rpcUrl: "https://subnets.avax.network/dexalot/testnet/rpc",
119-
evmChainId: 432201,
120-
coinName: "ALOT",
121-
isTestnet: true,
122-
subnetId: "9m6a3Qte8FaRbLZixLhh8Ptdkemm4csNaLwQeKkENx5wskbWP",
123-
wrappedTokenAddress: "",
124-
validatorManagerAddress: "",
125-
logoUrl: "https://images.ctfassets.net/gcj8jwzm6086/6tKCXL3AqxfxSUzXLGfN6r/be31715b87bc30c0e4d3da01a3d24e9a/dexalot-subnet.png",
126-
wellKnownTeleporterRegistryAddress: "0xF86Cb19Ad8405AEFa7d09C778215D2Cb6eBfB228",
127-
hasBuilderHubFaucet: true,
128-
externalFaucetUrl: "https://core.app/tools/testnet-faucet",
129-
explorerUrl: "https://subnets-test.avax.network/dexalot",
130-
faucetThresholds: {
131-
threshold: 1.0,
132-
dripAmount: 2
133-
},
134-
features: [
135-
"EVM-compatible L1 chain",
136-
"Decentralized exchange with CLOB",
137-
"Deploy dApps on Dexalot L1"
138-
]
139113
}
140114
] as L1ListItem[],
141115
}

content/academy/permissionless-l1s/02-proof-of-stake/01-introduction.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ authors: [nicolasarnedo]
66
icon: Book
77
---
88

9-
## The Transformation: Two Pieces of the Puzzle
10-
11-
Converting from PoA to PoS isn't about replacing your entire blockchain—it's about strategically combining two concepts you may have already learned in separate courses:
12-
13-
![Proof of Stake Architecture](https://qizat5l3bwvomkny.public.blob.vercel-storage.com/PoS.png)
14-
159
## Proof of Stake as Sybil Protection
1610

1711
Proof of Stake (PoS) is fundamentally a **Sybil protection mechanism** that secures blockchain networks by preventing malicious actors from gaining control through the creation of multiple fake identities. Sybil protection mechanisms serve three critical functions:

content/academy/permissionless-l1s/03-transformation-requirements/01-introduction.mdx

Lines changed: 0 additions & 48 deletions
This file was deleted.

content/academy/permissionless-l1s/03-transformation-requirements/02-native-minter.mdx

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)