ethereum-optimism / docs

Optimism Developer Docs
https://docs.optimism.io
93 stars 171 forks source link

[DOCS] Wrong L1 contract deployment command #1033

Open JustAnotherDevv opened 3 days ago

JustAnotherDevv commented 3 days ago

Wrong L1 contract deployment command

Overview

In the docs page with tutorial for deploying L2 using OP stack the section for deploying L1 contracts is wrong. The command from the docs is:

forge script scripts/deploy/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL --slow.

It should be forge script scripts/deploy/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL --slow instead.

Now, after running this script I am getting error:

forge script scripts/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL --slow 
[⠒] Compiling...
[⠢] Compiling 1 files with Solc 0.8.15
[⠘] Solc 0.8.15 finished in 75.04ms
No files changed, compilation skipped
Traces:
  [57372465] → new Deploy@0x5b73C5498c1E3b4dbA84de0F1833c4a029d90519
    └─ ← [Return] 285705 bytes of code

  [2272650] Deploy::setUp()
    ├─ [0] VM::projectRoot() [staticcall]
    │   └─ ← [Return] "/Users/nevvdevv/optimism/packages/contracts-bedrock"
    ├─ [0] VM::envOr("DEPLOY_SCRIPT", "Deploy")
    │   └─ ← [Return] <env var value>
    ├─ [0] VM::envOr("DEPLOYMENT_CONTEXT", "")
    │   └─ ← [Return] <env var value>
    ├─ [0] VM::envOr("SIG", "run")
    │   └─ ← [Return] <env var value>
    ├─ [0] VM::envOr("DEPLOY_FILE", "run-latest.json")
    │   └─ ← [Return] <env var value>
    ├─ [0] VM::envOr("CHAIN_ID", 21322 [2.132e4])
    │   └─ ← [Return] <env var value>
    ├─ [0] VM::toString(21322 [2.132e4]) [staticcall]
    │   └─ ← [Return] "21322"
    ├─ [0] VM::createDir("/Users/nevvdevv/optimism/packages/contracts-bedrock/deployments/getting-started", true)
    │   └─ ← [Return] 
    ├─ [0] VM::readFile("/Users/nevvdevv/optimism/packages/contracts-bedrock/deployments/getting-started/.chainId") [staticcall]
    │   └─ ← [Revert] vm.readFile: failed to read from "/Users/nevvdevv/optimism/packages/contracts-bedrock/deployments/getting-started/.chainId": No such file or directory (os error 2)
    ├─ [0] VM::toString(21322 [2.132e4]) [staticcall]
    │   └─ ← [Return] "21322"
    ├─ [0] VM::writeFile("/Users/nevvdevv/optimism/packages/contracts-bedrock/deployments/getting-started/.chainId", "21322")
    │   └─ ← [Return] 
    ├─ [0] console::log("Connected to network with chainid %s", 21322 [2.132e4]) [staticcall]
    │   └─ ← [Stop] 
    ├─ [0] VM::readFile("/Users/nevvdevv/optimism/packages/contracts-bedrock/deployments/getting-started/.deploy") [staticcall]
    │   └─ ← [Revert] vm.readFile: failed to read from "/Users/nevvdevv/optimism/packages/contracts-bedrock/deployments/getting-started/.deploy": No such file or directory (os error 2)
    ├─ [0] VM::writeJson("<stringified JSON>", "/Users/nevvdevv/optimism/packages/contracts-bedrock/deployments/getting-started/.deploy")
    │   └─ ← [Return] 
    ├─ [0] console::log("Storing temp deployment data in %s", "/Users/nevvdevv/optimism/packages/contracts-bedrock/deployments/getting-started/.deploy") [staticcall]
    │   └─ ← [Stop] 
    ├─ [0] VM::envOr("CONTRACT_ADDRESSES_PATH", "")
    │   └─ ← [Return] <env var value>
    ├─ [0] VM::projectRoot() [staticcall]
    │   └─ ← [Return] "/Users/nevvdevv/optimism/packages/contracts-bedrock"
    ├─ [1893528] → new <unknown>@0xC7f2Cf4845C6db0e1a1e91ED41Bcd0FcC1b0E141
    │   ├─ [0] console::log("DeployConfig: reading file %s", "/Users/nevvdevv/optimism/packages/contracts-bedrock/deploy-config/getting-started.json") [staticcall]
    │   │   └─ ← [Stop] 
    │   ├─ [0] VM::readFile("/Users/nevvdevv/optimism/packages/contracts-bedrock/deploy-config/getting-started.json") [staticcall]
    │   │   └─ ← [Return] <file>
    │   ├─ [0] VM::parseJsonAddress("<stringified JSON>", "$.finalSystemOwner") [staticcall]
    │   │   └─ ← [Revert] vm.parseJsonAddress: failed parsing JSON: expected value at line 19 column 38
    │   └─ ← [Revert] vm.parseJsonAddress: failed parsing JSON: expected value at line 19 column 38
    └─ ← [Revert] vm.parseJsonAddress: failed parsing JSON: expected value at line 19 column 38

Update

It seems like in the file ./deploy-config/getting-started.json in the line 19 the value "l2OutputOracleStartingTimestamp": , is empty as you can see which is not correct json syntax but it's not explained in the docs how it should be generated.

I can create PR for it today but want to know before if it's worth changing and if it's gonna be merged.

sbvegan commented 2 days ago

Did you use the tutorials/chain branch for this tutorial?

JustAnotherDevv commented 2 days ago

Did you use the tutorials/chain branch for this tutorial?

Yes, I have switched to the branch before following rest of the tutorial.