[Glossary] Smart Contract Lab Terms
-
Below is a concise glossary of key terms you’ll encounter in Smart Contract Lab discussions. Perfect for devs and auditors diving into on-chain code.
️ Languages & Runtimes
- Solidity: The most popular contract language on Ethereum—JavaScript-like syntax for writing smart contracts.
- Vyper: A Python-inspired Ethereum language focused on simplicity and auditability.
- Rust / Ink!: A systems-language (Rust) variant used for writing contracts on Substrate/Polkadot via the Ink! framework.
- Move: A Rust-influenced language created by Diem (Facebook) for safe resource management in smart contracts.
- EVM (Ethereum Virtual Machine): The runtime environment that executes Ethereum smart-contract bytecode.
Compilation & Deployment
- Compiler (solc, vyper): A tool that converts your high-level code into low-level EVM bytecode.
- Bytecode: The binary instructions the EVM executes—deployed to chain.
- ABI (Application Binary Interface): A JSON spec of your contract’s functions/events—used by front-ends and scripts to interact.
- Gas Limit / Gas Price: Max gas you allow and price per gas unit you’re willing to pay at deployment/execution.
- Constructor: A special function that runs once, during contract deployment, to initialize state.
Auditing & Verification
- Audit: A systematic security review of contract code by experts, looking for vulnerabilities.
- Formal Verification: Mathematically proving your contract behaves exactly as specified.
- Reentrancy: A bug where a contract calls back into itself before state updates—famous for TheDAO hack.
- Integer Overflow/Underflow: When arithmetic exceeds its max/min value—now prevented by SafeMath libraries or built-in checks.
- Access Control: Patterns (Ownable, RBAC) that restrict who can call sensitive functions.
Gas & Optimization
- Gas: The “fuel” paid to execute contract code; each opcode has a gas cost.
- Storage vs. Memory: Persistent (storage) is expensive; temporary (memory/calldata) is cheaper.
- View / Pure Functions: Read-only (view) or side-effect-free (pure) functions that cost no gas when called externally.
- Inlining & Assembly: Embedding optimized EVM bytecode or small functions inlined to reduce gas.
- Constant Folding: Letting the compiler precompute static expressions to save gas at runtime.
🧪 Testing & Tooling
- Unit Test: Small, isolated tests for individual functions (e.g., with Hardhat, Truffle or Foundry).
- Integration Test: End-to-end tests that deploy contracts and simulate user interactions.
- Fuzzing: Automated testing with random inputs to uncover edge-case bugs.
- Hardhat / Truffle / Foundry: Development frameworks offering local chains, testing suites, and deployment scripts.
- Ethers.js / Web3.js: JavaScript libraries for interacting with deployed contracts in your front-end or scripts.
Pin this thread for quick reference in the lab. Spot any terms missing or need code examples? Drop your suggestions below!
-
C CryptoKas pinned this topic