Skip to main content

Interface

Storage#

variable seller       : address = @tz1MZrh8CvYkp7BfLQMcm6mg5FvL5HRZfACw
variable buyer        : address = @tz1MZrh8CvYkp7BfLQMcm6mg5FvL5HRZfACw
variable taxcollector : address = @tz1MZrh8CvYkp7BfLQMcm6mg5FvL5HRZfACw
variable price        : tez = 0tz
constant taxrate      : rational = 20%
constant securityrate : rational = 110%
constant deadline     : date = now + 1d
states = | Created initial | Aborted | Funded | InTransit | Completed

Entry points#

Transitions#

transition abortCreated () {  called by buyer  from Created  to Aborted}
transition abortFunded () {  called by buyer  from Funded  to Aborted}
transition abort () {  from any  to Aborted when { now > deadline }}

Fund#

transition fund () {  called by buyer  from Created  to Funded when { transferred >= (100% + taxrate + securityrate) * price }}

Complete#

transition complete () {  called by buyer  from Funded  to Completed  with effect {    ...  }}