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

Internal Txs' gas limit default overpriced for eth transfers #8763

Closed
tmashuang opened this issue Jun 8, 2020 · 4 comments · Fixed by #8764
Closed

Internal Txs' gas limit default overpriced for eth transfers #8763

tmashuang opened this issue Jun 8, 2020 · 4 comments · Fixed by #8764

Comments

@tmashuang
Copy link
Contributor

Describe the bug
Internal transactions, transaction initiated within MetaMask(not dapps), are defaulting to 100,000 instead of a typical 21,000.

To Reproduce (REQUIRED)
Send a Tx within MetaMask(develop) as of this issue creation and edit gas, or have advanced gas control enabled, and see the gas limit default set to 100,00 on any network.

Expected behavior
Gas limit set to typical 21,000

Screenshots

Txs' Gas Limit 100,000 Default

Browser details (please complete the following information):
VM Ubuntu 18.04
Chrome 83.0.4103.61

@tmashuang tmashuang added the v8 label Jun 8, 2020
@tmashuang
Copy link
Contributor Author

tmashuang commented Jun 8, 2020

Seems the problem line is here

if (!sendToken && !data) {

I get sendToken = {} and data = undefined for simple send. Don't know if the sendToken param should be an object, but the solution can be simply checking if it's empty.

@Gudahtt
Copy link
Member

Gudahtt commented Jun 9, 2020

Any idea how sendToken was set to an object? I'm having trouble reproducing this.

@Gudahtt
Copy link
Member

Gudahtt commented Jun 9, 2020

Nevermind; I have reproduced it now. Curious - metamask.send.token is undefined, but sendToken is an empty object on that line 🤔

@Gudahtt
Copy link
Member

Gudahtt commented Jun 9, 2020

It looks like this line is responsible for setting it to an empty object:

Even prior to #8695, selectedToken was initialized to an empty object on that line as well. But the default wasn't actually set in that case, because when no token was selected, a null was returned by the getSelectedToken selector rather than undefined. The default parameter isn't used if the parameter is null. So #8695 is responsible for this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants