Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code optimization #374

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Cherkaso8
Copy link

Pull Request Description

The pull request includes the following changes:

  1. Artifact Import Optimization:

    • Removed duplicate contract imports in the verifyMainnetDeployment.js file, which used different paths for the same files.
  2. Documentation Updates:

    • Fixed typos and improved readability in the verifyTestnetProofVerifier.md file:
      • "Tweeking" replaced with "Tweaking"
      • "exactlly" replaced with "exactly"
    • Updated some phrases and commands for more accurate description of the process.
  3. Code Optimization:

    • Improved functions for contract verification, eliminating redundant calls.
    • Added additional checks for contract implementations through proxies and administrators.
  4. Technical Changes:

    • Added extra checks for each contract on the main network (Mainnet) with output information to Etherscan.
    • Removed redundant proxy and contract implementation verification calls.

Overall, the code and documentation readability have been improved, redundancies eliminated, and the process clarified.

Common parameters for networks are entered in the createNetworkConfig function, which automatically builds the configuration for each network. This eliminates duplication.

All compilers use the same optimizer setting (for most contracts). This is submitted to the COMPILER_SETTINGS constant.

Account configuration is now stored in one ACCOUNTS_CONFIG object, which is used for all networks.

Flexibility is applied through the use of the INFURA_URL variable, which makes it easy to change the URL for providers without having to copy the same code
Instead of prescribing the path to artifacts for each contract every time, I created an artifactsPath object that stores the path to all the necessary files. This makes it easy to control and change paths in one place.

To improve readability and reduce repeating code, I have taken repeated actions into separate functions

Renamed some variables to improve code readability

Excess or non-informative comments have also been removed, for example, indications of the location of files that are now processed automatically.

---------------------------------------------------

there were typos in the original contract if you decide to leave it: conracts - contracts,  btyecode - bytecode

"deployMainnet.polygonZkEVMBridgeAddress" and other proxy addresses are checked several times. It is better to check each address specifically in the context of his contract to avoid confusion.

Printout:"polygonZkEVMGlobalImpl" must be "polygonZkEVMGlobalExitRootImpl" so that the variable name matches the content.

and few more
Fixed typos 

lets - let’s
Tweeking - Tweaking
exactlly - exactly
transacction - transaction
bycode - bytecode
Copy link

cla-bot bot commented Dec 20, 2024

We require contributors/corporates @Cherkaso8 to read our Contributor License Agreement, please check the Individual CLA document/Corporate CLA document

@Cherkaso8 Cherkaso8 changed the title Optimize / fix / typos Code optimization Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant