Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. template GardeningContract
  2. with
  3. gardener : Party
  4. beneficiary : Party
  5. amount : Amount
  6. invoiceId : Text
  7. optAchId : Optional Text
  8. where
  9. signatory gardener, beneficiary
  10.  
  11. agreement partyToText gardener <> " will mow " <> partyToText beneficiary
  12. <> "'s lawn for " <> show amount <> ". The ACH transaction "
  13. <> (if optAchId /= None then "has" else "has not") <> " been settled."
  14.  
  15. controller beneficiary can
  16. SettleTransfer : ContractId GardeningContract
  17. with
  18. transferCid : TransferCid
  19. do
  20. assert (optAchId == None)
  21. transfer <- fetch transferCid
  22. assert (transfer.sender == beneficiary)
  23. assert (transfer.receiver == gardener)
  24. assert (transfer.amount == amount)
  25. assert (transfer.status == processed)
  26. assert (elem (Metadata with key = "invoiceId", value = invoiceId) transfer.metadata)
  27. create this with optAchId = Some transfer.individualAchId
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement