ProgramCrafter / ratelance

https://ratingers.pythonanywhere.com/ratelance/
10 stars 3 forks source link
hack-ton-berfest hacktoberfest

Ratelance

Ratelance platform poster

Ratelance is freelance platform that seeks to remove barriers between potential employers and workers.
Our goal is to create a secure, reliable and formally verified platform that makes it easy to delegate tasks.

We are focused on creating an environment of collaboration and DeTrust :handshake:, while helping individuals and businesses to

Contact us

Install

$ git clone https://github.com/ProgramCrafter/ratelance.git
$ pip3 install --upgrade tonsdk pynacl requests bitarray bitstring==3.1.9
$ cd ratelance
$ python3 cli_main.py

Pros of this system

  1. There are no TODOs in contracts; their code is hopefully final
  2. Contracts' states are simple, which makes it easier to verify their correctness
  3. Distribution of reward is flexible, which allows worker and job poster to negotiate half-payment or something more interesting
  4. System is symmetric, which allows workers to post announcements that they are ready to take some jobs
  5. Contracts are written in FunC; that ensures less errors while converting to TVM assembly than high-level languages like Tact
  6. System utilizes newest TON features, such as wallet v4 plugins
  7. CLI is almost ready to be used, it covers whole contract lifetime

Current state

Algorithm described in detail

Common user story

  1. Poster creates an job contract sending his stake (order value + fee + safety deposit) to it.
  2. An analytic message is sent by poster to pre-specified address in parallel, for job contracts to be found easier.

  3. Worker creates an offer contract in response to specified job, stores hash of order.
  4. An analytic message is sent by worker to job contract in parallel, for offer contracts to be found easier.

  5. Poster chooses an offer and sends its address (and proof that it's really an offer == StateInit) to job contract.
  6. Job contract calculates hash of current order state and sends a "collapse" request to offer contract. Job contract locks.
  7. Offer contract checks the incoming message and requests money from worker's wallet, locking meanwhile.
  8. Worker's wallet accepts message from plugin and responds with wanted amount of money.
  9. Offer contract forwards this money to job contract, destroying itself and unplugging from wallet.

  10. Job contract transforms into multisig wallet (2/4: poster, worker, Ratelance platform and TON validators)
    • poster+worker – an agreement was established, everything is OK
    • poster+Ratelance – worker has not accomplished the work, poster gets a refund
    • worker+Ratelance – poster does not accept provided work, worker gets the money
    • poster+TON validators – something done by worker is deemed so inacceptible by TON that even voting is conducted
    • worker+TON validators – heavy disagreement between poster and worker, so that Ratelance cannot be a referee
    • Ratelance+TON – order is deemed so inacceptible by TON that even voting is conducted

  11. Single-party-signed messages go to job or other pre-established address as analytic messages with minimal value.

  12. Upon receiving message with required signatures, job contract sends out TON and self-destroys.

Reverts

Possible failures

TL-B schemes

Moved to interaction.tlb.