Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template GardeningContract
- with
- gardener : Party
- beneficiary : Party
- amount : Amount
- invoiceId : Text
- optAchId : Optional Text
- where
- signatory gardener, beneficiary
- agreement partyToText gardener <> " will mow " <> partyToText beneficiary
- <> "'s lawn for " <> show amount <> ". The ACH transaction "
- <> (if optAchId /= None then "has" else "has not") <> " been settled."
- controller beneficiary can
- SettleTransfer : ContractId GardeningContract
- with
- transferCid : TransferCid
- do
- assert (optAchId == None)
- transfer <- fetch transferCid
- assert (transfer.sender == beneficiary)
- assert (transfer.receiver == gardener)
- assert (transfer.amount == amount)
- assert (transfer.status == processed)
- assert (elem (Metadata with key = "invoiceId", value = invoiceId) transfer.metadata)
- create this with optAchId = Some transfer.individualAchId
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement