5

After a contract has fulfilled its mission in life (such as pay beneficiary), is it proper to delete or disable said contract? If so, how exactly is this done?

Offhand, I would think that if the contract gets needlessly validated (for the rest of eternity [yikes!]) it would needlessly clog up the system.

2 Answers 2

1

I don't think "disabling" a contract is possible since a "contract" in Cardano is not deployed anywhere on chain. The script/contract is supplied with a transaction that wants to spend UTXOs sitting at the contract address (which is basically a hash of the script code). Anybody can construct such at transaction at any time and the validator node will need to validate it.

The network will not be congested because as others have pointed out "contracts" in Cardano are completely passive and do not run on their own. They only run if a transaction wants to spend UTXOs sitting at the script address. If somebody would want to attack the network and construct millions of such transactions to run the code it would ruin him because each transaction has to pay fees and the fees are based on the resources needed to run the script. The more computational/memory heavy the script is the more fees you have to pay.

1

I would think that if the contract gets needlessly validated (for the rest of eternity [yikes!])

Ah. This is a misunderstanding. Scripts are completely passive. Nothing gets run unless a transaction interacts with it.

So, in the case of a contract that pays a beneficiary, the script doesn't do that for you, it includes a validator that says "yes" or "no" to anyone trying to spend the UTxOs at the script address.

2
  • Ok, so allow me to rephrase: Is it correct that if all the constraints of the submitted tran end up being satisfied, then the tran stops being validated?
    – Kwaggy
    Aug 12, 2021 at 18:55
  • "constraints of the submitted tran end up being satisfied." You can build a transaction that satisfies whatever constraints you give it, but you can only interact with scripts with transactions that meet the constraints of scripts' validators. "then the tran stops being validated?" Do you mean the transaction is invalid? Any transaction that meets the constraints of the script's validator can spend UTxOs (either to take them or to update the state) from the script address. In perpetuity. That being said, there would be no reason to interact with a script that doesn't have anything to spend. Aug 12, 2021 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.