-- Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. -- SPDX-License-Identifier: Apache-2.0 module Iou where import Daml.Script template Iou with issuer : Party owner : Party amount : Int currency : Text where signatory issuer observer owner choice Transfer : ContractId Iou with newOwner : Party controller owner do create this with owner = newOwner run = script do bank <- allocateParty "Bank" alice <- allocateParty "Alice" bob <- allocateParty "Bob" cid <- submit bank do createCmd Iou with issuer = bank owner = alice amount = 10 currency = "USD" submit alice do exerciseCmd cid Transfer with newOwner = bob