30 Days of Solidity
馃搼Day {06} in becoming a Solidity developer

Today is the sixth day of class. Seeing Teacher Qiuqiu's recommendation, let's keep track of our learning journey here. Today's class focused on developing a digital piggy bank. I diligently studied and practiced, and it was quite rewar
ding. The most significant part was the challenges I encountered and resolved during development and debugging, which gave me a great sense of accomplishment.
The two main functions in the code are: deposit and withdrawal.
Question 1: I got an error when making a deposit. After analysis, I discovered that I omitted a variable during the constructor initialization. This variable failed the check during the deposit.
Question 2: After the deposit, where did the money go from my address? This question involves Ethereum's account model. After consulting AI, I learned:
路 Smart contracts can store Ether.
路 Ethereum's account model: external accounts and contract accounts.
Question 3: When executing a withdrawal, the code kept throwing errors.After some troubleshooting, I realized that I hadn't correctly entered the function parameters in the Remix IDE deployment interface. However, after this round of exploration, I've become much more familiar with Remix IDE. I've experienced debugging, switching wallets, compiling and deploying versions, and so on.
Finally, a question arises regarding withdrawals. The withdrawal amount is a parameter I enter myself, so this value is arbitrary. If the smart contract can send this withdrawal to my address, then I seem to be able to create Ether at will. How does Ethereum handle this problem? In short, a smart contract cannot transfer Ether it doesn't own.
That concludes my learning experience today.Future courses will be even more exciting, and I'll continue to share more of my insights.

