@@ -4,16 +4,40 @@ use option::OptionTrait;
44
55use starknet :: class_hash :: {ClassHash , Felt252TryIntoClassHash };
66
7+ // Holds EIC data.
8+ // * eic_hash is the EIC class hash.
9+ // * eic_init_data is a span of the EIC init args.
10+ #[derive(Copy , Drop , Serde , PartialEq )]
11+ struct EICData {
12+ eic_hash : ClassHash ,
13+ eic_init_data : Span <felt252 >
14+ }
15+
16+ // Holds implementation data.
17+ // * impl_hash is the implementation class hash.
18+ // * eic_data is the EIC data when applicable, and empty otherwise.
19+ // * final indicates whether the implementation is finalized.
720#[derive(Copy , Drop , Serde , PartialEq )]
821struct ImplementationData {
922 impl_hash : ClassHash ,
10- // TODO we don't need init data without eic_hash, so consolidate these into a more meaningful
11- // data structure.
12- eic_hash : ClassHash ,
13- eic_init_data : Span <felt252 >,
23+ eic_data : Option <EICData >,
1424 final : bool
1525}
1626
27+
28+ // starknet_keccak(eic_initialize).
29+ const EIC_INITIALIZE_SELECTOR : felt252 =
30+ 1770792127795049777084697565458798191120226931451376769053057094489776256516 ;
31+
32+ // Duration from implementation is eligible until it expires. (1209600 = 2 weeks).
33+ const IMPLEMENTATION_EXPIRATION : u64 = 1209600 ;
34+
35+ #[starknet:: interface]
36+ trait IEICInitializable <TContractState > {
37+ fn eic_initialize (ref self : TContractState , eic_init_data : Span <felt252 >);
38+ }
39+
40+
1741#[starknet:: interface]
1842trait IReplaceable <TContractState > {
1943 fn get_upgrade_delay (self : @ TContractState ) -> u64 ;
0 commit comments