Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: supports gas payment for two-way calls #72

Merged
merged 17 commits into from
Apr 27, 2023

Conversation

npty
Copy link
Member

@npty npty commented Apr 17, 2023

Description

This PR adds support for nested contract calls. It does this by checking the transaction receipt log for ContractCall or ContractCallWithToken events. If these events are found, the relayer adds a new gas paid event with the deducted gas fee.

Other improvements

  • Add typechain to generate types for the GasService and Gateway contracts

Issues

  • The deducted gas fee logic doesn't work correctly if there're multiple ContractCall or ContractCallWithToken events. I think we can fix it later because we don't have examples that executes callContract or callContractWithToken multiple times in the destination contract.

How to test against axelar-examples?

  1. Clone this branch
  2. Run npm install
  3. In axelar-examples, run npm install @axelar-network/axelar-local-dev@relative-path-to-axelar-local-dev
  4. In axelar-examples, run npm run test

@npty npty requested a review from StephenFluin April 17, 2023 14:13
@npty npty marked this pull request as ready for review April 17, 2023 14:13
@npty npty changed the title fix: cannot pay gas at source chain for round trip feat: supports gas payment for two-way calls Apr 17, 2023
Copy link
Contributor

@StephenFluin StephenFluin left a comment

Choose a reason for hiding this comment

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

Tested with the latest axelar-examples with the updated sync/ack example, works well!

@npty npty merged commit 12fa574 into main Apr 27, 2023
@npty npty deleted the fix/cannot-pay-gas-at-source-chain-for-round-trip branch April 27, 2023 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants