evm-booking

EVM smart contract for ERC20 backed time slot booking
Info | Log | Files | Refs | README

intro.texi (2320B)


      1 @chapter Overview
      2 
      3 This EVM smart contract allows exchanging ERC20 tokens for generic serial units. 
      4 
      5 The primary use-case is time-slot booking.
      6 
      7 Unit ranges may also be reserved for collective use. In this case, token holders must pledge a proportional amount of their holdings towards the shared units.
      8 
      9 
     10 @section Example
     11 
     12 Alice and Bob hold @samp{TIME} vouchers.
     13 
     14 Each @samp{TIME} voucher unit represents one hour of time with a really comfortable hammock on the beach.
     15 
     16 Unfortunately, the beach is not accessible all the time, because local technocrat authorities have decided to close the beach for the public every day from 6pm to 6am on every weekday, to protect people from their own pleasure-seeking.
     17 
     18 Their trusted friend Trent publishes the @samp{evm-booking} contract, to manage hammock time for the coming month.
     19 
     20 The month has 30 days. The period starts on a wednesday (6am) and ends on a friday (6am).
     21 
     22 The period has 22 weekdays and 8 weekend days. This translates to @math{(22 * 12) + (8 * 24) = 264 + 192 = 456} hours of available hammock time.
     23 
     24 456.00 @samp{TIME} vouchers are minted (two decimal places).
     25 
     26 Since Alice paid more for the hammock, she gets 60% of the time. Thus Alice has 273.6 and Bob has 182.4.
     27 
     28 
     29 @subsection Collective use
     30 
     31 Alice and Bob decide that they will rent the hammock out on weekends through Trent, and share in the proceeds. The rest of the time, they can reserve hammock time for themselves, or sell hammock time on to others.
     32 
     33 Trent reserves 192 hours in the contract for collective use, and Alice and Bob has to pledge @math{192 * 60% = 115.2} and @math{192 * 0.4 = 76.8} vouchers respectively to cover that use.
     34 
     35 Trent will be selling hammock time for @dfn{Generic Fiat Currency (GFC)}, and will get 30% off the top for the bother.
     36 
     37 
     38 @subsection Individual use
     39 
     40 Alice spends a total of 100 hours on the hammock. Her remaining 15.2 hours are unused, during which time the hammock is very lonely.
     41 
     42 Bob sells 10 hours of hammock use to each Carol and Dave, and uses every bit of remaining time himself.
     43 
     44 Dave is too busy for hammocking. He spends 2 hours and sells 8 remaining hours to Frank.
     45 
     46 
     47 @subsection Fruits of use
     48 
     49 Trent was able to cash in a tidy 200 GFC for the time. He takes 60 GFC for himself. According to their shares, Alice gets 84 GFC and Bob gets 56 GFC.