Skip to content

Instantly share code, notes, and snippets.

View da-blog's full-sized avatar

da-blog

View GitHub Profile
transferAsset: ContractId Asset -> Party -> Update (ContractId Asset)
transferAsset assetCid recipient = do
asset <- fetch assetCid
archive assetCid
create asset with
owner = recipient
assetCid <- create Asset with ..
template Asset
with
owner : Party
amount : Decimal
where
signatory owner
data Status = NotStarted | Started | Reviewed deriving (Eq, Show)
template Task
with
lead : Party
manager : Party
developer : Party
status : Status
where
signatory lead
template Distribution
with
fromDistributor: Party
toDistributor: Party
event: Text
tickets: Int
where
signatory fromDistributor
data VerifiableCredentials = VerifiableCredentials
with
connectionid : Text
holder_did : Text
issuer_did : Text
deriving (Eq, Show)
controller healthClinic can
nonconsuming SetVerifiableCredentials : ContractId CitizenCredentialsProposal
with
template HealthClinicRole
with
operator : Party
healthclinic : Party
healthclinicdetails : HealthClinicDetails
where
signatory operator, healthclinic
key (operator, healthclinic) : (Party, Party)
maintainer key._1
template TestRequest
with
operator : Party
healthclinic : Party
citizen: Party
where
signatory citizen
observer operator
controller healthclinic can
template CitizenRole
with
operator : Party
citizen : Party
citizendetails : CitizenDetails
verifiablecredentials : VerifiableCredentials
where
signatory operator, citizen
key (operator, citizen) : (Party, Party)
data Roletype = Citizen | HealthClinic | StateHealthAgency | InsuranceCompany
deriving (Eq, Show)
template Network
with
operator : Party
where
signatory operator