-
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
Correct way to send erc20 token with web3? #2017
Comments
Hi, I've never done this kind of thing the way you are doing. I always have an ERC20 contract that holds balances and has a transfer method. Just call that method. Done. Btw, I'm using web3.js and open-zeppelin for a while, always using the most recent versions (even the beta ones) and I never had problems. |
Hey @obernardovieira, yea just from one account to another. I have Metamask available but I initially thought it wasn't going to be necessary precisely because of the standard erc20
What version of web3 are you using? Token I'm testing with is with Zeppelin tech as well, using zOS |
web3-1.0.0-beta35 |
No with that example I'm getting the |
@medied In your |
@Aniket-Engg @obernardovieira thank you both for looking into this! I ended up upgrading web3 to 1.x.x and was able to get it working, safe to close this issue from my end |
|
Couple of similar issues are #1775 and #1151, but one difference is that I'm using web3 v0.20.7. I was initially going off of human-standard-token-abi docs (reading calls such as
balanceOf()
are working fine), then tried withsendTransaction()
directly. I'm getting the same error in both approaches though:Failed to load resource: the server responded with a status of 405 () [https://rinkeby.infura.io/v3/xxx] DEBUG - error in _sendToken web3Util.js:148 Error: Invalid JSON RPC response: ""
This is what the method looks like:
Any insight on what to try? What's the right way to do this with web3 v0.20.7
The text was updated successfully, but these errors were encountered: