Fix missing weiValue in transaction when estimating gas for payable function#2206
Merged
gtebrean merged 3 commits intoLFDT-web3j:mainfrom Nov 12, 2025
Merged
Fix missing weiValue in transaction when estimating gas for payable function#2206gtebrean merged 3 commits intoLFDT-web3j:mainfrom
gtebrean merged 3 commits intoLFDT-web3j:mainfrom
Conversation
…ble function Signed-off-by: liulinhui <1249055292@qq.com>
Signed-off-by: liulinhui <1249055292@qq.com>
Signed-off-by: liulinhui <1249055292@qq.com>
Contributor
|
I’ve tested this fix on Sepolia using a simple payable contract ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
to fix #1268
Fix an issue where the weiValue is not set in the constructed transaction during gas estimation for a payable function, which leads to failure.
Where should the reviewer start?
org.web3j.tx.Contract
Why is it needed?
When estimating gas for a payable function, the transaction must include the correct weiValue to reflect the actual call conditions. Without setting the weiValue, the gas estimation does not accurately represent a real invocation, and in many contracts, this leads to a revert or failure during the estimation phase.
This fix ensures the weiValue is properly included in the transaction used for gas estimation, which allows the estimation to succeed and reflect real execution costs.
Checklist