A well-known problem for cryptocurrency holders is that all funds are lost if the owner is incapacitated and has not shared their private key with anyone else. For this week's submission, you are expected to write a smart contract that will send all of its balance to a pre-set address if the owner of that contract has not called a still_alive
function on the contract in the last 10 blocks.
Before starting this assignment: Please make sure you complete the first 3 modules of the CryptoZombies smart contract course:
These modules will provide you with the necessary foundation to complete this assignment.
Exercise:
- Design, write, and deploy a deadman's switch contract to Goerli or Sepolia testnet.
Deadline: 26th September 2024 (Thursday) - 2 weeks from now
- Fork this repository
- Clone your forked repository to your local machine
- Create a new branch for your changes:
git checkout -b <your_name>_solution_week_2
- Implement the Deadman's Switch contract in
DeadmansSwitch.sol
- Commit your changes and push to your forked repository
- Create a pull request to the original repository
- Introduction to Remix IDE
- How to Compile and Deploy Smart Contracts using Remix
- Interacting with Smart Contracts in Remix
- Open Remix IDE in your browser
- Create a new file called
DeadmansSwitch.sol
and paste your contract code - Compile the contract using the Solidity Compiler tab
- Switch to the Deploy & Run Transactions tab
- Select the appropriate environment (Injected Web3 for MetaMask)
- Deploy the contract with the required constructor parameters
- After deployment, copy the contract address
- The address of your deployed contract on Goerli or Sepolia testnet
Example:
0x1234567890123456789012345678901234567890
- Link to your GitHub Pull Request with the implemented contract
Head over to the Coursework link: https://forms.gle/qWAdJtf91Zs3RgGx9 to submit your work.
Inform your UniDAO lead once the submission has been made.
Feel free to ask any sort of doubts on Discord.