Skip to content

parulsingh23/smart_contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

                      **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>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published