@@ -24,7 +24,9 @@ pub struct L2FeeConfiguration {
2424 pub protocol_tax_fee_e6 : u32 ,
2525 pub creator_swap_fee_e6 : u32 ,
2626 pub protocol_swap_fee_e6 : u32 ,
27- pub priority_fee_tax_floor : u128
27+ pub priority_fee_tax_floor : u128 ,
28+ pub jit_tax_enabled : bool ,
29+ pub withdraw_only : bool
2830}
2931
3032pub trait FeeConfig :
@@ -49,6 +51,10 @@ pub trait FeeConfig:
4951 /// - L2: swap_fee (0) + protocol_fee (creator + protocol swap fees)
5052 fn fee ( & self , bundle : bool ) -> u32 ;
5153
54+ fn priority_fee_tax_floor ( & self ) -> u128 {
55+ 0
56+ }
57+
5258 fn update_fees ( & mut self , update : Self :: Update ) ;
5359
5460 /// Calculate MEV tax given a priority fee in wei.
@@ -110,21 +116,26 @@ impl FeeConfig for L2FeeConfiguration {
110116 self . swap_fee ( ) + self . protocol_fee ( )
111117 }
112118
113- fn update_fees ( & mut self , update : Self :: Update ) {
114- let Self :: Update { protocol_tax_fee_e6 , protocol_swap_fee_e6 , priority_fee_tax_floor } =
115- update ;
119+ fn priority_fee_tax_floor ( & self ) -> u128 {
120+ self . priority_fee_tax_floor
121+ }
116122
117- if let Some ( fee) = protocol_tax_fee_e6 {
123+ fn update_fees ( & mut self , update : Self :: Update ) {
124+ if let Some ( fee) = update. protocol_tax_fee_e6 {
118125 self . protocol_tax_fee_e6 = fee;
119126 }
120-
121- if let Some ( fee) = protocol_swap_fee_e6 {
127+ if let Some ( fee) = update. protocol_swap_fee_e6 {
122128 self . protocol_swap_fee_e6 = fee;
123129 }
124-
125- if let Some ( floor) = priority_fee_tax_floor {
130+ if let Some ( floor) = update. priority_fee_tax_floor {
126131 self . priority_fee_tax_floor = floor;
127132 }
133+ if let Some ( enabled) = update. jit_tax_enabled {
134+ self . jit_tax_enabled = enabled;
135+ }
136+ if let Some ( wo) = update. withdraw_only {
137+ self . withdraw_only = wo;
138+ }
128139 }
129140
130141 fn mev_tax ( & self , priority_fee_wei : u128 ) -> u128 {
@@ -148,7 +159,9 @@ pub struct L1FeeUpdate {
148159pub struct L2FeeUpdate {
149160 pub protocol_tax_fee_e6 : Option < u32 > ,
150161 pub protocol_swap_fee_e6 : Option < u32 > ,
151- pub priority_fee_tax_floor : Option < u128 >
162+ pub priority_fee_tax_floor : Option < u128 > ,
163+ pub jit_tax_enabled : Option < bool > ,
164+ pub withdraw_only : Option < bool >
152165}
153166
154167#[ cfg( test) ]
@@ -162,7 +175,9 @@ mod tests {
162175 protocol_tax_fee_e6 : 2000 ,
163176 creator_swap_fee_e6 : 3000 ,
164177 protocol_swap_fee_e6 : 4000 ,
165- priority_fee_tax_floor : floor
178+ priority_fee_tax_floor : floor,
179+ jit_tax_enabled : false ,
180+ withdraw_only : false
166181 }
167182 }
168183
@@ -210,7 +225,9 @@ mod tests {
210225 cfg. update_fees ( L2FeeUpdate {
211226 protocol_tax_fee_e6 : None ,
212227 protocol_swap_fee_e6 : None ,
213- priority_fee_tax_floor : Some ( 42 )
228+ priority_fee_tax_floor : Some ( 42 ) ,
229+ jit_tax_enabled : None ,
230+ withdraw_only : None
214231 } ) ;
215232 assert_eq ! ( cfg. priority_fee_tax_floor, 42 ) ;
216233 }
@@ -221,7 +238,9 @@ mod tests {
221238 cfg. update_fees ( L2FeeUpdate {
222239 protocol_tax_fee_e6 : Some ( 9999 ) ,
223240 protocol_swap_fee_e6 : None ,
224- priority_fee_tax_floor : None
241+ priority_fee_tax_floor : None ,
242+ jit_tax_enabled : None ,
243+ withdraw_only : None
225244 } ) ;
226245 assert_eq ! ( cfg. priority_fee_tax_floor, 100 ) ;
227246 assert_eq ! ( cfg. protocol_tax_fee_e6, 9999 ) ;
@@ -233,10 +252,14 @@ mod tests {
233252 cfg. update_fees ( L2FeeUpdate {
234253 protocol_tax_fee_e6 : Some ( 111 ) ,
235254 protocol_swap_fee_e6 : Some ( 222 ) ,
236- priority_fee_tax_floor : Some ( 333 )
255+ priority_fee_tax_floor : Some ( 333 ) ,
256+ jit_tax_enabled : Some ( true ) ,
257+ withdraw_only : Some ( true )
237258 } ) ;
238259 assert_eq ! ( cfg. protocol_tax_fee_e6, 111 ) ;
239260 assert_eq ! ( cfg. protocol_swap_fee_e6, 222 ) ;
240261 assert_eq ! ( cfg. priority_fee_tax_floor, 333 ) ;
262+ assert ! ( cfg. jit_tax_enabled) ;
263+ assert ! ( cfg. withdraw_only) ;
241264 }
242265}
0 commit comments