maticnetwork / contracts

Smart contracts comprising the business logic of the Matic Network
https://matic.network
GNU General Public License v3.0
1.15k stars 506 forks source link

POL updates, migration to Foundry/Hardhat #502

Closed simonDos closed 9 months ago

simonDos commented 10 months ago

This merge includes 3 different major changes:

  1. POL-related SC updates from plasma-bridge-update branch (reviewed and audited)
  2. Migration of the whole repository and all tests to use Foundry/Hardhat (description below)
  3. Deletion of deprecated/unused contracts (which are not on mainnet)

Migration details We used the new Foundry template repo as a starting point, but incorporated Hardhat to easily re-use the old tests. All test were then migrated to be used with new JS version and Hardhat framework

No Smart Contract was edited during this migration!

Goals:

type: module

As the old tests relied heavily on import statements, we decided to make the whole project "type": "module" .

This results in the necessary renaming of some config files like hardhat.config.cjs or solcover.cjs using the cjs extension.

Config

To maintain a single source of truth for our config, we import foundry.toml into hardhat.config.cjs to define solidity version and optimiser runs.