Smart Contract For Freelance Platform ETH & TON Blockchains
Samples:
https://drive.google.com/file/d/1cCPQP_lWqhaIp3rUAszIJyLrcLHcDruY/view?usp=drive_link
https://drive.google.com/file/d/1-_JtvZ5utULzwoNUtu0YKIC0evwH_JOz/view?usp=drive_link
Smart Contract Description for Blockchain-Based Freelance Platform with Jury trial
1. Introduction:
This smart contract implements the functionality of a freelance platform on the blockchain. It supports operations on both Ethereum and TON networks, utilizing ERC-20 tokens as the currency for transactions between clients and freelancers.
2. Order Creation:
When a client decides to create an order, they deploy a smart contract on the blockchain to initiate the transaction. The following parameters are defined within this contract:
- Order cost
- Order completion time (with the option to extend)
- Escrow payment from the freelancer (as a percentage of the order cost, utilized in case of disputes)
- Identifier and hash checksum of the order conditions stored in the database
3. Response from Potential Freelancers:
Freelancers can respond to the order by initiating a transaction with an escrow payment. The client can select multiple freelancers, but only the first one to accept becomes the active executor. Escrow payments are returned to non-selected freelancers.
4. Order Execution:
The smart contract enters the execution state. The client can extend the order completion time, while the freelancer can append solutions to the order, with these solutions being stored similarly to the order conditions.
5. Order Closure and Disputes:
Upon the expiration of the completion time or upon early termination, the client either accepts or rejects the freelancer's solution. In the case of acceptance, funds are transferred to the freelancer's address, and the smart contract transitions to a closed deal state. If rejected, the smart contract enters a dispute state.
6. Dispute State:
In this state, information about the order (conditions and solutions) becomes public. Judge-like participants, referred to as jurors, vote on the dispute, and any user can participate as a juror. Jurors provide an escrow payment and vote for either the client or the freelancer. Each address is allowed only one vote. The smart contract rewards the winner and refunds the escrow payments of jurors who supported the winning side.
7. Dispute Resolution:
Upon completion of the voting, the smart contract transitions back to a closed deal state. The winner receives the payment, and jurors who supported the winner receive their escrow payments back. The losing party does not receive payment, and jurors who supported it do not receive refunds.
8. Closed Deal State:
In this state, the smart contract is accessible only for reading, and no further interactions are allowed.
ZIP archive with smart contract and 30 min consult on how to deploy it