Skip to content

Commit

Permalink
feat(website): alpha-5 docs (#14725)
Browse files Browse the repository at this point in the history
Co-authored-by: Marcus Wentz <52706599+MarcusWentz@users.noreply.github.com>
Co-authored-by: Kenk <kenghin_lim@hotmail.com>
  • Loading branch information
3 people authored Sep 19, 2023
1 parent 6e5b789 commit 2abe121
Show file tree
Hide file tree
Showing 83 changed files with 9,017 additions and 5,731 deletions.
3 changes: 0 additions & 3 deletions packages/website/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
.next
node_modules
# temporarily ignoring auto-generated contract documentation until
# we can separate L2/L3 contracts
contract-documentation
24 changes: 8 additions & 16 deletions packages/website/components/Button/AddTokensButton.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,32 @@
import {
ELDFELL_ADD_ETHEREUM_CHAIN,
ELDFELL_ADD_TOKENS,
ELDFELL_CONFIG,
GRIMSVOTN_ADD_ETHEREUM_CHAIN,
GRIMSVOTN_ADD_TOKENS,
GRIMSVOTN_CONFIG,
SEPOLIA_ADD_ETHEREUM_CHAIN,
SEPOLIA_ADD_TOKENS,
SEPOLIA_CONFIG,
JOLNIR_ADD_ETHEREUM_CHAIN,
JOLNIR_ADD_TOKENS,
JOLNIR_CONFIG,
} from "../../domain/chain";

import { ethereumRequest } from "../../utils/ethereumRequest";

type ConnectButtonProps = {
network:
| typeof SEPOLIA_CONFIG.names.shortName
| typeof ELDFELL_CONFIG.names.shortName
| typeof GRIMSVOTN_CONFIG.names.shortName;
| typeof SEPOLIA_CONFIG.names.shortName
| typeof JOLNIR_CONFIG.names.shortName;
};

const chainMap = {
Eldfell: ELDFELL_CONFIG.chainId.hex, // 167005
Grimsvotn: GRIMSVOTN_CONFIG.chainId.hex, // 167005
Sepolia: SEPOLIA_CONFIG.chainId.hex, // 11155111
Sepolia: SEPOLIA_CONFIG.chainId.hex,
};

const configMap = {
Eldfell: ELDFELL_ADD_ETHEREUM_CHAIN,
Grimsvotn: GRIMSVOTN_ADD_ETHEREUM_CHAIN,
Sepolia: SEPOLIA_ADD_ETHEREUM_CHAIN,
Jolnir: JOLNIR_ADD_ETHEREUM_CHAIN,
};

const tokenConfigMap = {
Grimsvotn: GRIMSVOTN_ADD_TOKENS,
Sepolia: SEPOLIA_ADD_TOKENS,
Eldfell: ELDFELL_ADD_TOKENS,
Jolnir: JOLNIR_ADD_TOKENS,
};

interface AddTokensButtonProps {
Expand Down
24 changes: 8 additions & 16 deletions packages/website/components/Button/ConnectToMetamaskButton.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import {
ELDFELL_ADD_ETHEREUM_CHAIN,
ELDFELL_CONFIG,
GRIMSVOTN_ADD_ETHEREUM_CHAIN,
GRIMSVOTN_CONFIG,
SEPOLIA_CONFIG,
TAIKO_CONFIG,
TAIKO_ADD_ETHEREUM_CHAIN,
} from "../../domain/chain";

import { ethereumRequest } from "../../utils/ethereumRequest";

type ConnectButtonProps = {
network:
| typeof SEPOLIA_CONFIG.names.shortName
| typeof ELDFELL_CONFIG.names.shortName
| typeof GRIMSVOTN_CONFIG.names.shortName;
| typeof SEPOLIA_CONFIG.names.shortName
| typeof TAIKO_CONFIG.names.shortName;
};

const chainMap = {
Eldfell: ELDFELL_CONFIG.chainId.hex, // 167005
Grimsvotn: GRIMSVOTN_CONFIG.chainId.hex, // 167005
Sepolia: SEPOLIA_CONFIG.chainId.hex, // 11155111
Sepolia: SEPOLIA_CONFIG.chainId.hex,
Jolnir: TAIKO_CONFIG.chainId.hex,
};

async function ConnectToMetamask(network: ConnectButtonProps["network"]) {
Expand All @@ -37,11 +33,7 @@ async function ConnectToMetamask(network: ConnectButtonProps["network"]) {
if (network === SEPOLIA_CONFIG.names.shortName) {
params = [{ chainId: chainMap[network] }];
} else {
params = [
network === ELDFELL_CONFIG.names.shortName
? ELDFELL_ADD_ETHEREUM_CHAIN
: GRIMSVOTN_ADD_ETHEREUM_CHAIN,
];
params = [TAIKO_ADD_ETHEREUM_CHAIN];
}
try {
await ethereumRequest(
Expand All @@ -53,7 +45,7 @@ async function ConnectToMetamask(network: ConnectButtonProps["network"]) {
} catch (error) {
alert(
"Failed to add the network with wallet_addEthereumChain request. Add the network with https://chainlist.org/ or do it manually. Error log: " +
error.message
error.message
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/website/components/Ecosystem/EcosystemSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const ecosystemData: EcosystemData[] = [
{
icon: "/images/ecosystem/taiko.svg",
name: "Bridge",
link: "https://bridge.test.taiko.xyz",
link: "https://bridge.jolnir.taiko.xyz",
description: "Bridge is a dapp that lets you bridge tokens with Taiko.",
filters: [],
isLive: true,
Expand Down Expand Up @@ -351,7 +351,7 @@ const ecosystemData: EcosystemData[] = [
{
icon: "/images/ecosystem/taiko.svg",
name: "Swap",
link: "https://swap.test.taiko.xyz",
link: "https://swap.jolnir.taiko.xyz",
description: "Swap is a dapp that lets you swap tokens on Taiko.",
filters: [],
isLive: true,
Expand Down
7 changes: 4 additions & 3 deletions packages/website/components/Home/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function Footer() {
className="hover:underline"
target={"_blank"}
>
Brand kit
Media kit
</a>
</li>
</ul>
Expand All @@ -58,10 +58,11 @@ export function Footer() {
</li>
<li className="mb-4">
<a
href="/docs/resources/integration-guide"
href="https://status.taiko.xyz"
className="hover:underline"
target={"_blank"}
>
Integration manual
Status
</a>
</li>
</ul>
Expand Down
8 changes: 4 additions & 4 deletions packages/website/components/Home/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export function Hero() {
<div className="relative z-10 w-3/4 pt-16 pb-20 text-left lg:py-48">
<div className="pl-[max(env(safe-area-inset-left),1.5rem)]">
<h1 className="font-grotesk text-4xl md:text-5xl tracking-tight text-neutral-900 dark:text-neutral-100">
A <span className="text-[#e81899]">Type 1</span> ZK-EVM
A <span className="text-[#e81899]">based</span> rollup
</h1>
<p className="font-groteskmedium mt-3 text-lg text-neutral-600 sm:text-xl md:mt-5 dark:text-neutral-100">
Decentralized, Ethereum-equivalent ZK-Rollup.
Decentralized, Ethereum-equivalent (Type 1) ZK-EVM.
</p>
<div className="mt-10 flex flex-col sm:flex-row md:justify-left">
<div className="inline-flex mb-4 sm:mb-0 sm:mr-4">
Expand All @@ -59,10 +59,10 @@ export function Hero() {
</div>
<div className="inline-flex">
<a
href="/docs/guides/run-a-node"
href="/docs/guides/run-a-taiko-node"
className="inline-flex items-center rounded-md border-2 border-[#e81899] bg-transparent px-5 py-2.5 text-base font-semibold text-[#e81899] hover:border-[#d1168a] hover:text-[#d1168a] hover:no-underline w-auto"
>
Run a node
Run a Taiko node
</a>
</div>
</div>
Expand Down
44 changes: 43 additions & 1 deletion packages/website/domain/chain/baseTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ interface AddTokenParameter {
image: string;
}


// Taiko network types
interface BasedContracts {
addressManager: Contract;
Expand All @@ -79,6 +78,22 @@ interface BasedContracts {
};
}

interface Alpha5BasedContracts {
addressManager: Contract;
taikoL1: Contract;
erc20Vault: Contract;
erc721Vault: Contract;
erc1155Vault: Contract;
bridge: Contract;
signalService: Contract;
proofVerifier: Contract;
erc20Contracts?: {
taikoToken?: ERC20Contract;
horseToken?: ERC20Contract;
bullToken?: ERC20Contract;
};
}

interface RollupContracts {
taikoL2: Contract;
tokenVault: Contract;
Expand All @@ -92,6 +107,21 @@ interface RollupContracts {
};
}

interface Alpha5RollupContracts {
taikoL2: Contract;
etherVault: Contract;
erc20Vault: Contract;
erc721Vault: Contract;
erc1155Vault: Contract;
bridge: Contract;
signalService: Contract;
erc20Contracts: {
bridgedTaikoToken: ERC20Contract;
bridgedHorseToken: ERC20Contract;
bridgedBullToken: ERC20Contract;
};
}

interface OtherContracts {
deterministicDeploymentProxy?: Contract;
erc4337Entrypoint?: Contract;
Expand All @@ -112,15 +142,27 @@ interface TaikoL2Alpha3 extends Network {
otherContracts: OtherContracts;
}

interface TaikoL1Alpha5 extends Network {
basedContracts: Alpha5BasedContracts;
otherContracts: OtherContracts;
}

interface TaikoL2Alpha5 extends Network {
rollupContracts: Alpha5RollupContracts;
otherContracts: OtherContracts;
}

type TaikoL2Alpha4 = TaikoL2Alpha3;

export type {
AddEthereumChainParameter,
AddTokenParameter,
TaikoL1Alpha3,
TaikoL1Alpha4,
TaikoL1Alpha5,
TaikoL2Alpha3,
TaikoL2Alpha4,
TaikoL2Alpha5,
BasedContracts,
RollupContracts,
OtherContracts,
Expand Down
14 changes: 12 additions & 2 deletions packages/website/domain/chain/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
// export base configs
import { JOLNIR_CONFIG } from "./jolnir/config";
import { JOLNIR_ADD_ETHEREUM_CHAIN } from "./jolnir/addEthereumChain";
import { JOLNIR_ADD_TOKENS } from "./jolnir/addTokens";

export { SEPOLIA_CONFIG } from "./sepolia/config";
export { GRIMSVOTN_CONFIG } from "./grimsvotn/config";
export { ELDFELL_CONFIG } from "./eldfell/config";
export { JOLNIR_CONFIG } from "./jolnir/config";

// export add ethereum chain configs
export { SEPOLIA_ADD_ETHEREUM_CHAIN } from "./sepolia/addEthereumChain";
export { GRIMSVOTN_ADD_ETHEREUM_CHAIN } from "./grimsvotn/addEthereumChain";
export { ELDFELL_ADD_ETHEREUM_CHAIN } from "./eldfell/addEthereumChain";
export { JOLNIR_ADD_ETHEREUM_CHAIN } from "./jolnir/addEthereumChain";

export { SEPOLIA_ADD_TOKENS } from "./sepolia/addTokens";
export { GRIMSVOTN_ADD_TOKENS } from "./grimsvotn/addTokens";
export { ELDFELL_ADD_TOKENS } from "./eldfell/addTokens";
export { JOLNIR_ADD_TOKENS } from "./jolnir/addTokens";

// alias abstract taiko config to a concrete config
export const TAIKO_CONFIG = JOLNIR_CONFIG;
export const TAIKO_ADD_ETHEREUM_CHAIN = JOLNIR_ADD_ETHEREUM_CHAIN;
export const TAIKO_ADD_TOKENS = JOLNIR_ADD_TOKENS;
11 changes: 11 additions & 0 deletions packages/website/domain/chain/jolnir/addEthereumChain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { JOLNIR_CONFIG } from "./config";
import { AddEthereumChainParameter } from "../baseTypes";

export const JOLNIR_ADD_ETHEREUM_CHAIN: AddEthereumChainParameter = {
chainId: JOLNIR_CONFIG.chainId.hex,
chainName: JOLNIR_CONFIG.names.mediumName,
nativeCurrency: JOLNIR_CONFIG.nativeCurrency,
rpcUrls: [JOLNIR_CONFIG.rpc.https],
blockExplorerUrls: [JOLNIR_CONFIG.blockExplorer.url],
iconUrls: [],
};
38 changes: 38 additions & 0 deletions packages/website/domain/chain/jolnir/addTokens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { AddTokenParameter } from "../baseTypes";
import { JOLNIR_CONFIG } from "./config";

export const JOLNIR_ADD_TTKOJ: AddTokenParameter = {
address:
JOLNIR_CONFIG.rollupContracts.erc20Contracts.bridgedTaikoToken.address.impl,
symbol: JOLNIR_CONFIG.rollupContracts.erc20Contracts.bridgedTaikoToken.symbol,
decimals:
JOLNIR_CONFIG.rollupContracts.erc20Contracts.bridgedTaikoToken.decimals,
image:
"https://raw.githubusercontent.com/taikoxyz/taiko-mono/main/packages/branding/testnet-token-images/ttko.svg",
};

export const JOLNIR_ADD_BLL: AddTokenParameter = {
address:
JOLNIR_CONFIG.rollupContracts.erc20Contracts.bridgedBullToken.address.impl,
symbol: JOLNIR_CONFIG.rollupContracts.erc20Contracts.bridgedBullToken.symbol,
decimals:
JOLNIR_CONFIG.rollupContracts.erc20Contracts.bridgedBullToken.decimals,
image:
"https://raw.githubusercontent.com/taikoxyz/taiko-mono/main/packages/branding/testnet-token-images/bull.svg",
};

export const JOLNIR_ADD_HORSE: AddTokenParameter = {
address:
JOLNIR_CONFIG.rollupContracts.erc20Contracts.bridgedHorseToken.address.impl,
symbol: JOLNIR_CONFIG.rollupContracts.erc20Contracts.bridgedHorseToken.symbol,
decimals:
JOLNIR_CONFIG.rollupContracts.erc20Contracts.bridgedHorseToken.decimals,
image:
"https://raw.githubusercontent.com/taikoxyz/taiko-mono/main/packages/branding/testnet-token-images/horse.svg",
};

export const JOLNIR_ADD_TOKENS = [
JOLNIR_ADD_TTKOJ,
JOLNIR_ADD_BLL,
JOLNIR_ADD_HORSE,
];
Loading

1 comment on commit 2abe121

@vercel
Copy link

@vercel vercel bot commented on 2abe121 Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment failed with the following error:

Too many requests - try again in 36 seconds (more than 60, code: "api-deployments-flood").

Please sign in to comment.