Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Migration from 1.8v to 4v caused Insufficient funds error #6249

Closed
@meri-maki

Description

@meri-maki

I have upgraded web3 and web3-eth from 1.8.0 to 4.0.2 (mostly because of less package size)
I've read the migration guide and, since I had quite a simple logic of connecting wallet + sending transaction, there was not much to change

I haven't changed anything in web3.eth.sendTransaction, but after updating I started getting this error for every single transaction (even though there are funds):

Returned error: err: insufficient funds for gas * price + value: address 0x568A33aA237fFc284FF584A3BAB17A44FAeF4054 have 61046238310789005 want 8879502456500000000 (supplied gas 500000000)

Here is the code for sendTransaction:

return web3.eth.sendTransaction({
						from: selectedAccount,
						to: window.toonAppData.address,
						data: "0x64edfbf0e2c706ba4a09595315c45355a341a576cc17f3a19f43ac1c02f814ee",
						value: web3.utils.toWei(amount, "ether"),
					})

I'm quite new to web3 and I'm not the one who wrote the initial code, but since I had to update wallet connect, this issue also appeared...

Environment

"devDependencies": {
"@babel/core": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.22.5",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"assert": "^2.0.0",
"autoprefixer": "^10.4.13",
"babel-loader": "^9.1.0",
"babel-preset-es2015": "^6.24.1",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^4.2.2",
"fs-extra": "^10.1.0",
"html-minimizer-webpack-plugin": "^4.3.0",
"html-webpack-plugin": "^5.5.0",
"https-browserify": "^1.0.0",
"less": "^4.1.3",
"less-loader": "^11.1.0",
"mini-css-extract-plugin": "^2.6.1",
"os-browserify": "^0.3.0",
"postcss-loader": "^7.0.1",
"process": "^0.11.10",
"sass": "^1.60.0",
"sass-loader": "^13.2.2",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"style-loader": "^3.3.1",
"url": "^0.11.0",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1"
},
"dependencies": {
"@metamask/detect-provider": "^2.0.0",
"@wagmi/core": "^1.3.3",
"@walletconnect/ethereum-provider": "^2.8.6",
"@web3modal/ethereum": "^2.6.2",
"@web3modal/html": "^2.6.2",
"browserify-zlib": "^0.2.0",
"path-browserify": "^1.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.10",
"viem": "^1.2.6",
"web3": "^4.0.2",
"web3-eth": "^4.0.2"
},

Metadata

Metadata

Assignees

Labels

4.x4.0 related

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions