New answers tagged

0

MetaMask is in line with this approach, it asks at first to the user to allow app (domain) to access their accounts, and then it asks for confirmation for each transaction sent. For the allowance it just ask once at the beginning for each domain, though. Are you testing this on a site you already approved the address for?


0

UPDATE: Could not figure what the problem was, so I deleted the MetaMask Chrome extension and re-installed it. Now it works fine.


0

Method #1. There's no way that method #2 will be faster, because method #1 is method #2 + a chance for the transaction to confirm earlier. If you send at 1pm a transaction with 10gwei/gas, if by chance there is low network activity, your transaction will get picked up. If not, anyway you will speed it up at 2pm, same as method #2. So you don't lose anything (...


1

Long story short is either you wait until the gas prices are realy low or you send some more ETH to make the transactions possible. Here you can check the gas prices - https://etherscan.io/gastracker On the picture above you can see the Low/Average/High price for the to type of transactions you are trying to do. Currently 1 ETH = 3,760.96$ and your 0....


0

I just tried obtaining some test ether from the site you posted and it was successful. You can try refreshing your wallet. Also ensure via the transaction ID, that it was successful


0

As you may have learned, Metamask cancels a transaction that has not been mined by replacing it with a transaction where you send 0 ETH to yourself. This method works for cancelling any transaction, including NFT minting transactions that have not been confirmed in a block. If you want to replace a transaction yourself by manually setting the nonce of your ...


0

Solved it by running yarn dev instead of yarn start Yarn start wasn't parsing/compiling the recently saved changes in VScode no idea why


0

To get the current network connection you could use its chainId. ethereum.request({ method: 'eth_chainId' })


0

Answer To The Question I have figured out a way to deal with this. The problem was the data was being saved correctly but when fetching the records solidity was assigning msg.sender to the creator of the contract not the one who sent the transaction. So, in order to deal with this I am sending the user address from frontend in the call function and receiving ...


0

To get a return value with Web3 from a solidity function you have one of two options: First, you can mark the function view, which means that function cannot update the state or ledger, and then the return value will be returned to Web3 when using call() Second, if your function updates state, then you can emit an event with the data you want to retrieve, ...


1

"Connecting" your wallet to a website does two things: It allows the website to know that you have a crypto wallet (implicitly) It gives the website your wallet's public address (explicitly) Once the website has your address, they can use it to read whatever information there is publicly available in the blockchain, for that address. One such ...


0

jQuery is a JavaScript library for DOM manipulation. jQuery is unrelated to MetaMask that interacts with JavaScript.


0

Two possible explanations. Chains You are probably using a different Ethereum chain. The id of the chain (or "network") you're connected to should be 1 if you want to interact with Ethereum Mainnet. See these links: How to select a network id or is there a list of network ids? Chainlist.Org Derivation Paths Otherwise, you may have used a ...


1

The CEX can only steal your tokens if you have either approved it to use your tokens or directly transferred your tokens to it. And if you have approved/transferred token A, it can't steal token B. Disconnecting your metamask from the site has little effect, since the "connection" doesn't give any special access to your wallet anyway - it basically ...


0

This official Metamask page explains that you need to press "create account" as if you were creating a new account 2, and the resulting account will actually be your existing account 2. Weird, but that's how it is. Also, there seems to be no way to automatically import all the tokens that were there in your old wallet install. So, unless you ...


0

here is the work around (https://www.myetherwallet.com) link the web3 metamask extension to the MEW website wallet... then of course set the same nonce and a higher gas. this will allow the transaction to enter the mempool with a duplicate nonce... then you just wait for it to be picked up by node. this just happened to me and took me 3 days to figure out. ...


1

As far as I can see, I don' see anywhere in your code the syntax where you're actually calling the method. You have the instance of the contract which is myCollectionbut you're not calling the function properly. instead of this: function updateCollection() { myCollection.getNumberObjects (function(errGNO, resGNO) { you can try this: let collection = ...


0

ok found out the settings for allowance of metamask to read your internet were off and when allowing it to connect to all sites the balances appeared in the account again and were accurate. still cannot log into the ox protocol which is scary cause that's where my coins are and commented on etherscan of pool activity but nothing back yet


0

You will need to instantiate the web3 object and cannot refer to a package here. from web3 import Web3, HTTPProvider w3 = Web3(Web3.HTTPProvider(<infura or alchemy URL>)) def verify(request, message, signedMessage): response = w3.geth.personal.ecRecover(message, signature) return HttpResponse(response, content_type='text/json')


0

This can be used if you have ethers.js active: let accounts = await provider.send("eth_requestAccounts", []); let account = accounts[0]; You can do this with MetaMask browsers, no ethers: const accounts = await ethereum.request({ method: 'eth_requestAccounts' }); const account = accounts[0]; account will be their address.Now, with Web3.js, here'...


0

If you want the user to pay with tokens. Your contract should look like this pragma solidity >=0.7.0 <0.9.0; import "@openzeppelin/contracts/tokens/ERC20/IERC20.sol" // npm install @openzeppelin-contracts required contract PaymentInvoiceSplit { uint productPrice; constructor (uint defaultProductPrice) { owner = msg.sender; ...


3

Your theory is correct. MetaMask sends a static (local) call to the contract. The call is the same as a real transaction, except 1) its state changes are not persisted 2) it doesn't cost any gas, since it doesn't send a transaction to the blockchain 3) is executed against your local node's data only. That way is not 100% accurate, but it's basically the best ...


0

You shouldn't be using web3.currentProvider anymore. This is the old way. Do this instead: if (window.ethereum) { web3 = new Web3(window.ethereum); } else { // Code for HttpProvider remains unchanged } await window.ethereum.send('eth_requestAccounts'); See How to Connect Web3.js to MetaMask in 2021


2

Both of your assumptions are correct. Message signing happens off chain, and is in fact required in order to send a transaction on the chain (through signing a transaction). To put a message on chain, you (or 1inch, ...) needs to actively send a transaction on chain including the signed message. A message signature is essentially just some binary data, so ...


0

ONe thing that maybe causing this issue The front sends 1 ether contractInstance.methods.betxc(x).send({value: web3.utils.toWei("1", "ether")}) and the contract when winning send twice that amount msg.sender.transfer(msg.value*2); For the transfer to succeed the contract needs to have a balance greater than 2 ether. Note: block....


1

I had same errors and I solved it now by raising the gas limit when sending transaction! I recommend you raise your gas limit and try it again.


0

You will not be able achieve this. Metamask is providing your browser with a web3 module that you can use to connect your app to the blockchain. The users will be able to connect to your app to sign transaction. In order to connect your app to the blockchain, you will need web3 or ethersjs. https://web3js.readthedocs.io/en/v1.5.2/getting-started.html https://...


0

All of the accounts that get created happen the exact same way each time you restore a wallet. Just keep hitting "new" until you get to however many account you had before and the account ids will all line up perfectly. Then you have to add whatever names you gave them by hand.


1

Connecting your wallet doesn't really do much: it doesn't send any transactions. About all it does it gives your wallet's public address to the website and the possibility for the website to request actions from the wallet - actions which you, as a user, need to accept manually. In theory, everything would be smoother and more user friendly if your wallet ...


0

Yes there is an official list. And here is an example implementation in Javascript JSON format: const METAMASK_POSSIBLE_ERRORS = { '-32700': { standard: 'JSON RPC 2.0', message: 'Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.', }, '-32600': { standard: 'JSON ...


0

Is it possible for attackers to hack a wallet without private keys and seed? No it is not possible. Ways to hack a mobile wallet User signing a wrong transaction: Do not interact with any portals from non-reputable and/or anonymous teams Ways to hack a desktop wallet Malware. trojan, etc. on a desktop computer


0

All errors thrown or returned by the MetaMask provider follow this interface: interface ProviderRpcError extends Error { message: string; code: number; data?: unknown; } The ethereum.request(args) method throws errors eagerly. You can often use the error code property to determine why the request failed. Common codes and their meaning include: 4001 : ...


2

As per the error message and logs it looks like you're passing invalid arguments --- (argument="address", value="1000000", code=INVALID_ARGUMENT, version=address/5.4.0) The address argument expects an address type argument, but you're passing a number (1000000) instead. (argument=null, value="1000000", code=INVALID_ARGUMENT, ...


1

TL:DR yes, you need two That's because the Web3Provider does not have the ganache accounts "connected". The Metamask account is the only signer. The JsonRpcProvider on the other hand has all the ganache accounts connected as signers. If you want to perform transactions using the ganache accounts using Metamask, you'll need to import their ...


0

a secret recovery phrase is generated using an hd wallet. Private keys are basically children of this phrase, but there's no way to go back to the parent having just the private key.


1

It uses web3.eth.estimateGas (https://web3js.readthedocs.io/en/v1.2.11/web3-eth.html), which basically runs the transaction locally and returns the amount of gas used. It's pretty good most of the times but it can definitely get it wrong. Not sure in which specific cases though.


0

We've fixed the problem by setting maxFeePerGas and maxPriorityFeePerGas on null contract.methods.methodName().send({ ... maxPriorityFeePerGas: null, maxFeePerGas: null, }); and for the last part - yes, amount needs to be multiplied on gas limit.


0

I was having a similar issue, I would consider using ethers (https://docs.ethers.io/v5/) instead of web3 as it's less buggy and the documentation is better. It was hard to see from your formatting but my solution for getting the balance is below: import { ethers } from "ethers"; const provider = new ethers.providers.Web3Provider(window.ethereum) ...


0

web3 is no longer available from MetaMask and you have to use the ethereum object to call personal_sign: const message = "Hello from Ethereum Stack Exchange!"; const accounts = await ethereum.request({ method: 'eth_requestAccounts' }); const account = accounts[0]; const signature = await ethereum.request({ method: 'personal_sign', params: [ message,...


0

ethereum.on('connect', (connectInfo) => { console.log("connected to wallet"); console.log(connectInfo); }); OR https://docs.metamask.io/guide/onboarding-library.html#getting-started


0

It's personal_sign now, not eth_personalSign. It has always been personal_sign, it's probably just a typo in the Metamask docs. const message = "Hello from Ethereum Stack Exchange!"; const accounts = await ethereum.request({ method: 'eth_requestAccounts' }); const account = accounts[0]; const signature = await ethereum.request({ method: '...


0

I wrote a post describing the process that led me to recover my wallet and i think you could use it to recover yours in a similar way. Ypu already have the file so i think you can skip to the last step where you decompress the data with snappy. After that you should be able to use the vault decryptor tool https://medium.com/@rubenfb14/lost-metamask-wallet-...


2

Metamask provides the ethereum object in your browser JS API to interact with the wallet. With that you can send transactions and interact with the chain. See https://docs.metamask.io/guide/ https://docs.metamask.io/guide/getting-started.html#basic-considerations Once MetaMask is installed and running, you should find that new browser tabs have a window....


Top 50 recent answers are included