A simple yet powerful Ethereum smart contract project for issuing and verifying certificates, built with Hardhat, Solidity, and Ganache.
CertVault/
├── contracts/
│ └── CertVault.sol # Solidity contract for certificate issuance and validation
├── scripts/
│ └── deploy.js # Script to deploy the smart contract
├── .env.example # Sample environment variables file
├── .gitignore
├── hardhat.config.js # Hardhat config (network, compiler version, etc.)
├── package.json
└── README.md
- 🧾 Smart Contract Logic — Issue, store, and validate certificates via the blockchain
- 🔒 Secure Deployment — Uses private keys from
.envand Hardhat network - ⚙️ Easy Setup — Clear instructions for both beginners and experienced devs
- 🧪 Test & Interaction Ready — Use Hardhat console/scripts or front-end integrations
Make sure you have the following installed:
- Node.js (v16 or above)
- npm
- Hardhat
- Ganache (GUI or CLI)
git clone https://github.com/PawanMohit16/DeploySmartContract.git
cd DeploySmartContractnpm installCopy the example environment file:
cp .env.example .envThen open .env and paste your Ganache account private key:
PRIVATE_KEY=your_ganache_private_key_hereYou can either:
- Launch Ganache GUI, or
- Run CLI in a separate terminal:
ganache-clinpx hardhat compilenpx hardhat run scripts/deploy.js --network ganacheAfter deployment, you'll see the contract address printed in the console.
You can interact with the contract using the Hardhat console, scripts, or your own front-end.
- Issue Certificate
issueCertificate(string memory recipientName, string memory courseName, string memory ipfsHash)- Validate Certificate
validateCertificate(string memory ipfsHash) → returns bool- Get Certificate Details
getCertificate(string memory ipfsHash) → returns (string memory recipientName, string memory courseName)- ❌ Never commit your actual
.envfile or private keys - ✅ Only commit
.env.examplewith placeholder values
This project is licensed under the MIT License. See LICENSE for more information.
Pull requests, issues, and stars are always welcome!
Want to format your own
README.mdlike a pro?
Check out GitHub's Markdown Guide.
- 🧾 Contract Logic — See
contracts/CertVault.sol - ⚙️ Deployment Logic — See
scripts/deploy.js - 🌐 Network Config — See
hardhat.config.js
Happy building! 🎉