I have setup and run a node locally in my system by using these commands
"./evmosd init test --chain-id=evmos_9000-6
./evmosd keys add t1
./evmosd add-genesis-account t1 1000000000000000000000000aevmos,1000000000000000000000000000stake
./evmosd gentx t1 1000000000000000000stake
./evmosd collect-gentxs
./evmosd validate-genesis
./evmosd start"
and able to add funds on evmos account. When I import that account on metamask through its private key, It added successfully and funds also shown there. But When I transfer the funds from one account to another through metamask it gives me an error like this:
[ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"code":-32000,"message":"tx gas (125677) exceeds block gas limit (0): out of gas: out of gas"}}}'
Metamask Error
Same error face on while deploying the contract with remix IDE. See the screenshot.
Contract Error
Evmos Metamask Funds
Any help will be highly appreciated.
While connecting metamask not able to transfer funds to another account
I have tried these methods:
-> When I send evmos tokens through terminal it successfully sent to another account.
-> If I send through metamask or Web3 js library its gives me this error
"[ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"code":-32000,"message":"tx gas (125677) exceeds block gas limit (0): out of gas: out of gas"}}}'"
I have enough faucets to transfer as you can see on above screenshot. I have used EVMOS v11.0.0
Related
I am trying to build a no-code tool for users, I want to be able to transfer tokens on the user's behalf.
anytime I call the IERC20(token address).approvefunction, my metamask does not a return a screen like the attached image and the IERC20(token address).transferFrom function does not execute.
Approve function
tps://i.stack.imgur.com/NfyMC.png
Calling approve() function from within your contract would just approve tokens to be spend from your contract address - not from the user.
You need to invoke MetaMask popup from your frontend app - not from the contract.
Either using their request method, requesting a transaction to the token contract, with data field of the approve() function and its arguments.
Or with more high-level approach: Creating a frontend instance of web3js, ethers.js, or whichever library you prefer, connecting to the window.ethereum local provider, and then invoking the approve() function on the token contract from here. This will also open the MetaMask popup windows asking the user to sign the transaction.
I'm using wallet connect for Eth transaction in my app.
but now need transact an ERC-20 token and don't know how do that
It has passed 8 months, but I'll answer.
You need to first approve on the sender side and do the transaction later. WalletConnect only uses Mainnet, so test it using https://test.walletconnect.org/ or first work on the Metamask testnets and apply to Walletconnect
I've noticed that anytime I want to test some token, I have to go into MetaMask and a load in the custom address off of etherscan, rather than using the provided tokens found within MetaMask. The picture above shows Dai (with the two Dai labels: the one provided by MetaMask and the one coming from the custom Dai address) within Rinkeby. However, this has been an issue for me whether it was dealing with other ERC20 tokens such as LINK or other networks (e.g. Ropsten and Kovan).
Could I be doing something incorrect when sending tokens? Are the provided token labels just for Mainnet?
I've cobbled together some code to send some tokens using web3.js 1.0.0-beta46 and then decided to try to send more token than I had in my wallet. to my great surprise the transaction send succeeded and I got a txid, but of course the transfer failed
here's the attempt (on Ropsten):
https://ropsten.etherscan.io/tx/0xaf2708dcc9b86b7cca0076e329a1e81fc28fdc4a97765b0a79544ec0685cfa69
now my question: how can I tell when the transfer succeeded? or for that matter how can I get the error message? etherscan merely indicates:
ERC-20 Token Transfer Error (Unable to locate Corresponding Transfer Event Logs), Check with Sender
The most simple and straightforward way would be to check the balances of sender and receiver before and after the transfer.
Now about the failed transfer, after reading the contract I noticed that in the event of insufficient funds you simple return false, which makes a valid transaction. What you should do is revert the transactions using require to make the checks. That way an invalid transaction will be reverted by the EVM which will be recognized by etherscan and show that the transaction failed.
I am trying to link an account that I created use geth with an instance of web3 that I'm running in a node repl. In order to add the account, I did the following:
1) I decrypted the JSON private key file created by Geth, in the MyEtherWallet tool.
2) Added the account with the command web3.eth.accounts.wallet.add(<private key>)
This seemed to work, but upon closer inspection, the address of the account that had been added differed from the address of the account.
Can anyone explain why this is happening, and what I need to do differently to add this specific account to web3 so that I can deploy contracts using that account?