Cyfrin / solidity-by-example.github.io

Solidity By Example
https://solidity-by-example.org/
MIT License
614 stars 201 forks source link

Update EtherUnits.sol #266

Closed open-dev-top closed 6 months ago

open-dev-top commented 6 months ago

I made two main changes:

  1. Added comparison with the unit "gwei." This unit is commonly used according to https://eth-converter.com/.
  2. Adjusted the code style for better readability, especially for beginners: I replaced literal values in comparisons with previously defined variable names. This emphasizes that the variable has a fixed value. Additionally, I added parentheses to clarify the order of operations for beginners, preventing confusion caused by default operator precedence.

Test Description:

remix_test_result

This is the result of compiling and deploying on Remix, and I believe it indicates that everything is working fine!

One concern:

I'm not sure if I should submit to the main branch. I forked the project's default branch (gh-pages) based on a YouTube tutorial, then created my own branch, and finally submitted a pull request to gh-pages. If I've done something wrong, please let me know briefly. I just want to start contributing and mean no harm.

Not important message

I came across the web3 domain through Patrick Collins' Youtube tutorials, and he's truly remarkable! He emphasizes the importance of community repeatedly, which prompted me to make some changes. He said, "You're abusing if you only use the community without contributing." I've actually been using other people's code on GitHub for two or three years now, and I want to try contributing my first code. Solidity-by-example has become a concise guide for Solidity beginners, and I would feel honored to contribute to it!

t4sk commented 6 months ago

@open-dev-top Thanks

open-dev-top commented 6 months ago

You are welcome!

t4sk @.***>于2024年5月13日 周一下午6:21写道:

@open-dev-top https://github.com/open-dev-top Thanks

— Reply to this email directly, view it on GitHub https://github.com/solidity-by-example/solidity-by-example.github.io/pull/266#issuecomment-2107196995, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG3I4N2TRGRFDXN6W5V3NJTZCCH3LAVCNFSM6AAAAABHKRVHQOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBXGE4TMOJZGU . You are receiving this because you were mentioned.Message ID: <solidity-by-example/solidity-by-example.github.io/pull/266/c2107196995@ github.com>