Closed skosito closed 3 months ago
[!CAUTION]
Review failed
The pull request is closed.
The recent updates across several smart contracts introduce enhanced functionality and improved error handling. Key changes include the addition of the TSS_ROLE
for refined access control, rigorous input validation checks, and new error types for better debugging and user experience. These modifications aim to create a more robust and versatile framework for interactions within the contracts, ultimately boosting their security and operational capabilities.
Files | Change Summary |
---|---|
v2/pkg/erc20custody.sol/... |
Updated ABI and binary representation for ERC20Custody , modifying function signatures and adding new error types. |
v2/pkg/gatewayevm.sol/... |
Updated ABI for GatewayEVM , reflecting changes in function definitions and state mutability. |
v2/pkg/gatewayevmupgradetest.sol/... |
Modifications to ABI and binary for GatewayEVMUpgradeTest , enhancing functionality with new methods. |
v2/pkg/gatewayzevm.sol/... |
Updated ABI and binary, introducing new functions and events in GatewayZEVM . |
v2/pkg/igatewayevm.sol/... |
Added new error type ConnectorInitialized to IGatewayEVMErrorsMetaData . |
v2/pkg/igatewayzevm.sol/... |
Included new error type InsufficientZetaAmount in IGatewayZEVMErrorsMetaData . |
v2/pkg/senderzevm.sol/... |
Updated Bin field in SenderZEVMMetaData , indicating changes in bytecode. |
v2/pkg/zetaconnectorbase.sol/... |
Introduced TSS_ROLE and new methods for role retrieval in ZetaConnectorBase . |
v2/pkg/zetaconnectornative.sol/... |
Added TSS_ROLE and new methods for accessing this role in ZetaConnectorNative . |
v2/pkg/zetaconnectornonnative.sol/... |
Introduced TSS_ROLE function for role management in ZetaConnectorNonNative . |
v2/src/evm/GatewayEVM.sol |
Implemented zero address checks across multiple functions for improved security. |
v2/src/evm/ZetaConnectorBase.sol |
Added TSS_ROLE constant to enhance access control. |
v2/src/evm/ZetaConnectorNonNative.sol |
Updated setMaxSupply function to require TSS_ROLE for permissions. |
v2/src/evm/interfaces/IGatewayEVM.sol |
Introduced ConnectorInitialized error for detailed error handling. |
v2/src/zevm/GatewayZEVM.sol |
Added input validation checks to various functions to prevent invalid address usage. |
v2/src/zevm/interfaces/IGatewayZEVM.sol |
Included error for insufficient Zeta amounts. |
v2/test/ERC20Custody.t.sol |
New test contract ERC20CustodyTest introduced for validating functionality of ERC20Custody . |
v2/test/GatewayEVM.t.sol |
Updated tests to use specific non-native Zeta token implementation, enhancing coverage. |
v2/test/GatewayZEVM.t.sol |
Enhanced error handling with new error types in tests, focusing on input validation. |
v2/test/ZRC20.t.sol |
Added new test functions to improve coverage of ZRC20 functionalities. |
v2/test/ZetaConnectorNative.t.sol |
Introduced EnforcedPause error and testing for paused contract behavior. |
v2/test/ZetaConnectorNonNative.t.sol |
Added new error types related to access control and supply management. |
v2/typechain-types/ZetaConnectorBase.ts |
Updated interfaces to include TSS_ROLE . |
v2/typechain-types/ZetaConnectorNative.ts |
Included TSS_ROLE in interface definitions. |
v2/typechain-types/ZetaConnectorNonNative.ts |
Added TSS_ROLE to manage new role functionality. |
sequenceDiagram
participant User
participant Contract
participant RoleManagement
User->>Contract: Call function (e.g., deposit)
Contract->>RoleManagement: Check for valid role (TSS_ROLE)
RoleManagement-->>Contract: Role validated
Contract->>Contract: Execute function logic
Contract-->>User: Return result
🐇 In the meadow, a change so bright,
New roles and checks take glorious flight.
TSS_ROLE hops in, with a skip and a cheer,
Validations in place, we’ve nothing to fear!
Contracts now flourish, secure and keen,
In our blockchain garden, all is serene! 🌼
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 94.44444%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 82.65%. Comparing base (
43176d2
) to head (8fcc85b
). Report is 21 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
v2/src/evm/ZetaConnectorBase.sol | 0.00% | 1 Missing :warning: |
v2/src/zevm/GatewayZEVM.sol | 95.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
this contract is currently under test/utils so it's not impacting coverage, should we move it under src/zevm and exclude from coverage?
We should exclude it from coverage yes
bumps v2 coverage from ~70% to ~80%, fixes some smaller issues, extends simple checks of external functions a bit
@lumtis question about more tests - the only protocol contract that is not tested is SystemContract, simply because we are not using full functionality, there are no tests for it in v1, and it will be replaced by some sort of registry contract, so no point to add tests for whole contract now
this contract is currently under
test/utils
so it's not impacting coverage, should we move it undersrc/zevm
and exclude from coverage?Summary by CodeRabbit
New Features
TSS_ROLE
, for improved access control across multiple contracts.ConnectorInitialized
andInsufficientZetaAmount
.ERC20Custody
,GatewayEVM
,GatewayZEVM
, andZetaConnectorBase
.Bug Fixes
Tests
ERC20Custody
,GatewayEVM
, andGatewayZEVM
to validate functionalities and edge cases.