Skip to content

Instantly share code, notes, and snippets.

@nemanja-da
nemanja-da / script.hs
Created February 20, 2023 15:02
ScriptCommand - OOP classes and Daml smart contract templates, an imperfect analogy
assetCid <- create Asset with ..
@nemanja-da
nemanja-da / Asset.hs
Created February 20, 2023 15:01
Asset - OOP classes and Daml smart contract templates, an imperfect analogy
template Asset
with
owner : Party
amount : Decimal
where
signatory owner
@nemanja-da
nemanja-da / AcceptedQuote.hs
Created February 20, 2023 14:59
AcceptedQuote - Accelerating open insurance 2.0 with Daml smart contracts
template AcceptedQuote
with
cargoCarrier: Party
insuranceCarrier: Party
customer: Party
cargoInfo: Text
quoteDetails: Text
where
signatory customer
observer insuranceCarrier, cargoCarrier
@nemanja-da
nemanja-da / InsuranceQuoteRequest.hs
Created February 20, 2023 14:59
InsuranceQuoteRequest - Accelerating open insurance 2.0 with Daml smart contracts
template InsuranceQuoteRequest
with
cargoCarrier: Party
insuranceCarrier: Party
customer: Party
cargoInfo: Text
where
signatory cargoCarrier
observer customer, insuranceCarrier
@nemanja-da
nemanja-da / CustomerCargo.hs
Created February 20, 2023 14:58
CustomerCargo - Accelerating open insurance 2.0 with Daml smart contracts
template CustomerCargo
with
cargoCarrier: Party
customer: Party
cargoInfo: Text
where
signatory cargoCarrier
observer customer
choice RetrieveInsuranceQuote: ContractId InsuranceQuoteRequest
@nemanja-da
nemanja-da / CargoCarrierInvitation.hs
Created February 20, 2023 14:57
CargoCarrierInvitation - Accelerating open insurance 2.0 with Daml smart contracts
template CargoCarrierInvitation
with
cargoCarrier: Party
insuranceCarrier: Party
where
signatory insuranceCarrier
observer cargoCarrier
choice AcceptInvitation: ContractId CargoCarrierRole
controller cargoCarrier
@nemanja-da
nemanja-da / Ecosystem.hs
Created February 20, 2023 14:56
Ecosystem - Accelerating open insurance 2.0 with Daml smart contracts
template Ecosystem
with
insuranceCarrier: Party
where
signatory insuranceCarrier
choice InviteCargoCarrier: ContractId CargoCarrierInvitation
with
cargoCarrier: Party
controller insuranceCarrier
@nemanja-da
nemanja-da / ApprovedTransaction.hs
Created February 20, 2023 14:55
ApprovedTransaction - Financial credit reporting & management using Daml smart contracts
template ApprovedTransaction
with
customer: Party
balance: Decimal
creditLimit: Decimal
company: Party
amount: Decimal
date: Date
authorizationSystem: Party
fraudSystem : Party
@nemanja-da
nemanja-da / TransactionRequest.hs
Created February 20, 2023 14:54
TransactionRequest - Financial credit reporting & management using Daml smart contracts
template TransactionRequest
with
customer: Party
balance: Decimal
creditLimit: Decimal
company: Party
amount: Decimal
date: Date
authorizationSystem: Party
where
@nemanja-da
nemanja-da / EnterprisePlatform.hs
Created February 20, 2023 14:53
EnterprisePlatform - Financial credit reporting & management using Daml smart contracts
template EnterprisePlatform
with
company: Party
where
signatory company
nonconsuming choice CreateCustomerRelationship : ContractId CustomerRelationship
with
customer: Party
balance: Decimal