core icon indicating copy to clipboard operation
core copied to clipboard

Zksync testing

Open novaknole opened this issue 9 months ago • 7 comments

Description

Please include a summary of the change and be sure you follow the contributions rules we do provide here

Task ID: OS-?

  • Created TokenVotingSetupZkSync.sol which will be deployed and used for TokenVoting Plugin creations. This was needed as in the TokenVotingSetup.sol, we were deploying plugins with clones which is not supported on ZkSync for not-so-important reasons for reviewers.
  • Created PluginSetupProcessorUpgradeable.sol to allow upgradeable psp. This will be deployed only on zksync to avoid compiler bugs in case it happens.
  • Created MockedHelper contract in /test to help with the tests of PSP. This was needed as psp was written with smocks. As it's not supported on zksync, MockedHelper seemed the quickest option.
  • Created ProxyFactory and ProxyLib(or more precisely, copied it from develop branch by Michael) to help ease the deployments.
  • Created Javascript classes such as wrapper, hardhat, zksync inside /test/test-utils/wrapper. This was necessary to avoid rewriting the same tests. The Wrapper class is used to instantiate the appropriate network class to distinguish how deployments must be done. There're a couple of more functions into it that are different between zksync/hardat. The wrapper class is instantiated inside hardhat.config.ts.
  • Changed hardhat.config.ts to allow compiling contracts with zksync or hardhat both.
  • tests that were using evm_setAutomine has been skipped only on zksync network as this feature is not supported on there.
  • Changed deploy scripts such as depending on network, it decides whether to deploy PluginSetupProcessor or its upgradeable version. Same for TokenVotingSetupZkSync or TokenVotingSetup.
  • Contracts are deployed with latest versions, but we're not importing artifacts to help with deployment. This is because, typechain doesn't generate the correct files for zksync(it does, but the only thing it doesn't contain is artifacts), hence deployment with typechains is not possible. I am passing the artifact's names as strings. This causes that if 2 contracts with the same name exists, it can't decide which one to deploy. So, in the Wrapper class, we got string names and importing them.

Type of change

See the framework lifecycle in packages/contracts/docs/framework-lifecycle to decide what kind of change this pull request is.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • [ ] I have selected the correct base branch.
  • [ ] I have performed a self-review of my own code.
  • [ ] I have commented my code, particularly in hard-to-understand areas.
  • [ ] My changes generate no new warnings.
  • [ ] Any dependent changes have been merged and published in downstream modules.
  • [ ] I ran all tests with success and extended them if necessary.
  • [ ] I have updated the CHANGELOG.md file in the root folder.
  • [ ] I have updated the DEPLOYMENT_CHECKLIST file in the root folder.
  • [ ] I have updated the UPDATE_CHECKLIST file in the root folder.
  • [ ] I have updated the Subgraph and added a QA URL to the description of this PR.

novaknole avatar May 15 '24 09:05 novaknole