Here is my templets looks like
module Example where
import Daml.Script
template Onboarding
with
csd : Party
issuer : Party
globalCustodian : Party
localCustodian : Party
servicesProvider :Party
votingParty : Party
where
signatory issuer
observer csd
controller issuer can
CreateMeeting : ContractId Meeting
with
title : Text
details : Text
regulator : Party
do
create Meeting
with
globalCustodian
localCustodian
csd
issuer
title
details
observers = [regulator, csd, votingParty]
template Meeting
with
globalCustodian: Party
localCustodian: Party
issuer : Party
csd : Party
title : Text
details : Text
observers : [Party]
--nameOfVoter :Text
where
signatory issuer
--key (issuer, title) : AccountKey
-- maintainer key._1
observer observers
controller csd can
nonconsuming SendEntitlementNotification : ContractId EntitlementNotification
with
votingParty : Party
noOfVotes : Int
regulator : Party
nameOfVoter : Text
do
create EntitlementNotification with
globalCustodian
regulator
meeting = this
votingParty
noOfVotes
nameOfVoter
observers= [regulator, localCustodian, globalCustodian, votingParty]
controller issuer can
nonconsuming SendMeetingResults: ContractId MeetingResults
with
results: Text
--localCustodian: Party
regulator: Party
do
create MeetingResults with
meeting = this
results
observers = [regulator, localCustodian, globalCustodian]
voters=[]
template EntitlementNotification
with
globalCustodian: Party
regulator: Party
meeting : Meeting
votingParty : Party
noOfVotes : Int
observers : [Party]
nameOfVoter : Text
where
signatory meeting.csd
key (votingParty, nameOfVoter) : (Party, Text)
maintainer key._1
observer observers
controller votingParty can
SendMeetingInstructions : ContractId MeetingInstructions
with
instructions : Text
localCustodian : Party
nameofvoter : Text
do
create MeetingInstructions with
globalCustodian
regulator
meeting
votingParty
localCustodian
instructions
nameOfVoter
noOfVotes
observers =[localCustodian, votingParty, regulator]
template MeetingInstructions
with
nameOfVoter : Text
noOfVotes : Int
globalCustodian: Party
regulator: Party
meeting : Meeting
votingParty : Party
localCustodian : Party
instructions : Text
observers : [Party]
where
signatory votingParty
observer observers
controller localCustodian can
VoteExecution : ContractId ExecuteVote
do
create ExecuteVote with
nameOfVoter
noOfVotes
instructions
globalCustodian
localCustodian
meeting
regulator
observers = [localCustodian, globalCustodian, votingParty, regulator]
template ExecuteVote
with
nameOfVoter : Text
noOfVotes : Int
instructions : Text
regulator: Party
meeting : Meeting
localCustodian : Party
globalCustodian: Party
observers : [Party]
where
signatory localCustodian
observer observers
controller meeting.issuer can
AcceptVote: ContractId VoteAcceptance
do
create VoteAcceptance with
nameOfVoter
noOfVotes
instructions
globalCustodian
regulator
observers= [localCustodian, globalCustodian, regulator]
meeting
template VoteAcceptance
with
nameOfVoter : Text
noOfVotes : Int
instructions : Text
globalCustodian: Party
meeting : Meeting
regulator: Party
observers :[Party]
where
signatory meeting.issuer
observer observers
template MeetingResults
with
meeting: Meeting
observers :[Party]
results: Text
voters: [Party]
where
signatory meeting.issuer
observer observers
setup = script do
csd <- allocateParty "CSD"
compx <- allocateParty "Compx"
local <- allocateParty "Local"
global <- allocateParty "Global"
-- regu <- allocateParty "SEBI"
sp <- allocateParty "ServiceProvider"
joh <- allocateParty "Vp"
poff <- submit compx do
createCmd Onboarding with
csd = csd
issuer = compx
localCustodian = local
globalCustodian = global
servicesProvider = sp
votingParty = joh
pure ()
The script result is shows 1 active contract but when i do the command daml start i unable to view this contract
This is my **daml.yaml ** looks like
# for config file options, refer to
# https://docs.daml.com/tools/assistant.html#project-config-file-daml-yaml
sdk-version: 1.13.1
name: DEMO_2
version: 0.1.0
source: daml
init-script: Example:setup
parties:
- Compx
- CSD
- SEBI
- Global
- Local
- ServiceProvider
- Vp
version: 0.0.1
dependencies:
- daml-prim
- daml-stdlib
- daml-trigger
- daml-script
sandbox-options:
- --wall-clock-time
Any quick suggestions?