-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Function 'sendSignedTransaction' changes the value of the 'to' field from 'null' to '0x' #2190
Comments
Hi, sorry just to clarify a part of your problem so you are having issues with your "to" field which is by default in ETH blockchain that 0x is a legit account that anyone who leaves the "to" empty will automatically send it to 0x (black hole). Therefore most of the contracts nowadays set |
This does no longer happen all the given parameters will be deep cloned. The defined object |
@nivida : Starting from which version of web3.js will this fix be available? Thanks https://github.com/ethereum/web3.js/releases/tag/v1.0.0-beta.39, I suppose? At least according to:
Well, v39 has at least one other problem that I've reported in the past (something about So I guess that v40 onward should do? |
I'm sorry, but this doesn't seem to be resolved even on version 1.2.1 (which was released long after you had closed this issue). I clearly see that function Specifically, I see that it changes the value of the It is clearly visible in your code, at file web3-eth-accounts/src/index.js / line 167:
There is obviously no deep cloning of the input object here, hence the lines that follow change it:
Thanks Update: I am guessing that perhaps the deep-cloning was meant to be done via:
If so, then here is how I have verified that this does not achieve the purpose:
The printout is:
|
2.0-alpha.x does have this implemented. We will back-port it to the old architecture asap. (Have a look at the release notes of 1.2.0 and the referenced blog post) |
Attempting to deploy a contract:
When the value of
gas
is too low, this function fails withbase fee exceeds gas limit
, which is fine.However, in the process, it updates the
options
object, namely:chainId
,gasPrice
,nonce
andvalue
.to
field fromnull
to"0x"
.As a result of the latter, any further attempt to call this function with the
options
object results with:This behavior is extremely undesired IMO (moreover, perhaps you should even consider not updating the
options
object altogether, but you should by the least avoid setting theto
field to an illegal value).Side note: I'm not sure if related to this problem, but the value of the (new)
value
field is also"0x"
.Thanks
The text was updated successfully, but these errors were encountered: