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

feat: add hardhat task to verify deployed contracts #220

Merged
merged 10 commits into from
Oct 2, 2024

Conversation

tamtamchik
Copy link
Member

Screenshot 2024-09-24 at 23 13 10

@tamtamchik tamtamchik changed the base branch from master to repovation September 24, 2024 22:16
Copy link

github-actions bot commented Sep 24, 2024

badge

Hardhat Unit Tests Coverage Summary

Filename                                                       Stmts    Miss  Cover    Missing
-----------------------------------------------------------  -------  ------  -------  ---------
contracts/0.4.24/Lido.sol                                        212       0  100.00%
contracts/0.4.24/StETH.sol                                        72       0  100.00%
contracts/0.4.24/StETHPermit.sol                                  15       0  100.00%
contracts/0.4.24/lib/Packed64x4.sol                                5       0  100.00%
contracts/0.4.24/lib/SigningKeys.sol                              36       0  100.00%
contracts/0.4.24/lib/StakeLimitUtils.sol                          37       0  100.00%
contracts/0.4.24/nos/NodeOperatorsRegistry.sol                   485       0  100.00%
contracts/0.4.24/oracle/LegacyOracle.sol                          72       0  100.00%
contracts/0.4.24/utils/Pausable.sol                                9       0  100.00%
contracts/0.4.24/utils/Versioned.sol                               5       0  100.00%
contracts/0.6.12/WstETH.sol                                       17       0  100.00%
contracts/0.8.4/WithdrawalsManagerProxy.sol                       61       0  100.00%
contracts/0.8.9/BeaconChainDepositor.sol                          21       2  90.48%   48, 51
contracts/0.8.9/Burner.sol                                        71       0  100.00%
contracts/0.8.9/DepositSecurityModule.sol                        104       0  100.00%
contracts/0.8.9/EIP712StETH.sol                                   16       0  100.00%
contracts/0.8.9/LidoExecutionLayerRewardsVault.sol                16       0  100.00%
contracts/0.8.9/LidoLocator.sol                                   18       0  100.00%
contracts/0.8.9/OracleDaemonConfig.sol                            28       0  100.00%
contracts/0.8.9/StakingRouter.sol                                303       0  100.00%
contracts/0.8.9/WithdrawalQueue.sol                               88       0  100.00%
contracts/0.8.9/WithdrawalQueueBase.sol                          146       0  100.00%
contracts/0.8.9/WithdrawalQueueERC721.sol                         89       0  100.00%
contracts/0.8.9/WithdrawalVault.sol                               21       0  100.00%
contracts/0.8.9/lib/Math.sol                                       4       0  100.00%
contracts/0.8.9/lib/PositiveTokenRebaseLimiter.sol                22       0  100.00%
contracts/0.8.9/lib/UnstructuredRefStorage.sol                     2       0  100.00%
contracts/0.8.9/oracle/AccountingOracle.sol                      171       1  99.42%   723
contracts/0.8.9/oracle/BaseOracle.sol                             89       1  98.88%   397
contracts/0.8.9/oracle/HashConsensus.sol                         263       1  99.62%   1005
contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol                91      91  0.00%    96-461
contracts/0.8.9/proxy/OssifiableProxy.sol                         17       0  100.00%
contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol      171       0  100.00%
contracts/0.8.9/utils/DummyEmptyContract.sol                       0       0  100.00%
contracts/0.8.9/utils/PausableUntil.sol                           31       0  100.00%
contracts/0.8.9/utils/Versioned.sol                               11       0  100.00%
contracts/0.8.9/utils/access/AccessControl.sol                    23       0  100.00%
contracts/0.8.9/utils/access/AccessControlEnumerable.sol           9       0  100.00%
contracts/testnets/sepolia/SepoliaDepositAdapter.sol              21      21  0.00%    49-100
TOTAL                                                           2872     117  95.93%

Diff against master

Filename                                                       Stmts    Miss  Cover
-----------------------------------------------------------  -------  ------  --------
contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol      -54       0  +100.00%
contracts/testnets/sepolia/SepoliaDepositAdapter.sol             +21     +21  +100.00%
TOTAL                                                            -33     +21  -0.73%

Results for commit: cc18828

Minimum allowed coverage is 95%

♻️ This comment has been updated with latest results

@tamtamchik
Copy link
Member Author

@TheDZhon @mymphe, any objections against coupling this logic (abi extraction, contracts verification) with HardHat tasks are welcome; I'm not rock solid about this solution. It really might be that old plain bash files work better here.

@tamtamchik tamtamchik marked this pull request as ready for review September 25, 2024 13:28
@tamtamchik tamtamchik requested a review from a team as a code owner September 25, 2024 13:28
@tamtamchik tamtamchik requested review from TheDZhon and mymphe and removed request for a team September 25, 2024 13:28
@tamtamchik tamtamchik added this to the Repovation milestone Sep 25, 2024
@tamtamchik tamtamchik added enhancement New feature or request. refactoring Code improvement without changing functionality. labels Sep 25, 2024
@tamtamchik tamtamchik self-assigned this Sep 25, 2024
@tamtamchik
Copy link
Member Author

tamtamchik commented Sep 25, 2024

Proof of work: https://sepolia.etherscan.io/address/0x34104f0b5bf1ad71ec465240e3e8fe1547dac0e6#code

Copy link
Contributor

@mymphe mymphe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested minor improvements

tasks/extract-abis.ts Outdated Show resolved Hide resolved
tasks/verify-contracts.ts Outdated Show resolved Hide resolved
tasks/verify-contracts.ts Outdated Show resolved Hide resolved
tasks/verify-contracts.ts Outdated Show resolved Hide resolved
@mymphe
Copy link
Contributor

mymphe commented Sep 30, 2024

@TheDZhon @mymphe, any objections against coupling this logic (abi extraction, contracts verification) with HardHat tasks are welcome; I'm not rock solid about this solution. It really might be that old plain bash files work better here.

imo having some random bash script in a TS codebase sounds worse than writing a custom hardhat task for verification.

Copy link
Contributor

@TheDZhon TheDZhon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am totally ok with the hardhat verification approach given that it's totally automated and strongly typed against the previous bash solution 💪

Left some questions here and there 🙏

globals.d.ts Outdated Show resolved Hide resolved
tasks/extract-abis.ts Outdated Show resolved Hide resolved
tasks/extract-abis.ts Show resolved Hide resolved
tasks/verify-contracts.ts Outdated Show resolved Hide resolved
tasks/verify-contracts.ts Outdated Show resolved Hide resolved
tasks/verify-contracts.ts Outdated Show resolved Hide resolved
tasks/verify-contracts.ts Outdated Show resolved Hide resolved
Co-authored-by: Eugene Mamin <[email protected]>
@tamtamchik tamtamchik merged commit 87d7f33 into repovation Oct 2, 2024
8 of 9 checks passed
@tamtamchik tamtamchik deleted the feat/verify-contracts branch October 2, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request. refactoring Code improvement without changing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants