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(cast): add --cost for estimate to return the eth cost at current gas price #9687

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0xvv
Copy link
Contributor

@0xvv 0xvv commented Jan 15, 2025

Motivation

Directly getting an ETH amount from cast estimate is an easy way to check if an account has enough tokens to perform the given action. Can be particularly useful when doing customer support.

Solution

Add --cost which multiplies the gas cost by the current network gas price to quickly get the quantity of token needed to perform the transaction

cast estimate 0x5DB5235b5C7e247488784986e58019fFFd98FdA4 "stake()" --value 1ether --cost
0.001677499023679296

@0xvv 0xvv changed the title feat(cast): add --cost to cast estimate the eth cost at current gas price feat(cast): add --cost for estimate to return the eth cost at current gas price Jan 15, 2025
@0xvv 0xvv force-pushed the estimate-cost branch 3 times, most recently from d81f453 to 268dcb2 Compare January 15, 2025 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant