Skip to content

Instantly share code, notes, and snippets.

@istovatis
Last active March 10, 2023 08:49
Show Gist options
  • Select an option

  • Save istovatis/37360493a2fb120e1254fa676ba692d2 to your computer and use it in GitHub Desktop.

Select an option

Save istovatis/37360493a2fb120e1254fa676ba692d2 to your computer and use it in GitHub Desktop.
TokenSwap
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[["AAF Provider","The Role that provides AFF"],["RWD Provider","The Role that provides RWD"]],"contractType":"Swap","contractShortDescription":"Atomically exchange of RWD and AFF tokens","contractName":"Swap of RWD and AFF tokens","contractLongDescription":"Waits until one party deposits RWD and the other party deposits dollar tokens. If both parties collaborate it carries the exchange atomically, otherwise parties are refunded.","choiceInfo":[]}
When
[Case
(Deposit
(Role "RWD Provider")
(Role "RWD Provider")
(Token "aaaaaa" "RWD")
(ConstantParam "Amount of Reward")
)
(When
[Case
(Deposit
(Role "AAF provider")
(Role "AAF Provider")
(Token "bbbbbb" "AAF")
(ConstantParam "Amount of AAF")
)
(Pay
(Role "RWD Provider")
(Party (Role "AAF provider"))
(Token "aaaaaa" "RWD")
(ConstantParam "Amount of Reward")
(Pay
(Role "RWD Provider")
(Party (Role "RWD Provider"))
(Token "bbbbbb" "AAF")
(ConstantParam "Amount of AAF")
Close
)
)]
(TimeParam "Timeout for AFF deposit")
Close
)]
(TimeParam "Timeout for RWD deposit")
Close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment