will-smart-contract – 智能合约区块链毕设代写

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

will-smart-contract

Solidity smart contract that performs the basic function of a will.

This contract allows the owner (a benefactor or power of attorney) to store funds in a will and add beneficiaries who can withdraw the funds when the will is active.

After the contract is deployed, the owner has the following functions available through the interface:

  • add beneficiaries

  • deposit funds

  • activate will

Beneficiaries are added using their addresses, one at a time.

Funds can be added as many times as wanted. The exception is that after the will has been activated – meaning the funds are available for withdrawal by the beneficiaries – funds can no longer be deposited. This makes sense from a practical standpoint, but also it avoids any complicated logic in the case where some beneficiaries have withdrawn funds already and others have not (meaning the allocation would need to be recalculated with that in mind).

There are a number of checks to ensure that relevant functionality is only available to the owner or the beneficiary making a call. For example, only the owner can activate the will and only the beneficiary can see their own balance.

In this simple will implementation, a withdrawal can be made only once and all of the allotted funds are transferred in a lump sum to the beneficiary (msg.sender) making the withdrawal. This implementation also automatically divides the funds equally among beneficiaries. Since Solidity doesn’t yet have full support for floating point values, it was difficult to design a way for the owner to specify a unique percentage for each beneficiary.


will-smart-contract

履行遗嘱基本功能的可靠智能合约。

本合同允许所有人(受益人或授权书)在遗嘱中储存资金,并增加受益人,在遗嘱生效时可以提取资金。

部署合同后,所有者可通过界面使用以下功能:

  • 添加受益人

  • 存款资金

  • 激活将使用其地址添加受益人,一次一个受益人。

基金可以根据需要添加多少倍。例外情况是,在遗嘱被激活后,即受益人可以提取资金,资金就不能再存入了。从实际的角度来看,这是有道理的,但也避免了在某些受益人已经提取资金而其他受益人尚未提取资金的情况下的任何复杂逻辑(这意味着需要考虑到这一点重新计算拨款)。

有许多检查,以确保相关功能仅对拨打电话的所有者或受益人可用。例如,只有所有人可以激活遗嘱,只有受益人才能看到自己的余额。

在这种简单的遗嘱执行中,提款只能进行一次,并且所有分配的资金一次性转移给受益人(消息发送者)取款。这一实施还自动将资金平均分配给受益人。由于Solidity还没有完全支持浮点值,所以很难设计一种方法让所有者为每个受益人指定一个唯一的百分比。智能合约是否会增加受益人

In this simple will implementation, a withdrawal can be made only once and all of the allotted funds are transferred in a lump sum to the beneficiary (msg.sender) making the withdrawal. This implementation also automatically divides the funds equally among beneficiaries. Since Solidity doesn’t yet have full support for floating point values, it was difficult to design a way for the owner to specify a unique percentage for each beneficiary.

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情