github.com/ethereum-optimism/optimism@v1.7.2/packages/contracts-bedrock/scripts/getting-started/config.sh (about) 1 #!/usr/bin/env bash 2 3 # This script is used to generate the getting-started.json configuration file 4 # used in the Getting Started quickstart guide on the docs site. Avoids the 5 # need to have the getting-started.json committed to the repo since it's an 6 # invalid JSON file when not filled in, which is annoying. 7 8 reqenv() { 9 if [ -z "${!1}" ]; then 10 echo "Error: environment variable '$1' is undefined" 11 exit 1 12 fi 13 } 14 15 # Check required environment variables 16 reqenv "GS_ADMIN_ADDRESS" 17 reqenv "GS_BATCHER_ADDRESS" 18 reqenv "GS_PROPOSER_ADDRESS" 19 reqenv "GS_SEQUENCER_ADDRESS" 20 reqenv "L1_RPC_URL" 21 22 # Get the finalized block timestamp and hash 23 block=$(cast block finalized --rpc-url "$L1_RPC_URL") 24 timestamp=$(echo "$block" | awk '/timestamp/ { print $2 }') 25 blockhash=$(echo "$block" | awk '/hash/ { print $2 }') 26 27 # Generate the config file 28 config=$(cat << EOL 29 { 30 "l1StartingBlockTag": "$blockhash", 31 32 "l1ChainID": 11155111, 33 "l2ChainID": 42069, 34 "l2BlockTime": 2, 35 "l1BlockTime": 12, 36 37 "maxSequencerDrift": 600, 38 "sequencerWindowSize": 3600, 39 "channelTimeout": 300, 40 41 "p2pSequencerAddress": "$GS_SEQUENCER_ADDRESS", 42 "batchInboxAddress": "0xff00000000000000000000000000000000042069", 43 "batchSenderAddress": "$GS_BATCHER_ADDRESS", 44 45 "l2OutputOracleSubmissionInterval": 120, 46 "l2OutputOracleStartingBlockNumber": 0, 47 "l2OutputOracleStartingTimestamp": $timestamp, 48 49 "l2OutputOracleProposer": "$GS_PROPOSER_ADDRESS", 50 "l2OutputOracleChallenger": "$GS_ADMIN_ADDRESS", 51 52 "finalizationPeriodSeconds": 12, 53 54 "proxyAdminOwner": "$GS_ADMIN_ADDRESS", 55 "baseFeeVaultRecipient": "$GS_ADMIN_ADDRESS", 56 "l1FeeVaultRecipient": "$GS_ADMIN_ADDRESS", 57 "sequencerFeeVaultRecipient": "$GS_ADMIN_ADDRESS", 58 "finalSystemOwner": "$GS_ADMIN_ADDRESS", 59 "superchainConfigGuardian": "$GS_ADMIN_ADDRESS", 60 61 "baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000", 62 "l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000", 63 "sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000", 64 "baseFeeVaultWithdrawalNetwork": 0, 65 "l1FeeVaultWithdrawalNetwork": 0, 66 "sequencerFeeVaultWithdrawalNetwork": 0, 67 68 "gasPriceOracleOverhead": 2100, 69 "gasPriceOracleScalar": 1000000, 70 71 "enableGovernance": true, 72 "governanceTokenSymbol": "OP", 73 "governanceTokenName": "Optimism", 74 "governanceTokenOwner": "$GS_ADMIN_ADDRESS", 75 76 "l2GenesisBlockGasLimit": "0x1c9c380", 77 "l2GenesisBlockBaseFeePerGas": "0x3b9aca00", 78 "l2GenesisRegolithTimeOffset": "0x0", 79 80 "eip1559Denominator": 50, 81 "eip1559DenominatorCanyon": 250, 82 "eip1559Elasticity": 6, 83 84 "l2GenesisDeltaTimeOffset": null, 85 "l2GenesisCanyonTimeOffset": "0x0", 86 87 "systemConfigStartBlock": 0, 88 89 "requiredProtocolVersion": "0x0000000000000000000000000000000000000000000000000000000000000000", 90 "recommendedProtocolVersion": "0x0000000000000000000000000000000000000000000000000000000000000000", 91 92 "faultGameAbsolutePrestate": "0x03c7ae758795765c6664a5d39bf63841c71ff191e9189522bad8ebff5d4eca98", 93 "faultGameMaxDepth": 44, 94 "faultGameMaxDuration": 1200, 95 "faultGameGenesisBlock": 0, 96 "faultGameGenesisOutputRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", 97 "faultGameSplitDepth": 14, 98 99 "preimageOracleMinProposalSize": 1800000, 100 "preimageOracleChallengePeriod": 86400, 101 } 102 EOL 103 ) 104 105 # Write the config file 106 echo "$config" > deploy-config/getting-started.json