Solidity शब्दावली A-Z

Solidity और blockchain के सभी आवश्यक शब्द code examples के साथ समझाए गए। 48 definitions उपलब्ध हैं।

E

Emit

Solidity

Emit keyword का use events को trigger करने के लिए होता है। Events blockchain के transaction logs में store होते हैं और off-chain applications (frontends, indexers) इन्हें listen कर सकते हैं। Events smart contract से data retrieve करने का एक gas-efficient तरीका है।

ERC-20

Standards

ERC-20 Ethereum पर fungible tokens के लिए सबसे popular standard है। यह standard methods की एक set define करता है (transfer, balanceOf, approve, transferFrom) जो सभी ERC-20 tokens को implement करने होते हैं। यह interoperability सुनिश्चित करता है - सभी wallets, exchanges और dApps एक ही interface से सभी ERC-20 tokens के साथ काम कर सकते हैं।

ERC-721

Standards

ERC-721 non-fungible tokens (NFTs) का standard है। ERC-20 के विपरीत जहां सभी tokens identical हैं, ERC-721 में हर token unique होता है और एक unique ID से identify होता है। यह digital art, collectibles, in-game items और real estate जैसी unique assets को represent करने के लिए use होता है।

Ether

Solidity

Ether (ETH) Ethereum blockchain की native cryptocurrency है। Solidity में, ether को wei में measure किया जाता है (1 ether = 10^18 wei)। Solidity built-in units provide करता है: wei, gwei, ether। Payable functions ether receive कर सकते हैं।

Event

Solidity

Event एक Solidity construct है जो blockchain के transaction logs में data emit करने के लिए use होता है। Events cheap हैं (storage से काफी कम gas) और off-chain applications इन्हें efficiently query कर सकते हैं। Indexed parameters filter करने के लिए use होते हैं।

EVM (Ethereum Virtual Machine)

EVM

EVM वह runtime environment है जो Ethereum पर smart contracts को execute करता है। यह एक stack-based virtual machine है जो bytecode को process करता है। EVM Ethereum को Turing-complete बनाता है, मतलब यह theoretically कोई भी computation कर सकता है (gas limits के subject में)।

I

Immutable

Solidity

Immutable keyword variables को mark करने के लिए use होता है जिन्हें constructor में set किया जा सकता है लेकिन बाद में modify नहीं किया जा सकता। Immutable variables constant से ज्यादा flexible हैं (runtime values allow करते हैं) लेकिन regular state variables से cheaper हैं (bytecode में inline होते हैं)।

Indexed

Solidity

Indexed keyword event parameters को mark करने के लिए use होता है ताकि वे searchable बन सकें। Maximum 3 indexed parameters allowed हैं per event। Indexed parameters को topics के रूप में store किया जाता है, जिससे off-chain applications efficiently filter कर सकते हैं।

Inheritance

Solidity

Inheritance Solidity में एक mechanism है जो contract को दूसरे contract के properties और methods को inherit करने की अनुमति देता है। Solidity multiple inheritance support करता है। यह code reuse और modular architecture के लिए powerful tool है।

Interface

Solidity

Interface एक contract blueprint है जो केवल function signatures define करता है, implementation नहीं। Interfaces दूसरे contracts के साथ interact करने के लिए use होते हैं जब आपके पास पूरा code नहीं है। Interfaces किसी भी state variables या constructor नहीं रख सकते।

M

Mapping

Solidity

Mapping एक key-value data structure है जो Solidity में hash table की तरह काम करता है। Mapping automatically सभी possible keys को zero/default value से initialize करता है। Mappings iterate नहीं किए जा सकते (keys की list नहीं है)। Mappings केवल storage में exist हो सकते हैं।

Memory

Solidity

Memory एक temporary data location है जो function execution के दौरान exist करता है। Memory variables function call के बाद erase हो जाते हैं। Memory storage से काफी cheaper है। Complex types (arrays, structs) को explicitly memory या storage specify करना पड़ता है।

Modifier

Solidity

Modifier एक reusable code block है जो function behavior को modify करता है। Modifiers typically access control, validation और preconditions check करने के लिए use होते हैं। Underscore (_) placeholder function body के execution को represent करता है।

