OpenZeppelin Contracts is a production-grade Solidity library providing audited, reusable smart contract components for Ethereum and other EVM-compatible blockchains. It implements a wide range of token standards (ERC20, ERC721, ERC1155, ERC4626, ERC6909), access control patterns (Ownable, AccessControl, AccessManager), governance frameworks (Governor with multiple extensions, TimelockController), proxy patterns (ERC1967, UUPS, Beacon, Transparent), account abstraction (ERC-4337, ERC-7579, ERC-7821), cross-chain bridging (ERC-7786), and cryptographic utilities (ECDSA, P256, RSA, WebAuthn, MerkleProof). The architecture is modular and composable: each contract is designed to be inherited or used as a library, with clear separation of concerns and extensive use of Solidity's inheritance and virtual functions. Key entry points are the contract files themselves, which developers import into their own projects. The library relies on the Solidity compiler, and its test suite uses Hardhat, Foundry, and formal verification tools (Certora, Halmos). Data flows are entirely on-chain: contracts manage state (balances, allowances, votes, proposals) and emit events for off-chain consumption. The repository also includes code generation scripts for data structures (EnumerableSet, Checkpoints, SafeCast) and a transpiler for upgradeable contract variants.
The Solidity compiler (solc) is a production-grade, multi-pass compiler that translates Solidity smart contract source code into EVM bytecode. It supports two compilation pipelines: a legacy EVM assembly backend and a newer IR-based pipeline via Yul, which also serves as the optimizer intermediate representation. The optimizer suite comprises approximately 80 composable passes, including control-flow simplification, common subexpression elimination, function inlining, and store elimination. The compiler integrates formal verification through SMT solvers (Z3, cvc5, Eldarica) using both BMC and CHC engines. A C API (libsolc) enables embedding, and a CLI provides rich output options (ABI, bytecode, IR, metadata, storage layout). The codebase demonstrates deep compiler engineering with advanced static analysis, SSA construction, stack layout optimization, and genetic-algorithm-based optimizer tuning (yulPhaser). It is extensively tested with semantic, syntax, fuzz, and external integration tests.
Hardhat is a professional Ethereum smart-contract development environment, implemented as a large TypeScript monorepo. In production it operates as a CLI and programmatic framework that compiles Solidity, runs tests against local or remote networks, deploys contracts, verifies source code on block explorers, and manages project secrets and hardware-wallet signing. The core `hardhat` package provides a task runner, plugin system (`definePlugin`), hook handlers, config loading, and a Hardhat Runtime Environment, while companion packages add viem/ethers client integration, chai matchers, the Ignition declarative deployment engine, verification against Etherscan/Blockscout/Sourcify, Mocha and node:test runners, Foundry remapping support, coverage, gas analytics, and alternative Slang/Solx compiler backends. The architecture is a modular, hook-driven monorepo of 30+ packages. The core exposes lifecycle hooks for config, network, HRE, Solidity, and testing; plugins register tasks, global options, and hook handlers that compose through `next()` chains. Ignition-core implements a journal-based deployment state machine with reconciliation, execution strategies, and nonce management, making deployments resumable and auditable. The network layer abstracts JSON-RPC providers over HTTP and EDR-backed simulated networks, with request handlers for gas estimation, account management, and chain validation. Entry points include `packages/hardhat/src/cli.ts`, `packages/hardhat/src/hre.ts`, `packages/hardhat/src/config.ts`, and `packages/ignition-core/src/deploy.ts`. The codebase is well-engineered and heavily tested, with fixture projects, CI workflows, changesets, e2e scenarios against real-world projects, and benchmark infrastructure. It is current with Node 24 and modern TypeScript/ESM patterns. Notable minor issues include duplicated helper code across packages, hand-maintained chain/explorer mappings and hardfork lists, and some fragile workarounds around third-party CJS/ESM interop. Overall, it is a strong, actively maintained developer-tooling codebase with several genuinely reusable internal components.
The FuelLabs/fuels-rs repository is a Rust SDK for the Fuel blockchain, providing tools for compiling, deploying, and testing Sway contracts. It enables developers to interact with the Fuel blockchain through a provider abstraction, manage wallets and accounts, generate type-safe Rust bindings from Sway contracts via the `abigen!` macro, and build and send transactions using a fluent transaction builder pattern. The SDK follows a modular workspace structure with separate crates for accounts, core types, code generation, macros, and high-level program interactions. Key features include configurable constants, blob-based contract deployment for large contracts, and a testing macro (`setup_program_test!`) that reduces boilerplate in end-to-end tests. The architecture is modular, with clear separation of concerns: `fuels-accounts` for wallet management, `fuels-core` for core types and transaction building, `fuels-code-gen` for ABI binding generation, `fuels-macros` for procedural macros, and `fuels-programs` for high-level contract interaction APIs. The SDK relies on external dependencies such as the Fuel blockchain node (fuel-core) and the Sway compiler (forc) for contract compilation. Primary data flows involve generating bindings from ABI JSON, constructing transactions with customizable policies and inputs/outputs, deploying contracts (regular or via blob loader for large contracts), and interacting with deployed contracts through generated bindings. The SDK emphasizes type safety and developer experience, leveraging Rust's procedural macros and trait system to reduce boilerplate and prevent common errors.
This repository is the primary implementation of the Sway programming language and its toolchain, targeting the Fuel blockchain. It contains a full compiler pipeline (lexer, parser, AST, semantic analysis, IR with optimization passes, and code generation for the FuelVM), a package manager CLI (`forc`), a language server (`sway-lsp`), a code formatter (`swayfmt`), a debugger (`forc-debug`), a documentation generator (`forc-doc`), and a migration tool (`forc-migrate`). The standard library (`sway-lib-std`) provides essential blockchain primitives (assets, storage, crypto, etc.). The architecture is modular, with separate crates for the AST (`sway-ast`), IR (`sway-ir`), parsing (`sway-parse`), core compiler logic (`sway-core`), and error handling (`sway-error`). In production, developers use `forc` to build, test, and deploy Sway smart contracts, scripts, and predicates to the Fuel network. The LSP provides IDE features like completions, go-to-definition, and inlay hints. The formatter ensures consistent code style. The debugger enables step-through debugging of on-chain logic. The compiler supports multiple backends (FuelVM primary, EVM experimental) and includes advanced optimizations such as constant folding, dead code elimination, common subexpression elimination, and register allocation. Key entry points include `forc/src/main.rs` (CLI dispatcher), `sway-core/src/lib.rs` (compiler core), `sway-lsp/src/server.rs` (LSP server), and `swayfmt/src/lib.rs` (formatter). External dependencies include the Fuel protocol libraries (`fuel-core`, `fuel-vm`, `fuels-rs`), IPFS for package resolution, and standard Rust ecosystem crates. The repository is production-grade with extensive end-to-end tests, benchmarking infrastructure, and CI workflows.
Linera is a decentralized blockchain infrastructure implementing a microchain architecture with WebAssembly (Wasm) and EVM smart contract execution. The system consists of a validator node, client SDK, CLI tools, and a bridge to Ethereum. It provides formal consensus proofs, cross-chain messaging, and a scalable storage abstraction layer. Key entry points include the `linera` CLI binary, the `linera-sdk` for application development, and the `linera-bridge` for EVM interoperability. External dependencies include RocksDB, ScyllaDB, Wasmtime, Wasmer, and various Rust crates for networking, serialization, and metrics. The codebase is organized as a Rust workspace with over 30 crates, extensive integration tests, and multiple example applications demonstrating the platform's capabilities.
ethers.js is a production-grade TypeScript library for interacting with Ethereum-compatible blockchains, compiled to dual ESM and CommonJS packages with browser-specific module replacements (crypto, base64, geturl, ws, wordlists). The architecture is a modular facade: a top-level barrel (src.ts/index.ts) re-exports sub-modules for ABI encoding, address handling, contracts, crypto primitives, hashing, providers, transactions, utilities, wallets, and BIP-39 wordlists. The provider layer is the deepest abstraction — an AbstractProvider base class with polling/socket/filter-ID subscriber contracts, plus concrete implementations for JSON-RPC, WebSocket, IPC, browser-injected wallets (EIP-1193/6963), and community services (Infura, Alchemy, Etherscan, Chainstack, Ankr, QuickNode, Blockscout, Pocket, Cloudflare) with hardcoded community API keys and once-per-service throttle messages. Network-specific behavior is customizable through a plugin system (GasCostPlugin, EnsPlugin, FeeDataNetworkPlugin), and a FallbackProvider aggregates backends with quorum logic.
fhevm is a production-grade, full-stack confidential smart contract platform that brings Fully Homomorphic Encryption (FHE) to EVM-compatible blockchains. The system is a distributed microservices architecture: on-chain Solidity contracts (host-contracts for ACL, FHEVMExecutor, KMSVerifier, InputVerifier, ProtocolConfig, and gateway-contracts for decryption/input verification) handle encrypted state and access control, while a suite of Rust services (coprocessor/fhevm-engine with host-listener, gw-listener, tfhe-worker, sns-worker, transaction-sender, zkproof-worker, scheduler) perform off-chain FHE computation, ZK proof verification, and transaction submission. A relayer service exposes HTTP v2/v3 endpoints for public/user/delegated decryption with EIP-712 typed-data attestations, and a KMS connector manages threshold key generation and decryption. The TypeScript SDK (ethers and viem adapters) provides client-side encryption, decryption, and proof generation with WASM-based TFHE/TKMS modules, plus a CLI and load-testing toolkit. Cross-chain bridging via LayerZero V2 is included for confidential token transfers.
This repository is the official compiler for the Cairo programming language, a Turing-complete language designed for provable computation (zero-knowledge proofs). It compiles Cairo source through a multi-stage pipeline: parsing (via LALRPOP), semantic analysis with type inference and trait resolution, lowering to a control-flow graph with extensive optimizations (CSE, constant folding, inlining, match optimization, gas redeposit), generation of the Sierra intermediate representation (a safe, bounded subset for ZK provability), and final compilation to CASM (Cairo Assembly) for execution on the Cairo VM. The compiler uses the Salsa incremental computation framework for query-based caching and is split into 40+ crates organized by compiler phase (parser, semantic, lowering, sierra-generator, sierra-to-casm, etc.). It also includes a full toolchain for Starknet smart contract development, with plugins for contracts, storage, events, and ABI generation. CLI tools (cairo-compile, cairo-run, sierra-compile, starknet-compile, cairo-test, cairo-format) provide end-to-end functionality. The standard library ('corelib'), written in Cairo, provides fundamental types, collections, hash functions, and Starknet-specific primitives. The codebase demonstrates high craftsmanship with clean abstractions, a generic dataflow analysis framework, deterministic hash map utilities, and a reusable graph algorithm library. It is actively maintained with extensive CI, benchmarks, and a golden-file test infrastructure.
This repository is the official TypeScript SDK for the Fuel Network blockchain, structured as a monorepo using pnpm and Turbo. It provides a comprehensive suite of libraries for wallet management, transaction construction, smart contract interaction (contracts, predicates, scripts), and code generation from Sway ABIs. The codebase includes a CLI tool (`fuels`) for project scaffolding, building, deploying, and running local test nodes. It supports both Node.js and browser environments, evidenced by dual build configurations and React-based dApp templates. The architecture relies heavily on generated GraphQL operations and external binary dependencies (`forc`, `fuel-core`) which are managed internally via installation scripts.
This repository contains the full implementation of the Marginfi v2 protocol, a decentralized lending and borrowing platform on Solana. The core is an Anchor-based Rust smart contract that manages deposits, borrows, repays, liquidations, orders, and flash loans across multiple assets. It integrates with external lending protocols (Kamino, Drift, Solend, JupLend) via cross-program invocation (CPI), allowing users to use positions from those protocols as collateral. The codebase also includes a comprehensive CLI tool (p0-cli) for admin operations and user interaction, a standalone type crate for shared data structures, multiple mock programs for integration testing, and extensive test suites (Rust integration tests, TypeScript bankrun tests, and fuzz testing with Trident and libfuzzer). The architecture is a single Solana program with a rich set of instruction handlers, supported by off-chain tooling. The repository demonstrates high engineering craftsmanship with well-structured code, reusable components, and thorough testing across many edge cases.
The repository implements Hipo, a decentralized liquid staking protocol on the TON blockchain. Users deposit GRAM to receive hGRAM tokens representing a share in a staking pool that lends to validators for validation rounds. Rewards increase the hGRAM/GRAM exchange rate, accruing value to stakers. The system features a modular smart contract architecture with upgradeable contracts (Treasury, Parent, Wallet, Loan, Bill, Collection, Librarian), a participation state machine tracking validation rounds, and a library management system for code reuse. It includes a comprehensive test suite with custom Jest matchers, deployment scripts, and diagnostic tools for monitoring state and analytics.
This is the official JavaScript/TypeScript SDK for the Algorand blockchain, version 3.7.0. It provides a comprehensive set of tools for constructing, signing, encoding, and submitting transactions to Algorand nodes, as well as querying blockchain state via the Algod v2, Indexer, and KMD APIs. The SDK supports all transaction types (payment, asset management, application calls, key registration, state proofs, heartbeats), atomic transaction groups, ABI encoding/decoding for smart contract interactions, logic signatures (escrow, delegation, multisig), and post-quantum Falcon-1024 signatures. It is designed for both Node.js and browser environments, with CommonJS, ESM, and webpack bundle outputs. The architecture is modular: a core encoding layer (schema-based msgpack/JSON serialization) underpins all data types; a client layer abstracts HTTP communication with token-based authentication; a transaction builder pattern provides ergonomic construction; and a signer abstraction decouples signing logic from transaction assembly. Key entry points include the `Algodv2`, `Indexer`, and `Kmd` client classes, the `Transaction` class, `AtomicTransactionComposer` for atomic groups, and the `LogicSig`/`LogicSigAccount` classes. Data flows involve constructing transactions, signing them (via raw keys, multisig, or external signers), encoding to msgpack, and submitting to the network. The SDK also handles decoding of responses, including complex structures like block headers, state deltas, and simulation results. External dependencies include the `algorand-msgpack` package for msgpack encoding, `@algorandfoundation/falcon-wasm` for post-quantum signatures, and `hi-base32` for address encoding. The SDK is extensively tested with unit tests (Mocha), integration tests (Cucumber with mock servers), and browser tests (Selenium). It is actively maintained with regular releases, automated code generation from Algorand API specifications, and CI/CD pipelines for linting, testing, and publishing.
Blockscout is an open-source blockchain explorer for EVM-compatible chains, written in Elixir using the Phoenix framework. It indexes and serves on-chain data including blocks, transactions, internal transactions, token transfers, token balances, contract code, and more. The system is composed of four umbrella apps: `explorer` (database schemas, chain import pipeline, caching), `block_scout_web` (Phoenix web server with REST API v2, JSON-RPC, GraphQL, and real-time WebSocket channels), `indexer` (background fetchers that pull data from Ethereum nodes using JSON-RPC), and `ethereum_jsonrpc` (transport abstraction with chain-specific variants for Geth, Nethermind, Besu, etc.). The architecture is a monolith with clear separation of concerns, using PostgreSQL as the primary store, ETS/ConCache for caching, and Oban for async job processing. It supports multiple chain types (Ethereum, Optimism, Arbitrum, Celo, ZkSync, Scroll, and more) via compile-time and runtime configuration, with chain-specific data models and import pipelines. External dependencies include a PostgreSQL database, an Ethereum JSON-RPC endpoint, optional microservices for smart contract verification (Rust verifier, Sourcify), and third-party market data providers (CoinGecko, DefiLlama). The frontend is a single-page application built with jQuery and custom JavaScript, with real-time updates via Phoenix Channels. The codebase is well-structured with extensive use of Elixir behaviours (BufferedTask, Import.Runner, FillingMigration) and a sophisticated caching layer. It is actively maintained with frequent releases, thorough CI/CD, and a large community.
This repository provides example smart contract implementations for the OP_NET blockchain platform. It includes templates for tokens, NFTs, domain name resolution, stablecoins, and package registries. The contracts demonstrate proper use of the OP_NET runtime framework with clean architecture, good engineering practices, and reusable components. Each contract is self-contained and follows consistent patterns for deployment, method definition, event emission, and access control.
This repository is the canonical reference implementation of ERC-4337 (Ethereum Account Abstraction) by the standard's authors. It provides a singleton EntryPoint contract that coordinates validation, execution, and gas accounting for UserOperations. The codebase includes abstract base contracts for accounts and paymasters, production-grade sample accounts (SimpleAccount, Simple7702Account), libraries for packed UserOperation hashing and EIP-7702 support, and extensive test and simulation infrastructure. It is deployed on Ethereum mainnet and supports paymasters, signature aggregators, counterfactual deployment via CREATE2, and EIP-7702 delegated code. The architecture is modular: core logic is separated into libraries (UserOperationLib, Helpers, Exec, Eip7702Support) and abstract contracts (BaseAccount, BasePaymaster, StakeManager, NonceManager) that can be reused in custom implementations. Gas optimization is a key focus, with patterns like transient storage, packed storage, and a custom nonReentrant guard. While the repo is tightly coupled to the EntryPoint's design, individual libraries and base contracts are reusable in any ERC-4337 integration.
The Java Stellar SDK is a comprehensive client library for interacting with the Stellar blockchain network, providing both Horizon REST API bindings and Soroban smart contract support. It handles transaction construction, signing, and submission, as well as account management, asset operations, liquidity pools, and decentralized exchange path finding. The library is built on a robust XDR codec layer generated from protocol definitions, with handcrafted decoders that enforce depth limits and size constraints for safe binary parsing. It also includes a SPI-based platform abstraction for Base32/Base64 encoding to support Android deployments, and a sophisticated contract client that manages Soroban transaction lifecycle (simulation, restoration, signing, and submission). The codebase is actively maintained, with a large test suite spanning Java and Kotlin, CI/CD pipelines, and support for the latest Stellar protocol features (CAP-71, CAP-85, SEP-10/45/51/53). While the XDR generation pipeline requires periodic regeneration, the core SDK abstractions are well-isolated and exhibit strong engineering practices such as builder patterns, immutable value objects, and custom Gson deserializers for Horizon response parsing.
This repository provides a comprehensive Solidity implementation of the ERC-734 (Key Holder) and ERC-735 (Claim Holder) standards for decentralized on-chain identities. It includes a core Identity contract that manages cryptographic keys (management, action, claim, encryption) and claims (issuance, storage, revocation), along with a ClaimIssuer contract for issuing and revoking claims. The system supports proxy-based upgradeability via an ImplementationAuthority and IdentityProxy, allowing identity contracts to be upgraded without losing state. A factory contract (IdFactory) enables deterministic deployment of identity proxies using CREATE2, with support for wallet linking and token identity creation. A Gateway contract provides an off-chain authorization layer for identity deployment, managing approved signers and signature revocation. A Verifier contract allows other contracts to verify that an identity holds valid claims from trusted issuers for required topics. The architecture is modular, well-tested, and follows security best practices including signature malleability protection. It is designed for use in decentralized identity (DID) systems on EVM-compatible blockchains.
Xian Contracting is a Python-based smart contract development and execution framework that enables developers to write smart contracts in Python with a secure, metered runtime environment. The system features a modular architecture with components for compilation, execution, storage, and a standard library providing blockchain primitives. Key capabilities include Python-native smart contract authoring, deterministic execution with resource metering to prevent abuse, a secure storage system using Variables and Hashes, and restricted imports to prevent malicious code execution. The framework provides a ContractingClient as the primary interface for deploying and interacting with contracts, and includes comprehensive testing across unit, integration, performance, and security dimensions.
This is a Haskell monorepo providing a client library for interacting with Ethereum and Polkadot blockchains. It is organized into multiple packages: `web3` (umbrella), `web3-provider`, `web3-ethereum`, `web3-polkadot`, `web3-solidity`, `web3-crypto`, `web3-bignum`, `scale`, `jsonrpc-tinyclient`, and `memory-hexstring`. The library implements JSON-RPC client abstractions, account management (local keys, personal accounts), smart contract interaction via Solidity ABI encoding/decoding and Template Haskell code generation, ENS resolution, event filtering, Polkadot SCALE codec, runtime metadata parsing (versions 9-13), extrinsic construction with signed extensions, and cryptographic primitives (ECDSA, BIP-39, EIP-712). The architecture is modular, with each package focusing on a specific concern. Key entry points include `Network.Web3.Provider` for connecting to nodes, `Network.Ethereum.Contract.TH` for generating contract bindings, and `Network.Polkadot.Extrinsic` for building and signing transactions. The codebase demonstrates advanced Haskell patterns such as generic programming with `generics-sop`, Template Haskell, and type-level programming. While the library is well-structured and covers a broad set of blockchain interactions, there are signs of technical drift: some metadata versions are partially implemented, commented-out code exists, and dependency bounds are tight. Overall, it is a solid, actively maintained library suitable for Haskell-based blockchain development.