Project Time lock contract
Introduction
Timelocks in Solidity are smart contract mechanisms designed to restrict the execution of certain smart contract functions until a specified time has passed.
This feature is crucial for various applications such as governance mechanisms in DAOs (Decentralized Autonomous Organisation), vesting schedules in DeFi, and security measures.
In the context of smart contracts, timelocks are implemented to ensure that certain actions are delayed until a predetermined time.
They would be used in situations such as :
-
Secure Fund Transfers: By scheduling transfers with Timelock, users can ensure that funds are released only after a specified waiting period. This reduces the risk of unauthorized or accidental transfers, providing an additional layer of security.
-
Vesting and Token Lock-ups: Timelocks can be used to manage the release of tokens over time usually in an Initial Coin Offering (ICO) scenario. It's helpful when you want to spread out the distribution of tokens, to make sure the project can succeed long-term without being affected by immediate cash needs.
A timelock is a piece of code that checks if an action defined in the contract can be performed after a specific time condition is met.
It uses block.timestamp
global variable that the solidity provides to check if the predefined time conditions are met. block.timestamp
returns a uint256 value of the current block’s timestamp in seconds since the UNIX epoch (i.e. January 1, 1970).
Project objective
The aim of this project is to design and develop a Smartcontract enabling the transfer of our Ether to our heirs (son(s) and daughter(s)) on our death.
It will be used as follows:
-
Once the contract is deployed, we will deposit the Ethers on it we wish to bequeath on our death.
-
Next we'll need to call up a function to initialize the two addresses to which we wish to pass our wealth on our death (these addresses can also be passed on when the contract is deployed via the constructor).
-
For every period of time (to be defined like every month, every 6 months, or even a year), we'll need to call a function to prove that we're not dead.
-
If the period of time defined above expired, then the heirs could call up a contract function to trigger the fair sharing and distribution of the Ether on their respective addresses (and which we had authorized before).
For this project we do not ask to develop a web interface.
Sources :