Skip to content

Latest commit

 

History

History
68 lines (61 loc) · 6.39 KB

README.html

File metadata and controls

68 lines (61 loc) · 6.39 KB

                      **Smart Contract**

#Escrow

##Diagram


  •                                                                                                        *
    
  •              +--------------------------------+      +---------------------+                           *
    
  •              |        modifier                |      |     function        |                           *
    
  •              +--------------------------------+      +---------------------+                           *
    
  •              |   check_on_init_installment()  |      |  prime_day_Payout() +<--------------------.     *
    
  •              |                                |      |                     |                      |    *
    
  •              +---------------+----------------+      +---------+-----------+                      |    *
    
  •                              |                                 |                                  |    *
    
  •             +----------------v---------------------------------v----------------------+           |    *
    
  •             | queryOracle(string memory url, string memory json, string memory _type) |           |    *
    
  •             +-------------------------------------------------------------------------+           |    *
    
  •             |           pendingQueries[queryId] = QueryType(true,_type);              |           |    *
    
  •             |                                                                         |           |    *
    
  •             +-------------------------------------------------------------------------+           |    *
    
  •                                                                                                   |    *
    
  •          +--------------------------------------------------------------------------------+       |    *
    
  •          |                           provable_query()                                     |       |    *
    
  •          |                                                                                |       |    *
    
  •          +----------------------------------------+---------------------------------------+       |    *
    
  •          |  if (_type == "CurrencyConversion") => |        if (_type == "DayofMonth") =>  |       |    *
    
  •          |  executes immediately                  |        executes in one day            |       |    *
    
  •          +----------------------------------------+---------------------------------------+       |    *
    
  •          |                      pendingQueries[queryId] = QueryType(true,_type);          |       |    *
    
  •          |                                                                                |       |    *
    
  •          +--------------------------------------+-----------------------------------------+       |    *
    
  •                                                 |                                                 |    *
    
  •                                                 v                                                 |    *
    
  •                                                .--.                                               |    *
    
  •                                            .--+    |                                              |    *
    
  •                                       .---+         '--.                                          |    *
    
  •                                      |  Provable Oracle |                                         |    *
    
  •                                      |                  |                                         |    *
    
  •                                       '---------+-------'                                         |    *
    
  •                                                 |                                                 |    *
    
  •                                                 |                                                 |    *
    
  •                                                 v                                                 |    *
    
  • +-----------------------------------------------+-----------------------------------------------+ |    *
    
  • |                                   _callback()                                                 | |    *
    
  • +-----------------------------------------------------------------------------------------------+ |    *
    
  • |                    require (pendingQueries[myid].exists == true);                             | |    *
    
  • +-----------------------------------------------------------------------------------------------+ |    *
    
  • |                    delete pendingQueries[myid];                                               | |    *
    
  • +------------------------------------------------+----------------------------------------------+ |    *
    
  • |     if (pendingQueries[myid].exists._type      |    if (pendingQueries[myid].exists._type     | |    *
    
  • |         == "CurrencyConvert")=>                |        == "DayofMonth")                      | |    *
    
  • |                                                |                                              | |    *
    
  • |      funds_change(1/stringToUint(result)*2);   |       split string                           | |    *
    
  • |                                                |                                              | |    *
    
  • |                                                |    if(check_if_prime(stringToUint(_day)      | |    *
    
  • |                                                |         funds_change(.01*this.balance);      | |    *
    
  • |                                                |                                              | |    *
    
  • +------------------------------------------------+---------------------+------------------------+ |    *
    
  •                                                                        |                          |    *
    
  •                                                                         '------------------------'     *
    

<script src="https://casual-effects.com/markdeep/latest/markdeep.min.js?" charset="utf-8"></script>