Skip to content

GatewayZEVM : Add Gas price to event #482

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

Open
kingpinXD opened this issue Mar 19, 2025 · 2 comments
Open

GatewayZEVM : Add Gas price to event #482

kingpinXD opened this issue Mar 19, 2025 · 2 comments
Labels
zevm Related to zevm smart contract module

Comments

@kingpinXD
Copy link

We should add GasPrice to the withdraw event

    emit Withdrawn(
            msg.sender,
            0,
            receiver,
            zrc20,
            amount,
            gasFee,
            IZRC20(zrc20).PROTOCOL_FLAT_FEE(),
            "",
            CallOptions({ gasLimit: IZRC20(zrc20).GAS_LIMIT(), isArbitraryCall: true }),
            revertOptions
        );

We can calculate the price on the protocol side , as all events are processed in the same block , but it might be easier to emit the gasPrice paid by the user when creating the withdraw

NOTE : The gas-price when finalizing the TX might be different (more) than what the user paid for

@kingpinXD kingpinXD added the zevm Related to zevm smart contract module label Mar 19, 2025
@lumtis
Copy link
Member

lumtis commented Mar 19, 2025

NOTE : The gas-price when finalizing the TX might be different (more) than what the user paid for

Not sure how, because the even is parsed in the same Cosmos tx where the evm tx is done so everything is done atomically

@kingpinXD
Copy link
Author

The price is adjusted by the protocol if the CCTX gets stuck
https://github.com/zeta-chain/zeta-node/blob/ffd267a63c7cc55c26c94183efa375d4be2a3a2e/x/crosschain/keeper/abci.go#L200-L204

The additional gas tokens are borrowed from the stability pool .

This requirement is good to have , this pr already adds a workaround by setting the price whne the cctx is creatred
zeta-chain/node#3734

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zevm Related to zevm smart contract module
Projects
None yet
Development

No branches or pull requests

2 participants