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

pre-check setup steps for total cost #104

Open
zeroXbrock opened this issue Jan 21, 2025 · 1 comment
Open

pre-check setup steps for total cost #104

zeroXbrock opened this issue Jan 21, 2025 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@zeroXbrock
Copy link
Member

zeroXbrock commented Jan 21, 2025

Describe the bug

If --min-balance isn't enough to fund the whole setup stage (contract deployments & setup txs) you won't see the error until you run out of ether.

To Reproduce

run contender setup on uniV2 scenario with --min-balance 9

Expected behavior

Contracts will deploy, but the WETH deposit will fail.

@zeroXbrock zeroXbrock added bug Something isn't working enhancement New feature or request labels Jan 21, 2025
@zeroXbrock
Copy link
Member Author

zeroXbrock commented Jan 21, 2025

We should simulate all transactions before sending any. The challenge is that gas estimates (eth_call) don't work unless the sending account is funded, so you need to fund it with a sufficient amount of ETH before calling. Additionally, estimating gas for setup txs won't be accurate unless the contracts are deployed.

If we want to know the balance required to make the whole thing succeed before we decide to deploy the contracts, we can simulate the whole thing with an account that has unlimited ETH, then check the balance delta when we're done to get the true setup cost.

If we're OK with deploying the contracts first, then evaluating the cost of the setup txs (to make use of gas estimates, which I think will be easier to implement than the former solution), then we first need to implement resumable setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant