@@ -326,11 +326,15 @@ var (
326326 npa := common .GetNPASelection (cfg )
327327 txCfg := common .GetTransactionConfig ()
328328
329- var rawAppID string
329+ var (
330+ rawAppID string
331+ manifest * buildRofl.Manifest
332+ deployment * buildRofl.Deployment
333+ )
330334 if len (args ) > 0 {
331335 rawAppID = args [0 ]
332336 } else {
333- _ , deployment : = roflCommon .LoadManifestAndSetNPA (cfg , npa , deploymentName , & roflCommon.ManifestOptions {
337+ manifest , deployment = roflCommon .LoadManifestAndSetNPA (cfg , npa , deploymentName , & roflCommon.ManifestOptions {
334338 NeedAppID : true ,
335339 NeedAdmin : true ,
336340 })
@@ -353,6 +357,12 @@ var (
353357 cobra .CheckErr (err )
354358 }
355359
360+ fmt .Printf ("WARNING: Removing this ROFL app will DEREGISTER it, ERASE any on-chain secrets and local configuration!\n " )
361+ fmt .Printf ("WARNING: THIS ACTION IS IRREVERSIBLE!\n " )
362+ if ! common .GetAnswerYes () {
363+ common .Confirm (fmt .Sprintf ("Remove ROFL app '%s' deployed on network '%s'" , appID , npa .NetworkName ), "not removing" )
364+ }
365+
356366 // Prepare transaction.
357367 tx := rofl .NewRemoveTx (nil , & rofl.Remove {
358368 ID : appID ,
@@ -363,6 +373,14 @@ var (
363373 cobra .CheckErr (err )
364374
365375 common .BroadcastOrExportTransaction (ctx , npa , conn , sigTx , meta , nil )
376+
377+ // Update manifest to clear the corresponding deployment section.
378+ if manifest != nil {
379+ delete (manifest .Deployments , deploymentName )
380+ if err = manifest .Save (); err != nil {
381+ cobra .CheckErr (fmt .Errorf ("failed to update manifest: %w" , err ))
382+ }
383+ }
366384 },
367385 }
368386
0 commit comments