msg.sender

Solidity

msg.sender एक global variable है जो current function call करने वाले address को represent करता है। यह direct caller होता है - user या contract जो immediate call कर रहा है। Authentication और access control के लिए यह most commonly used variable है।

msg.value

Solidity

msg.value एक global variable है जो current transaction के साथ भेजे गए ether की amount (wei में) को represent करता है। यह केवल payable functions में available है। msg.value को payments accept करने और deposit tracking के लिए use किया जाता है।

R

Reentrancy

Security

Reentrancy एक critical vulnerability है जहां malicious contract एक function को recursively call कर सकता है इससे पहले कि first call complete हो। Famous DAO hack (2016) में reentrancy exploit हुआ था। इससे बचने के लिए checks-effects-interactions pattern या ReentrancyGuard use करें।

Require

Solidity

Require एक control structure है जो conditions validate करने के लिए use होता है। अगर condition false है, तो transaction revert हो जाता है और सभी state changes undo हो जाते हैं। Used gas partially refunded होता है। Require input validation और access control के लिए ideal है।

Return

Solidity

Return statement function से values को return करने के लिए use होता है। Solidity multiple return values support करता है। Return values को named किया जा सकता है, जो automatic return variables create करता है।

Revert

Solidity

Revert statement transaction को abort करने और सभी state changes को undo करने के लिए use होता है। Revert require से similar है लेकिन ज्यादा flexible है (custom errors के साथ use हो सकता है)। Revert complex error handling के लिए preferred है।

S

Selector (Function Selector)

EVM

Function selector एक function signature के first 4 bytes हैं। यह function को uniquely identify करता है और EVM को बताता है कि कौन सा function call करना है। Selector को keccak256 hash से derive किया जाता है। Low-level calls और proxy patterns में selectors direct use होते हैं।

Solidity

Solidity

Solidity एक high-level, object-oriented programming language है जो Ethereum smart contracts लिखने के लिए specifically designed किया गया है। यह statically-typed है और JavaScript, Python और C++ से influenced है। Solidity code EVM bytecode में compile होता है।

Storage

EVM

Storage वह permanent data location है जहां state variables store होते हैं। Storage data blockchain पर persist करता है और सबसे expensive है (gas terms में)। Storage को efficiently use करना gas optimization का critical part है। हर contract की अपनी isolated storage होती है।

Struct

Solidity

Struct एक custom data type है जो multiple related variables को group करता है। Structs complex data को organize करने के लिए use होते हैं। Struct members different types के हो सकते हैं। Structs को mappings और arrays में use किया जा सकता है।

T

Timestamp (block.timestamp)

EVM

block.timestamp current block का Unix timestamp (seconds में) provide करता है। यह time-based logic implement करने के लिए use होता है (deadlines, vesting, cooldowns)। ⚠️ Warning: miners timestamp को कुछ seconds तक manipulate कर सकते हैं, इसलिए critical randomness के लिए use न करें।

Token

DeFi

Token एक digital asset है जो smart contract द्वारा represent किया जाता है। Tokens fungible (ERC-20, सभी identical) या non-fungible (ERC-721/ERC-1155, unique) हो सकते हैं। Tokens currencies, voting rights, access permissions, या real-world assets को represent कर सकते हैं।

Transfer

Solidity

Transfer एक method है ether को payable addresses पर भेजने के लिए। यह 2300 gas forward करता है (reentrancy prevention के लिए) और failure पर revert करता है। Modern Solidity में, call{value: ...} को prefer किया जाता है क्योंकि यह ज्यादा flexible है।

tx.origin

Solidity

tx.origin वह address है जिसने originally transaction initiate किया (always एक EOA)। यह msg.sender से different है जो immediate caller हो सकता है (contract)। ⚠️ Security warning: tx.origin को authentication के लिए use न करें क्योंकि यह phishing attacks के लिए vulnerable है।

इन concepts को practice करने के लिए तैयार हैं?

1000+ interactive exercises और integrated IDE के साथ Solidity सीखें।

मुफ्त में शुरू करें