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

Adjust skipBalance logic #2138

Closed
wants to merge 2 commits into from
Closed

Adjust skipBalance logic #2138

wants to merge 2 commits into from

Conversation

acolytec3
Copy link
Contributor

Updates changes in #1849 with some recommendations from hardhat. Primarily, instead of just adding the tx cost or message value to the caller balance when skipBalance is set, we now only touch the balance if it's less than the transaction's cost (i.e. gasLimit *gasPrice + tx.value or maxFeePerGas * gasLimit + value if an EIP 1559 tx).

@jochem-brouwer
Copy link
Member

2 notes:

(1) this PR should be rebased/merge master (there is a conflict)

(2) I think we should add documentation about the behavior of skipBalance. The current documentation does not really explain what is going on;

/**
* If true, skips the balance check
*/
skipBalance?: boolean

/**
* Skip balance checks if true. Adds transaction value to balance to ensure execution doesn't fail.
*/
skipBalance?: boolean

@acolytec3
Copy link
Contributor Author

Closing and replacing with #2172

@holgerd77 holgerd77 deleted the adjust-skipbalance-logic branch March 2, 2023 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants