Skip to content

Commit

Permalink
Apply renamings to the ZeroCouponBond example
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Apr 5, 2019
1 parent a7c83eb commit 71756ad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions meadow/contracts/ZeroCouponBond.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ contract :: Contract
contract = zeroCouponBond 1 2 1000 200 10 20 30

zeroCouponBond :: Person -> Person -> Integer -> Integer -> Timeout -> Timeout -> Timeout -> Contract
zeroCouponBond issuer investor notional discount startDate maturityDate gracePeriod =
zeroCouponBond creatorID counterpartyID notionalPrincipal premiumDiscount initialExchangeDate maturityDate gracePeriod =
-- prepare money for zero-coupon bond, before it could be used
Commit 1 1 investor (Constant (notional - discount)) startDate maturityDate
Commit 1 1 counterpartyID (Constant (notionalPrincipal - premiumDiscount)) initialExchangeDate maturityDate
-- issuer must commit a full notional value of a bond
(Commit 2 2 issuer (Constant notional) startDate (maturityDate + gracePeriod)
(When FalseObs startDate Null
(Commit 2 2 creatorID (Constant notionalPrincipal) initialExchangeDate (maturityDate + gracePeriod)
(When FalseObs initialExchangeDate Null
-- after start date but before maturity date the issuer can receive the bond payment
(Pay 3 1 issuer (Committed 1) maturityDate
(Pay 3 1 creatorID (Committed 1) maturityDate
(When FalseObs maturityDate Null
-- after maturity date the investor can claim bond's full value
(Pay 4 2 investor (Committed 2)
(Pay 4 2 counterpartyID (Committed 2)
(maturityDate + gracePeriod) Null Null)
)
Null
Expand Down

0 comments on commit 71756ad

Please sign in to comment.