Solidity for Loop: Syntax, Patterns, and Gas Tips
Master the Solidity for loop. Counter syntax, break and continue, four iteration patterns, the unchecked-increment gas optimization
Read post →Technical writing by Mudassir Khan — agentic AI consultant and AI systems architect. New posts published directly on this site. Earlier writing on Dev.to.
Ethereum, Solana, smart contracts, wallets, on-chain transactions, and ERC token standards.
Master the Solidity for loop. Counter syntax, break and continue, four iteration patterns, the unchecked-increment gas optimization
Read post →Master the Solidity while loop. Binary search with overflow-safe midpoint, unbounded loop dangers, four common mistakes, and a complete SortedBidList
Read post →Master the Solidity do-while loop. The at-least-once guarantee, slot scanning patterns, wrap-around search, four common mistakes, and a complete SlotReserver
Read post →Cut loop gas costs in Solidity with five proven techniques: cache array length, unchecked ++i, prefix increment, memory accumulators, and single SSTORE
Read post →Iterate over Solidity mappings safely. Enumerable mapping pattern, pull over push for unbounded sets, paginated reads
Read post →Learn how to use address as a key and value in Solidity mappings. Balance tracker, ownership registry, approval grant, and freeze flag with a complete smart
Read post →Learn how to use uint256 as key and value in Solidity mappings. Voting tallies, leaderboards, staking counters, and a complete governance contract
Read post →Learn how to use bool as a mapping value in Solidity. Whitelist gates, role access control, and presale guards with complete smart contract examples and gas
Read post →Learn nested mappings in Solidity. How ERC20 allowance works, the two-step keccak256 storage derivation, and a complete AllowanceToken contract with approve
Read post →Learn how to use bytes32 as a mapping key in Solidity. Document registries, keccak256 role identifiers, and hash-based storage patterns with complete smart
Read post →Learn the uint array in Solidity end to end. push, pop, delete, swap and pop, memory arrays, fixed length, and a Remix contract with every method.
Read post →Learn the int array in Solidity end to end. push, pop, delete, swap and pop, signed values, memory arrays, fixed length, and a Remix contract
Read post →Learn the string array in Solidity end to end. push, pop, delete, swap and pop, the memory keyword, fixed length, and a Remix contract with every method.
Read post →Learn the address array in Solidity end to end. push, pop, delete, swap and pop, the zero address, memory arrays, and a Remix Whitelist with every method.
Read post →Learn the struct array in Solidity end to end. push, pop, delete, swap and pop, field updates, memory and storage, and a Remix StudentRegistry contract.
Read post →Build an ERC20 token from scratch and deploy it on Remix IDE. Full interface, contract code, deploy walkthrough, and the approve and transferFrom pattern.
Read post →Build a complete ERC721 NFT contract on Remix IDE, end-to-end. Full IERC721 interface, mint and transfer code, IPFS metadata, safeTransferFrom receiver
Read post →Build an ERC1155 multi token contract on Remix IDE. Full interface, batch operations, mint and transfer code, and a deployable game ready example.
Read post →Learn ERC-1155 with OpenZeppelin from zero. Six Solidity examples: single mint, batch mint, safe transfers, metadata URIs, and a game inventory.
Read post →Solana vs Ethereum — which blockchain should you build on? Distributed ledgers, Proof of History vs Gasper consensus, speed vs decentralization
Read post →Public RPC endpoints are rate limited. How RPC nodes work, mainnet vs testnet, Chain IDs, and how to add a custom network to MetaMask with Alchemy.
Read post →Solidity is the language for Ethereum smart contracts. This guide covers variables, functions, loops, control flow, and your first deployable contract.
Read post →Mapping with struct is Solidity's workhorse for per-user state. Learn the pattern, see a full voting registry, master storage packing, and avoid
Read post →Arrays plus loops in Solidity: for vs while, the vote tally pattern, the unbounded loop bug, pagination, and pull over push. Six patterns
Read post →Learn arrays in Solidity from scratch. Fixed and dynamic arrays, push, pop, length, delete, storage vs memory vs calldata, plus a full worked contract.
Read post →Build a Solidity calculator smart contract from scratch. Add, subtract, multiply, divide with pure functions, stored state, events, and require
Read post →Solidity powers Ethereum DeFi. Rust powers Solana's Sealevel parallel runtime. Here is how the two languages differ on safety, performance, learning curve
Read post →How an Ethereum wallet actually works — private and public keys, address derivation, seed phrases, and how a signed transaction proves ownership
Read post →An Ethereum transaction is a signed message. This guide walks through every field, the wallet to mempool to block lifecycle, gas pricing
Read post →All major ERC token standards explained — ERC20 fungible tokens, ERC721 NFTs, ERC1155 multi-token, ERC1400 security tokens, ERC4626 vaults
Read post →What a crypto wallet actually stores, the difference between custodial and non-custodial, and a step by step guide to installing MetaMask and Phantom
Read post →A 30-post technical series on agentic AI architecture, LangGraph patterns, blockchain compliance engineering, and production AI systems is in progress. Follow on Dev.to or LinkedIn to be notified.
FAQ
Hire an agentic AI consultant when your team needs to build autonomous, multi-step AI workflows — such as agents that browse the web, call APIs, or orchestrate multi-model pipelines — and lacks in-house experience with LangGraph, tool-use reliability, or production agent safety. A consultant is faster than hiring a full-time engineer if your timeline is under 6 months.
RAG (Retrieval-Augmented Generation) fixes knowledge gaps by injecting relevant documents at inference time — ideal for private or frequently updated data. Fine-tuning fixes behaviour gaps by adjusting model weights on curated examples — best when you need consistent tone, output format, or domain-specific reasoning. In 2026, most production systems use both: a fine-tuned model as the base, with RAG for dynamic knowledge retrieval.
An AI systems architect designs the end-to-end infrastructure for AI products — including model selection, data pipelines, vector stores, agent orchestration, evaluation frameworks, and deployment strategy. Unlike an ML engineer who focuses on model training, or a data scientist focused on analysis, an AI systems architect owns the full production system design.
Ethereum uses the Gasper consensus mechanism (Proof of Stake + Casper FFG), prioritising security and decentralisation over speed — it processes roughly 15–30 TPS. Solana uses Proof of History combined with Tower BFT, achieving 2,000–65,000 TPS at lower cost, but with greater centralisation risk. Ethereum is preferred for DeFi and high-value applications; Solana suits high-frequency, low-cost use cases.
The four multi-agent patterns that work reliably in production are: Sequential (agents chain output to input in a fixed order), Orchestrator-Worker (a coordinator agent delegates tasks to specialised sub-agents), Hierarchical (nested orchestration across multiple management levels), and Dynamic Handoff (agents route tasks to the best-suited agent at runtime). LangGraph is the most common framework for implementing all four.
Use a consultant if you need a working system in 1–3 months, have a defined scope, or are pre-Series A. Hire full-time when you have a live product requiring ongoing iteration, a team to mentor, and 6+ months of runway budgeted for the role. The hybrid model — consultant to build the initial system, then a mid-level engineer to maintain it — is what most seed-stage teams in 2026 actually use.