@@ -107,9 +107,9 @@ pub(crate) mod ReplaceabilityComponent {
107107 fn replace_to (
108108 ref self : ComponentState <TContractState >, implementation_data : ImplementationData ,
109109 ) {
110- // The call is restricted to the upgrade governor.
110+ // The call is restricted to the upgrade agent or upgrade governor.
111111 let roles_comp = get_dep_component! (@ self , Roles );
112- roles_comp . only_upgrade_governor ();
112+ roles_comp . only_upgrader ();
113113
114114 // Validate implementation is not finalized.
115115 assert! (! self . is_finalized (), " {}" , ReplaceErrors :: FINALIZED );
@@ -136,22 +136,19 @@ pub(crate) mod ReplaceabilityComponent {
136136 }
137137
138138 // Handle EIC.
139- match implementation_data . eic_data {
140- Option :: Some (eic_data ) => {
141- // Wrap the calldata as a span, as preparation for the library_call_syscall
142- // invocation.
143- let mut calldata_wrapper = ArrayTrait :: new ();
144- eic_data . eic_init_data. serialize (ref calldata_wrapper );
145-
146- // Invoke the EIC's initialize function as a library call.
147- let res = library_call_syscall (
148- class_hash : eic_data . eic_hash,
149- function_selector : EIC_INITIALIZE_SELECTOR ,
150- calldata : calldata_wrapper . span (),
151- );
152- assert! (res . is_ok (), " {}" , ReplaceErrors :: EIC_LIB_CALL_FAILED );
153- },
154- Option :: None (()) => {},
139+ if let Option :: Some (eic_data ) = implementation_data . eic_data {
140+ // Wrap the calldata as a span, as preparation for the library_call_syscall
141+ // invocation.
142+ let mut calldata_wrapper = ArrayTrait :: new ();
143+ eic_data . eic_init_data. serialize (ref calldata_wrapper );
144+
145+ // Invoke the EIC's initialize function as a library call.
146+ let res = library_call_syscall (
147+ class_hash : eic_data . eic_hash,
148+ function_selector : EIC_INITIALIZE_SELECTOR ,
149+ calldata : calldata_wrapper . span (),
150+ );
151+ assert! (res . is_ok (), " {}" , ReplaceErrors :: EIC_LIB_CALL_FAILED );
155152 }
156153
157154 // Replace the class hash.
0 commit comments