11//-----------------------------------------------------------------------//
2- // args and funcs
2+ // args / funcs
33
44local config = std.extVar("config" );
55
6+ // if the key is not present in the config, throw an error
67local require(key, conf) =
78 if std.objectHas (config, conf) then
89 { [key]: config[conf] }
910 else
1011 error "required field not found :" + conf;
1112
13+ // if the key is not present in the config, use the default value
1214local default(key, conf, default) =
1315 if std.objectHas (config, conf) then
1416 { [key]: config[conf] }
1517 else
1618 { [key]: default };
1719
20+ // if the key is not present in the config, use empty object
1821local optional(key, conf) =
1922 if std.objectHas (config, conf) then
2023 { [key]: config[conf] }
@@ -24,6 +27,9 @@ local optional(key, conf) =
2427//-----------------------------------------------------------------------//
2528// elements
2629
30+ local L1StartingBlockTag =
31+ require("l1StartingBlockTag" , "l1StartingBlockTag" );
32+
2733local DevDeployConfig =
2834 default("fundDevAccounts" , "fundDevAccounts" , false );
2935
@@ -53,7 +59,7 @@ local L2VaultsDeployConfig =
5359 + default("l1FeeVaultWithdrawalNetwork" , "l1FeeVaultWithdrawalNetwork" , 0 )
5460 + default("sequencerFeeVaultWithdrawalNetwork" , "sequencerFeeVaultWithdrawalNetwork" , 0 );
5561
56- local GovConfig =
62+ local GovernanceDeployConfig =
5763 default("enableGovernance" , "enableGovernance" , false )
5864 + default("governanceTokenSymbol" , "governanceTokenSymbol" , "NA" )
5965 + default("governanceTokenName" , "governanceTokenName" , "NotApplicable" )
@@ -69,7 +75,6 @@ local GasTokenDeployConfig =
6975 default("useCustomGasToken" , "useCustomGasToken" , false )
7076 + optional("customGasTokenAddress" , "customGasTokenAddress" );
7177
72- // OperatorDeployConfig
7378local OperatorDeployConfig =
7479 require("p2pSequencerAddress" , "SEQUENCER_ADDRESS" )
7580 + require("batchSenderAddress" , "BATCHER_ADDRESS" );
@@ -101,27 +106,52 @@ local L2CoreDeployConfig =
101106 + default("batchInboxAddress" , "batchInboxAddress" , "0xff00000000000000000000000000000000000000" )
102107 + default("systemConfigStartBlock" , "systemConfigStartBlock" , 0 );
103108
104- local AltDaConfig =
109+ local AltDADeployConfig =
105110 default("usePlasma" , "usePlasma" , false )
106111 + default("daCommitmentType" , "daCommitmentType" , "KeccakCommitment" )
107112 + default("daChallengeWindow" , "daChallengeWindow" , 16 )
108113 + default("daResolveWindow" , "daResolveWindow" , 16 )
109114 + default("daBondSize" , "daBondSize" , 1000000 )
110115 + default("daResolverRefundPercentage" , "daResolverRefundPercentage" , 0 );
111116
117+ local OutputOracleDeployConfig =
118+ optional("l2OutputOracleSubmissionInterval" , "l2OutputOracleSubmissionInterval" )
119+ + optional("l2OutputOracleStartingTimestamp" , "l2OutputOracleStartingTimestamp" )
120+ + optional("l2OutputOracleStartingBlockNumber" , "l2OutputOracleStartingBlockNumber" )
121+ + optional("l2OutputOracleProposer" , "l2OutputOracleProposer" )
122+ + optional("l2OutputOracleChallenger" , "l2OutputOracleChallenger" );
123+
124+ local FaultProofDeployConfig =
125+ default("useFaultProof" , "useFaultProof" , false )
126+ + optional("faultGameAbsolutePrestate" , "faultGameAbsolutePrestate" )
127+ + optional("faultGameMaxDepth" , "faultGameMaxDepth" )
128+ + optional("faultGameClockExtension" , "faultGameClockExtension" )
129+ + optional("faultGameMaxClockDuration" , "faultGameMaxClockDuration" )
130+ + optional("faultGameGenesisBlock" , "faultGameGenesisBlock" )
131+ + optional("faultGameGenesisOutputRoot" , "faultGameGenesisOutputRoot" )
132+ + optional("faultGameSplitDepth" , "faultGameSplitDepth" )
133+ + optional("faultGameWithdrawalDelay" , "faultGameWithdrawalDelay" )
134+ + optional("preimageOracleMinProposalSize" , "preimageOracleMinProposalSize" )
135+ + optional("preimageOracleChallengePeriod" , "preimageOracleChallengePeriod" )
136+ + optional("proofMaturityDelaySeconds" , "proofMaturityDelaySeconds" )
137+ + optional("disputeGameFinalityDelaySeconds" , "disputeGameFinalityDelaySeconds" )
138+ + optional("respectedGameType" , "respectedGameType" );
139+
112140//-----------------------------------------------------------------------//
113141// output
114- # l1StartingBlockTag: blockhash
115142
116- DevDeployConfig
143+ L1StartingBlockTag
144+ + DevDeployConfig
117145+ L2GenesisBlockDeployConfig
118146+ OwnershipDeployConfig
119147+ L2VaultsDeployConfig
120- + GovConfig
148+ + GovernanceDeployConfig
121149+ GasPriceOracleDeployConfig
122150+ GasTokenDeployConfig
123151+ OperatorDeployConfig
124152+ EIP1559DeployConfig
125153+ UpgradeScheduleDeployConfig
126154+ L2CoreDeployConfig
127- + AltDaConfig
155+ + AltDADeployConfig
156+ + OutputOracleDeployConfig
157+ + FaultProofDeployConfig
0 commit comments