Skip to content

Commit

Permalink
add contract deployment details and alphabetize services
Browse files Browse the repository at this point in the history
  • Loading branch information
dghelm committed Jul 26, 2024
1 parent 37e2c0b commit cea0dd3
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ permalink: "sdk/technical-stack/contracts"
excerpt: "Documents the contracts deployed to support the Scroll SDK."
---

import Aside from "../../../../../components/Aside.astro"

## Overview

Contracts deployed for a Scroll SDK chain include both contracts on the L1 (or basechain), and contracts deployed on the L2. Additionally, the L2 has "pre-deployed" contracts, matching those on [Scroll](/en/developers/scroll-contracts#l2-predeploys).
Expand Down Expand Up @@ -49,17 +51,65 @@ All contracts are available in the [scroll-contracts repo](https://github.com/sc

Contracts are deployed using deterministic addresses, with a salt used to generate the address of the contract. For every new deployment, a unique salt should be configured in `config.toml`.

During deployment, a simulation is first done to determine what address a contract will deploy to. This step is done during the creation the config files for each service's chart and when the `genesis.json` file is created. Contract addresses are then used to set each service's configuration.
During deployment, a simulation is first done to determine what address a contract will deploy to. This step is done during the creation the config files for each service's chart and when the `genesis.json` file is created. Contract addresses are then used to set each service's configuration (see [`gen-configs.sh`](https://github.com/scroll-tech/scroll-contracts/blob/feat-robust-deployment/docker/scripts/gen-configs.sh)).

{/* <!-- TODO: modify URL to develop branch --> */}

Then, after the `scroll-stack` chart is installed during `make install`, you will need to fund your SDK accounts and run `make deploy-contracts` to deploy all contracts on L1 and L2 using actual transactions.

To view the complete logs from the deployment process, see the `broadcast` folder in `/charts/scroll-stack/`.

{/* TODO: check again once we do this. */}

### Funding Deployment Accounts

You will need to manually fund the following wallet addresses from `config.toml`:

- `DEPLOYER_ADDR` *(only needs funded on L1)*
{/* - Suggested funds: `(L1 basefee * VARIABLE * 10e-9) ETH` */}
- `L1_COMMIT_SENDER_ADDR`
{/* - Suggested funds: `(L1 basefee * VARIABLE * 10e-9) ETH` */}
- `L1_FINALIZE_SENDER_ADDR`
{/* - Suggested funds: `(L1 basefee * VARIABLE * 10e-9) ETH` */}
- `L1_GAS_ORACLE_SENDER_ADDR`
{/* - Suggested funds: `(L1 basefee * VARIABLE * 10e-9) ETH` */}
- `L2_GAS_ORACLE_SENDER_ADDR` *(funded after L2 chain deployment)*
{/* - Suggested funds: `(L1 basefee * VARIABLE * 10e-9) ETH` */}

{/* <!-- TODO: modify for how this works after --> */}

<Aside type="tip">

To fund an L1 addresses when using Anvil, you can run the command below, replacing the first param with the address.

```bash
curl --location 'http://l1-devnet.scrollsdk/' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc":"2.0",
"method":"anvil_setBalance",
"params":["0x0000000005D6C5FCB0BA99480e585D2364e98000","0x3635C9ADC5DEA00000"],
"id":0
}'
```
</Aside>

<Aside type="tip">

To fund an L2 address directly, you can run the command below, replacing the RPC and setting a private key of an account funded on L1 and a recipient address on L2.

```bash
cast send --rpc-url https://rpc2.sepolia.org --private-key "$PRIVATE_KEY" "$L1_GATEWAY_ROUTER_PROXY_ADDR" "depositETH(address,uint256,uint256)" "$L2_RECIPENT_ADDR" "1ether" "300000" --value "1.1ether"
```

Then, when the `scroll-stack` chart is installed, the `contracts` chart will deploy all contracts on L1 and L2 using actual transactions signed by the deployer account.
</Aside>

To view the complete logs from the `contracts` process, ... TODO: EXPOSE THIS

## Contracts Deployed

In the table below, we document every contract deployed for Scroll, including a link to the deployment for Scroll's mainnet. Not all of these are used by default for Scroll SDK.

<!-- TODO: Modify table here for only post-Curie Scroll SDK contracts. -->
{/* <!-- TODO: Modify table here for only post-Curie Scroll SDK contracts. --> */}

| Contract Name | Description |
| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
Expand Down
20 changes: 10 additions & 10 deletions src/content/docs/en/sdk/technical-stack/services.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,29 @@ Below, we describe three configurations for services:
| Service | Default | Minimal | Production |
| ----------------------- | :---------------------: | :--------------------: | :------------------------------------------------: |
| l1-devnet | | | |
| balance-checker | | | ⚠️ |
| blockscout || | |
| blockscout-sc-verifier || | |
| bridge-history-api [^1] ||||
| bridge-history-fetcher [^1] ||||
| balance-checker | | | ⚠️ |
| chain-monitor | | ||
| coordinator-api [^2] | | ||
| coordinator-cron [^2] | | ||
| event-watcher ||||
| frontends || | ⚠️ |
| gas-oracle ||||
| grafana || | |
| rollup-explorer-backend || | |
| rollup-node || | |
| grafana || | ⚠️ |
| kube-prometheus-stack | | | |
| l1-devnet || | |
| l1-explorer || | |
| l2-sequencer ||||
| l2-rpc || ||
| l2-bootnode || ||
| l2-rpc || ||
| l2-sequencer ||||
| loki-stack || | ⚠️ |
| blockscout-sc-verifier || | |
| rpc-gateway || ||
| postgresql || ⚠️ | ⚠️ |
| kube-prometheus-stack || | |
| rollup-explorer-backend || | |
| rollup-node ||||
| rpc-gateway || ||

{/* | contracts | ✅ | ✅ [^2] | ✅ | */}

Expand Down

0 comments on commit cea0dd3

Please sign in to comment.