# pnpm Setup for AITBC Contracts **Level**: Intermediate **Prerequisites**: Node.js, familiarity with package managers **Estimated Time**: 5 minutes **Last Updated**: 2026-05-22 **Version**: 1.0 ## 🧭 **Navigation Path:** **🏠 [Documentation Home](../README.md)** → **📜 Contracts** → **⚙️ pnpm Setup** **breadcrumb**: Home → Contracts → pnpm Setup --- ## 🎯 **See Also:** - **📦 Smart Contract Deployment**: [SMART_CONTRACT_DEPLOYMENT.md](../deployment/SMART_CONTRACT_DEPLOYMENT.md) - Deployment guide using pnpm - **🔧 Development Guidelines**: [DEVELOPMENT_GUIDELINES.md](../development/DEVELOPMENT_GUIDELINES.md) - General development setup - **📜 Contracts Overview**: [contracts/README.md](README.md) - Contract documentation index --- ## 📦 **Overview** AITBC uses **pnpm** as the package manager for both smart contract projects: - `/opt/aitbc/contracts/` - Main Hardhat project (JavaScript-based) - `/opt/aitbc/packages/solidity/aitbc-token/` - Token contracts (TypeScript-based) pnpm provides faster installations, better disk efficiency, and stricter dependency management compared to npm. ## 📋 **Configuration Files** ### `.npmrc` **contracts/ directory:** ```ini auto-install-peers=false strict-peer-dependencies=true prefer-frozen-lockfile=true shamefully-hoist=true ``` **packages/solidity/aitbc-token/ directory:** ```ini auto-install-peers=false strict-peer-dependencies=true prefer-frozen-lockfile=true engine-strict=true ``` **Settings explained:** - **auto-install-peers=false**: Don't automatically install peer dependencies - requires explicit installation - **strict-peer-dependencies=true**: Fail if peer dependency requirements aren't met - **prefer-frozen-lockfile=true**: Use exact versions from lockfile (recommended for CI) - **shamefully-hoist=true** (contracts only): Hoist dependencies to node_modules root for compatibility with older Hardhat - **engine-strict=true** (aitbc-token only): Enforce Node.js version requirement (>=24.14.0) ### `pnpm-lock.yaml` The lockfile is automatically generated and should be committed to version control. It ensures reproducible installs across environments. ## 🚀 **Common Commands** ### Installation ```bash # For main contracts cd /opt/aitbc/contracts pnpm install # For aitbc-token cd /opt/aitbc/packages/solidity/aitbc-token pnpm install ``` ### Development Commands **contracts/ (JavaScript-based):** ```bash cd /opt/aitbc/contracts pnpm hardhat compile pnpm hardhat test pnpm hardhat run scripts/deploy.js --network localhost pnpm hardhat verify --network mainnet