HARDHAT EVM FIX: Resolve mcopy instruction compatibility issue
Issue Fixed:
❌ TypeError: The mcopy instruction is only available for Cancun-compatible VMs
❌ Compiling for shanghai EVM version
❌ OpenZeppelin v5.0.2 using mcopy opcode
❌ HH600 compilation failure
Root Cause:
- mcopy instruction requires Cancun EVM version or later
- Previous EVM version was shanghai (doesn't support mcopy)
- OpenZeppelin v5.0.2 uses mcopy for gas optimization
- EVM version too old for mcopy instruction
Solution Applied:
✅ Updated evmVersion to cancun in Hardhat config
✅ Cancun EVM supports mcopy and other new opcodes
✅ Maintains Solidity 0.8.25 compiler version
✅ Preserves optimizer settings for gas efficiency
Configuration Changes:
- evmVersion: cancun (supports mcopy)
- version: 0.8.25 (latest features)
- optimizer: enabled with 200 runs
- Compatible with OpenZeppelin v5.0.2
Impact:
- OpenZeppelin contracts now compile successfully
- mcopy instruction is supported
- No more HH600 compilation errors
- Modern EVM features available
- Gas optimizations from OpenZeppelin work
- Cancun EVM features enabled
This resolves the exact mcopy compatibility issue that was
preventing Hardhat from compiling contracts with OpenZeppelin v5.0.2.
HARDHAT COMPILER FIX: Resolve mcopy function not found error
Issue Fixed:
❌ DeclarationError: Function mcopy not found
❌ OpenZeppelin contracts using mcopy opcode
❌ Compilation failing with HH600 error
❌ EVM version too old for mcopy support
Root Cause:
- OpenZeppelin v5.0.2 uses mcopy function for gas optimization
- mcopy requires Shanghai EVM version or later
- Default EVM version didn't support mcopy opcode
- Hardhat config missing evmVersion setting
Solution Applied:
✅ Set evmVersion to shanghai in Hardhat config
✅ Shanghai EVM supports mcopy and other new opcodes
✅ Maintains Solidity 0.8.24 compiler version
✅ Keeps optimizer settings for gas efficiency
Configuration Changes:
- Added evmVersion: shanghai to solidity settings
- Maintains version: 0.8.24 for compiler
- Preserves optimizer settings
- Compatible with OpenZeppelin v5.0.2
Impact:
- OpenZeppelin contracts now compile successfully
- mcopy function is supported
- No more HH600 compilation errors
- Modern EVM features available
- Gas optimizations from OpenZeppelin work
This resolves the compilation issue that was preventing
Hardhat from compiling contracts due to missing mcopy support.
- Change file mode from 644 to 755 for all project files
- Add chain_id parameter to get_balance RPC endpoint with default "ait-devnet"
- Rename Miner.extra_meta_data to extra_metadata for consistency