@@ -86,6 +86,22 @@ type DevDeployConfig struct {
8686 FundDevAccounts bool `json:"fundDevAccounts"`
8787}
8888
89+ type RevenueShareDeployConfig struct {
90+ UseRevenueShare bool `json:"useRevenueShare"`
91+ ChainFeesRecipient common.Address `json:"chainFeesRecipient"`
92+ }
93+
94+ var _ ConfigChecker = (* RevenueShareDeployConfig )(nil )
95+
96+ func (d * RevenueShareDeployConfig ) Check (log log.Logger ) error {
97+ if d .UseRevenueShare {
98+ if d .ChainFeesRecipient == (common.Address {}) {
99+ return fmt .Errorf ("%w: ChainFeesRecipient cannot be address(0)" , ErrInvalidDeployConfig )
100+ }
101+ }
102+ return nil
103+ }
104+
89105type L2GenesisBlockDeployConfig struct {
90106 L2GenesisBlockNonce hexutil.Uint64 `json:"l2GenesisBlockNonce"`
91107 L2GenesisBlockGasLimit hexutil.Uint64 `json:"l2GenesisBlockGasLimit"`
@@ -150,18 +166,24 @@ type L2VaultsDeployConfig struct {
150166 // SequencerFeeVaultRecipient represents the recipient of fees accumulated in the SequencerFeeVault.
151167 // Can be an account on L1 or L2, depending on the SequencerFeeVaultWithdrawalNetwork value.
152168 SequencerFeeVaultRecipient common.Address `json:"sequencerFeeVaultRecipient"`
169+ // OperatorFeeVaultRecipient represents the recipient of fees accumulated in the OperatorFeeVault.
170+ OperatorFeeVaultRecipient common.Address `json:"operatorFeeVaultRecipient"`
153171 // BaseFeeVaultMinimumWithdrawalAmount represents the minimum withdrawal amount for the BaseFeeVault.
154172 BaseFeeVaultMinimumWithdrawalAmount * hexutil.Big `json:"baseFeeVaultMinimumWithdrawalAmount"`
155173 // L1FeeVaultMinimumWithdrawalAmount represents the minimum withdrawal amount for the L1FeeVault.
156174 L1FeeVaultMinimumWithdrawalAmount * hexutil.Big `json:"l1FeeVaultMinimumWithdrawalAmount"`
157175 // SequencerFeeVaultMinimumWithdrawalAmount represents the minimum withdrawal amount for the SequencerFeeVault.
158176 SequencerFeeVaultMinimumWithdrawalAmount * hexutil.Big `json:"sequencerFeeVaultMinimumWithdrawalAmount"`
177+ // OperatorFeeVaultMinimumWithdrawalAmount represents the minimum withdrawal amount for the OperatorFeeVault.
178+ OperatorFeeVaultMinimumWithdrawalAmount * hexutil.Big `json:"operatorFeeVaultMinimumWithdrawalAmount"`
159179 // BaseFeeVaultWithdrawalNetwork represents the withdrawal network for the BaseFeeVault.
160180 BaseFeeVaultWithdrawalNetwork WithdrawalNetwork `json:"baseFeeVaultWithdrawalNetwork"`
161181 // L1FeeVaultWithdrawalNetwork represents the withdrawal network for the L1FeeVault.
162182 L1FeeVaultWithdrawalNetwork WithdrawalNetwork `json:"l1FeeVaultWithdrawalNetwork"`
163183 // SequencerFeeVaultWithdrawalNetwork represents the withdrawal network for the SequencerFeeVault.
164184 SequencerFeeVaultWithdrawalNetwork WithdrawalNetwork `json:"sequencerFeeVaultWithdrawalNetwork"`
185+ // OperatorFeeVaultWithdrawalNetwork represents the withdrawal network for the OperatorFeeVault.
186+ OperatorFeeVaultWithdrawalNetwork WithdrawalNetwork `json:"operatorFeeVaultWithdrawalNetwork"`
165187}
166188
167189var _ ConfigChecker = (* L2VaultsDeployConfig )(nil )
@@ -176,6 +198,9 @@ func (d *L2VaultsDeployConfig) Check(log log.Logger) error {
176198 if d .SequencerFeeVaultRecipient == (common.Address {}) {
177199 return fmt .Errorf ("%w: SequencerFeeVaultRecipient cannot be address(0)" , ErrInvalidDeployConfig )
178200 }
201+ if d .OperatorFeeVaultRecipient == (common.Address {}) {
202+ return fmt .Errorf ("%w: OperatorFeeVaultRecipient cannot be address(0)" , ErrInvalidDeployConfig )
203+ }
179204 if ! d .BaseFeeVaultWithdrawalNetwork .Valid () {
180205 return fmt .Errorf ("%w: BaseFeeVaultWithdrawalNetwork can only be 0 (L1) or 1 (L2)" , ErrInvalidDeployConfig )
181206 }
@@ -185,6 +210,9 @@ func (d *L2VaultsDeployConfig) Check(log log.Logger) error {
185210 if ! d .SequencerFeeVaultWithdrawalNetwork .Valid () {
186211 return fmt .Errorf ("%w: SequencerFeeVaultWithdrawalNetwork can only be 0 (L1) or 1 (L2)" , ErrInvalidDeployConfig )
187212 }
213+ if ! d .OperatorFeeVaultWithdrawalNetwork .Valid () {
214+ return fmt .Errorf ("%w: OperatorFeeVaultWithdrawalNetwork can only be 0 (L1) or 1 (L2)" , ErrInvalidDeployConfig )
215+ }
188216 return nil
189217}
190218
@@ -743,6 +771,7 @@ type L2InitializationConfig struct {
743771 L2CoreDeployConfig
744772 FeeMarketConfig
745773 AltDADeployConfig
774+ RevenueShareDeployConfig
746775}
747776
748777func (d * L2InitializationConfig ) Check (log log.Logger ) error {
0 commit comments