Reading and interacting with old contracts

Is it possible to look-up, trigger or read an old contract from a new one on chain?

A use case I have in mind would be fractionalizing an NFT into say 1000 tokens (and locking the NFT into the contract).
If some one holds all tokens, this person should be able to unlock the NFT by paying all tokens back. However, either the old contract mist run forever in order to unlock the NFT, or a new contract should be able to trigger this functionality.

If both actions are not possible, I would appreciate any suggestions on how to deal with a similar case on chain (without having to trust a platform with the NFT).

Thanks a lot for your help!

Fractionalizing the NFT is possible, and you might be able to use Marlowe instead of Plutus, depending upon the details of the use case.

My understanding (which very well might be out of date because of recent changes to Plutus and Alonzo) is that the on-chain and off-chain code for a contract needs to be stored off-chain somewhere and that only the hash of the on-chain code (the validator) is permanently stored on-chain, even though the on-chain code is part of the transaction. If the location of the contract’s code is publicized, then one can run the “old” contract.

Thanks for answer.
Actually, my question was on a more technical level. I was wondering how I could lock tokens in a contract long-term and withdraw it upon interaction with another contract? (contracts usually have a life span where they just return assets to depositors if no action was taken in between). My goal was to lock some tokens forever, unless some amount of a different token was burned in exchange). Any thoughts about this matter?
Thanks anyway for your help.

1 Like

Sorry for my misunderstanding. Yes, Plutus contracts can do exactly what you describe. They don’t have a time limit or automatically return funds. They can burn tokens if they have permission. Plutus contracts can interact with each other, succeed one another, etc.

1 Like