-
Notifications
You must be signed in to change notification settings - Fork 55
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: revert options and revert context #305
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe recent updates enhance error handling and control flow across various smart contracts by introducing structured Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Contract
participant RevertHandler
User->>Contract: withdrawAndRevert(RevertContext)
alt Success
Contract-->>User: Withdrawal successful
else Revert
Contract->>RevertHandler: Handle revert using RevertContext
RevertHandler-->>User: Provide revert details
end
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? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #305 +/- ##
=======================================
Coverage 83.33% 83.33%
=======================================
Files 7 7
Lines 288 288
Branches 96 96
=======================================
Hits 240 240
Misses 48 48 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is the idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 15
Outside diff range, codebase verification and nitpick comments (3)
v2/src/zevm/interfaces/IGatewayZEVM.sol (1)
6-14
: Correct the typo in the comment.There is a typo in the comment for the
RevertOptions
struct. Change@pararm
to@param
.-/// @pararm abortAddress Address to receive funds if aborted. +/// @param abortAddress Address to receive funds if aborted.v2/pkg/systemcontractmock.sol/systemcontractmock.go (1)
Line range hint
38-43
:
Consider removing deprecated variables.The variables
SystemContractMockABI
andSystemContractMockBin
are marked as deprecated. If they are not used elsewhere, consider removing them to prevent potential issues and ensure the codebase remains clean.-// Deprecated: Use SystemContractMockMetaData.ABI instead. -var SystemContractMockABI = SystemContractMockMetaData.ABI -// Deprecated: Use SystemContractMockMetaData.Bin instead. -var SystemContractMockBin = SystemContractMockMetaData.Binv2/pkg/systemcontract.sol/systemcontract.go (1)
Lack of Validation for
ZContext
inDepositAndCall
FunctionThe
DepositAndCall
function does not include explicit validation logic for thecontext
parameter. Ensure that any necessary validations, such as checking for zero addresses or invalid input, are implemented elsewhere if required. This could be a potential oversight if validation is necessary for the correct functioning of the contract.
- File:
v2/pkg/systemcontract.sol/systemcontract.go
- Functions:
DepositAndCall
inSystemContractTransactor
,SystemContractSession
, andSystemContractTransactorSession
Analysis chain
Line range hint
491-503
:
Verify Logic and Validations forDepositAndCall
.The
DepositAndCall
function includes a structuredcontext
parameter. Ensure that the function logic correctly processes this parameter and that all necessary validations, such as checking for zero addresses or invalid input, are implemented.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the logic and validations for the `DepositAndCall` function. # Test: Search for the `DepositAndCall` logic. Expect: Correct processing and validation of the `context` parameter. rg --type go -A 10 $'DepositAndCall'Length of output: 43439
Script:
#!/bin/bash # Description: Search for the definition and usage of the `ZContext` type to check for any validation logic. # Search for the definition of the `ZContext` type. rg --type go 'type ZContext' # Search for any functions or methods that might validate `ZContext`. rg --type go 'func.*ZContext'Length of output: 14023
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (56)
- v2/pkg/erc20custody.sol/erc20custody.go (1 hunks)
- v2/pkg/igatewayevm.sol/igatewayevm.go (8 hunks)
- v2/pkg/igatewayevm.sol/igatewayevmevents.go (7 hunks)
- v2/pkg/igatewayzevm.sol/igatewayzevm.go (11 hunks)
- v2/pkg/igatewayzevm.sol/igatewayzevmevents.go (7 hunks)
- v2/pkg/senderzevm.sol/senderzevm.go (1 hunks)
- v2/pkg/systemcontract.sol/systemcontract.go (1 hunks)
- v2/pkg/systemcontractmock.sol/systemcontractmock.go (1 hunks)
- v2/pkg/testuniversalcontract.sol/testuniversalcontract.go (3 hunks)
- v2/pkg/universalcontract.sol/universalcontract.go (3 hunks)
- v2/pkg/zetaconnectornative.sol/zetaconnectornative.go (1 hunks)
- v2/pkg/zetaconnectornonnative.sol/zetaconnectornonnative.go (1 hunks)
- v2/scripts/localnet/EvmCall.s.sol (1 hunks)
- v2/scripts/localnet/EvmDepositAndCall.s.sol (1 hunks)
- v2/scripts/localnet/ZevmCall.s.sol (1 hunks)
- v2/scripts/localnet/ZevmWithdrawAndCall.s.sol (1 hunks)
- v2/src/evm/ERC20Custody.sol (1 hunks)
- v2/src/evm/GatewayEVM.sol (3 hunks)
- v2/src/evm/ZetaConnectorBase.sol (1 hunks)
- v2/src/evm/interfaces/IGatewayEVM.sol (3 hunks)
- v2/src/zevm/GatewayZEVM.sol (6 hunks)
- v2/src/zevm/interfaces/IGatewayZEVM.sol (7 hunks)
- v2/src/zevm/interfaces/UniversalContract.sol (2 hunks)
- v2/test/GatewayEVM.t.sol (13 hunks)
- v2/test/GatewayEVMZEVM.t.sol (7 hunks)
- v2/test/GatewayZEVM.t.sol (29 hunks)
- v2/test/ZetaConnectorNonNative.t.sol (1 hunks)
- v2/test/utils/GatewayEVMUpgradeTest.sol (10 hunks)
- v2/test/utils/SenderZEVM.sol (3 hunks)
- v2/test/utils/TestUniversalContract.sol (1 hunks)
- v2/typechain-types/GatewayEVM.ts (10 hunks)
- v2/typechain-types/GatewayEVMEchidnaTest.ts (10 hunks)
- v2/typechain-types/GatewayEVMUpgradeTest.ts (14 hunks)
- v2/typechain-types/GatewayZEVM.ts (20 hunks)
- v2/typechain-types/IGatewayEVM.sol/IGatewayEVM.ts (9 hunks)
- v2/typechain-types/IGatewayEVM.sol/IGatewayEVMEvents.ts (5 hunks)
- v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVM.ts (18 hunks)
- v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVMEvents.ts (7 hunks)
- v2/typechain-types/TestUniversalContract.ts (4 hunks)
- v2/typechain-types/UniversalContract.sol/UniversalContract.ts (4 hunks)
- v2/typechain-types/factories/ERC20Custody__factory.ts (1 hunks)
- v2/typechain-types/factories/GatewayEVMEchidnaTest__factory.ts (8 hunks)
- v2/typechain-types/factories/GatewayEVMUpgradeTest__factory.ts (11 hunks)
- v2/typechain-types/factories/GatewayEVM__factory.ts (8 hunks)
- v2/typechain-types/factories/GatewayZEVM__factory.ts (10 hunks)
- v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVMEvents__factory.ts (2 hunks)
- v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVM__factory.ts (7 hunks)
- v2/typechain-types/factories/IGatewayZEVM.sol/IGatewayZEVMEvents__factory.ts (2 hunks)
- v2/typechain-types/factories/IGatewayZEVM.sol/IGatewayZEVM__factory.ts (9 hunks)
- v2/typechain-types/factories/SenderZEVM__factory.ts (1 hunks)
- v2/typechain-types/factories/SystemContract.sol/SystemContract__factory.ts (1 hunks)
- v2/typechain-types/factories/SystemContractMock.sol/SystemContractMock__factory.ts (1 hunks)
- v2/typechain-types/factories/TestUniversalContract__factory.ts (2 hunks)
- v2/typechain-types/factories/UniversalContract.sol/UniversalContract__factory.ts (1 hunks)
- v2/typechain-types/factories/ZetaConnectorNative__factory.ts (1 hunks)
- v2/typechain-types/factories/ZetaConnectorNonNative__factory.ts (1 hunks)
Files skipped from review due to trivial changes (3)
- v2/src/evm/ERC20Custody.sol
- v2/src/evm/ZetaConnectorBase.sol
- v2/test/ZetaConnectorNonNative.t.sol
Additional context used
GitHub Check: Slither
v2/src/evm/GatewayEVM.sol
[warning] 207-224: Low-level calls
Low level call in GatewayEVM.deposit(address,RevertOptions) (src/evm/GatewayEVM.sol#207-224):
- (deposited,None) = tssAddress.call{value: msg.value}() (src/evm/GatewayEVM.sol#219)
[warning] 253-271: Low-level calls
Low level call in GatewayEVM.depositAndCall(address,bytes,RevertOptions) (src/evm/GatewayEVM.sol#253-271):
- (deposited,None) = tssAddress.call{value: msg.value}() (src/evm/GatewayEVM.sol#266)
Biome
v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVM.ts
[error] 356-356: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 367-367: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 379-379: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 491-491: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 503-503: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/IGatewayEVM.sol/IGatewayEVM.ts
[error] 328-328: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 334-334: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 345-345: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 355-355: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 417-417: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 424-424: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 436-436: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 447-447: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayZEVM.ts
[error] 650-650: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 661-661: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 673-673: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayEVM.ts
[error] 604-604: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 612-612: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 623-623: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 633-633: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 780-780: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 790-790: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 802-802: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayEVMUpgradeTest.ts
[error] 623-623: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 631-631: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 642-642: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 652-652: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 742-742: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 799-799: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 809-809: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 821-821: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayEVMEchidnaTest.ts
[error] 625-625: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 633-633: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 644-644: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 654-654: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 811-811: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 821-821: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
Additional comments not posted (247)
v2/src/zevm/interfaces/UniversalContract.sol (1)
31-31
: Simplified context structure inonRevert
.The
onRevert
function now useszContext
instead of the removedrevertContext
. This change likely simplifies the context management for reverts, aligning with best practices for contract development.v2/scripts/localnet/EvmCall.s.sol (2)
26-27
: Introduction ofRevertOptions
structure.The
RevertOptions
structure is introduced to manage revert scenarios more effectively. This addition provides enhanced control over transaction behavior in the event of a revert.
30-30
: EnhancedgatewayEVM.call
withRevertOptions
.The
gatewayEVM.call
now includesrevertOptions
, improving error handling and control flow during execution. This change aligns with the goal of robust contract interactions.v2/scripts/localnet/ZevmCall.s.sol (2)
36-37
: Introduction ofRevertOptions
structure.The
RevertOptions
structure is introduced to manage revert scenarios more effectively. This addition provides enhanced control over transaction behavior in the event of a revert.
40-40
: EnhancedgatewayZEVM.call
withRevertOptions
.The
gatewayZEVM.call
now includesrevertOptions
, improving error handling and control flow during execution. This change aligns with the goal of robust contract interactions.v2/scripts/localnet/ZevmWithdrawAndCall.s.sol (1)
39-40
: LGTM! Verify theRevertOptions
usage in the codebase.The introduction of the
RevertOptions
parameter enhances error handling as intended.Ensure that the
RevertOptions
struct and its usage are consistent across the codebase.Verification successful
Consistent Usage of
RevertOptions
Across the CodebaseThe
RevertOptions
struct is used consistently in various parts of the codebase, including test files and scripts. It is defined and utilized in both EVM and ZEVM contexts, ensuring that error handling is enhanced as intended.
- Struct Definition: The
RevertOptions
struct is defined in the interfaces for both EVM and ZEVM gateways.- Test Files: The struct is used in multiple test files such as
GatewayZEVM.t.sol
,GatewayEVMZEVM.t.sol
, andGatewayEVM.t.sol
.- Scripts: It is also employed in scripts like
ZevmWithdrawAndCall.s.sol
,ZevmCall.s.sol
,EvmDepositAndCall.s.sol
, andEvmCall.s.sol
.These usages indicate that the
RevertOptions
parameter is consistently integrated across the codebase. No inconsistencies were found in its usage.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `RevertOptions` across the codebase. # Test: Search for `RevertOptions` struct usage. Expect: Consistent usage across files. rg --type solidity --context 5 'RevertOptions'Length of output: 79
Script:
#!/bin/bash # Description: Verify the usage of `RevertOptions` across the codebase. # Define Solidity file type and search for `RevertOptions` struct usage. rg --type-add 'solidity:*.sol' --type solidity --context 5 'RevertOptions'Length of output: 34808
v2/scripts/localnet/EvmDepositAndCall.s.sol (1)
36-37
: LGTM! Verify theRevertOptions
usage in the codebase.The introduction of the
RevertOptions
parameter enhances error handling as intended.Ensure that the
RevertOptions
struct and its usage are consistent across the codebase.Verification successful
RevertOptions Usage Verified
The
RevertOptions
struct is consistently used across the codebase in various contexts, such as events, function parameters, and memory allocations. The integration appears to be as intended.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `RevertOptions` across the codebase. # Test: Search for `RevertOptions` struct usage. Expect: Consistent usage across files. rg --type solidity --context 5 'RevertOptions'Length of output: 79
Script:
#!/bin/bash # Description: Verify the usage of `RevertOptions` across Solidity files in the codebase. # Find all Solidity files and search for the `RevertOptions` struct usage within them. fd --extension sol --exec rg 'RevertOptions' {}Length of output: 280313
v2/typechain-types/factories/UniversalContract.sol/UniversalContract__factory.ts (1)
64-64
: LGTM! Verify thezContext
usage in the codebase.The change from
revertContext
tozContext
suggests a refactor for clarity or functionality.Ensure that the
zContext
struct and its usage are consistent across the codebase.Verification successful
Consistent Usage of
zContext
VerifiedThe
zContext
struct is used consistently across the codebase, indicating that the refactor fromrevertContext
tozContext
has been thoroughly applied. The instances found in various files confirm this consistency.
- Files checked include multiple
__factory.ts
files across different directories.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `zContext` across the codebase. # Test: Search for `zContext` struct usage. Expect: Consistent usage across files. rg --type typescript --context 5 'zContext'Length of output: 78
Script:
#!/bin/bash # Description: Verify the usage of `zContext` across the codebase. # Test: Search for `zContext` struct usage in TypeScript files. rg --glob '*.ts' --context 5 'zContext'Length of output: 22915
v2/test/utils/TestUniversalContract.sol (1)
Line range hint
56-62
:
Verify the integration ofzContext
.The parameter type change from
revertContext
tozContext
seems correct, assumingzContext
is the intended structure. Ensure that this change is consistent across the codebase and that thezContext
type provides the necessary fields.Verification successful
Integration of
zContext
is consistent and correct.The
zContext
structure is used consistently across the codebase, including in theonRevert
function. The change fromrevertContext
tozContext
is well-integrated and appears intentional. No issues found with this change.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `zContext` across the codebase. # Test: Search for the definition and usage of `zContext`. Expect: Consistent usage across the codebase. rg --type solidity 'zContext'Length of output: 62
Script:
#!/bin/bash # Description: Verify the usage of `zContext` across Solidity files. # Find all Solidity files and search for `zContext` within them. fd --extension sol --exec rg 'zContext' {}Length of output: 53079
v2/test/utils/SenderZEVM.sol (3)
5-6
: LGTM on import updates!The destructuring import for
IGatewayZEVM
andRevertOptions
is correct and improves clarity.
65-69
: VerifyRevertOptions
instantiation.The
RevertOptions
structure is instantiated with specific addresses. Ensure these addresses are correct and intended for the revert logic.
34-38
: VerifyRevertOptions
instantiation.The
RevertOptions
structure is instantiated with specific addresses. Ensure these addresses are correct and intended for the revert logic.v2/typechain-types/factories/IGatewayZEVM.sol/IGatewayZEVMEvents__factory.ts (2)
40-62
: LGTM onrevertOptions
structure!The
revertOptions
structure is correctly defined and integrated into theCall
event.
118-140
: LGTM onrevertOptions
structure!The
revertOptions
structure is correctly defined and integrated into theWithdrawal
event.v2/typechain-types/UniversalContract.sol/UniversalContract.ts (3)
Line range hint
142-147
:
VerifygetFunction
logic forZContextStruct
.Ensure that the
getFunction
logic foronRevert
integratesZContextStruct
correctly and aligns with the overall contract functionality.
47-48
: Verify compatibility ofZContextStruct
.Ensure that the
ZContextStruct
used inencodeFunctionData
is compatible with the expected data format in the contract logic.Verification successful
ZContextStruct is compatible with expected data formats.
The
ZContextStruct
is consistently defined and used across the codebase, with fields that align with typical Ethereum data types. This confirms its compatibility with the expected data format in the contract logic.
- Definition includes fields:
origin: BytesLike
,sender: AddressLike
,chainID: BigNumberish
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage and compatibility of `ZContextStruct` in the codebase. # Test: Search for `ZContextStruct` usage. Expect: Consistent usage across the codebase. rg --type ts 'ZContextStruct'Length of output: 9712
Script:
#!/bin/bash # Description: Extract the definition of `ZContextStruct` to verify its structure. # Find the definition of `ZContextStruct` in the codebase. ast-grep --lang typescript --pattern 'export type ZContextStruct = { $$$ }'Length of output: 5080
Line range hint
113-118
:
VerifyonRevert
method handling ofZContextStruct
.Ensure that the
onRevert
method correctly handles theZContextStruct
and integrates with the contract logic as expected.v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVMEvents__factory.ts (2)
34-56
: Verify integration ofrevertOptions
inCall
event.Ensure that the
revertOptions
structure is correctly integrated into theCall
event and aligns with the contract's logic.
94-116
: Verify integration ofrevertOptions
inDeposit
event.Ensure that the
revertOptions
structure is correctly integrated into theDeposit
event and aligns with the contract's logic.v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVMEvents.ts (4)
45-60
: Verify integration ofrevertOptions
inCallEvent
.Ensure that the
revertOptions
parameter is correctly integrated into theCallEvent
input and output tuples and aligns with the event's logic.Verification successful
Integration of
revertOptions
inCallEvent
is consistent.The
revertOptions
parameter is consistently integrated into theCallEvent
input and output tuples across multiple files. This suggests that the integration is uniform throughout the codebase. Further checks on logic alignment should be conducted separately if needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration of `revertOptions` in `CallEvent`. # Test: Search for `CallEvent` usage. Expect: Consistent integration of `revertOptions`. rg --type ts 'CallEvent' -A 5Length of output: 32774
24-34
: Verify definition and usage ofRevertOptionsStruct
.Ensure that
RevertOptionsStruct
andRevertOptionsStructOutput
are correctly defined and used consistently across the contract logic.Verification successful
RevertOptionsStruct is correctly defined and consistently used across the codebase.
The
RevertOptionsStruct
andRevertOptionsStructOutput
types are extensively utilized in various files, indicating their integral role in the contract logic. The definitions and usages are consistent with their intended purpose. No discrepancies were found in their application.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition and usage of `RevertOptionsStruct`. # Test: Search for `RevertOptionsStruct` usage. Expect: Consistent usage across the codebase. rg --type ts 'RevertOptionsStruct'Length of output: 13799
Line range hint
77-100
:
Verify integration ofrevertOptions
inWithdrawalEvent
.Ensure that the
revertOptions
parameter is correctly integrated into theWithdrawalEvent
input and output tuples and aligns with the event's logic.
Line range hint
171-187
:
Verify updated filters forCall
andWithdrawal
events.Ensure that the updated filters for
Call
andWithdrawal
events correctly include therevertOptions
parameter and align with the contract's logic.v2/typechain-types/TestUniversalContract.ts (3)
53-54
: Change toZContextStruct
looks good, but verify its usage.The switch from
RevertContextStruct
toZContextStruct
is consistent with the refactoring goals. Ensure thatZContextStruct
is correctly defined and used across the codebase.Verification successful
ZContextStruct is consistently defined and used across the codebase.
The search results show that
ZContextStruct
is defined and used in multiple files across different directories, indicating consistent usage. This confirms that the change fromRevertContextStruct
toZContextStruct
aligns with the refactoring goals and is correctly implemented throughout the codebase.
- Files with
ZContextStruct
Definition and Usage:
v1/typechain-types/contracts/zevm/interfaces/ZContract.ts
v2/typechain-types/UniversalContract.sol/UniversalContract.ts
v2/typechain-types/SystemContract.sol/SystemContract.ts
v2/typechain-types/GatewayZEVM.ts
v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVM.ts
v2/typechain-types/zContract.sol/UniversalContract.ts
v2/typechain-types/TestUniversalContract.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `ZContextStruct` is correctly defined and used across the codebase. # Test: Search for the definition and usage of `ZContextStruct`. Expect: Consistent usage and definition. rg --type solidity 'ZContextStruct'Length of output: 68
Script:
#!/bin/bash # Description: Verify that `ZContextStruct` is correctly defined and used across the codebase. # Test: Search for the definition and usage of `ZContextStruct` across all files. rg 'ZContextStruct'Length of output: 9702
175-177
: Update toZContextStruct
inonRevert
is correct, but verify related logic.The change to use
ZContextStruct
is consistent with the refactoring. Ensure that all related logic and documentation are updated.
204-206
: Refactoring toZContextStruct
ingetFunction
is appropriate, but verify related components.The update to use
ZContextStruct
is consistent with the refactoring. Ensure that this change is reflected in all related components.v2/src/evm/interfaces/IGatewayEVM.sol (6)
49-57
: Addition ofRevertOptions
toDeposit
event is correct, but verify event emission.The inclusion of
RevertOptions
enhances the event's capability. Ensure that the event is emitted with the correctRevertOptions
data.Verification successful
Event Emissions with
RevertOptions
are CorrectThe
Deposit
event is emitted with theRevertOptions
parameter in various instances throughout the codebase, confirming its correct usage. Here are some examples:
emit Deposit(owner, destination, amount, address(token), payload, revertOptions);
emit Deposit(msg.sender, receiver, amount, asset, payload, revertOptions);
These emissions show that the
RevertOptions
parameter is being used as intended.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `Deposit` event is emitted with correct `RevertOptions`. # Test: Search for `Deposit` event emissions. Expect: Correct `RevertOptions` data. rg --type solidity 'emit Deposit'Length of output: 68
Script:
#!/bin/bash # Description: Find all Solidity files and search for `Deposit` event emissions. # Find all `.sol` files and search for `emit Deposit` within them. fd --extension sol --exec rg 'emit Deposit' {}Length of output: 1492
63-64
: Inclusion ofRevertOptions
inCall
event is appropriate, but verify event emission.The addition of
RevertOptions
aligns with enhanced revert handling. Ensure that the event is emitted with the correctRevertOptions
data.Verification successful
Event
Call
is emitted withRevertOptions
correctly.The
Call
event is consistently emitted with theRevertOptions
parameter across various instances in the codebase. This confirms that the integration ofRevertOptions
is appropriately handled during event emissions.
- The event is emitted in multiple contexts, each including
revertOptions
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `Call` event is emitted with correct `RevertOptions`. # Test: Search for `Call` event emissions. Expect: Correct `RevertOptions` data. rg --type solidity 'emit Call'Length of output: 65
Script:
#!/bin/bash # Find all Solidity files and search for `emit Call` to verify the event emission. fd -e sol -x rg 'emit Call' {}Length of output: 488
142-147
: Inclusion ofRevertOptions
indepositAndCall
is appropriate, but verify function logic.The addition of
RevertOptions
supports enhanced handling. Ensure that the function logic correctly uses theRevertOptions
.
4-12
:RevertOptions
struct definition is well-structured, but verify its usage.The
RevertOptions
struct provides necessary fields for handling revert scenarios. Ensure that these fields are used appropriately in the codebase.
129-130
: Enhancement ofdeposit
function withRevertOptions
is valid, but verify function logic.The addition of
RevertOptions
allows for enhanced handling. Ensure that the function logic appropriately utilizes theRevertOptions
.
169-170
: Addition ofRevertOptions
tocall
function is valid, but verify function logic.The inclusion of
RevertOptions
aligns with enhanced handling. Ensure that the function logic makes proper use of theRevertOptions
.v2/typechain-types/factories/TestUniversalContract__factory.ts (2)
193-194
: Bytecode update is noted, but verify intended changes.The update in bytecode suggests changes in functionality or optimizations. Ensure that these changes are intended and documented.
78-80
: Update tostruct zContext
is correct, but verify consistent application.The change to
struct zContext
is consistent with the refactoring. Ensure that this change is consistently applied across the ABI.Verification successful
Consistent Application of
struct zContext
VerifiedThe
struct zContext
is consistently applied across multiple files in the codebase, indicating that the refactoring has been applied uniformly.
v2/typechain-types/factories/TestUniversalContract__factory.ts
v2/typechain-types/factories/GatewayZEVM__factory.ts
v2/typechain-types/factories/zContract.sol/ZContract__factory.ts
v2/typechain-types/factories/UniversalContract.sol/UniversalContract__factory.ts
v2/typechain-types/factories/SystemContract.sol/SystemContract__factory.ts
v2/typechain-types/factories/IGatewayZEVM.sol/IGatewayZEVM__factory.ts
v1/typechain-types/factories/contracts/zevm/interfaces/ZContract__factory.ts
v1/typechain-types/factories/contracts/zevm/SystemContract.sol/SystemContract__factory.ts
This confirms that the update to
struct zContext
is consistently applied.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistent application of `struct zContext` across the ABI. # Test: Search for `struct zContext` in ABI. Expect: Consistent application. rg --type typescript 'struct zContext'Length of output: 75
Script:
#!/bin/bash # Description: Verify consistent application of `struct zContext` across the ABI. # Test: Search for `struct zContext` in TypeScript files. Expect: Consistent application. rg --type ts 'struct zContext'Length of output: 2485
v2/typechain-types/factories/SenderZEVM__factory.ts (1)
123-123
: Verify the updated bytecode.The bytecode string has been updated. Ensure that this change reflects the intended modifications to the smart contract logic and that it has been thoroughly tested.
v2/src/zevm/interfaces/IGatewayZEVM.sol (4)
Line range hint
38-48
:
Verify the addition ofrevertOptions
in theWithdrawal
event.The
Withdrawal
event now includes aRevertOptions
parameter. Ensure that this change is reflected in all related event emissions and handlers.
217-217
: Verify the renaming ofcontext
tozContext
.The context parameter has been renamed to
zContext
inexecuteRevert
anddepositAndRevert
functions. Ensure that all related logic and calls are updated accordingly.Also applies to: 232-232
99-104
: Verify the integration ofRevertOptions
in function signatures.The
RevertOptions
struct has been added to multiple function signatures. Ensure that all function calls and related logic are updated to accommodate this change.Also applies to: 111-116, 125-131, 140-146, 154-159
25-27
: Verify the addition ofrevertOptions
in theCall
event.The
Call
event now includes aRevertOptions
parameter. Ensure that this change is reflected in all related event emissions and handlers.Verification successful
Verification successful:
revertOptions
included in allCall
event emissions.The
revertOptions
parameter is consistently included in all instances of theCall
event emissions across the codebase. No issues were found regarding its integration.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `Call` event emissions include `RevertOptions`. # Test: Search for the `Call` event to ensure `RevertOptions` is included in all emissions. rg --type solidity "emit Call("Length of output: 104
Script:
#!/bin/bash # Corrected regex pattern to search for the `Call` event emissions in Solidity files. rg --type solidity "emit Call\("Length of output: 67
Script:
#!/bin/bash # Find all Solidity files and search for the `emit Call(` statement to verify the inclusion of `RevertOptions`. fd -e sol -x rg "emit Call\(" {}Length of output: 490
v2/test/GatewayEVMZEVM.t.sol (3)
11-11
: Improve import statement consistency.The import statements have been updated to use destructuring. Ensure that this change is consistent across the codebase for readability and maintainability.
Also applies to: 18-24
Verification successful
Import statement consistency verified.
The use of destructured import statements is consistent across the codebase, as evidenced by the search results. This aligns with the goal of maintaining readability and maintainability. No further action is needed.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistent use of destructured import statements across the codebase. # Test: Search for import statements to ensure consistency in destructuring. rg --type solidity "import {"Length of output: 111
Script:
#!/bin/bash # Description: Verify consistent use of destructured import statements across the codebase. # Test: Search for import statements to ensure consistency in destructuring. rg --type solidity "import \\{"Length of output: 65
Script:
#!/bin/bash # Description: Verify consistent use of destructured import statements across the codebase. # Test: Search for import statements to ensure consistency in destructuring. rg "import \\{" --glob "*.sol"Length of output: 3950
134-135
: Verify the integration ofRevertOptions
in test function calls.The
RevertOptions
struct is integrated into several test function calls. Ensure that all related logic and assertions are updated to accommodate this change.Also applies to: 154-160, 192-196, 222-227
Verification successful
Integration of
RevertOptions
VerifiedThe
RevertOptions
parameter is included in the calls togatewayZEVM.call
andgatewayZEVM.withdrawAndCall
across the relevant test files. The presence ofRevertOptions
in these function calls suggests that the integration is implemented as expected. However, ensure that all related logic and assertions are updated to accommodate this change, as the search did not specifically verify assertion logic. You should manually verify that the test logic properly handlesRevertOptions
where necessary.
- Files with
RevertOptions
integration:
v2/test/GatewayEVMZEVM.t.sol
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the test function calls include the `RevertOptions` parameter. # Test: Search for test function calls to ensure `RevertOptions` is included. rg --type solidity "gatewayZEVM\.call\(|gatewayZEVM\.withdrawAndCall\("Length of output: 106
Script:
#!/bin/bash # Description: Verify that the test function calls include the `RevertOptions` parameter. # Find all Solidity files and search for the specific function calls. fd --extension sol --exec rg 'gatewayZEVM\.call\(|gatewayZEVM\.withdrawAndCall\('Length of output: 437
Script:
#!/bin/bash # Description: Search for assertions or logic involving `RevertOptions` in Solidity test files. # Find all Solidity test files and search for references to `RevertOptions`. fd --extension sol --exec rg 'RevertOptions'Length of output: 280308
64-64
: Verify the initialization and use ofRevertOptions
.The
RevertOptions
struct is initialized and used in various tests. Ensure that the tests adequately cover scenarios involving this struct.Also applies to: 119-120
v2/typechain-types/IGatewayEVM.sol/IGatewayEVMEvents.ts (10)
24-28
: New type declarationRevertOptionsStruct
.The
RevertOptionsStruct
type is well-defined and adds useful fields for handling reverts.
30-34
: New type declarationRevertOptionsStructOutput
.The
RevertOptionsStructOutput
type mirrors the input structure, which is consistent and necessary for output handling.
52-54
: AddedrevertOptions
toCallEvent.InputTuple
.The addition of
revertOptions
enhances the event's ability to manage transaction reverts.
55-59
: AddedrevertOptions
toCallEvent.OutputTuple
.Including
revertOptions
in the output tuple is consistent with the input, ensuring symmetry.
65-65
: AddedrevertOptions
toCallEvent.OutputObject
.This addition ensures that the
OutputObject
remains consistent with the tuple definitions.
79-80
: AddedrevertOptions
toDepositEvent.InputTuple
.The inclusion of
revertOptions
provides additional context for handling reverts in deposit events.
87-88
: AddedrevertOptions
toDepositEvent.OutputTuple
.This ensures that the output tuple aligns with the input structure, maintaining consistency.
96-96
: AddedrevertOptions
toDepositEvent.OutputObject
.The
OutputObject
now reflects the updated tuple structure, which is consistent.
281-284
: UpdatedCall
event filter signature.The signature change to include
revertOptions
as a tuple is correctly reflected in the event filter.
292-295
: UpdatedDeposit
event filter signature.The signature now includes
revertOptions
, which aligns with the event's updated structure.v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVM__factory.ts (7)
26-47
: AddedrevertOptions
tocall
function ABI.The addition of
revertOptions
as a tuple is well-structured and enhances the function's revert handling capabilities.
61-82
: AddedrevertOptions
todeposit
function ABI (payable).Incorporating
revertOptions
into the ABI for the payabledeposit
function improves error management.
106-127
: AddedrevertOptions
todeposit
function ABI (nonpayable).The addition of
revertOptions
is consistent with the payable version, ensuring uniformity.
146-167
: AddedrevertOptions
todepositAndCall
function ABI (payable).The structured
revertOptions
tuple enhances the function's ability to handle reverts effectively.
196-217
: AddedrevertOptions
todepositAndCall
function ABI (nonpayable).This addition mirrors the payable version, maintaining consistency across function definitions.
342-364
: AddedrevertOptions
toCall
event ABI.The event ABI now includes
revertOptions
, which aligns with the updated event structure.
402-424
: AddedrevertOptions
toDeposit
event ABI.The inclusion of
revertOptions
in the event ABI is consistent with the event's new structure.v2/pkg/universalcontract.sol/universalcontract.go (4)
41-41
: Updated ABI metadata forUniversalContract
.The ABI now reflects the use of
structzContext
, ensuring consistency with the updated function signatures.
214-216
: UpdatedOnRevert
function signature inUniversalContractTransactor
.The replacement of
RevertContext
withZContext
is consistent with the new context handling approach.
221-223
: UpdatedOnRevert
function signature inUniversalContractSession
.This change aligns with the updated context management strategy using
ZContext
.
228-230
: UpdatedOnRevert
function signature inUniversalContractTransactorSession
.The use of
ZContext
ensures consistency across all session types for context handling.v2/typechain-types/factories/SystemContractMock.sol/SystemContractMock__factory.ts (2)
345-345
: Verify the updated bytecode.The
_bytecode
constant has been updated, indicating a new contract deployment. Ensure that this change is intentional and correctly reflects the desired contract logic.
346-346
: Verify constructor parameter handling.The
SystemContractMockConstructorParams
type has been updated to include an optionalsigner
. Ensure all constructor calls are compatible with this change.v2/src/zevm/GatewayZEVM.sol (8)
Line range hint
190-206
:
Ensure correct handling ofRevertOptions
in ZETAwithdrawAndCall
.The ZETA
withdrawAndCall
function now includesRevertOptions
. Verify that this parameter is correctly handled and integrated into the function logic.
319-319
: Verify context type change inexecuteRevert
.The context parameter type has changed to
zContext
. Ensure this change is consistent with the broader context management strategy.
4-4
: Verify import ofRevertOptions
.The
RevertOptions
type is imported and used in several functions. Ensure that this type is correctly defined and used throughout the codebase.Verification successful
Import and Usage of
RevertOptions
VerifiedThe
RevertOptions
struct is correctly defined inv2/src/zevm/interfaces/IGatewayZEVM.sol
and is used consistently across the codebase, including inv2/src/zevm/GatewayZEVM.sol
. The import and usage are valid and correctly implemented.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the import and usage of `RevertOptions`. # Test: Search for `RevertOptions` definition and usage. Expect: Correct definition and consistent usage. rg --type solidity 'RevertOptions'Length of output: 67
Script:
#!/bin/bash # Searching for the definition of `RevertOptions` in Solidity files ast-grep --lang solidity --pattern 'contract RevertOptions { $$$ }' # Searching for the usage of `RevertOptions` in Solidity files rg 'RevertOptions' --glob '*.sol' -A 5Length of output: 20175
342-342
: Verify context type change indepositAndRevert
.The context parameter type has changed to
zContext
. Ensure this change is consistent with the broader context management strategy.Verification successful
zContext
Type Consistency Verified indepositAndRevert
FunctionThe
depositAndRevert
function in bothGatewayZEVM.sol
andIGatewayZEVM.sol
consistently useszContext
as the type for thecontext
parameter. This change aligns with the broader context management strategy in these files.
- Files and Lines:
v2/src/zevm/GatewayZEVM.sol
: Lines 342-346v2/src/zevm/interfaces/IGatewayZEVM.sol
: Lines 342-346The use of
zContext
is consistent across the implementation and interface, indicating a coherent application of the type change.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify context type change in `depositAndRevert`. # Test: Search for `depositAndRevert` function implementation. Expect: Consistent use of `zContext`. rg --type solidity $'function depositAndRevert\\(zContext calldata context, address zrc20, uint256 amount, address target, bytes calldata message\\)'Length of output: 181
Script:
#!/bin/bash # Description: Verify context type change in `depositAndRevert`. # Test: Search for `depositAndRevert` function implementation in Solidity files. Expect: Consistent use of `zContext`. rg 'function depositAndRevert\(zContext calldata context, address zrc20, uint256 amount, address target, bytes calldata message\)' --glob '*.sol' -A 5Length of output: 152
Script:
#!/bin/bash # Description: Search for any implementation of `depositAndRevert` in Solidity files. # Test: Search for `depositAndRevert` function in Solidity files to check parameter types. rg 'function depositAndRevert\(' --glob '*.sol' -A 5Length of output: 801
Line range hint
143-161
:
Ensure correct handling ofRevertOptions
inwithdrawAndCall
.The
withdrawAndCall
function now includesRevertOptions
. Verify that this parameter is correctly handled and integrated into the function logic.
212-225
: Ensure correct handling ofRevertOptions
incall
.The
call
function now includesRevertOptions
. Verify that this parameter is correctly handled and integrated into the function logic.
118-135
: Ensure correct handling ofRevertOptions
inwithdraw
.The
withdraw
function now includesRevertOptions
. Verify that this parameter is correctly handled and integrated into the function logic.
167-182
: Ensure correct handling ofRevertOptions
in ZETAwithdraw
.The ZETA
withdraw
function now includesRevertOptions
. Verify that this parameter is correctly handled and integrated into the function logic.v2/src/evm/GatewayEVM.sol (4)
4-6
: Verify import ofRevertOptions
.The
RevertOptions
type is imported and used in several functions. Ensure that this type is correctly defined and used throughout the codebase.Verification successful
Import and Usage of
RevertOptions
VerifiedThe
RevertOptions
type is correctly defined as a struct in bothIGatewayEVM.sol
andIGatewayZEVM.sol
and is consistently used across the codebase, including inGatewayEVM.sol
. Its fields are appropriately utilized in various functions and tests. No issues found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the import and usage of `RevertOptions`. # Test: Search for `RevertOptions` definition and usage. Expect: Correct definition and consistent usage. rg --type solidity 'RevertOptions'Length of output: 67
Script:
#!/bin/bash # Description: Verify the import and usage of `RevertOptions`. # Search for `RevertOptions` definition and usage in Solidity files. rg 'RevertOptions' --glob '*.sol' -A 5Length of output: 19988
301-312
: Ensure correct handling ofRevertOptions
incall
.The
call
function now includesRevertOptions
. Verify that this parameter is correctly handled and integrated into the function logic.
Line range hint
278-295
:
Ensure correct handling ofRevertOptions
in ERC20depositAndCall
.The ERC20
depositAndCall
function now includesRevertOptions
. Verify that this parameter is correctly handled and integrated into the function logic.Tools
GitHub Check: Slither
[warning] 207-224: Low-level calls
Low level call in GatewayEVM.deposit(address,RevertOptions) (src/evm/GatewayEVM.sol#207-224):
- (deposited,None) = tssAddress.call{value: msg.value}() (src/evm/GatewayEVM.sol#219)
[warning] 253-271: Low-level calls
Low level call in GatewayEVM.depositAndCall(address,bytes,RevertOptions) (src/evm/GatewayEVM.sol#253-271):
- (deposited,None) = tssAddress.call{value: msg.value}() (src/evm/GatewayEVM.sol#266)
230-246
: Ensure correct handling ofRevertOptions
in ERC20deposit
.The ERC20
deposit
function now includesRevertOptions
. Verify that this parameter is correctly handled and integrated into the function logic.v2/test/utils/GatewayEVMUpgradeTest.sol (9)
57-71
: Improved readability and maintainability.The use of descriptive parameter names and zero address checks enhances the function's clarity and robustness.
103-114
: Zero address check and event emission enhance robustness and transparency.The addition of a zero address check and the emission of an event with
revertOptions
improve the function's reliability and transparency.
211-228
: Enhanced error handling and input validation.The addition of the
RevertOptions
parameter and zero address checks improve the function's robustness.
235-251
: Improved error handling and input validation.The inclusion of the
RevertOptions
parameter and zero address checks enhance the function's robustness.
257-275
: Enhanced error handling and input validation.The addition of the
RevertOptions
parameter and zero address checks improve the function's robustness.
283-300
: Improved error handling and input validation.The inclusion of the
RevertOptions
parameter and zero address checks enhance the function's robustness.
306-317
: Enhanced error handling and input validation.The addition of the
RevertOptions
parameter and zero address checks improve the function's robustness.
321-327
: Improved readability and input validation.The use of a descriptive parameter name and zero address checks enhance the function's clarity and robustness.
331-337
: Improved readability and input validation.The use of a descriptive parameter name and zero address checks enhance the function's clarity and robustness.
v2/typechain-types/factories/IGatewayZEVM.sol/IGatewayZEVM__factory.ts (5)
31-51
: Well-definedRevertOptions
structure.The
RevertOptions
structure enhances error handling capabilities by providing detailed options for managing reverts.
182-182
: Enhanced context management and error handling.The updated function signature with
zContext
andRevertOptions
improves the function's robustness and flexibility.
282-282
: Enhanced context management and error handling.The updated function signature with
zContext
andRevertOptions
improves the function's robustness and flexibility.
340-364
: Improved error handling withRevertOptions
.The inclusion of
RevertOptions
in the function signature enhances its ability to manage revert scenarios.
Line range hint
439-464
: Improved error handling withRevertOptions
.The inclusion of
RevertOptions
in the function signature enhances its ability to manage revert scenarios.v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVM.ts (5)
26-29
: Well-definedRevertOptionsStruct
.The
RevertOptionsStruct
enhances error handling capabilities by providing detailed options for managing reverts.
60-63
: Enhanced error handling in function signatures.The inclusion of
RevertOptionsStruct
in the function signatures improves the interface's ability to manage revert scenarios.
167-168
: Improved event logging withrevertOptions
.The inclusion of
revertOptions
in event definitions enhances logging by providing more context about revert scenarios.
349-366
: Improved error handling withRevertOptionsStruct
.The inclusion of
RevertOptionsStruct
in the method signature enhances its ability to manage revert scenarios.Tools
Biome
[error] 356-356: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
371-389
: Improved error handling withRevertOptionsStruct
.The inclusion of
RevertOptionsStruct
in the method signature enhances its ability to manage revert scenarios.Tools
Biome
[error] 379-379: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/IGatewayEVM.sol/IGatewayEVM.ts (8)
26-30
: DefineRevertOptionsStruct
Correctly.The
RevertOptionsStruct
is defined correctly with fieldsrevertAddress
,callOnRevert
, andabortAddress
. This structure is crucial for handling revert options across various functions.
32-36
: Ensure Consistency inRevertOptionsStructOutput
.The
RevertOptionsStructOutput
is defined to match theRevertOptionsStruct
, ensuring consistency between input and output types. This is important for correct encoding and decoding of data.
141-154
: Update Event Input and Output Tuples forCallEvent
.The
CallEvent
now includesrevertOptions
in its input and output tuples. This change ensures that events carry the necessary revert option data.
168-185
: Update Event Input and Output Tuples forDepositEvent
.The
DepositEvent
now includesrevertOptions
in its input and output tuples. This update is crucial for tracking revert options in deposit-related events.
64-86
: Correctly Encode Function Data with Revert Options.The
encodeFunctionData
methods now includeRevertOptionsStruct
as a parameter. Verify that the encoding logic is correctly implemented in the codebase.
107-119
: Decode Function Results with Updated Signatures.The
decodeFunctionResult
methods are updated to handle the new function signatures. Ensure that decoding logic is correctly implemented.
Line range hint
546-557
: Update Event Filters with Revert Options.The event filters for
Call
andDeposit
events now includerevertOptions
. Ensure that these filters are correctly used in the codebase.Verification successful
Event Filters Updated with Revert Options Verified
The
Call
andDeposit
event filters have been updated to includerevertOptions
in their definitions. These updates are consistent across multiple files in the codebase, confirming that the changes are correctly implemented.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of updated event filters with `revertOptions`. # Test: Search for event filter usage. Expect: Proper handling of `revertOptions`. rg --type typescript -A 5 $'filters: { "Call(address,address,bytes,tuple)"' rg --type typescript -A 5 $'filters: { "Deposit(address,address,uint256,address,bytes,tuple)"'Length of output: 471
Script:
#!/bin/bash # Description: Search for the usage of `Call` and `Deposit` event filters and check for `revertOptions`. # Corrected search for event filter usage. rg --type typescript -A 10 'CallEvent' rg --type typescript -A 10 'DepositEvent'Length of output: 150
Script:
#!/bin/bash # Description: Search for the usage of `CallEvent` and `DepositEvent` in TypeScript files and check for `revertOptions`. # Corrected search for event filter usage in .ts files. rg --glob '*.ts' -A 10 'CallEvent' rg --glob '*.ts' -A 10 'DepositEvent'Length of output: 97607
42-45
: Update Function Signatures for Revert Options.The function signatures have been updated to include
RevertOptionsStruct
. Ensure that all calls to these functions are updated accordingly in the codebase.v2/typechain-types/factories/SystemContract.sol/SystemContract__factory.ts (1)
442-442
: Verify the Updated Bytecode.The bytecode has been updated, indicating changes in the contract's compiled code. Ensure that the new bytecode reflects the intended updates and does not introduce regressions.
v2/pkg/senderzevm.sol/senderzevm.go (1)
35-35
: Verify the Updated Bytecode inSenderZEVMMetaData
.The
Bin
field has been updated, indicating changes in the contract's bytecode. Ensure that the new bytecode reflects the intended updates and does not introduce regressions.v2/test/GatewayEVM.t.sol (4)
37-37
: Addition ofRevertOptions
inGatewayEVMTest
.The
RevertOptions
variable is introduced, which enhances the test setup by allowing for more detailed revert handling. Ensure that this variable is used consistently throughout the test cases.
Line range hint
290-324
:
Addition ofRevertOptions
inGatewayEVMInboundTest
.The
RevertOptions
variable is added and initialized. This provides flexibility in testing different revert scenarios. Ensure that therevertOptions
are correctly applied in all relevant test cases.
335-336
: Inclusion ofrevertOptions
in event emissions and function calls.The
revertOptions
parameter is now included in various event emissions and function calls. This change ensures that revert conditions are consistently logged and handled across different operations.Also applies to: 361-362, 388-389, 419-419, 432-433, 466-467, 493-494
353-353
: Ensure proper handling ofrevertOptions
in failure scenarios.The
revertOptions
parameter is included in failure scenarios, which is crucial for testing how the system handles reverts. Verify that all edge cases are covered and that therevertOptions
are correctly influencing the behavior.Also applies to: 374-374, 380-380, 399-399, 406-406, 448-448, 457-457, 478-478, 486-486, 501-501
v2/pkg/igatewayzevm.sol/igatewayzevmevents.go (4)
32-37
: Definition ofRevertOptions
struct.The
RevertOptions
struct is defined with fieldsRevertAddress
,CallOnRevert
, andAbortAddress
. This struct encapsulates revert handling details, enhancing the robustness of event handling.
41-41
: Update of ABI to includerevertOptions
.The ABI strings for
Call
andWithdrawal
events now include therevertOptions
parameter. This change ensures that the events carry detailed revert handling information.
259-264
: Integration ofRevertOptions
into event structures.The
RevertOptions
field is added to theIGatewayZEVMEventsCall
andIGatewayZEVMEventsWithdrawal
structs. This integration provides additional context for revert scenarios in event data.Also applies to: 423-423
267-269
: Modification of event handling functions to supportRevertOptions
.The event handling functions (
FilterCall
,WatchCall
,ParseCall
,FilterWithdrawal
,WatchWithdrawal
,ParseWithdrawal
) are updated to accommodate theRevertOptions
parameter. Ensure that these functions correctly process the new field.Also applies to: 288-290, 334-336, 427-429, 448-450, 494-496
v2/typechain-types/factories/ZetaConnectorNonNative__factory.ts (1)
620-620
: Significant bytecode update.The bytecode for the
ZetaConnectorNonNative
contract has been entirely replaced. This suggests major changes in the contract logic. Ensure that the changes are consistent with the intended functionality and that all dependent components are updated accordingly.v2/typechain-types/factories/ZetaConnectorNative__factory.ts (1)
614-614
: Verify the bytecode update.The
_bytecode
constant has been updated. Ensure that this change reflects the intended updates to the smart contract logic and that it has been thoroughly tested.v2/typechain-types/factories/ERC20Custody__factory.ts (1)
674-674
: Verify the bytecode update.The
_bytecode
constant has been updated. Ensure that this change reflects the intended updates to the smart contract logic and that it has been thoroughly tested.v2/typechain-types/GatewayZEVM.ts (8)
26-29
: Introduction ofRevertOptionsStruct
.The new
RevertOptionsStruct
enhances the handling of revert options. Ensure that this struct is used consistently across the contract and that it aligns with the intended error handling improvements.
32-36
: Introduction ofRevertOptionsStructOutput
.The
RevertOptionsStructOutput
provides a clear output structure for the revert options. Verify that this output structure is correctly integrated into the contract's logic.
76-79
: Update function signatures to includeRevertOptionsStruct
.The function signatures now include
RevertOptionsStruct
, which enhances error handling. Ensure that all related functions are updated and tested for this change.
180-205
: Update encoding for functions withRevertOptionsStruct
.The encoding functions have been updated to include
RevertOptionsStruct
. Verify that these changes are consistent with the intended functionality and that they are thoroughly tested.
272-284
: Update decoding for functions withRevertOptionsStruct
.The decoding functions have been updated to include
RevertOptionsStruct
. Ensure these changes are consistent with the intended functionality and are thoroughly tested.
295-310
: UpdateCallEvent
to includeRevertOptionsStruct
.The
CallEvent
now includesRevertOptionsStruct
, providing additional context. Verify that this change is correctly integrated and tested.
Line range hint
433-456
:
UpdateWithdrawalEvent
to includeRevertOptionsStruct
.The
WithdrawalEvent
now includesRevertOptionsStruct
, enhancing event context. Ensure this change is correctly integrated and tested.
Line range hint
969-1057
:
Update event filters to includeRevertOptionsStruct
.The event filters now include
RevertOptionsStruct
, providing enhanced filtering capabilities. Verify that these changes are correctly integrated and tested.v2/pkg/testuniversalcontract.sol/testuniversalcontract.go (3)
236-238
: Update context parameter type inOnRevert
.The
OnRevert
function now usesZContext
instead ofRevertContext
. Ensure that all usages of this function across the codebase are updated to match the new parameter type.
243-245
: Update context parameter type inOnRevert
for session.The
OnRevert
function inTestUniversalContractSession
now usesZContext
. Verify that the session calls are updated accordingly.
250-252
: Update context parameter type inOnRevert
for transactor session.The
OnRevert
function inTestUniversalContractTransactorSession
now usesZContext
. Ensure consistency in function calls with the new parameter type.v2/typechain-types/GatewayEVM.ts (9)
26-30
: IntroduceRevertOptionsStruct
.The
RevertOptionsStruct
is a new type that provides additional options for handling reverts. This enhances the flexibility and robustness of transaction management.
48-51
: Update deposit method signatures to includeRevertOptionsStruct
.The deposit methods now accept
RevertOptionsStruct
, allowing for more nuanced control over transaction behavior. Ensure that all calls to these methods are updated to include the new parameter.
111-134
: UpdateencodeFunctionData
for new signatures.The
encodeFunctionData
method signatures are updated to handle the newRevertOptionsStruct
. This ensures proper encoding of function calls with the new parameters.
301-314
: UpdateCallEvent
to includeRevertOptionsStruct
.The
CallEvent
now includesRevertOptionsStruct
, reflecting the additional options available for handling reverts. This change ensures that event logs capture the full context of transactions.
328-345
: UpdateDepositEvent
to includeRevertOptionsStruct
.The
DepositEvent
now includesRevertOptionsStruct
, enhancing the event's ability to convey transaction revert options.
Line range hint
1036-1047
: Update event filters to includeRevertOptionsStruct
.The event filters for
Call
andDeposit
events now includeRevertOptionsStruct
, ensuring that the filters can handle the new parameters.
599-603
: Avoid usingvoid
outside return types.The use of
void
in parameter lists is confusing. Consider replacingvoid
withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
627-632
: Avoid usingvoid
outside return types.Replace
void
withundefined
in parameter lists to adhere to best practices.- [void], + [undefined],Likely invalid or redundant comment.
616-622
: Avoid usingvoid
outside return types.Replace
void
withundefined
in parameter lists to improve clarity.- [void], + [undefined],Likely invalid or redundant comment.
v2/typechain-types/GatewayEVMUpgradeTest.ts (9)
26-30
: IntroduceRevertOptionsStruct
.The
RevertOptionsStruct
is a new type that provides additional options for handling reverts, enhancing transaction management.
48-51
: Update deposit method signatures to includeRevertOptionsStruct
.The deposit methods now accept
RevertOptionsStruct
, allowing for more nuanced control over transaction behavior. Ensure that all calls to these methods are updated to include the new parameter.
112-135
: UpdateencodeFunctionData
for new signatures.The
encodeFunctionData
method signatures are updated to handle the newRevertOptionsStruct
. This ensures proper encoding of function calls with the new parameters.
302-315
: UpdateCallEvent
to includeRevertOptionsStruct
.The
CallEvent
now includesRevertOptionsStruct
, reflecting the additional options available for handling reverts. This change ensures that event logs capture the full context of transactions.
329-346
: UpdateDepositEvent
to includeRevertOptionsStruct
.The
DepositEvent
now includesRevertOptionsStruct
, enhancing the event's ability to convey transaction revert options.
Line range hint
1062-1073
: Update event filters to includeRevertOptionsStruct
.The event filters for
Call
andDeposit
events now includeRevertOptionsStruct
, ensuring that the filters can handle the new parameters.
646-651
: Avoid usingvoid
outside return types.Replace
void
withundefined
in parameter lists to adhere to best practices.- [void], + [undefined],Likely invalid or redundant comment.
618-622
: Avoid usingvoid
outside return types.The use of
void
in parameter lists is confusing. Consider replacingvoid
withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
635-641
: Avoid usingvoid
outside return types.Replace
void
withundefined
in parameter lists to improve clarity.- [void], + [undefined],Likely invalid or redundant comment.
v2/typechain-types/GatewayEVMEchidnaTest.ts (9)
26-30
: RevertOptionsStruct Definition Looks Good.The structure of
RevertOptionsStruct
is well-defined and aligns with the intended functionality for handling revert options.
32-36
: RevertOptionsStructOutput Definition Looks Good.The structure of
RevertOptionsStructOutput
is well-defined and provides a clear mapping for output scenarios.
114-115
: Function Signature Update forcall
Looks Good.The inclusion of
RevertOptionsStruct
in thecall
function signature enhances error handling capabilities.
118-119
: Function Signature Update fordeposit
Looks Good.The inclusion of
RevertOptionsStruct
in thedeposit
function signature is consistent with enhanced revert management.
126-127
: Function Signature Update fordepositAndCall
Looks Good.The inclusion of
RevertOptionsStruct
in thedepositAndCall
function signature enhances the function's error handling capabilities.
322-323
: Event Definition Update forCallEvent
Looks Good.The inclusion of
revertOptions
in theCallEvent
definition improves the event's ability to track transaction states and manage errors.
349-350
: Event Definition Update forDepositEvent
Looks Good.The inclusion of
revertOptions
in theDepositEvent
definition improves the event's ability to track transaction states and manage errors.
1080-1081
: Filter Update forCall
Event Looks Good.The inclusion of a tuple in the
Call
event filter aligns with the updated event definition and maintains consistency.
1091-1092
: Filter Update forDeposit
Event Looks Good.The inclusion of a tuple in the
Deposit
event filter aligns with the updated event definition and maintains consistency.v2/test/GatewayZEVM.t.sol (39)
29-29
: Integration ofrevertOptions
Looks Good.The addition of
revertOptions
as a state variable enhances the contract's error handling capabilities.
67-68
: Initialization ofrevertOptions
Looks Good.The
revertOptions
variable is initialized correctly, ensuring it has the necessary values for testing.
76-78
: Inclusion ofrevertOptions
in Withdrawal Emit Statement Looks Good.The
emit Withdrawal
statement now includesrevertOptions
, which enhances the tracking of transaction states.
79-79
: Inclusion ofrevertOptions
inwithdraw
Function Call Looks Good.The
withdraw
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
94-94
: Inclusion ofrevertOptions
inwithdraw
Function Call Looks Good.The
withdraw
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
103-103
: Inclusion ofrevertOptions
inwithdraw
Function Call Looks Good.The
withdraw
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
108-108
: Inclusion ofrevertOptions
inwithdraw
Function Call Looks Good.The
withdraw
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
113-113
: Inclusion ofrevertOptions
inwithdraw
Function Call Looks Good.The
withdraw
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
125-125
: Inclusion ofrevertOptions
inwithdraw
Function Call Looks Good.The
withdraw
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
135-135
: Inclusion ofrevertOptions
inwithdrawAndCall
Function Call Looks Good.The
withdrawAndCall
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
141-141
: Inclusion ofrevertOptions
inwithdrawAndCall
Function Call Looks Good.The
withdrawAndCall
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
154-154
: Inclusion ofrevertOptions
inwithdrawAndCall
Function Call Looks Good.The
withdrawAndCall
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
178-178
: Inclusion ofrevertOptions
inwithdrawAndCall
Function Call Looks Good.The
withdrawAndCall
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
186-186
: Inclusion ofrevertOptions
inwithdraw
Function Call Looks Good.The
withdraw
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
191-191
: Inclusion ofrevertOptions
inwithdraw
Function Call Looks Good.The
withdraw
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
197-197
: Inclusion ofrevertOptions
inwithdrawAndCall
Function Call Looks Good.The
withdrawAndCall
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
203-203
: Inclusion ofrevertOptions
inwithdrawAndCall
Function Call Looks Good.The
withdrawAndCall
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
215-215
: Inclusion ofrevertOptions
inwithdraw
Function Call Looks Good.The
withdraw
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
239-239
: Inclusion ofrevertOptions
inwithdraw
Function Call Looks Good.The
withdraw
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
258-258
: Inclusion ofrevertOptions
inwithdraw
Function Call Looks Good.The
withdraw
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
273-273
: Inclusion ofrevertOptions
inwithdrawAndCall
Function Call Looks Good.The
withdrawAndCall
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
298-298
: Inclusion ofrevertOptions
inwithdrawAndCall
Function Call Looks Good.The
withdrawAndCall
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
313-313
: Inclusion ofrevertOptions
incall
Function Call Looks Good.The
call
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
322-322
: Inclusion ofrevertOptions
incall
Function Call Looks Good.The
call
function call now includesrevertOptions
, ensuring enhanced error handling during execution.
336-336
: Integration ofrevertOptions
Looks Good.The addition of
revertOptions
as a state variable enhances the contract's error handling capabilities.
534-535
: Use ofzContext
inexecuteRevert
Function Looks Good.The
executeRevert
function now useszContext
, ensuring consistent handling of context data.
544-545
: Use ofzContext
inexecuteRevert
Function Looks Good.The
executeRevert
function now useszContext
, ensuring consistent handling of context data.
554-555
: Use ofzContext
inexecuteRevert
Function Looks Good.The
executeRevert
function now useszContext
, ensuring consistent handling of context data.
564-565
: Use ofzContext
inexecuteRevert
Function Looks Good.The
executeRevert
function now useszContext
, ensuring consistent handling of context data.
574-575
: Use ofzContext
inexecuteRevert
Function Looks Good.The
executeRevert
function now useszContext
, ensuring consistent handling of context data.
584-585
: Use ofzContext
inexecuteRevert
Function Looks Good.The
executeRevert
function now useszContext
, ensuring consistent handling of context data.
595-596
: Use ofzContext
inexecuteRevert
Function Looks Good.The
executeRevert
function now useszContext
, ensuring consistent handling of context data.
682-683
: Use ofzContext
indepositAndRevert
Function Looks Good.The
depositAndRevert
function now useszContext
, ensuring consistent handling of context data.
692-693
: Use ofzContext
indepositAndRevert
Function Looks Good.The
depositAndRevert
function now useszContext
, ensuring consistent handling of context data.
702-703
: Use ofzContext
indepositAndRevert
Function Looks Good.The
depositAndRevert
function now useszContext
, ensuring consistent handling of context data.
715-716
: Use ofzContext
indepositAndRevert
Function Looks Good.The
depositAndRevert
function now useszContext
, ensuring consistent handling of context data.
729-730
: Use ofzContext
indepositAndRevert
Function Looks Good.The
depositAndRevert
function now useszContext
, ensuring consistent handling of context data.
739-740
: Use ofzContext
indepositAndRevert
Function Looks Good.The
depositAndRevert
function now useszContext
, ensuring consistent handling of context data.
749-750
: Use ofzContext
indepositAndRevert
Function Looks Good.The
depositAndRevert
function now useszContext
, ensuring consistent handling of context data.v2/pkg/igatewayevm.sol/igatewayevmevents.go (9)
33-37
: StructRevertOptions
is well-defined.The
RevertOptions
struct encapsulates additional parameters for event handling, enhancing error handling capabilities. The field types are appropriate.
259-263
: StructIGatewayEVMEventsCall
updated correctly.The addition of
RevertOptions
aligns with the updated ABI and provides additional context for theCall
event.
414-420
: StructIGatewayEVMEventsDeposit
updated correctly.The addition of
RevertOptions
aligns with the updated ABI and provides additional context for theDeposit
event.
Line range hint
266-285
: FunctionFilterCall
updated correctly.The function adapts to the new
Call
event structure, includingRevertOptions
, while maintaining existing filtering logic.
Line range hint
287-331
: FunctionWatchCall
updated correctly.The function adapts to the new
Call
event structure, includingRevertOptions
, while maintaining existing subscription logic.
Line range hint
333-340
: FunctionParseCall
updated correctly.The function adapts to the new
Call
event structure, includingRevertOptions
, while maintaining existing parsing logic.
Line range hint
423-442
: FunctionFilterDeposit
updated correctly.The function adapts to the new
Deposit
event structure, includingRevertOptions
, while maintaining existing filtering logic.
Line range hint
444-488
: FunctionWatchDeposit
updated correctly.The function adapts to the new
Deposit
event structure, includingRevertOptions
, while maintaining existing subscription logic.
Line range hint
490-497
: FunctionParseDeposit
updated correctly.The function adapts to the new
Deposit
event structure, includingRevertOptions
, while maintaining existing parsing logic.v2/pkg/igatewayzevm.sol/igatewayzevm.go (3)
32-36
: LGTM! StructRevertOptions
is well-defined.The new struct
RevertOptions
provides a clear and structured way to handle revert scenarios.
497-501
: LGTM! Event structs includeRevertOptions
.The addition of
RevertOptions
toIGatewayZEVMCall
andIGatewayZEVMWithdrawal
enhances event logging.Also applies to: 661-661
200-201
: LGTM! Verify consistent usage ofRevertOptions
.The function signatures have been updated correctly to include
RevertOptions
.Ensure that all function calls are updated to match the new signatures.
Also applies to: 207-208, 214-215, 347-348, 354-355, 361-362, 368-369, 375-376, 382-383, 389-390, 396-397, 403-404, 410-411, 417-418, 424-425
v2/typechain-types/factories/GatewayEVM__factory.ts (5)
99-119
: Consistent use ofrevertOptions
structure.The addition of the
revertOptions
structure enhances error handling across multiple functions. Ensure that all functions using this structure are tested for the new functionality.Also applies to: 147-167, 192-212, 232-252, 282-302
690-712
: Inclusion ofrevertOptions
in events.Adding
revertOptions
to events improves transparency and aids in debugging. Ensure that these events are emitted correctly in the contract logic.Also applies to: 750-772
1177-1177
: Flexible constructor parameters.The addition of
[signer?: Signer]
toGatewayEVMConstructorParams
provides flexibility in factory construction. Ensure that both constructor scenarios are tested.
Line range hint
1181-1187
: Correct constructor logic for parameter differentiation.The constructor logic correctly handles different parameter types using
isSuperArgs
. Ensure that tests cover both constructor paths.
Line range hint
1195-1212
: Consistency in static properties and methods.The updates to static properties and methods ensure consistency with the new ABI and bytecode. Ensure related documentation and tests are updated accordingly.
v2/typechain-types/factories/GatewayEVMUpgradeTest__factory.ts (8)
102-123
: Addition ofrevertOptions
parameter incall
function is well-defined.The
revertOptions
tuple is appropriately structured for handling revert scenarios. Ensure consistency across all functions using this parameter.
150-171
: Addition ofrevertOptions
parameter indeposit
function is consistent.The
revertOptions
tuple maintains consistency with other function definitions.
195-216
: Addition ofrevertOptions
parameter in overloadeddeposit
function is consistent.The
revertOptions
tuple maintains consistency with other function definitions.
235-256
: Addition ofrevertOptions
parameter indepositAndCall
function is consistent.The
revertOptions
tuple maintains consistency with other function definitions.
285-306
: Addition ofrevertOptions
parameter in overloadeddepositAndCall
function is consistent.The
revertOptions
tuple maintains consistency with other function definitions.
693-715
: Addition ofrevertOptions
parameter inCall
event is consistent.The
revertOptions
tuple maintains consistency with other event definitions.
753-775
: Addition ofrevertOptions
parameter inDeposit
event is consistent.The
revertOptions
tuple maintains consistency with other event definitions.
1207-1207
: Constructor parameter changes are valid.The inclusion of an optional
signer
parameter enhances flexibility in contract deployment.v2/typechain-types/factories/GatewayZEVM__factory.ts (7)
95-115
: Addition ofrevertOptions
tocall
function looks good.The inclusion of
revertOptions
enhances error handling by providing structured options for reverts. This aligns well with the PR's objective of improving functionality.
246-246
: Change ofcontext
tozContext
is appropriate.The update to
zContext
suggests an enhancement of the structure, aligning with the PR's goal of improving context management.
601-620
: Addition ofrevertOptions
towithdraw
function is consistent and beneficial.This change aligns with the overall enhancement strategy for error handling.
696-715
: Inclusion ofrevertOptions
inwithdrawAndCall
function aligns well with error handling improvements.The structured approach to managing reverts is consistent with the PR's objectives.
813-834
: Inclusion ofrevertOptions
inCall
event enhances transparency.Adding
revertOptions
to events supports better debugging and aligns with the PR's enhancements.
1018-1039
: Addition ofrevertOptions
toWithdrawal
event is consistent and useful.This change aligns with the enhancement of error handling and transparency.
641-644
: Replacement ofchainId
withzrc20
is appropriate.This change suggests a shift in focus towards specific token standards, aligning with the PR's goals.
v2/pkg/systemcontractmock.sol/systemcontractmock.go (1)
35-35
: Verify ABI and Bin consistency.The updated ABI and Bin values indicate changes to the contract's interface and logic. Ensure that these changes align with the intended functionality and that all related components are updated accordingly.
v2/pkg/igatewayevm.sol/igatewayevm.go (8)
32-37
: RevertOptions struct looks good.The
RevertOptions
struct is well-defined and aligns with the intended functionality of managing revert scenarios.
448-452
: IGatewayEVMCall struct update looks good.The addition of the
RevertOptions
field toIGatewayEVMCall
is consistent with the changes made to the function signatures.
603-609
: IGatewayEVMDeposit struct update looks good.The addition of the
RevertOptions
field toIGatewayEVMDeposit
is consistent with the changes made to the function signatures.
193-194
: Verify function signature updates for Call method.The
Call
method signatures have been updated to include theRevertOptions
parameter. Ensure that all function calls toCall
are updated accordingly.Also applies to: 200-201, 207-208
Verification successful
Function Signature Update Verified
The
Call
method signatures have been successfully updated to include theRevertOptions
parameter across the codebase. All instances reflect the new signature, ensuring consistency and correctness.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `Call` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'Call(receiver common.Address, payload []byte, revertOptions RevertOptions)'Length of output: 271
Script:
#!/bin/bash # Description: Verify all function calls to `Call` match the new signature. # Corrected Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 'Call\(receiver common\.Address, payload \[\]byte, revertOptions RevertOptions\)'Length of output: 10562
256-257
: Verify function signature updates for DepositAndCall method.The
DepositAndCall
method signatures have been updated to include theRevertOptions
parameter. Ensure that all function calls toDepositAndCall
are updated accordingly.Also applies to: 263-264, 270-271
Verification successful
Function signature updates for
DepositAndCall
verified successfully.All instances of the
DepositAndCall
method in the codebase have been updated to include theRevertOptions
parameter. No further changes are needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `DepositAndCall` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'DepositAndCall(receiver common.Address, payload []byte, revertOptions RevertOptions)'Length of output: 301
Script:
#!/bin/bash # Description: Verify all function calls to `DepositAndCall` include the new `revertOptions` parameter. # Test: Search for the function usage and check for the presence of `revertOptions` in the context. rg --type go -A 5 'DepositAndCall' | rg 'revertOptions'Length of output: 14375
277-278
: Verify function signature updates for DepositAndCall0 method.The
DepositAndCall0
method signatures have been updated to include theRevertOptions
parameter. Ensure that all function calls toDepositAndCall0
are updated accordingly.Also applies to: 284-285, 291-292
Verification successful
Function Signature Updates Verified for
DepositAndCall0
MethodThe
DepositAndCall0
method's signature, including theRevertOptions
parameter, has been consistently updated across the codebase. All relevant function calls now correctly include this parameter.
- Verified in files such as
v2/pkg/igatewayevm.sol/igatewayevm.go
and others.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `DepositAndCall0` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'DepositAndCall0(receiver common.Address, amount *big.Int, asset common.Address, payload []byte, revertOptions RevertOptions)'Length of output: 421
Script:
#!/bin/bash # Description: Verify all function calls to `DepositAndCall0` match the new signature. # Corrected Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 'DepositAndCall0\('Length of output: 14610
214-215
: Verify function signature updates for Deposit method.The
Deposit
method signatures have been updated to include theRevertOptions
parameter. Ensure that all function calls toDeposit
are updated accordingly.Also applies to: 221-222, 228-229
235-236
: Verify function signature updates for Deposit0 method.The
Deposit0
method signatures have been updated to include theRevertOptions
parameter. Ensure that all function calls toDeposit0
are updated accordingly.Also applies to: 242-243, 249-250
Verification successful
Function signature updates for Deposit0 verified successfully.
All occurrences of the
Deposit0
function in the codebase include therevertOptions
parameter, confirming that the updates have been applied consistently. No further changes are required.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `Deposit0` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'Deposit0(receiver common.Address, amount *big.Int, asset common.Address, revertOptions RevertOptions)'Length of output: 123
Script:
#!/bin/bash # Description: Search for all function calls to `Deposit0` in the codebase to verify their signatures. # Search for all occurrences of `Deposit0` function calls and include context lines to check the parameters. rg --type go -A 5 'Deposit0('Length of output: 100
Script:
#!/bin/bash # Description: Search for all function calls to `Deposit0` in the codebase to verify their signatures. # Correct the regex pattern by escaping the parentheses. rg --type go -A 5 'Deposit0\('Length of output: 9614
v2/pkg/systemcontract.sol/systemcontract.go (2)
Line range hint
77-91
:
Verify Deployment Logic with Updated ABI.Ensure that the
DeploySystemContract
function correctly handles the updated ABI and bytecode. Verify that the deployment parameters align with the new contract structure.Verification successful
Deployment Logic Correctly Handles ABI and Bytecode
The
DeploySystemContract
function properly retrieves and checks the ABI, uses the bytecode, and deploys the contract usingbind.DeployContract
. The deployment logic aligns with the updated contract structure.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `DeploySystemContract` function aligns with the updated ABI and bytecode. # Test: Search for the deployment logic and parameters. Expect: Correct alignment with the updated ABI. rg --type go -A 5 $'DeploySystemContract'Length of output: 3567
Script:
#!/bin/bash # Extract the full implementation of the `DeploySystemContract` function to verify ABI and bytecode handling. ast-grep --lang go --pattern 'func DeploySystemContract($_, $_, $_, $_, $_) ($_, $_, $_, $_) { $$$ }'Length of output: 3550
Line range hint
36-42
:
Ensure ABI Consistency and Completeness.The updated ABI includes a structured
context
parameter in thedepositAndCall
function. Verify that all components of thecontext
(origin, sender, chainID) are correctly utilized in the contract logic and that the ABI accurately reflects the contract's functionality.v2/typechain-types/factories/GatewayEVMEchidnaTest__factory.ts (5)
150-171
: Enhancement: AddedrevertOptions
todeposit
function.The
revertOptions
tuple is added to improve error handling by allowing specific actions on revert scenarios. Verify that this addition is consistently used across all relevant functions and that the handling logic is correctly implemented.
195-216
: Enhancement: AddedrevertOptions
todeposit
function variant.The inclusion of the
revertOptions
tuple supports improved error handling. Ensure consistent implementation across all relevant functions.
235-256
: Enhancement: AddedrevertOptions
todepositAndCall
function.The
revertOptions
tuple enhances error handling by providing structured parameters for revert scenarios. Ensure consistent usage across all relevant functions.
285-306
: Enhancement: AddedrevertOptions
todepositAndCall
function variant.The inclusion of the
revertOptions
tuple supports improved error handling. Ensure consistent implementation across all relevant functions.
102-123
: Enhancement: AddedrevertOptions
tocall
function.The addition of the
revertOptions
tuple enhances error handling by providing structured parameters for revert scenarios. Ensure that this addition is consistently used across all relevant functions and that the handling logic is correctly implemented.Verification successful
Verification Complete: Consistent Usage of
revertOptions
The
revertOptions
parameter is consistently used across multiple relevant functions and structures in the codebase. Ensure that the logic handling these options is correctly implemented in all instances.
- Files with consistent usage include:
v2/typechain-types/GatewayZEVM.ts
v2/typechain-types/GatewayEVMEchidnaTest.ts
v2/typechain-types/GatewayEVM.ts
v2/typechain-types/GatewayEVMUpgradeTest.ts
- Various factory files
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistent usage of `revertOptions` across the codebase. # Test: Search for the usage of `revertOptions` in function signatures. Expect: Consistent usage across all relevant functions. rg --type ts -A 5 $'revertOptions'Length of output: 69502
v2/pkg/zetaconnectornative.sol/zetaconnectornative.go (1)
35-35
: Ensure ABI changes are documented and tested.The ABI has been updated with new functions like
withdrawAndCall
andwithdrawAndRevert
, as well as new error types. Ensure these changes are reflected in the documentation and adequately tested.v2/pkg/zetaconnectornonnative.sol/zetaconnectornonnative.go (2)
35-35
: Verify ABI changes for consistency and security.The ABI has been expanded to include new functions and events. Ensure that these changes are consistent with the intended functionality and do not introduce security vulnerabilities.
Verification successful
ABI changes are consistent and secure.
The ABI changes, including new functions and events related to roles and token management, are consistent with the intended functionality. There are no indications of security vulnerabilities or inconsistent usage in the codebase.
- The
ZetaConnectorNonNativeMetaData
variable is used consistently within the same file.- The new functions and events align with the contract's expanded capabilities.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of ABI changes with the intended functionality. # Test: Search for the ABI usage in the codebase. Expect: Consistent usage of new functions and events. rg --type go -A 5 $'ZetaConnectorNonNativeMetaData'Length of output: 22231
Line range hint
38-41
:
Ensure deprecated variables are not used elsewhere.The variables
ZetaConnectorNonNativeABI
andZetaConnectorNonNativeBin
are deprecated. Verify that they are not used elsewhere in the codebase, and ensure the transition toZetaConnectorNonNativeMetaData
is complete.Verification successful
Ensure Internal Transition to
ZetaConnectorNonNativeMetaData
is CompleteThe deprecated variables
ZetaConnectorNonNativeABI
andZetaConnectorNonNativeBin
are not used elsewhere in the codebase. However,ZetaConnectorNonNativeBin
is still used internally within its declaration file. Consider updating this internal usage to ensure full transition toZetaConnectorNonNativeMetaData
.
- Update usage within
v2/pkg/zetaconnectornonnative.sol/zetaconnectornonnative.go
to useZetaConnectorNonNativeMetaData.Bin
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that deprecated variables are not used elsewhere in the codebase. # Test: Search for the usage of deprecated variables. Expect: No usage of `ZetaConnectorNonNativeABI` and `ZetaConnectorNonNativeBin`. rg --type go $'ZetaConnectorNonNativeABI|ZetaConnectorNonNativeBin'Length of output: 832
Script:
#!/bin/bash # Description: Verify if deprecated variables are used outside their declaration file. # Test: Search for the usage of deprecated variables in the entire codebase, excluding their declaration file. rg --type go --glob '!v2/pkg/zetaconnectornonnative.sol/zetaconnectornonnative.go' $'ZetaConnectorNonNativeABI|ZetaConnectorNonNativeBin'Length of output: 138
v2/pkg/erc20custody.sol/erc20custody.go (2)
35-35
: LGTM! ABI and binary updates enhance functionality.The ABI and binary updates are well-structured and enhance the contract's functionality by adding new methods and events for improved withdrawal capabilities.
35-35
: Verify ABI consistency with Solidity contract.Ensure that the updated ABI accurately reflects the Solidity contract's functions and events, especially the new
withdrawAndCall
andwithdrawAndRevert
methods.Verification successful
ABI Consistency Verified
The ABI in the Go file accurately reflects the Solidity contract's functions and events, including
withdrawAndCall
andwithdrawAndRevert
. The changes are consistent with the contract's implementation.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify ABI consistency with the Solidity contract. # Test: Check if the ABI matches the Solidity contract. # Expect: The ABI in the Go file should match the functions and events in the Solidity contract. rg --type solidity 'function withdrawAndCall|function withdrawAndRevert|event WithdrawAndCall|event WithdrawAndRevert'Length of output: 153
Script:
#!/bin/bash # Description: Locate Solidity files and verify ABI consistency with the Solidity contract. # Step 1: Find all Solidity files in the repository. sol_files=$(fd --extension sol) # Step 2: Search for the functions and events in the located Solidity files. for file in $sol_files; do echo "Searching in $file" rg 'function withdrawAndCall|function withdrawAndRevert|event WithdrawAndCall|event WithdrawAndRevert' "$file" doneLength of output: 159364
@@ -32,7 +32,7 @@ var ( | |||
// ZetaConnectorNonNativeMetaData contains all meta data concerning the ZetaConnectorNonNative contract. | |||
var ZetaConnectorNonNativeMetaData = &bind.MetaData{ | |||
ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"gateway_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"zetaToken_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tssAddress_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"admin_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"DEFAULT_ADMIN_ROLE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PAUSER_ROLE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"TSS_ROLE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"WITHDRAWER_ROLE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gateway\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIGatewayEVM\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRoleAdmin\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"grantRole\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"hasRole\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"receiveTokens\",\"inputs\":[{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceRole\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"callerConfirmation\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"revokeRole\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setMaxSupply\",\"inputs\":[{\"name\":\"maxSupply_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"supportsInterface\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"internalSendHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawAndCall\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"internalSendHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawAndRevert\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"internalSendHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"zetaToken\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"MaxSupplyUpdated\",\"inputs\":[{\"name\":\"maxSupply\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RoleAdminChanged\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"previousAdminRole\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"newAdminRole\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RoleGranted\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RoleRevoked\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Withdraw\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawAndCall\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawAndRevert\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AccessControlBadConfirmation\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AccessControlUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"neededRole\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"EnforcedPause\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ExceedsMaxSupply\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ExpectedPause\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ZeroAddress\",\"inputs\":[]}]", | |||
Bin: "0x60c060405260001960035534801561001657600080fd5b5060405161155a38038061155a83398101604081905261003591610220565b60016000819055805460ff19169055838383836001600160a01b038416158061006557506001600160a01b038316155b8061007757506001600160a01b038216155b8061008957506001600160a01b038116155b156100a75760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b03808516608052831660a0526100c5600082610154565b506100f07f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e483610154565b5061011b7f0da06bffcb63442de88b7f8385468eaf51e47079d4fa96875938e2c27c451deb83610154565b506101467f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82610154565b505050505050505050610274565b60008281526002602090815260408083206001600160a01b038516845290915281205460ff166101fa5760008381526002602090815260408083206001600160a01b03861684529091529020805460ff191660011790556101b23390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016101fe565b5060005b92915050565b80516001600160a01b038116811461021b57600080fd5b919050565b6000806000806080858703121561023657600080fd5b61023f85610204565b935061024d60208601610204565b925061025b60408601610204565b915061026960608601610204565b905092959194509250565b60805160a0516112826102d86000396000818161021d01528181610531015281816108240152818161097b01528181610ad00152610bf20152600081816101d1015281816104a1015281816105040152818161079401526107f701526112826000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c80635e3e9fef116100d857806391d148541161008c578063d547741f11610066578063d547741f14610386578063d5abeb0114610399578063e63ab1e9146103a257600080fd5b806391d1485414610311578063a217fddf14610357578063a783c7891461035f57600080fd5b8063743e0c9b116100bd578063743e0c9b146102cf5780638456cb59146102e257806385f438c1146102ea57600080fd5b80635e3e9fef146102a95780636f8b44b0146102bc57600080fd5b8063248a9ca31161012f57806336568abe1161011457806336568abe146102835780633f4ba83a146102965780635c975abb1461029e57600080fd5b8063248a9ca31461023f5780632f2ff15d1461027057600080fd5b8063106e629011610160578063106e6290146101b9578063116191b6146101cc57806321e093b11461021857600080fd5b806301ffc9a71461017c57806302d5c899146101a4575b600080fd5b61018f61018a366004610fb4565b6103c9565b60405190151581526020015b60405180910390f35b6101b76101b2366004611026565b610462565b005b6101b76101c73660046110b8565b6105f7565b6101f37f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b6101f37f000000000000000000000000000000000000000000000000000000000000000081565b61026261024d3660046110eb565b60009081526002602052604090206001015490565b60405190815260200161019b565b6101b761027e366004611104565b61069c565b6101b7610291366004611104565b6106c7565b6101b7610720565b60015460ff1661018f565b6101b76102b7366004611026565b610755565b6101b76102ca3660046110eb565b6108d0565b6101b76102dd3660046110eb565b61093e565b6101b76109e8565b6102627f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e481565b61018f61031f366004611104565b600091825260026020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b610262600081565b6102627f0da06bffcb63442de88b7f8385468eaf51e47079d4fa96875938e2c27c451deb81565b6101b7610394366004611104565b610a1a565b61026260035481565b6102627f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061045c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b61046a610a3f565b7f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e461049481610a82565b61049c610a8c565b6104c77f00000000000000000000000000000000000000000000000000000000000000008684610acb565b6040517fb8969bd400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b8969bd490610561907f0000000000000000000000000000000000000000000000000000000000000000908a908a908a908a90600401611179565b600060405180830381600087803b15801561057b57600080fd5b505af115801561058f573d6000803e3d6000fd5b505050508573ffffffffffffffffffffffffffffffffffffffff167fba96f26bdda53eb8c8ba39045dfb4ff39753fbc7a6edcf250a88e75e78d102fe8686866040516105dd939291906111d6565b60405180910390a2506105f06001600055565b5050505050565b6105ff610a3f565b7f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e461062981610a82565b610631610a8c565b61063c848484610acb565b8373ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243648460405161068491815260200190565b60405180910390a2506106976001600055565b505050565b6000828152600260205260409020600101546106b781610a82565b6106c18383610c53565b50505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610716576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106978282610d53565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61074a81610a82565b610752610e12565b50565b61075d610a3f565b7f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e461078781610a82565b61078f610a8c565b6107ba7f00000000000000000000000000000000000000000000000000000000000000008684610acb565b6040517f5131ab5900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690635131ab5990610854907f0000000000000000000000000000000000000000000000000000000000000000908a908a908a908a90600401611179565b600060405180830381600087803b15801561086e57600080fd5b505af1158015610882573d6000803e3d6000fd5b505050508573ffffffffffffffffffffffffffffffffffffffff167f7772f56296d3a5202974a45c61c9188d844ab4d6eeb18c851e4b8d5384ca6ced8686866040516105dd939291906111d6565b7f0da06bffcb63442de88b7f8385468eaf51e47079d4fa96875938e2c27c451deb6108fa81610a82565b610902610a8c565b60038290556040518281527f7810bd47de260c3e9ee10061cf438099dd12256c79485f12f94dbccc981e806c9060200160405180910390a15050565b610946610a8c565b6040517f79cc6790000000000000000000000000000000000000000000000000000000008152336004820152602481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906379cc679090604401600060405180830381600087803b1580156109d457600080fd5b505af11580156105f0573d6000803e3d6000fd5b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610a1281610a82565b610752610e8f565b600082815260026020526040902060010154610a3581610a82565b6106c18383610d53565b600260005403610a7b576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b6107528133610ee8565b60015460ff1615610ac9576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6003547f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5d91906111f9565b610b679084611212565b1115610b9f576040517fc30436e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f1e458bee00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052604482018390527f00000000000000000000000000000000000000000000000000000000000000001690631e458bee90606401600060405180830381600087803b158015610c3657600080fd5b505af1158015610c4a573d6000803e3d6000fd5b50505050505050565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16610d4b57600083815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff86168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610ce93390565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161045c565b50600061045c565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff1615610d4b57600083815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8616808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161045c565b610e1a610f78565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b610e97610a8c565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833610e65565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f74576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024810183905260440160405180910390fd5b5050565b60015460ff16610ac9576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060208284031215610fc657600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610ff657600080fd5b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461102157600080fd5b919050565b60008060008060006080868803121561103e57600080fd5b61104786610ffd565b945060208601359350604086013567ffffffffffffffff81111561106a57600080fd5b8601601f8101881361107b57600080fd5b803567ffffffffffffffff81111561109257600080fd5b8860208284010111156110a457600080fd5b959894975060200195606001359392505050565b6000806000606084860312156110cd57600080fd5b6110d684610ffd565b95602085013595506040909401359392505050565b6000602082840312156110fd57600080fd5b5035919050565b6000806040838503121561111757600080fd5b8235915061112760208401610ffd565b90509250929050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff8616815273ffffffffffffffffffffffffffffffffffffffff851660208201528360408201526080606082015260006111cb608083018486611130565b979650505050505050565b8381526040602082015260006111f0604083018486611130565b95945050505050565b60006020828403121561120b57600080fd5b5051919050565b8082018082111561045c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea2646970667358221220de5fa55e0ca79ea2f08903481d01ea00bbbf346b9cfba44e12a2dd6f3a6f2e8a64736f6c634300081a0033", | |||
Bin: "0x60c060405260001960035534801561001657600080fd5b5060405161155a38038061155a83398101604081905261003591610220565b60016000819055805460ff19169055838383836001600160a01b038416158061006557506001600160a01b038316155b8061007757506001600160a01b038216155b8061008957506001600160a01b038116155b156100a75760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b03808516608052831660a0526100c5600082610154565b506100f07f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e483610154565b5061011b7f0da06bffcb63442de88b7f8385468eaf51e47079d4fa96875938e2c27c451deb83610154565b506101467f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82610154565b505050505050505050610274565b60008281526002602090815260408083206001600160a01b038516845290915281205460ff166101fa5760008381526002602090815260408083206001600160a01b03861684529091529020805460ff191660011790556101b23390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016101fe565b5060005b92915050565b80516001600160a01b038116811461021b57600080fd5b919050565b6000806000806080858703121561023657600080fd5b61023f85610204565b935061024d60208601610204565b925061025b60408601610204565b915061026960608601610204565b905092959194509250565b60805160a0516112826102d86000396000818161021d01528181610531015281816108240152818161097b01528181610ad00152610bf20152600081816101d1015281816104a1015281816105040152818161079401526107f701526112826000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c80635e3e9fef116100d857806391d148541161008c578063d547741f11610066578063d547741f14610386578063d5abeb0114610399578063e63ab1e9146103a257600080fd5b806391d1485414610311578063a217fddf14610357578063a783c7891461035f57600080fd5b8063743e0c9b116100bd578063743e0c9b146102cf5780638456cb59146102e257806385f438c1146102ea57600080fd5b80635e3e9fef146102a95780636f8b44b0146102bc57600080fd5b8063248a9ca31161012f57806336568abe1161011457806336568abe146102835780633f4ba83a146102965780635c975abb1461029e57600080fd5b8063248a9ca31461023f5780632f2ff15d1461027057600080fd5b8063106e629011610160578063106e6290146101b9578063116191b6146101cc57806321e093b11461021857600080fd5b806301ffc9a71461017c57806302d5c899146101a4575b600080fd5b61018f61018a366004610fb4565b6103c9565b60405190151581526020015b60405180910390f35b6101b76101b2366004611026565b610462565b005b6101b76101c73660046110b8565b6105f7565b6101f37f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b6101f37f000000000000000000000000000000000000000000000000000000000000000081565b61026261024d3660046110eb565b60009081526002602052604090206001015490565b60405190815260200161019b565b6101b761027e366004611104565b61069c565b6101b7610291366004611104565b6106c7565b6101b7610720565b60015460ff1661018f565b6101b76102b7366004611026565b610755565b6101b76102ca3660046110eb565b6108d0565b6101b76102dd3660046110eb565b61093e565b6101b76109e8565b6102627f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e481565b61018f61031f366004611104565b600091825260026020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b610262600081565b6102627f0da06bffcb63442de88b7f8385468eaf51e47079d4fa96875938e2c27c451deb81565b6101b7610394366004611104565b610a1a565b61026260035481565b6102627f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061045c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b61046a610a3f565b7f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e461049481610a82565b61049c610a8c565b6104c77f00000000000000000000000000000000000000000000000000000000000000008684610acb565b6040517fb8969bd400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b8969bd490610561907f0000000000000000000000000000000000000000000000000000000000000000908a908a908a908a90600401611179565b600060405180830381600087803b15801561057b57600080fd5b505af115801561058f573d6000803e3d6000fd5b505050508573ffffffffffffffffffffffffffffffffffffffff167fba96f26bdda53eb8c8ba39045dfb4ff39753fbc7a6edcf250a88e75e78d102fe8686866040516105dd939291906111d6565b60405180910390a2506105f06001600055565b5050505050565b6105ff610a3f565b7f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e461062981610a82565b610631610a8c565b61063c848484610acb565b8373ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243648460405161068491815260200190565b60405180910390a2506106976001600055565b505050565b6000828152600260205260409020600101546106b781610a82565b6106c18383610c53565b50505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610716576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106978282610d53565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61074a81610a82565b610752610e12565b50565b61075d610a3f565b7f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e461078781610a82565b61078f610a8c565b6107ba7f00000000000000000000000000000000000000000000000000000000000000008684610acb565b6040517f5131ab5900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690635131ab5990610854907f0000000000000000000000000000000000000000000000000000000000000000908a908a908a908a90600401611179565b600060405180830381600087803b15801561086e57600080fd5b505af1158015610882573d6000803e3d6000fd5b505050508573ffffffffffffffffffffffffffffffffffffffff167f7772f56296d3a5202974a45c61c9188d844ab4d6eeb18c851e4b8d5384ca6ced8686866040516105dd939291906111d6565b7f0da06bffcb63442de88b7f8385468eaf51e47079d4fa96875938e2c27c451deb6108fa81610a82565b610902610a8c565b60038290556040518281527f7810bd47de260c3e9ee10061cf438099dd12256c79485f12f94dbccc981e806c9060200160405180910390a15050565b610946610a8c565b6040517f79cc6790000000000000000000000000000000000000000000000000000000008152336004820152602481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906379cc679090604401600060405180830381600087803b1580156109d457600080fd5b505af11580156105f0573d6000803e3d6000fd5b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610a1281610a82565b610752610e8f565b600082815260026020526040902060010154610a3581610a82565b6106c18383610d53565b600260005403610a7b576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b6107528133610ee8565b60015460ff1615610ac9576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6003547f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5d91906111f9565b610b679084611212565b1115610b9f576040517fc30436e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f1e458bee00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052604482018390527f00000000000000000000000000000000000000000000000000000000000000001690631e458bee90606401600060405180830381600087803b158015610c3657600080fd5b505af1158015610c4a573d6000803e3d6000fd5b50505050505050565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16610d4b57600083815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff86168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610ce93390565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161045c565b50600061045c565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff1615610d4b57600083815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8616808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161045c565b610e1a610f78565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b610e97610a8c565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833610e65565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f74576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024810183905260440160405180910390fd5b5050565b60015460ff16610ac9576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060208284031215610fc657600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610ff657600080fd5b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461102157600080fd5b919050565b60008060008060006080868803121561103e57600080fd5b61104786610ffd565b945060208601359350604086013567ffffffffffffffff81111561106a57600080fd5b8601601f8101881361107b57600080fd5b803567ffffffffffffffff81111561109257600080fd5b8860208284010111156110a457600080fd5b959894975060200195606001359392505050565b6000806000606084860312156110cd57600080fd5b6110d684610ffd565b95602085013595506040909401359392505050565b6000602082840312156110fd57600080fd5b5035919050565b6000806040838503121561111757600080fd5b8235915061112760208401610ffd565b90509250929050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff8616815273ffffffffffffffffffffffffffffffffffffffff851660208201528360408201526080606082015260006111cb608083018486611130565b979650505050505050565b8381526040602082015260006111f0604083018486611130565b95945050505050565b60006020828403121561120b57600080fd5b5051919050565b8082018082111561045c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea2646970667358221220133feb959a4994813f6fed174503c9362a55a5eb16796c13ecec764f91a7467b64736f6c634300081a0033", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure documentation and testing for new functions and events.
The new functions and events added to the ABI should be well-documented and adequately tested to ensure correct behavior and security.
Would you like assistance in generating documentation or tests for the new functions and events?
"deposit(address,(address,bool,address))": TypedContractMethod< | ||
[receiver: AddressLike, revertOptions: RevertOptionsStruct], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address Confusing Use of void
in Function Return Types.
The use of void
in function return types is flagged as confusing. Consider replacing void
with undefined
for clarity.
- [void],
+ [undefined],
Also applies to: 338-344, 349-353, 359-365
[ | ||
receiver: AddressLike, | ||
payload: BytesLike, | ||
revertOptions: RevertOptionsStruct | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address Confusing Use of void
in getFunction
Return Types.
The use of void
in getFunction
return types is flagged as confusing. Consider replacing void
with undefined
for clarity.
- [void],
+ [undefined],
Also applies to: 421-425, 430-435, 442-446, 451-458
v2/typechain-types/GatewayEVM.ts
Outdated
"deposit(address,(address,bool,address))": TypedContractMethod< | ||
[receiver: AddressLike, revertOptions: RevertOptionsStruct], | ||
[void], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using void
outside return types.
Replace void
with undefined
in parameter lists to prevent confusion.
- [void],
+ [undefined],
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"deposit(address,(address,bool,address))": TypedContractMethod< | |
[receiver: AddressLike, revertOptions: RevertOptionsStruct], | |
[void], | |
"deposit(address,(address,bool,address))": TypedContractMethod< | |
[receiver: AddressLike, revertOptions: RevertOptionsStruct], | |
[undefined], |
Tools
Biome
[error] 612-612: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
"deposit(address,(address,bool,address))": TypedContractMethod< | ||
[receiver: AddressLike, revertOptions: RevertOptionsStruct], | ||
[void], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using void
outside return types.
Replace void
with undefined
in parameter lists to prevent confusion.
- [void],
+ [undefined],
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"deposit(address,(address,bool,address))": TypedContractMethod< | |
[receiver: AddressLike, revertOptions: RevertOptionsStruct], | |
[void], | |
"deposit(address,(address,bool,address))": TypedContractMethod< | |
[receiver: AddressLike, revertOptions: RevertOptionsStruct], | |
[undefined], |
Tools
Biome
[error] 631-631: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
"deposit(address)": TypedContractMethod< | ||
[receiver: AddressLike], | ||
"deposit(address,(address,bool,address))": TypedContractMethod< | ||
[receiver: AddressLike, revertOptions: RevertOptionsStruct], | ||
[void], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace void
with undefined
.
Using void
outside of a return type or type parameter can be confusing. Consider replacing it with undefined
.
- [void],
+ [undefined],
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[void], | |
[undefined], |
Tools
Biome
[error] 633-633: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
amount: BigNumberish, | ||
asset: AddressLike, | ||
revertOptions: RevertOptionsStruct | ||
], | ||
[void], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace void
with undefined
.
Using void
outside of a return type or type parameter can be confusing. Consider replacing it with undefined
.
- [void],
+ [undefined],
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[void], | |
[undefined], |
Tools
Biome
[error] 644-644: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
receiver: AddressLike, | ||
payload: BytesLike, | ||
revertOptions: RevertOptionsStruct | ||
], | ||
[void], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace void
with undefined
.
Using void
outside of a return type or type parameter can be confusing. Consider replacing it with undefined
.
- [void],
+ [undefined],
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[void], | |
[undefined], |
Tools
Biome
[error] 811-811: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/src/evm/GatewayEVM.sol
Outdated
/// @param revertOptions Revert options. | ||
function depositAndCall( | ||
address receiver, | ||
bytes calldata payload, | ||
RevertOptions calldata revertOptions | ||
) | ||
external | ||
payable | ||
whenNotPaused | ||
nonReentrant | ||
{ | ||
if (msg.value == 0) revert InsufficientETHAmount(); | ||
if (receiver == address(0)) revert ZeroAddress(); | ||
|
||
(bool deposited,) = tssAddress.call{ value: msg.value }(""); | ||
|
||
if (!deposited) revert DepositFailed(); | ||
|
||
emit Deposit(msg.sender, receiver, msg.value, address(0), payload); | ||
emit Deposit(msg.sender, receiver, msg.value, address(0), payload, revertOptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review low-level call in depositAndCall
.
The function uses a low-level call to tssAddress
. Ensure that this call is safe and consider using a higher-level abstraction if possible.
Consider using Address.sendValue
from OpenZeppelin's Address
library for safer ETH transfers.
- (bool deposited,) = tssAddress.call{ value: msg.value }("");
+ Address.sendValue(payable(tssAddress), msg.value);
Committable suggestion was skipped due to low confidence.
receiver: AddressLike, | ||
payload: BytesLike, | ||
revertOptions: RevertOptionsStruct | ||
], | ||
[void], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace void
with undefined
.
Using void
outside of a return type or type parameter can be confusing. Consider replacing it with undefined
.
- [void],
+ [undefined],
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[void], | |
[undefined], |
Tools
Biome
[error] 625-625: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
/// @param revertAddress Address to receive revert. | ||
/// @param callOnRevert Flag if onRevert hook should be called. | ||
/// @pararm abortAddress Address to receive funds if aborted. | ||
struct RevertOptions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can define the type in a single file used by evm and zevm?
I don't think we need to maintain 2 version of it. Same whether depositing or withdrawing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per #310
We can add a revertMessage in the options that represents arbitrary data sent back in onRevert allowing custom handling and keeping context of initial inbound
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Outside diff range, codebase verification and nitpick comments (1)
v2/src/RevertOptions.sol (1)
7-7
: Fix typo in comment.There is a typo in the comment for
abortAddress
. It should be@param
instead of@pararm
.-/// @pararm abortAddress Address to receive funds if aborted. +/// @param abortAddress Address to receive funds if aborted.
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (40)
- v2/pkg/erc20custody.sol/erc20custody.go (1 hunks)
- v2/pkg/igatewayevm.sol/igatewayevm.go (8 hunks)
- v2/pkg/igatewayevm.sol/igatewayevmevents.go (7 hunks)
- v2/pkg/igatewayzevm.sol/igatewayzevm.go (11 hunks)
- v2/pkg/igatewayzevm.sol/igatewayzevmevents.go (7 hunks)
- v2/pkg/revertoptions.sol/revertoptions.go (1 hunks)
- v2/pkg/senderzevm.sol/senderzevm.go (1 hunks)
- v2/pkg/zetaconnectornative.sol/zetaconnectornative.go (1 hunks)
- v2/pkg/zetaconnectornonnative.sol/zetaconnectornonnative.go (1 hunks)
- v2/scripts/localnet/EvmCall.s.sol (1 hunks)
- v2/scripts/localnet/EvmDepositAndCall.s.sol (1 hunks)
- v2/scripts/localnet/ZevmCall.s.sol (1 hunks)
- v2/scripts/localnet/ZevmWithdrawAndCall.s.sol (1 hunks)
- v2/src/RevertOptions.sol (1 hunks)
- v2/src/evm/interfaces/IGatewayEVM.sol (3 hunks)
- v2/src/zevm/interfaces/IGatewayZEVM.sol (7 hunks)
- v2/test/GatewayEVM.t.sol (13 hunks)
- v2/test/GatewayEVMZEVM.t.sol (7 hunks)
- v2/test/GatewayZEVM.t.sol (29 hunks)
- v2/test/utils/SenderZEVM.sol (3 hunks)
- v2/typechain-types/GatewayEVM.ts (10 hunks)
- v2/typechain-types/GatewayEVMEchidnaTest.ts (10 hunks)
- v2/typechain-types/GatewayEVMUpgradeTest.ts (14 hunks)
- v2/typechain-types/GatewayZEVM.ts (20 hunks)
- v2/typechain-types/IGatewayEVM.sol/IGatewayEVM.ts (9 hunks)
- v2/typechain-types/IGatewayEVM.sol/IGatewayEVMEvents.ts (5 hunks)
- v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVM.ts (18 hunks)
- v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVMEvents.ts (7 hunks)
- v2/typechain-types/factories/ERC20Custody__factory.ts (1 hunks)
- v2/typechain-types/factories/GatewayEVMEchidnaTest__factory.ts (7 hunks)
- v2/typechain-types/factories/GatewayEVMUpgradeTest__factory.ts (10 hunks)
- v2/typechain-types/factories/GatewayEVM__factory.ts (7 hunks)
- v2/typechain-types/factories/GatewayZEVM__factory.ts (10 hunks)
- v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVMEvents__factory.ts (2 hunks)
- v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVM__factory.ts (5 hunks)
- v2/typechain-types/factories/IGatewayZEVM.sol/IGatewayZEVMEvents__factory.ts (2 hunks)
- v2/typechain-types/factories/IGatewayZEVM.sol/IGatewayZEVM__factory.ts (9 hunks)
- v2/typechain-types/factories/SenderZEVM__factory.ts (1 hunks)
- v2/typechain-types/factories/ZetaConnectorNative__factory.ts (1 hunks)
- v2/typechain-types/factories/ZetaConnectorNonNative__factory.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- v2/pkg/revertoptions.sol/revertoptions.go
Files skipped from review as they are similar to previous changes (16)
- v2/pkg/erc20custody.sol/erc20custody.go
- v2/pkg/igatewayzevm.sol/igatewayzevmevents.go
- v2/pkg/zetaconnectornative.sol/zetaconnectornative.go
- v2/scripts/localnet/EvmCall.s.sol
- v2/scripts/localnet/EvmDepositAndCall.s.sol
- v2/scripts/localnet/ZevmCall.s.sol
- v2/scripts/localnet/ZevmWithdrawAndCall.s.sol
- v2/src/evm/interfaces/IGatewayEVM.sol
- v2/src/zevm/interfaces/IGatewayZEVM.sol
- v2/test/GatewayEVM.t.sol
- v2/test/GatewayEVMZEVM.t.sol
- v2/test/GatewayZEVM.t.sol
- v2/test/utils/SenderZEVM.sol
- v2/typechain-types/factories/IGatewayZEVM.sol/IGatewayZEVM__factory.ts
- v2/typechain-types/factories/SenderZEVM__factory.ts
- v2/typechain-types/factories/ZetaConnectorNative__factory.ts
Additional context used
Biome
v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVM.ts
[error] 363-363: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 374-374: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 386-386: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 498-498: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 510-510: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/IGatewayEVM.sol/IGatewayEVM.ts
[error] 335-335: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 346-346: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 352-352: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 364-364: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 374-374: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 424-424: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 436-436: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 443-443: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 456-456: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 467-467: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayZEVM.ts
[error] 657-657: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 668-668: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 680-680: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayEVM.ts
[error] 611-611: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 624-624: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 630-630: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 642-642: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 652-652: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 787-787: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 802-802: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 809-809: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayEVMUpgradeTest.ts
[error] 630-630: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 643-643: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 649-649: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 661-661: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 671-671: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 749-749: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 806-806: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 821-821: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 828-828: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayEVMEchidnaTest.ts
[error] 632-632: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 645-645: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 651-651: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 663-663: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 673-673: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 818-818: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 833-833: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
Additional comments not posted (118)
v2/typechain-types/factories/IGatewayZEVM.sol/IGatewayZEVMEvents__factory.ts (1)
40-67
: LGTM!The changes correctly introduce the
revertOptions
tuple in the ABI for theCall
andWithdrawal
events. This aligns with the newRevertOptions
struct.Also applies to: 123-150
v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVMEvents.ts (1)
24-41
: LGTM!The introduction of
RevertOptionsStruct
andRevertOptionsStructOutput
and their integration intoCallEvent
andWithdrawalEvent
are well-implemented. The filter signatures are correctly updated.Also applies to: 52-53, 59-60, 67-67, 84-85, 95-96, 107-107, 178-178, 189-189
v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVMEvents__factory.ts (2)
34-61
: Addition ofrevertOptions
Structure in ABI.The introduction of the
revertOptions
tuple structure in theCall
event enhances the error handling capabilities by allowing more detailed revert scenarios. This change is well-structured, with clear naming and types for each component.
99-126
: Addition ofrevertOptions
Structure inDeposit
Event.The
revertOptions
structure is also added to theDeposit
event, providing consistency across events for handling revert scenarios. Ensure that these changes are reflected in the contract logic and that appropriate tests are in place.v2/typechain-types/IGatewayEVM.sol/IGatewayEVMEvents.ts (5)
24-29
: Introduction ofRevertOptionsStruct
.The new
RevertOptionsStruct
type is well-defined, providing a clear structure for handling revert scenarios. This addition enhances the flexibility and control over transaction reverts.
31-41
: Introduction ofRevertOptionsStructOutput
.The
RevertOptionsStructOutput
type complements the input structure, ensuring consistent handling of revert options in event outputs. This is a good practice to maintain type safety.
59-61
: Update toCallEvent
withrevertOptions
.The
CallEvent
namespace now includesrevertOptions
, which aligns with the new error handling strategy. Ensure that event listeners are updated to handle this additional data.Also applies to: 63-66, 72-72
86-87
: Update toDepositEvent
withrevertOptions
.The
DepositEvent
namespace is updated similarly, ensuring consistent error handling across different events. Verify that these changes are tested thoroughly.Also applies to: 94-95, 103-103
Line range hint
288-299
:
Modification of Event Filters withrevertOptions
.The event filter signatures for
Call
andDeposit
now include therevertOptions
tuple. This change is crucial for capturing the new revert data in event listeners.v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVM__factory.ts (7)
27-51
: Integration ofrevertOptions
incall
Function.The addition of
revertOptions
to thecall
function enhances its ability to handle reverts. Ensure that the contract logic properly utilizes these options for error handling.
76-101
: Integration ofrevertOptions
indeposit
Function.The
deposit
function now includesrevertOptions
, providing better control over revert scenarios. Verify that this change is reflected in the contract's operational logic.
117-141
: Integration ofrevertOptions
in Payabledeposit
Function.The payable version of the
deposit
function also includesrevertOptions
, ensuring consistency across function variants. Ensure that these options are correctly implemented in the contract.
171-197
: Integration ofrevertOptions
indepositAndCall
Function.The
depositAndCall
function now supportsrevertOptions
, enhancing its error management capabilities. This addition should be tested to ensure proper functionality.
217-242
: Integration ofrevertOptions
in PayabledepositAndCall
Function.The payable
depositAndCall
function includesrevertOptions
, maintaining consistency in error handling features. Ensure that these changes are well-tested.
367-394
: Addition ofrevertOptions
inCall
Event.The
Call
event now includesrevertOptions
, aligning with the new error handling strategy. This addition should be reflected in event processing logic.
432-459
: Addition ofrevertOptions
inDeposit
Event.The
Deposit
event's inclusion ofrevertOptions
ensures comprehensive error handling. Verify that event listeners are updated to process this data.v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVM.ts (4)
26-30
: IntroduceRevertOptionsStruct
.The new
RevertOptionsStruct
provides a structured way to handle revert options, enhancing error handling capabilities.
33-43
: IntroduceRevertOptionsStructOutput
.The
RevertOptionsStructOutput
mirrors theRevertOptionsStruct
for output purposes, maintaining consistency in data handling.
174-189
: Update event definitions to includerevertOptions
.The
Call
andWithdrawal
events now includerevertOptions
, allowing for more detailed logging of revert scenarios.Also applies to: 206-229
67-70
: Update function signatures to includeRevertOptionsStruct
.The function signatures have been updated to include
RevertOptionsStruct
, providing enhanced control over revert scenarios. Ensure that all calls to these functions are updated accordingly.Also applies to: 104-129, 152-164, 356-396, 490-534
Verification successful
All function calls match the updated signatures with
RevertOptionsStruct
.The search results confirm that all instances of
withdraw
andwithdrawAndCall
in thev2/typechain-types
directory are using the updated signatures that includeRevertOptionsStruct
. There are no mismatched function calls in the specified directory.
- The function signatures in both
GatewayZEVM.ts
andIGatewayZEVM.ts
are correctly updated.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all function calls match the updated signatures including `RevertOptionsStruct`. # Test: Search for function usage. Expect: Occurrences of the updated signatures. rg --type ts -A 5 $'withdraw\\(bytes,uint256,address,\\(address,bool,address,bytes\\)\\)' rg --type ts -A 5 $'withdrawAndCall\\(bytes,uint256,address,bytes,\\(address,bool,address,bytes\\)\\)'Length of output: 10083
Script:
#!/bin/bash # Description: Verify that all function calls to `withdraw` and `withdrawAndCall` use the updated signatures with `RevertOptionsStruct`. # Search for calls to the `withdraw` function and check if they match the updated signature. rg --type ts -A 2 'withdraw\(' # Search for calls to the `withdrawAndCall` function and check if they match the updated signature. rg --type ts -A 2 'withdrawAndCall\('Length of output: 38799
Script:
#!/bin/bash # Description: Verify that all function calls to `withdraw` and `withdrawAndCall` in the `v2/typechain-types` directory use the updated signatures with `RevertOptionsStruct`. # Search for calls to the `withdraw` function in the `v2/typechain-types` directory. rg --type ts -A 2 'withdraw\(' v2/typechain-types/ # Search for calls to the `withdrawAndCall` function in the `v2/typechain-types` directory. rg --type ts -A 2 'withdrawAndCall\(' v2/typechain-types/Length of output: 10255
v2/typechain-types/IGatewayEVM.sol/IGatewayEVM.ts (4)
26-31
: IntroduceRevertOptionsStruct
.The new
RevertOptionsStruct
enhances the interface by providing structured revert handling options.
33-43
: IntroduceRevertOptionsStructOutput
.The
RevertOptionsStructOutput
is consistent with the input structure, ensuring coherent data handling.
148-161
: Update event definitions to includerevertOptions
.The
CallEvent
andDepositEvent
now includerevertOptions
, providing more detailed event logging.Also applies to: 175-192
49-52
: Update function signatures to includeRevertOptionsStruct
.Function signatures now incorporate
RevertOptionsStruct
, enhancing the ability to manage revert scenarios. Verify all function calls to ensure they match the updated signatures.Also applies to: 71-93, 114-126, 330-373, 419-468
Verification successful
Function signatures updated successfully.
The function signatures have been updated to include
RevertOptionsStruct
across the relevant files. The changes are consistent with the updated signatures as requested.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all function calls match the updated signatures including `RevertOptionsStruct`. # Test: Search for function usage. Expect: Occurrences of the updated signatures. rg --type ts -A 5 $'deposit\\(address,uint256,address,\\(address,bool,address,bytes\\)\\)' rg --type ts -A 5 $'depositAndCall\\(address,bytes,\\(address,bool,address,bytes\\)\\)'Length of output: 20014
v2/pkg/senderzevm.sol/senderzevm.go (1)
35-35
: Update inSenderZEVM
contract bytecode.The bytecode for the
SenderZEVM
contract has been updated. Ensure that this change aligns with the intended contract functionality and does not introduce unexpected behavior.v2/typechain-types/factories/ZetaConnectorNonNative__factory.ts (1)
620-620
: Verify the impact of bytecode changes.The bytecode has been entirely replaced, indicating a substantial change in the contract logic. Ensure that these changes are thoroughly tested and documented, as they may affect contract behavior.
v2/typechain-types/factories/ERC20Custody__factory.ts (1)
674-674
: Verify the impact of bytecode changes.The bytecode has been entirely replaced, indicating a substantial change in the contract logic. Ensure that these changes are thoroughly tested and documented, as they may affect contract behavior.
v2/typechain-types/GatewayZEVM.ts (2)
523-528
: Addressvoid
type usage issue.The use of
void
in these method signatures is flagged as confusing. Consider replacingvoid
withundefined
to clarify the return type.- [void], + [undefined],Also applies to: 650-656, 661-667, 672-678, 684-690
26-30
: Ensure comprehensive testing ofRevertOptionsStruct
integration.The introduction of
RevertOptionsStruct
enhances error handling. Verify that all affected methods and events are adequately tested to ensure correct functionality and error management.Also applies to: 33-43, 83-86, 121-121, 137-137, 145-145, 187-212, 279-291, 302-303, 309-310, 317-317, 440-441, 451-452, 463-463
v2/typechain-types/GatewayEVM.ts (8)
26-31
: Introduction ofRevertOptionsStruct
.The addition of
RevertOptionsStruct
is a positive enhancement for handling revert scenarios more effectively. Ensure that this new structure is consistently used across the codebase where applicable.
33-43
: Definition ofRevertOptionsStructOutput
.The
RevertOptionsStructOutput
provides a clear mapping for the output of revert options. This is well-structured for handling outputs consistently.
55-58
: Update method signatures to includeRevertOptionsStruct
.The method signatures in
GatewayEVMInterface
now includeRevertOptionsStruct
, enhancing the functionality for handling revert scenarios. This is a significant improvement in terms of error handling.
118-141
: UpdateencodeFunctionData
method signatures.The
encodeFunctionData
methods have been updated to includeRevertOptionsStruct
, which aligns with the new approach for handling reverts. Ensure that encoding logic is correctly implemented and tested.
236-249
: UpdatedecodeFunctionResult
method signatures.The
decodeFunctionResult
methods now handleRevertOptionsStruct
, ensuring that the decoding process accommodates the new structure. This change supports the enhanced error handling mechanism.
308-321
: UpdateCallEvent
to includeRevertOptionsStruct
.The
CallEvent
now carries additional information about revert options, which is beneficial for event handling and logging.
335-352
: UpdateDepositEvent
to includeRevertOptionsStruct
.The
DepositEvent
has been updated to include revert options, aligning with the new error handling strategy. This ensures comprehensive event logging.
Line range hint
1043-1054
:
Update event filters to includeRevertOptionsStruct
.The event filters for
Call
andDeposit
now include revert options, ensuring that these events capture the full context of transaction handling.v2/typechain-types/GatewayEVMUpgradeTest.ts (8)
26-31
: Introduction ofRevertOptionsStruct
.The addition of
RevertOptionsStruct
enhances the handling of revert scenarios, providing a structured approach to error management.
33-43
: Definition ofRevertOptionsStructOutput
.The
RevertOptionsStructOutput
provides a structured format for handling output related to revert options, ensuring consistency in data handling.
55-58
: Update method signatures to includeRevertOptionsStruct
.The method signatures in
GatewayEVMUpgradeTestInterface
now incorporateRevertOptionsStruct
, enhancing error handling capabilities.
119-142
: UpdateencodeFunctionData
method signatures.The
encodeFunctionData
methods now includeRevertOptionsStruct
, aligning with the new error handling strategy. Ensure proper testing of encoding logic.
237-249
: UpdatedecodeFunctionResult
method signatures.The
decodeFunctionResult
methods have been updated to handleRevertOptionsStruct
, supporting the enhanced error handling mechanism.
309-322
: UpdateCallEvent
to includeRevertOptionsStruct
.The
CallEvent
now includes revert options, providing additional context for event handling and logging.
336-353
: UpdateDepositEvent
to includeRevertOptionsStruct
.The
DepositEvent
has been updated to include revert options, ensuring comprehensive event logging and error handling.
Line range hint
1069-1080
:
Update event filters to includeRevertOptionsStruct
.The event filters for
Call
andDeposit
now include revert options, capturing the full context of transaction handling.v2/typechain-types/GatewayEVMEchidnaTest.ts (16)
26-31
: RevertOptionsStruct definition looks good.The
RevertOptionsStruct
type is well-defined and aligns with the intended functionality of enhancing error handling.
33-43
: RevertOptionsStructOutput definition looks good.The
RevertOptionsStructOutput
type is correctly defined and consistent with TypeScript's tuple syntax.
55-58
: Function signature updates look good.The updated function signatures in
GatewayEVMEchidnaTestInterface
correctly incorporateRevertOptionsStruct
for enhanced error handling.
121-144
: encodeFunctionData updates look good.The updates to
encodeFunctionData
correctly reflect the changes in function signatures to includeRevertOptionsStruct
.
248-260
: decodeFunctionResult updates look good.The updates to
decodeFunctionResult
correctly reflect the changes in function signatures to includeRevertOptionsStruct
.
Line range hint
329-357
: Event updates look good.The updates to
CallEvent
andDepositEvent
correctly incorporateRevertOptionsStruct
, enhancing error handling in events.
627-674
: TypedContractMethod updates look good.The updated
TypedContractMethod
definitions correctly incorporateRevertOptionsStruct
for enhanced error handling.Tools
Biome
[error] 632-632: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 645-645: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 651-651: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 663-663: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 673-673: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
813-865
: getFunction updates look good.The updates to
getFunction
correctly reflect the changes in function signatures to includeRevertOptionsStruct
.Tools
Biome
[error] 818-818: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 833-833: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
Line range hint
1087-1098
: Event filter updates look good.The updates to event filters correctly incorporate
tuple
, enhancing the filtering capabilities forCall
andDeposit
events.
632-632
: Replacevoid
withundefined
.Using
void
outside of a return type or type parameter can be confusing. Consider replacing it withundefined
.Tools
Biome
[error] 632-632: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
645-645
: Replacevoid
withundefined
.Using
void
outside of a return type or type parameter can be confusing. Consider replacing it withundefined
.Tools
Biome
[error] 645-645: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
651-651
: Replacevoid
withundefined
.Using
void
outside of a return type or type parameter can be confusing. Consider replacing it withundefined
.Tools
Biome
[error] 651-651: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
663-663
: Replacevoid
withundefined
.Using
void
outside of a return type or type parameter can be confusing. Consider replacing it withundefined
.Tools
Biome
[error] 663-663: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
673-673
: Replacevoid
withundefined
.Using
void
outside of a return type or type parameter can be confusing. Consider replacing it withundefined
.Tools
Biome
[error] 673-673: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
818-818
: Replacevoid
withundefined
.Using
void
outside of a return type or type parameter can be confusing. Consider replacing it withundefined
.Tools
Biome
[error] 818-818: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
833-833
: Replacevoid
withundefined
.Using
void
outside of a return type or type parameter can be confusing. Consider replacing it withundefined
.Tools
Biome
[error] 833-833: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/pkg/igatewayevm.sol/igatewayevmevents.go (9)
32-38
: RevertOptions struct addition is well-defined.The new
RevertOptions
struct encapsulates parameters for revert handling, aligning with the PR's goal to improve error handling.
260-264
: RevertOptions field addition to IGatewayEVMEventsCall is appropriate.Including
RevertOptions
in theIGatewayEVMEventsCall
struct provides additional context for revert scenarios, enhancing event handling.
Line range hint
267-286
: FilterCall function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Call
event, ensuring consistency with the contract's event structure.
Line range hint
288-332
: WatchCall function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Call
event, ensuring consistency with the contract's event structure.
Line range hint
334-341
: ParseCall function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Call
event, ensuring consistency with the contract's event structure.
415-421
: RevertOptions field addition to IGatewayEVMEventsDeposit is appropriate.Including
RevertOptions
in theIGatewayEVMEventsDeposit
struct provides additional context for revert scenarios, enhancing event handling.
Line range hint
424-443
: FilterDeposit function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Deposit
event, ensuring consistency with the contract's event structure.
Line range hint
445-489
: WatchDeposit function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Deposit
event, ensuring consistency with the contract's event structure.
Line range hint
491-498
: ParseDeposit function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Deposit
event, ensuring consistency with the contract's event structure.v2/pkg/igatewayzevm.sol/igatewayzevm.go (11)
32-37
: RevertOptions struct addition is well-defined.The new
RevertOptions
struct encapsulates parameters for revert handling, aligning with the PR's goal to improve error handling.
198-202
: Call function update with RevertOptions is appropriate.Including
RevertOptions
in theCall
function enhances its ability to manage revert scenarios, aligning with the PR's objectives.
345-349
: Withdraw function update with RevertOptions is appropriate.Including
RevertOptions
in theWithdraw
function enhances its ability to manage revert scenarios, aligning with the PR's objectives.
498-503
: RevertOptions field addition to IGatewayZEVMCall is appropriate.Including
RevertOptions
in theIGatewayZEVMCall
struct provides additional context for revert scenarios, enhancing event handling.
Line range hint
506-525
: FilterCall function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Call
event, ensuring consistency with the contract's event structure.
Line range hint
527-571
: WatchCall function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Call
event, ensuring consistency with the contract's event structure.
Line range hint
573-580
: ParseCall function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Call
event, ensuring consistency with the contract's event structure.
662-663
: RevertOptions field addition to IGatewayZEVMWithdrawal is appropriate.Including
RevertOptions
in theIGatewayZEVMWithdrawal
struct provides additional context for revert scenarios, enhancing event handling.
Line range hint
666-685
: FilterWithdrawal function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Withdrawal
event, ensuring consistency with the contract's event structure.
Line range hint
687-731
: WatchWithdrawal function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Withdrawal
event, ensuring consistency with the contract's event structure.
Line range hint
733-740
: ParseWithdrawal function update is consistent with ABI changes.The function has been updated to reflect the new ABI for the
Withdrawal
event, ensuring consistency with the contract's event structure.v2/typechain-types/factories/GatewayEVM__factory.ts (7)
99-125
: Inclusion ofrevertOptions
incall
function is well-structured.The addition of the
revertOptions
parameter enhances the function's flexibility for error handling.
162-188
: Inclusion ofrevertOptions
indeposit
function is consistent and appropriate.The
revertOptions
parameter is added correctly, aligning with the intended improvements in error handling.
195-227
: Consistent addition ofrevertOptions
in the seconddeposit
function.The
revertOptions
parameter is included appropriately, providing enhanced error handling.
257-283
: Addition ofrevertOptions
indepositAndCall
function is well-implemented.The
revertOptions
parameter is correctly integrated, supporting improved error handling.
715-742
: Inclusion ofrevertOptions
inCall
event is consistent.The
revertOptions
parameter is added correctly, aligning with the enhanced error handling strategy.
780-807
: Consistent addition ofrevertOptions
inDeposit
event.The
revertOptions
parameter is correctly integrated, enhancing error handling capabilities.
1211-1212
: Flexibility inGatewayEVMConstructorParams
is well-implemented.The inclusion of an optional
signer
provides greater flexibility in constructor parameters.v2/typechain-types/factories/GatewayEVMUpgradeTest__factory.ts (6)
102-128
: Enhancement withrevertOptions
parameter.The addition of the
revertOptions
parameter in thecall
function enhances error handling and control flow. The structure appears correct and consistent.
165-191
: Enhancement withrevertOptions
parameter.The addition of the
revertOptions
parameter in thedeposit
function is consistent with the enhancements for error handling. The structure is correct.
198-230
: Enhancement withrevertOptions
parameter.The addition of the
revertOptions
parameter in the seconddeposit
function aligns with the error handling enhancements. The structure is consistent.
260-286
: Enhancement withrevertOptions
parameter.The addition of the
revertOptions
parameter in thedepositAndCall
function enhances error handling. The structure is consistent and correct.
291-331
: Enhancement withrevertOptions
parameter.The addition of the
revertOptions
parameter in the seconddepositAndCall
function aligns with the enhancements for error handling. The structure is consistent.
472-482
: Parameter renaming for consistency.The renaming of parameters in the
initialize
,setConnector
, andsetCustody
functions enhances readability and consistency. The changes are appropriate.Also applies to: 592-605
v2/typechain-types/factories/GatewayZEVM__factory.ts (5)
605-631
: Consistent enhancement withrevertOptions
inwithdraw
.The
withdraw
function now includes arevertOptions
tuple, aligning with similar enhancements in thecall
function. This consistency is beneficial for error handling.Verify the consistent implementation of
revertOptions
throughout the codebase.
701-736
:revertOptions
added towithdrawAndCall
.The inclusion of
revertOptions
in thewithdrawAndCall
function is consistent with previous changes, enhancing error handling capabilities.Verify the consistent implementation of
revertOptions
throughout the codebase.
837-864
:revertOptions
added toCall
event.Including
revertOptions
in theCall
event provides more detailed logging of revert scenarios, which aids in debugging and monitoring.Verify the consistent implementation of
revertOptions
throughout the codebase.
1047-1074
:revertOptions
added toWithdrawal
event.The addition of
revertOptions
to theWithdrawal
event enhances logging and monitoring capabilities for revert scenarios, aiding in debugging.Verify the consistent implementation of
revertOptions
throughout the codebase.
95-121
: Enhance error handling withrevertOptions
.The addition of the
revertOptions
tuple in thecall
function enhances error handling by allowing more control over revert scenarios. This is a positive change.Ensure that the implementation of
revertOptions
is consistent across the codebase.Verification successful
Consistent usage of
revertOptions
verified.The
revertOptions
tuple is consistently used across the codebase, aligning with its intended structure and purpose. This ensures enhanced error handling capabilities are uniformly applied. No issues found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistent usage of `revertOptions` across the codebase. # Test: Search for the usage of `revertOptions`. Expect: Consistent structure and usage. rg --type ts 'revertOptions'Length of output: 13883
v2/pkg/igatewayevm.sol/igatewayevm.go (13)
32-38
: Addition ofRevertOptions
struct is well-structured.The
RevertOptions
struct provides a clear and organized way to handle transaction reverts. Its fields cover various aspects needed for revert scenarios.
194-195
: Inclusion ofrevertOptions
inCall
function is appropriate.The updated function signature allows for improved error handling during transactions.
201-202
: Inclusion ofrevertOptions
inCall
function is appropriate.The updated function signature allows for improved error handling during transactions.
208-209
: Inclusion ofrevertOptions
inCall
function is appropriate.The updated function signature allows for improved error handling during transactions.
215-216
: Inclusion ofrevertOptions
inDeposit
function is appropriate.The updated function signature allows for improved error handling during transactions.
222-223
: Inclusion ofrevertOptions
inDeposit
function is appropriate.The updated function signature allows for improved error handling during transactions.
229-230
: Inclusion ofrevertOptions
inDeposit
function is appropriate.The updated function signature allows for improved error handling during transactions.
236-237
: Inclusion ofrevertOptions
inDeposit0
function is appropriate.The updated function signature allows for improved error handling during transactions.
243-244
: Inclusion ofrevertOptions
inDeposit0
function is appropriate.The updated function signature allows for improved error handling during transactions.
250-251
: Inclusion ofrevertOptions
inDeposit0
function is appropriate.The updated function signature allows for improved error handling during transactions.
257-258
: Inclusion ofrevertOptions
inDepositAndCall
function is appropriate.The updated function signature allows for improved error handling during transactions.
449-452
: Inclusion ofRevertOptions
inIGatewayEVMCall
struct is beneficial.The addition enhances the event's ability to log revert scenarios.
604-609
: Inclusion ofRevertOptions
inIGatewayEVMDeposit
struct is beneficial.The addition enhances the event's ability to log revert scenarios.
v2/typechain-types/factories/GatewayEVMEchidnaTest__factory.ts (5)
102-128
:revertOptions
addition incall
function looks good.The addition of the
revertOptions
tuple enhances error handling by allowing more granular control over reverts.
165-191
:revertOptions
addition indeposit
function looks good.The
revertOptions
tuple is consistently integrated, enhancing the function's error handling capabilities.
198-230
:revertOptions
addition in overloadeddeposit
function looks good.The integration of
revertOptions
is consistent and enhances error handling.
260-286
:revertOptions
addition indepositAndCall
function looks good.Consistent integration of
revertOptions
enhances the function's error handling.
767-794
:revertOptions
addition inCall
event looks good.The inclusion of
revertOptions
in the event enhances tracking and handling of revert scenarios.v2/pkg/zetaconnectornonnative.sol/zetaconnectornonnative.go (1)
Line range hint
14-35
:
Ensure documentation and testing for new functions and events.The ABI changes introduce new functions and events, such as
withdrawAndRevert
andAccessControlUnauthorizedAccount
. Ensure these are well-documented and adequately tested to maintain correct behavior and security.
amount: BigNumberish, | ||
zrc20: AddressLike, | ||
revertOptions: RevertOptionsStruct | ||
], | ||
[void], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address confusing use of void
in function return types.
The use of void
is flagged as confusing. Consider replacing void
with undefined
for clarity.
- [void],
+ [undefined],
Also applies to: 374-374, 386-386, 498-498, 510-510
Tools
Biome
[error] 363-363: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[ | ||
receiver: AddressLike, | ||
payload: BytesLike, | ||
revertOptions: RevertOptionsStruct | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace void
with undefined
in parameter lists.
The use of void
in parameter lists is confusing outside of return types. Replace it with undefined
to prevent confusion and align with TypeScript best practices.
- [void],
+ [undefined],
Also applies to: 617-623, 628-629, 634-640, 646-651
[ | ||
receiver: AddressLike, | ||
payload: BytesLike, | ||
revertOptions: RevertOptionsStruct | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace void
with undefined
in parameter lists.
The use of void
in parameter lists is confusing outside of return types. Replace it with undefined
to align with TypeScript best practices and prevent confusion.
- [void],
+ [undefined],
Also applies to: 636-642, 647-648, 653-659, 665-670
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 10
Outside diff range, codebase verification and nitpick comments (6)
v2/typechain-types/factories/TestUniversalContract__factory.ts (1)
76-78
: Ensure Consistency in Type Naming Across the CodebaseThe type name
RevertContext
should be used consistently throughout the codebase. The following files contain instances ofrevertContext
that should be updated toRevertContext
for consistency:
v2/typechain-types/factories/ZetaConnectorNonNative__factory.ts
v2/typechain-types/factories/ZetaConnectorNative__factory.ts
v2/typechain-types/factories/ZetaConnectorBase__factory.ts
v2/typechain-types/factories/TestUniversalContract__factory.ts
v2/typechain-types/factories/Revert.sol/Revertable__factory.ts
v2/typechain-types/factories/GatewayZEVM__factory.ts
v2/typechain-types/factories/GatewayEVMUpgradeTest__factory.ts
v2/typechain-types/factories/GatewayEVM__factory.ts
v2/typechain-types/factories/ERC20Custody__factory.ts
v2/typechain-types/factories/GatewayEVMEchidnaTest__factory.ts
v2/typechain-types/factories/ERC20CustodyEchidnaTest__factory.ts
v2/typechain-types/factories/zContract.sol/UniversalContract__factory.ts
Please update these instances to ensure consistent naming conventions.
Analysis chain
Ensure Consistency in Type Naming.
The change from
struct revertContext
tostruct RevertContext
should be consistent across the codebase to prevent mismatches.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the type name `RevertContext` across the codebase. # Test: Search for occurrences of `revertContext` and `RevertContext`. rg --type ts 'revertContext|RevertContext'Length of output: 22773
v2/src/zevm/interfaces/IGatewayZEVM.sol (3)
5-5
: Consider Centralizing Type Definitions.The import of
Revert.sol
suggests that types are defined in multiple locations. Consider centralizing type definitions to avoid duplication and potential inconsistencies.
Update Required for
Withdrawal
Event EmissionsNot all
Withdrawal
event emissions and definitions have been updated to include therevertOptions
parameter. Please ensure consistency across the codebase by updating the following locations:
v2/src/zevm/ZRC20.sol
: Update theWithdrawal
event to includerevertOptions
.v2/src/zevm/interfaces/IWZETA.sol
: Update theWithdrawal
event to includerevertOptions
.v2/src/zevm/interfaces/IZRC20.sol
: Update theWithdrawal
event to includerevertOptions
.Analysis chain
Line range hint
29-39
:
Update toWithdrawal
Event.The addition of
revertOptions
to theWithdrawal
event improves its functionality. Ensure that all event emissions and listeners reflect this change.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all `Withdrawal` event emissions and listeners include the new `revertOptions`. # Test: Search for `Withdrawal` event emissions and listeners. rg --type sol 'Withdrawal'Length of output: 54
Script:
#!/bin/bash # Description: Search for `Withdrawal` event emissions and listeners across all files, focusing on Solidity files. # Test: Search for `Withdrawal` event emissions and listeners. rg 'Withdrawal' --glob '*.sol' -A 5Length of output: 10116
207-214
: UpdateexecuteRevert
Function Calls in TestsThe
executeRevert
function inv2/test/GatewayZEVM.t.sol
still usesrevertContext
instead ofzContext
. Please update these calls to ensure consistency with the updated function signature.
- File:
v2/test/GatewayZEVM.t.sol
- Lines: Multiple instances where
executeRevert
is called withrevertContext
.Analysis chain
Update to
executeRevert
Function Signature.The
executeRevert
function now useszContext
instead ofrevertContext
. Ensure that all function calls reflect this change.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all `executeRevert` function calls use `zContext`. # Test: Search for `executeRevert` function calls and check for `zContext`. rg --type sol 'executeRevert'Length of output: 57
Script:
#!/bin/bash # Description: Verify that all `executeRevert` function calls use `zContext`. # Test: Search for `executeRevert` function calls and check for `zContext`. rg 'executeRevert'Length of output: 100333
Script:
#!/bin/bash # Description: Check for `executeRevert` function calls in test files to verify parameter usage. # Search for `executeRevert` calls in test files and check for parameter usage. rg 'executeRevert\(' -A 2 v2/test/*.solLength of output: 1643
v2/pkg/revert.sol/revertable.go (1)
4-4
: Update References to Package NameThe package name
igatewayevm
is still present in several files. Please update these references to the new package namerevert
to ensure consistency across the codebase.
v2/pkg/igatewayevm.sol/igatewayevmevents.go
v2/pkg/igatewayevm.sol/igatewayevmerrors.go
v2/pkg/igatewayevm.sol/igatewayevm.go
Analysis chain
Package name change.
The package name has been changed from
igatewayevm
torevert
, indicating a shift in focus or functionality. Ensure that all references to this package are updated accordingly in the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all references to the old package name are updated. # Test: Search for the old package name. Expect: No occurrences. rg --type go 'package igatewayevm'Length of output: 222
v2/src/zevm/GatewayZEVM.sol (1)
Update
withdrawAndCall
function calls to includeRevertOptions
.The
withdrawAndCall
function signature has been updated to include aRevertOptions
parameter. However, some calls to this function have not been updated to match the new signature. Please update the following occurrences:
v2/test/ZetaConnectorNative.t.sol
v2/test/ERC20Custody.t.sol
These calls should include the
RevertOptions
parameter to ensure consistency and correct functionality.Analysis chain
Line range hint
145-163
:
Verify the usage ofRevertOptions
.The addition of
RevertOptions
to thewithdrawAndCall
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `withdrawAndCall` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type solidity -A 5 $'withdrawAndCall'Length of output: 74
Script:
#!/bin/bash # Corrected: Verify all function calls to `withdrawAndCall` match the new signature. # Test: Search for the function usage in Solidity files. rg --glob '*.sol' -A 5 $'withdrawAndCall'Length of output: 19531
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (86)
- v2/pkg/erc20custody.sol/erc20custody.go (5 hunks)
- v2/pkg/ierc20custody.sol/ierc20custody.go (5 hunks)
- v2/pkg/ierc20custody.sol/ierc20custodyevents.go (4 hunks)
- v2/pkg/igatewayevm.sol/igatewayevm.go (13 hunks)
- v2/pkg/igatewayevm.sol/igatewayevmevents.go (10 hunks)
- v2/pkg/igatewayzevm.sol/igatewayzevm.go (11 hunks)
- v2/pkg/ireceiverevm.sol/ireceiverevmevents.go (4 hunks)
- v2/pkg/izetaconnector.sol/izetaconnectorevents.go (4 hunks)
- v2/pkg/receiverevm.sol/receiverevm.go (5 hunks)
- v2/pkg/revert.sol/revertable.go (3 hunks)
- v2/pkg/senderzevm.sol/senderzevm.go (1 hunks)
- v2/pkg/systemcontract.sol/systemcontract.go (1 hunks)
- v2/pkg/systemcontractmock.sol/systemcontractmock.go (1 hunks)
- v2/pkg/testuniversalcontract.sol/testuniversalcontract.go (6 hunks)
- v2/pkg/universalcontract.sol/universalcontract.go (3 hunks)
- v2/pkg/zetaconnectorbase.sol/zetaconnectorbase.go (5 hunks)
- v2/pkg/zetaconnectornative.sol/zetaconnectornative.go (5 hunks)
- v2/pkg/zetaconnectornonnative.sol/zetaconnectornonnative.go (5 hunks)
- v2/src/Revert.sol (1 hunks)
- v2/src/evm/ERC20Custody.sol (3 hunks)
- v2/src/evm/GatewayEVM.sol (6 hunks)
- v2/src/evm/ZetaConnectorBase.sol (2 hunks)
- v2/src/evm/ZetaConnectorNative.sol (2 hunks)
- v2/src/evm/ZetaConnectorNonNative.sol (2 hunks)
- v2/src/evm/interfaces/IERC20Custody.sol (3 hunks)
- v2/src/evm/interfaces/IGatewayEVM.sol (5 hunks)
- v2/src/evm/interfaces/IZetaConnector.sol (2 hunks)
- v2/src/zevm/GatewayZEVM.sol (8 hunks)
- v2/src/zevm/interfaces/IGatewayZEVM.sol (7 hunks)
- v2/src/zevm/interfaces/UniversalContract.sol (2 hunks)
- v2/test/ERC20Custody.t.sol (7 hunks)
- v2/test/GatewayEVM.t.sol (18 hunks)
- v2/test/GatewayZEVM.t.sol (18 hunks)
- v2/test/ZetaConnectorNative.t.sol (4 hunks)
- v2/test/ZetaConnectorNonNative.t.sol (6 hunks)
- v2/test/utils/GatewayEVMUpgradeTest.sol (9 hunks)
- v2/test/utils/IReceiverEVM.sol (2 hunks)
- v2/test/utils/ReceiverEVM.sol (2 hunks)
- v2/test/utils/TestUniversalContract.sol (3 hunks)
- v2/typechain-types/ERC20Custody.ts (6 hunks)
- v2/typechain-types/ERC20CustodyEchidnaTest.ts (6 hunks)
- v2/typechain-types/GatewayEVM.ts (19 hunks)
- v2/typechain-types/GatewayEVMEchidnaTest.ts (21 hunks)
- v2/typechain-types/GatewayEVMUpgradeTest.ts (23 hunks)
- v2/typechain-types/GatewayZEVM.ts (22 hunks)
- v2/typechain-types/IERC20Custody.sol/IERC20Custody.ts (6 hunks)
- v2/typechain-types/IERC20Custody.sol/IERC20CustodyEvents.ts (3 hunks)
- v2/typechain-types/IGatewayEVM.sol/IGatewayEVM.ts (14 hunks)
- v2/typechain-types/IGatewayEVM.sol/IGatewayEVMEvents.ts (8 hunks)
- v2/typechain-types/IGatewayEVM.sol/index.ts (1 hunks)
- v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVM.ts (18 hunks)
- v2/typechain-types/IReceiverEVM.sol/IReceiverEVMEvents.ts (3 hunks)
- v2/typechain-types/IZetaConnector.sol/IZetaConnectorEvents.ts (3 hunks)
- v2/typechain-types/ReceiverEVM.ts (6 hunks)
- v2/typechain-types/Revert.sol/Revertable.ts (1 hunks)
- v2/typechain-types/Revert.sol/index.ts (1 hunks)
- v2/typechain-types/TestUniversalContract.ts (6 hunks)
- v2/typechain-types/UniversalContract.sol/UniversalContract.ts (4 hunks)
- v2/typechain-types/ZetaConnectorBase.ts (6 hunks)
- v2/typechain-types/ZetaConnectorNative.ts (6 hunks)
- v2/typechain-types/ZetaConnectorNonNative.ts (6 hunks)
- v2/typechain-types/factories/ERC20Custody__factory.ts (3 hunks)
- v2/typechain-types/factories/GatewayEVMUpgradeTest__factory.ts (14 hunks)
- v2/typechain-types/factories/GatewayEVM__factory.ts (11 hunks)
- v2/typechain-types/factories/GatewayZEVM__factory.ts (12 hunks)
- v2/typechain-types/factories/IERC20Custody.sol/IERC20CustodyEvents__factory.ts (1 hunks)
- v2/typechain-types/factories/IERC20Custody.sol/IERC20Custody__factory.ts (2 hunks)
- v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVMEvents__factory.ts (4 hunks)
- v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVM__factory.ts (9 hunks)
- v2/typechain-types/factories/IGatewayEVM.sol/index.ts (1 hunks)
- v2/typechain-types/factories/IGatewayZEVM.sol/IGatewayZEVM__factory.ts (11 hunks)
- v2/typechain-types/factories/IReceiverEVM.sol/IReceiverEVMEvents__factory.ts (1 hunks)
- v2/typechain-types/factories/IZetaConnector.sol/IZetaConnectorEvents__factory.ts (1 hunks)
- v2/typechain-types/factories/ReceiverEVM__factory.ts (3 hunks)
- v2/typechain-types/factories/Revert.sol/Revertable__factory.ts (1 hunks)
- v2/typechain-types/factories/Revert.sol/index.ts (1 hunks)
- v2/typechain-types/factories/SenderZEVM__factory.ts (1 hunks)
- v2/typechain-types/factories/SystemContract.sol/SystemContract__factory.ts (1 hunks)
- v2/typechain-types/factories/SystemContractMock.sol/SystemContractMock__factory.ts (1 hunks)
- v2/typechain-types/factories/TestUniversalContract__factory.ts (2 hunks)
- v2/typechain-types/factories/UniversalContract.sol/UniversalContract__factory.ts (1 hunks)
- v2/typechain-types/factories/ZetaConnectorBase__factory.ts (2 hunks)
- v2/typechain-types/factories/ZetaConnectorNative__factory.ts (3 hunks)
- v2/typechain-types/factories/ZetaConnectorNonNative__factory.ts (3 hunks)
- v2/typechain-types/factories/index.ts (1 hunks)
- v2/typechain-types/index.ts (3 hunks)
Files skipped from review due to trivial changes (3)
- v2/typechain-types/Revert.sol/index.ts
- v2/typechain-types/factories/IGatewayEVM.sol/index.ts
- v2/typechain-types/factories/Revert.sol/index.ts
Files skipped from review as they are similar to previous changes (17)
- v2/pkg/igatewayevm.sol/igatewayevmevents.go
- v2/pkg/senderzevm.sol/senderzevm.go
- v2/pkg/systemcontractmock.sol/systemcontractmock.go
- v2/src/evm/ERC20Custody.sol
- v2/src/evm/ZetaConnectorBase.sol
- v2/src/evm/interfaces/IGatewayEVM.sol
- v2/src/zevm/interfaces/UniversalContract.sol
- v2/test/ZetaConnectorNonNative.t.sol
- v2/test/utils/TestUniversalContract.sol
- v2/typechain-types/factories/GatewayEVMUpgradeTest__factory.ts
- v2/typechain-types/factories/GatewayEVM__factory.ts
- v2/typechain-types/factories/GatewayZEVM__factory.ts
- v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVMEvents__factory.ts
- v2/typechain-types/factories/IGatewayZEVM.sol/IGatewayZEVM__factory.ts
- v2/typechain-types/factories/SenderZEVM__factory.ts
- v2/typechain-types/factories/SystemContract.sol/SystemContract__factory.ts
- v2/typechain-types/factories/SystemContractMock.sol/SystemContractMock__factory.ts
Additional context used
Biome
v2/typechain-types/factories/Revert.sol/Revertable__factory.ts
[error] 44-52: Avoid classes that contain only static members.
Prefer using simple functions instead of classes with only static members.
(lint/complexity/noStaticOnlyClass)
v2/typechain-types/Revert.sol/Revertable.ts
[error] 92-92: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 104-104: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 108-108: Don't use '{}' as a type.
Prefer explicitly define the object shape. '{}' means "any non-nullable value".
(lint/complexity/noBannedTypes)
v2/typechain-types/ReceiverEVM.ts
[error] 260-260: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 298-298: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/IGatewayEVM.sol/IGatewayEVM.ts
[error] 337-337: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 348-348: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 354-354: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 366-366: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 376-376: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 431-431: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 443-443: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 450-450: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 463-463: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 474-474: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVM.ts
[error] 380-380: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 391-391: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 402-402: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 414-414: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 516-516: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 528-528: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 540-540: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayZEVM.ts
[error] 685-685: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 696-696: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 708-708: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayEVM.ts
[error] 613-613: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 626-626: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 632-632: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 644-644: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 654-654: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 794-794: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 809-809: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 816-816: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayEVMUpgradeTest.ts
[error] 632-632: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 645-645: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 651-651: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 663-663: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 673-673: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 756-756: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 813-813: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 828-828: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 835-835: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
v2/typechain-types/GatewayEVMEchidnaTest.ts
[error] 634-634: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 647-647: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 653-653: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 665-665: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 675-675: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 825-825: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 840-840: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
GitHub Check: Slither
v2/src/evm/GatewayEVM.sol
[warning] 211-228: Low-level calls
Low level call in GatewayEVM.deposit(address,RevertOptions) (src/evm/GatewayEVM.sol#211-228):
- (deposited,None) = tssAddress.call{value: msg.value}() (src/evm/GatewayEVM.sol#223)
[warning] 257-275: Low-level calls
Low level call in GatewayEVM.depositAndCall(address,bytes,RevertOptions) (src/evm/GatewayEVM.sol#257-275):
- (deposited,None) = tssAddress.call{value: msg.value}() (src/evm/GatewayEVM.sol#270)
Additional comments not posted (320)
v2/typechain-types/IGatewayEVM.sol/index.ts (1)
Line range hint
1-6
:
Verify the impact of removingRevertable
.The
Revertable
type has been removed from exports. Ensure that this change does not affect any dependent modules or components that relied on this type.v2/src/Revert.sol (1)
1-32
: LGTM! The new structures and interface enhance error handling.The introduction of
RevertOptions
,RevertContext
, and theRevertable
interface provides a structured approach to managing reverts, improving error handling and control flow.v2/src/evm/interfaces/IZetaConnector.sol (1)
Line range hint
4-25
:
LGTM! The addition ofRevertContext
enhances event functionality.Including
RevertContext
in theWithdrawAndRevert
event provides more detailed information for handling revert scenarios, improving debugging and management.v2/test/utils/IReceiverEVM.sol (1)
4-5
: LGTM! Enhanced event structure withRevertContext
.The use of
RevertContext
in theReceivedRevert
event improves the structure and clarity of the event parameters.Also applies to: 37-38
v2/typechain-types/factories/UniversalContract.sol/UniversalContract__factory.ts (1)
62-79
: LGTM! Improved ABI structure withRevertContext
.The changes to the
onRevert
function's ABI enhance the clarity and structure of the parameters, using a structuredRevertContext
.v2/typechain-types/factories/IZetaConnector.sol/IZetaConnectorEvents__factory.ts (1)
78-99
: Enhancement: Detailed revert context added.The addition of the
revertContext
structure to theWithdrawAndRevert
event provides more comprehensive information about reverts, enhancing error handling and debugging capabilities.v2/test/utils/ReceiverEVM.sol (1)
69-72
: Improvement: Enhanced revert handling.The
onRevert
function now usesRevertContext
, improving the handling and emission of detailed revert information. This change enhances the contract's error handling capabilities.v2/typechain-types/factories/IERC20Custody.sol/IERC20CustodyEvents__factory.ts (1)
122-144
: LGTM! Verify the integration of the new event structure.The addition of the
revertContext
event structure enhances debugging capabilities by providing detailed revert information. Ensure that this new structure is correctly integrated and used in the contract logic.Verification successful
Integration of
revertContext
VerifiedThe
revertContext
structure is well-integrated across various parts of the codebase. It is used in multiple Solidity contracts and TypeScript files, indicating its integration into the contract logic and related interfaces. This confirms that the new event structure is being utilized effectively for debugging and revert information handling.
- Occurrences in Solidity Contracts: Found in
IGatewayZEVM.sol
,GatewayEVM.sol
,ZetaConnectorNative.sol
,ZetaConnectorBase.sol
,IERC20Custody.sol
, and more.- Occurrences in TypeScript Files: Found in
IGatewayEVM.ts
,IZetaConnectorEvents.ts
,IERC20Custody.ts
, and others.The integration appears comprehensive and consistent with the intended functionality.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage and integration of the new `revertContext` structure. # Test: Search for the usage of `revertContext`. Expect: Occurrences in related contract logic. rg --type solidity --type ts 'revertContext'Length of output: 77
Script:
#!/bin/bash # Description: Verify the usage and integration of the new `revertContext` structure. # Find all Solidity and TypeScript files and search for the usage of `revertContext`. fd -e sol -e ts | xargs rg 'revertContext'Length of output: 386963
v2/typechain-types/factories/IReceiverEVM.sol/IReceiverEVMEvents__factory.ts (1)
135-155
: LGTM! Verify the integration of the new event parameter.The replacement of the
data
parameter with therevertContext
structure provides more detailed information about revert scenarios. Ensure that this new parameter is correctly integrated and used in the contract logic.Verification successful
Integration of
revertContext
Parameter VerifiedThe
revertContext
parameter is extensively integrated across the codebase, appearing in both Solidity and TypeScript files. It is used in event emissions, function parameters, and struct definitions, and is also present in test files, indicating that its functionality is being tested. This suggests a thorough integration into the contract logic.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage and integration of the new `revertContext` parameter. # Test: Search for the usage of `revertContext`. Expect: Occurrences in related contract logic. rg --type solidity --type ts 'revertContext'Length of output: 77
Script:
#!/bin/bash # Description: Verify the usage and integration of the new `revertContext` parameter. # Test: Search for the usage of `revertContext`. Expect: Occurrences in related contract logic. rg 'revertContext' --glob '*.sol' --glob '*.ts'Length of output: 24340
v2/src/evm/ZetaConnectorNative.sol (1)
Line range hint
76-96
: LGTM! Verify the integration of the new parameter in function logic.The addition of the
revertContext
parameter to thewithdrawAndRevert
function enhances error handling by providing context during revert operations. Ensure that this new parameter is correctly integrated and used in the function logic.Verification successful
Integration of
revertContext
Parameter Verified: TherevertContext
parameter is correctly integrated into thewithdrawAndRevert
function. It is used in the function's logic and passed to thegateway.revertWithERC20
method, and its integration is supported by related test cases.
- The parameter is part of the function signature and used in the function body.
- Test cases involving
withdrawAndRevert
confirm its usage and integration.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage and integration of the `revertContext` parameter in the `withdrawAndRevert` function. # Test: Search for the usage of `withdrawAndRevert` and `revertContext`. Expect: Occurrences in related contract logic. rg --type solidity 'withdrawAndRevert|revertContext'Length of output: 87
Script:
#!/bin/bash # Description: Verify the usage and integration of the `revertContext` parameter in the `withdrawAndRevert` function. # Test: Search for the usage of `withdrawAndRevert` and `revertContext` in Solidity files. rg 'withdrawAndRevert|revertContext' --glob '*.sol' -A 5Length of output: 37964
v2/typechain-types/UniversalContract.sol/UniversalContract.ts (3)
37-39
: LGTM: Enhanced RevertContextStruct.The updated
RevertContextStruct
now includesasset
,amount
, andrevertMessage
, which enhances error handling by providing more context.
59-59
: LGTM: Updated encodeFunctionData for onRevert.The
encodeFunctionData
method now correctly uses the updatedRevertContextStruct
, aligning with the new structure.
124-124
: LGTM: Updated onRevert method signature.The
onRevert
method now uses the updatedRevertContextStruct
, improving the handling of revert scenarios.Also applies to: 148-148
v2/src/evm/interfaces/IERC20Custody.sol (2)
27-30
: LGTM: Enhanced WithdrawAndRevert event.The
WithdrawAndRevert
event now includes aRevertContext
parameter, providing more context for revert scenarios.
76-84
: LGTM: Updated withdrawAndRevert function signature.The
withdrawAndRevert
function now includes aRevertContext
parameter, enhancing error handling and context management.v2/src/evm/ZetaConnectorNonNative.sol (1)
90-96
: LGTM: Enhanced withdrawAndRevert function.The
withdrawAndRevert
function now includes aRevertContext
parameter and uses it in thegateway.revertWithERC20
method, improving error handling.Also applies to: 108-110
v2/typechain-types/factories/index.ts (1)
13-13
: Addition ofRevert.sol
export is consistent.The new export statement for
Revert.sol
follows the existing pattern and enhances module accessibility. This change is appropriate and aligns with the file's purpose.v2/typechain-types/IZetaConnector.sol/IZetaConnectorEvents.ts (3)
24-28
: Introduction ofRevertContextStruct
enhances event detail.The new
RevertContextStruct
provides a structured way to include detailed revert information, which is a valuable addition for error handling.
77-90
: Update toWithdrawAndRevertEvent
includes revert context.The addition of
revertContext
to theWithdrawAndRevertEvent
namespace enriches the event with more detailed revert information, aligning with the enhanced error handling goals.
Line range hint
190-195
: Update event signature forWithdrawAndRevert
.The change in the event signature to include
revertContext
is consistent with the new structure and provides more comprehensive event data.Ensure that all event listeners and handlers are updated to accommodate this new signature.
v2/typechain-types/factories/IERC20Custody.sol/IERC20Custody__factory.ts (2)
106-127
: Addition ofRevertContext
towithdrawAndRevert
function.The inclusion of
RevertContext
in thewithdrawAndRevert
function inputs enhances error handling by providing detailed context about reverts.
242-264
: Addition ofRevertContext
toWithdrawAndRevert
event.The
RevertContext
addition to theWithdrawAndRevert
event enriches the event data with detailed revert information, aligning with enhanced error management.Ensure that all relevant functions and event handlers are updated to handle the new context structure.
Verification successful
RevertContext Structure is Properly Integrated
The
RevertContext
structure has been integrated into theWithdrawAndRevert
event across the codebase, as evidenced by the multiple instances found in various files. This confirms that the relevant functions and event handlers have been updated to handle the new context structure.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the updated `withdrawAndRevert` function and `WithdrawAndRevert` event. # Test: Search for the `withdrawAndRevert` function and `WithdrawAndRevert` event usage. Expect: Updated context structure usage. rg --type typescript -A 5 $'withdrawAndRevert' rg --type typescript -A 5 $'WithdrawAndRevert'Length of output: 161
Script:
#!/bin/bash # Description: Verify the usage of the updated `withdrawAndRevert` function and `WithdrawAndRevert` event. # Test: Search for the `withdrawAndRevert` function and `WithdrawAndRevert` event usage in .ts files. Expect: Updated context structure usage. rg --glob '*.ts' -A 5 $'withdrawAndRevert' rg --glob '*.ts' -A 5 $'WithdrawAndRevert'Length of output: 40391
v2/typechain-types/TestUniversalContract.ts (3)
39-48
: Structured Revert Context Approved.The addition of
asset
,amount
, andrevertMessage
fields inRevertContextStruct
andRevertContextStructOutput
enhances the clarity and utility of revert data handling.
104-107
: Event Structure Update Approved.The inclusion of
revertContext
inContextDataRevertEvent
aligns with the structured handling of revert data.
65-65
: Simplified Method Signatures Approved.The updated method signatures using
RevertContextStruct
streamline the handling of revert contexts.Ensure that all usages of
encodeFunctionData
andonRevert
are updated to match the new signatures.Also applies to: 170-170, 194-194
v2/typechain-types/IERC20Custody.sol/IERC20CustodyEvents.ts (3)
24-35
: New Revert Context Structure Approved.The introduction of
RevertContextStruct
andRevertContextStructOutput
provides a clear and structured way to handle revert contexts.
119-120
: Enhanced Event Structure Approved.The update to include
revertContext
inWithdrawAndRevertEvent
enhances the event's data handling capabilities.Also applies to: 126-127, 134-134
270-270
: Updated Event Signature Approved.The signature update for
WithdrawAndRevert
reflects the inclusion of structured revert context data.Ensure that all emissions of
WithdrawAndRevert
are updated to match the new signature.Verification successful
Event Signature Update Verified.
The
WithdrawAndRevert
event signature has been consistently updated across the relevant files in the codebase:
v2/typechain-types/ERC20CustodyEchidnaTest.ts
v2/typechain-types/ERC20Custody.ts
v2/typechain-types/IERC20Custody.sol/IERC20Custody.ts
v2/typechain-types/IERC20Custody.sol/IERC20CustodyEvents.ts
These updates confirm that the new signature is correctly implemented.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all emissions of `WithdrawAndRevert` match the new signature. # Test: Search for the event emission. Expect: Only occurrences of the new signature. rg --type typescript -A 5 $'WithdrawAndRevert\\(address,address,uint256,bytes,tuple\\)'Length of output: 121
Script:
#!/bin/bash # Description: Verify all emissions of `WithdrawAndRevert` match the new signature. # Test: Search for the event emission. Expect: Only occurrences of the new signature. rg --type ts -A 5 $'WithdrawAndRevert\\(address,address,uint256,bytes,tuple\\)'Length of output: 2285
v2/typechain-types/IReceiverEVM.sol/IReceiverEVMEvents.ts (3)
24-35
: New Revert Context Structure Approved.The introduction of
RevertContextStruct
andRevertContextStructOutput
provides a clear and structured way to handle revert contexts.
138-141
: Enhanced Event Structure Approved.The update to include
revertContext
inReceivedRevertEvent
enhances the event's data handling capabilities.Also applies to: 143-145, 148-148
284-284
: Updated Event Signature Approved.The signature update for
ReceivedRevert
reflects the inclusion of structured revert context data.Ensure that all emissions of
ReceivedRevert
are updated to match the new signature.Verification successful
Event Signature Update Verified
The
ReceivedRevert
event signature has been correctly updated to include atuple
in the relevant files:
v2/typechain-types/ReceiverEVM.ts
v2/typechain-types/IReceiverEVM.sol/IReceiverEVMEvents.ts
The changes reflect the new event structure as intended.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all emissions of `ReceivedRevert` match the new signature. # Test: Search for the event emission. Expect: Only occurrences of the new signature. rg --type typescript -A 5 $'ReceivedRevert\\(address,tuple\\)'Length of output: 96
Script:
#!/bin/bash # Description: Verify all emissions of `ReceivedRevert` match the new signature. # Test: Search for the event emission. Expect: Only occurrences of the new signature. rg --type ts -A 5 $'ReceivedRevert\\(address,tuple\\)'Length of output: 1048
v2/typechain-types/factories/TestUniversalContract__factory.ts (1)
171-171
: Verify Bytecode Changes.The bytecode has been updated, which may affect contract deployment and execution. Ensure that the new bytecode aligns with the intended functionality and has been tested.
v2/typechain-types/IGatewayEVM.sol/IGatewayEVMEvents.ts (5)
24-29
: New Type Definition:RevertOptionsStruct
.The introduction of
RevertOptionsStruct
enhances error handling. Ensure that this new type is utilized consistently across the codebase.
43-47
: New Type Definition:RevertContextStruct
.The addition of
RevertContextStruct
provides context for reverts. Verify its integration with existing logic.
Line range hint
277-288
:
Update Event Filter Signatures.The event filter signatures for
Call
andDeposit
now includerevertOptions
. Ensure that all event listeners are updated to handle this change.
70-72
: Update toCallEvent
InputTuple.The addition of
revertOptions
to theCallEvent
input tuple enhances event handling. Ensure that all event emissions are updated accordingly.Verification successful
Verification Successful:
CallEvent
emissions includerevertOptions
.The
revertOptions
parameter has been successfully integrated into theCallEvent
emissions across the relevant files. No further action is required.
- Files verified include:
v2/typechain-types/GatewayEVMUpgradeTest.ts
v2/typechain-types/GatewayEVMEchidnaTest.ts
v2/typechain-types/GatewayEVM.ts
v2/typechain-types/IGatewayEVM.sol/IGatewayEVMEvents.ts
v2/typechain-types/IGatewayEVM.sol/IGatewayEVM.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all `CallEvent` emissions include the new `revertOptions`. # Test: Search for `CallEvent` emissions and check for `revertOptions`. rg --type ts 'CallEvent'Length of output: 12950
Script:
#!/bin/bash # Description: Search for `CallEvent` emissions and check if they include `revertOptions`. # Search for `CallEvent` emissions and include a few lines of context to check for `revertOptions`. rg --type ts 'CallEvent' -A 5 | grep -i 'revertOptions'Length of output: 475
97-98
: Update toDepositEvent
InputTuple.The inclusion of
revertOptions
in theDepositEvent
input tuple improves event handling. Ensure that all event emissions reflect this change.v2/src/zevm/interfaces/IGatewayZEVM.sol (5)
15-18
: Update toCall
Event.The inclusion of
revertOptions
in theCall
event enhances its utility. Ensure that all event emissions and listeners are updated accordingly.
88-94
: Update towithdraw
Function Signature.The
withdraw
function now includesrevertOptions
. Verify that all function calls are updated to pass this new parameter.Verification successful
Verification Successful:
withdraw
Function Calls UpdatedThe
withdraw
function calls have been updated to include therevertOptions
parameter, as seen in the test files. This confirms that the necessary updates have been made to accommodate the new function signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all `withdraw` function calls include the new `revertOptions`. # Test: Search for `withdraw` function calls and check for `revertOptions`. rg --type sol 'withdraw'Length of output: 52
Script:
#!/bin/bash # Description: Verify that all `withdraw` function calls include the new `revertOptions`. # Test: Search for `withdraw` function calls in Solidity files and check for `revertOptions`. rg 'withdraw' --glob '*.sol' -A 2Length of output: 42243
143-149
: Update tocall
Function Signature.The
call
function now includesrevertOptions
. Verify that all function calls are updated to pass this new parameter.
114-121
: Update towithdrawAndCall
Function Signature.The
withdrawAndCall
function now requiresrevertOptions
. Ensure that all calls to this function are updated accordingly.Verification successful
All
withdrawAndCall
Calls Updated withrevertOptions
.The
withdrawAndCall
function calls within theIGatewayZEVM
contract have been updated to include therevertOptions
parameter as required. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all `withdrawAndCall` function calls include the new `revertOptions`. # Test: Search for `withdrawAndCall` function calls and check for `revertOptions`. rg --type sol 'withdrawAndCall'Length of output: 59
Script:
#!/bin/bash # Find all Solidity files and search for `withdrawAndCall` calls. fd -e sol -x rg 'withdrawAndCall' {}Length of output: 92706
Script:
#!/bin/bash # Find all Solidity files and search for `withdrawAndCall` calls specifically within the IGatewayZEVM contract. fd -e sol -x rg 'IGatewayZEVM.*withdrawAndCall' {}Length of output: 465
224-231
: Update todepositAndRevert
Function Signature.The
depositAndRevert
function now useszContext
. Verify that all function calls are updated to reflect this change.Verification successful
depositAndRevert
Function Calls Updated withzContext
.The
depositAndRevert
function calls across the codebase have been updated to includezContext
as a parameter. The search results confirm thatzContext
is consistently used in all relevant function calls.
- Instances of
depositAndRevert
in TypeScript and Go files includezContext
in their parameters.No further action is required.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all `depositAndRevert` function calls use `zContext`. # Test: Search for `depositAndRevert` function calls and check for `zContext`. rg --type sol 'depositAndRevert'Length of output: 60
Script:
#!/bin/bash # Find all Solidity files and search for `depositAndRevert` function calls. fd -e sol -x rg 'depositAndRevert' {}Length of output: 32058
Script:
#!/bin/bash # Extract lines around `depositAndRevert` calls to check for `zContext` usage. fd -e sol -e ts -e go -x rg -A 3 -B 3 'depositAndRevert' {}Length of output: 133664
v2/pkg/revert.sol/revertable.go (5)
32-37
: Introduction ofRevertContext
struct.The
RevertContext
struct provides a clear and structured way to handle revert-related data, enhancing type safety and readability. This is a positive change that improves the code's maintainability.
200-201
: UpdateOnRevert
function signature inRevertableSession
.This change mirrors the update in
RevertableTransactor
, ensuring consistency across sessions. Verify that session usage aligns with this change.
207-208
: UpdateOnRevert
function signature inRevertableTransactorSession
.This change ensures consistency across transactor sessions. Verify that transactor session usage aligns with this change.
41-41
: ABI update foronRevert
.The ABI string has been updated to reflect the new
RevertContext
struct. Ensure that all external systems interacting with this contract are aware of the ABI change.
193-194
: UpdateOnRevert
function signature inRevertableTransactor
.The function now takes a
RevertContext
instead of a byte array, improving type safety and clarity. Ensure that all calls to this function are updated to use the new parameter type.Verification successful
Verification Successful: All
OnRevert
function calls updatedAll instances of the
OnRevert
function in the codebase have been updated to use theRevertContext
parameter, as expected. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all calls to `OnRevert` use the new parameter type. # Test: Search for `OnRevert` function calls. Expect: Only occurrences with `RevertContext`. rg --type go 'OnRevert'Length of output: 268691
v2/typechain-types/IERC20Custody.sol/IERC20Custody.ts (6)
26-30
: Introduction ofRevertContextStruct
.The
RevertContextStruct
provides a clear and structured way to handle revert-related data in TypeScript, enhancing type safety and readability.
32-36
: Definition ofRevertContextStructOutput
.This output type provides a tuple representation of the
RevertContextStruct
, ensuring consistency in how revert context data is handled in outputs.
256-257
: UpdatewithdrawAndRevert
method signature.The method now requires a
RevertContextStruct
, aligning with the updated function signature. Ensure that all calls to this method are updated with the new parameter.Also applies to: 297-297
384-384
: Update event signature forWithdrawAndRevert
.The event now includes
revertContext
, enhancing the information available during event emissions. Ensure that event filters are updated to accommodate this change.
70-76
: UpdateencodeFunctionData
forwithdrawAndRevert
.The function now requires a
RevertContextStruct
, reflecting changes to handle additional context. Ensure that all calls to this method are updated with the new parameter.
166-181
: UpdateWithdrawAndRevertEvent
structure.The event now includes
revertContext
, enhancing the information available during event emissions. Ensure that event listeners are updated to handle this new structure.v2/typechain-types/factories/ZetaConnectorBase__factory.ts (2)
308-329
: Addition ofrevertContext
inwithdrawAndRevert
function inputs.The
revertContext
provides detailed context for revert scenarios, improving error handling. Ensure that all calls to this function are updated with the new parameter.
514-536
: Addition ofrevertContext
inWithdrawAndRevert
event inputs.The event now includes
revertContext
, enhancing the information available during event emissions. Ensure that event listeners are updated to handle this new structure.v2/typechain-types/ReceiverEVM.ts (4)
26-30
: IntroduceRevertContextStruct
for structured error handling.The new
RevertContextStruct
type provides a structured way to pass information about reverts, which enhances error handling and debugging capabilities.
32-36
: DefineRevertContextStructOutput
for output handling.The
RevertContextStructOutput
type mirrorsRevertContextStruct
for output scenarios, ensuring consistency in handling revert context data.
58-61
: UpdateencodeFunctionData
foronRevert
withRevertContextStruct
.The
encodeFunctionData
method now acceptsRevertContextStruct
, aligning with the new structured error handling approach.
197-207
: EnhanceReceivedRevertEvent
withRevertContextStruct
.The
ReceivedRevertEvent
now includesRevertContextStruct
, providing more detailed information during revert scenarios.v2/pkg/universalcontract.sol/universalcontract.go (5)
34-36
: RedefineRevertContext
struct for clarity.The
RevertContext
struct now includesAsset
,Amount
, andRevertMessage
, simplifying the representation of revert contexts.
48-48
: Update ABI metadata foronRevert
.The ABI metadata reflects the changes in the
RevertContext
structure, ensuring compatibility with the contract's interface.
218-222
: SimplifyOnRevert
function signature inUniversalContractTransactor
.The
OnRevert
function now takes a singleRevertContext
parameter, streamlining the function's interface and improving maintainability.
225-229
: SimplifyOnRevert
function signature inUniversalContractSession
.The function signature change mirrors the transactor, ensuring consistency across different contract sessions.
232-236
: SimplifyOnRevert
function signature inUniversalContractTransactorSession
.This change aligns with the overall refactoring effort, maintaining uniformity in how revert contexts are handled.
v2/test/ZetaConnectorNative.t.sol (4)
42-42
: AddrevertContext
state variable for structured revert handling.The
revertContext
variable is initialized insetUp
, providing a consistent structure for handling reverts in tests.
76-76
: InitializerevertContext
insetUp
.The initialization of
revertContext
ensures that revert scenarios are handled with detailed context, improving test reliability.
267-273
: Update event emissions to includerevertContext
.The use of
revertContext
in event emissions enhances the clarity and consistency of revert-related events, aiding in debugging and error tracking.
299-299
: IncluderevertContext
inwithdrawAndRevert
function call.The function signature now includes
revertContext
, aligning with the updated error handling strategy.v2/src/zevm/GatewayZEVM.sol (6)
170-184
: Verify the usage ofRevertOptions
.The addition of
RevertOptions
to thewithdraw
function for ZETA tokens enhances error handling. Ensure that all calls to this function are updated to include the new parameter.Verification successful
Verify the usage of
RevertOptions
in function calls.The search results indicate that the
withdraw
function with theRevertOptions
parameter is being called correctly in multiple places within the codebase. These calls are consistent with the updated function signature, ensuring that theRevertOptions
parameter is utilized as intended.
- Files with updated
withdraw
calls:
v2/test/GatewayZEVM.t.sol
v2/test/utils/SenderZEVM.sol
v2/scripts/localnet/ZevmWithdrawAndCall.s.sol
Please verify manually if necessary to ensure all calls are updated and functioning as expected.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `withdraw` for ZETA tokens match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type solidity -A 5 $'withdraw'Length of output: 67
Script:
#!/bin/bash # Description: Verify all function calls to `withdraw` for ZETA tokens match the new signature. # Test: Search for the function usage in Solidity files. Expect: Only occurrences of the new signature. rg 'withdraw' --glob '*.sol' -A 5Length of output: 70098
Line range hint
320-336
:
Verify the usage of the new context type.The context parameter type in
executeRevert
has been changed. Ensure that all calls to this function are updated to use the new context type.Verification successful
New context type usage verified successfully.
The
executeRevert
function calls in the test files correctly use thezContext
type for thecontext
parameter, indicating that the change has been properly integrated. No further action is required.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `executeRevert` match the new context type. # Test: Search for the function usage. Expect: Only occurrences of the new context type. rg --type solidity -A 5 $'executeRevert'Length of output: 72
Script:
#!/bin/bash # Description: Verify all function calls to `executeRevert` match the new context type. # Test: Search for the function usage. Expect: Only occurrences of the new context type. rg --glob '*.sol' -A 5 'executeRevert'Length of output: 6167
215-227
: Verify the usage ofRevertOptions
.The addition of
RevertOptions
to thecall
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.
Line range hint
345-363
:
Verify the usage of the new context type.The context parameter type in
depositAndRevert
has been changed. Ensure that all calls to this function are updated to use the new context type.Verification successful
Verification Successful: New Context Type Usage is Consistent
The
depositAndRevert
function has been updated to use the new context typezContext
orZContextStruct
across the codebase. All instances reflect this change, ensuring consistency. No outdated usage of the old context type was found.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `depositAndRevert` match the new context type. # Test: Search for the function usage. Expect: Only occurrences of the new context type. rg --type solidity -A 5 $'depositAndRevert'Length of output: 75
Script:
#!/bin/bash # Description: Verify all function calls to `depositAndRevert` in the Solidity codebase. # Test: Search for the function usage across all files. Expect: Only occurrences of the new context type. rg 'depositAndRevert' -A 5Length of output: 72644
121-137
: Verify the usage ofRevertOptions
.The addition of
RevertOptions
to thewithdraw
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.
Line range hint
192-208
:
Verify the usage ofRevertOptions
.The addition of
RevertOptions
to thewithdrawAndCall
function for ZETA tokens enhances error handling. Ensure that all calls to this function are updated to include the new parameter.Verification successful
All calls to
withdrawAndCall
includeRevertOptions
.The search results confirm that the
withdrawAndCall
function is consistently called with theRevertOptions
parameter across the codebase. This suggests that the function's new signature has been correctly adopted in all relevant places.
- Calls to
withdrawAndCall
withRevertOptions
were found in various Solidity files, confirming the update.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `withdrawAndCall` for ZETA tokens match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type solidity -A 5 $'withdrawAndCall'Length of output: 74
Script:
#!/bin/bash # Description: Find Solidity files and search for calls to `withdrawAndCall`. # Find all Solidity files and search for the function usage. fd --extension sol --exec rg 'withdrawAndCall' {}Length of output: 92719
Script:
#!/bin/bash # Description: Refine search to focus on Solidity files and verify the usage of `withdrawAndCall` with `RevertOptions`. # Find all Solidity files and search for the specific function signature usage. fd --extension sol --exec rg 'withdrawAndCall\(.*revertOptions' {}Length of output: 3419
v2/typechain-types/factories/IGatewayEVM.sol/IGatewayEVM__factory.ts (6)
27-55
: Verify the usage ofrevertOptions
.The addition of
revertOptions
to thecall
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.Verification successful
Verify the usage of
revertOptions
.The
call
function is consistently used with therevertOptions
parameter across the codebase. Ensure that all instances are correctly updated to include this parameter, as seen in the following files:
v2/test/GatewayZEVM.t.sol
v2/test/GatewayEVMZEVM.t.sol
v2/test/GatewayEVM.t.sol
v2/test/utils/SenderZEVM.sol
v2/scripts/localnet/ZevmCall.s.sol
v2/scripts/localnet/EvmCall.s.sol
These instances confirm that the new parameter is being utilized correctly. However, further manual verification might be necessary to ensure all edge cases are covered.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `call` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type typescript -A 5 $'call'Length of output: 67
Script:
#!/bin/bash # Description: Search for the `call` function usage across the codebase. # Search for the `call` function usage and include surrounding lines for context. rg 'call\(' -A 5Length of output: 19918
285-306
: Verify the usage ofrevertContext
.The addition of
revertContext
to theexecuteRevert
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.Verification successful
The
revertContext
parameter is correctly integrated.The
executeRevert
function is consistently defined and used with therevertContext
parameter across the codebase, including in files such asGatewayEVM.ts
,GatewayEVMUpgradeTest.ts
, andGatewayEVMEchidnaTest.ts
. This confirms that all calls to this function have been updated to include the new parameter.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `executeRevert` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type typescript -A 5 $'executeRevert'Length of output: 76
Script:
#!/bin/bash # Description: Verify all function calls to `executeRevert` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type ts -A 5 $'executeRevert'Length of output: 15959
117-141
: Verify the usage ofrevertOptions
.The addition of
revertOptions
to the payabledeposit
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.
76-102
: Verify the usage ofrevertOptions
.The addition of
revertOptions
to thedeposit
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.Verification successful
Verification Successful:
revertOptions
Parameter Usage indeposit
FunctionThe updated
deposit
function signature with therevertOptions
parameter is present in the codebase, indicating that the integration has been made. Ensure that all relevant function calls are updated to use this new signature where applicable.
- Confirmed occurrences in
v2/typechain-types/GatewayEVM.ts
and related files.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `deposit` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type typescript -A 5 $'deposit'Length of output: 70
Script:
#!/bin/bash # Description: Verify all function calls to `deposit` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type ts -A 5 $'deposit'Length of output: 163777
363-384
: Verify the usage ofrevertContext
.The addition of
revertContext
to therevertWithERC20
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.
171-197
: Verify the usage ofrevertOptions
.The addition of
revertOptions
to thedepositAndCall
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.v2/src/evm/GatewayEVM.sol (5)
305-316
: Verify the usage ofRevertOptions
.The addition of
RevertOptions
to thecall
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.Verification successful
RevertOptions usage in
call
function is correctly implemented.The
call
function with theRevertOptions
parameter is used correctly across the codebase, including in test files, ensuring the new signature is properly integrated and tested.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `call` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type solidity -A 5 $'call'Length of output: 63
Script:
#!/bin/bash # Description: Verify all function calls to `call` match the new signature. # Test: Search for the function usage within Solidity files. Expect: Only occurrences of the new signature. rg 'call\(' --glob '*.sol' -A 5Length of output: 5243
Line range hint
186-205
:
Verify the usage ofrevertContext
.The addition of
revertContext
to therevertWithERC20
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.Verification successful
All calls to
revertWithERC20
are correctly updated withrevertContext
. The function is consistently used with the new parameter across the codebase, ensuring enhanced error handling as intended.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `revertWithERC20` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type solidity -A 5 $'revertWithERC20'Length of output: 74
Script:
#!/bin/bash # Description: Search for all occurrences of `revertWithERC20` in Solidity files to verify the new function signature. # Find all `.sol` files and search for `revertWithERC20` within them. fd --extension sol --exec rg 'revertWithERC20' {}Length of output: 66551
256-274
: Review low-level call indepositAndCall
.The function uses a low-level call to
tssAddress
. Ensure that this call is safe and consider using a higher-level abstraction if possible.Consider using
Address.sendValue
from OpenZeppelin'sAddress
library for safer ETH transfers.- (bool deposited,) = tssAddress.call{ value: msg.value }(""); + Address.sendValue(payable(tssAddress), msg.value);Verify the usage of
RevertOptions
.The addition of
RevertOptions
to thedepositAndCall
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.Verification successful
Function calls to
depositAndCall
have been updated.The
depositAndCall
function is used with the newRevertOptions
parameter in the test files, confirming that the codebase has been updated to match the new signature.
- Instances in
v2/test/GatewayEVM.t.sol
demonstrate the usage of the new signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `depositAndCall` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type solidity -A 5 $'depositAndCall'Length of output: 73
Script:
#!/bin/bash # Description: Verify all function calls to `depositAndCall` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --glob '*.sol' -A 5 'depositAndCall'Length of output: 14743
210-227
: Review low-level call indeposit
.The function uses a low-level call to
tssAddress
. Ensure that this call is safe and consider using a higher-level abstraction if possible.Consider using
Address.sendValue
from OpenZeppelin'sAddress
library for safer ETH transfers.- (bool deposited,) = tssAddress.call{ value: msg.value }(""); + Address.sendValue(payable(tssAddress), msg.value);Verify the usage of
RevertOptions
.The addition of
RevertOptions
to thedeposit
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.Verification successful
All
deposit
function calls includeRevertOptions
.The
deposit
function inGatewayEVM.sol
is correctly using theRevertOptions
parameter in all relevant instances, including interfaces and test files. This indicates that the function's signature has been consistently updated across the codebase.
v2/src/evm/interfaces/IGatewayEVM.sol
: Function signatures includeRevertOptions
.v2/src/evm/GatewayEVM.sol
: Function implementation includesRevertOptions
.v2/test/utils/GatewayEVMUpgradeTest.sol
: Test cases includeRevertOptions
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `deposit` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type solidity -A 5 $'deposit'Length of output: 66
Script:
#!/bin/bash # Description: Verify all function calls to `deposit` match the new signature. # Test: Search for the function usage in Solidity files. Expect: Only occurrences of the new signature. rg --glob '*.sol' -A 5 $'deposit'Length of output: 50927
Script:
#!/bin/bash # Description: Verify if all calls to `deposit` in GatewayEVM.sol use the new signature with `RevertOptions`. # Test: Search for the specific signature of the `deposit` function with `RevertOptions`. rg --glob '*.sol' -A 3 'deposit(' | grep 'RevertOptions'Length of output: 123
Script:
#!/bin/bash # Description: Verify if all calls to `deposit` in GatewayEVM.sol use the new signature with `RevertOptions`. # Test: Search for the specific signature of the `deposit` function with `RevertOptions`. rg --glob '*.sol' -A 3 'deposit\(' | grep 'RevertOptions'Length of output: 502
Line range hint
101-115
:
Verify the usage ofrevertContext
.The addition of
revertContext
to theexecuteRevert
function enhances error handling. Ensure that all calls to this function are updated to include the new parameter.Verification successful
All
executeRevert
calls are correctly updated withrevertContext
.The search results confirm that all instances of the
executeRevert
function in the codebase have been updated to include therevertContext
parameter. This ensures that the function's new signature is consistently used throughout the codebase.
- Files and Locations:
v2/src/evm/GatewayEVM.sol
v2/src/evm/interfaces/IGatewayEVM.sol
- Various test files and typechain-generated files also reflect the updated signature.
No further manual verification is required.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `executeRevert` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type solidity -A 5 $'executeRevert'Length of output: 72
Script:
#!/bin/bash # Description: Verify all function calls to `executeRevert` match the new signature. # Test: Search for the function usage without specifying file type. rg -A 5 'executeRevert'Length of output: 266519
v2/typechain-types/factories/ReceiverEVM__factory.ts (2)
28-47
: Enhance error handling withRevertContext
.The introduction of the
RevertContext
tuple in theonRevert
function's ABI enhances error handling by providing detailed context during reverts. This change improves the granularity of information available, aiding in debugging and state management.
275-295
: Update event structure forReceivedRevert
.The
ReceivedRevert
event now includes theRevertContext
tuple, providing more comprehensive information when a revert occurs. This change aligns with the improved error handling strategy and enhances transparency in transaction logging.v2/test/utils/GatewayEVMUpgradeTest.sol (10)
4-4
: ImportRevertContext
andRevertOptions
for enhanced error handling.The addition of these imports from
Revert.sol
indicates a shift towards more structured error handling within the contract, allowing for better management of transaction failures.
57-71
: Improve initialization with descriptive parameter names.The
initialize
function now uses more descriptive parameter names, enhancing code readability. The addition of zero address checks strengthens the contract's robustness against invalid inputs.
103-119
: EnhanceexecuteRevert
function withRevertContext
.The
executeRevert
function now includes aRevertContext
parameter, allowing for more nuanced handling of revert scenarios. This change improves the function's ability to manage errors effectively.
214-231
: AddRevertOptions
todeposit
function for improved error handling.The
deposit
function now includesRevertOptions
, allowing for more flexible management of potential errors during deposits. This change enhances the function's robustness and transparency.
238-254
: IntegrateRevertOptions
into ERC20deposit
function.The ERC20
deposit
function now incorporatesRevertOptions
, aligning with the enhanced error handling strategy across the contract. This addition improves the function's ability to manage transaction failures.
260-278
: IncludeRevertOptions
indepositAndCall
for better error management.The
depositAndCall
function now acceptsRevertOptions
, providing more control over error handling during complex transactions. This change supports the contract's improved error management capabilities.
286-303
: Enhance ERC20depositAndCall
withRevertOptions
.The ERC20 version of
depositAndCall
now includesRevertOptions
, enhancing error handling and aligning with the contract's overall improvements in managing transaction failures.
309-320
: AddRevertOptions
tocall
function for improved control.The
call
function now includesRevertOptions
, allowing for more detailed management of potential errors during contract calls. This change enhances the function's robustness and flexibility.
324-330
: RefactorsetCustody
with improved parameter naming.The
setCustody
function now uses a more descriptive parameter name,custody_
, improving code readability. The additional check for zero addresses strengthens the function's robustness.
334-340
: RefactorsetConnector
with improved parameter naming.The
setConnector
function now uses a more descriptive parameter name,zetaConnector_
, enhancing code clarity. The added zero address check improves the function's robustness.v2/typechain-types/index.ts (2)
22-23
: AddrevertSol
import for expanded type definitions.The addition of the
revertSol
import integrates types fromRevert.sol
, expanding the available type definitions and improving modularity.
196-197
: ShiftRevertable
type source toRevert.sol
.The
Revertable
type and its factory are now sourced fromRevert.sol
, reflecting a reorganization that enhances modularity and clarity in type management.v2/typechain-types/IGatewayEVM.sol/IGatewayEVM.ts (12)
26-31
: IntroduceRevertOptionsStruct
for enhanced error handling.The
RevertOptionsStruct
type is a well-structured addition that enhances the contract's ability to handle revert scenarios more explicitly. This change improves the robustness of the contract's operations.
33-43
: DefineRevertOptionsStructOutput
for consistent output handling.The
RevertOptionsStructOutput
type ensures that the output of functions usingRevertOptionsStruct
is consistently structured, aiding in clarity and maintainability.
45-49
: IntroduceRevertContextStruct
for contextual revert information.The
RevertContextStruct
provides additional context for revert scenarios, which can be useful for debugging and handling complex transactions.
61-64
: Update function signatures to includeRevertOptionsStruct
.The inclusion of
RevertOptionsStruct
in function signatures likedeposit
anddepositAndCall
enhances the flexibility and control over transaction reverts.
82-104
: ModifyencodeFunctionData
to supportRevertOptionsStruct
.The
encodeFunctionData
method updates reflect the changes in function signatures, ensuring that the encoding process accommodates the newRevertOptionsStruct
.
112-126
: UpdateencodeFunctionData
forexecuteRevert
withRevertContextStruct
.The
executeRevert
function now includesRevertContextStruct
, providing additional context during reverts.
165-178
: EnhanceCallEvent
withRevertOptionsStruct
.The
CallEvent
now includesRevertOptionsStruct
, allowing emitted events to carry revert-related information, which aids in tracking and handling errors.
192-209
: EnhanceDepositEvent
withRevertOptionsStruct
.The
DepositEvent
now includesRevertOptionsStruct
, improving the ability to log and manage revert scenarios during deposit operations.
263-280
: EnhanceRevertedEvent
withRevertContextStruct
.The
RevertedEvent
now includesRevertContextStruct
, providing detailed information about the context of a revert, which is beneficial for debugging and auditing.
387-391
: Replacevoid
withundefined
in return types.The use of
void
in return types is flagged as confusing. Consider replacingvoid
withundefined
for clarity and to align with TypeScript best practices.Also applies to: 412-413
426-430
: Replacevoid
withundefined
in return types.The use of
void
in return types is flagged as confusing. Consider replacingvoid
withundefined
for clarity and to align with TypeScript best practices.Also applies to: 435-442, 447-448, 454-461, 466-473
Line range hint
558-569
: Update event filters to includeRevertOptionsStruct
.The event filters for
Call
andDeposit
now includeRevertOptionsStruct
, ensuring that the filtering process accounts for the new revert-related data.Also applies to: 602-603
v2/typechain-types/IGatewayZEVM.sol/IGatewayZEVM.ts (11)
26-31
: IntroduceRevertOptionsStruct
for enhanced error handling.The
RevertOptionsStruct
type is a well-structured addition that enhances the contract's ability to handle revert scenarios more explicitly. This change improves the robustness of the contract's operations.
33-43
: DefineRevertOptionsStructOutput
for consistent output handling.The
RevertOptionsStructOutput
type ensures that the output of functions usingRevertOptionsStruct
is consistently structured, aiding in clarity and maintainability.
58-60
: IntroduceRevertContextStruct
for contextual revert information.The
RevertContextStruct
provides additional context for revert scenarios, which can be useful for debugging and handling complex transactions.
79-82
: Update function signatures to includeRevertOptionsStruct
.The inclusion of
RevertOptionsStruct
in function signatures likewithdraw
andwithdrawAndCall
enhances the flexibility and control over transaction reverts.
Line range hint
89-155
: ModifyencodeFunctionData
to supportRevertOptionsStruct
.The
encodeFunctionData
method updates reflect the changes in function signatures, ensuring that the encoding process accommodates the newRevertOptionsStruct
.
178-190
: UpdatedecodeFunctionResult
for consistency with new signatures.The
decodeFunctionResult
methods have been updated to reflect the new function signatures, ensuring consistency in decoding function results.
200-215
: EnhanceCallEvent
withRevertOptionsStruct
.The
CallEvent
now includesRevertOptionsStruct
, allowing emitted events to carry revert-related information, which aids in tracking and handling errors.
Line range hint
232-255
: EnhanceWithdrawalEvent
withRevertOptionsStruct
.The
WithdrawalEvent
now includesRevertOptionsStruct
, improving the ability to log and manage revert scenarios during withdrawal operations.
373-378
: Replacevoid
withundefined
in return types.The use of
void
in return types is flagged as confusing. Consider replacingvoid
withundefined
for clarity and to align with TypeScript best practices.Also applies to: 509-514
437-442
: Replacevoid
withundefined
in return types.The use of
void
in return types is flagged as confusing. Consider replacingvoid
withundefined
for clarity and to align with TypeScript best practices.Also applies to: 482-487, 520-527, 532-539, 544-551, 557-564
Line range hint
586-597
: Update event filters to includeRevertOptionsStruct
.The event filters for
Call
andWithdrawal
now includeRevertOptionsStruct
, ensuring that the filtering process accounts for the new revert-related data.v2/test/GatewayEVM.t.sol (12)
37-38
: IntroduceRevertOptions
andRevertContext
for enhanced testing.The addition of
RevertOptions
andRevertContext
variables in the test contract allows for testing scenarios involving revert options, enhancing the robustness of the test suite.
79-79
: InitializeRevertContext
for testing revert scenarios.The
RevertContext
is initialized with mock data, providing a basis for testing revert-related functionality.
240-240
: TestrevertWithERC20
withRevertContext
.The test for
revertWithERC20
now includesrevertContext
, ensuring that the function's behavior is correctly validated under revert conditions.
251-255
: TestexecuteRevert
withRevertContext
.The test for
executeRevert
now includesrevertContext
, validating that the function correctly handles revert scenarios.
268-268
: TestexecuteRevert
failure scenarios.The tests for
executeRevert
now include scenarios where the sender is not authorized or the receiver is a zero address, ensuring comprehensive coverage of potential errors.Also applies to: 277-277
293-293
: IntroduceRevertOptions
for enhanced testing inGatewayEVMInboundTest
.The addition of
RevertOptions
allows for testing scenarios involving revert options, enhancing the robustness of the test suite.
326-331
: InitializeRevertOptions
with mock data.The
RevertOptions
are initialized with mock data, providing a basis for testing revert-related functionality.
342-343
: EmitDeposit
event withRevertOptions
.The
Deposit
event now includesrevertOptions
, ensuring that the event accurately reflects the transaction's revert conditions.Also applies to: 368-369, 395-396, 473-474
426-426
: EmitDeposit
event with payload andRevertOptions
.The
Deposit
event now includes a payload andrevertOptions
, ensuring that the event accurately reflects the transaction's conditions.Also applies to: 439-440
455-455
: Test failure scenarios fordepositAndCall
.The tests for
depositAndCall
now include scenarios where the amount is zero or the receiver is a zero address, ensuring comprehensive coverage of potential errors.Also applies to: 464-464, 485-485, 493-493
500-501
: EmitCall
event withRevertOptions
.The
Call
event now includesrevertOptions
, ensuring that the event accurately reflects the transaction's revert conditions.
508-508
: Test failure scenario forcall
.The test for
call
now includes a scenario where the destination is a zero address, ensuring comprehensive coverage of potential errors.v2/typechain-types/ZetaConnectorBase.ts (5)
26-30
: New Type Definition:RevertContextStruct
.The introduction of
RevertContextStruct
is a positive addition for handling revert scenarios, encapsulatingasset
,amount
, andrevertMessage
. Ensure consistency in how these fields are used across the codebase.
32-36
: New Type Definition:RevertContextStructOutput
.The corresponding output type
RevertContextStructOutput
correctly mirrors the structure ofRevertContextStruct
for output purposes. This ensures type safety and clarity in handling revert contexts.
304-317
: Update Event Tuples:WithdrawAndRevertEvent
.Including
revertContext
in theInputTuple
andOutputTuple
ofWithdrawAndRevertEvent
improves event logging and debugging capabilities. Ensure that event emissions are updated accordingly in the implementation.
444-445
: Update Method Signature:withdrawAndRevert
.The method signature now includes
revertContext
, aligning with the enhanced error handling strategy. Check that all invocations of this method are updated to include the new parameter.Verification successful
No Invocations Found for
withdrawAndRevert
MethodThe search did not find any invocations of the
withdrawAndRevert
method in the codebase. This suggests that the method is not currently used, or it might be a new addition awaiting integration. Ensure that any future uses of this method include therevertContext
parameter as per the updated method signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify method invocations of `withdrawAndRevert` with the new parameter. rg --type typescript -A 5 $'withdrawAndRevert'Length of output: 80
Script:
#!/bin/bash # Re-run the search for method invocations of `withdrawAndRevert` using the correct file type for TypeScript. rg --type ts -A 5 $'withdrawAndRevert'Length of output: 15129
Script:
#!/bin/bash # Search for actual function calls to `withdrawAndRevert` to verify if the `revertContext` parameter is included. rg --type ts 'withdrawAndRevert\(' -A 3Length of output: 41
Script:
#!/bin/bash # Broaden the search for function calls to `withdrawAndRevert` to ensure no invocations are missed. rg --type ts 'withdrawAndRevert\(' -A 10Length of output: 42
129-135
: Update Function Signature:encodeFunctionData
forwithdrawAndRevert
.The addition of
RevertContextStruct
to thewithdrawAndRevert
function signature enhances error handling by providing detailed context. Verify that all calls to this function are updated to match the new signature.v2/typechain-types/ZetaConnectorNative.ts (5)
26-30
: New Type Definition:RevertContextStruct
.The introduction of
RevertContextStruct
is consistent with the previous file, providing a structured way to handle revert scenarios. Ensure its usage is consistent across the codebase.
32-36
: New Type Definition:RevertContextStructOutput
.The output type
RevertContextStructOutput
mirrors the input structure, ensuring consistency and type safety in handling revert contexts.
304-317
: Update Event Tuples:WithdrawAndRevertEvent
.Including
revertContext
in theInputTuple
andOutputTuple
ofWithdrawAndRevertEvent
enhances event logging. Ensure that event emissions are updated accordingly in the implementation.
444-445
: Update Method Signature:withdrawAndRevert
.The method signature now includes
revertContext
, aligning with the enhanced error handling strategy. Check that all invocations of this method are updated to include the new parameter.
129-135
: Update Function Signature:encodeFunctionData
forwithdrawAndRevert
.Adding
RevertContextStruct
to thewithdrawAndRevert
function signature enhances error handling. Verify that all calls to this function are updated to match the new signature.v2/test/ERC20Custody.t.sol (5)
36-36
: New State Variable:revertContext
.The addition of
revertContext
as a state variable allows for better error handling and context management during tests. Ensure this variable is correctly initialized and used in all relevant test cases.
78-78
: Initialization ofrevertContext
.The
revertContext
is initialized with default values. Ensure these values are appropriate for the test scenarios and adjust if necessary.
374-374
: Update Function Call:withdrawAndRevert
.The
withdrawAndRevert
function call now includesrevertContext
, aligning with the enhanced error handling. Ensure all test cases using this function are updated accordingly.
423-429
: Update Event Emissions:The events
ReceivedRevert
,Reverted
, andWithdrawAndRevert
now includerevertContext
. This provides better traceability and context in test scenarios. Verify that the emitted values are correctly asserted in the tests.
Line range hint
454-472
: Test Cases forwithdrawAndRevert
.The test cases for
withdrawAndRevert
are updated to includerevertContext
. Ensure that these tests cover all edge cases and scenarios relevant to the new context handling.v2/typechain-types/ZetaConnectorNonNative.ts (5)
26-30
: DefineRevertContextStruct
Type.The
RevertContextStruct
type is well-defined with propertiesasset
,amount
, andrevertMessage
. This structure is crucial for passing detailed context in case of transaction reverts.
32-36
: DefineRevertContextStructOutput
Type.The
RevertContextStructOutput
type mirrors the input structure but specifies output types, ensuring consistency in handling revert contexts.
137-143
: UpdatewithdrawAndRevert
Function Signature.The addition of
RevertContextStruct
to thewithdrawAndRevert
function signature enhances error handling by providing detailed context in case of reverts.
329-342
: ModifyWithdrawAndRevertEvent
Structure.The inclusion of
revertContext
in both input and output tuples of theWithdrawAndRevertEvent
allows for more comprehensive event data, facilitating better debugging and state tracking.
Line range hint
746-751
: Update Event Declaration forWithdrawAndRevert
.The event signature now includes a tuple for
revertContext
, aligning with the updated function and event structures. This change ensures consistency across the contract's interface.v2/typechain-types/ERC20Custody.ts (5)
26-30
: DefineRevertContextStruct
Type.The
RevertContextStruct
is correctly defined withasset
,amount
, andrevertMessage
properties, providing detailed context for transaction reverts.
32-36
: DefineRevertContextStructOutput
Type.The
RevertContextStructOutput
type ensures the output format is consistent with the input structure, aiding in uniform handling of revert contexts.
143-149
: UpdatewithdrawAndRevert
Function Signature.Including
RevertContextStruct
in thewithdrawAndRevert
function signature enhances error handling capabilities by providing additional context.
361-376
: ModifyWithdrawAndRevertEvent
Structure.The addition of
revertContext
to both input and output tuples of theWithdrawAndRevertEvent
allows for detailed event data, improving debugging and state management.
Line range hint
785-790
: Update Event Declaration forWithdrawAndRevert
.The event signature now includes
revertContext
as a tuple, ensuring consistency with updated function and event structures.v2/typechain-types/ERC20CustodyEchidnaTest.ts (5)
26-30
: DefineRevertContextStruct
Type.The
RevertContextStruct
is well-defined withasset
,amount
, andrevertMessage
properties, providing essential context for transaction reverts.
32-36
: DefineRevertContextStructOutput
Type.The
RevertContextStructOutput
type mirrors the input structure, ensuring consistency in handling revert contexts.
155-161
: UpdatewithdrawAndRevert
Function Signature.The addition of
RevertContextStruct
to thewithdrawAndRevert
function signature enhances the function's ability to handle errors with detailed context.
382-397
: ModifyWithdrawAndRevertEvent
Structure.The inclusion of
revertContext
in both input and output tuples of theWithdrawAndRevertEvent
provides comprehensive event data, aiding in debugging and state management.
Line range hint
829-834
: Update Event Declaration forWithdrawAndRevert
.The event signature now includes
revertContext
as a tuple, aligning with the updated function and event structures for consistency.v2/pkg/izetaconnector.sol/izetaconnectorevents.go (4)
32-37
: New Struct:RevertContext
The
RevertContext
struct is well-defined with appropriate fields to capture the asset, amount, and revert message. Ensure this struct is correctly utilized in all relevant parts of the codebase.
550-554
: Updated Struct:IZetaConnectorEventsWithdrawAndRevert
The
RevertContext
field is correctly added to theIZetaConnectorEventsWithdrawAndRevert
struct, enhancing the event's data. Confirm that all event consumers handle this additional context.
Line range hint
557-572
: Event Handling UpdatesThe functions
FilterWithdrawAndRevert
,WatchWithdrawAndRevert
, andParseWithdrawAndRevert
are updated to accommodate the newrevertContext
parameter. Ensure that these functions are tested and that their usage aligns with the updated event signature.Also applies to: 574-612, 616-629
41-41
: Updated ABI StringThe ABI string now includes the
revertContext
as a tuple in theWithdrawAndRevert
event. Verify that all consumers of this ABI are updated to handle the new structure.Verification successful
No External Consumers Found for Updated ABI
The
IZetaConnectorEventsMetaData
is only referenced within its defining file and does not appear to have external consumers in the codebase. Therefore, no updates are necessary for handling the newrevertContext
structure in external consumers.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all usages of the updated ABI string. # Test: Search for the usage of `IZetaConnectorEventsMetaData` to ensure consumers are updated. rg --type go 'IZetaConnectorEventsMetaData'Length of output: 623
Script:
#!/bin/bash # Description: Search for all references to `IZetaConnectorEventsMetaData` in the codebase to check for consumer updates. rg 'IZetaConnectorEventsMetaData'Length of output: 613
v2/typechain-types/factories/ZetaConnectorNonNative__factory.ts (2)
371-392
: Updated Function and Event:withdrawAndRevert
The
withdrawAndRevert
function and corresponding event now include therevertContext
parameter. Ensure that all interactions with this function and event are updated to handle the new parameter.Also applies to: 590-612
665-665
: Significant Bytecode UpdateThe
_bytecode
constant has been completely replaced, indicating a substantial change in the contract's logic. Verify that all dependent systems are aware of and compatible with these changes.v2/typechain-types/factories/ZetaConnectorNative__factory.ts (2)
345-366
: Updated Function and Event:withdrawAndRevert
The
withdrawAndRevert
function and corresponding event now include therevertContext
parameter. Ensure that all interactions with this function and event are updated to handle the new parameter.Also applies to: 551-573
659-659
: Significant Bytecode UpdateThe
_bytecode
constant has been completely replaced, indicating a substantial change in the contract's logic. Verify that all dependent systems are aware of and compatible with these changes.v2/typechain-types/factories/ERC20Custody__factory.ts (2)
369-390
: Enhancement: Addition ofrevertContext
structure is approved.The
revertContext
structure provides additional context during reverts, enhancing error handling capabilities.Also applies to: 606-628
719-719
: Verify the impact of the bytecode update.The complete replacement of the
_bytecode
constant suggests a major update to the contract. Ensure that the new bytecode reflects the intended functionality and security enhancements.v2/typechain-types/GatewayZEVM.ts (2)
26-31
: Enhancement: Addition ofRevertOptionsStruct
is approved.The
RevertOptionsStruct
provides a structured way to handle revert options, improving error handling.Also applies to: 33-43
95-98
: Enhancement: Method signature updates to includeRevertOptionsStruct
are approved.The inclusion of
RevertOptionsStruct
in method signatures ensures consistent handling of revert options.Also applies to: 213-238, 305-317, 678-718
v2/pkg/testuniversalcontract.sol/testuniversalcontract.go (2)
34-36
: Enhancement:RevertContext
struct changes are approved.The updated
RevertContext
struct consolidates relevant fields, enhancing clarity and usability.
240-244
: Enhancement:OnRevert
function signature updates are approved.The updated
OnRevert
function signatures streamline context management by using the newRevertContext
structure.Also applies to: 247-251, 254-258
v2/typechain-types/GatewayEVM.ts (9)
26-31
: RevertOptionsStruct definition is appropriate.The structure is well-defined and aligns with the intended functionality for handling transaction reverts.
45-49
: RevertContextStruct definition is appropriate.This structure is well-defined for providing context during a transaction revert.
325-338
: Event updates are consistent with method signature changes.The inclusion of
RevertOptionsStruct
in events aligns with the updated method signatures and enhances functionality.
447-464
: Event updates are consistent with method signature changes.The inclusion of
RevertContextStruct
in events aligns with the updated method signatures and enhances functionality.
194-200
: Replacevoid
withundefined
in parameter lists.The use of
void
in parameter lists is confusing outside of return types. Replace it withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
151-152
: Replacevoid
withundefined
in parameter lists.The use of
void
in parameter lists is confusing outside of return types. Replace it withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
160-161
: Replacevoid
withundefined
in parameter lists.The use of
void
in parameter lists is confusing outside of return types. Replace it withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
137-138
: Replacevoid
withundefined
in parameter lists.The use of
void
in parameter lists is confusing outside of return types. Replace it withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
141-148
: Replacevoid
withundefined
in parameter lists.The use of
void
in parameter lists is confusing outside of return types. Replace it withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
v2/typechain-types/GatewayEVMUpgradeTest.ts (9)
26-31
: RevertOptionsStruct definition is appropriate.The structure is well-defined and aligns with the intended functionality for handling transaction reverts.
45-49
: RevertContextStruct definition is appropriate.This structure is well-defined for providing context during a transaction revert.
326-339
: Event updates are consistent with method signature changes.The inclusion of
RevertOptionsStruct
in events aligns with the updated method signatures and enhances functionality.
466-483
: Event updates are consistent with method signature changes.The inclusion of
RevertContextStruct
in events aligns with the updated method signatures and enhances functionality.
152-153
: Replacevoid
withundefined
in parameter lists.The use of
void
in parameter lists is confusing outside of return types. Replace it withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
138-139
: Replacevoid
withundefined
in parameter lists.The use of
void
in parameter lists is confusing outside of return types. Replace it withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
195-201
: Replacevoid
withundefined
in parameter lists.The use of
void
in parameter lists is confusing outside of return types. Replace it withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
161-161
: Replacevoid
withundefined
in parameter lists.The use of
void
in parameter lists is confusing outside of return types. Replace it withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
142-149
: Replacevoid
withundefined
in parameter lists.The use of
void
in parameter lists is confusing outside of return types. Replace it withundefined
to align with TypeScript best practices.- [void], + [undefined],Likely invalid or redundant comment.
v2/typechain-types/GatewayEVMEchidnaTest.ts (6)
26-43
: RevertOptionsStruct and RevertOptionsStructOutput look good!The introduction of these types enhances error handling and state management. The structure is clear and well-defined.
45-55
: RevertContextStruct and RevertContextStructOutput look good!These types provide valuable context for handling reverts, and their structure is clear and appropriate.
132-155
: Function signature updates in GatewayEVMEchidnaTestInterface look good!The inclusion of
RevertOptionsStruct
in function signatures enhances error handling. The changes are consistent and well-integrated.
Line range hint
346-374
: Event definition updates in GatewayEVMEchidnaTestInterface look good!Including
revertOptions
in event definitions enhances the information available for event handling. The changes are well-structured.
Line range hint
629-692
: TypedContractMethod updates look good, but addressvoid
usage.The updates to include
RevertOptionsStruct
andRevertContextStruct
enhance error handling. However, consider replacingvoid
withundefined
for clarity.- [void], + [undefined],Tools
Biome
[error] 634-634: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 647-647: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 653-653: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 665-665: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[error] 675-675: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
Line range hint
1092-1158
: TypedContractEvent updates look good!The inclusion of
revertOptions
in event definitions provides more detailed information for event handling. The changes are well-structured and beneficial.v2/pkg/ireceiverevm.sol/ireceiverevmevents.go (5)
32-37
: RevertContext struct definition is well-designed.The
RevertContext
struct encapsulates relevant information for revert scenarios effectively.
805-807
: ReceivedRevert event modification enhances semantic richness.Replacing raw bytes with
RevertContext
provides more detailed information about reverts.
810-815
: FilterReceivedRevert function correctly updated.The function now handles the new
ReceivedRevert
event structure.
822-827
: WatchReceivedRevert function correctly updated.The function now watches logs for the new
ReceivedRevert
event structure.
859-864
: ParseReceivedRevert function correctly updated.The function now parses logs for the new
ReceivedRevert
event structure.v2/test/GatewayZEVM.t.sol (11)
67-72
: revertOptions initialization is appropriate.The
revertOptions
variable is initialized with suitable values for testing.
80-83
: testWithdrawZRC20 function correctly integrates revertOptions.The test verifies the expected behavior with
revertOptions
.
98-98
: testWithdrawZRC20FailsIfNoBalanceForGasFee function correctly integrates revertOptions.The test verifies the expected failure scenario with
revertOptions
.
107-107
: testWithdrawZRC20FailsIfNoBalanceForTransfer function correctly integrates revertOptions.The test verifies the expected failure scenario with
revertOptions
.
112-112
: testWithdrawZRC20FailsIsAmountIs0 function correctly integrates revertOptions.The test verifies the expected failure scenario with
revertOptions
.
117-117
: testWithdrawZRC20FailsIfReceiverIsZeroAddress function correctly integrates revertOptions.The test verifies the expected failure scenario with
revertOptions
.
129-129
: testWithdrawZRC20FailsIfNoAllowance function correctly integrates revertOptions.The test verifies the expected failure scenario with
revertOptions
.
139-139
: testWithdrawAndCallZRC20FailsIfReceiverIsZeroAddress function correctly integrates revertOptions.The test verifies the expected failure scenario with
revertOptions
.
145-145
: testWithdrawAndCallZRC20FailsIfAmountIsZero function correctly integrates revertOptions.The test verifies the expected failure scenario with
revertOptions
.
158-158
: testWithdrawZRC20WithMessageFailsIfNoAllowance function correctly integrates revertOptions.The test verifies the expected failure scenario with
revertOptions
.
172-182
: testWithdrawZRC20WithMessage function correctly integrates revertOptions.The test verifies the expected behavior with
revertOptions
.v2/pkg/ierc20custody.sol/ierc20custodyevents.go (5)
32-37
: RevertContext struct definition is well-structured.The
RevertContext
struct encapsulates relevant information for revert scenarios effectively.
856-861
: WithdrawAndRevert event modification is appropriate.Including
RevertContext
in theWithdrawAndRevert
event provides valuable context for debugging and error handling.
Line range hint
864-878
: FilterWithdrawAndRevert function update is correct.The function appropriately handles the updated
WithdrawAndRevert
event structure with therevertContext
parameter.
Line range hint
885-899
: WatchWithdrawAndRevert function update is correct.The function correctly adapts to the new
WithdrawAndRevert
event structure, including therevertContext
parameter.
931-935
: ParseWithdrawAndRevert function update is correct.The function appropriately handles the parsing of the updated
WithdrawAndRevert
event with therevertContext
parameter.v2/pkg/ierc20custody.sol/ierc20custody.go (8)
32-37
: New Struct:RevertContext
The
RevertContext
struct has been introduced to encapsulate additional information for revert scenarios. This is a beneficial addition for providing context during transaction reverts, improving debuggability and error handling.
273-274
: Update Function Signature: SessionWithdrawAndRevert
The session variant of
WithdrawAndRevert
also includes therevertContext
parameter. Ensure that session-based calls are updated accordingly.
280-281
: Update Function Signature: Transactor SessionWithdrawAndRevert
The transactor session variant of
WithdrawAndRevert
includes therevertContext
parameter. Ensure that transactor session-based calls are updated accordingly.
950-955
: Update Event Struct:IERC20CustodyWithdrawAndRevert
The
IERC20CustodyWithdrawAndRevert
struct now includes theRevertContext
. This change ensures that events related to this struct capture the full context of a revert scenario, which is crucial for logging and debugging.
958-960
: Update Event Filter:FilterWithdrawAndRevert
The
FilterWithdrawAndRevert
function now filters logs with the updated event signature, including theRevertContext
. Ensure that any log processing logic accommodates this change.
979-981
: Update Event Watcher:WatchWithdrawAndRevert
The
WatchWithdrawAndRevert
function now watches logs with the updated event signature, including theRevertContext
. Ensure that any event handling logic accommodates this change.
1025-1027
: Update Event Parser:ParseWithdrawAndRevert
The
ParseWithdrawAndRevert
function now parses logs with the updated event signature, including theRevertContext
. Ensure that any parsing logic accommodates this change.
266-267
: Update Function Signature:WithdrawAndRevert
The
WithdrawAndRevert
function now includes arevertContext
parameter. This change enhances the function's capability to handle more detailed revert scenarios. Ensure that all calls to this function are updated to include the new parameter.v2/pkg/igatewayzevm.sol/igatewayzevm.go (30)
39-44
: New Struct:RevertOptions
The
RevertOptions
struct replaces the previousRevertContext
and provides a more detailed configuration for handling reverts. This addition allows for more granular control over revert scenarios, enhancing the contract's robustness.
215-216
: Update Function Signature: SessionCall
The session variant of
Call
includes therevertOptions
parameter. Ensure that session-based calls are updated accordingly.
222-223
: Update Function Signature: Transactor SessionCall
The transactor session variant of
Call
includes therevertOptions
parameter. Ensure that transactor session-based calls are updated accordingly.
299-300
: Update Function Signature: SessionDepositAndRevert
The session variant of
DepositAndRevert
includes therevertContext
parameter. Ensure that session-based calls are updated accordingly.
306-307
: Update Function Signature: Transactor SessionDepositAndRevert
The transactor session variant of
DepositAndRevert
includes therevertContext
parameter. Ensure that transactor session-based calls are updated accordingly.
341-342
: Update Function Signature: SessionExecuteRevert
The session variant of
ExecuteRevert
includes therevertContext
parameter. Ensure that session-based calls are updated accordingly.
348-349
: Update Function Signature: Transactor SessionExecuteRevert
The transactor session variant of
ExecuteRevert
includes therevertContext
parameter. Ensure that transactor session-based calls are updated accordingly.
362-363
: Update Function Signature: SessionWithdraw
The session variant of
Withdraw
includes therevertOptions
parameter. Ensure that session-based calls are updated accordingly.
369-370
: Update Function Signature: Transactor SessionWithdraw
The transactor session variant of
Withdraw
includes therevertOptions
parameter. Ensure that transactor session-based calls are updated accordingly.
383-384
: Update Function Signature: SessionWithdraw0
The session variant of
Withdraw0
includes therevertOptions
parameter. Ensure that session-based calls are updated accordingly.
390-391
: Update Function Signature: Transactor SessionWithdraw0
The transactor session variant of
Withdraw0
includes therevertOptions
parameter. Ensure that transactor session-based calls are updated accordingly.
404-405
: Update Function Signature: SessionWithdrawAndCall
The session variant of
WithdrawAndCall
includes therevertOptions
parameter. Ensure that session-based calls are updated accordingly.
411-412
: Update Function Signature: Transactor SessionWithdrawAndCall
The transactor session variant of
WithdrawAndCall
includes therevertOptions
parameter. Ensure that transactor session-based calls are updated accordingly.
425-426
: Update Function Signature: SessionWithdrawAndCall0
The session variant of
WithdrawAndCall0
includes therevertOptions
parameter. Ensure that session-based calls are updated accordingly.
432-433
: Update Function Signature: Transactor SessionWithdrawAndCall0
The transactor session variant of
WithdrawAndCall0
includes therevertOptions
parameter. Ensure that transactor session-based calls are updated accordingly.
509-510
: Update Event Struct:IGatewayZEVMCall
The
IGatewayZEVMCall
struct now includes theRevertOptions
. This change ensures that events related to this struct capture the full context of a revert scenario, which is crucial for logging and debugging.
513-515
: Update Event Filter:FilterCall
The
FilterCall
function now filters logs with the updated event signature, including theRevertOptions
. Ensure that any log processing logic accommodates this change.
534-536
: Update Event Watcher:WatchCall
The
WatchCall
function now watches logs with the updated event signature, including theRevertOptions
. Ensure that any event handling logic accommodates this change.
580-582
: Update Event Parser:ParseCall
The
ParseCall
function now parses logs with the updated event signature, including theRevertOptions
. Ensure that any parsing logic accommodates this change.
669-670
: Update Event Struct:IGatewayZEVMWithdrawal
The
IGatewayZEVMWithdrawal
struct now includes theRevertOptions
. This change ensures that events related to this struct capture the full context of a revert scenario, which is crucial for logging and debugging.
673-675
: Update Event Filter:FilterWithdrawal
The
FilterWithdrawal
function now filters logs with the updated event signature, including theRevertOptions
. Ensure that any log processing logic accommodates this change.
694-696
: Update Event Watcher:WatchWithdrawal
The
WatchWithdrawal
function now watches logs with the updated event signature, including theRevertOptions
. Ensure that any event handling logic accommodates this change.
740-742
: Update Event Parser:ParseWithdrawal
The
ParseWithdrawal
function now parses logs with the updated event signature, including theRevertOptions
. Ensure that any parsing logic accommodates this change.
208-209
: Update Function Signature:Call
The
Call
function now includes arevertOptions
parameter. This change provides more control over revert scenarios during contract calls. Ensure that all calls to this function are updated to include the new parameter.
334-335
: Update Function Signature:ExecuteRevert
The
ExecuteRevert
function now includes arevertContext
parameter. This change enhances the function's capability to handle more detailed revert scenarios. Ensure that all calls to this function are updated to include the new parameter.
355-356
: Update Function Signature:Withdraw
The
Withdraw
function now includes arevertOptions
parameter. This change provides more control over revert scenarios during withdrawals. Ensure that all calls to this function are updated to include the new parameter.
397-398
: Update Function Signature:WithdrawAndCall
The
WithdrawAndCall
function now includes arevertOptions
parameter. This change provides more control over revert scenarios during withdrawals. Ensure that all calls to this function are updated to include the new parameter.
418-419
: Update Function Signature:WithdrawAndCall0
The
WithdrawAndCall0
function now includes arevertOptions
parameter. This change provides more control over revert scenarios during withdrawals. Ensure that all calls to this function are updated to include the new parameter.Verification successful
Verification Successful: Function Calls Updated
All calls to the
WithdrawAndCall0
function have been updated to include the newrevertOptions
parameter, as required by the updated function signature. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `WithdrawAndCall0` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'WithdrawAndCall0'Length of output: 5761
292-293
: Update Function Signature:DepositAndRevert
The
DepositAndRevert
function now includes arevertContext
parameter. This change enhances the function's capability to handle more detailed revert scenarios. Ensure that all calls to this function are updated to include the new parameter.Verification successful
Function Signature Update Verified:
DepositAndRevert
The
DepositAndRevert
function calls across the codebase have been successfully updated to include the newrevertContext
parameter. No further action is required.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `DepositAndRevert` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'DepositAndRevert'Length of output: 178816
376-377
: Update Function Signature:Withdraw0
The
Withdraw0
function now includes arevertOptions
parameter. This change provides more control over revert scenarios during withdrawals. Ensure that all calls to this function are updated to include the new parameter.Verification successful
No Calls to Update for
Withdraw0
FunctionThe search did not find any calls to the
Withdraw0
function in the codebase, indicating that there are no existing calls that need to be updated with the newrevertOptions
parameter.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `Withdraw0` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'Withdraw0'Length of output: 5431
Script:
#!/bin/bash # Description: Search for all calls to the `Withdraw0` function to verify they include the new `revertOptions` parameter. # Test: Find all calls to `Withdraw0` and check their usage. rg --type go 'Withdraw0\(' -A 2Length of output: 2615
Script:
#!/bin/bash # Description: Perform a comprehensive search for calls to the `Withdraw0` function. # Test: Search the entire codebase for any calls to `Withdraw0`. rg 'Withdraw0\(' -A 2Length of output: 2605
v2/pkg/receiverevm.sol/receiverevm.go (8)
33-37
: RevertContext struct definition looks good.The
RevertContext
struct is well-defined with appropriate field types for its purpose.
215-216
: OnRevert function signature change is appropriate.The function now accepts a
RevertContext
struct, aligning with the improved error handling strategy.
222-223
: OnRevert function signature change in ReceiverEVMSession is consistent.The update to use
RevertContext
ensures consistency and improved error handling across session types.
229-230
: OnRevert function signature change in ReceiverEVMTransactorSession is consistent.The update to use
RevertContext
ensures consistency and improved error handling across session types.
995-997
: ReceiverEVMReceivedRevert struct update is well-defined.Replacing the
Data
field withRevertContext
provides a more structured approach to handling revert events.
1002-1003
: FilterReceivedRevert function update is consistent.The function correctly reflects the changes in the
ReceivedRevert
event structure.
1014-1015
: WatchReceivedRevert function update is consistent.The function correctly reflects the changes in the
ReceivedRevert
event structure.
1051-1052
: ParseReceivedRevert function update is consistent.The function correctly reflects the changes in the
ReceivedRevert
event structure.v2/pkg/igatewayevm.sol/igatewayevm.go (26)
32-37
: RevertContext struct looks good.The
RevertContext
struct is well-defined with appropriate fields for handling context in revert scenarios.
39-44
: RevertOptions struct looks good.The
RevertOptions
struct is well-defined with appropriate fields for handling options in revert scenarios.
201-202
: Function signature updated correctly for Call in IGatewayEVMTransactor.The addition of
RevertOptions
to theCall
function enhances error handling capabilities.
208-209
: Function signature updated correctly for Call in IGatewayEVMSession.The addition of
RevertOptions
to theCall
function enhances error handling capabilities.
215-216
: Function signature updated correctly for Call in IGatewayEVMTransactorSession.The addition of
RevertOptions
to theCall
function enhances error handling capabilities.
222-223
: Function signature updated correctly for Deposit in IGatewayEVMTransactor.The addition of
RevertOptions
to theDeposit
function enhances error handling capabilities.
229-230
: Function signature updated correctly for Deposit in IGatewayEVMSession.The addition of
RevertOptions
to theDeposit
function enhances error handling capabilities.
236-237
: Function signature updated correctly for Deposit in IGatewayEVMTransactorSession.The addition of
RevertOptions
to theDeposit
function enhances error handling capabilities.
243-244
: Function signature updated correctly for Deposit0 in IGatewayEVMTransactor.The addition of
RevertOptions
to theDeposit0
function enhances error handling capabilities.
250-251
: Function signature updated correctly for Deposit0 in IGatewayEVMSession.The addition of
RevertOptions
to theDeposit0
function enhances error handling capabilities.
257-258
: Function signature updated correctly for Deposit0 in IGatewayEVMTransactorSession.The addition of
RevertOptions
to theDeposit0
function enhances error handling capabilities.
264-265
: Function signature updated correctly for DepositAndCall in IGatewayEVMTransactor.The addition of
RevertOptions
to theDepositAndCall
function enhances error handling capabilities.
271-272
: Function signature updated correctly for DepositAndCall in IGatewayEVMSession.The addition of
RevertOptions
to theDepositAndCall
function enhances error handling capabilities.
278-279
: Function signature updated correctly for DepositAndCall in IGatewayEVMTransactorSession.The addition of
RevertOptions
to theDepositAndCall
function enhances error handling capabilities.
285-286
: Function signature updated correctly for DepositAndCall0 in IGatewayEVMTransactor.The addition of
RevertOptions
to theDepositAndCall0
function enhances error handling capabilities.
292-293
: Function signature updated correctly for DepositAndCall0 in IGatewayEVMSession.The addition of
RevertOptions
to theDepositAndCall0
function enhances error handling capabilities.
299-300
: Function signature updated correctly for DepositAndCall0 in IGatewayEVMTransactorSession.The addition of
RevertOptions
to theDepositAndCall0
function enhances error handling capabilities.
327-328
: Function signature updated correctly for ExecuteRevert in IGatewayEVMTransactor.The addition of
RevertContext
to theExecuteRevert
function enhances error handling capabilities.
334-335
: Function signature updated correctly for ExecuteRevert in IGatewayEVMSession.The addition of
RevertContext
to theExecuteRevert
function enhances error handling capabilities.
341-342
: Function signature updated correctly for ExecuteRevert in IGatewayEVMTransactorSession.The addition of
RevertContext
to theExecuteRevert
function enhances error handling capabilities.
369-370
: Function signature updated correctly for RevertWithERC20 in IGatewayEVMTransactor.The addition of
RevertContext
to theRevertWithERC20
function enhances error handling capabilities.
376-377
: Function signature updated correctly for RevertWithERC20 in IGatewayEVMSession.The addition of
RevertContext
to theRevertWithERC20
function enhances error handling capabilities.
383-384
: Function signature updated correctly for RevertWithERC20 in IGatewayEVMTransactorSession.The addition of
RevertContext
to theRevertWithERC20
function enhances error handling capabilities.
456-460
: IGatewayEVMCall struct updated correctly.The addition of
RevertOptions
to theIGatewayEVMCall
struct aligns with the event updates and enhances data handling.
611-617
: IGatewayEVMDeposit struct updated correctly.The addition of
RevertOptions
to theIGatewayEVMDeposit
struct aligns with the event updates and enhances data handling.
1069-1074
: IGatewayEVMReverted struct updated correctly.The addition of
RevertContext
to theIGatewayEVMReverted
struct aligns with the event updates and enhances data handling.v2/pkg/systemcontract.sol/systemcontract.go (4)
Line range hint
32-36
: Structured input approach withZContext
looks good!The
ZContext
struct provides a clear and structured way to handle context-related data, improving the readability and maintainability of the code.
39-45
: Updated ABI structure and deprecation ofSystemContractABI
are appropriate.The updated ABI in
SystemContractMetaData
enhances the contract's capabilities. DeprecatingSystemContractABI
in favor ofSystemContractMetaData.ABI
aligns with best practices for maintaining a single source of truth.
Line range hint
51-67
: Deployment function correctly utilizes updated metadata.The
DeploySystemContract
function appropriately usesSystemContractMetaData
for ABI retrieval and deployment, ensuring alignment with the updated metadata structure.
Line range hint
431-437
: Structured input inDepositAndCall
enhances clarity.The addition of the
context
parameter using theZContext
struct improves the function's clarity and maintainability. Ensure consistent usage throughout the codebase.Verification successful
Structured input in
DepositAndCall
is consistently used.The
DepositAndCall
function consistently uses theZContext
parameter across all instances in the codebase, confirming the structured input's integration. No further action is required.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `DepositAndCall` use the new `ZContext` parameter. # Test: Search for the function usage. Expect: Only occurrences with the new `ZContext` parameter. rg --type go -A 5 $'DepositAndCall'Length of output: 39039
v2/pkg/zetaconnectorbase.sol/zetaconnectorbase.go (5)
32-37
: LGTM: StructRevertContext
is well-defined.The
RevertContext
struct is appropriately defined to encapsulate revert-related information.
1803-1807
: LGTM: Updated eventWithdrawAndRevert
withRevertContext
.The inclusion of
RevertContext
in the event enhances the capability to handle revert scenarios.Ensure that event parsing and handling are updated with the new signature.
685-686
: LGTM: Updated function signature forWithdrawAndRevert
.The inclusion of
revertContext
enhances the function's capability to handle revert scenarios.Ensure that all calls to this function are updated with the new signature.
678-679
: LGTM: Updated function signature forWithdrawAndRevert
.The inclusion of
revertContext
enhances the function's capability to handle revert scenarios.Ensure that all calls to this function are updated with the new signature.
671-672
: LGTM: Updated function signature forWithdrawAndRevert
.The inclusion of
revertContext
enhances the function's capability to handle revert scenarios.Ensure that all calls to this function are updated with the new signature.
v2/pkg/zetaconnectornative.sol/zetaconnectornative.go (8)
32-37
: StructRevertContext
looks good.The
RevertContext
struct is well-defined with relevant fields to provide context during reverts.
700-701
: FunctionWithdrawAndRevert
signature update looks good.The inclusion of the
revertContext
parameter is consistent with the transactor's update.
707-708
: FunctionWithdrawAndRevert
signature update looks good.The inclusion of the
revertContext
parameter is consistent with other session updates.
1825-1829
: StructZetaConnectorNativeWithdrawAndRevert
update looks good.The addition of
RevertContext
to this event struct enhances logging capabilities.
Line range hint
1834-1844
:
FunctionFilterWithdrawAndRevert
update looks good.The update aligns with the new event signature and improves event handling.
Line range hint
1851-1861
:
FunctionWatchWithdrawAndRevert
update looks good.The update aligns with the new event signature and enhances real-time event processing.
Line range hint
1893-1899
:
FunctionParseWithdrawAndRevert
update looks good.The update aligns with the new event signature and enhances parsing capabilities.
693-694
: FunctionWithdrawAndRevert
signature update looks good.The inclusion of the
revertContext
parameter enhances error handling capabilities.Ensure that all function calls to
WithdrawAndRevert
are updated to match the new signature.v2/pkg/zetaconnectornonnative.sol/zetaconnectornonnative.go (5)
32-37
: Well-definedRevertContext
struct.The
RevertContext
struct is a clear and appropriate addition for handling revert scenarios, encapsulating necessary parameters like asset, amount, and revert message.
745-746
: EnhancedWithdrawAndRevert
function signature.The inclusion of the
revertContext
parameter improves the function's capability to handle detailed revert scenarios.
752-753
: ConsistentWithdrawAndRevert
function signature in session.The updated function signature maintains consistency with the
Transactor
version, enhancing session handling with detailed revert information.
759-760
: UpdatedWithdrawAndRevert
function signature in transactor session.The inclusion of the
revertContext
parameter ensures comprehensive handling of revert scenarios, consistent with other function versions.
2011-2015
: EnhancedWithdrawAndRevert
event structure.The addition of
RevertContext
to the event data structure improves the granularity of event logging and tracking.v2/pkg/erc20custody.sol/erc20custody.go (3)
32-37
: Introduction ofRevertContext
struct looks good.The
RevertContext
struct is well-defined and appropriately uses types suitable for Ethereum smart contract interactions.
713-715
: Changes toWithdrawAndRevert
function signature are appropriate.The addition of the
revertContext
parameter enhances error handling and interaction capabilities.Ensure that all usages of
WithdrawAndRevert
across the codebase are updated to match the new signature.Also applies to: 720-722, 727-729
2152-2157
: Updates toWithdrawAndRevert
event are well-implemented.Including
RevertContext
in the event parameters provides comprehensive logging and handling of reverts.Ensure that all event handling and parsing logic is updated to accommodate the new event structure.
Also applies to: 2160-2162, 2181-2183
|
||
onRevert: TypedContractMethod< | ||
[revertContext: RevertContextStruct], | ||
[void], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using void
outside return types.
The use of void
in the onRevert
method signature is confusing. Consider using undefined
instead for clarity.
- [void],
+ [undefined],
Also applies to: 104-104
Tools
Biome
[error] 92-92: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
"nonpayable" | ||
>; | ||
|
||
filters: {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using {}
as a type.
Using {}
as a type can be misleading. Consider defining an explicit object shape or using Record<string, unknown>
if the shape is not known.
- filters: {};
+ filters: Record<string, unknown>;
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
filters: {}; | |
filters: Record<string, unknown>; |
Tools
Biome
[error] 108-108: Don't use '{}' as a type.
Prefer explicitly define the object shape. '{}' means "any non-nullable value".
(lint/complexity/noBannedTypes)
export class Revertable__factory { | ||
static readonly abi = _abi; | ||
static createInterface(): RevertableInterface { | ||
return new Interface(_abi) as RevertableInterface; | ||
} | ||
static connect(address: string, runner?: ContractRunner | null): Revertable { | ||
return new Contract(address, _abi, runner) as unknown as Revertable; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor static-only class into standalone functions.
The Revertable__factory
class contains only static members, which can be refactored into standalone functions to reduce complexity and improve readability.
export const Revertable__factory = {
abi: _abi,
createInterface(): RevertableInterface {
return new Interface(_abi) as RevertableInterface;
},
connect(address: string, runner?: ContractRunner | null): Revertable {
return new Contract(address, _abi, runner) as unknown as Revertable;
},
};
Tools
Biome
[error] 44-52: Avoid classes that contain only static members.
Prefer using simple functions instead of classes with only static members.
(lint/complexity/noStaticOnlyClass)
onRevert: TypedContractMethod< | ||
[revertContext: RevertContextStruct], | ||
[void], | ||
"nonpayable" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address void
usage in onRevert
.
The use of void
here is flagged by the static analysis tool as potentially confusing. Consider using undefined
instead to align with TypeScript conventions.
- [void],
+ [undefined],
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
onRevert: TypedContractMethod< | |
[revertContext: RevertContextStruct], | |
[void], | |
"nonpayable" | |
onRevert: TypedContractMethod< | |
[revertContext: RevertContextStruct], | |
[undefined], | |
"nonpayable" |
Tools
Biome
[error] 260-260: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
): TypedContractMethod< | ||
[revertContext: RevertContextStruct], | ||
[void], | ||
"nonpayable" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address void
usage in getFunction
for onRevert
.
Similar to the previous comment, replace void
with undefined
for clarity and consistency with TypeScript practices.
- [void],
+ [undefined],
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
): TypedContractMethod< | |
[revertContext: RevertContextStruct], | |
[void], | |
"nonpayable" | |
): TypedContractMethod< | |
[revertContext: RevertContextStruct], | |
[undefined], | |
"nonpayable" |
Tools
Biome
[error] 298-298: void is confusing outside a return type or a type parameter.
Unsafe fix: Use undefined instead.
(lint/suspicious/noConfusingVoidType)
[ | ||
receiver: AddressLike, | ||
payload: BytesLike, | ||
revertOptions: RevertOptionsStruct | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace void
with undefined
in return types.
The use of void
in return types is flagged as confusing. Consider replacing void
with undefined
for clarity and to align with TypeScript best practices.
- [void],
+ [undefined],
Also applies to: 341-347, 352-353, 358-364, 370-375
[ | ||
receiver: BytesLike, | ||
chainId: BigNumberish, | ||
message: BytesLike, | ||
revertOptions: RevertOptionsStruct | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace void
with undefined
in return types.
The use of void
in return types is flagged as confusing. Consider replacing void
with undefined
for clarity and to align with TypeScript best practices.
- [void],
+ [undefined],
Also applies to: 384-390, 395-401, 406-412, 418-424
[ | ||
receiver: BytesLike, | ||
chainId: BigNumberish, | ||
message: BytesLike, | ||
revertOptions: RevertOptionsStruct | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address void
type usage issue.
The use of void
in these method signatures is flagged as confusing. Consider replacing void
with undefined
to clarify the return type.
- [void],
+ [undefined],
Also applies to: 685-695, 700-718
values: [AddressLike, BytesLike, RevertOptionsStruct] | ||
): string; | ||
encodeFunctionData(functionFragment: "custody", values?: undefined): string; | ||
encodeFunctionData( | ||
functionFragment: "deposit(address)", | ||
values: [AddressLike] | ||
functionFragment: "deposit(address,uint256,address,(address,bool,address,bytes))", | ||
values: [AddressLike, BigNumberish, AddressLike, RevertOptionsStruct] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace void
with undefined
in parameter lists.
The use of void
in parameter lists is confusing outside of return types. Replace it with undefined
to align with TypeScript best practices.
- [void],
+ [undefined],
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
values: [AddressLike, BytesLike, RevertOptionsStruct] | |
): string; | |
encodeFunctionData(functionFragment: "custody", values?: undefined): string; | |
encodeFunctionData( | |
functionFragment: "deposit(address)", | |
values: [AddressLike] | |
functionFragment: "deposit(address,uint256,address,(address,bool,address,bytes))", | |
values: [AddressLike, BigNumberish, AddressLike, RevertOptionsStruct] | |
values: [AddressLike, BytesLike, RevertOptionsStruct] | |
): string; | |
encodeFunctionData(functionFragment: "custody", values?: undefined): string; | |
encodeFunctionData( | |
functionFragment: "deposit(address,uint256,address,(address,bool,address,bytes))", | |
values: [AddressLike, BigNumberish, AddressLike, RevertOptionsStruct] |
values: [AddressLike, BytesLike, RevertOptionsStruct] | ||
): string; | ||
encodeFunctionData(functionFragment: "custody", values?: undefined): string; | ||
encodeFunctionData( | ||
functionFragment: "deposit(address)", | ||
values: [AddressLike] | ||
functionFragment: "deposit(address,uint256,address,(address,bool,address,bytes))", | ||
values: [AddressLike, BigNumberish, AddressLike, RevertOptionsStruct] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace void
with undefined
in parameter lists.
The use of void
in parameter lists is confusing outside of return types. Replace it with undefined
to align with TypeScript best practices.
- [void],
+ [undefined],
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
values: [AddressLike, BytesLike, RevertOptionsStruct] | |
): string; | |
encodeFunctionData(functionFragment: "custody", values?: undefined): string; | |
encodeFunctionData( | |
functionFragment: "deposit(address)", | |
values: [AddressLike] | |
functionFragment: "deposit(address,uint256,address,(address,bool,address,bytes))", | |
values: [AddressLike, BigNumberish, AddressLike, RevertOptionsStruct] | |
values: [AddressLike, BytesLike, RevertOptionsStruct] | |
): string; | |
encodeFunctionData(functionFragment: "custody", values?: undefined): string; | |
encodeFunctionData( | |
functionFragment: "deposit(address,uint256,address,(address,bool,address,bytes))", | |
values: [AddressLike, BigNumberish, AddressLike, RevertOptionsStruct] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Minor comment
@@ -109,9 +110,9 @@ contract GatewayEVM is | |||
if (destination == address(0)) revert ZeroAddress(); | |||
(bool success,) = destination.call{ value: msg.value }(""); | |||
if (!success) revert ExecutionFailed(); | |||
Revertable(destination).onRevert(data); | |||
Revertable(destination).onRevert(revertContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we directly have destination
as Revertable
in the argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are always casting like this (eg. UniversalContract, ERC20 and so on), i suggest we open new issue to make it consistent across codebase if we prefer this approach, not sure what is better, but would be nice to be consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (19)
- v2/pkg/erc20custody.sol/erc20custody.go (5 hunks)
- v2/pkg/receiverevm.sol/receiverevm.go (5 hunks)
- v2/pkg/senderzevm.sol/senderzevm.go (1 hunks)
- v2/pkg/systemcontract.sol/systemcontract.go (1 hunks)
- v2/pkg/systemcontractmock.sol/systemcontractmock.go (1 hunks)
- v2/pkg/testuniversalcontract.sol/testuniversalcontract.go (6 hunks)
- v2/pkg/zetaconnectornative.sol/zetaconnectornative.go (5 hunks)
- v2/pkg/zetaconnectornonnative.sol/zetaconnectornonnative.go (5 hunks)
- v2/typechain-types/factories/ERC20Custody__factory.ts (3 hunks)
- v2/typechain-types/factories/GatewayEVMUpgradeTest__factory.ts (14 hunks)
- v2/typechain-types/factories/GatewayEVM__factory.ts (11 hunks)
- v2/typechain-types/factories/GatewayZEVM__factory.ts (12 hunks)
- v2/typechain-types/factories/ReceiverEVM__factory.ts (3 hunks)
- v2/typechain-types/factories/SenderZEVM__factory.ts (1 hunks)
- v2/typechain-types/factories/SystemContract.sol/SystemContract__factory.ts (1 hunks)
- v2/typechain-types/factories/SystemContractMock.sol/SystemContractMock__factory.ts (1 hunks)
- v2/typechain-types/factories/TestUniversalContract__factory.ts (2 hunks)
- v2/typechain-types/factories/ZetaConnectorNative__factory.ts (3 hunks)
- v2/typechain-types/factories/ZetaConnectorNonNative__factory.ts (3 hunks)
Files skipped from review as they are similar to previous changes (10)
- v2/pkg/erc20custody.sol/erc20custody.go
- v2/pkg/receiverevm.sol/receiverevm.go
- v2/pkg/testuniversalcontract.sol/testuniversalcontract.go
- v2/typechain-types/factories/GatewayEVMUpgradeTest__factory.ts
- v2/typechain-types/factories/GatewayEVM__factory.ts
- v2/typechain-types/factories/GatewayZEVM__factory.ts
- v2/typechain-types/factories/ReceiverEVM__factory.ts
- v2/typechain-types/factories/SenderZEVM__factory.ts
- v2/typechain-types/factories/SystemContract.sol/SystemContract__factory.ts
- v2/typechain-types/factories/SystemContractMock.sol/SystemContractMock__factory.ts
Additional comments not posted (28)
v2/typechain-types/factories/TestUniversalContract__factory.ts (2)
76-78
: Ensure Consistency in Type Naming.The internal type has been updated from
struct revertContext
tostruct RevertContext
. Ensure that this change is consistently applied across the codebase to avoid potential mismatches.Verification successful
Consistency in Type Naming Verified.
The change from
struct revertContext
tostruct RevertContext
has been consistently applied across the codebase. No instances of the old naming were found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify consistency of the `RevertContext` struct usage across the codebase. rg --type ts 'struct RevertContext'Length of output: 4214
171-171
: Verify Bytecode Changes.The bytecode has been updated. Ensure that the changes are intentional and that all dependent components are aware of the new bytecode.
v2/pkg/senderzevm.sol/senderzevm.go (1)
35-35
: Verify Updated Bytecode.The bytecode for
SenderZEVM
has been updated. Ensure that this change is consistent with the intended contract logic and that all relevant documentation reflects this update.v2/typechain-types/factories/ZetaConnectorNonNative__factory.ts (1)
665-665
: Verify Complete Bytecode Replacement.The bytecode has been entirely replaced. Ensure that the new bytecode reflects the intended changes and that all dependent systems are updated accordingly.
v2/typechain-types/factories/ZetaConnectorNative__factory.ts (2)
345-366
: Enhanced error handling withrevertContext
.The addition of the
revertContext
structure to thewithdrawAndRevert
function and event provides valuable context for handling reverts, aligning well with the PR objectives.Also applies to: 551-573
659-659
: Significant bytecode update.The complete replacement of the bytecode indicates a major update to the contract's implementation, likely enhancing functionality or performance.
v2/typechain-types/factories/ERC20Custody__factory.ts (2)
369-390
: Enhanced error handling withrevertContext
.The addition of the
revertContext
structure to thewithdrawAndRevert
function and event provides valuable context for handling reverts, aligning well with the PR objectives.Also applies to: 606-628
719-719
: Significant bytecode update.The complete replacement of the bytecode indicates a major update to the contract's implementation, likely enhancing functionality or performance.
v2/pkg/systemcontractmock.sol/systemcontractmock.go (2)
35-35
: Verify binary data changes reflect intended logic updates.The binary data updates should correspond to the ABI changes and reflect the intended logic updates. Ensure consistency with the ABI and PR objectives.
34-34
: Verify ABI changes align with PR objectives.The ABI updates suggest changes in the contract's interface. Ensure these changes are consistent with the introduction of
RevertContext
andRevertOptions
as described in the PR objectives.v2/pkg/systemcontract.sol/systemcontract.go (3)
Line range hint
600-605
:
Verify Event Handling and Log Filtering Functions.The event handling and log filtering functions should be checked for consistency with the updated ABI. Ensure that event names and parameters match the contract definitions.
Verification successful
Event Handling and Log Filtering Verified
The event handling and log filtering functions for
SetConnectorZEVM
are implemented correctly in theSystemContractFilterer
struct, matching the expected ABI. The functionsFilterSetConnectorZEVM
,WatchSetConnectorZEVM
, andParseSetConnectorZEVM
ensure proper event handling.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify event handling and log filtering functions align with the updated ABI. # Test: Search for event `SetConnectorZEVM` in the Go code. Expect: The function signature matches the ABI. rg --type go -A 5 $'func (_SystemContract *SystemContractFilterer) FilterSetConnectorZEVM'Length of output: 91
Script:
#!/bin/bash # Description: Search for event handling functions in the SystemContractFilterer struct. # Test: List all functions in SystemContractFilterer to find any event handling implementations. rg --type go -A 5 'func \(_SystemContract \*SystemContractFilterer\)'Length of output: 21224
Line range hint
145-150
:
Ensure Function Signatures Align with Updated ABI.The function signatures in
SystemContract
should be verified against the updated ABI to ensure consistency. This includes checking the deployment and interaction functions for any potential issues.
41-42
: Verify ABI Changes and Structured Input.The ABI changes, particularly the structured input for the
context
parameter indepositAndCall
, should be verified for correctness. Ensure that these changes align with the intended contract functionality and that any dependent systems or contracts are updated accordingly.Verification successful
ABI Changes Verified: Structured Input Confirmed
The
depositAndCall
function with a structuredcontext
parameter is correctly implemented in the Solidity code, matching the ABI changes. This confirms the correctness and consistency of the ABI with the contract's intended functionality. No further issues were found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the ABI changes and the structured input for the `context` parameter. # Test: Search for function `depositAndCall` in the contract code. Expect: The function signature matches the ABI. rg --type solidity -A 5 $'function depositAndCall'Length of output: 84
Script:
#!/bin/bash # Description: Locate Solidity files and search for the `depositAndCall` function. # Find all Solidity files and search for the `depositAndCall` function. fd --extension sol --exec rg 'function depositAndCall' {}Length of output: 8420
v2/pkg/zetaconnectornative.sol/zetaconnectornative.go (8)
32-37
: RevertContext struct looks good.The
RevertContext
struct is well-defined and enhances error handling by providing detailed context during asset withdrawal failures.
690-694
: WithdrawAndRevert function update is appropriate.The inclusion of the
RevertContext
parameter enhances error handling by providing additional context for transaction failures.
697-701
: WithdrawAndRevert function update in session is consistent.The addition of
RevertContext
ensures consistent error handling improvements across session types.
704-708
: WithdrawAndRevert function update in transactor session is consistent.The inclusion of
RevertContext
maintains consistency and enhances error handling across transactor sessions.
1825-1829
: ZetaConnectorNativeWithdrawAndRevert struct update is logical.The inclusion of the
RevertContext
field enhances the event logging capabilities, aligning with the function changes.
Line range hint
1832-1847
: FilterWithdrawAndRevert function update is appropriate.The function now captures logs with the enhanced
WithdrawAndRevert
event, including theRevertContext
.
Line range hint
1849-1889
: WatchWithdrawAndRevert function update is consistent.The function now watches logs with the enhanced
WithdrawAndRevert
event, including theRevertContext
, improving error tracking.
1891-1896
: ParseWithdrawAndRevert function update is appropriate.The function now parses logs with the enhanced
WithdrawAndRevert
event, including theRevertContext
, aiding in detailed error analysis.v2/pkg/zetaconnectornonnative.sol/zetaconnectornonnative.go (7)
749-753
: Verify usage and testing ofrevertContext
inWithdrawAndRevert
.Ensure that the
revertContext
parameter is properly utilized and that the function is adequately tested.
756-760
: Verify usage and testing ofrevertContext
inWithdrawAndRevert
.Ensure that the
revertContext
parameter is properly utilized and that the function is adequately tested.
2011-2015
: Ensure documentation and testing forZetaConnectorNonNativeWithdrawAndRevert
.The updated struct should be well-documented and adequately tested to ensure correct behavior and security.
2035-2037
: Verify implementation and testing ofWatchWithdrawAndRevert
.Ensure that the function correctly handles the
WithdrawAndRevert
event and is adequately tested.
2077-2079
: Verify implementation and testing ofParseWithdrawAndRevert
.Ensure that the function correctly parses the
WithdrawAndRevert
event and is adequately tested.
742-746
: Verify usage and testing ofrevertContext
inWithdrawAndRevert
.Ensure that the
revertContext
parameter is properly utilized and that the function is adequately tested.
2018-2020
: Verify implementation and testing ofFilterWithdrawAndRevert
.Ensure that the function correctly handles the
WithdrawAndRevert
event and is adequately tested.
// RevertContext is an auto generated low-level Go binding around an user-defined struct. | ||
type RevertContext struct { | ||
Asset common.Address | ||
Amount uint64 | ||
RevertMessage []byte | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure documentation and testing for RevertContext
.
The new RevertContext
struct should be well-documented and adequately tested to ensure correct behavior and security.
Would you like assistance in generating documentation or tests for RevertContext
?
adds revertOption for every external function in both gateways
improve imports a bit
adapt tests and localnet scripts
add revertContext to methods where eventually onRevert is called in both evm and zevm
Summary by CodeRabbit
Summary by CodeRabbit
New Features
RevertContext
for enhanced error handling during withdrawals and reverts across multiple contracts.RevertContext
, improving the clarity and structure of data during revert scenarios.RevertContext
, allowing better context and tracking for error handling.Bug Fixes
Documentation
RevertContext
.