feat: add support for deposits using the v2 connector contract #3990
feat: add support for deposits using the v2 connector contract #3990
Conversation
…into connector-v2-migration-deposit # Conflicts: # cmd/zetae2e/local/evm.go # cmd/zetae2e/local/local.go # e2e/e2etests/test_v2_zeta_deposit.go # e2e/runner/setup_zevm.go
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThis set of changes introduces comprehensive support for ZETA token operations within the protocol, including deposit, call, revert, and abort flows in both the core and E2E testing infrastructure. The update refactors deposit logic by coin type, enhances connector contract handling, and extends outbound event parsing and signing to accommodate ZETA-specific scenarios. Multiple new E2E tests and contract modifications ensure robust coverage and validation of these flows. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant E2ERunner
participant GatewayEVM
participant ZetaConnectorNative
participant ZEVM
participant Observer
participant Signer
User->>E2ERunner: Initiate ZETA deposit and call
E2ERunner->>GatewayEVM: DepositAndCall0 (ZETA, receiver, amount, payload, revertOpts)
GatewayEVM->>ZetaConnectorNative: depositAndCall (amount, target, message)
ZetaConnectorNative->>ZEVM: Mint ZETA, execute contract call
ZEVM-->>ZetaConnectorNative: Execution result (success/revert/abort)
ZetaConnectorNative-->>GatewayEVM: Event logs (Withdrawn, Reverted, Aborted)
Observer->>ZetaConnectorNative: Parse event logs for outbound status
Observer->>Signer: Sign outbound/revert transaction if confirmed
Signer->>ZetaConnectorNative: Submit signed transaction
ZetaConnectorNative-->>ZEVM: Finalize token transfer or revert/abort handling
Possibly related PRs
Suggested labels
Suggested reviewers
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
* update go mod * add a new message for migrating funds * add migrate funds to e2e * rebase from develop * add v2 e2e test to check flow * add zeta gateway deposit to zetaclient * add github workflow * update comments * fix code formating * fix code formating * fix code formating * fix unit tests * fix unit tests * revert to old command to start e2e test * remove message for migration and refactor to using contract directly * add changelog * generate files after removing new message * update generated files * update generated files * update go mod * update deposit * add unit tests * add unit tests * generate files * generate files * undo changes based on develop * update deposit and revert smart contract call * rename zeta deposit test file * rename zeta deposit test file * add abort and revert tests * add TestZetaDepositAndCallNoMessage * add TestZetaDepositAndCallNoMessage * remove payable from TestAbort contract * rename to LegacyZETADepositAndCallContract * improve unit test coverage * fix unit tests * add some delay in TestZetacore_SubscribeNewBlocks * update comment for handling zeta token zrc20 * resolve comments * rebase develop * refactor to errors.Wrap for all instances of fmt.Errorf * update zeta tests minimum version * refactor TestCrosschainSwap * refactor TestCrosschainSwap * fix admin upgrade e2e
Description
Partially closses #3947
The withdraw tests will be added in a separate PR to make the review easier
This PR
The PR is ready to be reviewed; however, unit test coverage for some of the functions will be added soon
How Has This Been Tested?
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Chores