mirror of
https://github.com/corda/corda.git
synced 2025-01-26 06:09:25 +00:00
Tech white paper: update example from Sofus
This commit is contained in:
parent
536b79a5f2
commit
6c8996fb5e
@ -11,7 +11,8 @@
|
||||
breaklines,%
|
||||
autogobble,%
|
||||
frame=lines,%
|
||||
framesep=2\fboxsep%
|
||||
framesep=2\fboxsep,%
|
||||
fontsize=\footnotesize%
|
||||
}
|
||||
\usepackage{color}
|
||||
\usepackage{epigraph}
|
||||
@ -1184,13 +1185,15 @@ experimental \emph{universal contract} that builds on the language extension fea
|
||||
language. To avoid linguistic confusion it refers to the combined code/data bundle as an `arrangement' rather
|
||||
than a contract. A European FX call option expressed in this language looks like this:
|
||||
|
||||
\newpage
|
||||
|
||||
\begin{kotlincode}
|
||||
val european_fx_option = arrange {
|
||||
actions {
|
||||
acmeCorp.may {
|
||||
"exercise".anytime {
|
||||
acmeCorp may {
|
||||
"exercise" anytime {
|
||||
actions {
|
||||
(acmeCorp or highStreetBank).may {
|
||||
(acmeCorp or highStreetBank) may {
|
||||
"execute".givenThat(after("2017-09-01")) {
|
||||
highStreetBank.owes(acmeCorp, 1.M, EUR)
|
||||
acmeCorp.owes(highStreetBank, 1200.K, USD)
|
||||
@ -1199,7 +1202,7 @@ than a contract. A European FX call option expressed in this language looks like
|
||||
}
|
||||
}
|
||||
}
|
||||
highStreetBank.may {
|
||||
highStreetBank may {
|
||||
"expire".givenThat(after("2017-09-01")) {
|
||||
zero
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ class ActionBuilder(val actors: Set<Party>) {
|
||||
}
|
||||
}
|
||||
|
||||
fun String.anytime(init: ContractBuilder.() -> Unit): Action {
|
||||
infix fun String.anytime(init: ContractBuilder.() -> Unit): Action {
|
||||
val b = ContractBuilder()
|
||||
b.init()
|
||||
val a = Action(this, const(true), actors, b.final())
|
||||
|
Loading…
x
Reference in New Issue
Block a user