Smart Contract – 智能合约区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Smart Contract – 智能合约区块链毕设代写 是一篇很好的国外资料

Smart Contract

Our new startup company has created an Ethereum-compatible blockchain to help on our finances, increase transparency and to automate accounting and auditing. We used the Solidity smart contract to complete this project.

First we created an AssociateProfitSplitter contract. In this contract we accept Ether into the contract and divide the Ether evenly among the associate level employees. This allows the Human Resources department to pay employees quickly and efficiently.

In our company’s management level we created a TieredProfitSplitter that distributes different percentages of incoming Ether to the corporate officers at different tiers. In this contract the CEO gets paid 60%, CTO 25%, and Bob, the VP gets 15%.

We used Remix IDE, Ganache ( and MetaMask to create, compile and deploy the contracts.

To create AssociateProfitSplitter contract, we did the following:

  • Created the public variables, set payable to each employee’s address;

  • Created a constructor function that accepts ether;

  • Created balance function to set to `public view returns(uint)’;

  • Created deposit function set to public payable to ensure only the owner can call the function;

  • We used msg.value to account for any leftover wei and send it back to Human Resources.

To create TieredProfitSplitter contract, we did the following:

  • Calculated rudimentary percentages for different tiers of employees (CEO, CTO, and Bob).

  • Calculated the number of points by dividing msg.value by 100.

  • Multiplied the points with a number representing a percentage, points * 60, 25 or 15 which would output a number that is corresponding to the tiers of the msg.value.

  • Transferred the amount to each employee, setting the amount to equal the points multiplied by their given percentage.

  • Send the remainder to the employee with the highest percentage by subtracting total from msg.value.

We successfully deployed the contracts. Please see the attached screenshots.







  • 创建了公共变量,设置为每个员工的地址
  • 创建了一个接受以太的构造函数
  • 创建了平衡函数,将其设置为“公共视图返回(uint)”
  • 创建了设置为公共应付的存款功能,以确保只有所有者才能调用该功能
  • 我们使用msg.value来说明剩余的wei,并将其发送回人力资源部


  • 通过将msg.value除以100来计算点数。
  • 将点数乘以一个表示百分比的数字,即点*60、25或15,这将输出一个与msg.value层对应的数字
  • 将金额转移给每位员工,将金额设置为等于点数乘以他们给定的百分比
  • 通过从msg.value中减去total,将剩余部分发送给百分比最高的员工
  • 通过从msg.value中减去total,将剩余部分发送给百分比最高的员工



区块链毕设网(全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » Smart Contract – 智能合约区块链毕设代写


立即查看 了解详情