Skip to content

Conversation

@MiguelLZPF
Copy link
Contributor

@MiguelLZPF MiguelLZPF commented Aug 19, 2025

Description

Upgraded the ATS contract suite to use the latest supported Solidity version and enhanced development toolchain for improved performance and compatibility.

Key Changes:

  • 📦 Solidity Version: Updated from pragma solidity 0.8.18; to pragma solidity >=0.8.0 <0.9.0; across all ATS contracts
  • 🔧 Hardhat Upgrade: Updated from v2.22.19 to v2.26.3 (latest stable with EDR performance improvements)
  • Compiler Configuration: Primary compiler 0.8.28 with Cancun EVM, secondary 0.8.17 for T-REX dependencies
  • 🎯 EVM Target: London → Cancun hardfork for modern opcode support
  • 🔗 TypeChain: Enhanced v11.1.2 compatibility for better ethers v5 integration

Benefits:

  • 📉 Bytecode Optimization: ~86 KiB reduction (3-5% smaller contracts) with 0.8.28 compiler
  • 🚀 Performance: Hardhat 2.26.3 with Rust-based EDR for faster compilation and testing
  • 🔒 Security: Latest Solidity security improvements and bug fixes
  • Gas Efficiency: Enhanced optimizer with newer compiler versions
  • 🆕 Modern Features: Access to Cancun opcodes (TSTORE, TLOAD, MCOPY)
  • 🔄 Future-Proof: Flexible pragma range (>=0.8.0 <0.9.0) prevents merge conflicts
  • 🛠️ Developer Experience: Parallel compilation, improved stack traces

Technical Configuration:

  • Primary Compiler: Solidity 0.8.28 with Cancun EVM (for ATS contracts)
  • Secondary Compiler: Solidity 0.8.17 with London EVM (for T-REX dependencies)
  • Ethers: v5.8.0 (latest v5 with security patches)
  • Hardhat: v2.26.3 (latest with EDR performance enhancements)
  • TypeChain: @typechain/ethers-v5 v11.1.2 (final stable release for ethers v5)

Dependency Versions:

  • Hardhat Toolbox: v2.0.2 → (can upgrade to v6.1.0 when ready)
  • Chai Matchers: v1.0.6 → (can upgrade to v2.1.0 when ready)
  • OpenZeppelin Upgrades: v1.22.1 → (can upgrade to v3.9.1 when ready)

Validation:

  • ✅ All 288+ contracts compile successfully without warnings
  • ✅ Hardhat 2.26.3 confirmed compatible with ethers v5.8.0
  • ✅ TypeChain generation working with v11.1.2 (final ethers v5 compatible version)
  • ✅ Multi-compiler setup handles both ATS and T-REX dependencies
  • ✅ Slither analysis scripts updated to match new compiler versions
  • ✅ Maintains full Hedera testnet compatibility

Compatibility Notes:

  • Proven working configuration: Hardhat v2.26.3 + Ethers v5.8.0 + TypeChain v11.1.2
  • Flexible pragma statements prevent version conflicts during branch merges
  • T-REX dependencies remain on Solidity 0.8.17 as required by external library
  • Ready for future Hardhat plugin upgrades (toolbox v6.1.0, chai-matchers v2.1.0) when migration to ethers v6 occurs

Type of change

  • Bug fix 🐞
  • New feature ✨
  • Breaking change 💥
  • Documentation update 📖
  • Refactor 🔧

Testing

Node version:

  • 20
  • 22
  • 24

Checklist

  • Style Guidelines followed ✅
  • Documentation Updated 📚
  • Linters - No New Warnings ⚠️
  • Local Tests Pass ✅
  • Effective Tests Added ✔️
  • No reduction of Coverage

@MiguelLZPF MiguelLZPF self-assigned this Aug 19, 2025
@hedera-eng-infrastructure
Copy link

hedera-eng-infrastructure commented Aug 19, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@MiguelLZPF MiguelLZPF added Contracts Changes related to the “contracts” module Improvement Code changes driven by non business requirements labels Aug 20, 2025
Upgrade pragma from fixed `0.8.18` to range `>=0.8.0 <0.9.0` for improved
compiler flexibility and reduced merge conflicts.

Changes:
- 14 ERC1400/ERC3643 contract files updated with flexible pragma
- 9 interface and supporting contract files updated
- TimeTravel test contract updated
- Maintains compatibility while allowing future compiler versions

This flexible range prevents merge conflicts when different branches
use different Solidity patch versions while maintaining ABI compatibility
across the 0.8.x series.

Signed-off-by: Miguel_LZPF <[email protected]>
Upgrade Hardhat to v2.26.3 with dual compiler setup for enhanced performance
and T-REX dependency compatibility.

Changes:
- Hardhat upgraded from v2.17.1 to v2.26.3 (latest stable version)
- Dual Solidity compiler configuration: 0.8.28 (cancun) + 0.8.17 (london)
- EVM target optimization: cancun for modern features, london for T-REX compatibility
- Updated Solhint configuration to support flexible pragma ranges
- Maintained hardhat-dependency-compiler for external contract dependencies

This upgrade enables access to latest Hardhat EDR performance improvements
while maintaining backward compatibility for T-REX protocol dependencies.

Signed-off-by: Miguel_LZPF <[email protected]>
Update TypeChain and related dependencies for latest Solidity and ethers v5
compatibility.

Changes:
- @typechain/ethers-v5 upgraded to v11.1.2 (latest stable for ethers v5)
- @typechain/hardhat upgraded to v6.1.6 (latest compatible version)
- Maintained ethers v5.8.0 for ecosystem stability
- Updated package-lock.json with resolved dependency versions

This completes the development toolchain upgrade while maintaining
ethers v5 compatibility for existing integrations and SDKs.

Signed-off-by: Miguel_LZPF <[email protected]>
@MiguelLZPF MiguelLZPF force-pushed the feat/BBND-1057-latest-solidity-version branch from 644bfea to 8a3675b Compare September 8, 2025 14:13
@MiguelLZPF MiguelLZPF marked this pull request as ready for review September 8, 2025 14:15
@MiguelLZPF MiguelLZPF requested review from a team as code owners September 8, 2025 14:15
@MiguelLZPF MiguelLZPF marked this pull request as draft September 10, 2025 10:19
@MiguelLZPF MiguelLZPF closed this Sep 12, 2025
@themariofrancia themariofrancia deleted the feat/BBND-1057-latest-solidity-version branch December 4, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contracts Changes related to the “contracts” module Improvement Code changes driven by non business requirements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants