#Is it Possible to Update Compilation Params?

9 messages · Page 1 of 1 (latest)

celest tendon
#

Given this deployment config:

    app_factory = algorand.client.get_typed_app_factory(
        AppFactory,
        default_sender=deployer.address,
        default_signer=deployer.signer,
        compilation_params=algokit_utils.AppClientCompilationParams(
            updatable=True,
            deletable=True,
        ),
    )

    app_client, _ = app_factory.deploy(
        on_update=algokit_utils.OnUpdate.UpdateApp,
        on_schema_break=algokit_utils.OnSchemaBreak.ReplaceApp,
    )

Is it possible to update the deletable and on_schema_break attributes so subsequent deployments of the app use that or should I just call op.err() in the smart contract's delete_app method so that the app call transaction just fails?

opaque yarrow
#

What are you trying to do again?

#

If you no longer want your (subsequent) contracts to be deletable, you just change the flag to False

#

This obviously won't have an effect on any contracts that have already been created, just the ones that will be created after the change

quick venture
#

Hmm not directly addressing your question but why are you getting a typed factory from a manually defined AppFactory? If you wrote this contract when you generate a client for it you can use that Factory defined in that client

#

Not sure if you’re using algokit but if you pip install algokit-client-generator the command is algokitgen-py -a your_contract.arc56.json -o your_contract.py

Then from your_contract import YourContractFactory

#

Just double-checking

#

Regarding your question:

Is it possible to update the deletable and on_schema_break attributes so subsequent deployments of the app use that

If you didn’t define update or delete I’m pretty sure you’ll need to use OnUpdate.append first, sometimes to force-start it if you get the same app ID back you need to actually change the schema or approval program slightly to trick the deploy method into creating a new contract. Then OnUpdate.replace

If you’re deploying an identical contract for a clean instance it will ignore deleting entirely and just give you the same app ID, so you’d have to call .send.delete.your_delete_method()

or should I just call op.err() in the smart contract's delete_app method so that the app call transaction just fails?

I don’t see what this would accomplish but perhaps I’m not understanding what you’re going for here

#

Personally I just use send.create.your_create_method and send.delete.your_delete_method, if you don’t have an abimethod with create parameter set than its send.create.bare , just make sure you define a method with allow actions for UpdateApplication and DeleteApplication