Adding a time-release to ownership of ETH and ERC tokens
dETHlock will allow users to deposit ETH and a balance of one ERC#-compliant token into a "will" structure. Wills contain an owner and beneficiary addresses along with the address and balance in one ERC token. Wills also contain a "deadline" time stamp. Will owners can continue to deposit ETH and token balances at any time. The deadline is also adjustable to any time point in the future. After the deadline passes the beneficiary can also make withdrawls.
How it's made
The dETHlock contract is built with all the usual textbook contract patterns. It's "ownable", "pausable", and "upgradeable" ("Noun" being its proxy contract and "Verb" being its functional contract). Additonally it is "Accountable", being able to track excess tips in ETH withdrawlable by its owner. dETHlock maintains an array of "will" structures that are deposit records of Noun's assets and the deadline time keys before listed beneficiary addresses can make withdraws. It also maintains address maps to arrays of owned and beneficiary will records for UI convienience. All the usual deposit/withdraw and update functions are present. The React front-end currently runs in Scaffold. Using The Graph to agregate a user's wills was a late add and a 'nice to have' considering the data is already call-able and aggregated as an address map to index arrays on-chain. Note: GitHub project is on /tree/TimeLock, but the submission form would not allow branches.Technologies used