A comprehensive development environment and learning resource for building smart contracts on VeChain using Hardhat. This repository contains practical examples and best practices for Solidity development.
This repository serves as the companion codebase for the Solidity Masterclass video series [Video Series Link]. It provides a complete development environment with real-world examples of smart contract patterns, security considerations, and best practices.
Each section of code corresponds to detailed video explanations in our course:
- [Setting Up Your Development Environment] - Initial setup and configuration
- [Smart Contract Fundamentals] - Basic patterns and best practices
- [Token Standards & Implementation] - ERC20, ERC721, ERC1155
- [Advanced Patterns & Security] - Proxy patterns, upgrades, and security
- ✅ Hardhat configuration for VeChain networks (Solo, Testnet, Mainnet)
- 🐳 Thor-Solo instance for local development
- 📦 Upgradeable smart contracts templates
- 🧪 Comprehensive test suite setup
- 🔧 Deploy and upgrade scripts
- 🎭 Mock contracts for common VeChain contracts
- Node.js v20 (version specified in `.nvmrc`)
- Yarn or npm
- Docker (for running Thor-Solo)
- Clone the repository:
git clone https://github.com/your-username/solidity-masterclass.git
cd solidity-masterclass
- Install dependencies:
yarn install
- Create your environment file:
cp .env.example .env
1. Start the Thor-Solo instance:
```bash
yarn start-solo
```
### Compile
```bash
yarn compile
```
### Deploy
```bash
yarn deploy:solo
```
or
```bash
yarn deploy:testnet
```
or
```bash
yarn deploy:mainnet
```
### Test
```bash
yarn test
```
or to generate a coverage report:
```bash
yarn test:coverage:solidity
```
## Warning
This template is using the `@openzeppelin/contracts-upgradeable` `v5.0.2` and `@openzeppelin/contracts` `v5.0.2` in order to be compatible with the VeChain Solidity compiler version of `0.8.20`.
This repository includes examples of both secure patterns and common vulnerabilities for educational purposes. Never deploy contracts to production without thorough security audits.
MIT
Contributions are welcome! Please read our Contributing Guidelines for details on our code of conduct and the process for submitting pull requests.
For support and discussions, please join our Discord community or open an issue.
For detailed explanations of each concept, please refer to the corresponding video lessons in our Solidity Masterclass Series.