Aca dejando my primera review al goat @PastanagaCrypto on @ethos_network
app.ethos.network/activity/r…
🔐 Avoid One of the Most Common Smart Contract Vulnerabilities: Reentrancy
When building in Web3, security must come before functionality. A single overlooked line of Solidity can cost millions.
One of the most notorious bugs in Ethereum’s history — the DAO hack — happened due to a reentrancy vulnerability.
Let’s break it down and learn how to avoid it 👇
---
Solidity’s CEI pattern is a best practice that drastically reduces your attack surface:
- ✅ Checks: Ensure valid conditions (e.g. `require` the user has enough balance)
- ✏️ Effects: Update state variables (e.g. subtract balance)
- 🔁 Interactions: Make external calls (e.g. send ETH with `.call`)
Why this order?
Because if an external call (like `recipient.call`) triggers malicious fallback logic, it can re-enter your function before the state is updated — stealing funds repeatedly. This is reentrancy.
---
🧠 Why Does CEI Work?
Solidity's transaction model means if anything in a function fails, the entire transaction reverts — including any state changes done before the failure.
So when we move the state change before the external call, even if the call fails or is exploited, everything rolls back to a safe state.
---
📚 Want to learn more?
👉 Solidity Security Docs: [docs.soliditylang.org/en/lat…](docs.soliditylang.org/en/lat…)
👉 Try tools like Slither or MythX to detect vulnerabilities in your code.
---
📸 The image shows exactly a Vulnerable vs Safe Example
#code #development #cryptocurrency #BlockchainTechnology #smartcontracts #Ethereum #SOLIDITY
64
🚀 Bringing Real-World Data On-Chain with @chainlink
Smart contracts are powerful, but they have one key limitation:
🧠 They can’t access real-world data on their own. This is known as the Oracle Problem.
So, how do we solve it?
🔗 Enter Chainlink – a decentralized oracle network (Layer 2) that enables smart contracts to securely access off-chain data.
🔍 What are Chainlink Data Feeds?
Chainlink provides Data Feeds – secure, reliable, and decentralized sources of external information (like weather, sports scores, and prices).
💰 A powerful subset: Price Feeds
These offer real-time market data (ETH/USD, BTC/USD, etc.) you can trust.
🛠 Want to see how it's implemented?
✅ Check out my contract using price feeds on Sepolia: sepolia.etherscan.io/address…
✅ Check the GitHub repo implementation: github.com/manumafe98/solidi…
📚 Learn more from the Chainlink docs: docs.chain.link/data-feeds/p…
#Solidity #Chainlink #Web3Dev #SmartContracts #Crypto
1
59
🧠 What are stablecoins?
Stablecoins are crypto assets designed to have low volatility, maintaining a value close to an external benchmark like the US Dollar 💵.
While Bitcoin’s price swings wildly, stablecoins act more like a "crypto dollar", offering steady buying power.
📚 Types of Stablecoins – 3 Key Axes
1️⃣ Collateral Origin
🔹 Exogenous: Backed by assets outside the system (e.g. USDC, DAI backed by ETH)
🔹 Endogenous: Backed by assets within the protocol (e.g. UST backed by LUNA — which failed catastrophically)
2️⃣ Price Targeting
🔸 Pegged: Value is anchored to a fiat currency (e.g. USDC, Tether, DAI)
🔸 Floating: Uses algorithms to stabilize purchasing power without a direct peg (e.g. RAI)
3️⃣ Stability Mechanism
⚙️ Governed: A team or DAO controls mint/burn (e.g. USDC, Tether)
🤖 Algorithmic: Autonomous mint/burn with minimal or no human control (e.g. DAI, FRAX, formerly UST)
🎥 Deep dive with @PatrickAlphaC ➡️ youtube.com/watch?v=XeqQf08P…
#Web3 #Stablecoins #CryptoEducation #DeFi #Blockchain #Ethereum #FinTech
1
60
🚀 Improve How You Write State Variables in Solidity
Writing clean and optimized state variables in your smart contracts can make a big difference — not just in readability, but also in gas efficiency.
Let’s break down why this matters:
🔐 What are state variables in Solidity?
State variables are fields declared inside a smart contract that get stored on the blockchain. They live in what's called Storage, which is a persistent data location.
Because these variables are stored on-chain, every read or write operation consumes gas.
🗂 Data Locations: Storage vs Memory
Solidity uses three main data locations:
- `storage` (permanent, on-chain)
- `memory` (temporary, used during function execution)
- `calldata` (read-only input parameters)
State variables are always stored in `storage`, which is the most expensive in terms of gas usage.
⚙️ Why Naming Conventions Matter: A Look at Opcodes
The Ethereum Virtual Machine (EVM) runs on low-level instructions called Operational Codes (opcodes). These include:
- `SLOAD` (read from storage) — 2,100 gas
- `SSTORE` (write to storage) — up to 20,000 gas
- `MLOAD` / `MSTORE` (memory) — significantly cheaper
By using the right variable types (`constant`, `immutable`, etc.) and conventions, you avoid unnecessary storage operations — which means cheaper, more efficient contracts.
Want to explore opcodes? Check out: evm.codes/
⛽ What is Gas and Why Should You Care?
Gas is the unit of computational work on the Ethereum blockchain. More complex operations (like updating a state variable) cost more gas — and users pay for that.
Poorly optimized code = higher gas costs = worse UX for your dApp.
📌 State Variable Conventions: Quick Summary
- Use `constant` for values that never change (saves gas at compile time)
- Use `immutable` for values that are set only once in the constructor
- Prefix `s_` for regular storage variables
- Prefix `i_` for immutable variables
- Use `ALL_CAPS` for constants
52
🚀 La importancia de NatSpec en Solidity
🧾 Qué es NatSpec?
NatSpec (Ethereum Natural Language Specification Format) es un estándar para documentar contratos inteligentes y funciones en Solidity. Permite agregar comentarios estructurados que pueden ser utilizados por herramientas y auditorías.
🤔 El código no debería ser autoexplicativo?
En Solidity, documentar con NatSpec es especialmente importante por dos razones:
1️⃣ A diferencia de otros lenguajes, los contratos inteligentes son **inmutables** una vez desplegados, por ende es crucial dejar por escrito qué hace cada función.
2️⃣ Si tu contrato está pensado para ser desplegado en **mainnet**, deberá ser auditado por expertos. Una buena documentación facilita muchísimo su trabajo y reduce errores.
🧪 Ejemplos de NatSpec Tags útiles:
- `@dev`: Para dejar detalles técnicos útiles para desarrolladores.
- `@param`: Para documentar cada parámetro que recibe una función.
- `@return`: Para describir el valor devuelto.
📚 Querés profundizar más? Te dejo la documentación oficial de Solidity: docs.soliditylang.org/en/lat…
2
46
🚀 Writing Better Smart Contracts in Solidity
Consistent code style in Solidity enhances readability, security, and maintainability. Whether working solo or in a team, uniform formatting reduces bugs and improves clarity.
Follow these style recommendations:
📚 Official Solidity Style Guide: docs.soliditylang.org/en/lat…
30
Just got my @EFDevcon ticket for the Ethereum World's Fair. Six days of real apps, stablecoins, onchain identity, DeFi, and more.
If you’re curious what Ethereum actually does, don't miss Devconnect. Nov 17–22 in Buenos Aires 🇦🇷
You coming? devconnect.org/argentina/tic…
19





