I have been looking through smart contract examples and have seen a commonality between them. The ones I have seen only lock ADA inside the smart contract. Is there a way to attach information and lock the information inside the smart contract so when a specific criteria is met, the information is released.
In addition to this question, are there any smart contract examples that are different than locking ADA and retrieving it?
A Plutus smart contract MUST lock some ADA, which would at least be the minimum amount required by any other Tx.
Additionally to that, it CAN lock native token values. For example this contract locks Astor tokens which represent pool rewards that can be collected by delegators as an extra payout.
Additionally to that, every UTxO locked by a Plutus MUST have some arbitrary datum associated with it. Perhaps this maps to your “attached information”. To be specific, the UTxO has the hash of the associated datum (not the actual datum value). When a client wants to spend that UTxO it MUST provide the correct datum (i.e. the client must know it).
You cannot query a Plutus contract for data. Clients send some redeemer & datum value together with ADA & tokens, the contract validates the Tx and if validation passes it unlocks the funds requested by the Tx. Tx validation can already happen off-chain (i.e. in the client wallet), which is a property of the deterministic nature of Plutus smart contracts.