@@ -200,6 +200,8 @@ pub struct RefundClaimedEvent {
200200 pub total_paid : i128 ,
201201}
202202
203+ /// Per-attendee POAP metadata sent over the wire to the POAP NFT contract's
204+ /// `mint_poap` entry point. Field shape must match `poap_nft::PoapMetadata`.
203205#[ contracttype]
204206#[ derive( Clone , Debug , Eq , PartialEq ) ]
205207pub struct TicketPurchasedEvent {
@@ -785,6 +787,17 @@ impl EventManager {
785787 env. events ( )
786788 . publish ( ( Symbol :: new ( & env, "RefundClaimed" ) , ) , event) ;
787789
790+ pub fn initialize_legacy ( env : Env , ticket_factory : Address ) -> Result < ( ) , Error > {
791+ if env. storage ( ) . instance ( ) . has ( & DataKey :: TicketFactory ) {
792+ return Err ( Error :: AlreadyInitialized ) ;
793+ }
794+ upg:: set_admin ( & env, & ticket_factory) ;
795+ upg:: init_version ( & env) ;
796+ env. storage ( )
797+ . instance ( )
798+ . set ( & DataKey :: TicketFactory , & ticket_factory) ;
799+ env. storage ( ) . instance ( ) . set ( & DataKey :: EventCounter , & 0u32 ) ;
800+ upg:: extend_instance_ttl ( & env) ;
788801 Ok ( ( ) )
789802 }
790803
@@ -1183,6 +1196,27 @@ impl EventManager {
11831196 upg:: commit_upgrade ( & env) ;
11841197 }
11851198
1199+ /// Immediate (fast-path) upgrade. Admin-only, no timelock — see
1200+ /// `upgradeable::upgrade` for the full security note. Reserve for
1201+ /// emergencies; prefer `schedule_upgrade` + `commit_upgrade` for
1202+ /// routine upgrades.
1203+ pub fn upgrade ( env : Env , new_wasm_hash : BytesN < 32 > ) {
1204+ upg:: upgrade ( & env, new_wasm_hash) ;
1205+ }
1206+
1207+ /// Apply post-upgrade state-shape migrations and bump the version to
1208+ /// `target_version`. Admin-only; rejects downgrades.
1209+ pub fn migrate ( env : Env , target_version : u32 ) {
1210+ upg:: require_admin ( & env) ;
1211+ upg:: require_version_increase ( & env, target_version) ;
1212+
1213+ match target_version {
1214+ _ => { }
1215+ }
1216+
1217+ upg:: migration_completed ( & env, target_version) ;
1218+ }
1219+
11861220 pub fn pause ( env : Env ) {
11871221 upg:: pause ( & env) ;
11881222 }
0 commit comments