Snippets
Created by
LudvigOberg
last modified
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | (defcontract mortgage_deed_sub_contract ()
(fields
(sellers_bank :type pubkey :init nil)
(buyers_bank :type pubkey)
(land_registry :type pubkey :init nil)
(future_deed_holder :type pubkey :init nil)
(future_second_hand_deed_holder :type pubkey :init nil)
(current_deed_holder :type pubkey :init nil)
(buyer :type pubkey :init nil)
(buyer_1 :type pubkey :init nil)
(property_ID :type string :init nil)
(deed_amount_buyers_bank :type integer :init nil)
(deed_amount_future_deed_holder :type integer :init nil)
(contract_date :type integer :init nil)
(aktnummer :type integer :init nil)
(state :type string :init nil))
(actions
(intiate ((land-registry-pk pubkey) (sellers-bank-pk pubkey) (future-deed-holder-pk pubkey) (future-second-hand-deed-holder-pk pubkey) (current-deed-holder-pk pubkey) (buyer-local-pk pubkey) (buyer-1-local-pk pubkey))
"Invite Land registry, Sellers bank, deed holders and buyers"
(guard
(signatures buyers_bank)
(eql state nil))
(locally
(invite land-registry-pk
sellers-bank-pk
future-deed-holder-pk
future-second-hand-deed-holder-pk
current-deed-holder-pk
buyer-local-pk
buyer-1-local-pk))
(update land_registry land-registry-pk
sellers_bank sellers-bank-pk
future_deed_holder future-deed-holder-pk
future_second_hand_deed_holder future-second-hand-deed-holder-pk
current_deed_holder current-deed-holder-pk
buyer buyer-local-pk
buyer_1 buyer-1-local-pk
state :set_deed-information)
)
(set-deed-information
((property-id string) (contract-date integer) (deed-amount-buyers-bank integer) (aktnummer-local integer) (deed-amount-future-deed-holder integer))
"Input property id, contract date, deed amount and aktnummer"
(guard
(signatures buyers_bank)
(eql state :set_deed-information)
(eql property_ID nil)
(eql deed_amount_buyers_bank nil)
(eql contract_date nil)
(eql aktnummer nil)
(eql deed_amount_future_deed_holder nil)
(eql aktnummer nil)
)
(update property_ID property-id
contract_date contract-date
deed_amount_buyers_bank deed-amount-buyers-bank
deed_amount_future_deed_holder deed-amount-future-deed-holder
aktnummer aktnummer-local
state :intiate-deed-transfer)
)
(intiate-deed-transfer ()
"Buyer bank intiates deed transfer"
(guard
(signatures buyers_bank)
(eql state :intiate-deed-transfer))
(update state :buyer-approve-deed-transfer)
)
(buyer-approve-deed-transfer ()
"Buyers approves deed transfer"
(guard
(signatures buyer)
(eql state :buyer-approve-deed-transfer))
(update state :buyer-1-approve-deed-transfer)
)
(buyer-1-approve-deed-transfer ()
"Buyer 1 approves deed transfer"
(guard
(signatures buyer_1)
(eql state :buyer-1-approve-deed-transfer))
(update state :sellers-bank-approve-transfer)
)
(sellers-bank-approve-transfer ()
"Sellers bank approve deed transfer"
(guard
(signatures sellers_bank)
(eql state :sellers-bank-approve-transfer))
(update state :future-deed-holder-approves-transfer)
)
(future-deed-holder-approves-transfer ()
"future deed holder approve deed transfer"
(guard
(signatures future_deed_holder)
(eql state :future-deed-holder-approves-transfer))
(update state :current-deed-holder-approve-deed-transfer)
)
(current-deed-holder-approves-transfer ()
"Current deed holder approve deed transfer"
(guard
(signatures current_deed_holder)
(eql state :current-deed-holder-approve-deed-transfer))
(update state :land-registry-process-deed)
)
(land-registry-process-deed ()
"Land registry sets deed as pending"
(guard
(signatures land_registry)
(eql state :land-registry-process-deed))
(update state :land-registry-set-deed-as-pending)
)
(land-registry-denies-deed ()
"Land registry denies deed"
(guard
(signatures land_registry)
(eql state :land-registry-process-deed))
(update state :deed-denied)
)
(land-registry-approves-deed ()
"Land registry approves deed"
(guard
(signatures land_registry)
(eql state :land-registry-set-deed-as-pending))
(update state :deed-has-been-approved)
)
))
|
Comments (0)
You can clone a snippet to your computer for local editing. Learn more.