Skip to content

Commit

Permalink
chore: update tutorial to reflect changes (#84)
Browse files Browse the repository at this point in the history
<!--

Thank you for contributing to the ZKsync Code Community!

Before submitting the PR, please make sure you do the following:

- Read the [Contributing
Guide](https://github.com/ZKsync-Community-Hub/community-code/blob/main/CONTRIBUTING.md).
- Understand our [Code of
Conduct](https://github.com/ZKsync-Community-Hub/community-code/blob/main/CODE_OF_CONDUCT.md)

-->

# Description

<!-- Please describe what are the changes and what they are solving for
in this PR. -->
- Updates tutorial so users make use of the `governors` address for
deploying / setting owner for base token contract as expected by the
`zk_toolbox` script:
https://github.com/matter-labs/zksync-era/pull/2973/files
- Removed the funding governor section as that is done by the script 
## Linked Issues

<!-- If you have any issues this PR is related to, link them here. -->
<!--
Check out
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
on how to automate linking a GitHub Issue to a PR.
-->

## Additional context
  • Loading branch information
dutterbutter authored Sep 27, 2024
1 parent 2012988 commit e7897fd
Showing 1 changed file with 4 additions and 31 deletions.
35 changes: 4 additions & 31 deletions content/tutorials/custom-zk-chain/20.customizing-your-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ Next, create a `.env` file with:
touch .env
```

Add the `WALLET_PRIVATE_KEY` environment variable with the private key of the rich wallet we've been using
so that we can deploy using a pre-funded address:
Add the governor private key from our elastic_chain setup to ensure that this address becomes the owner of the token contract. Here's how
you can add the `WALLET_PRIVATE_KEY` environment variable:

```bash
WALLET_PRIVATE_KEY=0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110
# Use the private key of the `governor` from wallet.yaml
WALLET_PRIVATE_KEY=<governor_private_key_from_wallet.yaml>
```

### Deploying an ERC20 Contract
Expand Down Expand Up @@ -223,34 +224,6 @@ For example, if we set the nominator to 20 and the denominator to 1, together th
this would mean that 20 tokens would be given the equivalent value as 1 ETH for gas.
For testing purposes, we'll just use a 1:1 ratio.

### Funding the governor addresses

Now that you have some tokens and created a new chain,
the next step is to send some to each of the governor's addresses for the ecosystem and chain on the L1.
This will allow you to register and deploy your chain, and deploy the paymaster.
For the _ecosystem governor_, you can find the address in `<my_elastic_chain>/configs/wallets.yaml` under `governor`.
The second governor address you need to fund is for the _chain governor_.
The chain governor address can be found in `<my_elastic_chain>/chains/custom_zk_chain/configs/wallets.yaml` also under `governor`.
Run the command below **twice** (once for each governor address) to use `cast` to transfer some of your ERC20 tokens to the governor's address on the L1.

```bash
cast send <0xYOUR_TOKEN_ADDRESS> "transfer(address,uint256)" \
<0x_YOUR_GOVERNOR_ADDRESS> 1000000000000000000 \
--private-key 0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 \
--rpc-url http://localhost:8545 \
--gas-price 30000000000
```

To verify that this worked, check the balance of both governor addresses:

```bash
cast balance --erc20 <0xYOUR_TOKEN_ADDRESS> \
<0x_YOUR_GOVERNOR_ADDRESS> \
--rpc-url http://localhost:8545
```

### Initializing the chain

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
Expand Down

0 comments on commit e7897fd

Please sign in to comment.