Solidity – 坚固性区块链毕设代写

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

Solidity

In this assignment, we have created three (3) smart contracts to automate some company financial operations. The contracts were all tested on the local network and then deployed to the Kovan network.

Contract #1 – Associate Profit Splitter

Deployed on the Kovan network contract addres: 0xF7993D6746De8400926f5D02C4Da9e7fB7781397

This contract will be used by human resources to pay employees quickly and efficiently. The contract will accept ether, and divide it evenly among associate-level employees.

The three (3) associate level employees have been defined as employee _one, employee _two and employee _three. The constructor function has been used to program their payable addresses into the contract.

The deposit function will do the following 1 – Accept the deposit amount from HR 2 – Split the amount evenly among the 3 employees 3 – Transfer the respective portions to each employee 4 – Send back any potential remainder to HR

The contract will not accept deposits except through calling the deposit function.

The balance function will serve as a sort of test function to ensure that the deposit function is returning the remainders to HR. Therefore, the balance function, should always return 0.

See copy of codes here

Contract #2 -Tiered Profit Splitter

Deployed on the Kovan network contract addres: 0x6eaC22D813Fd62A78f0771a295460F7b68e670a3

This contract will be used to split profits between three (3) employees based on predetermined percentages (60%, 25% and 15%), after the amounts have been converted to points.

The employees have been defined as employee _one, employee _two and employee _three. The constructor function has been used to program their payable addresses into the contract.

The deposit function will do the following 1 – convert the deposit amount to points 2 – Apply percentage to calculate the amount for the employee 3 – Keep a running balance of the total allocated 4 – transfer the respective amounts to each employee 5 – Calculate the difference between the original deposit and the total allocated, then send this difference to employee _one.

The contract will not accept deposits except through calling the deposit function.

The balance function will serve as a sort of test function to ensure that the deposit function is executing properly. Since all of the ether should be transferred to employees, the balance function should always return 0.

See copy of codes here

Contract #3 -Deferred Equity Plan

Deployed on the Kovan network contract addres: 0x393bc81Ed5AE18fF38eF62c325B1B1f45E56B0f1

This contract will be used to manage an employee’s “deferred equity incentive plan,” which distributes 1000 shares over four years to the employee, assuming the employee is still active at the end of each vesting period. 250 shares will be distributed at the end of each vesting period which is one year (365 days).

The start time will be set as “now” and 365 days added to calculate the unlock time.

The constructor function has been used to program the employee’s payable addresses and also to set human resources as the message sender.

The distribution function will do the following 1 – Verify that the vesting period is met for unlocking 2 – Set the next unlock time 3 – Distribute shares

The contract will not accept deposits of ether.

The contract can be deactivated by either HR or the employee

See copy of codes here

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

Add AssociateProfitSplitter.sol


Solidity

在这项任务中,我们创建了三(3)个智能合约,以自动化一些公司的财务运作。这些合同都在本地网络上测试,然后部署到科万网络。

Contract #1 – Associate Profit Splitter

部署在Kovan网络上的合同地址:0xF7993D6746De8400926f5D02C4Da9e7fB7781397。

人力资源部将使用此合同快速高效地支付员工工资。合同将接受乙醚,并将其平均分配给副雇员。

三(3)名副职员工被定义为员工1、员工2和员工3。constructor函数已用于将其应付地址编程到合同中。

存款功能将执行以下操作1-接受HR的存款金额2-将金额平均分配给3名员工3-将各自的部分转移给每个员工4-将任何可能的剩余部分发送回HR

除非通过调用存款功能,否则合同不接受存款。

余额函数将作为一种测试函数,以确保存款函数将剩余部分返回给HR。因此,balance函数应始终返回0。

请参阅此处的代码副本

Contract #2 -Tiered Profit Splitter

部署在Kovan network合同地址:0x6eaC22D813Fd62A78f0771a295460F7b68e670a3

此合同将用于在三(3)名员工之间根据预定的百分比(60%、25%和15%)分配利润。

员工被定义为员工1、员工2和员工3。constructor函数已用于将其应付地址编程到合同中。

存款功能将执行以下操作1-将存款金额转换为点数2-应用百分比计算员工的金额3-保持分配总额的连续余额4-将各自的金额转移给每个员工5-计算原始存款与分配总额之间的差额,然后把这个差价寄给雇员一号。

除非通过调用存款函数,否则合同将不接受存款。

平衡函数将作为一种测试函数,以确保存款函数正确执行。由于所有员工的余额都应该被转移到ether,所以应该始终将该函数的余额返回给ether。

请参阅此处的代码副本

Contract #3 -Deferred Equity Plan

部署在Kovan network合同地址:0x393BC81ED5AE18FF38EF62C325B1F45E56B0F1

此合同将用于管理员工的“递延股权激励计划”,该计划在四年内向员工分配1000股股份,假设员工在每个授予期结束时仍然活跃。250股股票将在每个一年(365天)的授予期结束时分配。

开始时间将设置为“现在”,并添加365天来计算解锁时间。

构造器函数已用于编程员工的应付款地址,并将人力资源设置为消息发送者。

分配功能将执行以下操作1-验证是否满足解锁的授予期2-设置下一次解锁时间3-分配股票

合同不接受以太保证金。

人力资源部或员工都可以停用合同

请参阅此处的代码副本

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

Add AssociateProfitSplitter.sol

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情