diff --git a/packages/website/.gitignore b/packages/website/.gitignore index d109751023b..f74c78183c9 100644 --- a/packages/website/.gitignore +++ b/packages/website/.gitignore @@ -1,5 +1,2 @@ .next node_modules -# temporarily ignoring auto-generated contract documentation until -# we can separate L2/L3 contracts -contract-documentation \ No newline at end of file diff --git a/packages/website/components/Button/AddTokensButton.tsx b/packages/website/components/Button/AddTokensButton.tsx index 5eb7732a4b2..f9da4ee2dbb 100644 --- a/packages/website/components/Button/AddTokensButton.tsx +++ b/packages/website/components/Button/AddTokensButton.tsx @@ -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 { diff --git a/packages/website/components/Button/ConnectToMetamaskButton.tsx b/packages/website/components/Button/ConnectToMetamaskButton.tsx index 813cbaf7f28..9df9684b151 100644 --- a/packages/website/components/Button/ConnectToMetamaskButton.tsx +++ b/packages/website/components/Button/ConnectToMetamaskButton.tsx @@ -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"]) { @@ -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( @@ -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 ); } } diff --git a/packages/website/components/Ecosystem/EcosystemSection.tsx b/packages/website/components/Ecosystem/EcosystemSection.tsx index ffb0cea59ab..11a825e861e 100644 --- a/packages/website/components/Ecosystem/EcosystemSection.tsx +++ b/packages/website/components/Ecosystem/EcosystemSection.tsx @@ -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, @@ -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, diff --git a/packages/website/components/Home/Footer.tsx b/packages/website/components/Home/Footer.tsx index 0f7a146e565..fc9f21a19a8 100644 --- a/packages/website/components/Home/Footer.tsx +++ b/packages/website/components/Home/Footer.tsx @@ -32,7 +32,7 @@ export function Footer() { className="hover:underline" target={"_blank"} > - Brand kit + Media kit @@ -58,10 +58,11 @@ export function Footer() {
  • - Integration manual + Status
  • diff --git a/packages/website/components/Home/Hero.tsx b/packages/website/components/Home/Hero.tsx index 845901e0f20..e9a842cdab7 100644 --- a/packages/website/components/Home/Hero.tsx +++ b/packages/website/components/Home/Hero.tsx @@ -43,10 +43,10 @@ export function Hero() {

    - A Type 1 ZK-EVM + A based rollup

    - Decentralized, Ethereum-equivalent ZK-Rollup. + Decentralized, Ethereum-equivalent (Type 1) ZK-EVM.

    @@ -59,10 +59,10 @@ export function Hero() {
    - Run a node + Run a Taiko node
    diff --git a/packages/website/domain/chain/baseTypes.ts b/packages/website/domain/chain/baseTypes.ts index 01f64320431..2c2b53c8466 100644 --- a/packages/website/domain/chain/baseTypes.ts +++ b/packages/website/domain/chain/baseTypes.ts @@ -62,7 +62,6 @@ interface AddTokenParameter { image: string; } - // Taiko network types interface BasedContracts { addressManager: Contract; @@ -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; @@ -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; @@ -112,6 +142,16 @@ 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 { @@ -119,8 +159,10 @@ export type { AddTokenParameter, TaikoL1Alpha3, TaikoL1Alpha4, + TaikoL1Alpha5, TaikoL2Alpha3, TaikoL2Alpha4, + TaikoL2Alpha5, BasedContracts, RollupContracts, OtherContracts, diff --git a/packages/website/domain/chain/index.ts b/packages/website/domain/chain/index.ts index 8919afaa22f..192253ee4f4 100644 --- a/packages/website/domain/chain/index.ts +++ b/packages/website/domain/chain/index.ts @@ -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; diff --git a/packages/website/domain/chain/jolnir/addEthereumChain.ts b/packages/website/domain/chain/jolnir/addEthereumChain.ts new file mode 100644 index 00000000000..5a5761c03de --- /dev/null +++ b/packages/website/domain/chain/jolnir/addEthereumChain.ts @@ -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: [], +}; diff --git a/packages/website/domain/chain/jolnir/addTokens.ts b/packages/website/domain/chain/jolnir/addTokens.ts new file mode 100644 index 00000000000..c6d95cb0e4b --- /dev/null +++ b/packages/website/domain/chain/jolnir/addTokens.ts @@ -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, +]; diff --git a/packages/website/domain/chain/jolnir/config.ts b/packages/website/domain/chain/jolnir/config.ts new file mode 100644 index 00000000000..fdd837d4697 --- /dev/null +++ b/packages/website/domain/chain/jolnir/config.ts @@ -0,0 +1,115 @@ +import { TaikoL2Alpha5 } from "../baseTypes"; + +export const JOLNIR_CONFIG = { + names: { + lowercaseShortName: "jolnir", + shortName: "Jolnir", + shortishName: "Jolnir L2", + mediumName: "Taiko Jolnir L2", + longName: "Taiko Jolnir L2 (alpha-5)", + }, + chainId: { + decimal: 167007, + hex: "0x28c5f", + }, + nativeCurrency: { + name: "Ether", + symbol: "ETH", + decimals: 18, + }, + rpc: { + https: "https://rpc.jolnir.taiko.xyz", + wss: "wss://ws.jolnir.taiko.xyz", + }, + blockExplorer: { + name: "Blockscout", + url: "https://explorer.jolnir.taiko.xyz", + }, + testnet: true, + rollupContracts: { + // Protocol contracts + taikoL2: { + name: "TaikoL2", + address: { + impl: "0x1000777700000000000000000000000000000001", + }, + }, + etherVault: { + name: "EtherVault", + address: { + impl: "0x1000777700000000000000000000000000000003", + }, + }, + erc20Vault: { + name: "ERC20Vault", + address: { + impl: "0x1000777700000000000000000000000000000002", + }, + }, + erc721Vault: { + name: "ERC721Vault", + address: { + impl: "0x1000777700000000000000000000000000000008", + }, + }, + erc1155Vault: { + name: "ERC1155Vault", + address: { + impl: "0x1000777700000000000000000000000000000009", + }, + }, + bridge: { + name: "Bridge", + address: { + impl: "0x1000777700000000000000000000000000000004", + }, + }, + signalService: { + name: "SignalService", + address: { + impl: "0x1000777700000000000000000000000000000007", + }, + }, + // Bridged ERC-20 contracts + erc20Contracts: { + bridgedTaikoToken: { + name: "Bridged Taiko Token Jolnir", + address: { + impl: "0xe705498492D0aE94CA9365D395D2C6924F24F445", + }, + decimals: 18, + symbol: "TTKOj", + }, + bridgedHorseToken: { + name: "Bridged Horse Token", + address: { + impl: "0x9833DcA11f178dbaF2b88da42557DA2970534430", + }, + decimals: 18, + symbol: "HORSE", + }, + bridgedBullToken: { + name: "Bridged Bull Token", + address: { + impl: "0xc02D1fE3aA2134D2d7561e99f0A699C5Ca7B44ED", + }, + decimals: 18, + symbol: "BLL", + }, + }, + }, + otherContracts: { + deterministicDeploymentProxy: { + name: "Deterministic Deployment Proxy", + address: { + impl: "0xTODO(docs)", + }, + }, + erc4337Entrypoint: { + name: "ERC-4337 Entrypoint", + address: { + impl: "0xTODO(docs)", + }, + }, + }, +} as const satisfies TaikoL2Alpha5; diff --git a/packages/website/domain/chain/jolnir/wagmiChain.ts b/packages/website/domain/chain/jolnir/wagmiChain.ts new file mode 100644 index 00000000000..0b2be02bb4e --- /dev/null +++ b/packages/website/domain/chain/jolnir/wagmiChain.ts @@ -0,0 +1,24 @@ +import { Chain } from "viem"; +import { JOLNIR_CONFIG } from "./config"; + +export const taikoJOLNIR = { + id: JOLNIR_CONFIG.chainId.decimal, + name: JOLNIR_CONFIG.names.mediumName, + network: JOLNIR_CONFIG.names.lowercaseShortName, + nativeCurrency: JOLNIR_CONFIG.nativeCurrency, + rpcUrls: { + public: { + http: [JOLNIR_CONFIG.rpc.https], + }, + default: { + http: [JOLNIR_CONFIG.rpc.https], + }, + }, + blockExplorers: { + default: { + name: JOLNIR_CONFIG.blockExplorer.name, + url: JOLNIR_CONFIG.blockExplorer.url, + }, + }, + testnet: JOLNIR_CONFIG.testnet, +} as const satisfies Chain; diff --git a/packages/website/domain/chain/sepolia/config.ts b/packages/website/domain/chain/sepolia/config.ts index 01671e4b173..094bb25130f 100644 --- a/packages/website/domain/chain/sepolia/config.ts +++ b/packages/website/domain/chain/sepolia/config.ts @@ -1,4 +1,4 @@ -import { TaikoL1Alpha3 } from "../baseTypes"; +import { TaikoL1Alpha5 } from "../baseTypes"; export const SEPOLIA_CONFIG = { names: { @@ -29,71 +29,86 @@ export const SEPOLIA_CONFIG = { addressManager: { name: "AddressManager", address: { - proxy: "0xB566C97d37662f8a5843D523bE7806e04b02D99d", - impl: "0x98c5042C5fD3B38F250961546d271760b504278E", + proxy: "0x6b390878aCf6e3AdF5fAEb4771c6FB6be518D569", + impl: "0x39bF8d5A8Ad841381E4075A009035a6a22d46bFE", }, }, taikoL1: { name: "TaikoL1", address: { - proxy: "0x6375394335f34848b850114b66A49D6F47f2cdA8", - impl: "0x07eb4fe3c621393702cee6643af9c728fbac116a", + proxy: "0x95fF8D3CE9dcB7455BEB7845143bEA84Fe5C4F6f", + impl: "0xD0979F959D788dD0C55c743Cb5D5c2175F2AB097", }, }, - tokenVault: { - name: "TokenVault", + erc20Vault: { + name: "ERC20Vault", address: { - proxy: "0xD70506580B5F65e68ed0dbA7B4Ae507641C48197", - impl: "0x90871108691796cee8307C8610Da353F4Ef41774", + proxy: "0x9f1a34A0e4f6C77C3648C4d9E922DA615C64D194", + impl: "0xA17D83Fe61bF1D13446ed70A50dDab8b400Fa988", + }, + }, + erc721Vault: { + name: "ERC721Vault", + address: { + proxy: "0x116649D245c08979E20FeDa89162A3D02fFeA88a", + impl: "0xFc168aF3235C76bDb8C544b71E4d55c458EbA2cf", + }, + }, + erc1155Vault: { + name: "ERC1155Vault", + address: { + proxy: "0xF92938C48D078797E1Eb201D0fbB1Ac739F50B90", + impl: "0xFbBE73bD5682Db685eAe986d713F84Af4851b2e9", }, }, bridge: { name: "Bridge", address: { - proxy: "0x7D992599E1B8b4508Ba6E2Ba97893b4C36C23A28", - impl: "0xd7C538576c78ab62EFE867CffC23F7e722E73A7D", + proxy: "0x5293Bb897db0B64FFd11E0194984E8c5F1f06178", + impl: "0xa239b8f15e3BF3789D184873300cB6bdCe3BcC05", }, }, signalService: { name: "SignalService", address: { - proxy: "0x23baAc3892a823e9E59B85d6c90068474fe60086", - impl: "0x4E0924758cBbe463c58c6F2519086411d084f242", + proxy: "0xcD5e2bebd3DfE46e4BF96aE2ac7B89B22cc6a982", + impl: "0xD3ac5E6d9DB6e9845f53521D36b81cc14dA5424a", }, }, - plonkVerifier: { - name: "PlonkVerifier", + proofVerifier: { + name: "ProofVerifier", address: { - impl: "0xd46eb8cF2b47cd99bdb1dD8C76EEc55ac6eb930E", + proxy: "0xdC396C7478C5C985fc19386BdD29370e10572ed9", + impl: "0x05764AeD55E200200C0f50AAdEa377E9cf3C6Fb0", }, }, erc20Contracts: { taikoToken: { - name: "Taiko Token", + name: "Taiko Token Jolnir", + symbol: "TTKOj", + decimals: 18, address: { - proxy: "0xE52952B8063d0AE6Bd35E894866d8148976ce645", - impl: "0x517976c137606f040168E5ec7f15e5d32f29C73F", + proxy: "0x75F94f04d2144cB6056CCd0CFF1771573d838974", + impl: "0xB3458D8Ba7fcA9Eab341E986005df155e1243AE4", }, - decimals: 8, - symbol: "TTKO", }, horseToken: { name: "Horse Token", + symbol: "HORSE", + decimals: 18, address: { - impl: "0x958b482c4E9479a600bFFfDDfe94D974951Ca3c7", + impl: "0xe9f36Ec3F1B8056A67a2B542551D248D511aA7d6", }, - decimals: 18, - symbol: "HORSE", }, bullToken: { name: "Bull Token", + symbol: "BLL", + decimals: 18, address: { - impl: "0x39e12053803898211F21047D56017986E0f070c1", + impl: "0x0505f8EA58319b96bd7FffCec82d29AcC78Fb57e", }, - decimals: 18, - symbol: "BLL", }, }, }, otherContracts: {}, -} as const satisfies TaikoL1Alpha3; +} as const satisfies TaikoL1Alpha5; diff --git a/packages/website/excalidraw/contestable-validity-rollup.excalidraw b/packages/website/excalidraw/contestable-validity-rollup.excalidraw new file mode 100644 index 00000000000..1888291aef0 --- /dev/null +++ b/packages/website/excalidraw/contestable-validity-rollup.excalidraw @@ -0,0 +1,448 @@ +{ + "type": "excalidraw", + "version": 2, + "source": "https://marketplace.visualstudio.com/items?itemName=pomdtr.excalidraw-editor", + "elements": [ + { + "id": "FV8-ho5oBLP9NnMPH824A", + "type": "rectangle", + "x": 336.2906494140625, + "y": 95.31094360351562, + "width": 144.90469360351562, + "height": 79.2421875, + "angle": 0, + "strokeColor": "#1864ab", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "roundness": { + "type": 3 + }, + "seed": 54452031, + "version": 238, + "versionNonce": 577835985, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "9q7PcXqH2Fu6M4RVSjXkb" + } + ], + "updated": 1695015286128, + "link": null, + "locked": false + }, + { + "id": "9q7PcXqH2Fu6M4RVSjXkb", + "type": "text", + "x": 366.623046875, + "y": 122.43203735351562, + "width": 84.23989868164062, + "height": 25, + "angle": 0, + "strokeColor": "#1864ab", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "roundness": null, + "seed": 121211199, + "version": 99, + "versionNonce": 1203211711, + "isDeleted": false, + "boundElements": null, + "updated": 1695015286128, + "link": null, + "locked": false, + "text": "Proposer", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 17, + "containerId": "FV8-ho5oBLP9NnMPH824A", + "originalText": "Proposer", + "lineHeight": 1.25 + }, + { + "type": "rectangle", + "version": 316, + "versionNonce": 1458115473, + "isDeleted": false, + "id": "JG0KQ1Fa6aVHmNCuqqXD_", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 338.43357849121094, + "y": 307.641357421875, + "strokeColor": "#c92a2a", + "backgroundColor": "transparent", + "width": 144.90469360351562, + "height": 79.2421875, + "seed": 54452031, + "groupIds": [], + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "type": "text", + "id": "teChrhADEMipqLxfIOv2U" + } + ], + "updated": 1695015288377, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 183, + "versionNonce": 915433983, + "isDeleted": false, + "id": "teChrhADEMipqLxfIOv2U", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 379.4359588623047, + "y": 334.762451171875, + "strokeColor": "#c92a2a", + "backgroundColor": "transparent", + "width": 62.899932861328125, + "height": 25, + "seed": 121211199, + "groupIds": [], + "roundness": null, + "boundElements": [], + "updated": 1695015288377, + "link": null, + "locked": false, + "fontSize": 20, + "fontFamily": 1, + "text": "Prover", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "JG0KQ1Fa6aVHmNCuqqXD_", + "originalText": "Prover", + "lineHeight": 1.25, + "baseline": 17 + }, + { + "type": "rectangle", + "version": 415, + "versionNonce": 1548393713, + "isDeleted": false, + "id": "FHWBfomZ-xNe7po2tcjFC", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 594.4726409912109, + "y": 310.4995422363281, + "strokeColor": "#c92a2a", + "backgroundColor": "#1864ab", + "width": 144.90469360351562, + "height": 79.2421875, + "seed": 54452031, + "groupIds": [], + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "type": "text", + "id": "Fk0I-DThEH9sN2uV3ltfU" + } + ], + "updated": 1695015305046, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 294, + "versionNonce": 1492035231, + "isDeleted": false, + "id": "Fk0I-DThEH9sN2uV3ltfU", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 627.5950164794922, + "y": 325.1206359863281, + "strokeColor": "#c92a2a", + "backgroundColor": "transparent", + "width": 78.65994262695312, + "height": 50, + "seed": 121211199, + "groupIds": [], + "roundness": null, + "boundElements": [], + "updated": 1695015305046, + "link": null, + "locked": false, + "fontSize": 20, + "fontFamily": 1, + "text": "Bonded \nProver", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "FHWBfomZ-xNe7po2tcjFC", + "originalText": "Bonded Prover", + "lineHeight": 1.25, + "baseline": 42 + }, + { + "id": "UVZyHHSejc5zDtlKi2upa", + "type": "rectangle", + "x": 625.682861328125, + "y": 100.93592834472656, + "width": 66, + "height": 63, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "#868e96", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "roundness": { + "type": 3 + }, + "seed": 1091582833, + "version": 282, + "versionNonce": 576700657, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "8Uql9QkZRynDp3f7XG-kw" + } + ], + "updated": 1695015277659, + "link": null, + "locked": false + }, + { + "id": "8Uql9QkZRynDp3f7XG-kw", + "type": "text", + "x": 638.4188766479492, + "y": 122.43592834472656, + "width": 40.52796936035156, + "height": 20, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "roundness": null, + "seed": 2075896127, + "version": 561, + "versionNonce": 86885023, + "isDeleted": false, + "boundElements": null, + "updated": 1695015277659, + "link": null, + "locked": false, + "text": "Block", + "fontSize": 16, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 14, + "containerId": "UVZyHHSejc5zDtlKi2upa", + "originalText": "Block", + "lineHeight": 1.25 + }, + { + "id": "7j0yiEa_8_GpXZDlBuBFW", + "type": "line", + "x": 832.1343994140625, + "y": 98.08125305175781, + "width": 0, + "height": 54.23905944824219, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "#1864ab", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "roundness": { + "type": 2 + }, + "seed": 314473151, + "version": 87, + "versionNonce": 1191138335, + "isDeleted": false, + "boundElements": null, + "updated": 1695016839889, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 54.23905944824219 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "0D31DyeyQjiB9Vf-4IJsb", + "type": "line", + "x": 833.4656372070312, + "y": 126.5250244140625, + "width": 323.26873779296875, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "#1864ab", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "roundness": { + "type": 2 + }, + "seed": 626882623, + "version": 142, + "versionNonce": 596086385, + "isDeleted": false, + "boundElements": null, + "updated": 1695016845925, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 323.26873779296875, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "type": "line", + "version": 186, + "versionNonce": 1856336767, + "isDeleted": false, + "id": "4oSeur6bz5KI5ttwqVkjt", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 1157.6003951350226, + "y": 99.88064728915693, + "strokeColor": "#000000", + "backgroundColor": "#1864ab", + "width": 0, + "height": 54.23905944824219, + "seed": 314473151, + "groupIds": [], + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1695016853198, + "link": null, + "locked": false, + "startBinding": null, + "endBinding": null, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": null, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 54.23905944824219 + ] + ] + }, + { + "id": "NE3Zjar3yp61fMj0fAkGz", + "type": "text", + "x": 887.3438110351562, + "y": 84.24375915527344, + "width": 197.35986328125, + "height": 20, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "#1864ab", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "roundness": null, + "seed": 958439889, + "version": 27, + "versionNonce": 1682267697, + "isDeleted": false, + "boundElements": null, + "updated": 1695016863360, + "link": null, + "locked": false, + "text": "provingWindow, t=90 days", + "fontSize": 16, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 14, + "containerId": null, + "originalText": "provingWindow, t=90 days", + "lineHeight": 1.25 + } + ], + "appState": { + "gridSize": null, + "viewBackgroundColor": "#ffffff" + }, + "files": {} +} \ No newline at end of file diff --git a/packages/website/next.config.mjs b/packages/website/next.config.mjs index f63794efc04..057e994eb14 100644 --- a/packages/website/next.config.mjs +++ b/packages/website/next.config.mjs @@ -20,68 +20,6 @@ const withNextra = nextra({ export default withNextra({ async redirects() { return [ - // Migrate builder guides to new "Build on Taiko" section - { - source: "/docs/guides/configure-your-wallet", - destination: "/docs/guides/build-on-taiko/setup-your-wallet", - permanent: true, - }, - { - source: "/docs/guides/receive-tokens", - destination: "/docs/guides/build-on-taiko/receive-tokens", - permanent: true, - }, - { - source: "/docs/guides/use-the-bridge", - destination: "/docs/guides/build-on-taiko/bridge-tokens", - permanent: true, - }, - { - source: "/docs/guides/swap-tokens", - destination: "/docs/guides/build-on-taiko/swap-tokens", - permanent: true, - }, - { - source: "/docs/guides/deploy-a-contract", - destination: "/docs/guides/build-on-taiko/deploy-a-contract", - permanent: true, - }, - { - source: "/docs/guides/verify-a-contract", - destination: "/docs/guides/build-on-taiko/verify-a-contract", - permanent: true, - }, - { - source: "/docs/guides/build-a-dapp", - destination: "/docs/guides/build-on-taiko/build-a-dapp", - permanent: true, - }, - // Migrate node runner guides to new "Run a node" section - { - source: "/docs/guides/run-a-node", - destination: "/docs/guides/run-a-node/run-a-taiko-node", - permanent: true, - }, - { - source: "/docs/guides/run-a-sepolia-node", - destination: "/docs/guides/run-a-node/run-a-sepolia-node", - permanent: true, - }, - { - source: "/docs/guides/enable-a-proposer", - destination: "/docs/guides/run-a-node/enable-a-proposer", - permanent: true, - }, - { - source: "/docs/guides/enable-a-prover", - destination: "/docs/guides/run-a-node/enable-a-prover", - permanent: true, - }, - { - source: "/docs/guides/claim-prover-ttko", - destination: "/docs/guides/run-a-node/claim-prover-rewards", - permanent: true, - }, // Introduce the concept of manuals { source: "/docs/resources/contributing", @@ -99,6 +37,7 @@ export default withNextra({ destination: "/docs/guides/run-a-node/claim-prover-rewards", permanent: true, }, + // Add events page { source: "/events", destination: diff --git a/packages/website/package.json b/packages/website/package.json index 899b18384e6..bcbbef1cbf1 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -14,17 +14,18 @@ "nextra-theme-docs": "^2.12.3", "react": "^18.2.0", "react-dom": "^18.2.0", - "remark-mdx-disable-explicit-jsx": "^0.1.0" + "remark-mdx-disable-explicit-jsx": "^0.1.0", + "sharp": "^0.32.5" }, "devDependencies": { "@heroicons/react": "^2.0.18", - "@types/node": "^20.6.0", + "@types/node": "^20.6.2", "@types/react": "^18.2.21", "autoprefixer": "^10.4.15", - "daisyui": "^3.7.4", + "daisyui": "^3.7.5", "postcss": "^8.4.29", "tailwindcss": "^3.3.3", "typescript": "^5.2.2", - "viem": "^1.10.12" + "viem": "^1.10.14" } } diff --git a/packages/website/pages/_meta.json b/packages/website/pages/_meta.json index 8eec2b4400d..2a54e8295c0 100644 --- a/packages/website/pages/_meta.json +++ b/packages/website/pages/_meta.json @@ -11,72 +11,17 @@ "title": "Docs", "type": "page" }, - "grimsvotn": { - "title": "Grimsvotn L2", - "type": "menu", - "items": { - "bridge": { - "title": "Bridge (L1 ↔ L2)", - "href": "https://bridge.test.taiko.xyz", - "newWindow": true - }, - "swap": { - "title": "Swap", - "href": "https://swap.test.taiko.xyz", - "newWindow": true - }, - "status": { - "title": "Grimsvotn Protocol Status", - "href": "https://status.test.taiko.xyz", - "newWindow": true - }, - "l2-block-explorer": { - "title": "Grimsvotn L2 Block Explorer", - "href": "https://explorer.test.taiko.xyz", - "newWindow": true - }, - "uptime": { - "title": "Uptime", - "href": "https://status.taiko.xyz", - "newWindow": true - } - } + "bridge": { + "title": "Bridge ↗", + "type": "page", + "href": "https://bridge.jolnir.taiko.xyz", + "newWindow": true }, - "eldfell": { - "title": "Eldfell L3", - "type": "menu", - "items": { - "bridge": { - "title": "Bridge (L2 ↔ L3)", - "href": "https://bridge.l3test.taiko.xyz", - "newWindow": true - }, - "swap": { - "title": "Swap", - "href": "https://swap.l3test.taiko.xyz", - "newWindow": true - }, - "status": { - "title": "Eldfell Protocol Status", - "href": "https://explorer.l3test.taiko.xyz/stats", - "newWindow": true - }, - "l3-block-explorer": { - "title": "Eldfell L3 Block Explorer", - "href": "https://explorer.l3test.taiko.xyz", - "newWindow": true - }, - "staking-dashboard": { - "title": "Staking dashboard", - "href": "https://staking.l3test.taiko.xyz", - "newWindow": true - }, - "uptime": { - "title": "Uptime", - "href": "https://status.taiko.xyz", - "newWindow": true - } - } + "block-explorer": { + "title": "Block Explorer ↗", + "type": "page", + "href": "https://explorer.jolnir.taiko.xyz", + "newWindow": true }, "ecosystem": { "title": "Ecosystem", diff --git a/packages/website/pages/docs/concepts/overview.mdx b/packages/website/pages/docs/concepts/overview.mdx index 6c3d0962595..339c97f58f1 100644 --- a/packages/website/pages/docs/concepts/overview.mdx +++ b/packages/website/pages/docs/concepts/overview.mdx @@ -4,8 +4,8 @@ import Image from "next/image"; Taiko is a secure, decentralized, and permissionless [rollup](https://www.youtube.com/watch?v=7pWxCklcNsU) on Ethereum. Taiko achieves this by: -1. writing all block data required to reconstruct the post-block state to Ethereum. Recording block data to Ethereum as an L1 makes the data decentralized and public. This data is needed for everyone to know the latest chain state to add new blocks to Taiko. Taiko's proof generation requires an even stricter requirement: all executable data must be saved publicly in sequence. Consequently, provers can generate proofs for a block using only publicly known data. -2. creating and proposing blocks should be a fast and efficient process. Anyone should be able to add blocks to the chain on a level playing field, having access to the same chain data at all times. Proposers, of course, should be able to compete on e.g., transaction fees and [Maximal Extractable Value (MEV)](https://ethereum.org/en/developers/docs/mev/). +1. Writing all block data required to reconstruct the post-block state to Ethereum. Recording block data to Ethereum as an L1 makes the data decentralized and public. This data is needed for everyone to know the latest chain state to add new blocks to Taiko. Taiko's proof generation requires an even stricter requirement: all executable data must be saved publicly in sequence. Consequently, provers can generate proofs for a block using only publicly known data. +2. Creating and proposing blocks should be a fast and efficient process. Anyone should be able to add blocks to the chain on a level playing field, having access to the same chain data at all times. Proposers, of course, should be able to compete on e.g., transaction fees and [Maximal Extractable Value (MEV)](https://ethereum.org/en/developers/docs/mev/). We achieve this by splitting the block submission process into two parts: @@ -54,37 +54,6 @@ the same mechanism is used on Ethereum it allows Taiko to be Ethereum equivalent (with some small implementation detail changes) even for this part of its network, which is not obviously the case for L2s. -## Off-chain proof market - -Proving blocks requires significant compute power to calculate the proof -to submit and verify the proof on Ethereum. Provers need -to be compensated for this work as the network needs to -attract provers that are willing to do this work. How much -to pay for a proof is not obvious however: - -1. The Ethereum gas cost to publish/verify a proof - on Ethereum is unpredictable. -2. The proof generation cost does not necessarily - match perfectly with the gas cost. -3. The proof generation cost keeps changing as proving software is optimized and the hardware used - gets faster and cheaper. -4. The proof generation cost depends on how fast a - proof needs to be generated. - -In the pursuit of optimizing network efficiency and balancing costs, the ecosystem introduces a robust off-chain proof market. Proposers, on a per-block basis, actively seek potential proof service providers through this dynamic marketplace. A pivotal component of this setup is the publicly exposed API, providing proposers with the means to query and engage with available proof providers off-chain. - -When an agreement is reached concerning the proving fee for a specific block, the chosen proof service provider is then tasked with granting a cryptographic signature to the proposer. This signature serves as a binding commitment, signifying the prover's dedication to delivering the proof within the agreed-upon timeframe. - -Provers within this off-chain proof market come in two primary forms: Externally Owned Accounts (EOA) and contracts, often referred to as Prover pools. To qualify as a Prover pool, a contract must adhere to specific criteria, implementing either the IProver interface, as previously defined by Taiko, or the IERC1271 (isValidSignature) interface. - -Upon a proposer's submission of a block, the signature granted by the chosen provider is subjected to verification. Any deviations result in a reverted transaction. - -As an additional incentive for proposers, the system incorporates the issuance of TKO tokens. This serves as an extra motivator, as proposing blocks alone may not always prove profitable, especially when considering Ethereum's on-chain fees plus the proving fee. The issuance of TKO tokens operates on a dynamic 'emission rate per second,' comparing each block proposal to the last. - -The reward depends on the proof service provider and the agreement. For EOAs and Prover pools that implement the IERC1271 interface, the reward is disbursed in ETH. However, in cases where providers implement the IProver interface, the prover fee can be ETH, any other ERC20 tokens, or even NFTs, based on the negotiated terms. - -To add a layer of security and commitment to the process, provers must provide a substantial amount of TKO tokens per block, effectively serving as insurance. In the unfortunate event of a failure to deliver the proof within the given time, a portion, specifically 1/4, is directed to the actual prover, while the remaining 3/4 are permanently burnt. Conversely, successful and timely proof delivery ensures the return of these tokens to the Prover. - ## EIP-4844 scaling via blob data EIP-4844 is an Ethereum upgrade that bolts blob data to consensus layer blocks. diff --git a/packages/website/pages/docs/concepts/proposing.mdx b/packages/website/pages/docs/concepts/proposing.mdx index 0dc11f81373..a01b5593ae5 100644 --- a/packages/website/pages/docs/concepts/proposing.mdx +++ b/packages/website/pages/docs/concepts/proposing.mdx @@ -13,15 +13,24 @@ On Taiko, the next L2 state is known immediately and deterministically at the ti The Ethereum yellow paper has well-defined rules to compute the state transition. We use these same rules to take a proposed block, and compute the post-block state on Taiko. The high level overview of creating L2 blocks as follows: 1. The system starts by creating a new L2 block with an anchor transaction. This anchor transaction is always the first transaction in the block even if the block is empty. (More about anchor transactions in the next section.) + 2. There are validity checks performed at the node (or sometimes protocol) level as well: -2.1 Asserts that the length of the transaction list does not exceed a predefined maximum (MAX_TX_LIST_BYTES), ensuring that the list is within the limits. -2.2 The transaction list is (RLP) decoded into a list of transactions (txList). If the bytes are not decodeable it will result in an empty block. -2.3 The amount of gas required to include transactions is available. (If a transaction cannot fit into a block, it is simply excluded from it, but the block is still valid with other transactions.) -2.4 The transaction signature is valid. -2.5 The transaction nonce is valid. -2.6 The sender account has no contract code deployed (EIP-3607). -2.7 The transaction's gas limit is no smaller than the intrinsic gas. -2.8. The sender has enough balance to cover the transaction (gasLimit * gasPrice + tx.value). + + 2.1 Asserts that the length of the transaction list does not exceed a predefined maximum (MAX_TX_LIST_BYTES), ensuring that the list is within the limits. + + 2.2 The transaction list is (RLP) decoded into a list of transactions (txList). If the bytes are not decodeable it will result in an empty block. + + 2.3 The amount of gas required to include transactions is available. (If a transaction cannot fit into a block, it is simply excluded from it, but the block is still valid with other transactions.) + + 2.4 The transaction signature is valid. + + 2.5 The transaction nonce is valid. + + 2.6 The sender account has no contract code deployed (EIP-3607). + + 2.7 The transaction's gas limit is no smaller than the intrinsic gas. + + 2.8. The sender has enough balance to cover the transaction (gasLimit \* gasPrice + tx.value). ## Anchor transaction @@ -31,4 +40,4 @@ The anchor transaction is required to be the first transaction in a Taiko block 1. Persisting `l1Height`, `l1Hash` and `l1SignalRoot` to the storage trie. These values can be used by bridges to validate cross-chain messages. 2. Ensuring that the previous 256 block hashes that are exposed to the EVM are correct. -3. Calculating the EIP-1559 `basefee` which will be used on L2. \ No newline at end of file +3. Calculating the EIP-1559 `basefee` which will be used on L2. diff --git a/packages/website/pages/docs/concepts/proving.mdx b/packages/website/pages/docs/concepts/proving.mdx index 25be8258bb8..a1161e954ee 100644 --- a/packages/website/pages/docs/concepts/proving.mdx +++ b/packages/website/pages/docs/concepts/proving.mdx @@ -48,59 +48,33 @@ For the visual learners here is a visualization of the three stages (proposed -> /> -## Types of provers +## Off chain prover market (PBS style) -### Community prover +Proving blocks requires significant compute power to calculate the proof +to submit and verify the proof on Ethereum. Provers need +to be compensated for this work as the network needs to +attract provers that are willing to do this work. How much +to pay for a proof is not obvious however: -Currently, you only need a single proof from any prover to verify a block. +1. The Ethereum gas cost to publish/verify a proof + on Ethereum is unpredictable. +2. The proof generation cost does not necessarily + match perfectly with the gas cost. +3. The proof generation cost keeps changing as proving software is optimized and the hardware used + gets faster and cheaper. +4. The proof generation cost depends on how fast a + proof needs to be generated. -### Oracle prover +In the pursuit of optimizing network efficiency and balancing costs, the ecosystem introduces a robust off-chain proof market. Proposers, on a per-block basis, actively seek potential proof service providers through this dynamic marketplace. A pivotal component of this setup is the publicly exposed API, providing proposers with the means to query and engage with available proof providers off-chain. -The oracle prover is a prover from a unique address (our own address) that is able to override the community prover. This is a safety mechanism we have in place while the ZK-EVM is still in development and in case an invalid block was marked as verified from a community proof. +When an agreement is reached concerning the proving fee for a specific block, the chosen proof service provider is then tasked with granting a cryptographic signature to the proposer. This signature serves as a binding commitment, signifying the prover's dedication to delivering the proof within the agreed-upon timeframe. -### The proof cooldown period +Provers within this off-chain proof market come in two primary forms: Externally Owned Accounts (EOA) and contracts, often referred to as Prover pools. To qualify as a Prover pool, a contract must adhere to specific criteria, implementing either the IProver interface, as previously defined by Taiko, or the IERC1271 (isValidSignature) interface. -We have a proof cooldown period which is an interval of time we set after fully verifying a block. The reason we do that is to allow for a fault proof to come in, once we have a multi-prover system set in place. +Upon a proposer's submission of a block, the signature granted by the chosen provider is subjected to verification. Any deviations result in a reverted transaction. -## Prover dynamics +As an additional incentive for proposers, the system incorporates the issuance of TKO tokens. This serves as an extra motivator, as proposing blocks alone may not always prove profitable, especially when considering Ethereum's on-chain fees plus the proving fee. The issuance of TKO tokens operates on a dynamic 'emission rate per second,' comparing each block proposal to the last. -Keep in mind that running a prover on mainnet will be a very competitive space, and those who generate proofs will have very powerful machines. It's unlikely anyone will be able to be a "casual prover". +The reward depends on the proof service provider and the agreement. For EOAs and Prover pools that implement the IERC1271 interface, the reward is disbursed in ETH. However, in cases where providers implement the IProver interface, the prover fee can be ETH, any other ERC20 tokens, or even NFTs, based on the negotiated terms. -{/* TODO: we should not mention testnet details inside concept documentation (this is like a whitepaper), we can find another abstraction for it */} - -### Grimsvotn L2 (alpha-3) - -In the alpha-3 protocol, the protocol rewards the most efficient prover. The prover that can submit a valid proof the fastest, will win the reward. This trades off decentralization for efficiency, because in a mainnet scenario it's likely only a single prover will prevail, which is a bit risky for liveness. - -#### How the proof reward is determined - -A proof reward in TTKO is rewarded for successfully proving a block. This reward is dependent on the `proofTimeTarget`. You can see the current proof reward by calling `getProofReward` on the TaikoL1 contract. - -So that we don't grow a long list of unverified blocks for too long, we want to target proofs coming in at a certain rate. So we set a target proof time. If it has taken a long time since the last verified block, the proof reward increases to incentivize provers to generate a proof. - -Conversely, if everyone is submitting proofs quickly, then the proof reward decreases towards zero. This means that as a prover, you should query `getProofReward` on the TaikoL1 contract to determine if it is profitable to generate a proof. If you submit proofs as quickly as possible, then the proof reward will trend towards zero. - -#### Default in simple-taiko-node - -The [simple-taiko-node](https://github.com/taikoxyz/simple-taiko-node) will come pre-configured to not submit proofs as quickly as possible, by querying `getProofReward`. This hopefully means that most nodes in the network are acting in the group interest, by responsibly not submitting the proof as quickly as possible. However, because the first prover will win the reward, and because the project is open source, anybody can modify the [taiko-client](https://github.com/taikoxyz/taiko-client) and act rationally to submit a proof slightly earlier than the default set in `simple-taiko-node`. As you can see, it causes somewhat of a prisoner's dilemma. - -#### Proof skip - -We have a `realProofSkipSize` set [here](https://github.com/taikoxyz/taiko-mono/blob/main/packages/protocol/contracts/L1/TaikoConfig.sol#LL40C13-L40C30) so that a real proof is only needed every N blocks for the testnet. - -#### Your role as a prover - -We are describing this dynamic so you can be informed when you run a prover. It's very possible that without the correct strategy, you will not be profitable as a prover. You are naturally competing in an open space where others could have more efficient hardware and generate a proof in a short amount of time that you cannot compete against. - -### Eldfell L3 (alpha-4) - -In the alpha-4 protocol we have developed a staking based proving system. There exists a pool of (currently 32) top provers. Entering this pool depends on several factors: - -- The capacity a prover can handle -- The amount of TTKOe staked -- The expected reward per gas -- The current fee per gas - -Essentially, this design is slightly less efficient but more decentralized (with better liveness). - -You can read more about the staking system [here](https://github.com/taikoxyz/taiko-mono/blob/alpha-4/packages/protocol/docs/tokenomics_staking.md). +To add a layer of security and commitment to the process, provers must provide a substantial amount of TKO tokens per block, effectively serving as insurance. In the unfortunate event of a failure to deliver the proof within the given time, a portion, specifically 1/4, is directed to the actual prover, while the remaining 3/4 are permanently burnt. Conversely, successful and timely proof delivery ensures the return of these tokens to the Prover. diff --git a/packages/website/pages/docs/guides.mdx b/packages/website/pages/docs/guides.mdx index 23ae18188f3..e5a1ff0e223 100644 --- a/packages/website/pages/docs/guides.mdx +++ b/packages/website/pages/docs/guides.mdx @@ -4,25 +4,15 @@ import { Cards, Card } from "nextra/components"; Check out our guides below. You can leave feedback [here](https://docs.google.com/forms/d/1Vn10tqZW0bPvNUItzeek9u8kh7YkQZOGorMb3LuJVVA) and ask any questions on the [Taiko Discord](https://discord.gg/taikoxyz)! -## Build on Taiko - - - - - - - - - - - -## Run a node - - - - - - + + + + + + + + + + - diff --git a/packages/website/pages/docs/guides/_meta.json b/packages/website/pages/docs/guides/_meta.json index 5d8385d4c85..788362e28f2 100644 --- a/packages/website/pages/docs/guides/_meta.json +++ b/packages/website/pages/docs/guides/_meta.json @@ -1,8 +1,32 @@ { - "build-on-taiko": { - "title": "Build on Taiko" + "setup-your-wallet": { + "title": "💰 Setup your wallet" }, - "run-a-node": { - "title": "Run a node" + "receive-tokens": { + "title": "🎁 Receive tokens" + }, + "bridge-tokens": { + "title": "🌉 Bridge tokens" + }, + "swap-tokens": { + "title": "🔄 Swap tokens" + }, + "deploy-a-contract": { + "title": "🚀 Deploy a contract" + }, + "verify-a-contract": { + "title": "📜 Verify a contract" + }, + "run-a-sepolia-node": { + "title": "🔷 Run a Sepolia node" + }, + "run-a-taiko-node": { + "title": "🥁 Run a Taiko node" + }, + "enable-a-proposer": { + "title": "📤 Enable a proposer" + }, + "enable-a-prover": { + "title": "🔎 Enable a prover" } } diff --git a/packages/website/pages/docs/guides/bridge-tokens.mdx b/packages/website/pages/docs/guides/bridge-tokens.mdx new file mode 100644 index 00000000000..2febdf1ecde --- /dev/null +++ b/packages/website/pages/docs/guides/bridge-tokens.mdx @@ -0,0 +1,37 @@ +import { Callout, Steps } from "nextra-theme-docs"; + +# Bridge tokens + + + The BLL token is **expected to fail** about 50% of the time when + bridging--this is done intentionally to test error handling. + + +## Overview + +This guide will help you use the bridge to send tokens between Sepolia and Taiko. You can read more about how bridging works [here](/docs/concepts/bridging). + +## Prerequisites + +- A wallet with some testnet ETH on Sepolia or Taiko (you can [receive tokens here](/docs/guides/receive-tokens)). + +## Steps + + + ### Visit the bridge + + Visit the [bridge](https://bridge.jolnir.taiko.xyz). + + ### Follow the video guide for bridging + + + + diff --git a/packages/website/pages/docs/guides/build-on-taiko/_meta.json b/packages/website/pages/docs/guides/build-on-taiko/_meta.json deleted file mode 100644 index 4857d098d45..00000000000 --- a/packages/website/pages/docs/guides/build-on-taiko/_meta.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "setup-your-wallet": { - "title": "💰 Setup your wallet" - }, - "receive-tokens": { - "title": "🎁 Receive tokens" - }, - "bridge-tokens": { - "title": "🌉 Bridge tokens" - }, - "swap-tokens": { - "title": "🔄 Swap tokens" - }, - "deploy-a-contract": { - "title": "🚀 Deploy a contract" - }, - "verify-a-contract": { - "title": "📜 Verify a contract" - }, - "build-a-dapp": { - "title": "🛠️ Build a dapp" - } -} diff --git a/packages/website/pages/docs/guides/build-on-taiko/bridge-tokens.mdx b/packages/website/pages/docs/guides/build-on-taiko/bridge-tokens.mdx deleted file mode 100644 index b08b4d45f3f..00000000000 --- a/packages/website/pages/docs/guides/build-on-taiko/bridge-tokens.mdx +++ /dev/null @@ -1,31 +0,0 @@ -import { Callout, Steps } from "nextra-theme-docs"; - -# Bridge tokens - - - The BLL token is **expected to fail** about 50% of the time when - bridging--this is done intentionally to test error handling. - - -## Overview - -This guide will help you use the bridge to send tokens between Taiko testnets and their base chains. You can read more about how bridging works [here](/docs/concepts/bridging). - -## Prerequisites - -- A wallet with some testnet ETH on Sepolia or a Taiko testnet (you can [receive tokens here](/docs/guides/receive-tokens)). - -## Steps - - - ### Visit a bridge - There two bridges, one is for bridging between Sepolia L1 and Grimsvotn L2, and the other is for bridging between Grimsvotn L2 and Eldfell L3. Try them out here: - - [Sepolia L1 ↔ Grimsvotn L2 bridge](https://bridge.test.taiko.xyz/) - - [Grimsvotn L2 ↔ Eldfell L3 bridge](https://bridge.l3test.taiko.xyz) - - ### Bridge tokens - Try bridging tokens between testnets by selecting them from the dropdown. You can also manually claim the transfer yourself by clicking the "Claim" button under the "Transactions" tab (but **only** if you already have some ETH on the destination chain). - - ![bridge claim](/images/guides/bridge-claim.png) - - diff --git a/packages/website/pages/docs/guides/build-on-taiko/build-a-dapp.mdx b/packages/website/pages/docs/guides/build-on-taiko/build-a-dapp.mdx deleted file mode 100644 index aff9b5d41f8..00000000000 --- a/packages/website/pages/docs/guides/build-on-taiko/build-a-dapp.mdx +++ /dev/null @@ -1,11 +0,0 @@ -# Build a dapp - -This guide will help you build a dapp on Taiko in one click! - -## Prerequisites - -- A curiosity to learn and build 🙃. - -## Steps - -1. Visit the [dapp-slaps starter template](https://github.com/d1onys1us/dapp-slaps) to create an Ethereum dapp in one click. diff --git a/packages/website/pages/docs/guides/build-on-taiko/receive-tokens.mdx b/packages/website/pages/docs/guides/build-on-taiko/receive-tokens.mdx deleted file mode 100644 index 447f9fa0f1f..00000000000 --- a/packages/website/pages/docs/guides/build-on-taiko/receive-tokens.mdx +++ /dev/null @@ -1,48 +0,0 @@ -import { Callout, Steps } from "nextra-theme-docs"; - -# Receive tokens - -This guide will help you receive testnet tokens. You can see all the deployed tokens [here](/docs/reference/contract-addresses). Keep in mind HORSE and BLL faucets only distribute to Grimsvotn L2. To get HORSE and BLL on Eldfell L3, you will need to [use the bridge](/docs/guides/build-on-taiko/bridge-tokens). - -## Prerequisites - -- You have an Ethereum wallet address to accept the testnet tokens. - -## Steps - - - ### Receive Sepolia ETH - Visit one of the faucets to receive ETH on Sepolia: - - [sepolia-faucet.pk910.de](https://sepolia-faucet.pk910.de) - - [faucet-sepolia.rockx.com](https://faucet-sepolia.rockx.com) - - [sepoliafaucet.com](https://sepoliafaucet.com) - - [infura.io/faucet/sepolia](https://infura.io/faucet/sepolia) - - [faucet.quicknode.com/ethereum/sepolia](https://faucet.quicknode.com/ethereum/sepolia) - - [coinbase.com/faucets/ethereum-sepolia-faucet](https://coinbase.com/faucets/ethereum-sepolia-faucet) - - [faucet.chainstack.com/sepolia-faucet](https://faucet.chainstack.com/sepolia-faucet) - - ### Receive HORSE - Navigate to the [Sepolia L1 ↔ Grimsvotn L2 bridge](https://bridge.test.taiko.xyz), select HORSE from the dropdown, and click "Faucet". - - To receive HORSE on Eldfell L3, you will need to [use the bridge](/docs/guides/build-on-taiko/bridge-tokens). - - ![receive horse](/images/guides/receive-horse.png) - - ### Receive BLL - Repeat the previous step for receiving HORSE, except select "BLL" from the dropdown. - - ### Receive TTKO - - TTKO has been distributed to all proposers and provers from the alpha-1 and alpha-2 testnets and you can see those transactions [here](https://sepolia.etherscan.io/address/0x19B4F9C381C7927FE33D853e48b560141A380C44). You can see the script used [here](https://github.com/taikoxyz/operations). - - - - It's possible more will be distributed, especially considering those that did not run a proposer/prover in alpha1/alpha2, and those who are new to the Taiko community. - Otherwise, you can obtain TTKO by successfully [proving blocks](/docs/guides/enable-a-prover) (the protocol rewards you in TTKO) or from [Swap](https://swap.test.taiko.xyz). - - ### Receive TTKOe - TTKOe has been distributed to all proposers and provers from the alpha-1 and alpha-2 testnets and you can see those transactions [here](https://explorer.test.taiko.xyz/address/0x7532Cd98ED13c0C164dBC7a92D872955c8C99bD3). You can see the script used [here](https://github.com/taikoxyz/operations). - - Otherwise, you can obtain TTKOe by successfully [proving blocks](/docs/guides/enable-a-prover) (the protocol rewards you in TTKOe) or from [Swap](https://swap.l3test.taiko.xyz). - - diff --git a/packages/website/pages/docs/guides/build-on-taiko/swap-tokens.mdx b/packages/website/pages/docs/guides/build-on-taiko/swap-tokens.mdx deleted file mode 100644 index 08a20867943..00000000000 --- a/packages/website/pages/docs/guides/build-on-taiko/swap-tokens.mdx +++ /dev/null @@ -1,58 +0,0 @@ -import { Callout, Steps } from "nextra-theme-docs"; - -# Swap tokens - -This guide will help you interact with Swap, which is a fork of Uniswap v2 that Taiko has deployed only for testing purposes. - -## Prerequisites - -- You must have some tokens (at least ETH) on a Taiko testnet. You can [receive some ETH, HORSE, and BLL from the faucets](/docs/guides/receive-tokens) and then [bridge them to Taiko](/docs/guides/use-the-bridge). - -## Steps - - - ### Navigate to Swap - Navigate to one of the Swap dapps: - - Swap on Grimsvotn: [https://swap.test.taiko.xyz](https://swap.test.taiko.xyz). - - Swap on Eldfell: [https://swap.l3test.taiko.xyz](https://swap.l3test.taiko.xyz). - - ### Connect to the Taiko testnet - ![1](/images/guides/swap/1.png) - - ### Choose tokens to swap - If you do not see the tokens, you might be prompted to add the testnet tokens (see below) - ![2](/images/guides/swap/2.png) - ![5](/images/guides/swap/5.png) - - ### Input swap amount - ![6](/images/guides/swap/6.png) - - ### [One-time] Approve the token to swap -

    - -

    - - ### Swap tokens - - Here we swap BLL tokens for HORSE tokens. - Try with small amounts as there might not be sufficient liquidity. - ![9](/images/guides/swap/9.png) - ![10](/images/guides/swap/10.png) - ![11](/images/guides/swap/11.png) - - ### View Transaction on blockscout - ![12](/images/guides/swap/12.png) - ![13](/images/guides/swap/13.png) - - ### Add liquidity - Provide liquidity to a pool. You can receive some testnet tokens [here](/docs/guides/receive-tokens). - ![provide liquidity](/images/guides/swap-liquidity.png) - -
    - -## Troubleshooting - -### Token list does not show up - -![3](/images/guides/swap/3.png) -![4](/images/guides/swap/4.png) diff --git a/packages/website/pages/docs/guides/build-on-taiko/deploy-a-contract.mdx b/packages/website/pages/docs/guides/deploy-a-contract.mdx similarity index 73% rename from packages/website/pages/docs/guides/build-on-taiko/deploy-a-contract.mdx rename to packages/website/pages/docs/guides/deploy-a-contract.mdx index 93b2f2c6828..bef4811de52 100644 --- a/packages/website/pages/docs/guides/build-on-taiko/deploy-a-contract.mdx +++ b/packages/website/pages/docs/guides/deploy-a-contract.mdx @@ -2,38 +2,33 @@ import { Callout, Steps, Tab, Tabs } from "nextra-theme-docs"; # Deploy a contract -This guide will help you deploy a smart contract to Taiko using Foundry or Hardhat. +This guide will help you deploy a smart contract to Taiko. ## Prerequisites -- You have [Foundry](https://book.getfoundry.sh/getting-started/installation) or [Hardhat](https://hardhat.org/hardhat-runner/docs/getting-started#quick-start) installed. -- You have testnet ETH on a Taiko testnet (to pay the transaction fee for deploying the contract). - - You can [request Sepolia ETH](/docs/guides/build-on-taiko/receive-tokens#receive-sepolia-eth) from the faucet and then [bridge tokens](/docs/guides/build-on-taiko/bridge-tokens) to send the testnet ETH to a Taiko testnet. -- You have the private key to the account with testnet ETH on a Taiko testnet. +- You have testnet ETH on Taiko (to pay the transaction fee for deploying the contract). + - You can [request Sepolia ETH](/docs/guides/receive-tokens#receive-sepolia-eth) from the faucet and then [use the bridge](/docs/guides/bridge-tokens) to send testnet ETH to Taiko. +- You have the private key to the account with testnet ETH on Taiko. ### Additional Remix prerequisites -- You have [setup your wallet](/docs/guides/build-on-taiko/setup-your-wallet) to connect to the relevant testnets. +- You have [setup your wallet](/docs/guides/setup-your-wallet) to connect to the relevant testnets. ## Steps -{" "} - - - Make sure to set the RPC to the network you are trying to deploy to. The ones - here just use Grimsvotn L2 as an example. You can see all the RPC urls under - [RPC configuration](/docs/reference/rpc-configuration). - - - **1. Create a project with Foundry** + **1. Install Foundry** + + See the [Foundry installation guide](https://book.getfoundry.sh/getting-started/installation). + + **2. Create a project with Foundry** ```sh forge init hello_foundry && cd hello_foundry ``` - **2. Deploy your contract** + **3. Deploy your contract** Deploy the contract located at `src/Counter.sol`. Replace `YOUR_PRIVATE_KEY` below with your private key which has some testnet ETH on Taiko. @@ -43,12 +38,12 @@ This guide will help you deploy a smart contract to Taiko using Foundry or Hardh ```sh - forge create --rpc-url https://rpc.test.taiko.xyz --private-key YOUR_PRIVATE_KEY src/Counter.sol:Counter + forge create --rpc-url https://rpc.jolnir.taiko.xyz --private-key YOUR_PRIVATE_KEY src/Counter.sol:Counter ``` - **3. View your contract** + **4. View your contract** - Paste the address from the output into the [Taiko block explorer](https://explorer.test.taiko.xyz) and verify that the contract was deployed. + Paste the address from the output into the [Taiko block explorer](https://explorer.jolnir.taiko.xyz) and verify that the contract was deployed. @@ -73,7 +68,7 @@ This guide will help you deploy a smart contract to Taiko using Foundry or Hardh solidity: "0.8.18", networks: { taiko: { - url: "https://rpc.test.taiko.xyz", + url: "https://rpc.jolnir.taiko.xyz", accounts: [ "0xf214f2b2cd398c806f84e317254e0f0b801d0643303237d97a22a48e01628897", ], diff --git a/packages/website/pages/docs/guides/enable-a-proposer.mdx b/packages/website/pages/docs/guides/enable-a-proposer.mdx new file mode 100644 index 00000000000..b60a66ddc45 --- /dev/null +++ b/packages/website/pages/docs/guides/enable-a-proposer.mdx @@ -0,0 +1,59 @@ +import { Callout, Steps } from "nextra-theme-docs"; +import { contractAddressToLink } from "../../../utils/contractAddressToLink"; +import { SEPOLIA_CONFIG, GRIMSVOTN_CONFIG } from "../../../domain/chain"; +import { StyledLink } from "/components/StyledLink"; + +# Enable a proposer + +This guide will help you enable your Taiko node as a proposer. + +## Prerequisites + +- You have already setup a node (see: [Run a node](/docs/guides/run-a-node)) +- Must have a balance of ETH on Sepolia L1 (see: [Receive tokens](/docs/guides/receive-tokens)). + +## Steps + + + +### Open .env file in `simple-taiko-node` + +```sh +nano .env +``` + +### Set environment variables to enable a proposer + + + Do **not** use a private key that is valuable to you. The private key will be + stored in plain text in the `.env` file, and this is not secure. There is a + real risk of losing your assets. You should **only use a test account**. + + +Set the following environment variables to enable your node as a proposer: + +- Set `ENABLE_PROPOSER` to `true` +- Set `L1_PROPOSER_PRIVATE_KEY` to the private key of your L1 account (with balance) who will send TaikoL1.proposeBlock transactions +- Set `L2_SUGGESTED_FEE_RECIPIENT` to the address of your L2 account who will be the tx fee beneficiary of the L2 blocks that you proposed + +### Set a prover market prover + +By default, the proposer will select a local prover to acquire the bond needed to propose a block. You can also specify a prover from the [prover market](/docs/reference/prover-market) by overriding the default value for: + +- `PROVER_ENDPOINTS` + +### Verify proposer logs + +You should see a log if you have proposed a block: `📝 Propose transactions succeeded`. + +You can check all commands to see proposer logs in the [node runner manual](/docs/manuals/node-runner-manual#view-client-proposer-logs). + + + +## Videos + +- [Enable a proposer on your Taiko L2 node](https://www.youtube.com/watch?v=z3gWKEoJidw) (deprecated, but still useful) + +## Troubleshooting + +View the [Node troubleshooting reference](/docs/reference/node-troubleshooting) for help on any common error codes / issues. diff --git a/packages/website/pages/docs/guides/enable-a-prover.mdx b/packages/website/pages/docs/guides/enable-a-prover.mdx new file mode 100644 index 00000000000..8afcfb265ae --- /dev/null +++ b/packages/website/pages/docs/guides/enable-a-prover.mdx @@ -0,0 +1,88 @@ +import { Callout, Steps } from "nextra-theme-docs"; + +# Enable a prover + +This guide will help you enable your Taiko node as a prover. Read more about prover dynamics [here](/docs/concepts/proving#prover-dynamics). + +## Prerequisites + +- You have already setup a node (see: [Run a node](/docs/guides/run-a-node)). +- Must have a balance of ETH on Sepolia L1 (see: [Receive tokens](/docs/guides/receive-tokens)). +- Should have at least 8/16 core CPU and 32GB of RAM. + +## Steps + + +### Open the .env file in `simple-taiko-node` + +```sh +nano .env +``` + +### Set environment variables to enable prover + + + Do **not** use a private key that is valuable to you. The private key will be + stored in plain text in the `.env` and this is not secure. There is a real + risk of losing your assets. You should **only use a test account**. + + +Open the `.env` file and set the following environment variables to enable your node as a prover: + +- Set `ENABLE_PROVER` to `true` +- Set `L1_PROVER_PRIVATE_KEY` to your L1 account private key (with balance of TTKOj on TaikoL1), we will the public key of this account in the next Steps + +### Approve TaikoL1 as TTKOj spender + +You will need TTKOj deposited on the TaikoL1 contract to secure the bond for the proofs you generate. + +First, you will need to **approve the TaikoL1 contract as a spender**. Visit the TTKOj contract on Sepolia [here](https://sepolia.etherscan.io/address/0x75F94f04d2144cB6056CCd0CFF1771573d838974#writeProxyContract). + +Next, click the **Connect to Web3** button. + +Next, click the **approve** function and set the spender address to the TaikoL1 contract address: `0x95fF8D3CE9dcB7455BEB7845143bEA84Fe5C4F6f`. + +Next, set the amount to at least the minimum bond amount of 2.5 TTKOj. You will need 2.5 TTKOj for each bond you sign. + +Finally, click the **Write** button. + +### Deposit TTKOj to TaikoL1 + +Visit the TaikoL1 contract [here](https://sepolia.etherscan.io/address/0x95fF8D3CE9dcB7455BEB7845143bEA84Fe5C4F6f#writeProxyContract). + +Next, click the **Connect to Web3** button. + +Next, click the **depositTaikoToken** function. + +Next, set the amount to at least the minimum bond amount of 2.5 TTKOj. You will need 2.5 TTKOj for each bond you sign. + +Finally, click the **Write** button. + +### Verify prover logs + +Run this command to verify you have some prover logs: + +```sh +docker compose logs -f taiko_client_prover_relayer | egrep "block proof was|proof submission error|Block proven" +``` + +You should see logs like this if it was successful: + +- `💰 Your block proof was accepted` means you successfully submitted a proof and your bond is returned. +- `✅ Block proven` means a proposed block was successfully proved on TaikoL1 (by anyone). + +You can check all commands to see prover logs in the [node runner manual](/docs/manuals/node-runner-manual#view-client-prover-relayer-logs). + +### Register your prover (optionally) + +Add your prover to the [prover registration page](/docs/reference/prover-market.mdx) so that other block proposers can find your prover and request bonds. + + + +## Videos + +- [Enable and exit a prover on your L2/L3 node](https://www.youtube.com/watch?v=yAHpbmNEC0M) (deprecated, but still useful) + +## Troubleshooting + +View the [Node troubleshooting reference](/docs/reference/node-troubleshooting) for help on any common error codes / issues. diff --git a/packages/website/pages/docs/guides/receive-tokens.mdx b/packages/website/pages/docs/guides/receive-tokens.mdx new file mode 100644 index 00000000000..573707383c1 --- /dev/null +++ b/packages/website/pages/docs/guides/receive-tokens.mdx @@ -0,0 +1,35 @@ +import { Callout, Steps } from "nextra-theme-docs"; +import { TAIKO_CONFIG } from "domain/chain"; + +# Receive tokens + +This guide will help you receive testnet tokens. You can see all the deployed tokens [here](/docs/reference/contract-addresses). + +## Prerequisites + +- You have an Ethereum wallet address to accept the testnet tokens. + +## Steps + + + ### Receive Sepolia ETH + You can receive Sepolia ETH from several online faucets. Here are a few you can try: + - [sepolia-faucet.pk910.de](https://sepolia-faucet.pk910.de) + - [faucet-sepolia.rockx.com](https://faucet-sepolia.rockx.com) + - [sepoliafaucet.com](https://sepoliafaucet.com) + + ### Receive HORSE + Navigate to the [bridge](https://bridge.jolnir.taiko.xyz), select HORSE from the dropdown, and click "Faucet". + + ![receive horse](/images/guides/receive-horse.png) + + ### Receive BLL + Repeat the previous step for receiving HORSE, except select "BLL" from the dropdown. + + ### Receive TTKOj + + TTKOj has been distributed to all proposers and provers from the alpha-1 and alpha-2 testnets and you can see those transactions [here](https://sepolia.etherscan.io/address/0x7532Cd98ED13c0C164dBC7a92D872955c8C99bD3). You can see the script used [here](https://github.com/taikoxyz/operations). TTKOj will be distributed to alpha-3/alpha-4 participants very soon :) + + Otherwise, you can obtain TTKOj by successfully [proposing blocks](/docs/guides/enable-a-proposer) (the protocol rewards you in TTKOj) or from [Swap](https://swap.jolnir.taiko.xyz). + + diff --git a/packages/website/pages/docs/guides/run-a-node/_meta.json b/packages/website/pages/docs/guides/run-a-node/_meta.json deleted file mode 100644 index 126e67beba1..00000000000 --- a/packages/website/pages/docs/guides/run-a-node/_meta.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "run-a-sepolia-node": { - "title": "🔷 Run a Sepolia node" - }, - "run-a-taiko-node": { - "title": "🥁 Run a Taiko node" - }, - "enable-a-proposer": { - "title": "📤 Enable a proposer" - }, - "enable-a-prover": { - "title": "🔎 Enable a prover" - }, - "claim-prover-rewards": { - "title": "🛄 Claim prover rewards" - } -} diff --git a/packages/website/pages/docs/guides/run-a-node/claim-prover-rewards.mdx b/packages/website/pages/docs/guides/run-a-node/claim-prover-rewards.mdx deleted file mode 100644 index 8e1b3c410d7..00000000000 --- a/packages/website/pages/docs/guides/run-a-node/claim-prover-rewards.mdx +++ /dev/null @@ -1,50 +0,0 @@ -import { Callout, Steps } from "nextra-theme-docs"; - -# Claim prover rewards - -This guide will help you claim TTKO/TTKOe earned as a prover. - -## Prerequisites - -- You followed the [Enable a prover](/docs/guides/enable-a-prover) guide and have a prover which has proved a block to earn TTKO/TTKOe rewards. - -### Grimsvotn L2 (TTKO) - -- Must have a balance of ETH on Sepolia L1 (see: [Receive tokens](/docs/guides/receive-tokens)). - -### Eldfell L3 (TTKOe) - -- Must have a balance of ETH on Grimsvotn L2 (see: [Receive tokens](/docs/guides/receive-tokens)/[Bridge tokens](/docs/guides/build-on-taiko/bridge-tokens)). - -## Steps - - - -### View TTKO/TTKOe prover address balance - -Go to the TaikoL1 contract read page ([TTKO](https://sepolia.etherscan.io/address/0x6375394335f34848b850114b66A49D6F47f2cdA8#readProxyContract#F10)/[TTKOe](https://explorer.test.taiko.xyz/address/0x4e7c942D51d977459108bA497FDc71ae0Fc54a00/read-proxy#address-tabs)) and input your prover address to lookup your TTKO/TTKOe claim balance. - -### Enter withdraw amount - -Switch to the contract write page and select `withdrawTaikoToken(amount uint256)` to withdraw [TTKO](https://sepolia.etherscan.io/address/0x6375394335f34848b850114b66A49D6F47f2cdA8#writeProxyContract#F11)/[TTKOe](https://explorer.test.taiko.xyz/address/0x4e7c942D51d977459108bA497FDc71ae0Fc54a00/write-proxy#address-tabs) balances earned from being a prover. - - - Make sure to click the plus sign and add `10^8` decimals, or add 8 zeroes - manually. - - -For example if you want to withdraw `69` TTKO, you would enter `6900000000`. - - -Make sure -```solidity -amount<=withdrawTaikoToken(proverAddress) -``` -or else the transaction will revert. - - -### Withdraw your tokens - -Click `Write` and confirm the transaction in your wallet. - - diff --git a/packages/website/pages/docs/guides/run-a-node/enable-a-proposer.mdx b/packages/website/pages/docs/guides/run-a-node/enable-a-proposer.mdx deleted file mode 100644 index b8088001d09..00000000000 --- a/packages/website/pages/docs/guides/run-a-node/enable-a-proposer.mdx +++ /dev/null @@ -1,118 +0,0 @@ -import { Callout, Steps } from "nextra-theme-docs"; -import { contractAddressToLink } from "../../../../utils/contractAddressToLink"; -import { SEPOLIA_CONFIG, GRIMSVOTN_CONFIG } from "../../../../domain/chain"; -import { StyledLink } from "/components/StyledLink"; - -# Enable a proposer - -This guide will help you enable your Taiko node as a proposer. - -## Prerequisites - -- You have already setup a node (see: [Run a node](/docs/guides/run-a-node)) - -### Grimsvotn L2 - -- Must have a balance of ETH and TTKO on Sepolia L1 (see: [Receive tokens](/docs/guides/receive-tokens)). - -### Eldfell L3 - -- Must have a balance of ETH and TTKOe on Grimsvotn L2 (see: [Receive tokens](/docs/guides/receive-tokens)). - -## Steps - - -### Visit the TaikoL1 contract on block explorer - -First, you need to visit the `TaikoL1` **proxy contract**: - -- If you are depositing **TTKO**, you can visit it . -- If you are depositing **TTKOe**, you can visit it . - -### Click the write proxy tab - -Then, visit the "Write proxy" (Blockscout) or "Write as proxy" (Etherscan) tab. - -Click the wallet connect button on the explorer. - -### Enter deposit amount - -Click the text field for `depositTaikoToken` and enter the amount of TTKO or TTKOe you would like to deposit followed by 8 zeroes. - - - Make sure to click the plus sign and click `10^8` decimals to add 8 zeroes, or - add 8 zeroes manually. - - -For example if you want to deposit `69` TTKO/TTKOe, you would enter `6900000000`. - - - For accurate deposit amounts, refer to "Block Fee" on the L2/L3 Protocol - Status page (see: [L2 Protocol Status](https://status.test.taiko.xyz), [L3 - Protocol Status](https://explorer.l3test.taiko.xyz/stats)). Insufficient - deposits may result in proposal failure. - - -### Deposit your TTKO/TTKOe - -Click `Write` and confirm the transaction in your wallet. - -### Open .env file in `simple-taiko-node` - -For Grimsvotn L2: -```sh -nano .env -``` - -For Eldfell L3: - -```sh -nano .env.l3 -``` - -### Set environment variables to enable a proposer - - - Do **not** use a private key that is valuable to you. The private key will be - stored in plain text in the `.env` or `.env.l3` file, and this is not secure. - There is a real risk of losing your assets. You should **only use a test - account**. - - -Set the following environment variables to enable your node as a proposer: - -For Grimsvotn L2 `.env`: - -```sh -ENABLE_PROPOSER=true # change from false to true -# A L1 account (with balance) private key who will send TaikoL1.proposeBlock transactions -L1_PROPOSER_PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000000 # your wallet's private key -# A L2 account address who will be the tx fee beneficiary of the L2 blocks that you proposed -L2_SUGGESTED_FEE_RECIPIENT=0x0000000000000000000000000000000000000000 # the recipient of L2/L3 ETH rewards. -``` - -For Eldfell L3 `.env.l3`: - -```sh -ENABLE_PROPOSER=true # change from false to true -# A L2 account (with balance) private key who will send TaikoL1.proposeBlock transactions -L2_PROPOSER_PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000000 # your wallet's private key -# A L3 account address who will be the tx fee beneficiary of the L3 blocks that you proposed -L3_SUGGESTED_FEE_RECIPIENT=0x0000000000000000000000000000000000000000 # the recipient of L2/L3 ETH rewards. -``` - -### Verify proposer logs - -You should see a log if you have proposed a block: `📝 Propose transactions succeeded`. - -You can check all commands to see proposer logs in the [node runner manual](/docs/manuals/node-runner-manual#view-client-proposer-logs). - - - -## Videos - -- [Enable a proposer on your Taiko L2/L3 node](https://www.youtube.com/watch?v=z3gWKEoJidw) - -## Troubleshooting - -View the [Node troubleshooting reference](/docs/reference/node-troubleshooting) for help on any common error codes / issues. diff --git a/packages/website/pages/docs/guides/run-a-node/enable-a-prover.mdx b/packages/website/pages/docs/guides/run-a-node/enable-a-prover.mdx deleted file mode 100644 index 90df51a8b34..00000000000 --- a/packages/website/pages/docs/guides/run-a-node/enable-a-prover.mdx +++ /dev/null @@ -1,147 +0,0 @@ -import { Callout, Steps } from "nextra-theme-docs"; - - - Keep in mind that running a prover is a very competitive space, and those who - generate proofs will have very powerful machines and optimized clients. It's - unlikely to prove a block and gain rewards with the default client and minimum - hardware requirements (e.g. even a i9-13900K is not fast enough to prove for Grimsvotn L2). - - -# Enable a prover - -This guide will help you enable your Taiko node as a prover. Your node will generate proofs, but this does not mean you will be able to submit a proof in time to earn a reward, see the warning above. Read more about prover dynamics [here](/docs/concepts/proving#prover-dynamics) (especially to set your expectations about running a prover). - -## Prerequisites - -- You have already setup a node (see: [Run a node](/docs/guides/run-a-node)) -- Should have at least 8/16 core CPU and 32GB of RAM. - -### Grimsvotn L2 - -- Must have a balance of ETH on Sepolia L1 (see: [Receive tokens](/docs/guides/receive-tokens)). - -### Eldfell L3 - -- Must have a balance of ETH on Grimsvotn L2 (see: [Receive tokens](/docs/guides/receive-tokens)). - -## Steps - - -### Open the .env file in `simple-taiko-node` - -For Grimsvotn L2: - -```sh -nano .env -``` - -For Eldfell L3: - -```sh -nano .env.l3 -``` - - -### Set environment variables to enable prover - - - Do **not** use a private key that is valuable to you. The private key will be - stored in plain text in the `.env` or `.env.l3` file, and this is not secure. - There is a real risk of losing your assets. You should **only use a test - account**. - - -Set the following environment variables to enable your node as a prover: - -For Grimsvotn L2 `.env`: - -```sh -ENABLE_PROVER=true # change from false to true -# A L1 account (with balance) private key which will send the TaikoL1.proveBlock transactions. -L1_PROVER_PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000000 # your prover's private key -``` - -For Eldfell L3 `.env.l3`: - -```sh -ENABLE_PROVER=true # change from false to true -# A L2 account (with balance) private key which will send the TaikoL1.proveBlock transactions. -L2_PROVER_PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000000 # your prover's private key -``` - -### Verify prover logs - -Verify you have some prover logs: - -- `💰 Your block proof was accepted` means you are the first prover and receive the reward. -- `✅ Block proven` just means a proposed block was successfully proved on TaikoL1 (by anyone). - -You can check all commands to see prover logs in the [node runner manual](/docs/manuals/node-runner-manual#view-client-prover-relayer-logs). - -L2 -```sh -docker compose logs -f taiko_client_prover_relayer |egrep "block proof was|proof submission error|Block proven" -``` - -L3 -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 logs -f l3_taiko_client_prover_relayer |egrep "block proof was|proof submission error|Block proven" -``` - -### Stake your TTKOe (Eldfell L3 provers only) - -The simple-taiko-node comes with a default value of `PROVE_UNASSIGNED_BLOCKS` set to `true`. This means that your prover will attempt to prove these open blocks. To be assigned blocks by the protocol, you need to stake your TTKOe. - -If you are trying to run a prover for Eldfell L3 first keep in mind, the competition for getting into the prover pool will be high. But don't worry! Even if you get slashed, there's nothing wrong with that. TTKOe is a worthless testnet token, and even getting slashed really helps us to test the network. - -To stake your TTKOe try using the [staking dashboard](https://staking.l3test.taiko.xyz/) or the base layer contract manually (see [TaikoL1](/docs/reference/contract-addresses)). - -To be one of the provers, you must stake more than current prover stakes, and in the list of top 32 stakers [here](https://staking.l3test.taiko.xyz/#/currentProvers). - -The stake amount would be calculated by Capacity/Amount per Capacity. If you want to stake 2 TTKOe with 32 capacity, your Amount per Capacity will be calculated as: `2 / 32 = 0.0625`. - -If you have already staked some amount, only the difference will be deducted from your balance. - -1. Set the amount per capacity. This is the amount you in TTKOe you are staking. The more you stake, the higher your rank will be in prover pool. -2. Set the reward per gas. This is the reward you want to receive in TTKOe. A good value would be close to the current protocol `feePerGas`. -3. Set the capacity you can provide. This is the amount of parallel blocks you can handle within the proof window. - -### Changing the Staked TTKOe Amount (Only for Eldfell L3 Provers) - -In the event that you have staked TTKOe and made an error in the amount, you can change the staked amount at any time here. However, there are some considerations. - -For example, if you've staked 2 TTKOe and want to change the staked amount to 1 TTKOe, the difference of 1 TTKOe will be exited and you will not be able to withdraw it for a week. Be careful when entering the amount. - - - Always manually add eight zeros for the decimal '10^8`. - - -Enter the amount you wish to change your stake to for `amount` on the `stake()` function. Unlike the Staking Dashboard's Amount per Capacity, the entered amount will be the total staked amount. You can call the stake function on the ProverPool contract [here](https://explorer.test.taiko.xyz/address/0xC9580414A4372BDdBd8e19e01854DC0B2b1390Cf). - -Here are the parameters to set for `stake()`: -- `amount` -- `rewardPerGas (uint32)` -- `maxCapacity (uint32)` (minimum: 32) - -In the example above, if you enter 1 in the amount and click Write, the amount will change from 2 to 1, and 1 TTKOe will be exited. - -### Exit your prover from prover pool (Eldfell L3 provers only) - -If you want to stop proving, you can exit your prover from the prover pool. This will stop your prover from being assigned blocks. - -There are two actions you can use on the `ProverPool.sol` contract, the proxy contract can be found [here](/docs/reference/contract-addresses#based-contracts-1): - -1. Withdraw. This will withdraw your stake for your prover. -2. Exit. This will withdraw your stake and fully exit you from the prover pool (delete from storage). - -If want to temporarily leave the pool a withdraw should be enough, if you want to completely leave the pool you should use exit. - - - -## Videos - -- [Enable and exit a prover on your L2/L3 node](https://www.youtube.com/watch?v=yAHpbmNEC0M) - -## Troubleshooting - -View the [Node troubleshooting reference](/docs/reference/node-troubleshooting) for help on any common error codes / issues. diff --git a/packages/website/pages/docs/guides/run-a-node/run-a-sepolia-node.mdx b/packages/website/pages/docs/guides/run-a-sepolia-node.mdx similarity index 100% rename from packages/website/pages/docs/guides/run-a-node/run-a-sepolia-node.mdx rename to packages/website/pages/docs/guides/run-a-sepolia-node.mdx diff --git a/packages/website/pages/docs/guides/run-a-node/run-a-taiko-node.mdx b/packages/website/pages/docs/guides/run-a-taiko-node.mdx similarity index 75% rename from packages/website/pages/docs/guides/run-a-node/run-a-taiko-node.mdx rename to packages/website/pages/docs/guides/run-a-taiko-node.mdx index 1175a0565cc..f00dc5fffdf 100644 --- a/packages/website/pages/docs/guides/run-a-node/run-a-taiko-node.mdx +++ b/packages/website/pages/docs/guides/run-a-taiko-node.mdx @@ -3,13 +3,13 @@ import Image from "next/image"; # Run a Taiko node -This guide will help you start up a Taiko L2/L3 RPC node using [simple-taiko-node](https://github.com/taikoxyz/simple-taiko-node). +This guide will help you start up a Taiko RPC node using [simple-taiko-node](https://github.com/taikoxyz/simple-taiko-node). ## Prerequisites - [Docker](https://docs.docker.com/engine/install/) is installed and **running**. - [Git](https://github.com/git-guides/install-git/) is installed. -- Meet the [Geth minimum hardware requirements](https://github.com/ethereum/go-ethereum#hardware-requirements) except for the storage requirement because Taiko nodes will require less storage. As of `2023-07-27` an L2 sync takes **55 GB** and an L3 sync takes **4 GB**. +- Meet the [Geth minimum hardware requirements](https://github.com/ethereum/go-ethereum#hardware-requirements) except for the storage requirement because Taiko nodes will require less storage. As of `2023-09-18` a node uses less than **10 GB**. **100 GB** should be future proof enough if you intend to run your node for a while. ## Steps @@ -39,12 +39,12 @@ git config core.autocrlf false ### Copy the sample .env files ```sh -cp .env.sample .env && cp .env.sample.l3 .env.l3 +cp .env.sample .env ``` ### Set the required values in the .env file -**First**, open the `.env` or `.env.l3` file in your preferred text editor: +**First**, open the `.env` in your preferred text editor: @@ -63,13 +63,13 @@ notepad .env -**Next**, you will retrieve the base layer endpoints. +**Next**, you will set the L1 archive node endpoints. -You can get a base layer endpoint from a few places, but it **must point to an archive node** to access the state trie beyond the last 128 blocks. +You can get a L1 endpoint from a few places, but it **must point to an archive node** to access the state trie beyond the last 128 blocks. **Recommended**: -Run your own Sepolia archive node, see: [Run a Sepolia node](/docs/guides/run-a-sepolia-node). This is recommended because you will eventually be rate-limited by public RPC providers. If you are running an Eldfell L3 node, you will need to have a fully synced Grimsvotn L2 node. +Run your own Sepolia archive node, see: [Run a Sepolia node](/docs/guides/run-a-sepolia-node). This is recommended because you will eventually be rate-limited by public RPC providers. **Alternative**: [Alchemy](https://www.alchemy.com/) and [Infura](https://www.infura.io/) are two popular RPC providers. Make sure you select the RPC as Sepolia testnet, and not Ethereum mainnet. @@ -133,41 +133,32 @@ This is your `L1_ENDPOINT_WS` on your `.env`. -**Finally**, set the base layer endpoints. - -For a Grimsvotn L2 node this would be: +**Finally**, set the following L1 node endpoints in your `.env` file: - `L1_ENDPOINT_HTTP` - `L1_ENDPOINT_WS` -For an Eldfell L3 node this would be: - -- `L2_ENDPOINT_HTTP` -- `L2_ENDPOINT_WS` - -Take a look at the comments above these values in the `.env.sample` and `.env.sample.l3` to see how to set them up. +Take a look at the comments above these values in the `.env.sample` to see how to set them up. ### Start a node -Make sure Docker is running and then run the following command to start the node. - -For a Grimsvotn L2 node: +Make sure Docker is running and then run the following command to start the node: ```sh sudo docker compose up -d ``` -For an Eldfell L3 node: +### Verify node is running -```sh -sudo docker compose -f ./docker-compose.l3.yml --env-file .env.l3 up -d -``` +#### Check with the node dashboard -### Verify node is running +A node dashboard will be running on `localhost` on the `GRAFANA_PORT` you set in your `.env` file, which defaults to `3001`: [http://localhost:3001/d/L2ExecutionEngine/l2-execution-engine-overview](http://localhost:3001/d/L2ExecutionEngine/l2-execution-engine-overview). + +You can verify that your node is syncing by checking the **chain head** on the dashboard and seeing that it is increasing. Once the chain head matches what's on the block explorer, you are fully synced. #### Check with curl commands -1. Check if the Execution Layer client is connected to Taiko L2 / L3: +1. Check if the Execution Layer client is connected to Taiko L2: ```bash curl http://localhost:8547 \ @@ -182,8 +173,6 @@ which should return the chainId as `0x28c5d` (167005): { "jsonrpc": "2.0", "id": 0, "result": "0x28c5d" } ``` -For Taiko L3, use port 8549 for the `eth_chainId` curl request and you should get chainId `0x28c5e` (167006). - 2. Check if the Execution Layer client is synced by requesting the latest Taiko L2 / L3 block from the Execution Layer client: ```bash @@ -199,23 +188,8 @@ curl http://localhost:8547 \ sudo docker compose logs -f ``` -or the Taiko L3 logs here - -```bash -sudo docker compose -f ./docker-compose.l3.yml --env-file .env.l3 logs -f -``` - If you find an error, check the [Node troubleshooting](/docs/reference/node-troubleshooting) page. -#### Check with the node dashboard - -A node dashboard will be running on `localhost` on the `GRAFANA_PORT` you set in your `.env` or `.env.l3` file. - -- For a Grimsvotn L2 node that would default to: [http://localhost:3001/d/L2ExecutionEngine/l2-execution-engine-overview](http://localhost:3001/d/L2ExecutionEngine/l2-execution-engine-overview). -- For a Eldfell L3 node that would default to: [http://localhost:3002/d/L2ExecutionEngine/l2-execution-engine-overview](http://localhost:3002/d/L2ExecutionEngine/l2-execution-engine-overview). - -You can verify that your node is syncing by checking the **chain head** on the dashboard and seeing that it is increasing. Once the chain head matches what's on the block explorer, you are fully synced. -

    - +
    - ### Add tokens to your wallet
    -
    - + network={TAIKO_CONFIG.names.shortName}/> diff --git a/packages/website/pages/docs/guides/swap-tokens.mdx b/packages/website/pages/docs/guides/swap-tokens.mdx new file mode 100644 index 00000000000..157cb784416 --- /dev/null +++ b/packages/website/pages/docs/guides/swap-tokens.mdx @@ -0,0 +1,42 @@ +import { Callout, Steps } from "nextra-theme-docs"; + +# Swap tokens + +This guide will help you interact with Swap, which is a fork of Uniswap v2 that Taiko has deployed only for testing purposes. + +## Prerequisites + +- You must have some tokens to swap on Taiko, and ETH to cover the gas cost. You can [receive some ETH, HORSE, and BLL from the faucets](/docs/guides/receive-tokens) and then [bridge them to Taiko](/docs/guides/use-the-bridge). + +## Steps + + + ### Visit Swap + + Visit the [Swap dapp](https://swap.jolnir.taiko.xyz). + + ### Follow the video guide for swapping tokens + + + + ### Follow the video guide for adding liquidity + + + + diff --git a/packages/website/pages/docs/guides/build-on-taiko/verify-a-contract.mdx b/packages/website/pages/docs/guides/verify-a-contract.mdx similarity index 72% rename from packages/website/pages/docs/guides/build-on-taiko/verify-a-contract.mdx rename to packages/website/pages/docs/guides/verify-a-contract.mdx index db37ccb348a..0d12b2b9661 100644 --- a/packages/website/pages/docs/guides/build-on-taiko/verify-a-contract.mdx +++ b/packages/website/pages/docs/guides/verify-a-contract.mdx @@ -2,20 +2,14 @@ import { Callout, Steps, Tab, Tabs } from "nextra-theme-docs"; # Verify a contract -This guide will help get your contract verified on a Taiko testnet! +This guide will help get your contract verified on Taiko! ## Prerequisites -- You have a contract deployed on a Taiko testnet and the source code available. +- You have a contract deployed on Taiko and the source code available. ## Steps - - Make sure to set the RPC to the network you are trying to deploy to. The ones - here just use Grimsvotn L2 as an example. You can see all the RPC urls under - [RPC configuration](/docs/reference/rpc-configuration). - - **1. Add Etherscan config to Hardhat config** @@ -75,27 +69,25 @@ This guide will help get your contract verified on a Taiko testnet! Follow Blockscout's [official guide](https://docs.blockscout.com/for-users/verifying-a-smart-contract) to verify your contract on Taiko's blockscout explorers. - Copy the following Foundry test repo https://github.com/MarcusWentz/foundry-testing using git clone SSH + Copy the following Foundry test repo https://github.com/MarcusWentz/foundry-testing using git clone SSH: ```sh git clone git@github.com:MarcusWentz/foundry-testing.git ``` - Deploy to Taiko Grimsvotn L2 network and verify at the same time on Blockscout (with EIP-1559 gas [transaction type 1]) + + Deploy to Taiko and verify at the same time on Blockscout (with EIP-1559 gas [transaction type 1]): ```sh - forge create --rpc-url https://rpc.test.taiko.xyz --private-key $devTestnetPrivateKey src/Contract.sol:SimpleStorage --verify --verifier blockscout --verifier-url https://explorer.test.taiko.xyz/api\? + forge create --rpc-url https://rpc.test.taiko.xyz --private-key $devTestnetPrivateKey src/Contract.sol:SimpleStorage --verify --verifier blockscout --verifier-url https://explorer.test.taiko.xyz/api\? ``` - Deploy to Taiko Eldfell L3 network and verify at the same time on Blockscout (with EIP-1559 gas [transaction type 1]) - ```sh - forge create --rpc-url https://rpc.l3test.taiko.xyz --private-key $devTestnetPrivateKey src/Contract.sol:SimpleStorage --verify --verifier blockscout --verifier-url https://blockscoutapi.l3test.taiko.xyz/api\? - ``` - To use Legacy gas for [transaction type 0], add the + To use Legacy gas for [transaction type 0], add the ```sh - --legacy + --legacy ``` - flag with forge create. Example: + flag with forge create. Example: ``` - forge create --legacy --rpc-url https://rpc.test.taiko.xyz --private-key $devTestnetPrivateKey src/Contract.sol:SimpleStorage --verify --verifier blockscout --verifier-url https://explorer.test.taiko.xyz/api\? + forge create --legacy --rpc-url https://rpc.test.taiko.xyz --private-key $devTestnetPrivateKey src/Contract.sol:SimpleStorage --verify --verifier blockscout --verifier-url https://explorer.test.taiko.xyz/api\? ``` - + + diff --git a/packages/website/pages/docs/index.mdx b/packages/website/pages/docs/index.mdx index fabf9be7f75..57f3abdb772 100644 --- a/packages/website/pages/docs/index.mdx +++ b/packages/website/pages/docs/index.mdx @@ -11,13 +11,14 @@ Check out the [Taiko roadmap](/images/roadmaps/taiko-roadmap.png) to see where w Here's the best guides to get started with trying Taiko: - - + + +## RPC configuration + +See the RPC configuration for Taiko [here](/docs/reference/rpc-configuration). + ## Contribute to Taiko Taiko is an open-source, community-driven project that welcomes and values every and any contribution. That's including both technical and non-technical contributions. diff --git a/packages/website/pages/docs/manuals/integration-manual.mdx b/packages/website/pages/docs/manuals/integration-manual.mdx index 8e61cd791c8..244dc01112b 100644 --- a/packages/website/pages/docs/manuals/integration-manual.mdx +++ b/packages/website/pages/docs/manuals/integration-manual.mdx @@ -10,9 +10,9 @@ You can view the RPC configuration [here](/docs/reference/rpc-configuration). ## Taiko ETH -To [deploy on Taiko](https://taiko.xyz/docs/guides/build-on-taiko/deploy-a-contract), you would need some ETH on Taiko. +To [deploy on Taiko](https://taiko.xyz/docs/guides/deploy-a-contract), you would need some ETH on Taiko. -You can get some Taiko ETH by bridging from Sepolia ETH to Taiko [here](https://bridge.test.taiko.xyz/). +You can get some Taiko ETH by bridging from Sepolia ETH to Taiko [here](https://bridge.jolnir.taiko.xyz/). ## Taiko brand assets diff --git a/packages/website/pages/docs/manuals/node-runner-manual.mdx b/packages/website/pages/docs/manuals/node-runner-manual.mdx index e79ac00b5aa..ddb4abaf6b6 100644 --- a/packages/website/pages/docs/manuals/node-runner-manual.mdx +++ b/packages/website/pages/docs/manuals/node-runner-manual.mdx @@ -2,188 +2,84 @@ ## Start node -**Grimsvotn L2:** - ```sh docker compose up -d ``` -**Eldfell L3:** - -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 up -d -``` - ## Stop node -**Grimsvotn L2:** - ```sh docker compose down ``` -**Eldfell L3:** - -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 down -``` - ## Restart node -**Grimsvotn L2:** - ```sh docker compose down && docker compose up -d ``` -**Eldfell L3:** - -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 down && docker compose -f ./docker-compose.l3.yml --env-file .env.l3 up -d -``` - ## Update node -**Grimsvotn L2:** - ```sh git pull origin main && docker compose pull ``` -**Eldfell L3:** - -```sh -git pull origin main && docker compose -f ./docker-compose.l3.yml --env-file .env.l3 pull -``` - ## Remove node -**Grimsvotn L2:** - ```sh docker compose down -v ``` -**Eldfell L3:** - -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 down -v -``` - ## Start and remove orphan containers This command will start and remove containers that are not part of the current docker compose file. -**Grimsvotn L2:** - ```sh docker compose up -d --remove-orphans ``` -**Eldfell L3:** - -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 up -d --remove-orphans -``` - ## View grafana dashboard -**Grimsvotn L2:** - ```sh open http://localhost:3001/d/L2ExecutionEngine/l2-execution-engine-overview ``` -**Eldfell L3:** - -```sh -open http://localhost:3002/d/L2ExecutionEngine/l2-execution-engine-overview -``` - ## View all logs -**Grimsvotn L2:** - ```sh docker compose logs -f ``` -**Eldfell L3:** - -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 logs -f -``` - ## View execution logs -**Grimsvotn L2:** - ```sh docker compose logs -f l2_execution_engine ``` -**Eldfell L3:** - -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 logs -f l3_execution_engine -``` - ## View client driver logs -**Grimsvotn L2:** - ```sh docker compose logs -f taiko_client_driver ``` -**Eldfell L3:** - -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 logs -f l3_taiko_client_driver -``` - ## View client proposer logs -**Grimsvotn L2:** - ```sh docker compose logs -f taiko_client_proposer ``` -**Eldfell L3:** - -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 logs -f l3_taiko_client_proposer -``` - ## View client prover relayer logs -**Grimsvotn L2:** - ```sh docker compose logs -f taiko_client_prover_relayer ``` -**Eldfell L3:** - -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 logs -f l3_taiko_client_prover_relayer -``` - ## View zkevm prover logs -**Grimsvotn L2:** - ```sh docker compose logs -f zkevm_chain_prover_rpcd ``` -**Eldfell L3:** - -```sh -docker compose -f ./docker-compose.l3.yml --env-file .env.l3 logs -f l3_zkevm_chain_prover_rpcd -``` - ## View system resource usage stats ```sh diff --git a/packages/website/pages/docs/reference/_meta.json b/packages/website/pages/docs/reference/_meta.json index 6baf38ec6b8..85cac02e1b9 100644 --- a/packages/website/pages/docs/reference/_meta.json +++ b/packages/website/pages/docs/reference/_meta.json @@ -5,6 +5,12 @@ "rpc-configuration": { "title": "RPC configuration" }, + "contract-documentation": { + "title": "Contract documentation" + }, + "prover-market-page": { + "title": "Prover market page" + }, "node-troubleshooting": { "title": "Node troubleshooting" }, diff --git a/packages/website/pages/docs/reference/contract-addresses.mdx b/packages/website/pages/docs/reference/contract-addresses.mdx index 9708f94623f..1991999fc94 100644 --- a/packages/website/pages/docs/reference/contract-addresses.mdx +++ b/packages/website/pages/docs/reference/contract-addresses.mdx @@ -1,8 +1,4 @@ -import { - SEPOLIA_CONFIG, - GRIMSVOTN_CONFIG, - ELDFELL_CONFIG, -} from "../../../domain/chain"; +import { SEPOLIA_CONFIG, TAIKO_CONFIG } from "../../../domain/chain"; import { contractAddressToLink } from "../../../utils/contractAddressToLink"; import Link from "next/link"; import { ContractAddressTable } from "components/ContractAddressTable"; @@ -13,16 +9,10 @@ import { ContractAddressTable } from "components/ContractAddressTable"; # Contract addresses -**Based contracts** refer to contracts deployed on the base layer and **rollup contracts** refer to contracts deployed on the rollup. Learn more about inception layers [here](/docs/concepts/inception-layers)! +Below are the contracts we have deployed on the base layer (Sepolia L1) and the rollup (Taiko L2). ## Sepolia L1 -Sepolia L1 is used as a **base layer**. - -### Based contracts - -> Read the deployed alpha-3 based contracts [here](https://github.com/taikoxyz/taiko-mono/tree/alpha-3/packages/protocol/contracts). - @@ -104,193 +94,8 @@ Sepolia L1 is used as a **base layer**.
    -### Rollup contracts - -None. - -### Other contracts - -None. - -{/* Grimsvotn L2 contracts */} - -## Grimsvotn L2 - -Grimsvotn L2 is used as a **base layer** and a **rollup**. - -### Based contracts - -> Read the deployed alpha-4 based contracts [here](https://github.com/taikoxyz/taiko-mono/tree/alpha-4/packages/protocol/contracts). - - - - - - - - - - - {Object.keys(GRIMSVOTN_CONFIG.basedContracts).map((key) => { - if (key === "erc20Contracts") return; - const contract = GRIMSVOTN_CONFIG.basedContracts[key]; - const baseUrl = GRIMSVOTN_CONFIG.blockExplorer.url; - const blockExplorerName = GRIMSVOTN_CONFIG.blockExplorer.name; - const proxyAddress = contract.address.proxy; - const implementationAddress = contract.address.impl; - return ( - - - - - - ); - })} - -
    NameProxyImplementation
    {contract.name} - {proxyAddress ? ( - - {`${proxyAddress}`} - - ) : ( - "None" - )} - - - {`${implementationAddress}`} - -
    - - - - - - - - - - - - - {Object.keys(GRIMSVOTN_CONFIG.basedContracts.erc20Contracts).map((key) => { - const contract = GRIMSVOTN_CONFIG.basedContracts.erc20Contracts[key]; - const baseUrl = GRIMSVOTN_CONFIG.blockExplorer.url; - const blockExplorerName = GRIMSVOTN_CONFIG.blockExplorer.name; - const proxyAddress = contract.address.proxy; - const implementationAddress = contract.address.impl; - return ( - - - - - - - - ); - })} - -
    NameSymbolDecimalsProxyImplementation
    {contract.name}{contract.symbol}{contract.decimals} - {proxyAddress ? ( - - {`${proxyAddress}`} - - ) : ( - "None" - )} - - - {`${implementationAddress}`} - -
    - -### Rollup contracts - -> Read the deployed alpha-3 rollup contracts [here](https://github.com/taikoxyz/taiko-mono/tree/alpha-3/packages/protocol/contracts). - - - - - - - - - - - {Object.keys(GRIMSVOTN_CONFIG.rollupContracts).map((key) => { - if (key === "erc20Contracts") return; - const contract = GRIMSVOTN_CONFIG.rollupContracts[key]; - const baseUrl = GRIMSVOTN_CONFIG.blockExplorer.url; - const blockExplorerName = GRIMSVOTN_CONFIG.blockExplorer.name; - const proxyAddress = contract.address.proxy; - const implementationAddress = contract.address.impl; - return ( - - - - - - ); - })} - -
    NameProxyImplementation
    {contract.name} - {proxyAddress ? ( - - {`${proxyAddress}`} - - ) : ( - "None" - )} - - - {`${implementationAddress}`} - -
    - - - - - - - - - - - - - {Object.keys(GRIMSVOTN_CONFIG.rollupContracts.erc20Contracts).map((key) => { - const contract = GRIMSVOTN_CONFIG.rollupContracts.erc20Contracts[key]; - const baseUrl = GRIMSVOTN_CONFIG.blockExplorer.url; - const blockExplorerName = GRIMSVOTN_CONFIG.blockExplorer.name; - const proxyAddress = contract.address.proxy; - const implementationAddress = contract.address.impl; - return ( - - - - - - - - ); - })} - -
    NameSymbolDecimalsProxyImplementation
    {contract.name}{contract.symbol}{contract.decimals} - {proxyAddress ? ( - - {`${proxyAddress}`} - - ) : ( - "None" - )} - - - {`${implementationAddress}`} - -
    - -### Other contracts +## Taiko L2 -
    @@ -300,64 +105,11 @@ Grimsvotn L2 is used as a **base layer** and a **rollup**. - {Object.keys(GRIMSVOTN_CONFIG.otherContracts).map((key) => { + {Object.keys(TAIKO_CONFIG.rollupContracts).map((key) => { if (key === "erc20Contracts") return; - const contract = GRIMSVOTN_CONFIG.otherContracts[key]; - const baseUrl = GRIMSVOTN_CONFIG.blockExplorer.url; - const blockExplorerName = GRIMSVOTN_CONFIG.blockExplorer.name; - const proxyAddress = contract.address.proxy; - const implementationAddress = contract.address.impl; - return ( - - - - - - ); - })} - -
    {contract.name} - {proxyAddress ? ( - - {`${proxyAddress}`} - - ) : ( - "None" - )} - - - {`${implementationAddress}`} - -
    - -{/* Eldfell L3 contracts */} - -## Eldfell L3 - -Elfell L3 is used as a **rollup**. - -### Based contracts - -None. - -### Rollup contracts - -> Read the deployed alpha-4 rollup contracts [here](https://github.com/taikoxyz/taiko-mono/tree/alpha-3/packages/protocol/contracts). - - - - - - - - - - - {Object.keys(ELDFELL_CONFIG.rollupContracts).map((key) => { - if (key === "erc20Contracts") return; - const contract = ELDFELL_CONFIG.rollupContracts[key]; - const baseUrl = ELDFELL_CONFIG.blockExplorer.url; - const blockExplorerName = ELDFELL_CONFIG.blockExplorer.name; + const contract = TAIKO_CONFIG.rollupContracts[key]; + const baseUrl = TAIKO_CONFIG.blockExplorer.url; + const blockExplorerName = TAIKO_CONFIG.blockExplorer.name; const proxyAddress = contract.address.proxy; const implementationAddress = contract.address.impl; return ( @@ -394,10 +146,10 @@ None. - {Object.keys(ELDFELL_CONFIG.rollupContracts.erc20Contracts).map((key) => { - const contract = ELDFELL_CONFIG.rollupContracts.erc20Contracts[key]; - const baseUrl = ELDFELL_CONFIG.blockExplorer.url; - const blockExplorerName = ELDFELL_CONFIG.blockExplorer.name; + {Object.keys(TAIKO_CONFIG.rollupContracts.erc20Contracts).map((key) => { + const contract = TAIKO_CONFIG.rollupContracts.erc20Contracts[key]; + const baseUrl = TAIKO_CONFIG.blockExplorer.url; + const blockExplorerName = TAIKO_CONFIG.blockExplorer.name; const proxyAddress = contract.address.proxy; const implementationAddress = contract.address.impl; return ( @@ -424,7 +176,3 @@ None. })}
    NameProxyImplementation
    - -### Other contracts - -None. diff --git a/packages/website/pages/docs/reference/contract-documentation/L1/IProofVerifier.md b/packages/website/pages/docs/reference/contract-documentation/L1/IProofVerifier.md new file mode 100644 index 00000000000..031ddfe64cf --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/L1/IProofVerifier.md @@ -0,0 +1,24 @@ +--- +title: IProofVerifier +--- + +## IProofVerifier + +Contract that is responsible for verifying proofs. + +### verifyProofs + +```solidity +function verifyProofs(uint64 blockId, bytes blockProofs, bytes32 instance) external +``` + +Verify the given proof(s) for the given blockId. This function +should revert if the verification fails. + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------------------------------------------------------------------------------------- | +| blockId | uint64 | Unique identifier for the block. | +| blockProofs | bytes | Raw bytes representing the proof(s). | +| instance | bytes32 | Hashed evidence & config data. If set to zero, proof is assumed to be from oracle prover. | diff --git a/packages/website/pages/docs/reference/contract-documentation/L1/IProver.md b/packages/website/pages/docs/reference/contract-documentation/L1/IProver.md new file mode 100644 index 00000000000..bd28f077bd1 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/L1/IProver.md @@ -0,0 +1,24 @@ +--- +title: IProver +--- + +## IProver + +Defines the function that handle prover assignment. + +### onBlockAssigned + +```solidity +function onBlockAssigned(uint64 blockId, struct TaikoData.BlockMetadataInput input, struct TaikoData.ProverAssignment assignment) external payable +``` + +Assigns a prover to a specific block or reverts if this prover +is not available. + +#### Parameters + +| Name | Type | Description | +| ---------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| blockId | uint64 | The ID of the proposed block. Note that the ID is only known when the block is proposed, therefore, it should not be used for verifying prover authorization. | +| input | struct TaikoData.BlockMetadataInput | The block's BlockMetadataInput data. | +| assignment | struct TaikoData.ProverAssignment | The assignment to evaluate | diff --git a/packages/website/pages/docs/reference/contract-documentation/L1/ProofVerifier.md b/packages/website/pages/docs/reference/contract-documentation/L1/ProofVerifier.md new file mode 100644 index 00000000000..cf4d064d71d --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/L1/ProofVerifier.md @@ -0,0 +1,52 @@ +--- +title: ProofVerifier +--- + +## ProofVerifier + +See the documentation in {IProofVerifier}. + +### L1_INVALID_PROOF + +```solidity +error L1_INVALID_PROOF() +``` + +### init + +```solidity +function init(address _addressManager) external +``` + +Initializes the contract with the provided address manager. + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | -------------------------------------------- | +| \_addressManager | address | The address of the address manager contract. | + +### verifyProofs + +```solidity +function verifyProofs(uint64, bytes blockProofs, bytes32 instance) external view +``` + +Verify the given proof(s) for the given blockId. This function +should revert if the verification fails. + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------------------------------------------------------------------------------------- | +| | uint64 | | +| blockProofs | bytes | Raw bytes representing the proof(s). | +| instance | bytes32 | Hashed evidence & config data. If set to zero, proof is assumed to be from oracle prover. | + +--- + +## title: ProxiedProofVerifier + +## ProxiedProofVerifier + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/L1/TaikoData.md b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoData.md new file mode 100644 index 00000000000..65f4aea8b17 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoData.md @@ -0,0 +1,224 @@ +--- +title: TaikoData +--- + +## TaikoData + +This library defines various data structures used in the Taiko +protocol. + +### Config + +_Struct holding Taiko configuration parameters. See {TaikoConfig}._ + +```solidity +struct Config { + uint256 chainId; + bool relaySignalRoot; + uint64 blockMaxProposals; + uint64 blockRingBufferSize; + uint64 blockMaxVerificationsPerTx; + uint32 blockMaxGasLimit; + uint32 blockFeeBaseGas; + uint24 blockMaxTxListBytes; + uint256 blockTxListExpiry; + uint256 proposerRewardPerSecond; + uint256 proposerRewardMax; + uint256 proofRegularCooldown; + uint256 proofOracleCooldown; + uint16 proofWindow; + uint96 proofBond; + bool skipProverAssignmentVerificaiton; + uint256 ethDepositRingBufferSize; + uint64 ethDepositMinCountPerBlock; + uint64 ethDepositMaxCountPerBlock; + uint96 ethDepositMinAmount; + uint96 ethDepositMaxAmount; + uint256 ethDepositGas; + uint256 ethDepositMaxFee; +} +``` + +### StateVariables + +_Struct holding state variables._ + +```solidity +struct StateVariables { + uint64 genesisHeight; + uint64 genesisTimestamp; + uint64 numBlocks; + uint64 lastVerifiedBlockId; + uint64 nextEthDepositToProcess; + uint64 numEthDeposits; +} +``` + +### BlockMetadataInput + +_Struct representing input data for block metadata._ + +```solidity +struct BlockMetadataInput { + bytes32 txListHash; + address proposer; + uint24 txListByteStart; + uint24 txListByteEnd; + bool cacheTxListInfo; +} +``` + +### ProverAssignment + +_Struct representing prover assignment_ + +```solidity +struct ProverAssignment { + address prover; + uint64 expiry; + bytes data; +} +``` + +### BlockMetadata + +_Struct containing data only required for proving a block +Warning: changing this struct requires changing {LibUtils.hashMetadata} +accordingly._ + +```solidity +struct BlockMetadata { + uint64 id; + uint64 timestamp; + uint64 l1Height; + bytes32 l1Hash; + bytes32 mixHash; + bytes32 txListHash; + uint24 txListByteStart; + uint24 txListByteEnd; + uint32 gasLimit; + address proposer; + struct TaikoData.EthDeposit[] depositsProcessed; +} +``` + +### BlockEvidence + +_Struct representing block evidence._ + +```solidity +struct BlockEvidence { + bytes32 metaHash; + bytes32 parentHash; + bytes32 blockHash; + bytes32 signalRoot; + bytes32 graffiti; + address prover; + bytes proofs; +} +``` + +### Transition + +_Struct representing state transition data. +10 slots reserved for upgradability, 4 slots used._ + +```solidity +struct Transition { + bytes32 key; + bytes32 blockHash; + bytes32 signalRoot; + address prover; + uint64 provenAt; + bytes32[6] __reserved; +} +``` + +### Block + +_Struct containing data required for verifying a block. +10 slots reserved for upgradability, 3 slots used._ + +```solidity +struct Block { + bytes32 metaHash; + address prover; + uint96 proofBond; + uint64 blockId; + uint64 proposedAt; + uint32 nextTransitionId; + uint32 verifiedTransitionId; + bytes32[7] __reserved; +} +``` + +### TxListInfo + +_Struct representing information about a transaction list. +1 slot used._ + +```solidity +struct TxListInfo { + uint64 validSince; + uint24 size; +} +``` + +### EthDeposit + +_Struct representing an Ethereum deposit. +1 slot used._ + +```solidity +struct EthDeposit { + address recipient; + uint96 amount; + uint64 id; +} +``` + +### SlotA + +_Forge is only able to run coverage in case the contracts by default +capable of compiling without any optimization (neither optimizer runs, +no compiling --via-ir flag). +In order to resolve stack too deep without optimizations, we needed to +introduce outsourcing vars into structs below._ + +```solidity +struct SlotA { + uint64 genesisHeight; + uint64 genesisTimestamp; + uint64 numEthDeposits; + uint64 nextEthDepositToProcess; +} +``` + +### SlotB + +```solidity +struct SlotB { + uint64 numBlocks; + uint64 nextEthDepositToProcess; + uint64 lastVerifiedAt; + uint64 lastVerifiedBlockId; +} +``` + +### State + +_Struct holding the state variables for the {TaikoL1} contract._ + +```solidity +struct State { + mapping(uint64 => struct TaikoData.Block) blocks; + mapping(uint64 => mapping(bytes32 => uint32)) transitionIds; + mapping(uint64 => mapping(uint32 => struct TaikoData.Transition)) transitions; + mapping(bytes32 => struct TaikoData.TxListInfo) txListInfo; + mapping(uint256 => uint256) ethDeposits; + mapping(address => uint256) taikoTokenBalances; + struct TaikoData.SlotA slotA; + struct TaikoData.SlotB slotB; + uint256[142] __gap; +} +``` diff --git a/packages/website/pages/docs/reference/contract-documentation/L1/TaikoErrors.md b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoErrors.md new file mode 100644 index 00000000000..45d63a671b8 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoErrors.md @@ -0,0 +1,159 @@ +--- +title: TaikoErrors +--- + +## TaikoErrors + +This abstract contract provides custom error declartions used in +the Taiko protocol. Each error corresponds to specific situations where +exceptions might be thrown. + +### L1_ALREADY_PROVEN + +```solidity +error L1_ALREADY_PROVEN() +``` + +### L1_BLOCK_ID_MISMATCH + +```solidity +error L1_BLOCK_ID_MISMATCH() +``` + +### L1_EVIDENCE_MISMATCH + +```solidity +error L1_EVIDENCE_MISMATCH() +``` + +### L1_INSUFFICIENT_TOKEN + +```solidity +error L1_INSUFFICIENT_TOKEN() +``` + +### L1_INVALID_ASSIGNMENT + +```solidity +error L1_INVALID_ASSIGNMENT() +``` + +### L1_INVALID_BLOCK_ID + +```solidity +error L1_INVALID_BLOCK_ID() +``` + +### L1_INVALID_CONFIG + +```solidity +error L1_INVALID_CONFIG() +``` + +### L1_INVALID_ETH_DEPOSIT + +```solidity +error L1_INVALID_ETH_DEPOSIT() +``` + +### L1_INVALID_EVIDENCE + +```solidity +error L1_INVALID_EVIDENCE() +``` + +### L1_INVALID_METADATA + +```solidity +error L1_INVALID_METADATA() +``` + +### L1_INVALID_ORACLE_PROVER + +```solidity +error L1_INVALID_ORACLE_PROVER() +``` + +### L1_INVALID_PARAM + +```solidity +error L1_INVALID_PARAM() +``` + +### L1_INVALID_PROOF + +```solidity +error L1_INVALID_PROOF() +``` + +### L1_INVALID_PROPOSER + +```solidity +error L1_INVALID_PROPOSER() +``` + +### L1_INVALID_PROVER + +```solidity +error L1_INVALID_PROVER() +``` + +### L1_INVALID_PROVER_SIG + +```solidity +error L1_INVALID_PROVER_SIG() +``` + +### L1_NOT_PROVEABLE + +```solidity +error L1_NOT_PROVEABLE() +``` + +### L1_SAME_PROOF + +```solidity +error L1_SAME_PROOF() +``` + +### L1_TOO_MANY_BLOCKS + +```solidity +error L1_TOO_MANY_BLOCKS() +``` + +### L1_TRANSITION_NOT_FOUND + +```solidity +error L1_TRANSITION_NOT_FOUND() +``` + +### L1_TX_LIST_NOT_EXIST + +```solidity +error L1_TX_LIST_NOT_EXIST() +``` + +### L1_TX_LIST_HASH + +```solidity +error L1_TX_LIST_HASH() +``` + +### L1_TX_LIST_RANGE + +```solidity +error L1_TX_LIST_RANGE() +``` + +### L1_TX_LIST + +```solidity +error L1_TX_LIST() +``` + +### L1_UNEXPECTED_TRANSITION_ID + +```solidity +error L1_UNEXPECTED_TRANSITION_ID() +``` diff --git a/packages/website/pages/docs/reference/contract-documentation/L1/TaikoEvents.md b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoEvents.md new file mode 100644 index 00000000000..34a0ae37b8c --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoEvents.md @@ -0,0 +1,100 @@ +--- +title: TaikoEvents +--- + +## TaikoEvents + +This abstract contract provides event declarations for the Taiko +protocol, which are emitted during block proposal, proof, verification, and +Ethereum deposit processes. + +_The events defined here must match the definitions in the corresponding +L1 libraries._ + +### BlockProposed + +```solidity +event BlockProposed(uint256 blockId, address prover, uint256 reward, struct TaikoData.BlockMetadata meta) +``` + +_Emitted when a block is proposed._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------------------------------ | ------------------------------------------------------------------- | +| blockId | uint256 | The ID of the proposed block. | +| prover | address | The address of the assigned prover for the block. | +| reward | uint256 | The proposer's block reward in Taiko token. | +| meta | struct TaikoData.BlockMetadata | The block metadata containing information about the proposed block. | + +### BlockProven + +```solidity +event BlockProven(uint256 blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) +``` + +_Emitted when a block is proven._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | -------------------------------------------------- | +| blockId | uint256 | The ID of the proven block. | +| parentHash | bytes32 | The hash of the parent block. | +| blockHash | bytes32 | The hash of the proven block. | +| signalRoot | bytes32 | The signal root of the proven block. | +| prover | address | The address of the prover who submitted the proof. | + +### BlockVerified + +```solidity +event BlockVerified(uint256 blockId, address prover, bytes32 blockHash) +``` + +_Emitted when a block is verified._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ------------------------------------------------------------------ | +| blockId | uint256 | The ID of the verified block. | +| prover | address | The address of the prover that proved the block which is verified. | +| blockHash | bytes32 | The hash of the verified block. | + +### EthDeposited + +```solidity +event EthDeposited(struct TaikoData.EthDeposit deposit) +``` + +_Emitted when an Ethereum deposit is made._ + +#### Parameters + +| Name | Type | Description | +| ------- | --------------------------- | --------------------------------------------------------------------- | +| deposit | struct TaikoData.EthDeposit | The Ethereum deposit information including recipient, amount, and ID. | + +### BondReceived + +```solidity +event BondReceived(address from, uint64 blockId, uint256 bond) +``` + +_The following events are emitted when bonds are received, returned, +or rewarded. Note that no event is emitted when a bond is kept/burnt as +for a single block, multiple bonds may get burned or retained by the +protocol, emitting events will consume more gas._ + +### BondReturned + +```solidity +event BondReturned(address to, uint64 blockId, uint256 bond) +``` + +### BondRewarded + +```solidity +event BondRewarded(address to, uint64 blockId, uint256 bond) +``` diff --git a/packages/website/pages/docs/reference/contract-documentation/L1/TaikoL1.md b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoL1.md new file mode 100644 index 00000000000..d5d94b68358 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoL1.md @@ -0,0 +1,27 @@ +--- +title: TaikoL1 +--- + +## TaikoL1 + +### getConfig + +```solidity +function getConfig() public pure virtual returns (struct TaikoData.Config) +``` + +Gets the configuration of the TaikoL1 contract. + +#### Return Values + +| Name | Type | Description | +| ---- | ----------------------- | -------------------------------------------------- | +| [0] | struct TaikoData.Config | Config struct containing configuration parameters. | + +--- + +## title: ProxiedTaikoL1 + +## ProxiedTaikoL1 + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/L1/TaikoL1Base.md b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoL1Base.md new file mode 100644 index 00000000000..c43a187256a --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoL1Base.md @@ -0,0 +1,304 @@ +--- +title: TaikoL1Base +--- + +## TaikoL1Base + +This contract serves as the "base layer contract" of the Taiko +protocol, providing functionalities for proposing, proving, and verifying +blocks. The term "base layer contract" means that although this is usually +deployed on L1, it can also be deployed on L2s to create L3s ("inception +layers"). The contract also handles the deposit and withdrawal of Taiko +tokens and Ether. + +### state + +```solidity +struct TaikoData.State state +``` + +### receive + +```solidity +receive() external payable +``` + +_Fallback function to receive Ether and deposit to to Layer 2._ + +### init + +```solidity +function init(address _addressManager, bytes32 _genesisBlockHash) external +``` + +Initializes the rollup. + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ------------------------------------ | +| \_addressManager | address | The {AddressManager} address. | +| \_genesisBlockHash | bytes32 | The block hash of the genesis block. | + +### proposeBlock + +```solidity +function proposeBlock(bytes input, bytes assignment, bytes txList) external payable returns (struct TaikoData.BlockMetadata meta) +``` + +Proposes a Taiko L2 block. + +#### Parameters + +| Name | Type | Description | +| ---------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| input | bytes | An abi-encoded BlockMetadataInput that the actual L2 block header must satisfy. | +| assignment | bytes | Data to assign a prover. | +| txList | bytes | A list of transactions in this block, encoded with RLP. Note, in the corresponding L2 block an "anchor transaction" will be the first transaction in the block. If there are `n` transactions in the `txList`, then there will be up to `n + 1` transactions in the L2 block. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------------------------------ | -------------------------------------- | +| meta | struct TaikoData.BlockMetadata | The metadata of the proposed L2 block. | + +### proveBlock + +```solidity +function proveBlock(uint64 blockId, bytes input) external +``` + +Proves a block with a zero-knowledge proof. + +#### Parameters + +| Name | Type | Description | +| ------- | ------ | ---------------------------------------------------------------------------------------------- | +| blockId | uint64 | The index of the block to prove. This is also used to select the right implementation version. | +| input | bytes | An abi-encoded {TaikoData.BlockEvidence} object. | + +### verifyBlocks + +```solidity +function verifyBlocks(uint64 maxBlocks) external +``` + +Verifies up to N blocks. + +#### Parameters + +| Name | Type | Description | +| --------- | ------ | ------------------------------- | +| maxBlocks | uint64 | Max number of blocks to verify. | + +### depositTaikoToken + +```solidity +function depositTaikoToken(uint256 amount) external +``` + +Deposits Taiko tokens to the contract. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ---------------------------------- | +| amount | uint256 | Amount of Taiko tokens to deposit. | + +### withdrawTaikoToken + +```solidity +function withdrawTaikoToken(uint256 amount) external +``` + +Withdraws Taiko tokens from the contract. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------------------------------- | +| amount | uint256 | Amount of Taiko tokens to withdraw. | + +### depositEtherToL2 + +```solidity +function depositEtherToL2(address recipient) public payable +``` + +Deposits Ether to Layer 2. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ------------------------------------------------------------ | +| recipient | address | Address of the recipient for the deposited Ether on Layer 2. | + +### getTaikoTokenBalance + +```solidity +function getTaikoTokenBalance(address addr) public view returns (uint256) +``` + +Gets the Taiko token balance for a specific address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------------------------------------- | +| addr | address | Address to check the Taiko token balance. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | --------------------------------------- | +| [0] | uint256 | The Taiko token balance of the address. | + +### canDepositEthToL2 + +```solidity +function canDepositEthToL2(uint256 amount) public view returns (bool) +``` + +Checks if Ether deposit is allowed for Layer 2. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | -------------------------------- | +| amount | uint256 | Amount of Ether to be deposited. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | -------------------------------------------------- | +| [0] | bool | true if Ether deposit is allowed, false otherwise. | + +### getBlock + +```solidity +function getBlock(uint64 blockId) public view returns (struct TaikoData.Block blk) +``` + +Gets the details of a block. + +#### Parameters + +| Name | Type | Description | +| ------- | ------ | ------------------- | +| blockId | uint64 | Index of the block. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---------------------- | ----------- | +| blk | struct TaikoData.Block | The block. | + +### getTransition + +```solidity +function getTransition(uint64 blockId, bytes32 parentHash) public view returns (struct TaikoData.Transition) +``` + +Gets the state transition for a specific block. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ------------------------- | +| blockId | uint64 | Index of the block. | +| parentHash | bytes32 | Parent hash of the block. | + +#### Return Values + +| Name | Type | Description | +| ---- | --------------------------- | --------------------------------------- | +| [0] | struct TaikoData.Transition | The state transition data of the block. | + +### getCrossChainBlockHash + +```solidity +function getCrossChainBlockHash(uint64 blockId) public view returns (bytes32) +``` + +Fetches the hash of a block from the opposite chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ------ | ------------------------------------------------------------------------- | +| blockId | uint64 | The target block id. Specifying 0 retrieves the hash of the latest block. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | --------------------------------------------------- | +| [0] | bytes32 | The hash of the desired block from the other chain. | + +### getCrossChainSignalRoot + +```solidity +function getCrossChainSignalRoot(uint64 blockId) public view returns (bytes32) +``` + +Retrieves the root hash of the signal service storage for a +given block from the opposite chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ------ | ------------------------------------------------------------------------- | +| blockId | uint64 | The target block id. Specifying 0 retrieves the root of the latest block. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | ------------------------------------------------------- | +| [0] | bytes32 | The root hash for the specified block's signal service. | + +### getStateVariables + +```solidity +function getStateVariables() public view returns (struct TaikoData.StateVariables) +``` + +Gets the state variables of the TaikoL1 contract. + +#### Return Values + +| Name | Type | Description | +| ---- | ------------------------------- | ------------------------------------------------- | +| [0] | struct TaikoData.StateVariables | StateVariables struct containing state variables. | + +### getVerifierName + +```solidity +function getVerifierName(uint16 id) public pure returns (bytes32) +``` + +Gets the name of the proof verifier by ID. + +#### Parameters + +| Name | Type | Description | +| ---- | ------ | ------------------- | +| id | uint16 | ID of the verifier. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | -------------- | +| [0] | bytes32 | Verifier name. | + +### getConfig + +```solidity +function getConfig() public pure virtual returns (struct TaikoData.Config) +``` + +Gets the configuration of the TaikoL1 contract. + +#### Return Values + +| Name | Type | Description | +| ---- | ----------------------- | -------------------------------------------------- | +| [0] | struct TaikoData.Config | Config struct containing configuration parameters. | diff --git a/packages/website/pages/docs/reference/contract-documentation/L1/TaikoToken.md b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoToken.md new file mode 100644 index 00000000000..188f04bed15 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoToken.md @@ -0,0 +1,169 @@ +--- +title: TaikoToken +--- + +## TaikoToken + +The TaikoToken (TKO), in the protocol is used for prover collateral +in the form of bonds. It is an ERC20 token with 18 decimal places of +precision. + +### TKO_INVALID_ADDR + +```solidity +error TKO_INVALID_ADDR() +``` + +### TKO_INVALID_PREMINT_PARAMS + +```solidity +error TKO_INVALID_PREMINT_PARAMS() +``` + +### init + +```solidity +function init(address _addressManager, string _name, string _symbol, address[] _premintRecipients, uint256[] _premintAmounts) public +``` + +Initializes the TaikoToken contract and mints initial tokens to +specified recipients. + +#### Parameters + +| Name | Type | Description | +| ------------------- | --------- | ------------------------------------------------------------------- | +| \_addressManager | address | The {AddressManager} address. | +| \_name | string | The name of the token. | +| \_symbol | string | The symbol of the token. | +| \_premintRecipients | address[] | An array of addresses to receive initial token minting. | +| \_premintAmounts | uint256[] | An array of token amounts to mint for each corresponding recipient. | + +### snapshot + +```solidity +function snapshot() public +``` + +Creates a new token snapshot. + +### pause + +```solidity +function pause() public +``` + +Pauses token transfers. + +### unpause + +```solidity +function unpause() public +``` + +Unpauses token transfers. + +### mint + +```solidity +function mint(address to, uint256 amount) public +``` + +Mints new tokens to the specified address. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------------------------------------- | +| to | address | The address to receive the minted tokens. | +| amount | uint256 | The amount of tokens to mint. | + +### burn + +```solidity +function burn(address from, uint256 amount) public +``` + +Burns tokens from the specified address. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | -------------------------------- | +| from | address | The address to burn tokens from. | +| amount | uint256 | The amount of tokens to burn. | + +### transfer + +```solidity +function transfer(address to, uint256 amount) public returns (bool) +``` + +Transfers tokens to a specified address. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ---------------------------------- | +| to | address | The address to transfer tokens to. | +| amount | uint256 | The amount of tokens to transfer. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------------------------- | +| [0] | bool | A boolean indicating whether the transfer was successful or not. | + +### transferFrom + +```solidity +function transferFrom(address from, address to, uint256 amount) public returns (bool) +``` + +Transfers tokens from one address to another. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ------------------------------------ | +| from | address | The address to transfer tokens from. | +| to | address | The address to transfer tokens to. | +| amount | uint256 | The amount of tokens to transfer. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------------------------- | +| [0] | bool | A boolean indicating whether the transfer was successful or not. | + +### \_beforeTokenTransfer + +```solidity +function _beforeTokenTransfer(address from, address to, uint256 amount) internal +``` + +### \_afterTokenTransfer + +```solidity +function _afterTokenTransfer(address from, address to, uint256 amount) internal +``` + +### \_mint + +```solidity +function _mint(address to, uint256 amount) internal +``` + +### \_burn + +```solidity +function _burn(address from, uint256 amount) internal +``` + +--- + +## title: ProxiedTaikoToken + +## ProxiedTaikoToken + +Proxied version of the TaikoToken contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/L2/TaikoL2.md b/packages/website/pages/docs/reference/contract-documentation/L2/TaikoL2.md new file mode 100644 index 00000000000..45904f8c188 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/L2/TaikoL2.md @@ -0,0 +1,272 @@ +--- +title: TaikoL2 +--- + +## TaikoL2 + +Taiko L2 is a smart contract that handles cross-layer message +verification and manages EIP-1559 gas pricing for Layer 2 (L2) operations. +It is used to anchor the latest L1 block details to L2 for cross-layer +communication, manage EIP-1559 parameters for gas pricing, and store +verified L1 block information. + +### VerifiedBlock + +```solidity +struct VerifiedBlock { + bytes32 blockHash; + bytes32 signalRoot; +} +``` + +### EIP1559Params + +```solidity +struct EIP1559Params { + uint64 basefee; + uint32 gasIssuedPerSecond; + uint64 gasExcessMax; + uint64 gasTarget; + uint64 ratio2x1x; +} +``` + +### EIP1559Config + +```solidity +struct EIP1559Config { + uint128 yscale; + uint64 xscale; + uint32 gasIssuedPerSecond; +} +``` + +### publicInputHash + +```solidity +bytes32 publicInputHash +``` + +### eip1559Config + +```solidity +struct TaikoL2.EIP1559Config eip1559Config +``` + +### parentTimestamp + +```solidity +uint64 parentTimestamp +``` + +### latestSyncedL1Height + +```solidity +uint64 latestSyncedL1Height +``` + +### gasExcess + +```solidity +uint64 gasExcess +``` + +### Anchored + +```solidity +event Anchored(uint64 number, uint64 basefee, uint32 gaslimit, uint64 timestamp, bytes32 parentHash, uint256 prevrandao, address coinbase, uint64 chainid) +``` + +### EIP1559ConfigUpdated + +```solidity +event EIP1559ConfigUpdated(struct TaikoL2.EIP1559Config config, uint64 gasExcess) +``` + +### L2_BASEFEE_MISMATCH + +```solidity +error L2_BASEFEE_MISMATCH() +``` + +### L2_INVALID_1559_PARAMS + +```solidity +error L2_INVALID_1559_PARAMS() +``` + +### L2_INVALID_CHAIN_ID + +```solidity +error L2_INVALID_CHAIN_ID() +``` + +### L2_INVALID_SENDER + +```solidity +error L2_INVALID_SENDER() +``` + +### L2_PUBLIC_INPUT_HASH_MISMATCH + +```solidity +error L2_PUBLIC_INPUT_HASH_MISMATCH() +``` + +### L2_TOO_LATE + +```solidity +error L2_TOO_LATE() +``` + +### init + +```solidity +function init(address _addressManager, struct TaikoL2.EIP1559Params _param1559) external +``` + +Initializes the TaikoL2 contract. + +#### Parameters + +| Name | Type | Description | +| ---------------- | ---------------------------- | ---------------------------------------------------- | +| \_addressManager | address | Address of the {AddressManager} contract. | +| \_param1559 | struct TaikoL2.EIP1559Params | EIP-1559 parameters to set up the gas pricing model. | + +### anchor + +```solidity +function anchor(bytes32 l1Hash, bytes32 l1SignalRoot, uint64 l1Height, uint32 parentGasUsed) external +``` + +Anchors the latest L1 block details to L2 for cross-layer +message verification. + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | -------------------------------------------------------- | +| l1Hash | bytes32 | The latest L1 block hash when this block was proposed. | +| l1SignalRoot | bytes32 | The latest value of the L1 signal service storage root. | +| l1Height | uint64 | The latest L1 block height when this block was proposed. | +| parentGasUsed | uint32 | The gas used in the parent block. | + +### updateEIP1559Config + +```solidity +function updateEIP1559Config(struct TaikoL2.EIP1559Params _param1559) public +``` + +Updates EIP-1559 configurations. + +#### Parameters + +| Name | Type | Description | +| ----------- | ---------------------------- | ---------------------------------------------------- | +| \_param1559 | struct TaikoL2.EIP1559Params | EIP-1559 parameters to set up the gas pricing model. | + +### getBasefee + +```solidity +function getBasefee(uint64 timeSinceParent, uint32 parentGasUsed) public view returns (uint256 _basefee) +``` + +Gets the basefee and gas excess using EIP-1559 configuration for +the given parameters. + +#### Parameters + +| Name | Type | Description | +| --------------- | ------ | ------------------------------------------------ | +| timeSinceParent | uint64 | Time elapsed since the parent block's timestamp. | +| parentGasUsed | uint32 | Gas used in the parent block. | + +#### Return Values + +| Name | Type | Description | +| --------- | ------- | -------------------------------- | +| \_basefee | uint256 | The calculated EIP-1559 basefee. | + +### getCrossChainBlockHash + +```solidity +function getCrossChainBlockHash(uint64 blockId) public view returns (bytes32) +``` + +Fetches the hash of a block from the opposite chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ------ | ------------------------------------------------------------------------- | +| blockId | uint64 | The target block id. Specifying 0 retrieves the hash of the latest block. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | --------------------------------------------------- | +| [0] | bytes32 | The hash of the desired block from the other chain. | + +### getCrossChainSignalRoot + +```solidity +function getCrossChainSignalRoot(uint64 blockId) public view returns (bytes32) +``` + +Retrieves the root hash of the signal service storage for a +given block from the opposite chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ------ | ------------------------------------------------------------------------- | +| blockId | uint64 | The target block id. Specifying 0 retrieves the root of the latest block. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | ------------------------------------------------------- | +| [0] | bytes32 | The root hash for the specified block's signal service. | + +### getBlockHash + +```solidity +function getBlockHash(uint64 blockId) public view returns (bytes32) +``` + +Retrieves the block hash for the given L2 block number. + +#### Parameters + +| Name | Type | Description | +| ------- | ------ | --------------------------------------------------- | +| blockId | uint64 | The L2 block number to retrieve the block hash for. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | --------------------------------------------------------------------------------------------------------------------------- | +| [0] | bytes32 | The block hash for the specified L2 block id, or zero if the block id is greater than or equal to the current block number. | + +### getEIP1559Config + +```solidity +function getEIP1559Config() public view virtual returns (struct TaikoL2.EIP1559Config) +``` + +Retrieves the current EIP-1559 configuration details. + +#### Return Values + +| Name | Type | Description | +| ---- | ---------------------------- | ------------------------------------------------------------------------------------------------------------ | +| [0] | struct TaikoL2.EIP1559Config | The current EIP-1559 configuration details, including the yscale, xscale, and gasIssuedPerSecond parameters. | + +--- + +## title: ProxiedTaikoL2 + +## ProxiedTaikoL2 + +Proxied version of the TaikoL2 contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/L2/TaikoL2Signer.md b/packages/website/pages/docs/reference/contract-documentation/L2/TaikoL2Signer.md new file mode 100644 index 00000000000..9e2308ceb5b --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/L2/TaikoL2Signer.md @@ -0,0 +1,50 @@ +--- +title: TaikoL2Signer +--- + +## TaikoL2Signer + +This contract allows for signing operations required on Taiko L2. + +_It uses precomputed values for optimized signature creation._ + +### GOLDEN_TOUCH_ADDRESS + +```solidity +address GOLDEN_TOUCH_ADDRESS +``` + +### GOLDEN_TOUCH_PRIVATEKEY + +```solidity +uint256 GOLDEN_TOUCH_PRIVATEKEY +``` + +### L2_INVALID_GOLDEN_TOUCH_K + +```solidity +error L2_INVALID_GOLDEN_TOUCH_K() +``` + +### signAnchor + +```solidity +function signAnchor(bytes32 digest, uint8 k) public view returns (uint8 v, uint256 r, uint256 s) +``` + +Signs the provided digest using the golden touch mechanism. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ---------------------------------------- | +| digest | bytes32 | The hash of the data to be signed. | +| k | uint8 | The selector for signature optimization. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | --------------------------------- | +| v | uint8 | The recovery id. | +| r | uint256 | The r component of the signature. | +| s | uint256 | The s component of the signature. | diff --git a/packages/website/pages/docs/reference/contract-documentation/bridge/Bridge.md b/packages/website/pages/docs/reference/contract-documentation/bridge/Bridge.md new file mode 100644 index 00000000000..f11de0489a6 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/bridge/Bridge.md @@ -0,0 +1,312 @@ +--- +title: Bridge +--- + +## Bridge + +See the documentation for {IBridge}. + +_The code hash for the same address on L1 and L2 may be different._ + +### MessageStatusChanged + +```solidity +event MessageStatusChanged(bytes32 msgHash, enum LibBridgeStatus.MessageStatus status, address transactor) +``` + +### DestChainEnabled + +```solidity +event DestChainEnabled(uint256 chainId, bool enabled) +``` + +### receive + +```solidity +receive() external payable +``` + +### init + +```solidity +function init(address _addressManager) external +``` + +Initializes the contract. + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | --------------------------------------------- | +| \_addressManager | address | The address of the {AddressManager} contract. | + +### sendMessage + +```solidity +function sendMessage(struct IBridge.Message message) external payable returns (bytes32 msgHash) +``` + +Sends a message from the current chain to the destination chain +specified in the message. + +#### Parameters + +| Name | Type | Description | +| ------- | ---------------------- | ----------------------- | +| message | struct IBridge.Message | The message to be sent. | + +#### Return Values + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| msgHash | bytes32 | The hash of the sent message. | + +### processMessage + +```solidity +function processMessage(struct IBridge.Message message, bytes proof) external +``` + +Processes a message received from another chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ---------------------- | -------------------------------------- | +| message | struct IBridge.Message | The message to process. | +| proof | bytes | The proof of the cross-chain transfer. | + +### retryMessage + +```solidity +function retryMessage(struct IBridge.Message message, bool isLastAttempt) external +``` + +Retries executing a message that previously failed on its +destination chain. + +#### Parameters + +| Name | Type | Description | +| ------------- | ---------------------- | --------------------------------------------------------------- | +| message | struct IBridge.Message | The message to retry. | +| isLastAttempt | bool | Specifies whether this is the last attempt to send the message. | + +### recallMessage + +```solidity +function recallMessage(struct IBridge.Message message, bytes proof) external +``` + +Recalls a failed message on its source chain + +#### Parameters + +| Name | Type | Description | +| ------- | ---------------------- | ---------------------------------------- | +| message | struct IBridge.Message | The message to be recalled. | +| proof | bytes | The proof of message processing failure. | + +### isMessageSent + +```solidity +function isMessageSent(bytes32 msgHash) public view virtual returns (bool) +``` + +Checks if the message with the given hash has been sent on its +source chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------ | +| msgHash | bytes32 | The hash of the message. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | ----------------------------------------------------------- | +| [0] | bool | Returns true if the message has been sent, false otherwise. | + +### isMessageReceived + +```solidity +function isMessageReceived(bytes32 msgHash, uint256 srcChainId, bytes proof) public view virtual returns (bool) +``` + +Checks if the message with the given hash has been received on +its destination chain. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------------------------- | +| msgHash | bytes32 | The hash of the message. | +| srcChainId | uint256 | The source chain ID. | +| proof | bytes | The proof of message receipt. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | --------------------------------------------------------------- | +| [0] | bool | Returns true if the message has been received, false otherwise. | + +### isMessageFailed + +```solidity +function isMessageFailed(bytes32 msgHash, uint256 destChainId, bytes proof) public view virtual returns (bool) +``` + +Checks if a msgHash has failed on its destination chain. + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------------------------- | +| msgHash | bytes32 | The hash of the message. | +| destChainId | uint256 | The destination chain ID. | +| proof | bytes | The proof of message failure. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | -------------------------------------------------------- | +| [0] | bool | Returns true if the message has failed, false otherwise. | + +### isMessageRecalled + +```solidity +function isMessageRecalled(bytes32 msgHash) public view returns (bool) +``` + +Checks if a failed message has been recalled on its source +chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------ | +| msgHash | bytes32 | The hash of the message. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | ------------------------------------------------------------- | +| [0] | bool | Returns true if the Ether has been released, false otherwise. | + +### getMessageStatus + +```solidity +function getMessageStatus(bytes32 msgHash) public view virtual returns (enum LibBridgeStatus.MessageStatus) +``` + +Gets the execution status of the message with the given hash on +its destination chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------ | +| msgHash | bytes32 | The hash of the message. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---------------------------------- | ---------------------------------- | +| [0] | enum LibBridgeStatus.MessageStatus | Returns the status of the message. | + +### context + +```solidity +function context() public view returns (struct IBridge.Context) +``` + +Gets the current context. + +#### Return Values + +| Name | Type | Description | +| ---- | ---------------------- | ----------- | +| [0] | struct IBridge.Context | | + +### isDestChainEnabled + +```solidity +function isDestChainEnabled(uint256 _chainId) public view returns (bool enabled) +``` + +Checks if the destination chain with the given ID is enabled. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------- | +| \_chainId | uint256 | The ID of the chain. | + +#### Return Values + +| Name | Type | Description | +| ------- | ---- | ------------------------------------------------------------------ | +| enabled | bool | Returns true if the destination chain is enabled, false otherwise. | + +### hashMessage + +```solidity +function hashMessage(struct IBridge.Message message) public pure returns (bytes32) +``` + +Computes the hash of a given message. + +#### Parameters + +| Name | Type | Description | +| ------- | ---------------------- | ------------------------------------ | +| message | struct IBridge.Message | The message to compute the hash for. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | -------------------------------- | +| [0] | bytes32 | Returns the hash of the message. | + +### getMessageStatusSlot + +```solidity +function getMessageStatusSlot(bytes32 msgHash) public pure returns (bytes32) +``` + +Gets the slot associated with a given message hash status. + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------ | +| msgHash | bytes32 | The hash of the message. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | --------------------------------------------------------------- | +| [0] | bytes32 | Returns the slot associated with the given message hash status. | + +### shouldCheckProof + +```solidity +function shouldCheckProof() internal pure virtual returns (bool) +``` + +Tells if we need to check real proof or it is a test. + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | ------------------------------------------------------------ | +| [0] | bool | Returns true if this contract, or can be false if mock/test. | + +--- + +## title: ProxiedBridge + +## ProxiedBridge + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/bridge/BridgeErrors.md b/packages/website/pages/docs/reference/contract-documentation/bridge/BridgeErrors.md new file mode 100644 index 00000000000..718cf3f1851 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/bridge/BridgeErrors.md @@ -0,0 +1,134 @@ +--- +title: BridgeErrors +--- + +## BridgeErrors + +_This abstract contract defines custom errors that are used throughout +the Bridge contract._ + +### B_DENIED + +```solidity +error B_DENIED() +``` + +### B_ERC20_CANNOT_RECEIVE + +```solidity +error B_ERC20_CANNOT_RECEIVE() +``` + +### B_MSG_RECALLED_ALREADY + +```solidity +error B_MSG_RECALLED_ALREADY() +``` + +### B_EV_DO_NOT_BURN + +```solidity +error B_EV_DO_NOT_BURN() +``` + +### B_EV_NOT_AUTHORIZED + +```solidity +error B_EV_NOT_AUTHORIZED() +``` + +### B_EV_PARAM + +```solidity +error B_EV_PARAM() +``` + +### B_FAILED_TRANSFER + +```solidity +error B_FAILED_TRANSFER() +``` + +### B_FORBIDDEN + +```solidity +error B_FORBIDDEN() +``` + +### B_GAS_LIMIT + +```solidity +error B_GAS_LIMIT() +``` + +### B_INCORRECT_VALUE + +```solidity +error B_INCORRECT_VALUE() +``` + +### B_INIT_PARAM_ERROR + +```solidity +error B_INIT_PARAM_ERROR() +``` + +### B_MSG_HASH_NULL + +```solidity +error B_MSG_HASH_NULL() +``` + +### B_MSG_NON_RETRIABLE + +```solidity +error B_MSG_NON_RETRIABLE() +``` + +### B_MSG_NOT_FAILED + +```solidity +error B_MSG_NOT_FAILED() +``` + +### B_NULL_APP_ADDR + +```solidity +error B_NULL_APP_ADDR() +``` + +### B_USER_IS_NULL + +```solidity +error B_USER_IS_NULL() +``` + +### B_SIGNAL_NOT_RECEIVED + +```solidity +error B_SIGNAL_NOT_RECEIVED() +``` + +### B_STATUS_MISMATCH + +```solidity +error B_STATUS_MISMATCH() +``` + +### B_WRONG_CHAIN_ID + +```solidity +error B_WRONG_CHAIN_ID() +``` + +### B_WRONG_TO_ADDRESS + +```solidity +error B_WRONG_TO_ADDRESS() +``` + +### B_ZERO_SIGNAL + +```solidity +error B_ZERO_SIGNAL() +``` diff --git a/packages/website/pages/docs/reference/contract-documentation/bridge/EtherVault.md b/packages/website/pages/docs/reference/contract-documentation/bridge/EtherVault.md new file mode 100644 index 00000000000..b9656c2b248 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/bridge/EtherVault.md @@ -0,0 +1,121 @@ +--- +title: EtherVault +--- + +## EtherVault + +This contract is initialized with 2^128 Ether and allows authorized +addresses to release Ether. + +_Only the contract owner can authorize or deauthorize addresses._ + +### Authorized + +```solidity +event Authorized(address addr, bool authorized) +``` + +### EtherReleased + +```solidity +event EtherReleased(address to, uint256 amount) +``` + +### onlyAuthorized + +```solidity +modifier onlyAuthorized() +``` + +### receive + +```solidity +receive() external payable +``` + +Function to receive Ether. + +_Only authorized addresses can send Ether to the contract._ + +### init + +```solidity +function init(address addressManager) external +``` + +Initializes the contract with an {AddressManager}. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | --------------------------------------------- | +| addressManager | address | The address of the {AddressManager} contract. | + +### releaseEther + +```solidity +function releaseEther(uint256 amount) public +``` + +Transfers Ether from EtherVault to the sender, checking that the +sender is authorized. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ------------------------ | +| amount | uint256 | Amount of Ether to send. | + +### releaseEther + +```solidity +function releaseEther(address recipient, uint256 amount) public +``` + +Transfers Ether from EtherVault to a designated address, +checking that the sender is authorized. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ------------------------- | +| recipient | address | Address to receive Ether. | +| amount | uint256 | Amount of ether to send. | + +### authorize + +```solidity +function authorize(address addr, bool authorized) public +``` + +Sets the authorized status of an address, only the owner can +call this function. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ---------------------------------------- | +| addr | address | Address to set the authorized status of. | +| authorized | bool | Authorized status to set. | + +### isAuthorized + +```solidity +function isAuthorized(address addr) public view returns (bool) +``` + +Gets the authorized status of an address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ---------------------------------------- | +| addr | address | Address to get the authorized status of. | + +--- + +## title: ProxiedEtherVault + +## ProxiedEtherVault + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/bridge/IBridge.md b/packages/website/pages/docs/reference/contract-documentation/bridge/IBridge.md new file mode 100644 index 00000000000..38c9675639f --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/bridge/IBridge.md @@ -0,0 +1,259 @@ +--- +title: IRecallableMessageSender +--- + +## IRecallableMessageSender + +An interface that all recallable message senders shall implement. + +### onMessageRecalled + +```solidity +function onMessageRecalled(struct IBridge.Message message) external payable +``` + +--- + +## title: IBridge + +## IBridge + +The bridge used in conjunction with the {ISignalService}. + +_Ether is held by Bridges on L1 and by the EtherVault on L2, +not by token vaults._ + +### Message + +```solidity +struct Message { + uint256 id; + address from; + uint256 srcChainId; + uint256 destChainId; + address user; + address to; + address refundTo; + uint256 value; + uint256 fee; + uint256 gasLimit; + bytes data; + string memo; +} +``` + +### Context + +```solidity +struct Context { + bytes32 msgHash; + address from; + uint256 srcChainId; +} +``` + +### SignalSent + +```solidity +event SignalSent(address sender, bytes32 msgHash) +``` + +### MessageSent + +```solidity +event MessageSent(bytes32 msgHash, struct IBridge.Message message) +``` + +### MessageRecalled + +```solidity +event MessageRecalled(bytes32 msgHash) +``` + +### sendMessage + +```solidity +function sendMessage(struct IBridge.Message message) external payable returns (bytes32 msgHash) +``` + +Sends a message to the destination chain and takes custody +of Ether required in this contract. All extra Ether will be refunded. + +#### Parameters + +| Name | Type | Description | +| ------- | ---------------------- | ----------------------- | +| message | struct IBridge.Message | The message to be sent. | + +#### Return Values + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| msgHash | bytes32 | The hash of the sent message. | + +### processMessage + +```solidity +function processMessage(struct IBridge.Message message, bytes proof) external +``` + +Processes a message received from another chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ---------------------- | -------------------------------------- | +| message | struct IBridge.Message | The message to process. | +| proof | bytes | The proof of the cross-chain transfer. | + +### retryMessage + +```solidity +function retryMessage(struct IBridge.Message message, bool isLastAttempt) external +``` + +Retries executing a message that previously failed on its +destination chain. + +#### Parameters + +| Name | Type | Description | +| ------------- | ---------------------- | --------------------------------------------------------------- | +| message | struct IBridge.Message | The message to retry. | +| isLastAttempt | bool | Specifies whether this is the last attempt to send the message. | + +### recallMessage + +```solidity +function recallMessage(struct IBridge.Message message, bytes proof) external +``` + +Recalls a failed message on its source chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ---------------------- | ---------------------------------------- | +| message | struct IBridge.Message | The message to be recalled. | +| proof | bytes | The proof of message processing failure. | + +### isMessageSent + +```solidity +function isMessageSent(bytes32 msgHash) external view returns (bool) +``` + +Checks if the message with the given hash has been sent on its +source chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------ | +| msgHash | bytes32 | The hash of the message. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | ----------------------------------------------------------- | +| [0] | bool | Returns true if the message has been sent, false otherwise. | + +### isMessageReceived + +```solidity +function isMessageReceived(bytes32 msgHash, uint256 srcChainId, bytes proof) external view returns (bool) +``` + +Checks if the message with the given hash has been received on +its destination chain. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------------------------- | +| msgHash | bytes32 | The hash of the message. | +| srcChainId | uint256 | The source chain ID. | +| proof | bytes | The proof of message receipt. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | --------------------------------------------------------------- | +| [0] | bool | Returns true if the message has been received, false otherwise. | + +### isMessageFailed + +```solidity +function isMessageFailed(bytes32 msgHash, uint256 destChainId, bytes proof) external view returns (bool) +``` + +Checks if a msgHash has failed on its destination chain. + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------------------------- | +| msgHash | bytes32 | The hash of the message. | +| destChainId | uint256 | The destination chain ID. | +| proof | bytes | The proof of message failure. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | -------------------------------------------------------- | +| [0] | bool | Returns true if the message has failed, false otherwise. | + +### isMessageRecalled + +```solidity +function isMessageRecalled(bytes32 msgHash) external view returns (bool) +``` + +Checks if a failed message has been recalled on its source +chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------ | +| msgHash | bytes32 | The hash of the message. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | ------------------------------------------------------------- | +| [0] | bool | Returns true if the Ether has been released, false otherwise. | + +### context + +```solidity +function context() external view returns (struct IBridge.Context context) +``` + +Returns the bridge state context. + +#### Return Values + +| Name | Type | Description | +| ------- | ---------------------- | -------------------------------------------- | +| context | struct IBridge.Context | The context of the current bridge operation. | + +### hashMessage + +```solidity +function hashMessage(struct IBridge.Message message) external pure returns (bytes32) +``` + +Computes the hash of a given message. + +#### Parameters + +| Name | Type | Description | +| ------- | ---------------------- | ------------------------------------ | +| message | struct IBridge.Message | The message to compute the hash for. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | -------------------------------- | +| [0] | bytes32 | Returns the hash of the message. | diff --git a/packages/website/pages/docs/reference/contract-documentation/common/AddressManager.md b/packages/website/pages/docs/reference/contract-documentation/common/AddressManager.md new file mode 100644 index 00000000000..7e660fe124a --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/common/AddressManager.md @@ -0,0 +1,118 @@ +--- +title: IAddressManager +--- + +## IAddressManager + +Specifies methods to manage address mappings for given domain-name +pairs. + +### setAddress + +```solidity +function setAddress(uint256 domain, bytes32 name, address newAddress) external +``` + +Sets the address for a specific domain-name pair. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------------------------------------------- | +| domain | uint256 | The domain to which the address will be mapped. | +| name | bytes32 | The name to which the address will be mapped. | +| newAddress | address | The Ethereum address to be mapped. | + +### getAddress + +```solidity +function getAddress(uint256 domain, bytes32 name) external view returns (address) +``` + +Gets the address mapped to a specific domain-name pair. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------------------------------------------------- | +| domain | uint256 | The domain for which the address needs to be fetched. | +| name | bytes32 | The name for which the address needs to be fetched. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | --------------------------------------------- | +| [0] | address | Address associated with the domain-name pair. | + +--- + +## title: AddressManager + +## AddressManager + +Manages a mapping of domain-name pairs to Ethereum addresses. + +### AddressSet + +```solidity +event AddressSet(uint256 domain, bytes32 name, address newAddress, address oldAddress) +``` + +### EOA_OWNER_NOT_ALLOWED + +```solidity +error EOA_OWNER_NOT_ALLOWED() +``` + +### init + +```solidity +function init() external +``` + +Initializes the owner for the upgradable contract. + +### setAddress + +```solidity +function setAddress(uint256 domain, bytes32 name, address newAddress) external virtual +``` + +Sets the address for a specific domain-name pair. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------------------------------------------- | +| domain | uint256 | The domain to which the address will be mapped. | +| name | bytes32 | The name to which the address will be mapped. | +| newAddress | address | The Ethereum address to be mapped. | + +### getAddress + +```solidity +function getAddress(uint256 domain, bytes32 name) external view virtual returns (address) +``` + +Gets the address mapped to a specific domain-name pair. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------------------------------------------------- | +| domain | uint256 | The domain for which the address needs to be fetched. | +| name | bytes32 | The name for which the address needs to be fetched. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | --------------------------------------------- | +| [0] | address | Address associated with the domain-name pair. | + +--- + +## title: ProxiedAddressManager + +## ProxiedAddressManager + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/common/AddressResolver.md b/packages/website/pages/docs/reference/contract-documentation/common/AddressResolver.md new file mode 100644 index 00000000000..3187e7ef44d --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/common/AddressResolver.md @@ -0,0 +1,134 @@ +--- +title: AddressResolver +--- + +## AddressResolver + +This contract acts as a bridge for name-to-address resolution. +It delegates the resolution to the AddressManager. By separating the logic, +we can maintain flexibility in address management without affecting the +resolving process. + +### \_addressManager + +```solidity +contract IAddressManager _addressManager +``` + +### AddressManagerChanged + +```solidity +event AddressManagerChanged(address addressManager) +``` + +### RESOLVER_DENIED + +```solidity +error RESOLVER_DENIED() +``` + +### RESOLVER_INVALID_ADDR + +```solidity +error RESOLVER_INVALID_ADDR() +``` + +### RESOLVER_ZERO_ADDR + +```solidity +error RESOLVER_ZERO_ADDR(uint256 chainId, bytes32 name) +``` + +### onlyFromNamed + +```solidity +modifier onlyFromNamed(bytes32 name) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | -------------------------- | +| name | bytes32 | The name to check against. | + +### onlyFromNamed2 + +```solidity +modifier onlyFromNamed2(bytes32 name1, bytes32 name2) +``` + +#### Parameters + +| Name | Type | Description | +| ----- | ------- | --------------------------------- | +| name1 | bytes32 | The first name to check against. | +| name2 | bytes32 | The second name to check against. | + +### resolve + +```solidity +function resolve(bytes32 name, bool allowZeroAddress) public view virtual returns (address payable addr) +``` + +Resolves a name to its address on the current chain. + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------------------------------------------------------------------- | +| name | bytes32 | Name whose address is to be resolved. | +| allowZeroAddress | bool | If set to true, does not throw if the resolved address is `address(0)`. | + +#### Return Values + +| Name | Type | Description | +| ---- | --------------- | --------------------------------------- | +| addr | address payable | Address associated with the given name. | + +### resolve + +```solidity +function resolve(uint256 chainId, bytes32 name, bool allowZeroAddress) public view virtual returns (address payable addr) +``` + +Resolves a name to its address on a specified chain. + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------------------------------------------------------------------- | +| chainId | uint256 | The chainId of interest. | +| name | bytes32 | Name whose address is to be resolved. | +| allowZeroAddress | bool | If set to true, does not throw if the resolved address is `address(0)`. | + +#### Return Values + +| Name | Type | Description | +| ---- | --------------- | -------------------------------------------------------------- | +| addr | address payable | Address associated with the given name on the specified chain. | + +### addressManager + +```solidity +function addressManager() public view returns (address) +``` + +Fetches the AddressManager's address. + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | ------------------------------------------ | +| [0] | address | The current address of the AddressManager. | + +### \_init + +```solidity +function _init(address addressManager_) internal virtual +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ------------------------------ | +| addressManager\_ | address | Address of the AddressManager. | diff --git a/packages/website/pages/docs/reference/contract-documentation/common/ICrossChainSync.md b/packages/website/pages/docs/reference/contract-documentation/common/ICrossChainSync.md new file mode 100644 index 00000000000..70da0e6618d --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/common/ICrossChainSync.md @@ -0,0 +1,68 @@ +--- +title: ICrossChainSync +--- + +## ICrossChainSync + +_This interface is implemented by both the TaikoL1 and TaikoL2 +contracts. +It outlines the essential methods required for synchronizing and accessing +block hashes across chains. The core idea is to ensure that data between +both chains remain consistent and can be cross-referenced with integrity._ + +### CrossChainSynced + +```solidity +event CrossChainSynced(uint64 srcHeight, bytes32 blockHash, bytes32 signalRoot) +``` + +_Emitted when a block has been synced across chains._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------------------------------------------- | +| srcHeight | uint64 | The height (block id\_ that was synced. | +| blockHash | bytes32 | The hash of the synced block. | +| signalRoot | bytes32 | The root hash representing cross-chain signals. | + +### getCrossChainBlockHash + +```solidity +function getCrossChainBlockHash(uint64 blockId) external view returns (bytes32) +``` + +Fetches the hash of a block from the opposite chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ------ | ------------------------------------------------------------------------- | +| blockId | uint64 | The target block id. Specifying 0 retrieves the hash of the latest block. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | --------------------------------------------------- | +| [0] | bytes32 | The hash of the desired block from the other chain. | + +### getCrossChainSignalRoot + +```solidity +function getCrossChainSignalRoot(uint64 blockId) external view returns (bytes32) +``` + +Retrieves the root hash of the signal service storage for a +given block from the opposite chain. + +#### Parameters + +| Name | Type | Description | +| ------- | ------ | ------------------------------------------------------------------------- | +| blockId | uint64 | The target block id. Specifying 0 retrieves the root of the latest block. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | ------------------------------------------------------- | +| [0] | bytes32 | The root hash for the specified block's signal service. | diff --git a/packages/website/pages/docs/reference/contract-documentation/common/IMintableERC20.md b/packages/website/pages/docs/reference/contract-documentation/common/IMintableERC20.md new file mode 100644 index 00000000000..0553e97ba44 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/common/IMintableERC20.md @@ -0,0 +1,37 @@ +--- +title: IMintableERC20 +--- + +## IMintableERC20 + +Interface for ERC20 tokens with mint and burn functionality. + +### mint + +```solidity +function mint(address account, uint256 amount) external +``` + +Mints `amount` tokens and assigns them to the `account` address. + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------------------- | +| account | address | The account to receive the minted tokens. | +| amount | uint256 | The amount of tokens to mint. | + +### burn + +```solidity +function burn(address from, uint256 amount) external +``` + +Burns `amount` tokens from the `from` address. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ------------------------------------------------- | +| from | address | The account from which the tokens will be burned. | +| amount | uint256 | The amount of tokens to burn. | diff --git a/packages/website/pages/docs/reference/contract-documentation/common/Proxied.md b/packages/website/pages/docs/reference/contract-documentation/common/Proxied.md new file mode 100644 index 00000000000..8f9f5e9082f --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/common/Proxied.md @@ -0,0 +1,15 @@ +--- +title: Proxied +--- + +## Proxied + +_This abstract contract extends Initializable from OpenZeppelin's +upgradeable contracts library. It is intended to be used for proxy pattern +implementations where constructors are non-traditional._ + +### constructor + +```solidity +constructor() internal +``` diff --git a/packages/website/pages/docs/reference/contract-documentation/signal/ISignalService.md b/packages/website/pages/docs/reference/contract-documentation/signal/ISignalService.md new file mode 100644 index 00000000000..d8e81e2eeac --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/signal/ISignalService.md @@ -0,0 +1,77 @@ +--- +title: ISignalService +--- + +## ISignalService + +The SignalService contract serves as a secure cross-chain message +passing system. It defines methods for sending and verifying signals with +merkle proofs. The trust assumption is that the target chain has secure +access to the merkle root (such as Taiko injects it in the anchor +transaction). With this, verifying a signal is reduced to simply verifying +a merkle proof. + +### sendSignal + +```solidity +function sendSignal(bytes32 signal) external returns (bytes32 storageSlot) +``` + +Send a signal (message) by setting the storage slot to a value +of 1. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------------------------- | +| signal | bytes32 | The signal (message) to send. | + +#### Return Values + +| Name | Type | Description | +| ----------- | ------- | ---------------------------------------------------- | +| storageSlot | bytes32 | The location in storage where this signal is stored. | + +### isSignalSent + +```solidity +function isSignalSent(address app, bytes32 signal) external view returns (bool) +``` + +Verifies if a particular signal has already been sent. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | -------------------------------------- | +| app | address | The address that initiated the signal. | +| signal | bytes32 | The signal (message) to send. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | -------------------------------------------------- | +| [0] | bool | True if the signal has been sent, otherwise false. | + +### isSignalReceived + +```solidity +function isSignalReceived(uint256 srcChainId, address app, bytes32 signal, bytes proof) external view returns (bool) +``` + +Verifies if a signal has been received on the target chain. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | --------------------------------------------------------------------- | +| srcChainId | uint256 | The identifier for the source chain from which the signal originated. | +| app | address | The address that initiated the signal. | +| signal | bytes32 | The signal (message) to send. | +| proof | bytes | Merkle proof that the signal was persisted on the source chain. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | ------------------------------------------------------ | +| [0] | bool | True if the signal has been received, otherwise false. | diff --git a/packages/website/pages/docs/reference/contract-documentation/signal/SignalService.md b/packages/website/pages/docs/reference/contract-documentation/signal/SignalService.md new file mode 100644 index 00000000000..97b3a0b285c --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/signal/SignalService.md @@ -0,0 +1,154 @@ +--- +title: SignalService +--- + +## SignalService + +See the documentation in {ISignalService} for more details. + +### SignalProof + +```solidity +struct SignalProof { + uint64 height; + bytes proof; +} +``` + +### B_ZERO_SIGNAL + +```solidity +error B_ZERO_SIGNAL() +``` + +### B_NULL_APP_ADDR + +```solidity +error B_NULL_APP_ADDR() +``` + +### B_WRONG_CHAIN_ID + +```solidity +error B_WRONG_CHAIN_ID() +``` + +### validApp + +```solidity +modifier validApp(address app) +``` + +### validSignal + +```solidity +modifier validSignal(bytes32 signal) +``` + +### validChainId + +```solidity +modifier validChainId(uint256 srcChainId) +``` + +### init + +```solidity +function init(address _addressManager) external +``` + +_Initializer to be called after being deployed behind a proxy._ + +### sendSignal + +```solidity +function sendSignal(bytes32 signal) public returns (bytes32 storageSlot) +``` + +Send a signal (message) by setting the storage slot to a value +of 1. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------------------------- | +| signal | bytes32 | The signal (message) to send. | + +#### Return Values + +| Name | Type | Description | +| ----------- | ------- | ---------------------------------------------------- | +| storageSlot | bytes32 | The location in storage where this signal is stored. | + +### isSignalSent + +```solidity +function isSignalSent(address app, bytes32 signal) public view returns (bool) +``` + +Verifies if a particular signal has already been sent. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | -------------------------------------- | +| app | address | The address that initiated the signal. | +| signal | bytes32 | The signal (message) to send. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | -------------------------------------------------- | +| [0] | bool | True if the signal has been sent, otherwise false. | + +### isSignalReceived + +```solidity +function isSignalReceived(uint256 srcChainId, address app, bytes32 signal, bytes proof) public view returns (bool) +``` + +Verifies if a signal has been received on the target chain. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | --------------------------------------------------------------------- | +| srcChainId | uint256 | The identifier for the source chain from which the signal originated. | +| app | address | The address that initiated the signal. | +| signal | bytes32 | The signal (message) to send. | +| proof | bytes | Merkle proof that the signal was persisted on the source chain. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | ------------------------------------------------------ | +| [0] | bool | True if the signal has been received, otherwise false. | + +### getSignalSlot + +```solidity +function getSignalSlot(address app, bytes32 signal) public pure returns (bytes32 signalSlot) +``` + +Get the storage slot of the signal. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | -------------------------------------- | +| app | address | The address that initiated the signal. | +| signal | bytes32 | The signal to get the storage slot of. | + +#### Return Values + +| Name | Type | Description | +| ---------- | ------- | ---------------------------------------------------------------------------------------------------------------- | +| signalSlot | bytes32 | The unique storage slot of the signal which is created by encoding the sender address with the signal (message). | + +--- + +## title: ProxiedSignalService + +## ProxiedSignalService + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/tokenvault/BaseNFTVault.md b/packages/website/pages/docs/reference/contract-documentation/tokenvault/BaseNFTVault.md new file mode 100644 index 00000000000..c827e9c3eab --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/tokenvault/BaseNFTVault.md @@ -0,0 +1,168 @@ +--- +title: BaseNFTVault +--- + +## BaseNFTVault + +Abstract contract for bridging NFTs across different chains. + +### CanonicalNFT + +```solidity +struct CanonicalNFT { + uint256 chainId; + address addr; + string symbol; + string name; +} +``` + +### BridgeTransferOp + +```solidity +struct BridgeTransferOp { + uint256 destChainId; + address to; + address token; + uint256[] tokenIds; + uint256[] amounts; + uint256 gasLimit; + uint256 fee; + address refundTo; + string memo; +} +``` + +### ERC1155_INTERFACE_ID + +```solidity +bytes4 ERC1155_INTERFACE_ID +``` + +### ERC721_INTERFACE_ID + +```solidity +bytes4 ERC721_INTERFACE_ID +``` + +### isBridgedToken + +```solidity +mapping(address => bool) isBridgedToken +``` + +### bridgedToCanonical + +```solidity +mapping(address => struct BaseNFTVault.CanonicalNFT) bridgedToCanonical +``` + +### canonicalToBridged + +```solidity +mapping(uint256 => mapping(address => address)) canonicalToBridged +``` + +### BridgedTokenDeployed + +```solidity +event BridgedTokenDeployed(uint256 chainId, address ctoken, address btoken, string ctokenSymbol, string ctokenName) +``` + +### TokenSent + +```solidity +event TokenSent(bytes32 msgHash, address from, address to, uint256 destChainId, address token, uint256[] tokenIds, uint256[] amounts) +``` + +### TokenReleased + +```solidity +event TokenReleased(bytes32 msgHash, address from, address token, uint256[] tokenIds, uint256[] amounts) +``` + +### TokenReceived + +```solidity +event TokenReceived(bytes32 msgHash, address from, address to, uint256 srcChainId, address token, uint256[] tokenIds, uint256[] amounts) +``` + +### VAULT_INVALID_TO + +```solidity +error VAULT_INVALID_TO() +``` + +### VAULT_INVALID_TOKEN + +```solidity +error VAULT_INVALID_TOKEN() +``` + +### VAULT_INVALID_AMOUNT + +```solidity +error VAULT_INVALID_AMOUNT() +``` + +### VAULT_INVALID_USER + +```solidity +error VAULT_INVALID_USER() +``` + +### VAULT_INVALID_FROM + +```solidity +error VAULT_INVALID_FROM() +``` + +### VAULT_INVALID_SRC_CHAIN_ID + +```solidity +error VAULT_INVALID_SRC_CHAIN_ID() +``` + +### VAULT_INTERFACE_NOT_SUPPORTED + +```solidity +error VAULT_INTERFACE_NOT_SUPPORTED() +``` + +### VAULT_MESSAGE_NOT_FAILED + +```solidity +error VAULT_MESSAGE_NOT_FAILED() +``` + +### VAULT_MESSAGE_RELEASED_ALREADY + +```solidity +error VAULT_MESSAGE_RELEASED_ALREADY() +``` + +### VAULT_TOKEN_ARRAY_MISMATCH + +```solidity +error VAULT_TOKEN_ARRAY_MISMATCH() +``` + +### VAULT_MAX_TOKEN_PER_TXN_EXCEEDED + +```solidity +error VAULT_MAX_TOKEN_PER_TXN_EXCEEDED() +``` + +### init + +```solidity +function init(address addressManager) external +``` + +Initializes the contract with an address manager. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------------------------------- | +| addressManager | address | The address of the address manager. | diff --git a/packages/website/pages/docs/reference/contract-documentation/tokenvault/BridgedERC1155.md b/packages/website/pages/docs/reference/contract-documentation/tokenvault/BridgedERC1155.md new file mode 100644 index 00000000000..df8c7cd80fc --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/tokenvault/BridgedERC1155.md @@ -0,0 +1,133 @@ +--- +title: BridgedERC1155 +--- + +## BridgedERC1155 + +Contract for bridging ERC1155 tokens across different chains. + +### srcToken + +```solidity +address srcToken +``` + +### srcChainId + +```solidity +uint256 srcChainId +``` + +### symbol + +```solidity +string symbol +``` + +### Transfer + +```solidity +event Transfer(address from, address to, uint256 tokenId, uint256 amount) +``` + +### BRIDGED_TOKEN_CANNOT_RECEIVE + +```solidity +error BRIDGED_TOKEN_CANNOT_RECEIVE() +``` + +### BRIDGED_TOKEN_INVALID_PARAMS + +```solidity +error BRIDGED_TOKEN_INVALID_PARAMS() +``` + +### init + +```solidity +function init(address _addressManager, address _srcToken, uint256 _srcChainId, string _symbol, string _name) external +``` + +_Initializer function to be called after deployment._ + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------------------------------- | +| \_addressManager | address | The address of the address manager. | +| \_srcToken | address | Address of the source token. | +| \_srcChainId | uint256 | Source chain ID. | +| \_symbol | string | Symbol of the bridged token. | +| \_name | string | Name of the bridged token. | + +### mint + +```solidity +function mint(address account, uint256 tokenId, uint256 amount) public +``` + +_Mints tokens._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------------------- | +| account | address | Address to receive the minted tokens. | +| tokenId | uint256 | ID of the token to mint. | +| amount | uint256 | Amount of tokens to mint. | + +### burn + +```solidity +function burn(address account, uint256 tokenId, uint256 amount) public +``` + +_Burns tokens._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------------------- | +| account | address | Address from which tokens are burned. | +| tokenId | uint256 | ID of the token to burn. | +| amount | uint256 | Amount of tokens to burn. | + +### safeTransferFrom + +```solidity +function safeTransferFrom(address from, address to, uint256 tokenId, uint256 amount, bytes data) public +``` + +_Safely transfers tokens from one address to another._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------------------------ | +| from | address | Address from which tokens are transferred. | +| to | address | Address to which tokens are transferred. | +| tokenId | uint256 | ID of the token to transfer. | +| amount | uint256 | Amount of tokens to transfer. | +| data | bytes | Additional data. | + +### name + +```solidity +function name() public view returns (string) +``` + +Gets the concatenated name of the bridged token. + +#### Return Values + +| Name | Type | Description | +| ---- | ------ | ---------------------- | +| [0] | string | The concatenated name. | + +--- + +## title: ProxiedBridgedERC1155 + +## ProxiedBridgedERC1155 + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/tokenvault/BridgedERC20.md b/packages/website/pages/docs/reference/contract-documentation/tokenvault/BridgedERC20.md new file mode 100644 index 00000000000..7d29261e3e1 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/tokenvault/BridgedERC20.md @@ -0,0 +1,176 @@ +--- +title: BridgedERC20 +--- + +## BridgedERC20 + +An upgradeable ERC20 contract that represents tokens bridged from +another chain. + +### srcToken + +```solidity +address srcToken +``` + +### srcChainId + +```solidity +uint256 srcChainId +``` + +### BRIDGED_TOKEN_CANNOT_RECEIVE + +```solidity +error BRIDGED_TOKEN_CANNOT_RECEIVE() +``` + +### BRIDGED_TOKEN_INVALID_PARAMS + +```solidity +error BRIDGED_TOKEN_INVALID_PARAMS() +``` + +### init + +```solidity +function init(address _addressManager, address _srcToken, uint256 _srcChainId, uint8 _decimals, string _symbol, string _name) external +``` + +Initializes the contract. + +_Different BridgedERC20 Contract is deployed per unique \_srcToken +(e.g., one for USDC, one for USDT, etc.)._ + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ------------------------------------------------- | +| \_addressManager | address | The address manager. | +| \_srcToken | address | The source token address. | +| \_srcChainId | uint256 | The source chain ID. | +| \_decimals | uint8 | The number of decimal places of the source token. | +| \_symbol | string | The symbol of the token. | +| \_name | string | The name of the token. | + +### mint + +```solidity +function mint(address account, uint256 amount) public +``` + +Mints tokens to an account. + +_Only an ERC20Vault can call this function._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------------ | +| account | address | The account to mint tokens to. | +| amount | uint256 | The amount of tokens to mint. | + +### burn + +```solidity +function burn(address account, uint256 amount) public +``` + +Burns tokens from an account. + +_Only an ERC20Vault can call this function._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | -------------------------------- | +| account | address | The account to burn tokens from. | +| amount | uint256 | The amount of tokens to burn. | + +### transfer + +```solidity +function transfer(address to, uint256 amount) public returns (bool) +``` + +Transfers tokens from the caller to another account. + +_Any address can call this. Caller must have at least 'amount' to +call this._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ---------------------------------- | +| to | address | The account to transfer tokens to. | +| amount | uint256 | The amount of tokens to transfer. | + +### transferFrom + +```solidity +function transferFrom(address from, address to, uint256 amount) public returns (bool) +``` + +Transfers tokens from one account to another account. + +_Any address can call this. Caller must have allowance of at least +'amount' for 'from's tokens._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ------------------------------------ | +| from | address | The account to transfer tokens from. | +| to | address | The account to transfer tokens to. | +| amount | uint256 | The amount of tokens to transfer. | + +### name + +```solidity +function name() public view returns (string) +``` + +Gets the name of the token. + +#### Return Values + +| Name | Type | Description | +| ---- | ------ | -------------------------------------------------------- | +| [0] | string | The name of the token with the source chain ID appended. | + +### decimals + +```solidity +function decimals() public view returns (uint8) +``` + +Gets the number of decimal places of the token. + +#### Return Values + +| Name | Type | Description | +| ---- | ----- | ------------------------------------------ | +| [0] | uint8 | The number of decimal places of the token. | + +### canonical + +```solidity +function canonical() public view returns (address, uint256) +``` + +Gets the canonical token's address and chain ID. + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | ------------------------------------------- | +| [0] | address | The canonical token's address and chain ID. | +| [1] | uint256 | | + +--- + +## title: ProxiedBridgedERC20 + +## ProxiedBridgedERC20 + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/tokenvault/BridgedERC721.md b/packages/website/pages/docs/reference/contract-documentation/tokenvault/BridgedERC721.md new file mode 100644 index 00000000000..887e430ba62 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/tokenvault/BridgedERC721.md @@ -0,0 +1,158 @@ +--- +title: BridgedERC721 +--- + +## BridgedERC721 + +Contract for bridging ERC721 tokens across different chains. + +### srcToken + +```solidity +address srcToken +``` + +### srcChainId + +```solidity +uint256 srcChainId +``` + +### BRIDGED_TOKEN_CANNOT_RECEIVE + +```solidity +error BRIDGED_TOKEN_CANNOT_RECEIVE() +``` + +### BRIDGED_TOKEN_INVALID_PARAMS + +```solidity +error BRIDGED_TOKEN_INVALID_PARAMS() +``` + +### BRIDGED_TOKEN_INVALID_BURN + +```solidity +error BRIDGED_TOKEN_INVALID_BURN() +``` + +### init + +```solidity +function init(address _addressManager, address _srcToken, uint256 _srcChainId, string _symbol, string _name) external +``` + +_Initializer function to be called after deployment._ + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------------------------------- | +| \_addressManager | address | The address of the address manager. | +| \_srcToken | address | Address of the source token. | +| \_srcChainId | uint256 | Source chain ID. | +| \_symbol | string | Symbol of the bridged token. | +| \_name | string | Name of the bridged token. | + +### mint + +```solidity +function mint(address account, uint256 tokenId) public +``` + +_Mints tokens._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------------------ | +| account | address | Address to receive the minted token. | +| tokenId | uint256 | ID of the token to mint. | + +### burn + +```solidity +function burn(address account, uint256 tokenId) public +``` + +_Burns tokens._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | --------------------------------------- | +| account | address | Address from which the token is burned. | +| tokenId | uint256 | ID of the token to burn. | + +### transferFrom + +```solidity +function transferFrom(address from, address to, uint256 tokenId) public +``` + +_Safely transfers tokens from one address to another._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | -------------------------------------------- | +| from | address | Address from which the token is transferred. | +| to | address | Address to which the token is transferred. | +| tokenId | uint256 | ID of the token to transfer. | + +### name + +```solidity +function name() public view returns (string) +``` + +Gets the concatenated name of the bridged token. + +#### Return Values + +| Name | Type | Description | +| ---- | ------ | ---------------------- | +| [0] | string | The concatenated name. | + +### source + +```solidity +function source() public view returns (address, uint256) +``` + +Gets the source token and source chain ID being bridged. + +#### Return Values + +| Name | Type | Description | +| ---- | ------- | ----------------------------------------- | +| [0] | address | Source token address and source chain ID. | +| [1] | uint256 | | + +### tokenURI + +```solidity +function tokenURI(uint256 tokenId) public pure virtual returns (string) +``` + +Returns an empty token URI. + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ---------------- | +| tokenId | uint256 | ID of the token. | + +#### Return Values + +| Name | Type | Description | +| ---- | ------ | ---------------- | +| [0] | string | An empty string. | + +--- + +## title: ProxiedBridgedERC721 + +## ProxiedBridgedERC721 + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/tokenvault/ERC1155Vault.md b/packages/website/pages/docs/reference/contract-documentation/tokenvault/ERC1155Vault.md new file mode 100644 index 00000000000..bbdd54f106c --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/tokenvault/ERC1155Vault.md @@ -0,0 +1,112 @@ +--- +title: ERC1155NameAndSymbol +--- + +## ERC1155NameAndSymbol + +Interface for ERC1155 contracts that provide name() and symbol() +functions. These functions may not be part of the official interface but are +used by +some contracts. + +### name + +```solidity +function name() external view returns (string) +``` + +### symbol + +```solidity +function symbol() external view returns (string) +``` + +--- + +## title: ERC1155Vault + +## ERC1155Vault + +This vault holds all ERC1155 tokens that users have deposited. +It also manages the mapping between canonical tokens and their bridged +tokens. + +### sendToken + +```solidity +function sendToken(struct BaseNFTVault.BridgeTransferOp opt) external payable +``` + +Transfers ERC1155 tokens to this vault and sends a message to +the destination chain so the user can receive the same (bridged) tokens +by invoking the message call. + +#### Parameters + +| Name | Type | Description | +| ---- | ------------------------------------ | ------------------------------------- | +| opt | struct BaseNFTVault.BridgeTransferOp | Option for sending the ERC1155 token. | + +### receiveToken + +```solidity +function receiveToken(struct BaseNFTVault.CanonicalNFT ctoken, address from, address to, uint256[] tokenIds, uint256[] amounts) external payable +``` + +This function can only be called by the bridge contract while +invoking a message call. See sendToken, which sets the data to invoke +this function. + +#### Parameters + +| Name | Type | Description | +| -------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | +| ctoken | struct BaseNFTVault.CanonicalNFT | The canonical ERC1155 token which may or may not live on this chain. If not, a BridgedERC1155 contract will be deployed. | +| from | address | The source address. | +| to | address | The destination address. | +| tokenIds | uint256[] | The tokenIds to be sent. | +| amounts | uint256[] | The amounts to be sent. | + +### onMessageRecalled + +```solidity +function onMessageRecalled(struct IBridge.Message message) external payable +``` + +Releases deposited ERC1155 token(s) back to the user on the +source chain with a proof that the message processing on the destination +Bridge has failed. + +#### Parameters + +| Name | Type | Description | +| ------- | ---------------------- | ------------------------------------------------------------------------ | +| message | struct IBridge.Message | The message that corresponds to the ERC1155 deposit on the source chain. | + +### onERC1155BatchReceived + +```solidity +function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external pure returns (bytes4) +``` + +### onERC1155Received + +```solidity +function onERC1155Received(address, address, uint256, uint256, bytes) external pure returns (bytes4) +``` + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) +``` + +_See {IERC165-supportsInterface}._ + +--- + +## title: ProxiedERC1155Vault + +## ProxiedERC1155Vault + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/tokenvault/ERC20Vault.md b/packages/website/pages/docs/reference/contract-documentation/tokenvault/ERC20Vault.md new file mode 100644 index 00000000000..f89e3127045 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/tokenvault/ERC20Vault.md @@ -0,0 +1,223 @@ +--- +title: ERC20Vault +--- + +## ERC20Vault + +This vault holds all ERC20 tokens (excluding Ether) that users have +deposited. It also manages the mapping between canonical ERC20 tokens and +their bridged tokens. + +### CanonicalERC20 + +```solidity +struct CanonicalERC20 { + uint256 chainId; + address addr; + uint8 decimals; + string symbol; + string name; +} +``` + +### BridgeTransferOp + +```solidity +struct BridgeTransferOp { + uint256 destChainId; + address to; + address token; + uint256 amount; + uint256 gasLimit; + uint256 fee; + address refundTo; + string memo; +} +``` + +### isBridgedToken + +```solidity +mapping(address => bool) isBridgedToken +``` + +### bridgedToCanonical + +```solidity +mapping(address => struct ERC20Vault.CanonicalERC20) bridgedToCanonical +``` + +### canonicalToBridged + +```solidity +mapping(uint256 => mapping(address => address)) canonicalToBridged +``` + +### BridgedTokenDeployed + +```solidity +event BridgedTokenDeployed(uint256 srcChainId, address ctoken, address btoken, string ctokenSymbol, string ctokenName, uint8 ctokenDecimal) +``` + +### TokenSent + +```solidity +event TokenSent(bytes32 msgHash, address from, address to, uint256 destChainId, address token, uint256 amount) +``` + +### TokenReleased + +```solidity +event TokenReleased(bytes32 msgHash, address from, address token, uint256 amount) +``` + +### TokenReceived + +```solidity +event TokenReceived(bytes32 msgHash, address from, address to, uint256 srcChainId, address token, uint256 amount) +``` + +### VAULT_INVALID_TO + +```solidity +error VAULT_INVALID_TO() +``` + +### VAULT_INVALID_TOKEN + +```solidity +error VAULT_INVALID_TOKEN() +``` + +### VAULT_INVALID_AMOUNT + +```solidity +error VAULT_INVALID_AMOUNT() +``` + +### VAULT_INVALID_USER + +```solidity +error VAULT_INVALID_USER() +``` + +### VAULT_INVALID_FROM + +```solidity +error VAULT_INVALID_FROM() +``` + +### VAULT_INVALID_SRC_CHAIN_ID + +```solidity +error VAULT_INVALID_SRC_CHAIN_ID() +``` + +### VAULT_MESSAGE_NOT_FAILED + +```solidity +error VAULT_MESSAGE_NOT_FAILED() +``` + +### VAULT_MESSAGE_RELEASED_ALREADY + +```solidity +error VAULT_MESSAGE_RELEASED_ALREADY() +``` + +### onlyValidAddresses + +```solidity +modifier onlyValidAddresses(uint256 chainId, bytes32 name, address to, address token) +``` + +### init + +```solidity +function init(address addressManager) external +``` + +Initializes the contract with the address manager. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | --------------------------------- | +| addressManager | address | Address manager contract address. | + +### sendToken + +```solidity +function sendToken(struct ERC20Vault.BridgeTransferOp opt) external payable +``` + +Transfers ERC20 tokens to this vault and sends a message to the +destination chain so the user can receive the same amount of tokens by +invoking the message call. + +#### Parameters + +| Name | Type | Description | +| ---- | ---------------------------------- | -------------------------------- | +| opt | struct ERC20Vault.BridgeTransferOp | Option for sending ERC20 tokens. | + +### receiveToken + +```solidity +function receiveToken(struct ERC20Vault.CanonicalERC20 ctoken, address from, address to, uint256 amount) external payable +``` + +Receive bridged ERC20 tokens and Ether. + +#### Parameters + +| Name | Type | Description | +| ------ | -------------------------------- | -------------------------------------------------- | +| ctoken | struct ERC20Vault.CanonicalERC20 | Canonical ERC20 data for the token being received. | +| from | address | Source address. | +| to | address | Destination address. | +| amount | uint256 | Amount of tokens being received. | + +### onMessageRecalled + +```solidity +function onMessageRecalled(struct IBridge.Message message) external payable +``` + +Releases deposited ERC20 tokens back to the user on the source +ERC20Vault with a proof that the message processing on the destination +Bridge has failed. + +#### Parameters + +| Name | Type | Description | +| ------- | ---------------------- | ---------------------------------------------------------------------- | +| message | struct IBridge.Message | The message that corresponds to the ERC20 deposit on the source chain. | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) +``` + +Checks if the contract supports the given interface. + +#### Parameters + +| Name | Type | Description | +| ----------- | ------ | ------------------------- | +| interfaceId | bytes4 | The interface identifier. | + +#### Return Values + +| Name | Type | Description | +| ---- | ---- | ------------------------------------------------------------- | +| [0] | bool | true if the contract supports the interface, false otherwise. | + +--- + +## title: ProxiedERC20Vault + +## ProxiedERC20Vault + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/tokenvault/ERC721Vault.md b/packages/website/pages/docs/reference/contract-documentation/tokenvault/ERC721Vault.md new file mode 100644 index 00000000000..3cdf9c1fcd3 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/tokenvault/ERC721Vault.md @@ -0,0 +1,93 @@ +--- +title: ERC721Vault +--- + +## ERC721Vault + +This vault holds all ERC721 tokens that users have deposited. +It also manages the mapping between canonical tokens and their bridged +tokens. + +### sendToken + +```solidity +function sendToken(struct BaseNFTVault.BridgeTransferOp opt) external payable +``` + +Transfers ERC721 tokens to this vault and sends a message to the +destination chain so the user can receive the same (bridged) tokens +by invoking the message call. + +#### Parameters + +| Name | Type | Description | +| ---- | ------------------------------------ | ------------------------------------ | +| opt | struct BaseNFTVault.BridgeTransferOp | Option for sending the ERC721 token. | + +### receiveToken + +```solidity +function receiveToken(struct BaseNFTVault.CanonicalNFT ctoken, address from, address to, uint256[] tokenIds) external payable +``` + +Receive bridged ERC721 tokens and handle them accordingly. + +#### Parameters + +| Name | Type | Description | +| -------- | -------------------------------- | ------------------------------------------------ | +| ctoken | struct BaseNFTVault.CanonicalNFT | Canonical NFT data for the token being received. | +| from | address | Source address. | +| to | address | Destination address. | +| tokenIds | uint256[] | Array of token IDs being received. | + +### onMessageRecalled + +```solidity +function onMessageRecalled(struct IBridge.Message message) external payable +``` + +Release deposited ERC721 token(s) back to the user on the source +chain with a proof that the message processing on the destination Bridge +has failed. + +#### Parameters + +| Name | Type | Description | +| ------- | ---------------------- | ----------------------------------------------------------------------- | +| message | struct IBridge.Message | The message that corresponds to the ERC721 deposit on the source chain. | + +### onERC721Received + +```solidity +function onERC721Received(address, address, uint256, bytes) external pure returns (bytes4) +``` + +\_Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} +by `operator` from `from`, this function is called. + +It must return its Solidity selector to confirm the token transfer. +If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. + +The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\_ + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) +``` + +\_Returns true if this contract implements the interface defined by +`interfaceId`. See the corresponding +https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] +to learn more about how these ids are created. + +This function call must use less than 30 000 gas.\_ + +--- + +## title: ProxiedERC721Vault + +## ProxiedERC721Vault + +Proxied version of the parent contract. diff --git a/packages/website/pages/docs/reference/contract-documentation/tokenvault/libs/LibVaultUtils.md b/packages/website/pages/docs/reference/contract-documentation/tokenvault/libs/LibVaultUtils.md new file mode 100644 index 00000000000..d8cc537d283 --- /dev/null +++ b/packages/website/pages/docs/reference/contract-documentation/tokenvault/libs/LibVaultUtils.md @@ -0,0 +1,106 @@ +--- +title: LibVaultUtils +--- + +## LibVaultUtils + +### MAX_TOKEN_PER_TXN + +```solidity +uint256 MAX_TOKEN_PER_TXN +``` + +### VAULT_INVALID_FROM + +```solidity +error VAULT_INVALID_FROM() +``` + +### VAULT_INVALID_TOKEN + +```solidity +error VAULT_INVALID_TOKEN() +``` + +### VAULT_INVALID_TO + +```solidity +error VAULT_INVALID_TO() +``` + +### VAULT_TOKEN_ARRAY_MISMATCH + +```solidity +error VAULT_TOKEN_ARRAY_MISMATCH() +``` + +### VAULT_MAX_TOKEN_PER_TXN_EXCEEDED + +```solidity +error VAULT_MAX_TOKEN_PER_TXN_EXCEEDED() +``` + +### VAULT_INVALID_AMOUNT + +```solidity +error VAULT_INVALID_AMOUNT() +``` + +### deployProxy + +```solidity +function deployProxy(address implementation, address owner, bytes initializationData) external returns (address proxy) +``` + +_Deploys a contract (via proxy)_ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ------------------------------------- | +| implementation | address | The new implementation address | +| owner | address | The owner of the proxy admin contract | +| initializationData | bytes | Data for the initialization | + +### checkValidContext + +```solidity +function checkValidContext(bytes32 validSender, address resolver) external view returns (struct IBridge.Context ctx) +``` + +_Checks if context is valid_ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ------------------------------ | +| validSender | bytes32 | The valid sender to be allowed | +| resolver | address | The address of the resolver | + +### hashAndCheckToken + +```solidity +function hashAndCheckToken(struct IBridge.Message message, address bridgeAddress, address tokenAddress) external pure returns (bytes32 msgHash) +``` + +_Checks if token is invalid and returns the message hash_ + +#### Parameters + +| Name | Type | Description | +| ------------- | ---------------------- | ------------------------------- | +| message | struct IBridge.Message | The bridged message struct data | +| bridgeAddress | address | The bridge contract | +| tokenAddress | address | The token address to be checked | + +### checkIfValidAddresses + +```solidity +function checkIfValidAddresses(address vault, address to, address token) external pure +``` + +### checkIfValidAmounts + +```solidity +function checkIfValidAmounts(uint256[] amounts, uint256[] tokenIds, bool isERC721) external pure +``` diff --git a/packages/website/pages/docs/reference/node-troubleshooting.mdx b/packages/website/pages/docs/reference/node-troubleshooting.mdx index d7c37b765ec..4ad89d3f306 100644 --- a/packages/website/pages/docs/reference/node-troubleshooting.mdx +++ b/packages/website/pages/docs/reference/node-troubleshooting.mdx @@ -12,7 +12,7 @@ You can ignore it, it will disappear when the node is fully synced. #### `error: "failed to check token balance: proposer does not have enough tko balance to propose"` -You have not deposited enough TKO to pay the block fee. Deposit enough TKO from TKO token contracts. See [enable a proposer](/docs/guides/run-a-node/enable-a-proposer) for more info. +You have not deposited enough TKO to pay the block fee. Deposit enough TKO from TKO token contracts. See [enable a proposer](/docs/guides/enable-a-proposer) for more info. #### `error: "failed to insert new head to L2 execution engine: missing trie node"` @@ -20,11 +20,11 @@ Make sure that your RPC is pointing to an Sepolia archive node, and not a full n #### `error: "initialize rpc clients error"` -The RPC in your config is incorrect. You have to set the ENDPOINT correctly. Please refer to the following page to set the correct RPC: https://taiko.xyz/docs/guides/run-a-node/run-a-taiko-node. +The RPC in your config is incorrect. You have to set the ENDPOINT correctly. Please refer to the following page to set the correct RPC: https://taiko.xyz/docs/guides/run-a-taiko-node. #### `error: "daily request count exceeded, request rate limited"` -Your RPC provider has a limit on the number of requests. You can try using an RPC provider with higher limits or [run your own Sepolia node](/docs/guides/run-a-node/run-a-sepolia-node) which has no limit. +Your RPC provider has a limit on the number of requests. You can try using an RPC provider with higher limits or [run your own Sepolia node](/docs/guides/run-a-sepolia-node) which has no limit. #### `error: L1_BLOCK_ID` diff --git a/packages/website/pages/docs/reference/prover-market-page.mdx b/packages/website/pages/docs/reference/prover-market-page.mdx new file mode 100644 index 00000000000..2fc9fbe09f4 --- /dev/null +++ b/packages/website/pages/docs/reference/prover-market-page.mdx @@ -0,0 +1,26 @@ +import { Callout } from "nextra-theme-docs"; + +# Prover market registration page + +Edit this page by opening a pull request and modifying the table below to add your prover to the prover market table. Proposers can also use this page to find the endpoints of provers offering their service to the open market. + +> Inspired by MEV Boost market: +> https://github.com/eth-educators/ethstaker-guides/blob/main/MEV-relay-list.md + +## Prover market table + + + These endpoints are not checked, so it's possible they don't work or a + community member has shut off their prover. Additionally, these are community + listed endpoints, **Taiko has not audited them for security**. If you find an + endpoint not working please feel free to open a PR and remove it from this + list. + + +| Name | API Endpoint | Minimum fee | +| -------------- | -------------------------------------- | ----------- | +| Example prover | https://this.is.just.an.example.prover | 10 wei | + +## Other options + +You can also use proving pool service providers like [ZKPool](https://zkpool.io). diff --git a/packages/website/pages/docs/reference/rpc-configuration.mdx b/packages/website/pages/docs/reference/rpc-configuration.mdx index 98baf9a91d4..2be99f932e8 100644 --- a/packages/website/pages/docs/reference/rpc-configuration.mdx +++ b/packages/website/pages/docs/reference/rpc-configuration.mdx @@ -1,13 +1,9 @@ import { ConnectToMetamaskButton } from "components/Button/ConnectToMetamaskButton"; -import { - SEPOLIA_CONFIG, - GRIMSVOTN_CONFIG, - ELDFELL_CONFIG, -} from "../../../domain/chain"; +import { SEPOLIA_CONFIG, TAIKO_CONFIG } from "../../../domain/chain"; # RPC configuration -**{SEPOLIA_CONFIG.names.mediumName}** +**{SEPOLIA_CONFIG.names.shortishName}**
    @@ -19,27 +15,15 @@ import { | Symbol | {SEPOLIA_CONFIG.nativeCurrency.symbol} | | Block Explorer URL | {SEPOLIA_CONFIG.blockExplorer.url} | -**{GRIMSVOTN_CONFIG.names.mediumName}** +**{TAIKO_CONFIG.names.shortishName}**
    - - -| Name | Value | -| ------------------ | ---------------------------------------- | -| Chain ID | {GRIMSVOTN_CONFIG.chainId.decimal } | -| RPC (HTTPS) | {GRIMSVOTN_CONFIG.rpc.https} | -| RPC (WebSocket) | {GRIMSVOTN_CONFIG.rpc.wss} | -| Symbol | {GRIMSVOTN_CONFIG.nativeCurrency.symbol} | -| Block Explorer URL | {GRIMSVOTN_CONFIG.blockExplorer.url} | - -**{ELDFELL_CONFIG.names.mediumName}** - -
    - - -| Name | Value | -| ------------------ | -------------------------------------- | -| Chain ID | {ELDFELL_CONFIG.chainId.decimal} | -| RPC (HTTPS) | {ELDFELL_CONFIG.rpc.https} | -| Symbol | {ELDFELL_CONFIG.nativeCurrency.symbol} | -| Block Explorer URL | {ELDFELL_CONFIG.blockExplorer.url} | + + +| Name | Value | +| ------------------ | ------------------------------------ | +| Chain ID | {TAIKO_CONFIG.chainId.decimal } | +| RPC (HTTPS) | {TAIKO_CONFIG.rpc.https} | +| RPC (WebSocket) | {TAIKO_CONFIG.rpc.wss} | +| Symbol | {TAIKO_CONFIG.nativeCurrency.symbol} | +| Block Explorer URL | {TAIKO_CONFIG.blockExplorer.url} | diff --git a/packages/website/pages/docs/resources/_meta.json b/packages/website/pages/docs/resources/_meta.json index 5f8ffca613a..c601bcb0cbf 100644 --- a/packages/website/pages/docs/resources/_meta.json +++ b/packages/website/pages/docs/resources/_meta.json @@ -7,5 +7,8 @@ }, "rollup-glossary": { "title": "Rollup glossary" + }, + "learning-resources": { + "title": "Learning resources" } } diff --git a/packages/website/pages/docs/resources/learning-resources.mdx b/packages/website/pages/docs/resources/learning-resources.mdx new file mode 100644 index 00000000000..43656d128b0 --- /dev/null +++ b/packages/website/pages/docs/resources/learning-resources.mdx @@ -0,0 +1,7 @@ +# Learning resources + +This page contains some useful learning resources. + +## Dapp building + +- Build a dapp in one click: [dapp-slaps starter template](https://github.com/d1onys1us/dapp-slaps) diff --git a/packages/website/theme.config.tsx b/packages/website/theme.config.tsx index b4694f23f69..956a7161512 100644 --- a/packages/website/theme.config.tsx +++ b/packages/website/theme.config.tsx @@ -3,14 +3,14 @@ import { ThemedImage } from "./components/ThemedImage"; import { useConfig } from "nextra-theme-docs"; import { useRouter } from "next/router"; import { ThemeToggle } from "./components/ThemeToggle"; -import { ELDFELL_CONFIG } from "./domain/chain"; +import { TAIKO_CONFIG } from "./domain/chain"; export default { banner: { key: "banner", text: ( - 📌 {ELDFELL_CONFIG.names.shortishName} is here! Get started → + 📌 {TAIKO_CONFIG.names.shortName} is here! Get started → ), }, @@ -29,7 +29,7 @@ export default {