Skip to content

Pay gas fees in the contract for ZETA withdraws #357

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
lumtis opened this issue Sep 24, 2024 · 1 comment · May be fixed by #527
Open

Pay gas fees in the contract for ZETA withdraws #357

lumtis opened this issue Sep 24, 2024 · 1 comment · May be fixed by #527
Assignees

Comments

@lumtis
Copy link
Member

lumtis commented Sep 24, 2024

Currently for ZETA withdraws, withdrawGasFeeWithGasLimit is not used in the function because it is assumed the fees are paid at the protocol level.

For consistency in with V2 contracts and simplifying the protocol logic, the function should be used.

Low priority as ZETA is not enabled for now

@s2imonovic
Copy link
Collaborator

Implement this once Registry is deployed on mainnet.

function getGasInfo(uint256 chainId, uint256 gasLimit) public view returns (address, uint256) {
        address gasZRC20 = ISystem(systemContract).gasCoinZRC20ByChainId(chainId);
        if (gasZRC20 == address(0)) revert ZeroGasCoin();
        
        uint256 gasPrice = ISystem(systemContract).gasPriceByChainId(chainId);
        if (gasPrice == 0) revert ZeroGasPrice();
        
        uint256 gasFee = gasPrice * gasLimit;
        return (gasZRC20, gasFee); 
}

@s2imonovic s2imonovic self-assigned this Jun 4, 2025
@s2imonovic s2imonovic linked a pull request Jun 10, 2025 that will close this issue
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 a pull request may close this issue.

2 participants