Closed skosito closed 4 months ago
The updates include version upgrades for GitHub Actions, Solidity pragma changes for multiple contracts, new Foundry test files, and the addition of OpenZeppelin submodules. It also refines the Node.js version in workflows and enhances test scripts and configurations. The overall improvements focus on compatibility, testing efficiency, and better contract management.
File/Path | Summary |
---|---|
.github/workflows/... | Updated GitHub Actions versions, refined Node.js version, and added steps for Foundry installation and testing. |
.gitmodules | Added submodule for "lib/openzeppelin-foundry-upgrades". |
contracts/prototypes/... | Changed Solidity pragma directives to ^0.8.0 ; added constructors, initializers, and updated functions. |
echidna.yaml | Added balanceAddr field with a specific hexadecimal value. |
foundry.toml | Updated settings related to testing, optimization, FFI, AST, build info, output, permissions, and EVM version. |
lib/types.ts | Reorganized and reordered exported types without adding or removing values. |
package.json | Updated lint scripts and renamed test:forge to test:foundry with forge clean command. |
remappings.txt | Added new remapping for @openzeppelin/contracts-upgradeable/ . |
test/fuzz/... | Added new imports, created proxy addresses, and updated constructor and initialization logic in fuzz tests. |
testFoundry/... | Introduced new test contracts and functions for testing various functionalities, including proxy upgrades. |
.gitignore | Added lcov.info to the ignore list. |
lib/openzeppelin-foundry-upgrades | Introduced a subproject commit with a specific hash. |
In the land of code, a rabbit hops, With updates fresh, it never stops. Solidity’s tune now sings anew, With version bumps and tests to do. Foundry’s forge, a gleaming tool, Ensures our contracts always rule. From workflows to the deepest core, We’ve made them better, that’s for sure!
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 0%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 58.29%. Comparing base (
180b8c8
) to head (e90cd2c
).
Files | Patch % | Lines |
---|---|---|
contracts/prototypes/evm/GatewayEVM.sol | 0.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Would be great if we can merge #231 to it
The coverage looks good https://app.codecov.io/github/zeta-chain/protocol-contracts I think we're mainly missing tests for ERC20Custody withdraw
@lumtis thanks for adding coverage
unfortunately we can not change src
in foundry.toml because it overwrites hardhat config contracts path so everything else is not compiled, and because of that other tests are failing (on coverage PR: https://github.com/zeta-chain/protocol-contracts/actions/runs/9958513626/job/27513101458), this is mentioned on hardhat-foundry plugin repo as well (https://github.com/NomicFoundation/hardhat/blob/main/packages/hardhat-foundry/README.md#how-it-works)
i fixed this with simplest way i found which is to overwrite this part of the config just for coverage script: https://github.com/zeta-chain/protocol-contracts/pull/226/commits/05d2a4aab1f61e914961dfac8d5b0dc3e0f8f175
and improved coverage: https://github.com/zeta-chain/protocol-contracts/pull/226/commits/e90cd2c916dddca2b874b17fdaef7db098e97b76 tests build is failing here, fix is on this PR so we can ignore here: https://github.com/zeta-chain/protocol-contracts/pull/232
migrates unit tests for v2 contracts from hardhat to foundry
GatewayEVMUniswap is not migrated, it is tricky and everything that uniswap deploy npm package does we would need to do manually (basically this whole repo: https://github.com/trashpirate/uniswapV2-deploy, which means manually coping all uniswap files to fix uniswap pair issue on local network) - can this remain hardhat or be part of worker to test this flow?
testFoundry folder separated from test, to better separate hardhat and foundry due to some unexpected errors
introduces openzeppelin foundry upgrade, and modifies tests to deploy gateway and proxy properly
fixes build, test.yml was hanging again, it seems that moving to nodev4 and checkoutv4 did the trick EDIT: it still hangs, this is to be resolved in separate issue as it is ongoing and flaky for some time and not related to this PR
various fixes for issues discovered through debugging (config changes and so on)
nice to add in separate PR, fix lint warnings and some kind of formatter for solidity files, eg: https://book.getfoundry.sh/reference/config/formatter
Summary by CodeRabbit
New Features
Bug Fixes
Chores
package.json
scripts for improved linting and testing..gitignore
to exclude coverage files.Tests