Solidity tutorial on medium – 介质坚固性教程区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Solidity tutorial on medium – 介质坚固性教程区块链毕设代写 是一篇很好的国外资料

Solidity tutorial on medium

Article series can be found on my Medium profile!

Introduction

This project that I call it Delance (Decentralized Freelance), is just for education purpose and no more. After a walk through all of these series, you will be able to build your next great idea on the blockchain. (Of course, if blockchain is necessary for you and could improve your business.)

What this project is all about?

In this project, we are going to build a freelancing platform. our participants in the project are the freelancer and employer. All of the freelancing projects have two important attributes: deadline and price. The employer usually likes to get the project before the deadline and the freelancer needs to get the project fee once he delivered the project. The freelancer may also want to break the project to a couple of parts and request for payment after finishing each part. On the other hand, the employer would like to have some guarantee to make him sure the project will be delivered before the deadline.

Suppose the freelancer and employer get familiar together on twitter and make some agreement about the project price and the deadline. The employer doesn’t want to deposit all of the payments before getting the project and the freelancer doesn’t want to start the project before getting any payment. He doesn’t even know about the financial situation of the employer. Does the employer have enough money to pay? Here we can use a smart contract: a self-executing contract with the terms of the agreement🔥

Delance lifecycle

1. The employer will create a smart contract that accepts three arguments: the freelancer address, the deadline, and the project fee. The important thing here is the project fee is not just a number. the employer should deposit some ether in the smart contract. the balance of the smart contract will be the project fee. the image below shows the HTML form that the employer used to create a contract. notice that we don’t have an input for price. the employer should deposit some ether through his/her wallet while creating the contract. if no ether is sent, an Error will throw in the contract codes.

Solidity tutorial on medium - 介质坚固性教程

2. The freelancer can check the contract properties to see if the deadline and the project fee are matching with their agreements or not(the freelancer can find the contract on the blockchain. the contracts are also can be visible in our interface). If everything was right, the freelancer start the project. When the project reached a good point, the freelancer can create a request and ask for some amount of ether. the image below shows the HTML form that the freelancer used to create a request for payment.

Solidity tutorial on medium - 介质坚固性教程

3. We show all of the project details in our interface. the employer will see the freelancer requests and can unlock each of them. after that, the freelancer can withdraw the ether in just one click. the payments will be in his wallet up to 1 minute later. Below image shows you all of the project details

Solidity tutorial on medium - 介质坚固性教程

Delance rules

Imagine the employer have a web development project. the project fee is 1 ether:

1. The freelancer has done the frontend stuff and creates a request with an amount of 0.3 ether. after the creation of a request, the freelancer should wait for the employer to unlock the request. then, the freelancer can withdraw ethers. freelancers cannot withdraw any amount of ether that is in the smart contract without the employer’s permission.

2. If the project ends before the deadline, the employer can mark the project as a completed and all of the remaining amounts of ethers that exist in the contract will be withdraw to the freelancer wallet. for example, the freelancer has got 0.8 ether so far. 0.3 for frontend and 0.5 for the backend. once the project is done, the employer change project status to complete and then, 0.2 ether will automatically transfer to the freelancer address.

3. If the deadline reached and the freelancer wasn’t able to deliver the final version, the employer has two option:

  • The employer can increase the deadline: in this case, the freelancer would have extra time for delivering the project.
  • The employer can cancel the project: in this case, all of the remaining ethers in the smart contract will be withdraw to the employer address. for example, the employer has unlocked 0.3 ether for the ‘frontend request’ and get the front-end codes. the freelancer got stuck in the backend and cannot deliver the project. If the deadline reached, the employer may cancel the project and 0.7 ether will automatically transfer to the freelancer address.

back to top

We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Learn more.

npm i


关于介质的固体教程

文章系列可以在我的媒体简介上找到!

简介

