Skip to content

Commit

Permalink
Merge branch 'main' into new_relayer_events
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Mar 12, 2023
2 parents c18afdd + cc5f5c4 commit 1d0ca54
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 181 deletions.
31 changes: 8 additions & 23 deletions packages/website/components/AddEthereumChainButton.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
type Props = {
buttonText: string;
chain: string;
};

async function addEthereumChain(chain: string) {
async function addEthereumChain() {
interface AddEthereumChainParameter {
chainId: string; // A 0x-prefixed hexadecimal string
chainName: string;
Expand All @@ -16,44 +15,30 @@ async function addEthereumChain(chain: string) {
blockExplorerUrls?: string[];
iconUrls?: string[]; // Currently ignored.
}
const l1params: AddEthereumChainParameter = {
chainId: "0x7A6A",
chainName: "Ethereum A1 (Taiko)",
nativeCurrency: {
name: "ETH",
symbol: "eth",
decimals: 18,
},
rpcUrls: ["https://l1rpc.a1.taiko.xyz"],
blockExplorerUrls: ["https://l1explorer.a1.taiko.xyz/"],
iconUrls: [],
};

const l2params: AddEthereumChainParameter = {
chainId: "0x28C5B",
chainName: "Taiko A1 (Taiko)",
const taikoParams: AddEthereumChainParameter = {
chainId: "0x28C5A",
chainName: "Taiko Hackathon Testnet",
nativeCurrency: {
name: "ETH",
symbol: "eth",
decimals: 18,
},
rpcUrls: ["https://l2rpc.a1.taiko.xyz"],
blockExplorerUrls: ["https://l2explorer.a1.taiko.xyz/"],
rpcUrls: ["https://l2rpc.hackathon.taiko.xyz"],
blockExplorerUrls: ["https://l2explorer.hackathon.taiko.xyz/"],
iconUrls: [],
};

const params = chain === "l1" ? l1params : l2params;

await (window as any).ethereum.request({
method: "wallet_addEthereumChain",
params: [params],
params: [taikoParams],
});
}

export default function AddEthereumChainButton(props: Props) {
return (
<div
onClick={() => addEthereumChain(props.chain)}
onClick={() => addEthereumChain()}
className="hover:cursor-pointer text-neutral-900 bg-white hover:bg-neutral-100 border-solid border-neutral-200 focus:ring-4 focus:outline-none focus:ring-neutral-100 font-medium rounded-lg text-sm px-3 py-2 text-center inline-flex items-center dark:focus:ring-neutral-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700"
>
{props.buttonText}
Expand Down
9 changes: 3 additions & 6 deletions packages/website/pages/docs/guides/configure-wallet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ These steps will help you connect your wallet to the Taiko A1 testnet. There are
## Steps

1. Try clicking the buttons below to automatically add the networks to your wallet (using `wallet_addEthereumChain`).
| Network | Add to wallet |
| ----------- | --------------------------------------------------------------- |
| Ethereum A1 | <AddEthereumChainButton buttonText="Add to wallet" chain="l1"/> |
| Taiko A1 | <AddEthereumChainButton buttonText="Add to wallet" chain="l2"/> |

2. If that doesn't work, manually add the networks to your wallet using the [RPC configuration](/docs/reference/rpc-configuration).
2. Add the Sepolia testnet by clicking "Add chain" on [https://chainlist.wtf/](https://chainlist.wtf).
3. Add the Taiko network by clicking the "Add chain" button: <AddEthereumChainButton buttonText="Add chain" />
4. If that doesn't work, manually add the networks to your wallet using the [RPC configuration](/docs/reference/rpc-configuration).
4 changes: 2 additions & 2 deletions packages/website/pages/docs/guides/deploy-a-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ These steps will show you how to deploy a smart contract to Taiko A1 using Found
```
3. Deploy the contract from your project, located at `src/Counter.sol`. Replace `YOUR_PRIVATE_KEY` with your private key, mentioned in the previous prerequisites section.
```sh
forge create --legacy --rpc-url https://l2rpc.a1.taiko.xyz --private-key YOUR_PRIVATE_KEY src/Counter.sol:Counter
forge create --legacy --rpc-url https://l2rpc.hackathon.taiko.xyz --private-key YOUR_PRIVATE_KEY src/Counter.sol:Counter
```
> Note: The `--legacy` flag is needed because EIP-1559 is currently disabled on Taiko—there are plans to re-enable it in the future.
4. Paste the address from the output into the [L2 block explorer](https://l2explorer.a1.taiko.xyz/) to verify that the contract was deployed.
4. Paste the address from the output into the [L2 block explorer](https://l2explorer.hackathon.taiko.xyz/) to verify that the contract was deployed.
22 changes: 4 additions & 18 deletions packages/website/pages/docs/guides/request-from-faucet.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,10 @@ These steps will help you receive testnet tokens from the faucet.

## Steps

### Request Ethereum A1 ETH
### Request ETH on Sepolia

1. Visit the [L1 faucet](https://l1faucet.a1.taiko.xyz/) to receive Ethereum A1 ETH.
1. Visit the recommended [Sepolia faucet](https://sepolia-faucet.pk910.de/) to receive ETH on Sepolia.

### Request Taiko A1 ETH
### Request ETH on Taiko

1. Visit the [L2 faucet](https://l2faucet.a1.taiko.xyz/) to receive Taiko A1 ETH.

### Request HORSE

1. Visit the [bridge](https://bridge.a1.taiko.xyz/).
2. Select the network as Taiko A1 and the token dropdown as HORSE.
3. Click the faucet button that appears.

## Common problems

### Testnet faucet shows error “unable to find Ethereum address.”

The Twitter API is hitting a rate limit. Because of this, the faucet can’t recognize the Ethereum address in your tweet.

To solve this, you will need to wait and try again. If you continue having problems, you can ask the community to send you testnet funds by sending your address to the Discord channel: `🪙︱manual-faucet`.
1. Visit the [Taiko faucet](https://l2faucet.hackathon.taiko.xyz/) to receive ETH on Taiko.
23 changes: 0 additions & 23 deletions packages/website/pages/docs/guides/run-a-node.md

This file was deleted.

2 changes: 2 additions & 0 deletions packages/website/pages/docs/guides/use-the-bridge.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> Note: The bridge is currently not deployed on the Taiko hackathon testnet, but you can build bridges with the Signal Service cross-chain messaging.
# Use the bridge

These steps will help you to use the bridge to transfer assets between Ethereum A1 and Taiko A1. All the bridge contracts can be found [here](/docs/reference/contract-addresses).
Expand Down
17 changes: 6 additions & 11 deletions packages/website/pages/docs/reference/contract-addresses.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Contract addresses
# Hackathon testnet contract addresses

## L1
## Sepolia (L1)

- **TaikoL1:** `0x7B3AF414448ba906f02a1CA307C56c4ADFF27ce7`
- **TokenVault:** `0xD0dfd5baCf160B97C8eE3ecb463F18c08673160c`
- **Bridge:** `0x3612E284D763f42f5E4CB72B1602b23DAEC3cA60`
- **HORSE:** `0x3E3a3416DbCc5cb4448B6b171fF15f9Da35Ab72d`
- **TaikoL1:** `0xEdE510d93A3a6C5e8B8Be88F7719716063140197`
- **SignalService:**: `0xe40D5bedD2f3d9F288CC12c69463bC43c77488d6`

## L2
## Taiko (L2)

- **TaikoL2:** `0x0000777700000000000000000000000000000001`
- **TokenVault:** `0x0000777700000000000000000000000000000002`
- **EtherVault:** `0x0000777700000000000000000000000000000003`
- **Bridge:** `0x0000777700000000000000000000000000000004`
- **HORSE:** `0xb8ea36284d1fa062cc0c969e28a49f3531cfb1bf`
- **SignalService:** `0x191E3D5a00d54799D7da6c04d56b19938304c312`
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ title: TaikoCustomErrors
error L1_0_FEE_BASE()
```

### L1_ALREADY_PROVEN

```solidity
error L1_ALREADY_PROVEN()
```

### L1_ANCHOR_CALLDATA

```solidity
Expand Down Expand Up @@ -100,12 +106,6 @@ error L1_BLOCK_NUMBER()
error L1_CANNOT_BE_FIRST_PROVER()
```

### L1_CIRCUIT_LENGTH

```solidity
error L1_CIRCUIT_LENGTH()
```

### L1_COMMITTED

```solidity
Expand Down Expand Up @@ -142,18 +142,6 @@ error L1_EXTRA_DATA()
error L1_GAS_LIMIT()
```

### L1_HALTED

```solidity
error L1_HALTED()
```

### L1_HALT_CONDITION

```solidity
error L1_HALT_CONDITION()
```

### L1_ID

```solidity
Expand Down Expand Up @@ -190,10 +178,10 @@ error L1_META_MISMATCH()
error L1_NOT_COMMITTED()
```

### L1_NOT_FIRST_PROVER
### L1_NOT_ORACLE_PROVER

```solidity
error L1_NOT_FIRST_PROVER()
error L1_NOT_ORACLE_PROVER()
```

### L1_PROOF_LENGTH
Expand All @@ -214,22 +202,10 @@ error L1_PROVER()
error L1_SOLO_PROPOSER()
```

### L1_TOO_LATE

```solidity
error L1_TOO_LATE()
```

### L1_TOO_MANY

```solidity
error L1_TOO_MANY()
```

### L1_TOO_MANY_PROVERS
### L1_TOO_MANY_BLOCKS

```solidity
error L1_TOO_MANY_PROVERS()
error L1_TOO_MANY_BLOCKS()
```

### L1_TX_LIST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ struct Config {
uint256 chainId;
uint256 maxNumBlocks;
uint256 blockHashHistory;
uint256 zkProofsPerBlock;
uint256 maxVerificationsPerTx;
uint256 commitConfirmations;
uint256 maxProofsPerForkChoice;
uint256 blockMaxGasLimit;
uint256 maxTransactionsPerBlock;
uint256 maxBytesPerTxList;
Expand All @@ -32,12 +30,9 @@ struct Config {
uint64 blockTimeCap;
uint64 proofTimeCap;
uint64 bootstrapDiscountHalvingPeriod;
uint64 initialUncleDelay;
uint64 proverRewardRandomizedPercentage;
bool enableTokenomics;
bool enablePublicInputsCheck;
bool enableAnchorValidation;
bool enableOracleProver;
}
```

Expand All @@ -59,6 +54,18 @@ struct BlockMetadata {
}
```

### Evidence

```solidity
struct Evidence {
struct TaikoData.BlockMetadata meta;
struct BlockHeader header;
address prover;
bytes[] proofs;
uint16 circuitId;
}
```

### ProposedBlock

```solidity
Expand All @@ -75,8 +82,8 @@ struct ProposedBlock {
```solidity
struct ForkChoice {
bytes32 blockHash;
address prover;
uint64 provenAt;
address[] provers;
}
```

Expand All @@ -88,10 +95,11 @@ struct State {
mapping(uint256 => struct TaikoData.ProposedBlock) proposedBlocks;
mapping(uint256 => mapping(bytes32 => struct TaikoData.ForkChoice)) forkChoices;
mapping(address => mapping(uint256 => bytes32)) commits;
mapping(address => uint256) balances;
uint64 genesisHeight;
uint64 genesisTimestamp;
uint64 __reservedA1;
uint64 statusBits;
uint64 __reservedA2;
uint256 feeBase;
uint64 nextBlockId;
uint64 lastProposedAt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,5 @@ event BlockProposed(uint256 id, struct TaikoData.BlockMetadata meta)
### BlockProven

```solidity
event BlockProven(uint256 id, bytes32 parentHash, bytes32 blockHash, uint64 timestamp, uint64 provenAt, address prover)
```

### Halted

```solidity
event Halted(bool halted)
event BlockProven(uint256 id, bytes32 parentHash, bytes32 blockHash, address prover, uint64 provenAt)
```
Loading

0 comments on commit 1d0ca54

Please sign in to comment.