-- SignatoriesAndObservers.daml
module SignatoriesAndObservers where
-- ── Single signatory ────────────────────────────────────
-- Only the bank must authorize creation.
-- The client observes (sees the contract) but is not a signer.
template BankDeposit
with
bank : Party
client : Party
amount : Decimal
where
signatory bank
observer client
ensure amount > 0.0
-- ── Multiple signatories ─────────────────────────────────
-- Both parties must authorize the contract.
-- This means NEITHER can create or archive it without the other.
-- Comma-separated on one line, or use the `signatory` keyword twice.
template BilateralAgreement
with
partyA : Party
partyB : Party
terms : Text
where
signatory partyA, partyB
-- ── List of observers ───────────────────────────────────
-- The observer field can be a list of parties.
template Announcement
with
issuer : Party
audience : [Party]
message : Text
where
signatory issuer
observer audience
-- ── Computed signatories ─────────────────────────────────
-- Signatories are expressions evaluated at runtime.
-- Any party in the `with` block can be used.
template ConditionalAuth
with
primary : Party
secondary : Party
amount : Decimal
where
-- If amount exceeds threshold, require both to sign.
signatory if amount > 10000.0 then [primary, secondary] else [primary]
observer secondary
ensure amount > 0.0