Inspiration

Often when I fly, I wonder what happens to my TronLink wallet if don’t come back, if my plane doe s not land. All my USDT, BTT, WIN and JST tokens will be locked for ever. After all this is the main point of TronLink wallet and Tron chain. Trustless, unhachable non custodian wallet. But in this bad scenario for sure I would like my family to have access to my tokens. Writing the private key or mnemonic in multiple pieces of paper and hiding negates the whole trusses decentralised and programmable money I so believe in. What solution can I think of?

What it does

A willFactory smart contract that allows anyone like myself to generate my own unique per account Will smart contract. The latter allows me to register my account and USSDt, BTT, JST and WIN tokens that I hold. I have to also approve this smart contract to transfer these tokens from my registered account. Then I can register the account I want my tokens to eventually be transferred to along with what percentages per heir account and a message.

My will smart contract together with the server that keeps pinning it, checks if I have pressed the HeartBeat panel or if my registered account has its balance reduced (a proof of payment energy and therefore myself being still alive). In such cases the Will smart contract resets the trigger points. Otherwise as soon as Tron Chain block number surpasses each trigger point, it update the stage of my will smart contract from 0 to 6 with 4 being the point where all my registered and approved tokens move from my account to the Will smart contract and at stage 5 these funds are dispersed to my heirs as per the percentages I set up.

How I built it

Using Solildity for the willFactory and Will smart contracts, React for the from end, TronLink Wallet for signing and Nodejs for running a server to keep pinning the smart contracts.

Challenges we ran into

Normally the Trigger Points of this project would make sense to be along the lines of 1st Trigger point once per month 2nd one per week 3rd once per 3 day, 4th in one day and 5 in 1 day.

This also makes the cost of the server pinging very minimal as it could be checking as frequently as once or twice per day. However for hack thin purposes the above time frames have to be dramatically reduced to few tens of blocks per trigger point. Trying to keep the showcase video under 5 mins would mean trigger points being apart only by only a few blocks not allowing enough time for multiple transactions to be mined and the smart contracts to showcase properly.

Accomplishments that we're proud of

This project solves the issue I describe in the inspiration section. Trusting my coding and Tron chain I now know that no matter what happens to me my account balances will not be locked for ever but distributed to my loved ones.

What we learned

It is important to design things well before coding. Initially I was transferring all balances to the smart contract at Will smart contract initiation. Instead now the Job gets done but while I am alive I do not have any restrictions to the balances of my account. When I die what is left eventually will be distributed.

What's next for HeartBeat

I will be looking to see how to design the tokenomics for the project. The server uses economy of scale as it regularly pings all active Wills but nevertheless it incurs a cost and if other automated tools are used this cost needs to be covered

Share this project:

Updates