KS note – Telegram
KS note
495 subscribers
61 photos
2 files
71 links
・ Web3 & etc.

🥷⛓️🍷 @MostPow3rful
Download Telegram
started with solidity, played CTF/Challenge(s) such as HTB & Ethernaut (playing until death 🫡), Learned many things and at this point, i want to start Auditing on the past CodeHawks's First Flights 🦅✈️ and i want to write report at the specified time, then want to check other auditor's submission and compare with myself. hope to learn many things 🥷

🍷 Enjoy The Road
🦅✈️ First Flight 1️⃣
https://www.codehawks.com/contests/clnuo221v0001l50aomgo4nyn


🔴 [HIGH-0] user can access the value of s_password and s_owner variables beacuse of the storage layout. we can get the value and decode them.
cast storage $CONTRACT_ADDRESS 0 # s_owner
cast storage $CONTRACT_ADDRESS 1 # s_password

🔴 [HIGH-1] there is not any limit on setPassword() function. user can access the setPassword() function without any limit and can change the value of s_password;


⚪️ [INFO-0] should declare errors out of the contract ( make them global )
⚪️ [INFO-1] should change the name of errors.


🍷 Learned :
1️⃣ sensitive variables mustn't have the default value during deploying. deployer must pass the value to constructor and set the new value there.
📜 About Remappings in foundry ( something like alias )

🔗 https://book.getfoundry.sh/projects/dependencies#remapping-dependencies
📝 Smart Contract Layout

1️⃣ Pragma statements
2️⃣ Import statements
3️⃣ Interfaces
4️⃣ Libraries
5️⃣ Contracts


📝 Inside contract, library or interface :

1️⃣ State variables
2️⃣ Events
3️⃣ Modifiers
4️⃣ Struct, Arrays or Enums
5️⃣ Constructor
6️⃣ Fallback OR Receive function
7️⃣ External functions
8️⃣ Public functions
9️⃣ Internal functions
🔟 Private functions
🪄 Advices From Konata - white hat hacker🥷
1
🍷🥷 Thanks @solidityscan for "SolidityScan Pro Plan trial"
⚙️ Everyone should use this powerful Tool
🍾1
🐧 Learn Linux

🔗 https://linuxjourney.com/
🥷 You learn more by doing
1
🍾2