这个我称之为Delance(分散自由职业者)的项目,只是为了教育目的而不是更多。在浏览完所有这些系列之后,您将能够在区块链blockchain上构建下一个伟大的创意。(当然,如果区块链blockchain对您是必要的,并且可以改善您的业务。)

这个项目是关于什么的?

在这个项目中,我们将构建一个自由职业者平台。我们的项目参与者是自由职业者和雇主。所有的自由职业者项目都有两个重要的属性:期限和价格。雇主通常喜欢在截止日期前拿到项目,而自由职业者需要在项目交付后获得项目费用。自由职业者也可能想打破项目的几个部分,并要求付款后完成每个部分。另一方面,业主希望得到一些保证,以确保工程能在截止日期前交付。

假设自由职业者和雇主在twitter上很熟悉,就项目价格和截止日期达成了一些协议。雇主不想在得到项目之前存入所有的付款,自由职业者也不想在得到任何付款之前就开始项目。他甚至不知道雇主的经济状况。雇主有足够的钱支付吗?这里我们可以使用一个智能合约:一个带有协议条款的自动执行合约🔥

Delance生命周期

1。雇主将创建一个智能合同,接受三个参数:自由职业者地址、截止日期和项目费用。这里重要的是项目费用不仅仅是一个数字。雇主应该在智能合约中存入一些乙醚。智能合约的余额将是项目费用。下图显示了雇主用于创建合同的HTML表单。请注意,我们没有价格输入。雇主在签订合同时,应通过钱包存入一些乙醚。如果没有发送乙醚,则合同代码将出现错误。

Solidity tutorial on medium - 介质坚固性教程

2。自由职业者可以检查合同属性,看看截止日期和项目费用是否符合他们的协议(自由职业者可以在区块链blockchain上找到合同)。合同也可以在我们的界面上看到)。如果一切都是对的,自由职业者开始这个项目。当项目达到一个好的点,自由职业者可以创建一个请求,并要求一些以太。下图显示了自由职业者用来创建付款请求的HTML表单。

Solidity tutorial on medium - 介质坚固性教程

3。我们在界面中显示所有的项目细节。雇主将看到自由职业者的要求,并可以解锁他们每一个。在那之后,自由职业者只需点击一下就可以取出乙醚。付款将在1分钟后在他的钱包里。下图显示了所有项目的详细信息

<Solidity tutorial on medium>

Delance规则

假设雇主有一个web开发项目。项目费用为1乙醚:

1。自由职业者已经完成了前端工作,并创建了一个0.3以太的请求。创建请求后,自由职业者应该等待雇主解锁请求。然后,自由职业者可以撤回以太。未经雇主许可,自由职业者不得提取智能合约中的任何数量的乙醚。

2。如果项目在截止日期前结束,雇主可以将项目标记为已完成,合同中存在的所有剩余以太金额将被提取到自由职业者钱包中。例如,自由职业者到目前为止有0.8乙醚。前端0.3,后端0.5。一旦项目完成,雇主改变项目状态为完成,然后,0.2乙醚将自动转移到自由职业者的地址。

3。如果截止日期到了,而自由职业者不能提供最终版本,雇主有两个选择:

  • 雇主可以延长截止日期:在这种情况下,自由职业者将有额外的时间来交付项目。
  • 业主可以取消项目:在这种情况下,智能合同中所有剩余的以太网将撤回到业主地址。例如,雇主为“前端请求”解锁了0.3以太,并获得了前端代码。自由职业者被困在后端,无法交付项目。如果截止时间到了,雇主可以取消项目,0.7乙醚将自动转到自由职业者的地址。在

⬆ 返回顶部

我们使用可选的第三方分析Cookie来了解您如何使用GitHub.com网站所以我们可以制造更好的产品。了解更多。

npm i

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/18882.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » Solidity tutorial on medium – 介质坚固性教程区块链毕设代写

提供最优质的资源集合

立即查看 了解详情