Contract purpose

Smart Contract that simulates a testament/will. The creator adds the beneficiaries and sets an interval after which, if the does not interact with the contract, it means he died and the beneficiaries can ask for their money. After the money is distributed according to the testator's wish, the contract equally divides between the beneficiaries any savings left in the contract balance and self destructs.

Contract parameters

name: the name of the testator

checkTime : the time interval at which the testator has to interact with the contract to still be considered alive

Exposed methods and variables

issueTime shows the time when the will was created

testator returns the address of the testator

savings indicates the amount of money will be distributed to the beneficiaries

lastCheckIn show the time when the testator last interacted with the contract

setFortune allows the testator to send its savings to the contract balance

parameter nametypedetails
_savingsintegerthe amount of money sent to the contract

increaseFortune allows the testator to increase the amount of savings he previously set

parameter nametypedetails
_savingsintegerthe amount of money sent to the contract

addBeneficiary called by the testator whenever he wants to add a new beneficiary to his will

parameter nametypedetails
_namestringname of the beneficiary
_relationstringwhat relationship is between the testator and beneficiary
_addrethereum addressthe address of the beneficiary
_amountintegerthe amount of money this beneficiary will receive

checkIn called by the testator before the checkTime expires to signal that he is still alive

moneyRequest called by any beneficiary to request his money. If the testator has not interact with the contract for more time than the checkTime, it is assumed that he is dead, the money will be distributed to the beneficiaries and the contract will self destruct.

parameter nametypedetails
successbooltrue if the money were distributed, false otherwise
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract