Welcome to the SimpleBank smart contract challenge! This is a beginner-friendly Solidity assignment meant to help you practice writing and understanding a smart contract with state variables, mappings, and ether transfers.
You’ve been given a Solidity contract file SimpleBank.sol that has some blanks (marked with // TODO: ____). Your job is to:
- Fill in the missing parts of the contract.
- Make sure it compiles and deploys correctly on Remix IDE.
- Push your completed code to your GitHub fork and raise a PR.
-
Create a fork of this repository
Go to the top-right of this repo page and click the
Forkbutton. This will create your own copy of the repo. -
Clone your fork locally
Open your terminal and run the following:
git clone https://github.com/YOUR_USERNAME/SimpleBank.git cd SimpleBank -
Create a new branch with your name
Replace
your_namewith your actual name:git checkout -b your_name
-
Fill in the blanks in the smart contract
Open
SimpleBank.solin your favorite editor. You will see lines like:// TODO: Declare a public variable 'owner' of type address address public ____;
Replace the
____with the correct code. Repeat this for all TODOs. -
Test the smart contract in Remix IDE
- Go to https://remix.ethereum.org
- Create a new file called
SimpleBank.sol - Paste your modified contract code into it
- Compile it (select Solidity compiler 0.8.x)
- Deploy and test all functions:
- Deposit ether
- Withdraw ether
- View balances
- Call
contractBalance()as the owner
✅ Once everything works correctly, continue.
-
Push your branch to GitHub
git add . git commit -m "Filled blanks in SimpleBank by your_name" git push origin your_name
-
Create a Pull Request
- Go to your forked repository on GitHub
- Click "Compare & pull request"
- Set:
- Base repository = original repository you forked from
- Base branch =
main - Compare branch = your branch (
your_name)
- Title the PR as your name (e.g.,
AyeshaorRohan Singh) - Submit the PR
If you're unsure how to fill the blanks, here’s a small example:
address public owner;
mapping(address => uint) public balances;
require(msg.sender == owner, "Not the owner");
balances[msg.sender] += msg.value;
return balances[msg.sender];- A pull request from a branch with your name
- Contract should be tested and working on Remix
- Your name must be the title of the PR
Good luck and have fun learning Solidity! 🚀💻